diff --git a/app/src/main/java/com/devadvance/rootcloak2/NativeRootDetection.java b/app/src/main/java/com/devadvance/rootcloak2/NativeRootDetection.java index 7279df0..9f6df81 100644 --- a/app/src/main/java/com/devadvance/rootcloak2/NativeRootDetection.java +++ b/app/src/main/java/com/devadvance/rootcloak2/NativeRootDetection.java @@ -41,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState) { .setSharedPreferencesMode(MODE_WORLD_READABLE); addPreferencesFromResource(R.xml.native_root_detection); mPrefs = PreferenceManager.getDefaultSharedPreferences(this); - + Preference uninstallLibrary = findPreference("uninstall_library"); uninstallLibrary.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override @@ -74,7 +74,7 @@ public void onClick(DialogInterface dialog, int id) { reloadAppsList(); } - + @Override protected void onResume() { mRootShell = new RootUtil(); @@ -85,7 +85,13 @@ protected void onResume() { public void installLibrary() { String library = getApplicationInfo().nativeLibraryDir + File.separator + "librootcloak.so"; - if (!mRootShell.isSU() || !new File(library).exists()) { + if (!mRootShell.isSU()) { + Toast.makeText(this, R.string.library_no_root, Toast.LENGTH_LONG).show(); + finish(); + return; + } + + if (!new File(library).exists()) { Toast.makeText(this, R.string.library_installation_failed, Toast.LENGTH_LONG).show(); finish(); return; @@ -189,7 +195,7 @@ public boolean onPreferenceChange( Set newSetting = (Set) newValue; oldSetting.removeAll(newSetting); mPrefs.edit().putStringSet("reset_native_root_detection_apps", oldSetting).apply(); - + Intent refreshApps = new Intent(Common.REFRESH_APPS_INTENT); sendBroadcast(refreshApps); return true; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eb16bdc..c434076 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -75,5 +75,6 @@ Manage Keywords Manage Commands App Launcher Icon + Root permission denied