1.在RKUpdateService中调用findFromSdOrUsb检测update.zip文件或者update.img文件
2.检测到文件后 如果是 img文件则携带 version参数跳转 android.rockchip.update.service.FirmwareUpdatingActivity,是zip则直接跳转
3.在 FirmwareUpdatingActivity 文件中 点击 ok 跳转 UpdateAndRebootActivity 携带 文件path;
4.在 UpdateAndRebootActivity 页面 如果是 img 则调用 updateFirmware ,model : RKUPDATE_MODE:1 ; 如果是 zip,model :OTAUPDATE_MODE:2
5. 回到RKUpdateService 的 LocalBinder 的 RKRecoverySystem.installPackage 
6.调用 RecoverySystem.installPackage(context, packageFile);

然后回到 frameworks/base/core/java/android/os/RecoverySystem.java

 public static void installPackage(Context context, File packageFile, boolean processed)throws IOException {synchronized (sRequestLock) {LOG_FILE.delete();// Must delete the file in case it was created by system server.UNCRYPT_PACKAGE_FILE.delete();String filename = packageFile.getCanonicalPath();Log.w(TAG, "!!! REBOOTING TO INSTALL " + filename + " !!!");// If the package name ends with "_s.zip", it's a security update.boolean securityUpdate = filename.endsWith("_s.zip");// If the package is on the /data partition, the package needs to// be processed (i.e. uncrypt'd). The caller specifies if that has// been done in 'processed' parameter.if (filename.startsWith("/data/")) {if (processed) {if (!BLOCK_MAP_FILE.exists()) {Log.e(TAG, "Package claimed to have been processed but failed to find "+ "the block map file.");throw new IOException("Failed to find block map file");}} else {FileWriter uncryptFile = new FileWriter(UNCRYPT_PACKAGE_FILE);try {uncryptFile.write(filename + "\n");} finally {uncryptFile.close();}// UNCRYPT_PACKAGE_FILE needs to be readable and writable// by system server.if (!UNCRYPT_PACKAGE_FILE.setReadable(true, false)|| !UNCRYPT_PACKAGE_FILE.setWritable(true, false)) {Log.e(TAG, "Error setting permission for " + UNCRYPT_PACKAGE_FILE);}BLOCK_MAP_FILE.delete();}// If the package is on the /data partition, use the block map// file as the package name instead.filename = "@/cache/recovery/block.map";}final String filenameArg = "--update_package=" + filename + "\n";final String localeArg = "--locale=" + Locale.getDefault().toLanguageTag() + "\n";final String securityArg = "--security\n";String command = filenameArg + localeArg;if (securityUpdate) {command += securityArg;}RecoverySystem rs = (RecoverySystem) context.getSystemService(Context.RECOVERY_SERVICE);if (!rs.setupBcb(command)) {throw new IOException("Setup BCB failed");}// Having set up the BCB (bootloader control block), go ahead and rebootPowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);String reason = PowerManager.REBOOT_RECOVERY_UPDATE;// On TV, reboot quiescently if the screen is offif (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);if (wm.getDefaultDisplay().getState() != Display.STATE_ON) {reason += ",quiescent";}}pm.reboot(reason);throw new IOException("Reboot failed (no permissions?)");}}

如何禁止自动升级并让用户App可以执行升级命令

修改思路及内容
1. 在RKUpdateService中不检测update.zip文件和update.img文件
2. 修改页面布局 notify_dialog,及 UpdateAndRebootActivity页面的显示,使该页面透明悬浮
3. 调用方式为 = 直接跳转

    Intent intent = new Intent();intent.setComponent(new ComponentName("android.rockchip.update.service", "android.rockchip.update.service.UpdateAndRebootActivity") );intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.putExtra("android.rockchip.update.extra.IMAGE_PATH", path);context.startActivity(intent);

RK3288 系统升级流程相关推荐

  1. 【android系统】android系统升级流程分析(二)---update升级包分析

    接下来我们将通过几篇文章来分析update.zip包在具体Android系统升级的过程,来理解Android系统中Recovery模式服务的工作原理.今天让我先来分析下升级包update.zip. 一 ...

  2. 【android系统】android系统升级流程分析(一)---recovery模式中进行update包升级流程分析

    今天我们直接来看下android中具体的升级过程是如何的. 升级流程概述 升级的流程图: 升级流程分析 第一步:升级包获取 升级获取可以通过远程下载,也可直接拷贝到指定目录即可. 第二步:准备升级 然 ...

  3. Android系统升级流程

    一.前提条件 要进行Android系统升级,必须首先进入recovery模式,进入recovery模式的方式有: 1. 通过读取 /cache 分区中文件 /cache/recovery/comman ...

  4. linux系统导航怎么刷安卓系统升级,自定义Android系统升级流程

    流程# 参考链接### 创建系统升级app### 一.使用AndroidStudio创建系统app. 二.声明权限,具备读写外置存储设备的权限以及重启设备的权限. 三.修改配置文件,添加coreApp ...

  5. OTA和Recovery系统升级流程介绍

    本文介绍了Android原生OTA和Recovery升级过程步骤. 进入升级 - 1.1 正常启动和进入Recovery的区别 下面给出了升级流程的简单示意图.    上图中的上下两个部分,上面一部分 ...

  6. android 恢复出厂设置 代码,android恢复出厂设置以及系统升级流程

    http://www.bangchui.org/simple/?t5938.html ============================================= 恢复出厂设置流程概括: ...

  7. android OTA系统升级流程

    1. 获取update.zip文件 2.验证签名文件 3.通过installPackage接口升级 4.系统重新启动进入recovery界面(判断/cache/recovery 是否有cmd文件) 5 ...

  8. Recovery系统升级(3)---软件流程

    系统升级软件流程 本章节结合源码剖析Recovery系统升级流程,流程中相关技术难点或者细节会单独文章介绍,文中相应位置会附上链接. 从APP检测到服务器推送OTA升级包到设备启动到新版本系统的整个软 ...

  9. Android系统升级全流程

    Android系统升级流程处理 前段时间负责公司项目的系统升级模块开发,在开发过程中,对整个升级流程有个基本的了解,现在此做一个阶段性的总结,方便日后查阅.项目基于高通Android 7.0.1实现, ...

最新文章

  1. Java8-Stream-终止操作-查找与匹配
  2. Android的移动存储解决方案“.NET研究”之SharedPreferences
  3. python txt文件排序,使用Python在.txt文件中按數值(降序)排序高分列表
  4. 神牛驾到!James B. Orlin 的 O(nm)最大流算法论文翻译!!
  5. std::ostringstream
  6. ExcelJS 将JSON数组转换成为Excel文件 / JSON转换成为XLSX / 网页导出Excel表格
  7. 什么是计算机在自动控制中的应用,计算机在自动控制中的应用
  8. PS2019 常用快捷键大全
  9. 如何在线将flac格式转换成mp3音频
  10. Tomcat 服务器搭建
  11. 企业采用IT人才外包会有这么多好处
  12. 数学与计算机学院女生节标语,女生节标语理学院
  13. 华为交换机sftp 配置
  14. python怎么读汉字翻译拼音_python把汉字转换成拼音实现程序
  15. 华为正式发布鸿蒙艾,安卓12正式发布,华为掉出首发名单,鸿蒙系统硬扛谷歌苹果...
  16. 【MOOC】华中科技大学操作系统慕课答案-第1~3章单元测试
  17. 辽宁省抚顺市谷歌高清卫星地图下载
  18. Unity 3D学习之雷霆战机(一)
  19. 果集数据:从化妆镜切入“她”赛道,Amiro如何挖掘科技美护市场新机会?
  20. 新能源产业链全景图(建议收藏)

热门文章

  1. JAVA毕设项目林家餐厅自助点餐管理系统(java+VUE+Mybatis+Maven+Mysql)
  2. Reason Studios Reason 12 v12.2.5 WiN 音乐制作软件和机架插件
  3. kafka的安装和使用(详细版)
  4. python自动生成word报告_利用Python实现报告自动生成
  5. 友盟分享error:包名错误,确认与开放平台包名一致
  6. upload.js 文件图片上传
  7. python注册登陆程序_python的简单的登陆和注册功能实现
  8. 整理了4大类22种图表,不用担心用错统计图表,分析不出东西了
  9. java8 GC日志分析
  10. linux 查看 操作系统位数