문제

Hi in my Filemanager i want to add an Option to rename Files in /system directory. Ive tried this to add to my code. It doesnt work. What did I wrong?

public static void renameRootTarget(String oldname, String name)
        throws IOException, InterruptedException {

    Process process = Runtime.getRuntime().exec("su");
    DataOutputStream out = new DataOutputStream(process.getOutputStream());
    out.writeBytes("mount -o remount rw /\n");
    out.writeBytes("mv /system/" +oldname + "/system/"+ name + "\n");
    out.writeBytes("exit\n");
    out.flush();
    process.waitFor();
}

oldname is the selected file and name is the new filename created with an EditText.

도움이 되었습니까?

해결책

Change

out.writeBytes("mount -o remount rw /\n"); 

to

cmds.add("mount -o remount rw /system \n");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top