Update version gating

This commit is contained in:
topjohnwu 2022-06-01 03:01:56 -07:00
parent e029994ef8
commit 10b1782732
2 changed files with 2 additions and 1 deletions

View File

@ -30,6 +30,7 @@ object Const {
fun atLeast_21_2() = Info.env.versionCode >= 21200 || 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(ver: Int) = ver > 0 && ver % 100 != 0

View File

@ -26,7 +26,7 @@ class PolicyDao : MagiskDB() {
suspend fun update(policy: SuPolicy) {
val map = policy.toMap()
if (!Const.Version.isCanary()) {
if (!Const.Version.atLeast_25_0()) {
// Put in package_name for old database
map["package_name"] = AppContext.packageManager.getNameForUid(policy.uid)!!
}