-
-
Save yohanes/947e1d4eb8c4aaf2e8f6b9bfe9d37541 to your computer and use it in GitHub Desktop.
This file contains 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
import de.robv.android.xposed.IXposedHookLoadPackage; | |
import de.robv.android.xposed.XC_MethodHook; | |
import de.robv.android.xposed.XposedBridge; | |
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam; | |
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod; | |
public class JoeHackXposed implements IXposedHookLoadPackage { | |
private void hackLicense(final LoadPackageParam lpparam) { | |
findAndHookMethod("es.yohan.examples.LicenseChecker", lpparam.classLoader, | |
"isValidLicense", | |
String.class, | |
new XC_MethodHook() { | |
@Override | |
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | |
} | |
@Override | |
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | |
param.setResult(true); | |
} | |
}); | |
} | |
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable { | |
XposedBridge.log("Loaded app: " + lpparam.packageName); | |
if (lpparam.packageName.equals("es.yohan.examples")) { | |
hackLicense(lpparam); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment