From 72401bb621fc274b00a84bd95a024b6c146dab1e Mon Sep 17 00:00:00 2001 From: althafvly Date: Sat, 8 Mar 2025 11:34:01 +0530 Subject: [PATCH 1/3] build.sh: Switch to modern build signing method as default Signed-off-by: Jackeagle --- src/build.sh | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/build.sh b/src/build.sh index ad64f1a..58cd5d8 100755 --- a/src/build.sh +++ b/src/build.sh @@ -272,11 +272,6 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then echo ">> [$(date)] Adding keys path ($KEYS_DIR)" # Soong (Android 9+) complains if the signing keys are outside the build path ln -sf "$KEYS_DIR" user-keys - if [ "$android_version_major" -lt "10" ]; then - sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := user-keys/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := user-keys/releasekey\nPRODUCT_EXTRA_RECOVERY_KEYS := user-keys/releasekey\n\n;" "vendor/$vendor/config/common.mk" - elif [ "$android_version_major" -lt "12" ]; then - sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := user-keys/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := user-keys/releasekey\n\n;" "vendor/$vendor/config/common.mk" - fi fi # Prepare the environment @@ -385,14 +380,6 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then build_success=true fi fi - elif [ "$android_version_major" -lt "12" ] || [ "${RELEASE_TYPE}" = "test" ]; then - if [ "${BUILD_SUPER_IMAGE}" = true ]; then - if breakfast_device && mka bacon superimage; then - build_success=true - fi - elif brunch "${DEVICE}" "${BUILD_TYPE}"; then - build_success=true - fi elif breakfast_device; then # Apply patch for vendor prebuilt devices. if [ "${DEVICE}" = "one" ] || [ "${DEVICE}" = "two" ]; then @@ -596,17 +583,11 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi IMG_OUT=$OUT - if [ "$android_version_major" -lt "12" ]; then - IMG_OUT=obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES - fi # Move produced ZIP files to the main OUT directory echo ">> [$(date)] Moving build artifacts for ${DEVICE} to '$ZIP_DIR/$zipsubdir'" cd "${OUT}" || return 1 for build in $(ls e-*.zip); do - if [ "$android_version_major" -lt "12" ]; then - sha256sum "$build" >"$ZIP_DIR/$zipsubdir/$build.sha256sum" - fi find . -maxdepth 1 \( -name 'e-*.zip*' -o -name 'IMG-e*.zip*' -o -name 'QFIL-e*.zip*' \) -type f -exec mv {} "$ZIP_DIR/$zipsubdir/" \; SKIP_DYNAMIC_IMAGES="odm.img product.img system.img system_ext.img vendor.img" -- GitLab From b280ae79f87eac1bbeffddcc54821337cc0186c2 Mon Sep 17 00:00:00 2001 From: Jackeagle <116548-Jackeagle@users.noreply.gitlab.e.foundation> Date: Mon, 10 Mar 2025 03:04:26 +0000 Subject: [PATCH 2/3] build.sh: Use full path for sign_target_files_apks, ota_from_target_files and img_from_target_files Signed-off-by: Jackeagle --- src/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/build.sh b/src/build.sh index 58cd5d8..9525c63 100755 --- a/src/build.sh +++ b/src/build.sh @@ -426,7 +426,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi if [ "$(find $OUT/obj/PACKAGING/target_files_intermediates/ -name *-target_files*.zip -print -quit)" ]; then - sign_target_files_apks "${SIGN_TARGETS[@]}" \ + ./build/tools/releasetools/sign_target_files_apks "${SIGN_TARGETS[@]}" \ $OUT/obj/PACKAGING/target_files_intermediates/*-target_files*.zip "$OUT/$TARGET_FILES" # Generate OTA zip @@ -434,7 +434,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$SIGN_BUILDS" = true ]; then SIGN_KEY=(-k "user-keys/releasekey") fi - ota_from_target_files --backup=true "${SIGN_KEY[@]}" "$OUT/$TARGET_FILES" \ + ./build/tools/releasetools/ota_from_target_files --backup=true "${SIGN_KEY[@]}" "$OUT/$TARGET_FILES" \ "$OUT/$E_VERSION" if [ ! -f "$OUT/$E_VERSION" ]; then @@ -446,7 +446,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then # Flash: fastboot update update.zip FASTBOOT_PACKAGE="FASTBOOT-$E_VERSION" echo ">> [$(date)] Generating fastboot zip from target-files-package" - img_from_target_files "$OUT/$TARGET_FILES" "$OUT/$FASTBOOT_PACKAGE" + ./build/tools/releasetools/img_from_target_files "$OUT/$TARGET_FILES" "$OUT/$FASTBOOT_PACKAGE" if [ ! -f "$OUT/$FASTBOOT_PACKAGE" ]; then clean_up -- GitLab From 669620e3befc9f9a88a32b3cfce7413245beb579 Mon Sep 17 00:00:00 2001 From: Jackeagle Date: Mon, 10 Mar 2025 05:21:23 -0400 Subject: [PATCH 3/3] build.sh: Add test build support using brunch for RELEASE_TYPE="test" Signed-off-by: Jackeagle --- src/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/build.sh b/src/build.sh index 9525c63..7d6823f 100755 --- a/src/build.sh +++ b/src/build.sh @@ -380,6 +380,10 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then build_success=true fi fi + elif [ "${RELEASE_TYPE}" = "test" ]; then + if brunch "${DEVICE}" "${BUILD_TYPE}"; then + build_success=true + fi elif breakfast_device; then # Apply patch for vendor prebuilt devices. if [ "${DEVICE}" = "one" ] || [ "${DEVICE}" = "two" ]; then -- GitLab