嗨,我正在开发一个简单的启动动画应用程序,但我猜这是一个权限问题,但我不太确定,因为我是新手,但无论如何这是我的代码。我正在尝试将启动动画从 sdcard 复制到 /data/local 并将其重命名为 bootanimation.zip 我知道代码很好,因为如果我复制到 sdcard 上的另一个文件夹说 /mnt/sdcard/folder/bootanimation。 zip 它可以工作并且文件被重命名,但我无法复制到 /data/local 我的手机已植根,但我猜我的应用程序需要请求 su 或者我的清单需要更多权限。关于为什么我不能复制到 /data/local 的任何解决方案都会有很大的帮助。感谢您的任何帮助
try {
FileChannel srcChannel = new FileInputStream("/mnt/sdcard/boots/1bootanimation.zip").getChannel();
FileChannel dstChannel = new FileOutputStream("/data/local/bootanimation.zip").getChannel();
dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
srcChannel.close();
dstChannel.close();
} catch (IOException e) {
}