• android 5.x system.img 大于2G导致编译otapackage时报错怎样处理


    当system分区预制过多apk时假设img size超过2G 在make otapackage时会报例如以下错误
     zipfile.LargeZipFile: Zipfile size would require ZIP64 extensions
    in writestr zinfo.CRC = crc32(bytes) & 0xffffffff # CRC-32 checksum OverflowError: size does not fit in an int

    //http://blog.csdn.net/sergeycao

    这是因为python 2.7 脚本限制
    參考/prebuilts/python/linux-x86/2.7.5/lib/python2.7/
    ZIP64_LIMIT = (1 << 31) - 1       (31bits相当于2G)
     
    python 3.0+ 已提供solution,  但眼下Android 编译环境使用2.x 语法与 3.0不兼容
    对此google提供一个workaround solution
    參考下面网址有提供具体patch内容
    https://android-review.googlesource.com/#/c/142984 
    (但此方法占时提高write size 到32bits相当于4G, 假设超过4G仍会出现故障)
     
    另外还需改动一下脚本  build/tool/releasetools/
    1、sign_target_files_apks
    2、replace_img_from_target_files.py 
    3、ota_from_target_files
    4、img_from_target_files.py 
    5 、img_from_target_files
    6、common.py 
    7、add_img_to_target_files
    针对全部zipfile.ZipFile  加入最后 allowZip64=True 參数值
    ex:
    原始文件:
    output_zip = zipfile.ZipFile(filename, "a", compression=zipfile.ZIP_DEFLATED) 
    改动为:
    output_zip = zipfile.ZipFile(filename, "a", compression=zipfile.ZIP_DEFLATED, allowZip64=True)

  • 相关阅读:
    vue+element ui 实现菜单无限极菜单
    DOM事件绑定原理和传播机制
    数组和对象的深浅克隆
    new源码分析和Object.create的重写
    原型和原型链的学习
    4.3 模型参数的延后初始化
    4.2 模型参数的访问、初始化和共享
    CSAPP Float Point
    4.1 模型构造
    3.16 实战Kaggle比赛:房价预测
  • 原文地址:https://www.cnblogs.com/yjbjingcha/p/6993331.html
Copyright © 2020-2023  润新知