您的位置:首页 > 其它

[OTA] 系统加密后Recovery是如何读取OTA升级包的---Andorid 6.0 M 的更新

2015-12-04 14:54 337 查看
private static ProgressDialog pd = null;
之前有写过在android 5.0 L上,系统加密后Recovery是如何读取OTA升级包的最近发现在在Android 6.0上,Google做了一些改变,当然是好的改变了。首先,在RecoverySystem.java中,加了 UNCRYPT_FILE (/cache/recovery/uncrypt_file)
</pre><p></p><pre>
334    public static void installPackage(Context context, File packageFile)
335        throws IOException {
336        String filename = packageFile.getCanonicalPath();
337
338        FileWriter uncryptFile = new FileWriter(UNCRYPT_FILE);
339        try {
340            uncryptFile.write(filename + "\n");
341        } finally {
342            uncryptFile.close();
343        }
344        Log.w(TAG, "!!! REBOOTING TO INSTALL " + filename + " !!!");
345
346        // If the package is on the /data partition, write the block map file
347        // into COMMAND_FILE instead.
348        if (filename.startsWith("/data/")) {
349            filename = "@/cache/recovery/block.map";
350        }
351
352        final String filenameArg = "--update_package=" + filename;
353        final String localeArg = "--locale=" + Locale.getDefault().toString();
354        bootCommand(context, filenameArg, localeArg);
355    }
frameworks/base/services/core/java/com/android/server/power/ShutdownThread.java中新加了
</pre><p> private static ProgressDialog pd = null;</p><pre>
还有一个
private void uncrypt()
uncrypt()会调用uncrypt,并从UNCRYPT_STATUS_FILE文件中读取进度,更新一个progress dialog.
也就是说,在 M上,关机解密过程中,会在 power down animation前,显示一个progress dialog。 这样就避免了L上如果解密需要时间过长时,关机动画后会出现黑屏的问题。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: