public class HookEntry implements IXposedHookLoadPackage {
public static String TAG = "Demo";
public static ClassLoader dexClassLoader = null;
public static ClassLoader classLoader = null;
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if (loadPackageParam.packageName.equals(HookUtils.XPOSED_HOOK_PACKAGE)) {
classLoader = loadPackageParam.classLoader;
XposedBridge.log(TAG + " has Hooked!");
XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() {
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Context context = (Context) param.args[0];
dexClassLoader = context.getClassLoader();
if (dexClassLoader == null) {
XposedBridge.log("cannot get classloader return ");
return;
}
XposedBridge.log(TAG + " has Hooked!");
final Class<?> sqliteDatabase = XposedHelpers.findClass("net.sqlcipher.database.SQLiteDatabase", dexClassLoader);
final Method insertWithOnConflictMethod = XposedHelpers.findMethodExact(sqliteDatabase, "insertWithOnConflict", String.class, String.class, ContentValues.class, int.class);
public class HookEntry implements IXposedHookLoadPackage {
public static String TAG = "Demo";
public static ClassLoader dexClassLoader = null;
public static ClassLoader classLoader = null;
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
if (loadPackageParam.packageName.equals(HookUtils.XPOSED_HOOK_PACKAGE)) {
classLoader = loadPackageParam.classLoader;
XposedBridge.log(TAG + " has Hooked!");
XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() {
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Context context = (Context) param.args[0];
dexClassLoader = context.getClassLoader();
if (dexClassLoader == null) {
XposedBridge.log("cannot get classloader return ");
return;
}
XposedBridge.log(TAG + " has Hooked!");
final Class<?> sqliteDatabase = XposedHelpers.findClass("net.sqlcipher.database.SQLiteDatabase", dexClassLoader);
final Method insertWithOnConflictMethod = XposedHelpers.findMethodExact(sqliteDatabase, "insertWithOnConflict", String.class, String.class, ContentValues.class, int.class);