| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- --- a/AnyKernel3/anykernel.sh
- +++ b/AnyKernel3/anykernel.sh
- @@ -46,6 +46,48 @@
- $ksu_supported || abort " -> Non-GKI device, abort."
- +handle_input() {
- + /system/bin/getevent -lq 2>/dev/null | while IFS= read -r line; do
- + case "$line" in
- + *KEY_VOLUMEUP*DOWN*) echo "bypass"; break ;;
- + *KEY_VOLUMEDOWN*DOWN*) echo "normal"; break ;;
- + *KEY_POWER*DOWN*) echo "cancel"; break ;;
- + esac
- + done
- +}
- +
- +choose_flash_mode() {
- + ui_print " "
- + ui_print " -> Most users do not need Bypass; try Normal first!"
- + ui_print " -> This only swaps the Image for compatibility workarounds."
- + ui_print " -> VOL+ = Bypass | VOL- = Normal | POWER = Cancel"
- + ui_print " "
- +
- + while true; do
- + case $(handle_input) in
- + normal)
- + ui_print " -> Selected: Normal"
- + return 0
- + ;;
- + bypass)
- + ui_print " -> Selected: Bypass"
- + if [ -f "$AKHOME/Bypass-Image" ]; then
- + cp -f "$AKHOME/Bypass-Image" "$AKHOME/Image"
- + ui_print " -> Using Bypass-Image for this flash"
- + return 0
- + fi
- + abort " -> ERROR: Bypass-Image not found. Abort."
- + ;;
- + cancel)
- + abort " -> Cancelled by POWER button. Abort."
- + ;;
- + esac
- + done
- +}
- +
- +choose_flash_mode
- +
- # boot install
|