【发布时间】:2023-03-03 02:48:01
【问题描述】:
我对这个错误感到困惑:
java.io.FileNotFoundException:/cache/recovery/uncrypt_file:打开失败:EACCES(权限被拒绝)
当我使用这个方法时RecoverySystem.installPackage(),我的ota路径在sdcard。我的android版本是6.0.1,RecoverySystem.installPackage()的源代码如下:
public static void installPackage(Context context, File packageFile)
throws IOException {
String filename = packageFile.getCanonicalPath();
FileWrite uncryptFile=new FileWriter(UNCRYPT_FILE);
try{
uncryptFile.write(filename+"\n");
}finally{
uncryptFile.close();
}
Log.w(TAG, "!!! REBOOTING TO INSTALL " + filename + " !!!");
if(filename.startWith("/data/")){
filename="@/cache/recovery/block.map";
}
final String filenameArg = "--update_package=" + filename;
final String localeArg = "--locale=" + Locale.getDefault().toString();
bootCommand(context, filenameArg, localeArg);
}
【问题讨论】:
-
你的应用安装文件夹是什么?
-
那条路径一开始就不存在。那么你期待什么呢?
-
,and my ota path was in sdcard。然后告诉确切的路径。 -
我在AOSP中编译了这个otaUpdateAPK,并把它放在/system/app @Murf
-
我的update.zip路径是
/sdcard/update.zip,其中"/sdcard/update.zip".getCanonicaLpath()显示的确切路径是/storage/media/0/update.zip@greenapps
标签: android android-source ota