如何将文件从'资产'复制到root设备中的系统?

时间:2017-06-15 05:52:47

标签: android copy system rooted

我想这样做。但我得到/ system / app / filename:open failed:EROFS(只读文件系统)错误。

1 个答案:

答案 0 :(得分:-1)

这是一个例子。请尝试

private void saveFileToInternal(String orginal_url) {
        File file = new File(orginal_url);
        File dir = mContext.getDir(TEMP_FOLDER, Context.MODE_PRIVATE);
        File dest = new File(dir, "filename_" + file.getName());
        try {
            FileOutputStream out = new FileOutputStream(dest);
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            Log.e("Can not create file", e.getMessage());
        }
    }