2013-08-23 3 views
0

안녕하세요 Filemanager에서/system 디렉토리의 파일 이름을 바꾸는 옵션을 추가하고 싶습니다. 필자는 this을 코드에 추가하려고 시도했습니다. 그것은 작동하지 않습니다. 내가 뭘 잘못 했니?루트로 파일 이름 바꾸기

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을 선택한 파일과 이름이 글고 치기로 만든 새 파일 이름입니다.

답변

0

변경

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

cmds.add("mount -o remount rw /system \n");