[英]Cannot read/write/delete file through Android app
I am doing this through an app I am coding.我正在通过我正在编码的应用程序执行此操作。
I copy a file from /persist/ to the internal storage of my app using SU " cpy " and then I " chmod " it to 600 or even 777 .我使用 SU“ cpy ”将文件从/persist/复制到我的应用程序的内部存储,然后我将它“ chmod ”到600甚至777 。 I get " Access denied " exception whenever I read that file.
每当我阅读该文件时,我都会收到“拒绝访问”异常。 I can read any other file I create.
我可以读取我创建的任何其他文件。 I also changed the owner and group from " root " to my app , but I can still not touch that file - delete, read, write all fail.
我还将所有者和组从“ root ”更改为我的应用程序,但我仍然无法触摸该文件 - 删除、读取、写入都失败了。
The solution was to chcon the file as well.解决方案也是chcon文件。 Thanks to ChainFire!
感谢 ChainFire!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.