Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 35fecf5

Browse files
committed
Add a specific message when magisk is not installed.
1 parent c9669c1 commit 35fecf5

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

app/src/main/java/com/fox2code/mmm/NotificationType.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ public boolean shouldRemove() {
3232
return !MainApplication.isShowcaseMode();
3333
}
3434
},
35-
NO_ROOT(R.string.fail_root_magisk, R.drawable.ic_baseline_numbers_24, v -> {
36-
IntentHelper.openUrl(v.getContext(), "https://github.com/topjohnwu/Magisk/blob/master/docs/install.md");
37-
}) {
35+
NO_MAGISK(R.string.fail_magisk_missing, R.drawable.ic_baseline_numbers_24, v ->
36+
IntentHelper.openUrl(v.getContext(),
37+
"https://github.com/topjohnwu/Magisk/blob/master/docs/install.md")) {
38+
@Override
39+
public boolean shouldRemove() {
40+
return InstallerInitializer.getErrorNotification() != this;
41+
}
42+
},
43+
NO_ROOT(R.string.fail_root_magisk, R.drawable.ic_baseline_numbers_24) {
3844
@Override
3945
public boolean shouldRemove() {
4046
return InstallerInitializer.getErrorNotification() != this;

app/src/main/java/com/fox2code/mmm/installer/InstallerInitializer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public static NotificationType getErrorNotification() {
4848
hasRoot != Boolean.FALSE) {
4949
return null;
5050
}
51-
if (hasRoot != Boolean.TRUE && HAS_MAGISK) {
51+
if (!HAS_MAGISK) {
52+
return NotificationType.NO_MAGISK;
53+
} else if (hasRoot != Boolean.TRUE) {
5254
return NotificationType.ROOT_DENIED;
5355
}
5456
return NotificationType.NO_ROOT;

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<string name="app_name_short">Fox\'s Mmm</string>
44
<string name="fail_root_magisk">Could not access either Root or Magisk</string>
55
<string name="fail_root_denied">Root has been denied via the Magisk app</string>
6+
<string name="fail_magisk_missing">Magisk is not installed on this device</string>
67
<string name="loading">Loading…</string>
78
<string name="updatable">Upgradable</string>
89
<string name="installed">Installed</string>

0 commit comments

Comments
 (0)