Commit 9150bf72 authored by topjohnwu's avatar topjohnwu

Add info for MagiskHide when not using MagiskSU

Close #63
parent 84586467
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":
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment