0

我尝试像这样在 /sdcard 中用 myfont.ttf替换DroidSansFallback.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 回答