Android14 OTA差分包升级报Package is for source build

制作好差分包,使用adb线刷模式验证ota升级,出现E:Package is for source build错误

使用adb方式验证

  • 进入recovery模式
adb reboot recovery
  • 稍等一会界面会提示
Now send the package you want to apply 
to the device with "adb sidelaod <filename>"...
  • 输入命令开始升级
adb sideload Z:\xxx\xxx\ota\update.zip

update.zip是制作好的差分包

报E:Package is for source build

Finding update package...
[   48.397027] I:Update package id: /sideload/package.zip
[   48.521958] I:1 key(s) loaded from /system/etc/security/otacerts.zip
[   48.522082] Verifying update package...
[   48.560787] I:comment is 1738 bytes; signature is 1720 bytes from end
[   48.626868] I:signature (offset: 36340, length: 6b2): 308206ae06092a864886f70d0
[   48.627340] I:whole-file signature verified against RSA key 0
[   48.627449] Update package verification took 0.1 s (result 0).
[   48.661254] Installing update...
[   48.697640] I:old spl: 2024-05-05 new spl: 2024-05-05 CHECK passes
[   48.697909] E:Package is for source build mp1V614 but expected mp1V164
[   48.731747]
[   48.789490] I:current maximum temperature: 33043
[   48.789954] I:/sideload/package.zip

这个问题使用adb线刷才有, 如果使用代码升级验证不会出现。

本地验证时,注释以下代码

  • vendor_ap_s0/bootablse/recovery/install/install.cpp
--- a/vendor_ap_s0/bootable/recovery/install/install.cpp
+++ b/vendor_ap_s0/bootable/recovery/install/install.cpp
@@ -147,20 +147,20 @@ static bool CheckAbSpecificMetadata(const std::map<std::string, std::string>& me
   // Incremental updates should match the current build.
   auto device_pre_build = android::base::GetProperty("ro.build.version.incremental", "");
   auto pkg_pre_build = get_value(metadata, "pre-build-incremental");
-  if (!pkg_pre_build.empty() && pkg_pre_build != device_pre_build) {
+  /*if (!pkg_pre_build.empty() && pkg_pre_build != device_pre_build) {
     LOG(ERROR) << "Package is for source build " << pkg_pre_build << " but expected "
                << device_pre_build;
     return false;
-  }
+  }*/
 
   auto device_fingerprint = android::base::GetProperty("ro.build.fingerprint", "");
   auto pkg_pre_build_fingerprint = get_value(metadata, "pre-build");
-  if (!pkg_pre_build_fingerprint.empty() &&
+ /* if (!pkg_pre_build_fingerprint.empty() &&
       !isInStringList(device_fingerprint, pkg_pre_build_fingerprint, FINGERPRING_SEPARATOR)) {
     LOG(ERROR) << "Package is for source build " << pkg_pre_build_fingerprint << " but expected "
                << device_fingerprint;
     return false;
-  }
+  }*/
 
   // Check for downgrade version.
   int64_t build_timestamp =
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值