Skip to content

Commit

Permalink
urgent push, do not hook every time when activity start
Browse files Browse the repository at this point in the history
  • Loading branch information
oOJohn6Oo committed Dec 29, 2020
1 parent b7bbcb1 commit 1391933
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.externalNativeBuild
.cxx
local.properties
/app/release



Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/john/android/xuimodx/MainHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
* @Date: 12/28/20 9:38 AM
* @Description:
*/

class MainHook:IXposedHookLoadPackage {

companion object{
val foundedPackage = hashMapOf<String,Boolean>()
}

override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
var r: Class<*>?
Expand All @@ -30,6 +33,8 @@ class MainHook:IXposedHookLoadPackage {
XposedBridge.hookAllMethods(activityThread,"performLaunchActivity",object :XC_MethodHook(){
override fun afterHookedMethod(param: MethodHookParam?) {
if(param==null) return
if(foundedPackage[lpparam.packageName] == true) return
foundedPackage[lpparam.packageName] = true
val mInitialApplication = XposedHelpers.getObjectField(param.thisObject,"mInitialApplication")
val finalCL = XposedHelpers.callMethod(mInitialApplication,"getClassLoader") as ClassLoader
XposedBridge.log("found classload is => $finalCL")
Expand Down

0 comments on commit 1391933

Please sign in to comment.