init: Do not set safety net props for ENG builds

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
Pranav Vashi 2021-10-22 04:07:18 +05:30 committed by DigiGoon
parent 37bf4cfa91
commit cbc854979e
2 changed files with 10 additions and 2 deletions

View file

@ -123,6 +123,7 @@ libinit_cc_defaults {
"-DREBOOT_BOOTLOADER_ON_PANIC=0",
"-DSHUTDOWN_ZERO_TIMEOUT=0",
"-DWORLD_WRITABLE_KMSG=0",
"-DSPOOF_SAFETYNET=1",
"-Wall",
"-Werror",
"-Wextra",
@ -150,6 +151,8 @@ libinit_cc_defaults {
cppflags: [
"-USHUTDOWN_ZERO_TIMEOUT",
"-DSHUTDOWN_ZERO_TIMEOUT=1",
"-USPOOF_SAFETYNET",
"-DSPOOF_SAFETYNET=0",
],
},
uml: {
@ -421,6 +424,7 @@ init_first_stage_cc_defaults {
"-DSHUTDOWN_ZERO_TIMEOUT=0",
"-DLOG_UEVENTS=0",
"-DSEPOLICY_VERSION=30", // TODO(jiyong): externalize the version number
"-DSPOOF_SAFETYNET=1",
],
product_variables: {
@ -450,6 +454,8 @@ init_first_stage_cc_defaults {
cflags: [
"-USHUTDOWN_ZERO_TIMEOUT",
"-DSHUTDOWN_ZERO_TIMEOUT=1",
"-USPOOF_SAFETYNET",
"-DSPOOF_SAFETYNET=0",
],
},
},

View file

@ -1463,9 +1463,11 @@ void PropertyInit() {
// checks pass. This needs to be done before parsing the kernel cmdline as
// these properties are read-only and will be set to invalid values with
// androidboot cmdline arguments.
if (SPOOF_SAFETYNET) {
if (!IsRecoveryMode()) {
SetSafetyNetProps();
}
}
// If arguments are passed both on the command line and in DT,
// properties set in DT always have priority over the command-line ones.