Last active
January 14, 2024 13:42
-
-
Save kmark/d6a19bc50c6ba7cc8f1f to your computer and use it in GitHub Desktop.
Hooking into any class in Google Play Services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.versobit.kmark.gist; | |
import android.app.Application; | |
import android.content.Context; | |
import de.robv.android.xposed.IXposedHookLoadPackage; | |
import de.robv.android.xposed.XC_MethodHook; | |
import de.robv.android.xposed.callbacks.XC_LoadPackage; | |
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod; | |
public class XHookGms implements IXposedHookLoadPackage { | |
@Override | |
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpp) throws Throwable { | |
if(!"com.google.android.gms".equals(lpp.packageName)) { | |
return; | |
} | |
findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() { | |
@Override | |
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | |
// Hook here (as normal) using lpp.classLoader | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello. I want inject native shared libs on attach function. how to do it. or( how to do load native libs on apps)
Ex: