diff --git a/README.md b/README.md index e3c27494..0fb945ad 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Android 6.0+ devices rooted with [Magisk](https://github.com/topjohnwu/Magisk) 1. Download the zip from [GitHub release](https://github.com/RikkaApps/Riru/releases) 2. Install in Magisk Manager (Modules - Install from storage - Select downloaded zip) +**Before Magisk canary 21006, the first installation requires manual restart twice.** + ### Config * When the file `/data/adb/riru/disable` exists, Riru will do nothing diff --git a/app/src/main/java/moe/riru/manager/MainActivity.kt b/app/src/main/java/moe/riru/manager/MainActivity.kt index 67a8453d..8917db9f 100644 --- a/app/src/main/java/moe/riru/manager/MainActivity.kt +++ b/app/src/main/java/moe/riru/manager/MainActivity.kt @@ -30,7 +30,8 @@ class MainActivity : AppActivity() { val devRandomFile = SuFile.open("/data/adb/riru/dev_random") val devRandom = devRandomFile.readTextOrNull() if (devRandom == null) { - message.append("Riru not installed (or version < v22).") + message.append("Riru not installed (or version < v22).\n\n") + message.append("Before Magisk canary 21006, you will have to reboot twice to finish the first installation.") detail.append("$devRandomFile not exist") return } diff --git a/template/magisk_module/customize.sh b/template/magisk_module/customize.sh index 2b3e897c..e289d3fe 100644 --- a/template/magisk_module/customize.sh +++ b/template/magisk_module/customize.sh @@ -99,3 +99,11 @@ set_perm "$RIRU_PATH/api_version.new" 0 0 0600 $SECONTEXT ui_print "- Setting permissions" set_perm_recursive "$MODPATH" 0 0 0755 0644 + +# before Magisk 16e4c67, sepolicy.rule is copied on the second reboot +if [ "$MAGISK_VER_CODE" -lt 21006 ]; then + ui_print "*******************************" + ui_print "- Magisk version below 21006." + ui_print "- You have to manually reboot twice for the first installation." + ui_print "*******************************" +fi \ No newline at end of file