【问题标题】:How to copy files from 'assets' to system in the rooted android device?如何将文件从“资产”复制到有根的android设备中的系统?
【发布时间】:2017-11-17 11:29:29
【问题描述】:

我想这样做。但是我得到 /system/app/filename: open failed: EROFS (Read-only file system) 错误。

【问题讨论】:

  • Read-only file system 表示您必须将系统重新挂载为读写。
  • Runtime.getRuntime().exec("su mount -o remount,rw /system/media/");
  • 它不起作用。
  • It dose not work - 究竟如何?输出是什么?错误?
  • FileOutputStream fs = new FileOutputStream(“/system/media/bootanimation.zip”);---> /system/app/bootanimation.zip:打开失败:EROFS(只读文件系统)错误。

标签: android copy system rooted


【解决方案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());
        }
    }

【讨论】:

  • 看起来你总是想从其他用户那里得到所有答案。对吗?
  • 不,只有与问题无关的答案。
猜你喜欢
  • 2017-03-28
  • 2020-04-08
  • 2012-05-31
  • 1970-01-01
  • 1970-01-01
  • 2011-08-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多