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

View file

@ -1463,8 +1463,10 @@ void PropertyInit() {
// checks pass. This needs to be done before parsing the kernel cmdline as // 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 // these properties are read-only and will be set to invalid values with
// androidboot cmdline arguments. // androidboot cmdline arguments.
if (!IsRecoveryMode()) { if (SPOOF_SAFETYNET) {
SetSafetyNetProps(); if (!IsRecoveryMode()) {
SetSafetyNetProps();
}
} }
// If arguments are passed both on the command line and in DT, // If arguments are passed both on the command line and in DT,