== Build libdalvikhook ==
cd dalvikhook
cd jni
ndk-build
The following is error message when I follow the instructions, Could you help me?
C:\Android\ddi\dalvikhook\jni>ndk-build
Android NDK: WARNING:C:/Android/ddi/dalvikhook/jni/Android.mk:dalvikhook: LOCAL_
LDLIBS is always ignored for static libraries
Android NDK: WARNING:C:/Android/ddi/dalvikhook/jni/Android.mk:dalvikhook: non-sy
stem libraries in linker flags: -ldvm ../../../adbi/instruments/base/obj/local/a
rmeabi/libbase.a
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_S
TATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependenc
ies of the
Android NDK: current module
[armeabi] Compile arm : dalvikhook <= dexstuff.c
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'mydlsym':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:23:2: warning: format '%x' expects argu
ment of type 'unsigned int', but argument 5 has type 'void ' [-Wformat=]
log("%s = 0x%x\n", name, ret)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'dexstuff_resolv_dvm':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:30:2: warning: format '%x' expects argu
ment of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("dvm_hand = 0x%x\n", d->dvm_hand)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'dexstuff_loaddex':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:97:2: warning: format '%x' expects argu
ment of type 'unsigned int', but argument 4 has type 'char *' [-Wformat=]
log("dexstuff_loaddex, path = 0x%x\n", path)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c:103:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'jobject' [-Wformat=]
log("cookie = 0x%x\n", pResult.l)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'dexstuff_defineclass':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:117:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("sys classloader = 0x%x\n", cl)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c:118:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'struct Object *' [-Wforma
t=]
log("cur m classloader = 0x%x\n", m->clazz->classLoader)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c:127:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("class = 0x%x\n", ret)
^
[armeabi] Compile thumb : dalvikhook <= dalvik_hook.c
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c: In function 'dalvik_hook':
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:52:3: warning: format '%x' expects a
rgument of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("class = 0x%x\n", target_cls)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:76:3: warning: format '%x' expects a
rgument of type 'unsigned int', but argument 6 has type 'struct Method *' [-Wfor
mat=]
log("%s(%s) = 0x%x\n", h->method_name, h->method_sig, h->method)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:82:4: warning: format '%x' expects a
rgument of type 'unsigned int', but argument 4 has type 'DalvikBridgeFunc' [-Wfo
rmat=]
log("nativeFunc %x\n", h->method->nativeFunc)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:113:4: warning: format '%x' expects
argument of type 'unsigned int', but argument 5 has type 'void *' [-Wformat=]
log("patched %s to: 0x%x\n", h->method_name, h->native_func)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c: In function 'dalvik_prepare':
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:133:4: warning: format '%x' expects
argument of type 'unsigned int', but argument 4 has type 'jclass' [-Wformat=]
log("cls = 0x%x\n", h->cls)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:141:4: warning: format '%x' expects
argument of type 'unsigned int', but argument 4 has type 'jmethodID' [-Wformat=]
log("mid = 0x%x\n", h-> mid)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c: In function 'dalvik_postcall':
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:173:3: warning: format '%x' expects
argument of type 'unsigned int', but argument 5 has type 'void *' [-Wformat=]
log("patched BACK %s to: 0x%x\n", h->method_name, h->native_func)
^
[armeabi] StaticLibrary : libdalvikhook.a
== Build libdalvikhook ==
cd dalvikhook
cd jni
ndk-build
The following is error message when I follow the instructions, Could you help me?
C:\Android\ddi\dalvikhook\jni>ndk-build
Android NDK: WARNING:C:/Android/ddi/dalvikhook/jni/Android.mk:dalvikhook: LOCAL_
LDLIBS is always ignored for static libraries
Android NDK: WARNING:C:/Android/ddi/dalvikhook/jni/Android.mk:dalvikhook: non-sy
stem libraries in linker flags: -ldvm ../../../adbi/instruments/base/obj/local/a
rmeabi/libbase.a
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_S
TATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependenc
ies of the
Android NDK: current module
[armeabi] Compile arm : dalvikhook <= dexstuff.c
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'mydlsym':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:23:2: warning: format '%x' expects argu
ment of type 'unsigned int', but argument 5 has type 'void ' [-Wformat=]
log("%s = 0x%x\n", name, ret)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'dexstuff_resolv_dvm':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:30:2: warning: format '%x' expects argu
ment of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("dvm_hand = 0x%x\n", d->dvm_hand)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'dexstuff_loaddex':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:97:2: warning: format '%x' expects argu
ment of type 'unsigned int', but argument 4 has type 'char *' [-Wformat=]
log("dexstuff_loaddex, path = 0x%x\n", path)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c:103:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'jobject' [-Wformat=]
log("cookie = 0x%x\n", pResult.l)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c: In function 'dexstuff_defineclass':
C:/Android/ddi/dalvikhook/jni/dexstuff.c:117:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("sys classloader = 0x%x\n", cl)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c:118:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'struct Object *' [-Wforma
t=]
log("cur m classloader = 0x%x\n", m->clazz->classLoader)
^
C:/Android/ddi/dalvikhook/jni/dexstuff.c:127:2: warning: format '%x' expects arg
ument of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("class = 0x%x\n", ret)
^
[armeabi] Compile thumb : dalvikhook <= dalvik_hook.c
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c: In function 'dalvik_hook':
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:52:3: warning: format '%x' expects a
rgument of type 'unsigned int', but argument 4 has type 'void *' [-Wformat=]
log("class = 0x%x\n", target_cls)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:76:3: warning: format '%x' expects a
rgument of type 'unsigned int', but argument 6 has type 'struct Method *' [-Wfor
mat=]
log("%s(%s) = 0x%x\n", h->method_name, h->method_sig, h->method)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:82:4: warning: format '%x' expects a
rgument of type 'unsigned int', but argument 4 has type 'DalvikBridgeFunc' [-Wfo
rmat=]
log("nativeFunc %x\n", h->method->nativeFunc)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:113:4: warning: format '%x' expects
argument of type 'unsigned int', but argument 5 has type 'void *' [-Wformat=]
log("patched %s to: 0x%x\n", h->method_name, h->native_func)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c: In function 'dalvik_prepare':
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:133:4: warning: format '%x' expects
argument of type 'unsigned int', but argument 4 has type 'jclass' [-Wformat=]
log("cls = 0x%x\n", h->cls)
^
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:141:4: warning: format '%x' expects
argument of type 'unsigned int', but argument 4 has type 'jmethodID' [-Wformat=]
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c: In function 'dalvik_postcall':
C:/Android/ddi/dalvikhook/jni/dalvik_hook.c:173:3: warning: format '%x' expects
argument of type 'unsigned int', but argument 5 has type 'void *' [-Wformat=]
log("patched BACK %s to: 0x%x\n", h->method_name, h->native_func)
^
[armeabi] StaticLibrary : libdalvikhook.a