0

How can I read and modify the database of an app that I don't own with root.

I tried copying the file to my app's location like this:

try {
    Runtime.getRuntime().exec("su");
    Runtime.getRuntime().exec("su -c cat /data/user/0/com.maxmpz.audioplayer/databases/folders.db > /data/user/0/com.example.me.myapp/folders.db");
} catch (IOException e) {
    e.printStackTrace();
}

and:

try {
    Runtime.getRuntime().exec("su");
    Process p = Runtime.getRuntime().exec("su cp /data/user/0/com.maxmpz.audioplayer/databases/folders.db /data/user/0/com.example.me.myapp/folders.db");
} catch (IOException e) {
    e.printStackTrace();
}

But nothing happens (the exception isn't raised).

Ajeet Choudhary
  • 1,969
  • 1
  • 17
  • 41
Vasil Kalchev
  • 201
  • 3
  • 12

0 Answers0