mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 03:41:19 +08:00
Update Updater.kt (#209)
This commit is contained in:
@@ -3,13 +3,11 @@ package com.lt2333.simplicitytools.hook.app
|
|||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
||||||
import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull
|
import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
@@ -13,11 +12,15 @@ object Updater : AppRegister() {
|
||||||
object Updater : AppRegister() {
|
|
||||||
override val packageName: String = "com.android.updater"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
hasEnable("remove_ota_validate") {
|
hasEnable("remove_ota_validate") {
|
||||||
@@ -18,6 +16,15 @@ object Updater : AppRegister() {
|
|||||||
.firstOrNull { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 }
|
.firstOrNull { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 }
|
||||||
?.findMethod { name == "T" && returnType == Boolean::class.java }
|
?.findMethod { name == "T" && returnType == Boolean::class.java }
|
||||||
?.hookReturnConstant(false)
|
?.hookReturnConstant(false)
|
||||||
|
|
||||||
|
findMethod("miui.util.FeatureParser") {
|
||||||
|
name == "hasFeature" && parameterCount == 2
|
||||||
|
}.hookBefore {
|
||||||
|
if (it.args[0] == "support_ota_validate") {
|
||||||
|
it.result = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user