You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In demoApp it works just fine but when copying Hook.smali to another app, backup method is destroyed by the hook. Calling backup2 gives no error but backup, which is hooked, gives error below.
Without calling backup I can hook just fine but I need the return value of backup method.
java.lang.NoSuchMethodError: No static method backup(Ljava/lang/Object;)D in class Llab/galaxy/yahfa/demoApp/Hook; or its super classes (declaration of 'lab.galaxy.yahfa.demoApp.Hook' appears in base.apk!classes5.dex)
2018-12-30 17:40:56.334 21454-21454/? I/YAHFA-Native: target method is at 0x6fe6c4a0, hook method is at 0x79dea85920, backup method is at 0x79dea85858
2018-12-30 17:40:56.334 21454-21454/? I/YAHFA-Native: setNonCompilable: access flags is 0x80001
2018-12-30 17:40:56.334 21454-21454/? I/YAHFA-Native: setNonCompilable: access flags is 0x80009
2018-12-30 17:40:56.334 21454-21454/? I/YAHFA-Native: origin ep is 0x720018e0, new ep is 0x7a74b25000
2018-12-30 17:40:56.334 21454-21454/? I/YAHFA-Native: access flags is 0x2080101
2018-12-30 17:40:56.334 21454-21454/? I/YAHFA-Native: hook and backup done
package lab.galaxy.yahfa.demoApp;
public class Hook {
private static String TAG = "HOOK";
private static Context context = null;
public static void doHook(Context context) {
try {
Hook.context = context;
ClassLoader classLoader = context.getClassLoader();
Class clazz = Class.forName("android.xyz", true, classLoader);
HookMain.findAndBackupAndHook(clazz, "xyz", "()D", findMethodByName("hook"), findMethodByName("backup"));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
public static Method findMethodByName(String name) {
for (Method method : Hook.class.getDeclaredMethods()) {
if (method.getName().equals(name)) {
return method;
}
}
return null;
}
public static double hook(Object thiz) {
backup2(thiz);
return backup(thiz);
}
public static double backup(Object thiz) {
Log.e(TAG, "Shouldn't be here");
return 0;
}
public static double backup2(Object thiz) {
Log.e(TAG, "Backup2 Shouldn't be here");
return 0;
}
}
The text was updated successfully, but these errors were encountered:
I built the Hook.class in the demoApp module and it worked fine there but I don't have the source code of the other app (anymore) so the only option was to copy the built Hook.smali. I switched to AndHook now which is working fine but still thought I'd report this issue.
In demoApp it works just fine but when copying Hook.smali to another app, backup method is destroyed by the hook. Calling backup2 gives no error but backup, which is hooked, gives error below.
Without calling backup I can hook just fine but I need the return value of backup method.
java.lang.NoSuchMethodError: No static method backup(Ljava/lang/Object;)D in class Llab/galaxy/yahfa/demoApp/Hook; or its super classes (declaration of 'lab.galaxy.yahfa.demoApp.Hook' appears in base.apk!classes5.dex)
The text was updated successfully, but these errors were encountered: