[DNM] init: Spoof build type property to user

Also set release-keys and disable `ro.debuggable`. Avoids "root"
detection in some banking-related apps whilst having the convenience
of userdebug builds, such as adb root or permissive selinux.

Avoid this in eng build to keep necessary debugging intact.

Change-Id: I78ec5abe4db8083c0e02157c0bcd1a3d99fb9a5d
This commit is contained in:
Adithya R 2023-01-26 14:39:32 +05:30
parent 62be9a675d
commit d46c1bffa9
2 changed files with 7 additions and 0 deletions

View File

@ -153,6 +153,7 @@ libinit_cc_defaults {
},
eng: {
cppflags: [
"-DENG_BUILD",
"-USHUTDOWN_ZERO_TIMEOUT",
"-DSHUTDOWN_ZERO_TIMEOUT=1",
],

View File

@ -1366,6 +1366,12 @@ static void SetSafetyNetProps() {
InitPropertySet("ro.boot.verifiedbootstate", "green");
InitPropertySet("ro.boot.veritymode", "enforcing");
InitPropertySet("ro.build.tags", "release-keys");
#ifndef ENG_BUILD
// Spoof non-eng builds (such as userdebug) to user
InitPropertySet("ro.build.type", "user");
InitPropertySet("ro.debuggable", "0");
#endif
}
void PropertyInit() {