2

When installing an app, depending on the app, access to the filesystem is required and requested at the time of install. Is it possible to restrict this to specific folders(s) and their subfolders? For example a photo editor or diary app: why would such apps need to be able to access the whole filesystem.

If not it might not be a bad idea, security-wise...

  • 1
    1) May be I missed it but I don't remember an Android permission related to access to filesystem but only to shared storage. 2) Android uses Linux kernel so you can always restrict files and folders for something by using groups. // That said, your idea is broad to me, so I suggest you pin-point the specific issue you're having. – Firelord Jul 22 '15 at 9:54
  • If you don't need access (except for app-specific folders), simply don't request any. By default, each app can write to its own storage space, i.e. /data/data/<package_name> and /sdcard/Android/data/<package_name>. A photo editor would need "full access" if you want to edit existing photos residing outside that scope, of course. // Apart from that, what is the background of your question? What permission to request is a decision of the app developer we users cannot deal with. – Izzy Jul 22 '15 at 12:49
0

Could work in theory.

Every app installed on an android phone is given a user id starting from 10000 for the first app and a group with the same id is created.

BusyBox (and root, maybe?) required!

To get the uid of an app, execute the following in a terminal emulator.

dumpsys package com.example.myapp

Replace com.example.myapp with the package name of your target app.

  1. Format your storage (external/internal) with ext4, assuming you have a backup of all the files.
  2. Restore the backup.
  3. chown and chmod the folders you want to restrict. Basing your restrictions on groups will be a better option.

Again, it's just theory. May or may not work. If you didn't understand any of the steps, get proper knowledge about them or don't try them. This may cause temporary as well as permanent data loss.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.