I have a problem when I try to copy folders inside /data/data to SDcard.
I have my phone rooted.
I request Superuser permissions in my app with:
<
At the end I got it!!!!
I use the SuperUser process with the cp command to copy the files and folders.
I hope you find it helpful.
String comando = "cp -r /data/data/sourcefolder /sdcard/targetfolder";
Process suProcess = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(suProcess.getOutputStream());
os.writeBytes(comando + "\n");
os.flush();
os.writeBytes("exit\n");
os.flush();
try
{
int suProcessRetval = suProcess.waitFor();
if (255 != suProcessRetval)
{
// Acceso Root concedido
retval = true;
}else
{
// Acceso Root denegado
retval = false;
}
}
catch (Exception ex)
{
Log.w("Error ejecutando el comando Root", ex);
}
Thank you very much to all the people of this forum and for all the help which you offer!!