From 95ded3aae0db641ed47bfa1a7f69301013813a6f Mon Sep 17 00:00:00 2001 From: hosizoraru Date: Wed, 20 Sep 2023 17:27:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84de?= =?UTF-8?q?xkit=E6=97=A7=E7=89=88=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hook/hooks/cloudservice/Widevine.kt | 11 --- .../voyager/hook/hooks/guardprovider/Anti2.kt | 8 -- .../guardprovider/AntiDefraudAppManager.kt | 5 - .../hook/hooks/mediaeditor/DeviceShell2.kt | 4 - .../hooks/multipackage/CustomRefreshRate.kt | 28 ------ .../hook/hooks/multipackage/SuperClipboard.kt | 14 +-- .../hooks/packageinstaller/AllAsSystemApp.kt | 13 --- .../packageinstaller/DisableSafeModelTip.kt | 4 - .../BlurPersonalAssistant.kt | 4 - .../ModifyScreenRecorderConfig.kt | 3 - .../hook/hooks/screenshot/SaveAsPng.kt | 23 ++--- .../hooks/securitycenter/CameraFaceTracker.kt | 7 +- .../securitycenter/DynamicPerformance.kt | 9 -- .../hooks/securitycenter/EnhanceContours.kt | 14 --- .../securitycenter/GameBoxVisionEnhance.kt | 52 +--------- .../hook/hooks/securitycenter/GameTurbo.kt | 99 +------------------ .../hook/hooks/securitycenter/GunService.kt | 8 -- .../hooks/securitycenter/LockOneHundred.kt | 4 - .../voyager/hook/hooks/securitycenter/MEMC.kt | 8 -- .../hook/hooks/securitycenter/Macro.kt | 40 -------- .../securitycenter/OpenByDefaultSetting.kt | 8 -- .../hooks/securitycenter/PrivacyCamera.kt | 31 ------ .../hook/hooks/securitycenter/Report.kt | 5 - .../hook/hooks/securitycenter/RiskPkg.kt | 5 - .../hook/hooks/securitycenter/ScreenHoldOn.kt | 4 - .../hooks/securitycenter/SuperResolution.kt | 14 --- .../hook/hooks/securitycenter/VcbAbility.kt | 4 - .../voyager/hook/hooks/settings/HpLocation.kt | 8 -- .../voyager/hook/hooks/weather/MoreCard.kt | 7 -- 29 files changed, 14 insertions(+), 430 deletions(-) diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/cloudservice/Widevine.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/cloudservice/Widevine.kt index a5f6d98..8c4a170 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/cloudservice/Widevine.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/cloudservice/Widevine.kt @@ -8,18 +8,7 @@ import star.sky.voyager.utils.voyager.DexKitS.addUsingStringsEquals import star.sky.voyager.utils.yife.DexKit.dexKitBridge object Widevine : HookRegister() { - // private var cache: Map = emptyMap() private val WideVineL1 by lazy { -// val versionCode = -// getLoadPackageParam().getAppVersionCode() -// val method = cache[versionCode] ?: -// dexKitBridge.findMethodUsingString { -// usingString = "persist.vendor.sys.pay.widevine" -// matchType = MatchType.FULL -// }.firstOrNull()?.getMethodInstance(classLoader) -// ?: throw IllegalStateException("Method not found") -// cache = cache.plus(versionCode to method) -// method dexKitBridge.findMethod { matcher { addUsingStringsEquals("persist.vendor.sys.pay.widevine") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/Anti2.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/Anti2.kt index 7e3e211..7b31656 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/Anti2.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/Anti2.kt @@ -9,10 +9,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object Anti2 : HookRegister() { private val region by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "ro.miui.customized.region" -// matchType = MatchType.FULL -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("ro.miui.customized.region") @@ -21,10 +17,6 @@ object Anti2 : HookRegister() { } private val detect by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "https://flash.sec.miui.com/detect/app" -// matchType = MatchType.FULL -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("https://flash.sec.miui.com/detect/app") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/AntiDefraudAppManager.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/AntiDefraudAppManager.kt index 6efabc5..da7dcaa 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/AntiDefraudAppManager.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/guardprovider/AntiDefraudAppManager.kt @@ -20,9 +20,6 @@ class AntiDefraudAppManager : IXposedHookLoadPackage { "https://flash.sec.miui.com/detect/app" ), ) -// val resultMap = dexKitBridge.batchFindMethodsUsingStrings { -// queryMap(map) -// } val result = dexKitBridge.findMethod { matcher { addUsingStringsEquals( @@ -31,8 +28,6 @@ class AntiDefraudAppManager : IXposedHookLoadPackage { ) } } -// val antiDefraudAppManager = resultMap["AntiDefraudAppManager"]!! -// assert(antiDefraudAppManager.size == 1) val antiDefraudAppManagerDescriptor = result.first() val antiDefraudAppManagerMethod: Method = antiDefraudAppManagerDescriptor.getMethodInstance(lpparam.classLoader) diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/mediaeditor/DeviceShell2.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/mediaeditor/DeviceShell2.kt index d8ae2ef..2241cc8 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/mediaeditor/DeviceShell2.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/mediaeditor/DeviceShell2.kt @@ -20,10 +20,6 @@ object DeviceShell2 : HookRegister() { getString("device_shell_s2", "raphael") } private val partial by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "from_partial_screenshot" -// matchType = MatchType.FULL -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("from_partial_screenshot") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/CustomRefreshRate.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/CustomRefreshRate.kt index c68e0ae..ee75b1f 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/CustomRefreshRate.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/CustomRefreshRate.kt @@ -30,40 +30,12 @@ object CustomRefreshRate : HookRegister() { setObject(param.thisObject, "mIsCustomFpsSwitch", "true") } } -// dexKitBridge.batchFindMethodsUsingStrings { -// addQuery("qwq0", setOf("custom_mode_switch", "fucSwitch")) -// matchType = MatchType.FULL -// }.forEach { (_, methods) -> -// methods.filter { it.isMethod }.map { -// it.getMethodInstance(safeClassLoader).createHook { -// before { param -> -// setObject(param.thisObject, "mIsCustomFpsSwitch", "true") -//// setObject(param.thisObject, "fucSwitch", true) -//// val qwq = -//// getObjectOrNull( -//// param.thisObject, -//// "mIsCustomFpsSwitch" -//// ) -//// Log.i("hook mIsCustomFpsSwitch success, its:$qwq") -// } -// } -// } -// } } "com.xiaomi.misettings" -> { val refreshRateActivity = loadClass("com.xiaomi.misettings.display.RefreshRate.RefreshRateActivity") -// dexKitBridge.findMethodUsingString { -// usingString = "btn_preferce_category" -// matchType = MatchType.FULL -// }.single().getMethodInstance(classLoader).createHook { -// before { -// it.args[0] = true -// } -// } - dexKitBridge.findMethod { matcher { addUsingStringsEquals("btn_preferce_category") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/SuperClipboard.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/SuperClipboard.kt index 7c2c7cb..7610e62 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/SuperClipboard.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/multipackage/SuperClipboard.kt @@ -68,11 +68,6 @@ object SuperClipboard : HookRegister() { private fun dexKitSuperClipboard() { val ro by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "ro.miui.support_super_clipboard" -// matchType = MatchType.FULL -// methodReturnType = "boolean" -// }.firstOrNull()?.getMethodInstance(safeClassLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("ro.miui.support_super_clipboard") @@ -82,11 +77,6 @@ object SuperClipboard : HookRegister() { } val sys by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "persist.sys.support_super_clipboard" -// matchType = MatchType.FULL -// methodReturnType = "boolean" -// }.firstOrNull()?.getMethodInstance(safeClassLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("persist.sys.support_super_clipboard") @@ -123,7 +113,7 @@ object SuperClipboard : HookRegister() { .filter { name in setOf("isPcSupport", "isRegisterCapability", "supportMail", "supportTel") }.toList().createHooks { - returnConstant(true) - } + returnConstant(true) + } } } \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/AllAsSystemApp.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/AllAsSystemApp.kt index 9d44dbb..f9a41f5 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/AllAsSystemApp.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/AllAsSystemApp.kt @@ -12,7 +12,6 @@ object AllAsSystemApp : HookRegister() { private val systemMethod by lazy { dexKitBridge.findMethod { matcher { -// parameterTypes = listOf("Landroid/content/pm/ApplicationInfo;") paramTypes = listOf("android.content.pm.ApplicationInfo") returnType = "boolean" } @@ -20,19 +19,7 @@ object AllAsSystemApp : HookRegister() { } override fun init() = hasEnable("all_as_system_app") { -// dexKitBridge.findMethod { -// methodParamTypes = arrayOf("Landroid/content/pm/ApplicationInfo;") -// methodReturnType = "boolean" -// }.forEach { -// it.getMethodInstance(safeClassLoader).createHook { -// before { param -> -// (param.args[0] as ApplicationInfo).flags = -// (param.args[0] as ApplicationInfo).flags.or(ApplicationInfo.FLAG_SYSTEM) //// Log.i("看看行不行,被叫方法:" + param.method.declaringClass + "." + param.method.name) -// } -//// returnConstant(true) -// } -// } systemMethod.createHooks { before { param -> diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/DisableSafeModelTip.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/DisableSafeModelTip.kt index f29d011..0b1b494 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/DisableSafeModelTip.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/packageinstaller/DisableSafeModelTip.kt @@ -13,10 +13,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object DisableSafeModelTip : HookRegister() { private val MiuiSettingsAd by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "android.provider.MiuiSettings\$Ad" -// matchType = MatchType.FULL -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("android.provider.MiuiSettings\$Ad") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/personalassistant/BlurPersonalAssistant.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/personalassistant/BlurPersonalAssistant.kt index 5f384a7..d33feef 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/personalassistant/BlurPersonalAssistant.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/personalassistant/BlurPersonalAssistant.kt @@ -16,10 +16,6 @@ object BlurPersonalAssistant : HookRegister() { getInt("blur_personal_assistant_radius", 80) } private val ScrollStateManager by lazy { -// dexKitBridge.batchFindMethodsUsingStrings { -// addQuery("qwq", setOf("ScrollStateManager", "Manager must be init before using")) -// matchType = MatchType.FULL -// }.firstNotNullOf { (_, methods) -> methods.firstOrNull() }.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals( diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenrecorder/ModifyScreenRecorderConfig.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenrecorder/ModifyScreenRecorderConfig.kt index 0658649..b4f703d 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenrecorder/ModifyScreenRecorderConfig.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenrecorder/ModifyScreenRecorderConfig.kt @@ -36,9 +36,6 @@ object ModifyScreenRecorderConfig : HookRegister() { } } -// dexKitBridge.findMethodUsingString { -// usingString = "defaultBitRate = " -// } dexKitBridge.findMethod { matcher { usingStrings = listOf("defaultBitRate = ") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenshot/SaveAsPng.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenshot/SaveAsPng.kt index b428c14..45a36fc 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenshot/SaveAsPng.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/screenshot/SaveAsPng.kt @@ -74,10 +74,6 @@ object SaveAsPng : HookRegister() { } } -// dexKitBridge.batchFindMethodsUsingStrings { -// addQuery("qwq", setOf("context", "bitmap", "uri", "format")) -// matchType = MatchType.FULL -// } dexKitBridge.findMethod { matcher { addUsingStringsEquals( @@ -85,22 +81,19 @@ object SaveAsPng : HookRegister() { ) } }.forEach { -// (_, methods) -> -// methods -// it.map { - val pngMethod = it.getMethodInstance(classLoader) - (pngMethod.returnType == Boolean::class.java && pngMethod.paramCount == 7).apply { - pngMethod.createHook { - after { param -> - val compress = - Bitmap.CompressFormat.PNG + val pngMethod = it.getMethodInstance(classLoader) + (pngMethod.returnType == Boolean::class.java && pngMethod.paramCount == 7).apply { + pngMethod.createHook { + after { param -> + val compress = + Bitmap.CompressFormat.PNG // Log.i("qwq!!!!: ${param.args[4]}") - param.args[4] = compress + param.args[4] = compress // Log.i("qwq!!!!: ${param.args[4]}") - } } } } + } // } // loadClass("com.miui.screenshot.u0.f\$a").methodFinder() diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/CameraFaceTracker.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/CameraFaceTracker.kt index 33bf486..f84f4c5 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/CameraFaceTracker.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/CameraFaceTracker.kt @@ -15,13 +15,8 @@ object CameraFaceTracker : HookRegister() { } }.firstOrNull()?.getMethodInstance(classLoader) } + override fun init() = hasEnable("camera_face_tracker") { -// dexKitBridge.findMethodUsingString { -// usingString = "persist.vendor.camera.facetracker.support" -// matchType = MatchType.FULL -// }.single().getMethodInstance(classLoader).createHook { -// returnConstant(true) -// } tracker?.createHook { returnConstant(true) } diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/DynamicPerformance.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/DynamicPerformance.kt index 235abe2..8917880 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/DynamicPerformance.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/DynamicPerformance.kt @@ -9,10 +9,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object DynamicPerformance : HookRegister() { private val d by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "persist.sys.smartop.support_dynamic_performance" -// matchType = MatchType.FULL -// }.firstOrNull()?.getMethodInstance(classLoader)!! dexKitBridge.findMethod { matcher { addUsingStringsEquals( @@ -23,11 +19,6 @@ object DynamicPerformance : HookRegister() { } private val c by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = d.declaringClass.name -// usingString = "PREF_KEY_DYNAMIC_PERFORMANCE_SWITCH" -// methodReturnType = d.returnType.name -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals( diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/EnhanceContours.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/EnhanceContours.kt index 2c81d0a..2b09992 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/EnhanceContours.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/EnhanceContours.kt @@ -14,18 +14,9 @@ object EnhanceContours : HookRegister() { usingStrings = listOf("ro.vendor.media.video.frc.support") } }.forEach { - -// } -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq", setOf("ro.vendor.media.video.frc.support")) -// }.forEach { (_, classes) -> -// classes.map { val qaq = it.getClassInstance(classLoader) var counter = 0 dexKitBridge.findMethod { -// methodDeclareClass = qaq.name -// methodReturnType = "boolean" -// methodParamTypes = arrayOf("java.lang.String") matcher { declaredClass = qaq.name returnType = "boolean" @@ -45,10 +36,6 @@ object EnhanceContours : HookRegister() { declaredClass = qaq.name } }.first().getMethodInstance(classLoader) -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = qaq.name -// usingString = "debug.config.media.video.ais.support" -// }.single().getMethodInstance(classLoader) val newChar = tat.name.toCharArray() for (i in newChar.indices) { newChar[i]++ @@ -60,6 +47,5 @@ object EnhanceContours : HookRegister() { returnConstant(true) } } -// } } } \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameBoxVisionEnhance.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameBoxVisionEnhance.kt index 6c6305c..fe1b409 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameBoxVisionEnhance.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameBoxVisionEnhance.kt @@ -13,8 +13,7 @@ object GameBoxVisionEnhance : HookRegister() { private val gameBoxVisionEnhanceUtilsCls by lazy { loadClass("com.miui.gamebooster.utils.GameBoxVisionEnhanceUtils") } - // private lateinit var u: Method -// private lateinit var l6g: Class<*> + private val l6g by lazy { dexKitBridge.findClass { matcher { @@ -23,7 +22,6 @@ object GameBoxVisionEnhance : HookRegister() { }.first().getInstance(classLoader) } - // private lateinit var g: Method private val g by lazy { l6g.methodFinder() .filterByParamCount(3) @@ -33,19 +31,9 @@ object GameBoxVisionEnhance : HookRegister() { private val invokeMethod by lazy { dexKitBridge.findMethod { matcher { -// declaredClass = l6g.name -// name = g.name -// returnType = g.returnType.name declaredClass = gameBoxVisionEnhanceUtilsCls.name returnType = "boolean" paramTypes = emptyList() -// addInvoke { -//// declaredClass = gameBoxVisionEnhanceUtilsCls.name -//// returnType = "boolean" -// declaredClass = l6g.name -// name = g.name -//// returnType = g.returnType.name -// } addCall { declaredClass = l6g.name returnType = g.returnType.name @@ -53,46 +41,10 @@ object GameBoxVisionEnhance : HookRegister() { } }.map { it.getMethodInstance(classLoader) } } - override fun init() = hasEnable("game_box_vision_enhance") { -// gameBoxVisionEnhanceUtilsCls.methodFinder() -// .filterByReturnType(Boolean::class.java) -// .filterByParamCount(0) -// .toList().forEach { method1 -> -// if (method1.isStatic) { -// u = method1 -// } -// } - -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq1", setOf("GBToolsFunctionManager")) -// matchType = MatchType.FULL -// }.forEach { (_, classes1) -> -// classes1.map { -// l6g = it.getClassInstance(classLoader) -// } -// } - -// g = l6g.methodFinder() -// .filterByParamCount(3) -// .first() -// Log.i("qwq!!!: $invokeMethod") + override fun init() = hasEnable("game_box_vision_enhance") { invokeMethod.createHooks { returnConstant(true) } - -// dexKitBridge.findMethodInvoking { -// methodDeclareClass = l6g.name -// methodName = g.name -// methodReturnType = g.returnType.name -// beInvokedMethodDeclareClass = gameBoxVisionEnhanceUtilsCls.name -// beInvokedMethodReturnType = "boolean" -// }.forEach { (_, method2) -> -// method2.map { -// it.getMethodInstance(classLoader).createHook { -// returnConstant(true) -// } -// } -// } } } \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameTurbo.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameTurbo.kt index 535200a..38ad783 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameTurbo.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GameTurbo.kt @@ -10,10 +10,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object GameTurbo : HookRegister() { private val GameBoosterFeatureUtilsCls by lazy { -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq1", setOf("GameBoosterFeatureUtils")) -// matchType = MatchType.FULL -// }.firstNotNullOf { (_, classes1) -> classes1.firstOrNull() } dexKitBridge.findClass { matcher { addUsingStringsEquals("GameBoosterFeatureUtils") @@ -22,11 +18,6 @@ object GameTurbo : HookRegister() { } private val G by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "support_network_rps_mode" -// matchType = MatchType.FULL -// }.single().getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("support_network_rps_mode") @@ -36,12 +27,6 @@ object GameTurbo : HookRegister() { } private val h0 by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "grus" -// matchType = MatchType.FULL -// }.single { it.isMethod && it.getMethodInstance(classLoader) != G } -// .getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { declaredClass = GameBoosterFeatureUtilsCls.name @@ -52,15 +37,6 @@ object GameTurbo : HookRegister() { } private val k by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "cepheus" -// matchType = MatchType.FULL -// }.single { -// it.isMethod && -// it.getMethodInstance(classLoader) != G && -// it.getMethodInstance(classLoader) != h0 -// }.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { declaredClass = GameBoosterFeatureUtilsCls.name @@ -74,11 +50,6 @@ object GameTurbo : HookRegister() { } private val F by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "support_wifi_low_latency_mode" -// matchType = MatchType.FULL -// }.single().getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("support_wifi_low_latency_mode") @@ -88,11 +59,6 @@ object GameTurbo : HookRegister() { } private val PQ by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "support_touchfeature_gamemode" -// matchType = MatchType.FULL -// }.map { it.getMethodInstance(classLoader) } dexKitBridge.findMethod { matcher { declaredClass = GameBoosterFeatureUtilsCls.name @@ -102,11 +68,6 @@ object GameTurbo : HookRegister() { } private val l by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "com.xiaomi.aiasst.vision" -// matchType = MatchType.FULL -// }.single().getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { declaredClass = GameBoosterFeatureUtilsCls.name @@ -116,11 +77,6 @@ object GameTurbo : HookRegister() { } private val M by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "ro.vendor.fps.switch.default" -// matchType = MatchType.FULL -// }.single().getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { declaredClass = GameBoosterFeatureUtilsCls.name @@ -130,11 +86,6 @@ object GameTurbo : HookRegister() { } private val i by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "isEnhancedDsdaSupported" -// matchType = MatchType.FULL -// }.single().getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { declaredClass = GameBoosterFeatureUtilsCls.name @@ -184,52 +135,4 @@ object GameTurbo : HookRegister() { ) ) } -} - -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "grus" -// matchType = MatchType.FULL -// }.filter { it.isMethod }.forEach { -// val methods1 = -// it.getMethodInstance(classLoader) -// if (methods1 != G) h0 = methods1 -// } - -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "cepheus" -// matchType = MatchType.FULL -// }.filter { it.isMethod }.forEach { -// val methods2 = -// it.getMethodInstance(classLoader) -// if (methods2 != G && methods2 != h0) k = methods2 -// } - -//Log.i("Cls: $GameBoosterFeatureUtilsCls") -//Log.i("G: $G") -//Log.i("h0: $h0") -//Log.i("k: $k") -//Log.i("F: $F") -//Log.i("l: $l") -//Log.i("M: $M") -//Log.i("i: $i") -//Log.i("PQ: $PQ") -//Log.i("Gh0: $Gh0") -//Log.i("Gh0k: $Gh0k") - -// private val Gh0 by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "grus" -// matchType = MatchType.FULL -// }.filter { it.isMethod }.map { it.getMethodInstance(classLoader) } -// } -// -// private val Gh0k by lazy { -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = GameBoosterFeatureUtilsCls.name -// usingString = "cepheus" -// matchType = MatchType.FULL -// }.filter { it.isMethod }.map { it.getMethodInstance(classLoader) } -// } \ No newline at end of file +} \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GunService.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GunService.kt index e199302..a609937 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GunService.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/GunService.kt @@ -8,10 +8,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object GunService : HookRegister() { override fun init() = hasEnable("gun_service") { -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq", setOf("gb_game_collimator_status")) -// }.forEach { (_, classes) -> -// classes dexKitBridge.findClass { matcher { usingStrings = listOf("gb_game_collimator_status") @@ -19,9 +15,6 @@ object GunService : HookRegister() { }.map { val qaq = it.getInstance(classLoader) dexKitBridge.findMethod { -// methodDeclareClass = qaq.name -// methodReturnType = "boolean" -// methodParamTypes = arrayOf("java.lang.String") matcher { declaredClass = qaq.name returnType = "boolean" @@ -31,6 +24,5 @@ object GunService : HookRegister() { returnConstant(true) } } -// } } } \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/LockOneHundred.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/LockOneHundred.kt index 78bd5f5..9ab1cce 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/LockOneHundred.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/LockOneHundred.kt @@ -12,10 +12,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object LockOneHundred : HookRegister() { private val score by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "getMinusPredictScore" -// matchType = MatchType.CONTAINS -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingString("getMinusPredictScore", StringMatchType.Contains) diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/MEMC.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/MEMC.kt index 7fdc674..b160895 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/MEMC.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/MEMC.kt @@ -8,10 +8,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object MEMC : HookRegister() { override fun init() = hasEnable("MEMC") { -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq", setOf("ro.vendor.media.video.frc.support")) -// }.forEach { (_, classes) -> -// classes dexKitBridge.findClass { matcher { usingStrings = listOf("ro.vendor.media.video.frc.support") @@ -20,9 +16,6 @@ object MEMC : HookRegister() { val qaq = it.getInstance(classLoader) var counter = 0 dexKitBridge.findMethod { -// methodDeclareClass = qaq.name -// methodReturnType = "boolean" -// methodParamTypes = arrayOf("java.lang.String") matcher { declaredClass = qaq.name returnType = "boolean" @@ -37,6 +30,5 @@ object MEMC : HookRegister() { } } } -// } } } \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Macro.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Macro.kt index 34283c5..de46c5b 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Macro.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Macro.kt @@ -9,19 +9,9 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object Macro : HookRegister() { override fun init() = hasEnable("macro_combo") { -// dexKitBridge.findMethodUsingString { -// usingString = "pref_gb_unsupport_macro_apps" -// methodParamTypes = arrayOf("Ljava/util/ArrayList;") -// methodReturnType = "void" -// }.single().getMethodInstance(classLoader).createHook { -// before { -// it.result = ArrayList() -// } -// } dexKitBridge.findMethod { matcher { usingStrings = listOf("pref_gb_unsupport_macro_apps") -// parameterTypes = listOf("Ljava/util/ArrayList;") paramTypes = listOf("java.util.ArrayList") returnType = "void" } @@ -31,20 +21,6 @@ object Macro : HookRegister() { } } -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery( -// "qwq1", -// setOf("com.netease.sky.mi") -// ) -// }.forEach { (_, classes1) -> -// classes1.single().getClassInstance(classLoader).methodFinder() -// .filterByReturnType(Boolean::class.java) -// .filterByParamCount(1) -// .first().createHook { -// returnConstant(false) -// } -// } - dexKitBridge.findClass { matcher { usingStrings = listOf("com.netease.sky.mi") @@ -67,21 +43,5 @@ object Macro : HookRegister() { .first().createHook { returnConstant(true) } - -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery( -// "qwq2", -// setOf( -// "content://com.xiaomi.macro.MacroStatusProvider/game_macro_change" -// ) -// ) -// }.forEach { (_, classes2) -> -// classes2.single().getClassInstance(classLoader).methodFinder() -// .filterByReturnType(Boolean::class.java) -// .filterByParamCount(2) -// .first().createHook { -// returnConstant(true) -// } -// } } } \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/OpenByDefaultSetting.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/OpenByDefaultSetting.kt index 4d758ee..d8cf843 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/OpenByDefaultSetting.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/OpenByDefaultSetting.kt @@ -67,17 +67,9 @@ object OpenByDefaultSetting : HookRegister() { } } -// dexKitBridge.findMethodUsingString { -// usingString = "enter_way" -// matchType = MatchType.CONTAINS -// methodDeclareClass = "Lcom/miui/appmanager/ApplicationsDetailsActivity;" -// methodReturnType = "void" -//// methodParamTypes = arrayOf("", "Ljava/lang/Boolean;") -// } dexKitBridge.findMethod { matcher { addUsingString("enter_way", StringMatchType.Contains) -// declaredClass = "Lcom/miui/appmanager/ApplicationsDetailsActivity;" declaredClass = "com.miui.appmanager.ApplicationsDetailsActivity" returnType = "void" // parameterTypes = listOf("", "Ljava/lang/Boolean;") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/PrivacyCamera.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/PrivacyCamera.kt index b203bcd..8738a27 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/PrivacyCamera.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/PrivacyCamera.kt @@ -11,9 +11,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object PrivacyCamera : HookRegister() { private val privateCls by lazy { -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq", setOf("persist.sys.privacy_camera")) -// }.firstNotNullOf { (_, classes1) -> classes1.firstOrNull() } dexKitBridge.findClass { matcher { usingStrings = listOf("persist.sys.privacy_camera") @@ -22,10 +19,6 @@ object PrivacyCamera : HookRegister() { } private val R0 by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "persist.sys.privacy_camera" -// matchType = MatchType.FULL -// }.first().getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals("persist.sys.privacy_camera") @@ -37,13 +30,9 @@ object PrivacyCamera : HookRegister() { dexKitBridge.findMethod { matcher { declaredClass = privateCls.name -// returnType = R0.returnType.name -// parameterTypes = listOf(R0.parameterTypes[0].name) paramTypes = emptyList() returnType = "boolean" addInvoke { -// parameterTypes = emptyList() -// returnType = "boolean" returnType = R0.returnType.name paramTypes = listOf(R0.parameterTypes[0].name) declaredClass = privateCls.name @@ -59,26 +48,6 @@ object PrivacyCamera : HookRegister() { } } -// Log.i("cls name: ${privateCls.name}") -// Log.i("R0 name: ${R0.name}") -// Log.i("R0 return type: ${R0.returnType.name}") -// Log.i("R0 parameter type: ${R0.parameterTypes[0].name}") - -// dexKitBridge.findMethodInvoking { -// methodDeclareClass = privateCls.name -// methodReturnType = R0.returnType.name -// methodParameterTypes = arrayOf(R0.parameterTypes[0].name) -// beInvokedMethodParameterTypes = null -// beInvokedMethodReturnType = "boolean" -// beInvokedMethodDeclareClass = privateCls.name -// }.forEach { (_, method1) -> -// method1.map { it1 -> -// it1.getMethodInstance(classLoader).createHook { -// returnConstant(true) -// } -// } -// } - invokeMethod.createHooks { returnConstant(true) } diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Report.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Report.kt index fd49f6a..d595955 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Report.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/Report.kt @@ -9,11 +9,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object Report : HookRegister() { private val report by lazy { -// dexKitBridge.batchFindMethodsUsingStrings { -// addQuery("qwq", setOf("android.intent.action.VIEW", "com.xiaomi.market")) -// matchType = MatchType.FULL -// }.map { (_, methods) -> methods }.flatten().map { it.getMethodInstance(classLoader) } -// .toList() dexKitBridge.findMethod { matcher { addUsingStringsEquals("android.intent.action.VIEW", "com.xiaomi.market") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/RiskPkg.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/RiskPkg.kt index ff73326..65b3460 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/RiskPkg.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/RiskPkg.kt @@ -9,11 +9,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object RiskPkg : HookRegister() { private val pkg by lazy { -// dexKitBridge.batchFindMethodsUsingStrings { -// addQuery("qwq", setOf("riskPkgList", "key_virus_pkg_list", "show_virus_notification")) -// matchType = MatchType.FULL -// }.map { (_, methods) -> methods }.flatten().map { it.getMethodInstance(classLoader) } -// .toList() dexKitBridge.findMethod { matcher { addUsingStringsEquals( diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/ScreenHoldOn.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/ScreenHoldOn.kt index ac0c4f8..f9b1e76 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/ScreenHoldOn.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/ScreenHoldOn.kt @@ -8,10 +8,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object ScreenHoldOn : HookRegister() { private val screen by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "remove_screen_off_hold_on" -// methodReturnType = "boolean" -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { usingStrings = listOf("remove_screen_off_hold_on") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/SuperResolution.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/SuperResolution.kt index b6cac35..30214ce 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/SuperResolution.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/SuperResolution.kt @@ -8,10 +8,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object SuperResolution : HookRegister() { override fun init() = hasEnable("super_resolution") { -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq", setOf("ro.vendor.media.video.frc.support")) -// }.forEach { (_, classes) -> -// classes dexKitBridge.findClass { matcher { usingStrings = listOf("ro.vendor.media.video.frc.support") @@ -20,9 +16,6 @@ object SuperResolution : HookRegister() { val qaq = it.getInstance(classLoader) var counter = 0 dexKitBridge.findMethod { -// methodDeclareClass = qaq.name -// methodReturnType = "boolean" -// methodParamTypes = arrayOf("java.lang.String") matcher { declaredClass = qaq.name returnType = "boolean" @@ -36,12 +29,6 @@ object SuperResolution : HookRegister() { } } } -// dexKitBridge.findMethodUsingString { -// methodDeclareClass = qaq.name -// usingString = "debug.config.media.video.ais.support" -// }.single().getMethodInstance(classLoader).createHook { -// returnConstant(true) -// } dexKitBridge.findMethod { matcher { declaredClass = qaq.name @@ -51,6 +38,5 @@ object SuperResolution : HookRegister() { returnConstant(true) } } -// } } } \ No newline at end of file diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/VcbAbility.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/VcbAbility.kt index 2f3e0b9..70ce207 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/VcbAbility.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/securitycenter/VcbAbility.kt @@ -9,10 +9,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object VcbAbility : HookRegister() { private val vcb by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "persist.vendor.vcb.ability" -// matchType = MatchType.FULL -// }.firstOrNull()?.getMethodInstance(classLoader) dexKitBridge.findMethod { matcher { addUsingStringsEquals( diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/settings/HpLocation.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/settings/HpLocation.kt index 08b15fb..f041aff 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/settings/HpLocation.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/settings/HpLocation.kt @@ -9,10 +9,6 @@ import star.sky.voyager.utils.yife.DexKit.dexKitBridge object HpLocation : HookRegister() { private val hp by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "persist.vendor.gnss.hpLocSetUI" -// matchType = MatchType.FULL -// }.map { it.getMethodInstance(classLoader) }.toList() dexKitBridge.findMethod { matcher { addUsingStringsEquals("persist.vendor.gnss.hpLocSetUI") @@ -21,10 +17,6 @@ object HpLocation : HookRegister() { } private val Zh by lazy { -// dexKitBridge.findMethodUsingString { -// usingString = "zh_CN" -// matchType = MatchType.FULL -// }.map { it.getMethodInstance(classLoader) }.toList() dexKitBridge.findMethod { matcher { addUsingStringsEquals("zh_CN") diff --git a/app/src/main/kotlin/star/sky/voyager/hook/hooks/weather/MoreCard.kt b/app/src/main/kotlin/star/sky/voyager/hook/hooks/weather/MoreCard.kt index b50a25a..6d98036 100644 --- a/app/src/main/kotlin/star/sky/voyager/hook/hooks/weather/MoreCard.kt +++ b/app/src/main/kotlin/star/sky/voyager/hook/hooks/weather/MoreCard.kt @@ -10,10 +10,6 @@ import java.util.Locale object MoreCard : HookRegister() { private val toolsCls by lazy { -// dexKitBridge.batchFindClassesUsingStrings { -// addQuery("qwq", setOf("ro.miui.ui.version.name", "Wth2:ToolUtils")) -// matchType = MatchType.FULL -// }.firstNotNullOf { (_, classes1) -> classes1.firstOrNull() } dexKitBridge.findClass { matcher { addUsingStringsEquals( @@ -25,9 +21,6 @@ object MoreCard : HookRegister() { private val locale by lazy { dexKitBridge.findMethod { -// methodDeclareClass = toolsCls.name -// methodParamTypes = arrayOf("android.content.Context") -// methodReturnType = "java.util.Locale" matcher { declaredClass = toolsCls.name paramTypes = listOf("android.content.Context")