Code Monkey home page Code Monkey logo

Comments (2)

vijai1996 avatar vijai1996 commented on August 21, 2024

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:

  1. 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

  1. 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.

topjohnwu avatar topjohnwu commented on August 21, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.