Skip to content

Commit 19ff7cf

Browse files
committed
Add missing syscall for 64bit
Signed-off-by: tiann <[email protected]>
1 parent 7c15001 commit 19ff7cf

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,4 @@ Credits
8989

9090
1. [VirtualApp](https://github.com/asLody/VirtualApp)
9191
2. [Xposed](https://github.com/rovo89/Xposed)
92+
3. [And64InlineHook](https://github.com/Rprop/And64InlineHook)

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ HOOK_DEF(int, __statfs, __const char *__file, struct statfs *__buf) {
275275
return ret;
276276
}
277277

278+
// int statfs64 (__const char *__file, struct statfs *__buf);
279+
HOOK_DEF(int, statfs64, __const char *__file, struct statfs *__buf) {
280+
int res;
281+
const char *redirect_path = relocate_path(__file, &res);
282+
int ret = syscall(__NR_statfs, redirect_path, __buf);
283+
FREE(redirect_path, __file);
284+
return ret;
285+
}
286+
278287
int inline getArrayItemCount(char *const array[]) {
279288
int i;
280289
for (i = 0; array[i]; ++i);
@@ -520,9 +529,9 @@ void IOUniformer::startUniformer(const char *so_path, int api_level, int preview
520529
HOOK_SYMBOL(handle, unlinkat);
521530
HOOK_SYMBOL(handle, symlinkat);
522531
HOOK_SYMBOL(handle, utimensat);
523-
// HOOK_SYMBOL(handle, __getdents64);
524532
HOOK_SYMBOL(handle, chdir);
525533
HOOK_SYMBOL(handle, execve);
534+
HOOK_SYMBOL(handle, statfs64);
526535
dlclose(handle);
527536
}
528537
// hook_dlopen(api_level);

0 commit comments

Comments
 (0)