From a07caa8f8fcee07421ebab8bd001d4f969d4ee65 Mon Sep 17 00:00:00 2001 From: Arian Date: Thu, 17 Mar 2022 00:48:49 +0100 Subject: [PATCH] sm6150-common: releasetools: Use unique version-baseband strings for different regions Android 12 forbids to assign version-baseband multiple times with different values for different regions, hence append the hwc value to the version-baseband string. The lines have to follow this syntax now: require version-baseband-${ro.boot.hwc}=${modem_version},${firmware_version} Example for a device that wants assertions for global and chinese devices: require version-baseband-CN=4.3.c5-00100,21.4.21 require version-baseband-GLOBAL=4.3.c5-00100,V12.1.2.0.RFJMIXM Change-Id: Ib2c5b1c4588e6bfff1ebf5b7b1d8933d71e09251 --- releasetools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/releasetools.py b/releasetools.py index c54f5d3..080961b 100644 --- a/releasetools.py +++ b/releasetools.py @@ -55,9 +55,9 @@ def OTA_InstallEnd(info): def AddBasebandAssertion(info, input_zip): android_info = input_zip.open("OTA/android-info.txt") for line in android_info.readlines(): - m = re.search(r'require\s+version-baseband\s*=\s*(.+)', line.decode('utf-8')) + m = re.search(r'require\s+version-baseband\s*-\s*(.+)', line.decode('utf-8')) if m: - hwc, modem_version, firmware_version = m.group(1).rstrip().split(',') + hwc, modem_version, firmware_version = re.split('[=,]', m.group(1).rstrip()) if (len(hwc) and len(modem_version) and len(firmware_version)): cmd = 'assert(getprop("ro.boot.hwc") == "{0}" && (xiaomi.verify_baseband("{1}") == "1" || abort("ERROR: This package requires firmware from MIUI {2} or newer. Please upgrade firmware and retry!");) || true);' info.script.AppendExtra(cmd.format(hwc, modem_version, firmware_version))