mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-22 23:08:30 +00:00
Update version gating
This commit is contained in:
parent
e029994ef8
commit
10b1782732
@ -30,6 +30,7 @@ object Const {
|
|||||||
|
|
||||||
fun atLeast_21_2() = Info.env.versionCode >= 21200 || isCanary()
|
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 isCanary() = isCanary(Info.env.versionCode)
|
fun isCanary() = isCanary(Info.env.versionCode)
|
||||||
|
|
||||||
fun isCanary(ver: Int) = ver > 0 && ver % 100 != 0
|
fun isCanary(ver: Int) = ver > 0 && ver % 100 != 0
|
||||||
|
@ -26,7 +26,7 @@ class PolicyDao : MagiskDB() {
|
|||||||
|
|
||||||
suspend fun update(policy: SuPolicy) {
|
suspend fun update(policy: SuPolicy) {
|
||||||
val map = policy.toMap()
|
val map = policy.toMap()
|
||||||
if (!Const.Version.isCanary()) {
|
if (!Const.Version.atLeast_25_0()) {
|
||||||
// Put in package_name for old database
|
// Put in package_name for old database
|
||||||
map["package_name"] = AppContext.packageManager.getNameForUid(policy.uid)!!
|
map["package_name"] = AppContext.packageManager.getNameForUid(policy.uid)!!
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user