我正在尝试将系统文件复制到我的SD卡中。我的手机已经扎根。复制时,将在目标文件夹中创建一个文件,但该文件为空-0字节文件。我正在使用RootShell库。我在这里做什么错了?
if (RootShell.isRootAvailable()) {
Command command = new Command(0
,"mount -o remount,rw /system"
,"cp -r /data/data/com.testapp/storage/log.txt > /storage/emulated/0/backup/log.txt"
,"mount -o remount,ro /system"
);
try {
RootShell.getShell(true).add(command);
} catch (IOException | TimeoutException | RootDeniedException e) {
Toast.makeText(MainActivity.this, "exception root", Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
} else {
Toast.makeText(MainActivity.this, "err root", Toast.LENGTH_SHORT).show();
}