Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在android 12小米手机上,由Xcrash创建的log文件夹权限为drwx--S--- #109

Open
TC-zerol opened this issue Jun 1, 2022 · 6 comments

Comments

@TC-zerol
Copy link

TC-zerol commented Jun 1, 2022

xcrash.XCrash.init(this, new XCrash.InitParameters().setLogDir(getExternalFilesDir(null).getAbsolutePath() + "/log/"));
image

创建的文件夹权限为drwx--S---,tombstone文件权限为-rw-r-----
正常应该是文件夹权限为drwxrwx--x,tombstone文件权限为-rw-rw----

文件无法取出,这个问题可能由什么原因导致的。

@superoidlau
Copy link

Yes, I have the same problem.
deviceInfo:
Redmi K50 Pro

run cmd: ls -al

drwx--S--- 3 u0_a261 ext_data_rw 3452 2022-07-08 11:09 logs

cd logs: Permission denied

Have you solved the problem? thanks

@gejiashu
Copy link

gejiashu commented Sep 9, 2022

这个问题是因为 log 这个目录是在native 层的代码里面创建的,创建目录用的mode是只有创建的用户才可以读写执行。
在xc_util.c文件里面的这里 if(0 == mkdir(dir, S_IRWXU) || EEXIST == errno) return 0; 这个相当于mode是 700
把这个mode的值改掉就能解决了,改成这个
if(0 == mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO) || EEXIST == errno) return 0;
相当于是mode 777.

这个问题我在Android 11 12都有遇到过,在低版本的Android(Api 7, 8)上好像没有这个问题。

@superoidlau
Copy link

superoidlau commented Sep 9, 2022 via email

@MichaelJokAr
Copy link

您好,最近休假结束了么

@superoidlau
Copy link

superoidlau commented Mar 22, 2023 via email

@caikelun
Copy link
Collaborator

如果本地调试的话,可以找台root手机,没有root的话,可以run-as到你的demo app,然后查看tombstone文件。

线上的话xcrash的使用场景是由app进程自己读取tombstone文件,然后发送到服务端,应该不会有权限问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants