Skip to content

Commit

Permalink
删除多余的dexkit旧版注释
Browse files Browse the repository at this point in the history
  • Loading branch information
hosizoraru committed Sep 20, 2023
1 parent 9a4d504 commit 95ded3a
Show file tree
Hide file tree
Showing 29 changed files with 14 additions and 430 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Int, Method> = 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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -123,7 +113,7 @@ object SuperClipboard : HookRegister() {
.filter {
name in setOf("isPcSupport", "isRegisterCapability", "supportMail", "supportTel")
}.toList().createHooks {
returnConstant(true)
}
returnConstant(true)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,14 @@ 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"
}
}.map { it.getMethodInstance(safeClassLoader) }
}

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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ object ModifyScreenRecorderConfig : HookRegister() {
}
}

// dexKitBridge.findMethodUsingString {
// usingString = "defaultBitRate = "
// }
dexKitBridge.findMethod {
matcher {
usingStrings = listOf("defaultBitRate = ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,33 +74,26 @@ object SaveAsPng : HookRegister() {
}
}

// dexKitBridge.batchFindMethodsUsingStrings {
// addQuery("qwq", setOf("context", "bitmap", "uri", "format"))
// matchType = MatchType.FULL
// }
dexKitBridge.findMethod {
matcher {
addUsingStringsEquals(
"context", "bitmap", "uri", "format"
)
}
}.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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]++
Expand All @@ -60,6 +47,5 @@ object EnhanceContours : HookRegister() {
returnConstant(true)
}
}
// }
}
}
Loading

0 comments on commit 95ded3a

Please sign in to comment.