Amol Nage Amol Nage - 9 months ago 52
Java Question

Copy system files in rooted android device

I want to copy files and directories from /root directory to a different folder inside the SD_CARD. So, I did lots of search, but couldn't found a useful answer.

I executed su command like this:

Process pp = Runtime.getRuntime().exec("su cp "+originDir+" "+targetDir);

Any help will be great. Thanks.

Answer Source

Try Using RootTools library for android. (RootTools: a library to run commands as root).

RootTools provides rooted developers a standardized set of tools for use in the development of rooted applications.

You can find the latest release here:

You can find more informaiton on our wiki:

For a more slimmed down library, check out RootShell:

Hope this will help you.