当前位置:网站首页>OTA upgrade
OTA upgrade
2022-06-11 01:05:00 【Ape Xiaoshuai 01】
OTA upgrade
1. Command line scripts
echo "--update_package=/data/update.zip" > /cache/recovery/command
sync
reboot recovery
/data/update.zip Store path for update package
android7.1.1 in the future data Partition encryption , So we need to do adb shell uncrypt
uncrypt /data/media/0/update.zip /cache/recovery/block.map
echo --[email protected]/cache/recovery/block.map > /cache/recovery/command
#echo --locale=zh-CN
echo updating$path=/data/media/0/update.zip > /cache/recovery/last_flag
echo /data/media/0/update.zip > /cache/recovery/uncrypt_file
2. Upgrade in code
private static File RECOVERY_DIR = new File("/cache/recovery");
private static File UPDATE_FLAG_FILE = new File(RECOVERY_DIR, "last_flag");
public static void installPackage(Context context, File packageFile)throws IOException{
String filename = packageFile.getCanonicalPath();
writeFlagCommand(filename);
RecoverySystem.installPackage(context, packageFile);
}
//path That is, the path where the update package is located
public static void writeFlagCommand(String path) throws IOException{
RECOVERY_DIR.mkdirs();
UPDATE_FLAG_FILE.delete();
FileWriter writer = new FileWriter(UPDATE_FLAG_FILE);
try {
writer.write("updating$path=" + path);
}finally {
writer.close();
}
}
边栏推荐
- day01
- 87.(leaflet之家)leaflet军事标绘-直线箭头修改
- Complete collection of MySQL exercises (with answers) - you will know everything after practice
- 为什么使用 Golang 进行 Web 开发
- 最好的创意鼓工具:Groove Agent 5
- table_exists_action=append和table_exists_action=truncate
- 动态规划经典题目三角形最短路径
- Ts+fetch to upload selected files
- [论文翻译] Recent Advances in Open Set Recognition: A Survey
- Controltemplate in WPF
猜你喜欢

Google搜索为什么不能无限分页?

Small project on log traffic monitoring and early warning | environment foundation 2

Lucene mind map makes search engines no longer difficult to understand

招聘 | 南京 | TRIOSTUDIO 三厘社 – 室内设计师 / 施工图深化设计师 / 装置/产品设计师 / 实习生等

动态规划经典题目三角形最短路径

SQL审核 | “云上”用户可以一键使用 SQLE 审核服务啦

AQS explanation of concurrent programming

负载均衡策略图文详解

MESI cache consistency protocol for concurrent programming

MySQL
随机推荐
Idea setting background picture (simple)
A simple understanding of B tree
[introduction to ROS] - 01 introduction to ROS
The JVM determines whether an object can be recycled
How word removes the header line
循环结构语句
Room first use
阿里云配置SLB(负载均衡)实例
Complete uninstallation of MySQL under Linux
[论文翻译] Recent Advances in Open Set Recognition: A Survey
【ROS入门教程】---- 03 ROS基本概念及指令
Wechat applet to realize OCR scanning recognition
【ROS入门教程】---- 03 单片机、PC主机、ROS通信机制
Deep copy and shallow copy in golang
中小企业数字化转型为什么这么难?
时间相关-格式、运算、比较、转换
阻塞队列 — DelayedWorkQueue源码分析
Using solrj to add, delete, modify, and query Solr is too simple
浅谈IEEE会议论文的不出席政策Non-Presented Paper(No-Show)Policy
day01