简体   繁体   English

如何将文件从“资产”复制到root用户的Android设备中的系统?

[英]How to copy files from 'assets' to system in the rooted android device?

我想这样做。但是我得到了/ system / app / filename:打开失败:EROFS(只读文件系统)错误。

This is an example. 这是一个例子。 Please try 请试试

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());
        }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在已root用户的Android设备中复制系统文件 - Copy system files in rooted android device 如何在没有根设备的情况下在android中跟踪系统调用? - How to trace system calls in android with not rooted device? Android应用程序可以将自身复制到有根设备上的系统目录中吗? - Can an Android app copy itself to the system directory on a rooted device? .如何将文件从项目资产文件夹复制到android studio中的设备数据文件夹? - .How to copy files from project assets folder to device data folder in android studio? android - 从应用程序内部更改有根设备的系统设置 - android - changing the system settings of a rooted device from inside the app Android的复制保护如何检查设备是否已植根? - How can Android's Copy Protection check if the device is rooted? android如何在rooted设备的\\ system \\ fonts目录下安装自定义字体 - android how to install custom fonts on \system\fonts directory in rooted device 如何挂钩我的Android应用程序的系统调用(非root设备) - How to hook system calls of my android app (non rooted device) 更改时复制文件 - 已植根的 android 设备 - Copy file on change - Rooted android device 如果已root,可以直接在设备上访问Android文件和​​数据库吗? - Accessing Android Files and Database Directly on the device if rooted?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM