From 94d7ea9bb36a715557d8fdbf2fe758c46e920777 Mon Sep 17 00:00:00 2001 From: Tad Date: Sat, 22 Oct 2022 18:03:37 -0400 Subject: [PATCH] 20.0: fixup exec spawning toggle and also default disable it like 42c9d22d Signed-off-by: Tad --- .../android_frameworks_base/0018-Exec_Based_Spawning-1.patch | 4 ++-- .../android_frameworks_base/0018-Exec_Based_Spawning-12.patch | 2 +- .../android_frameworks_base/0018-Exec_Based_Spawning-2.patch | 4 ++-- .../0010-exec_spawning_toggle.patch | 4 ++-- PrebuiltApps | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch b/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch index 9bb48185..5ddfd0ad 100644 --- a/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch +++ b/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch @@ -161,7 +161,7 @@ index 993e4e7b4b3d..756547706f60 100644 } - if (parsedArgs.mInvokeWith != null || parsedArgs.mStartChildZygote -+ if (parsedArgs.mInvokeWith != null || SystemProperties.getBoolean("sys.spawn.exec", true) || parsedArgs.mStartChildZygote ++ if (parsedArgs.mInvokeWith != null || SystemProperties.getBoolean("sys.spawn.exec", false) || parsedArgs.mStartChildZygote || !multipleOK || peer.getUid() != Process.SYSTEM_UID) { // Continue using old code for now. TODO: Handle these cases in the other path. pid = Zygote.forkAndSpecialize(parsedArgs.mUid, parsedArgs.mGid, @@ -169,7 +169,7 @@ index 993e4e7b4b3d..756547706f60 100644 throw new IllegalStateException("WrapperInit.execApplication unexpectedly returned"); } else { if (!isZygote) { -+ if (SystemProperties.getBoolean("sys.spawn.exec", true)) { ++ if (SystemProperties.getBoolean("sys.spawn.exec", false)) { + ExecInit.execApplication(parsedArgs.mNiceName, parsedArgs.mTargetSdkVersion, + VMRuntime.getCurrentInstructionSet(), parsedArgs.mRemainingArgs); + diff --git a/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch b/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch index ea768388..778cb383 100644 --- a/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch +++ b/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch @@ -82,7 +82,7 @@ index 27518dd4cdce..a8d9400c7992 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java @@ -539,7 +539,7 @@ class ZygoteConnection { - if (SystemProperties.getBoolean("sys.spawn.exec", true) && + if (SystemProperties.getBoolean("sys.spawn.exec", false) && (parsedArgs.mRuntimeFlags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) { ExecInit.execApplication(parsedArgs.mNiceName, parsedArgs.mTargetSdkVersion, - VMRuntime.getCurrentInstructionSet(), parsedArgs.mRemainingArgs); diff --git a/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch b/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch index fc5a016e..ecfa657c 100644 --- a/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch +++ b/Patches/LineageOS-20.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch @@ -17,8 +17,8 @@ index 756547706f60..27518dd4cdce 100644 throw new IllegalStateException("WrapperInit.execApplication unexpectedly returned"); } else { if (!isZygote) { -- if (SystemProperties.getBoolean("sys.spawn.exec", true)) { -+ if (SystemProperties.getBoolean("sys.spawn.exec", true) && +- if (SystemProperties.getBoolean("sys.spawn.exec", false)) { ++ if (SystemProperties.getBoolean("sys.spawn.exec", false) && + (parsedArgs.mRuntimeFlags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) { ExecInit.execApplication(parsedArgs.mNiceName, parsedArgs.mTargetSdkVersion, VMRuntime.getCurrentInstructionSet(), parsedArgs.mRemainingArgs); diff --git a/Patches/LineageOS-20.0/android_packages_apps_Settings/0010-exec_spawning_toggle.patch b/Patches/LineageOS-20.0/android_packages_apps_Settings/0010-exec_spawning_toggle.patch index 68c4203f..4fec5ea0 100644 --- a/Patches/LineageOS-20.0/android_packages_apps_Settings/0010-exec_spawning_toggle.patch +++ b/Patches/LineageOS-20.0/android_packages_apps_Settings/0010-exec_spawning_toggle.patch @@ -89,7 +89,7 @@ index 0000000000..78f021210a +public class ExecSpawnPreferenceController extends AbstractPreferenceController + implements PreferenceControllerMixin, OnResume, Preference.OnPreferenceChangeListener { + -+ private static final String SYS_KEY_EXEC_SPAWN = "persist.security.exec_spawn"; ++ private static final String SYS_KEY_EXEC_SPAWN = "persist.security.exec_spawn_new"; + private static final String PREF_KEY_EXEC_SPAWN = "exec_spawn"; + private static final String PREF_KEY_SECURITY_CATEGORY = "security_category"; + @@ -129,7 +129,7 @@ index 0000000000..78f021210a + + if (mIsAdmin) { + mExecSpawn = (SwitchPreference) mSecurityCategory.findPreference(PREF_KEY_EXEC_SPAWN); -+ mExecSpawn.setChecked(SystemProperties.getBoolean(SYS_KEY_EXEC_SPAWN, true)); ++ mExecSpawn.setChecked(SystemProperties.getBoolean(SYS_KEY_EXEC_SPAWN, false)); + } else { + mSecurityCategory.removePreference(mSecurityCategory.findPreference(PREF_KEY_EXEC_SPAWN)); + } diff --git a/PrebuiltApps b/PrebuiltApps index e5fd92d1..073a081f 160000 --- a/PrebuiltApps +++ b/PrebuiltApps @@ -1 +1 @@ -Subproject commit e5fd92d14e918cf4db2a2b5f9284474914d0d353 +Subproject commit 073a081f055e3ef0e5a9153417b3bf0fd35d7105