[Bug] Native hook libc open function cause app can't open their own file #1922
Unanswered
fr0zenrain
asked this question in
Q&A
Replies: 1 comment
-
i'm sorry.maybe it's my bug, open is a variable argment function,i never process the third argument,so i guess it's the reason. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Steps to reproduce/复现步骤
I have write a native hook example, and hook open function, I just want redirect maps to file, it works,but i found app have so much FileNotFoundException.all stacktrace show permission denial.and when i cd to app's files directory,and the file permission
looks like
---------- 1 u0_a200 u0_a200 168 2022-05-07 14:43 config.json
most app after hook have the same problem. maybe i can change the permission by myself?so i want know the reason.thanks!
int fake_open(const char *file, int mode) {
if(...)
{
...
return backup_open(file,mode)
}
else
return backup_open(file, mode);
}
Expected behaviour/预期行为
app can access their own file
Actual behaviour/实际行为
app can not open their own file
Xposed Module List/Xposed 模块列表
Magisk Module List/Magisk 模块列表
LSPosed version/LSPosed 版本
181
Android version/Android 版本
10
Magisk version/Magisk 版本
24.1
Riru version/Riru 版本
v26.1.4.r522
Version requirement/版本要求
Logs/日志
2022-05-07 15:02:22.870 17151-17399/? W/System.err: java.io.FileNotFoundException: /data/user/0/com.baidu.BaiduMap/cache/slr/131_76e92bc650f8d7433dde8a4efdbfe72d (Permission denied)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at java.util.zip.ZipFile.open(Native Method)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at java.util.zip.ZipFile.(ZipFile.java:265)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at java.util.zip.ZipFile.(ZipFile.java:187)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at java.util.zip.ZipFile.(ZipFile.java:201)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at com.baidu.location.indoor.mapversion.b.c.a(Unknown Source:3)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at com.baidu.location.indoor.mapversion.b.b.g(Unknown Source:15)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at com.baidu.location.indoor.mapversion.b.b.a(Unknown Source:0)
2022-05-07 15:02:22.870 17151-17399/? W/System.err: at com.baidu.location.indoor.mapversion.b.b$2.run(Unknown Source:2)
2022-05-07 15:02:22.873 1729-2835/? I/WifiService: getConfiguredNetworks not allowed for uid=10200
ls -l
---x------ 1 u0_a200 u0_a200_cache 19055 2022-05-07 17:03 131_76e92bc650f8d7433dde8a4efdbfe72d
Beta Was this translation helpful? Give feedback.
All reactions