Android(安卓)OTA升级新旧版本任意升级
16lz
2021-01-25
1. Android升级到较新的版本后,想用.zip升级包升回旧的版本时,在升级时会发错。这是由于android系统时对升级文件有版本检测。
2. build/tools/releasetools/ota_from_target_files:
def main(argv): def option_handler(o, a): if o == "--board_config": pass # deprecated elif o in ("-k", "--package_key"): OPTIONS.package_key = a elif o in ("-i", "--incremental_from"): OPTIONS.incremental_source = a elif o in ("-w", "--wipe_user_data"): OPTIONS.wipe_user_data = True elif o in ("-n", "--no_prereq"): OPTIONS.omit_prereq = True elif o in ("-o", "--oem_settings"): OPTIONS.oem_source = a elif o in ("-e", "--extra_script"): OPTIONS.extra_script = a elif o in ("-a", "--aslr_mode"): if a in ("on", "On", "true", "True", "yes", "Yes"): OPTIONS.aslr_mode = True else: OPTIONS.aslr_mode = False elif o in ("-t", "--worker_threads"):
3. build/tools/releasetools/edify_generator.py 比较时间戳就是在这里
def AssertOlderBuild(self, timestamp, timestamp_text):
"""Assert that the build on the device is older (or the same as)
the given timestamp."""
self.script.append(
('(!less_than_int(%s, getprop("ro.build.date.utc"))) || '
'abort("Can\'t install this package (%s) over newer '
'build (" + getprop("ro.build.date") + ").");'
) % (timestamp, timestamp_text))
4. 如果不想系统检测版本,将ota_from_target_files文件中改为OPTIONS.omit_prereq = False
更多相关文章
- 一款常用的 Squid 日志分析工具
- GitHub 标星 8K+!一款开源替代 ls 的工具你值得拥有!
- RHEL 6 下 DHCP+TFTP+FTP+PXE+Kickstart 实现无人值守安装
- Linux 环境下实战 Rsync 备份工具及配置 rsync+inotify 实时同步
- Nginx系列教程(六)| 手把手教你搭建 LNMP 架构并部署天空网络电影
- Android系统编译so库提示error undefined reference to '__andro
- unity开发android游戏(一)搭建Unity安卓开发环境
- gradle之 (application 目录下 gradle 和 Root 目录下 gradle)
- Android(安卓)Studio 编写jni 实例