@@ -127,8 +127,6 @@ unset -f _log_path_setter || true
127127readonly LOG_PATH
128128export LOG_PATH
129129
130- export KEYCHECK_ENABLED=' false'
131-
132130# ## FUNCTIONS ###
133131
134132_send_text_to_recovery ()
@@ -282,18 +280,6 @@ package_extract_file()
282280 }
283281}
284282
285- package_extract_file_may_fail ()
286- {
287- {
288- unzip -o -p -qq " ${ZIPFILE:? } " " ${1:? } " 1> " ${2:? } " && test -s " ${2:? } "
289- } ||
290- {
291- rm -f -- " ${2:? } " || true
292- ui_debug " Failed to extract the file '${1} ' from this archive"
293- return 1
294- }
295- }
296-
297283package_extract_file_safe ()
298284{
299285 " ${OUR_BB} " unzip -opq " ${ZIPFILE:? } " " ${1:? } " 1> " ${2:? } " || ui_error " Failed to extract the file '${1} ' from this archive" 83
@@ -342,7 +328,7 @@ detect_recovery_arch()
342328detect_recovery_arch
343329
344330OUR_BB=" ${BASE_TMP_PATH:? } /busybox"
345- if test -n " ${CUSTOM_BUSYBOX: - } " && test -e " ${CUSTOM_BUSYBOX:? } " ; then
331+ if test -n " ${CUSTOM_BUSYBOX-} " && test -x " ${CUSTOM_BUSYBOX:? } " ; then
346332 OUR_BB=" ${CUSTOM_BUSYBOX:? } "
347333 ui_debug " Using custom BusyBox... '${OUR_BB:? } '"
348334elif test " ${RECOVERY_ARCH} " = ' x86_64' ; then
@@ -354,16 +340,14 @@ elif test "${RECOVERY_ARCH}" = 'x86'; then
354340elif test " ${RECOVERY_ARCH} " = ' arm64-v8a' ; then
355341 ui_debug ' Extracting 64-bit ARM BusyBox...'
356342 package_extract_file ' misc/busybox/busybox-arm64.bin' " ${OUR_BB:? } "
357- package_extract_file_may_fail ' misc/keycheck/keycheck-arm.bin' " ${BASE_TMP_PATH:? } /keycheck"
358343elif test " ${RECOVERY_ARCH} " = ' armeabi-v7a' || test " ${RECOVERY_ARCH} " = ' armeabi' ; then
359344 ui_debug ' Extracting ARM BusyBox...'
360345 package_extract_file ' misc/busybox/busybox-arm.bin' " ${OUR_BB:? } "
361- package_extract_file_may_fail ' misc/keycheck/keycheck-arm.bin' " ${BASE_TMP_PATH:? } /keycheck"
362346fi
363- if ! test -e " ${OUR_BB:? } " ; then ui_error ' BusyBox not found' ; fi
347+ if test ! -e " ${OUR_BB:? } " ; then ui_error ' BusyBox not found' ; fi
364348
365349# Give execution rights (if needed)
366- if test -z " ${CUSTOM_BUSYBOX: - } " || test " ${OUR_BB:? } " ! = " ${CUSTOM_BUSYBOX:? } " ; then
350+ if test -z " ${CUSTOM_BUSYBOX-} " || test " ${OUR_BB:? } " ! = " ${CUSTOM_BUSYBOX:? } " ; then
367351 # Legacy versions of chmod don't support +x and --
368352 chmod 0755 " ${OUR_BB:? } " || ui_error " chmod failed on '${OUR_BB:? } '" # Needed to make working the "safe" functions
369353fi
@@ -423,25 +407,10 @@ DEBUG_LOG="$(_get_common_setting 'DEBUG_LOG' "${DEBUG_LOG:-0}")"
423407test " ${DEBUG_LOG:? } " -ne 0 && enable_debug_log # Enable file logging if needed
424408
425409LIVE_SETUP_ALLOWED=" ${LIVE_SETUP_ALLOWED:- true} "
426- KEYCHECK_PATH=' '
427- if test " ${TEST_INSTALL:- false} " ! = ' false' ; then
428- " ${OUR_BB:? } " rm -f " ${BASE_TMP_PATH:? } /keycheck" || ui_error " Failed to remove keycheck"
429- else
430- # Setup Keycheck in the temp folder
431- if test -e " ${BASE_TMP_PATH:? } /keycheck" ; then
432- KEYCHECK_PATH=" ${TMP_PATH:? } /bin/keycheck"
433- " ${OUR_BB:? } " mv -f " ${BASE_TMP_PATH:? } /keycheck" " ${KEYCHECK_PATH:? } " || ui_error " Failed to move keycheck to the bin folder"
434- # Give execution rights
435- " ${OUR_BB:? } " chmod 0755 " ${KEYCHECK_PATH:? } " || ui_error " chmod failed on keycheck"
436- export KEYCHECK_ENABLED=' true'
437- fi
438- fi
439-
440- # Live setup under continuous integration systems doesn't make sense
441- if test " ${CI:- false} " ! = ' false' ; then LIVE_SETUP_ALLOWED=' false' ; fi
410+ if test " ${CI:- false} " ! = ' false' ; then LIVE_SETUP_ALLOWED=' false' ; fi # Live setup under continuous integration systems doesn't make sense
442411
443- readonly LIVE_SETUP_ALLOWED KEYCHECK_PATH
444- export LIVE_SETUP_ALLOWED KEYCHECK_PATH
412+ readonly LIVE_SETUP_ALLOWED
413+ export LIVE_SETUP_ALLOWED
445414
446415# Extract scripts
447416ui_debug ' Extracting scripts...'
0 commit comments