From 5ce29c30d2cc8c5ec3538e325e8eaa893268ee64 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 10 Jan 2021 20:16:02 -0800 Subject: [PATCH] Fix sepolicy copying --- app/src/main/java/com/topjohnwu/magisk/core/Const.kt | 2 +- .../com/topjohnwu/magisk/core/model/module/LocalModule.kt | 8 ++++---- app/src/main/res/raw/changelog.md | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/Const.kt b/app/src/main/java/com/topjohnwu/magisk/core/Const.kt index 3d56b47dd..b5e91f1b4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/Const.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/Const.kt @@ -25,6 +25,7 @@ object Const { fun atLeast_20_2() = Info.env.magiskVersionCode >= 20200 || isCanary() fun atLeast_20_4() = Info.env.magiskVersionCode >= 20400 || isCanary() fun atLeast_21_0() = Info.env.magiskVersionCode >= 21000 || isCanary() + fun atLeast_21_2() = Info.env.magiskVersionCode >= 21200 || isCanary() fun isCanary() = Info.env.magiskVersionCode % 100 != 0 } @@ -36,7 +37,6 @@ object Const { // notifications const val MAGISK_UPDATE_NOTIFICATION_ID = 4 const val APK_UPDATE_NOTIFICATION_ID = 5 - const val HIDE_MANAGER_NOTIFICATION_ID = 8 const val UPDATE_NOTIFICATION_CHANNEL = "update" const val PROGRESS_NOTIFICATION_CHANNEL = "progress" const val CHECK_MAGISK_UPDATE_WORKER_ID = "magisk_update" diff --git a/app/src/main/java/com/topjohnwu/magisk/core/model/module/LocalModule.kt b/app/src/main/java/com/topjohnwu/magisk/core/model/module/LocalModule.kt index a69ec0a9e..59b7a7639 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/model/module/LocalModule.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/model/module/LocalModule.kt @@ -27,13 +27,13 @@ class LocalModule(path: String) : Module() { val dir = "$PERSIST/$id" if (enable) { disableFile.delete() - if (Const.Version.isCanary()) + if (Const.Version.atLeast_21_2()) Shell.su("copy_sepolicy_rules").submit() else Shell.su("mkdir -p $dir", "cp -af $ruleFile $dir").submit() } else { !disableFile.createNewFile() - if (Const.Version.isCanary()) + if (Const.Version.atLeast_21_2()) Shell.su("copy_sepolicy_rules").submit() else Shell.su("rm -rf $dir").submit() @@ -45,13 +45,13 @@ class LocalModule(path: String) : Module() { set(remove) { if (remove) { removeFile.createNewFile() - if (Const.Version.isCanary()) + if (Const.Version.atLeast_21_2()) Shell.su("copy_sepolicy_rules").submit() else Shell.su("rm -rf $PERSIST/$id").submit() } else { !removeFile.delete() - if (Const.Version.isCanary()) + if (Const.Version.atLeast_21_2()) Shell.su("copy_sepolicy_rules").submit() else Shell.su("cp -af $ruleFile $PERSIST/$id").submit() diff --git a/app/src/main/res/raw/changelog.md b/app/src/main/res/raw/changelog.md index f2ab9bcd7..69a61d178 100644 --- a/app/src/main/res/raw/changelog.md +++ b/app/src/main/res/raw/changelog.md @@ -1,3 +1,7 @@ +## v8.0.5 + +- Fix sepolicy rule copying + ## v8.0.4 - A lot of stability changes and minor bug fixes