diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java b/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java index d3490ff7b..48fd82378 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java @@ -46,6 +46,9 @@ import java9.util.stream.StreamSupport; public class ApplicationAdapter extends SectionedAdapter { + private static final String SAFETYNET_PROCESS = "com.google.android.gms.unstable"; + private static final String GMS_PACKAGE = "com.google.android.gms"; + /* A list of apps that should not be shown as hide-able */ private static final List HIDE_BLACKLIST = Arrays.asList( App.self.getPackageName(), @@ -57,8 +60,10 @@ public class ApplicationAdapter extends SectionedAdapter "com.android.webview", "com.google.android.webview" ); - private static final String SAFETYNET_PROCESS = "com.google.android.gms.unstable"; - private static final String GMS_PACKAGE = "com.google.android.gms"; + private static final List DEFAULT_HIDELIST = Arrays.asList( + GMS_PACKAGE, + SAFETYNET_PROCESS + ); private static int BOTTOM_MARGIN = -1; @@ -197,7 +202,7 @@ public class ApplicationAdapter extends SectionedAdapter private void setHide(boolean add, HideAppInfo app, HideProcessInfo process) { // Don't remove SafetyNet - if (!add && process.name.equals(SAFETYNET_PROCESS)) + if (!add && DEFAULT_HIDELIST.contains(process.name)) return; Shell.su(Utils.fmt("magiskhide --%s %s %s", add ? "add" : "rm", app.info.packageName, process.name)).submit(); diff --git a/native/jni/magiskhide/hide_utils.cpp b/native/jni/magiskhide/hide_utils.cpp index 4166847c8..97dbfde97 100644 --- a/native/jni/magiskhide/hide_utils.cpp +++ b/native/jni/magiskhide/hide_utils.cpp @@ -232,6 +232,7 @@ bool init_list() { // Add SafetyNet by default rm_list(SAFETYNET_COMPONENT); rm_list(SAFETYNET_PROCESS); + init_list(SAFETYNET_PKG, SAFETYNET_PKG); init_list(SAFETYNET_PKG, SAFETYNET_PROCESS); init_list(MICROG_SAFETYNET, SAFETYNET_PROCESS);