Giter VIP home page Giter VIP logo

Comments (13)

arpitkh96 avatar arpitkh96 commented on July 28, 2024

You have to change their permissions first. Only then it would open

from amazefilemanager.

pejakm avatar pejakm commented on July 28, 2024

You have to change their permissions first.

Why? Amaze already has root access. Cyanogen's file manager (for example) has no problems with this.

from amazefilemanager.

arpitkh96 avatar arpitkh96 commented on July 28, 2024

OK i will implement it... Though it's obvious that files aren't readable in /data that's why permissions needs to be altered

from amazefilemanager.

pejakm avatar pejakm commented on July 28, 2024

Commit 1c47706 solves this by chmoding files to 777 and leaves them that way. I'm not an expert, but I think this is not the right way to do it. I just tested CyanogenMod File Manager, and like I've said before, it can open files from /data (given that it has root access), but it doesn't modify any file permissions.

from amazefilemanager.

VishalNehra avatar VishalNehra commented on July 28, 2024

I'll look into the possible solution later...

from amazefilemanager.

ShadowKyogre avatar ShadowKyogre commented on July 28, 2024

@vishal0071: I think these commits from CM File Manager might help with implementing it without modifying the permissions:

CyanogenMod/android_packages_apps_CMFileManager@3d75aa8
CyanogenMod/android_packages_apps_CMFileManager@14d3354

In short, what CM File manager is doing is running cat with root permissions to extract the contents of the file for viewing in the text editor. It then writes this back using dd (again, with root permissions) to the output file. It also tries to make sure that dd writes exactly the information inputted by the user into the file (it tries again if the operation didn't write exactly what the user inputted). I'm pretty sure there is a way to do the writing without dd, but I'm not sure how to do that yet either.

from amazefilemanager.

arpitkh96 avatar arpitkh96 commented on July 28, 2024

you mean we should copy files in cache and then read it?that doesnt seems a good idea either.

from amazefilemanager.

ShadowKyogre avatar ShadowKyogre commented on July 28, 2024

@arpitkh96: Yeah, the copy-into-cache doesn't seem like a good idea either if we're avoiding the use of dd. The main reason I didn't want to suggest using dd was because I was looking at the library you were using for root access, but wasn't sure where we'd pipe the edited file contents as stdin for dd so dd has data to work with. Otherwise, I'd totally be for it.

from amazefilemanager.

arpitkh96 avatar arpitkh96 commented on July 28, 2024

So what do you think is the best idea.... Changing permissions could be deadly

from amazefilemanager.

ShadowKyogre avatar ShadowKyogre commented on July 28, 2024

@arpitkh96 : I think I have an idea after looking at how OpenExplorer does it too, which uses the same library as AmazeFileManager to access root files: https://github.com/BrandroidTools/OpenExplorer/blob/50489177d1176518d9a9c626674b5c2e3c7e3f7f/src/org/brandroid/openmanager/data/OpenFileRoot.java#L499-L502

For getting file contents, use cat as root on the file that needs to be read and take that output (which is how Cyanogenmod's file manager does it, OpenExplorer puts the file in a tmp cache).

For writing the file contents, use cat as root with a command similar to the highlighted lines to redirect the output to the appropriate file. I'm pretty sure this'd preserve perms, but double check just to make sure.

[EDIT]: Just did a quick check with the shell on my Linux computer and perms don't change with this method. This should hold true for the root shell in Android devices since they're not that different.

from amazefilemanager.

arpitkh96 avatar arpitkh96 commented on July 28, 2024

i didnt fully got your idea. how does cat preserves permissions,for example in this case...openexplorer is using external storage for its temp file.and obviously if he copies the file in external memory(or internal,but not system) the permissions will not be preserved.So how the permissions are preserved using this way.the only way i see is manually setting permissions later

from amazefilemanager.

ShadowKyogre avatar ShadowKyogre commented on July 28, 2024

For reading from a file, cat just puts the contents of the file into
stdout, which can be retrieved from the RootTools library by doing
something like this in the link:
https://github.com/Stericson/RootTools/wiki/Usage#running-root-commands
(it's on a per-line basis, so one may need concatenate the lines).

For writing to a file, putting data into a file using cat by redirecting
the output to the doesn't modify the file permissions. OpenExplorer
doesn't copy the file from the tmp to write to it, just for reading
it (most likely because they didn't want to have to deal with adding the
lines together to make the whole text manually).

On 02/21/2015 10:22 PM, arpit khurana wrote:

i didnt fully got your idea. how does cat preserves permissions,for
example in this case...openexplorer is using external storage for its
temp file.and obviously if he copies the file in external memory(or
internal,but not system) the permissions will not be preserved.So how
the permissions are preserved using this way.the only way i see is
manually setting permissions later


Reply to this email directly or view it on GitHub
#65 (comment).

from amazefilemanager.

arpitkh96 avatar arpitkh96 commented on July 28, 2024

OK I got this. BTW I was looking for a way to make text files as well as databases readable. I have implemented your suggestions in text viewer. I don't think cat can help me read database. What say?

from amazefilemanager.

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.