Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -74,7 +74,7 @@ public void onClick(DialogInterface dialog, int id) {

reloadAppsList();
}

@Override
protected void onResume() {
mRootShell = new RootUtil();
Expand All @@ -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;
Expand Down Expand Up @@ -189,7 +195,7 @@ public boolean onPreferenceChange(
Set<String> newSetting = (Set<String>) 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;
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@
<string name="manage_keywords">Manage Keywords</string>
<string name="manage_commands">Manage Commands</string>
<string name="app_launcher_icon">App Launcher Icon</string>
<string name="library_no_root">Root permission denied</string>

</resources>