Amol Nage Amol Nage - 19 days ago 5
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

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: https://github.com/Stericson/RootTools/releases

You can find more informaiton on our wiki: https://github.com/Stericson/RootTools/wiki

For a more slimmed down library, check out RootShell: https://github.com/Stericson/RootShell

Hope this will help you.

Comments