Commit 10b17827 authored by topjohnwu's avatar topjohnwu

Update version gating

parent e029994e
...@@ -30,6 +30,7 @@ object Const { ...@@ -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() { ...@@ -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)!!
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment