Comments (13)
You have to change their permissions first. Only then it would open
from amazefilemanager.
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.
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.
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.
I'll look into the possible solution later...
from amazefilemanager.
@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.
you mean we should copy files in cache and then read it?that doesnt seems a good idea either.
from amazefilemanager.
@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.
So what do you think is the best idea.... Changing permissions could be deadly
from amazefilemanager.
@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.
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.
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.
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)
- Shizuku (ADB & Root) support
- Crash reported by Damien HOT 1
- Warn users to put phone on flat surface before writing to USB OTG. HOT 1
- Memory Leak on `FtpTileService`
- Highlight matched part in search results
- `IndexOutOfBoundsException`: Inconsistency detected. Invalid view holder adapter `positionViewHolder` HOT 7
- [Feature Request] Add direct camera integration HOT 1
- amaze
- amaze HOT 3
- crash when opening a .7z file HOT 1
- New search UI not visible on landscape orientation
- Crash reported by None HOT 1
- [Documentation] Add screenshots to Readme
- `IOException`: No valid decoder to decrypt PEM on `NetCopyClientConnectionPool#createSshClient` HOT 2
- Crash reported by bit2shift HOT 2
- NPE on `MainActivity#saveExternalIntentExtras`
- Mac user cant open the file HOT 1
- Crash reported by "Guillaume HOT 1
- not working
- Cant set Amaze as the default file manager on Android TV
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 amazefilemanager.