Skip to content

Commit

Permalink
feat[MyModule.kt]: Method hooked, replace to true.
Browse files Browse the repository at this point in the history
  • Loading branch information
VergeDX committed May 28, 2023
1 parent a29dee2 commit ce36b84
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions app/src/main/java/me/vergedx/pixelnfc_japansku/MyModule.kt
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
package me.vergedx.pixelnfc_japansku

import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.XC_MethodReplacement
import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LoadPackage

class MyModule : IXposedHookLoadPackage {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("Loaded app: " + lpparam.packageName)

XposedHelpers.findAndHookMethod(
"com.google.android.pixelnfc.provider.DeviceInfoContentProvider",
lpparam.classLoader, "isDeviceJapanSku", String::class.java,

object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam?) {
XposedBridge.log("beforeHookedMethod")
super.beforeHookedMethod(param)
}

override fun afterHookedMethod(param: MethodHookParam?) {
XposedBridge.log("afterHookedMethod")
super.afterHookedMethod(param)
object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam?): Any {
return true
}
})
}
Expand Down

0 comments on commit ce36b84

Please sign in to comment.