3030import de .robv .android .xposed .callbacks .XC_LoadPackage .LoadPackageParam ;
3131import de .robv .android .xposed .callbacks .XCallback ;
3232
33-
3433import static de .robv .android .xposed .XposedHelpers .findAndHookMethod ;
3534import static de .robv .android .xposed .XposedHelpers .findConstructorExact ;
3635
@@ -49,10 +48,6 @@ public class RootCloak implements IXposedHookLoadPackage {
4948 public void handleLoadPackage (final LoadPackageParam lpparam ) throws Throwable {
5049 isRootCloakLoadingPref = true ;
5150 Set <String > tmpAppSet = loadSetFromPrefs (Common .APPS ); // Load prefs for any app. This way we can determine if it matches the list of apps to hide root from.
52- // if (debugPref) {
53- // XposedBridge.log("Found app: " + lpparam.packageName);
54- // }
55-
5651 if (!(tmpAppSet .contains (lpparam .packageName ))) { // If the app doesn't match, don't hook into anything, and just return.
5752 isRootCloakLoadingPref = false ;
5853 } else {
@@ -248,7 +243,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable { // Ho
248243 }
249244
250245 List <ApplicationInfo > packages = (List <ApplicationInfo >) param .getResult (); // Get the results from the method call
251- Iterator <ApplicationInfo > iter = packages .iterator ();
246+ Iterator <ApplicationInfo > iter = packages .iterator ();
252247 ApplicationInfo tempAppInfo ;
253248 String tempPackageName ;
254249
@@ -540,7 +535,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
540535 }
541536 }
542537 });
543-
538+
544539 /**
545540 * Hooks loadLibrary() within java.lang.Runtime.
546541 * There are libraries specifically built to check for root. This helps us block those and others.
@@ -613,7 +608,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
613608 XposedBridge .log ("Hooked ADB debugging info, adb status is off" );
614609 }
615610 }
616-
611+
617612 if (Settings .Global .DEVELOPMENT_SETTINGS_ENABLED .equals (setting )) { // Hide development options being on from an app
618613 param .setResult (0 );
619614 if (debugPref ) {
@@ -625,7 +620,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
625620 }
626621
627622 private void initSettings () {
628- final XSharedPreferences prefSettings = new XSharedPreferences (Common . PACKAGE_NAME , Common .PREFS_SETTINGS );
623+ final XSharedPreferences prefSettings = new XSharedPreferences (BuildConfig . APPLICATION_ID , Common .PREFS_SETTINGS );
629624 prefSettings .makeWorldReadable ();
630625 debugPref = prefSettings .getBoolean (Common .DEBUG_KEY , false );
631626 }
@@ -642,7 +637,7 @@ private static Set<String> loadSetFromPrefs(Common.PrefSet type) {
642637
643638 final Set <String > newSet = new HashSet <>();
644639 try {
645- final XSharedPreferences loadedPrefs = new XSharedPreferences (Common . PACKAGE_NAME , type .getPrefKey ());
640+ final XSharedPreferences loadedPrefs = new XSharedPreferences (BuildConfig . APPLICATION_ID , type .getPrefKey ());
646641 loadedPrefs .makeWorldReadable ();
647642
648643 final boolean isFirstRun = loadedPrefs .getBoolean (Common .FIRST_RUN_KEY , true ); // Load boolean that determines if this is the first run since being installed.
0 commit comments