Comments (2)
Psst.... I somehow missed a whole lot of text where you have already found the issue. As in my original reply, the app cannot access the file because the owner, group and permissions have changed.
You have two options:
- su as the app's user - you can do this by getting the app's owner uX_aYYY and do the changes. Once you have su'ed as the user, you do not even require root anymore to modify the file since you act as the owner now. Im not sure if the shell will persist the su between Shell.sync.sh calls. But you can try.
X - The user id. Usually 0 if there is no multi user on the phone or if the current user is the primary user
Y - App id. I would guess android uses sequential numbers to generate this.
conclusively, the user is created for the app by u<userID>_a<appID> so perfect sandboxing is achieved across apps and different users
- Copy the file to sdcard/your app dir and modify it as you are doing with cp now since it has solved the issue.
Also, you do not have to use cp
to copy I believe. You can just use the File object to read the data in inputstream and flush it to target file using outputstream. But, cp
is included in busybox which the library adds to your app. Read the original reply for more info
-------------------- Original Reply -----------------------------
I'm not in any way part of this library development but, I can put in my views.
First, is it possible that the direct modification has changed the owner and group or the file permissions? Each app has their user and group for sandboxing. If the group or owner is changed, its inaccessible by the original app anymore.
For cp
I would assume it is safe because the library includes busybox by default unless you exclude it explicitly while building the app with this library included and busybox does contain cp.
from libsu.
@Yumeryu thanks for your report. The issue should be fixed since 1.3.0 release, can you update the library and check it out?
from libsu.
Related Issues (20)
- How do I transfer to Android tablet
- Crashing in onInit() HOT 4
- Remove ROOT_MOUNT_MASTER status HOT 1
- How do I simulate Control + C for a process HOT 3
- 使用360加固后无法绑定RootService HOT 6
- Doesn't support targetSdk>31? HOT 6
- LIBSU: java.io.InterruptedIOException HOT 2
- Access MainActivity HOT 5
- Refuses to work even though it has root. HOT 1
- LIBRARY REFUSES to access files. HOT 2
- 建议 HOT 2
- !
- [Security] Repository is vulnerable to MavenGate
- StrictMode violation: reading files from the disk in the main thread
- 希望能动态设置超时 HOT 1
- Apps using libsu do not work on root solutions like APatch. HOT 5
- NoSuchMethodException on Android 5.1.1 HOT 2
- . HOT 1
- Worst Documentation HOT 1
- System resources broken on Samsung too HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsu.