build/fix-store-build-prop-zip.patch
2023-01-08 12:46:09 +01:00

39 lines
1.5 KiB
Diff

From 497ae885d6a92d473ec3c603bd39e4510380240d Mon Sep 17 00:00:00 2001
From: nyyu <mail@nyyu.dev>
Date: Sat, 7 Jan 2023 10:54:05 +0100
Subject: [PATCH] releasetools: Store the build.prop file in the OTA zip
Change-Id: I81825a8a4633dff294a372ccf4de8e3aef99750c
---
tools/releasetools/non_ab_ota.py | 3 +++
tools/releasetools/ota_utils.py | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/releasetools/non_ab_ota.py b/tools/releasetools/non_ab_ota.py
index ad9cbcc82..91492ad76 100644
--- a/tools/releasetools/non_ab_ota.py
+++ b/tools/releasetools/non_ab_ota.py
@@ -308,6 +308,9 @@ endif;
script.AddToZip(input_zip, output_zip, input_path=OPTIONS.updater_binary)
metadata.required_cache = script.required_cache
+ common.ZipWriteStr(output_zip, "system/build.prop",
+ input_zip.read("SYSTEM/build.prop").decode())
+
# We haven't written the metadata entry, which will be done in
# FinalizeMetadata.
common.ZipClose(output_zip)
diff --git a/tools/releasetools/ota_utils.py b/tools/releasetools/ota_utils.py
index ff98ba9fb..1fb78db61 100644
--- a/tools/releasetools/ota_utils.py
+++ b/tools/releasetools/ota_utils.py
@@ -39,7 +39,7 @@ OPTIONS.boot_variable_file = None
METADATA_NAME = 'META-INF/com/android/metadata'
METADATA_PROTO_NAME = 'META-INF/com/android/metadata.pb'
-UNZIP_PATTERN = ['IMAGES/*', 'INSTALL/*', 'META/*', 'OTA/*', 'RADIO/*']
+UNZIP_PATTERN = ['IMAGES/*', 'INSTALL/*', 'META/*', 'OTA/*', 'RADIO/*', 'SYSTEM/build.prop']
SECURITY_PATCH_LEVEL_PROP_NAME = "ro.build.version.security_patch"