I have a rooted android phone. And Im trying to access /data/app/
folder. Using adb shell it is pretty easy, however I want to access it programmatically.
My android manifest:
...
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
...
And there is a strange thing, I can easily access system/app
, but there is no chance to get data or catalog names in data/app
.
Some java code:
String data = Environment.getDataDirectory().getPath();
String system = Environment.getRootDirectory().getPath();
File dir1= new File(system);
File dir2 = new File(data);
String[] ff1 = dir1.list(); // returns bunches of names/catalogs
String[] ff2 = dir2 .list(); // returns null
Where I did mistake? Thanks for help.
Related topics: How to access data/data folder in Android device?