[OTA升级]修改指纹,默认升级需求进行强制升级

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/su749520/article/details/82142153

1. 原因

由于Fota升级需要匹配指纹,这里我们做了个偷懒,修改服务器指定的指纹,即固定指纹

2. 获取升级包指纹信息

C:\Users\fadi.su\Desktop\update\META-INF\com\google\android\updater-script

ui_print("Source: xxx/L38043/K9:8.1.0/O11019/1535232673:user/release-keys");

3.配置到源码的build.prop

out\target\product\xxx6762_l01\system\build.prop

ro.build.fingerprint=xxx/L38043/K9:8.1.0/O11019/1535232673:user/release-keys

3. make snod 重新编译Systetem.img

命令 make snod


Creating filesystem with parameters:
    Size: 4227936256
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8080
    Inode size: 256
    Journal blocks: 16128
    Label: system
    Blocks: 1032211
    Block groups: 32
    Reserved block group size: 255
Created filesystem with 2573/258560 inodes and 440349/1032211 blocks
Running:  build_verity_tree -A aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 out/target/product/xxx6762_l01/system.img /tmp/tmpt3YVAm_verity_images/verity.img
9a1b53442d0aeb87bf7a2445e0eb40ddc69f096060fad324d84cca395c6bc610 aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7
Running:  system/extras/verity/build_verity_metadata.py build 4227936256 /tmp/tmpt3YVAm_verity_images/verity_metadata.img 9a1b53442d0aeb87bf7a2445e0eb40ddc69f096060fad324d84cca395c6bc610 aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 /dev/block/platform/bootdevice/by-name/system verity_signer build/target/product/security/verity.pk8
['verity_signer', '/tmp/tmp0eXD6f.table', 'build/target/product/security/verity.pk8', '/tmp/tmpXlcZol.sig']
appending /tmp/tmpt3YVAm_verity_images/verity_metadata.img to /tmp/tmpt3YVAm_verity_images/verity.img
Running:  fec -e -p 0 out/target/product/xxx6762_l01/system.img /tmp/tmpt3YVAm_verity_images/verity.img /tmp/tmpt3YVAm_verity_images/verity_fec.img
encoding RS(255, 253) to '/tmp/tmpt3YVAm_verity_images/verity_fec.img' for input files:
        1: 'out/target/product/xxx6762_l01/system.img'
        2: '/tmp/tmpt3YVAm_verity_images/verity.img'
appending /tmp/tmpt3YVAm_verity_images/verity_fec.img to /tmp/tmpt3YVAm_verity_images/verity.img
Running:  append2simg out/target/product/xxx6762_l01/system.img /tmp/tmpt3YVAm_verity_images/verity.img

out/target/product/xxx6762_l01/system.img maxsize=4384892160 blocksize=4224 total=1799296116 reserve=44292864

上述一个固定指纹的版本就出现了

验证方法-adb shell getprop “ro.build.fingerprint”

D:\AndroidStudioProjects>adb shell getprop "ro.build.fingerprint"
xxx/L38043/K9:8.1.0/O11019/1535232673:user/release-keys

猜你喜欢

转载自blog.csdn.net/su749520/article/details/82142153