Replace cmdline to pass SafetyNet (no SN Issues allowed)

Userspace parses this and sets the ro.boot.verifiedbootstate prop
according to the value that this flag has. When ro.boot.verifiedbootstate
is not 'green', SafetyNet is tripped and fails the CTS test.

Change verifiedbootstate from /proc/cmdline in order to fix the failed
SafetyNet CTS check.
This commit is contained in:
Jim Wu 2020-03-30 11:20:22 +08:00
parent dc1fa7ee2d
commit 55d5e5481f
1 changed files with 11 additions and 11 deletions

View File

@ -133,13 +133,9 @@ start_log_cather () {
chmod -R 666 "${LOG_PATH}"
}
start_verbose_log_catcher () {
start_log_cather all "EdXposed:V XSharedPreferences:V EdXposed-Bridge:V EdXposedManager:V XposedInstaller:V" true ${LOG_VERBOSE}
}
start_bridge_log_catcher () {
start_log_cather error "XSharedPreferences:V EdXposed-Bridge:V" true true
}
# Replace cmdline to pass SafetyNet, i think you should replace device fingerprint (use SafetyPatch or MagiskHideProps module) too
cat "/proc/cmdline" | sed 's/orange/green/i' | sed 's/yellow/green/i' | sed 's/unlocked/locked/i' > "${MODDIR}/cmdline"
mount -o bind "${MODDIR}/cmdline" "/proc/cmdline"
# Backup app_process to avoid bootloop caused by original Xposed replacement in Android Oreo
# TODO: Magisk mount replace
@ -158,13 +154,17 @@ if [[ ${NO_MANAGER} == true ]]; then
rm -rf /data/local/tmp/EdXposed.apk
fi
start_verbose_log_catcher
start_bridge_log_catcher
# execute live patch if rule not found
[[ -f "${MODDIR}/sepolicy.rule" ]] || sepolicy
# start_verbose_log_catcher
start_log_cather all "EdXposed:V XSharedPreferences:V EdXposed-Bridge:V EdXposedManager:V XposedInstaller:V" true ${LOG_VERBOSE}
# start_bridge_log_catcher
start_log_cather error "XSharedPreferences:V EdXposed-Bridge:V" true true
[[ -d "${TARGET}" ]] || mkdir -p "${TARGET}"
cp "${MODDIR}/module.prop" "${TARGET}/module.prop"
[[ -f "${MODDIR}/sepolicy.rule" ]] || sepolicy
chcon -R u:object_r:system_file:s0 "${MODDIR}"