0

このように /sdcard でDroidSansFallback.ttfmyfont.ttfに置き換えようとします

    try {
        Process p = Runtime.getRuntime().exec("su");
        DataOutputStream outs=new DataOutputStream(p.getOutputStream());
        outs.writeBytes("mount -o rw,remount /system"+"\n");
        outs.writeBytes("cat /sdcard/myfont.ttf >> /system/fonts/DroidSansFallback.ttf"+"\n");
        outs.writeBytes("mount -o rw,remount /system"+"\n");
        outs.flush();
    } catch (IOException e) {
        e.printStackTrace();
    }

この方法で DroidSansFallback を /sdcard にコピーできますが、コピーして戻すことはできません。ルート化されたデバイスで DroidSansFallback フォントを置き換える正しい方法を知っている場合は、助けてください。

4

1 に答える 1

0

あなたはおそらく「読み取り専用」権限を持っています/system/fonts

以下を試してください:

Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "chmod 777 /system/font" });
// I have used 777 just for testing you can change as per your requirement
proc.waitFor();  
于 2014-04-03T16:01:55.713 に答える