Add info for MagiskHide when not using MagiskSU

Close #63
This commit is contained in:
topjohnwu 2017-02-05 22:30:14 +08:00
parent 845864679c
commit 9150bf720d
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package com.topjohnwu.magisk;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.ListPreference;
@ -182,9 +183,16 @@ public class SettingsActivity extends AppCompatActivity {
break;
case "magiskhide":
enabled = prefs.getBoolean("magiskhide", false);
if (enabled)
new Async.MagiskHide().enable();
else
if (enabled) {
if (!Global.Info.isSuClient) {
Utils.getAlertDialogBuilder(getActivity())
.setTitle(R.string.no_magisksu_title)
.setMessage(R.string.no_magisksu_msg)
.setPositiveButton(R.string.understand, (dialog, which) -> new Async.MagiskHide().enable())
.setCancelable(false)
.show();
} else new Async.MagiskHide().enable();
} else
new Async.MagiskHide().disable();
break;
case "hosts":

View File

@ -115,6 +115,9 @@
<string name="repo_cache_cleared">Repo cache cleared</string>
<string name="safetyNet_hide_notice">This app uses SafetyNet\nAlready handled by MagiskHide by default</string>
<string name="start_magiskhide">Starting MagiskHide …</string>
<string name="no_magisksu_title">Not using MagiskSU!</string>
<string name="no_magisksu_msg">You are not rooted with MagiskSU, using MagiskHide itself might not be enough!\nIt\'s not officially supported, and you would need additional tools (e.g suhide) to pass Safety Net.</string>
<string name="understand">I understand</string>
<!--URL Templates-->
<string name="url_main" translatable="false">https://api.github.com/orgs/Magisk-Modules-Repo/repos</string>