mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-05-29 21:10:15 +02:00
Bump min version to v22
This commit is contained in:
parent
10b1782732
commit
05e5ac2ad2
@ -25,10 +25,9 @@ object Const {
|
|||||||
val APP_IS_CANARY get() = Version.isCanary(BuildConfig.VERSION_CODE)
|
val APP_IS_CANARY get() = Version.isCanary(BuildConfig.VERSION_CODE)
|
||||||
|
|
||||||
object Version {
|
object Version {
|
||||||
const val MIN_VERSION = "v21.0"
|
const val MIN_VERSION = "v22.0"
|
||||||
const val MIN_VERCODE = 21000
|
const val MIN_VERCODE = 22000
|
||||||
|
|
||||||
fun atLeast_21_2() = Info.env.versionCode >= 21200 || isCanary()
|
|
||||||
fun atLeast_24_0() = Info.env.versionCode >= 24000 || isCanary()
|
fun atLeast_24_0() = Info.env.versionCode >= 24000 || isCanary()
|
||||||
fun atLeast_25_0() = Info.env.versionCode >= 25000 || isCanary()
|
fun atLeast_25_0() = Info.env.versionCode >= 25000 || isCanary()
|
||||||
fun isCanary() = isCanary(Info.env.versionCode)
|
fun isCanary() = isCanary(Info.env.versionCode)
|
||||||
|
@ -29,7 +29,6 @@ data class LocalModule(
|
|||||||
private val removeFile = RootUtils.fs.getFile(path, "remove")
|
private val removeFile = RootUtils.fs.getFile(path, "remove")
|
||||||
private val disableFile = RootUtils.fs.getFile(path, "disable")
|
private val disableFile = RootUtils.fs.getFile(path, "disable")
|
||||||
private val updateFile = RootUtils.fs.getFile(path, "update")
|
private val updateFile = RootUtils.fs.getFile(path, "update")
|
||||||
private val ruleFile = RootUtils.fs.getFile(path, "sepolicy.rule")
|
|
||||||
private val riruFolder = RootUtils.fs.getFile(path, "riru")
|
private val riruFolder = RootUtils.fs.getFile(path, "riru")
|
||||||
private val zygiskFolder = RootUtils.fs.getFile(path, "zygisk")
|
private val zygiskFolder = RootUtils.fs.getFile(path, "zygisk")
|
||||||
private val unloaded = RootUtils.fs.getFile(zygiskFolder, "unloaded")
|
private val unloaded = RootUtils.fs.getFile(zygiskFolder, "unloaded")
|
||||||
@ -42,19 +41,12 @@ data class LocalModule(
|
|||||||
var enable: Boolean
|
var enable: Boolean
|
||||||
get() = !disableFile.exists()
|
get() = !disableFile.exists()
|
||||||
set(enable) {
|
set(enable) {
|
||||||
val dir = "$PERSIST/$id"
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
disableFile.delete()
|
disableFile.delete()
|
||||||
if (Const.Version.atLeast_21_2())
|
Shell.cmd("copy_sepolicy_rules").submit()
|
||||||
Shell.cmd("copy_sepolicy_rules").submit()
|
|
||||||
else
|
|
||||||
Shell.cmd("mkdir -p $dir", "cp -af $ruleFile $dir").submit()
|
|
||||||
} else {
|
} else {
|
||||||
!disableFile.createNewFile()
|
!disableFile.createNewFile()
|
||||||
if (Const.Version.atLeast_21_2())
|
Shell.cmd("copy_sepolicy_rules").submit()
|
||||||
Shell.cmd("copy_sepolicy_rules").submit()
|
|
||||||
else
|
|
||||||
Shell.cmd("rm -rf $dir").submit()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,16 +56,10 @@ data class LocalModule(
|
|||||||
if (remove) {
|
if (remove) {
|
||||||
if (updateFile.exists()) return
|
if (updateFile.exists()) return
|
||||||
removeFile.createNewFile()
|
removeFile.createNewFile()
|
||||||
if (Const.Version.atLeast_21_2())
|
Shell.cmd("copy_sepolicy_rules").submit()
|
||||||
Shell.cmd("copy_sepolicy_rules").submit()
|
|
||||||
else
|
|
||||||
Shell.cmd("rm -rf $PERSIST/$id").submit()
|
|
||||||
} else {
|
} else {
|
||||||
removeFile.delete()
|
removeFile.delete()
|
||||||
if (Const.Version.atLeast_21_2())
|
Shell.cmd("copy_sepolicy_rules").submit()
|
||||||
Shell.cmd("copy_sepolicy_rules").submit()
|
|
||||||
else
|
|
||||||
Shell.cmd("cp -af $ruleFile $PERSIST/$id").submit()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user