Skip to content

Commit e42d0f4

Browse files
author
tiann
committed
修复 Android 8。0以上 dlopen hook失败的问题。
1 parent 26ab932 commit e42d0f4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

VirtualApp/lib/src/main/jni/Foundation/IOUniformer.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,13 @@ int findSymbol(const char *name, const char *libn,
687687

688688
void hook_dlopen(int api_level) {
689689
void *symbol = NULL;
690-
if (api_level > 23) {
690+
if (api_level > 25) {
691+
if (findSymbol("__dl__Z9do_dlopenPKciPK17android_dlextinfoPKv", "linker",
692+
(unsigned long *) &symbol) == 0) {
693+
MSHookFunction(symbol, (void *) new_do_dlopen_V24,
694+
(void **) &orig_do_dlopen_V24);
695+
}
696+
} else if (api_level > 23) {
691697
if (findSymbol("__dl__Z9do_dlopenPKciPK17android_dlextinfoPv", "linker",
692698
(unsigned long *) &symbol) == 0) {
693699
MSHookFunction(symbol, (void *) new_do_dlopen_V24,

0 commit comments

Comments
 (0)