Salman Roy
Salman Roy

Reputation: 575

How to access Data/app folder in android?

I want to access Data/app folder, I use the following code:

File fl = new File("data/app/");

fl.list();

but I get exception. May be it need some permission to read this folder list, can some one tell me which permission it need to read file in that folder.

Any help in this regar is higly appreciated,

thanks.

Upvotes: 1

Views: 6691

Answers (1)

Philippe Banwarth
Philippe Banwarth

Reputation: 17755

1) The access mode for /data/app/ is rwxrwx--x. The --x part means that if you are not root you can not browse the directory but you can traverse it.

2) The apk files are world-readable (rw-r--r--)

So you can read the content of a file contained in /data/app/ as long as you know it's complete path.

shell@android:/ $ ls -l /data/app                                              
opendir failed, Permission denied

shell@android:/ $ ls -l /data/app/com.google.android.apps.maps-2.apk         
-rw-r--r-- system   system    8758286 2012-12-18 20:01 com.google.android.apps.maps-2.apk

Upvotes: 4

Related Questions