From c86cd29e33c887b5e4834f0382462d8074d72504 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Fri, 9 Dec 2022 17:21:29 +0800 Subject: [PATCH] Add more info to artifact name (#286) --- scripts/build.sh | 14 +++++++++----- scripts/extractMagisk.py | 5 +++++ scripts/generateWSALinks.py | 1 + xml/FE3FileUrl.xml | 2 +- xml/WUIDRequest.xml | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 606e7f6..44fec79 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -426,11 +426,15 @@ fi echo "Extract Magisk" if [ -f "$MAGISK_PATH" ]; then + version="" + versionCode=0 if ! python3 extractMagisk.py "$ARCH" "$MAGISK_PATH" "$WORK_DIR"; then echo "Unzip Magisk failed, is the download incomplete?" CLEAN_DOWNLOAD_MAGISK=1 abort fi + # shellcheck disable=SC1091 + source "${WORK_DIR:?}/ENV" || abort $SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort $SUDO patchelf --replace-needed libdl.so "../linker/$HOST_ARCH/libdl.so" "$WORK_DIR"/magisk/magiskpolicy || abort @@ -871,8 +875,8 @@ echo "Generate info" if [[ "$ROOT_SOL" = "none" ]]; then name1="" -elif [[ "$ROOT_SOL" = "" ]]; then - name1="-with-magisk-$MAGISK_VER" +elif [ "$ROOT_SOL" = "" ] || [ "$ROOT_SOL" = "magisk" ]; then + name1="-with-magisk-$version($versionCode)-$MAGISK_VER" else name1="-with-$ROOT_SOL-$MAGISK_VER" fi @@ -880,15 +884,15 @@ if [ "$GAPPS_BRAND" = "none" ]; then name2="-NoGApps" else if [ "$GAPPS_BRAND" = "OpenGApps" ]; then - name2="-$GAPPS_BRAND-${GAPPS_VARIANT}" + name2="-$GAPPS_BRAND-${ANDROID_API_MAP[$ANDROID_API]}-${GAPPS_VARIANT}" else - name2="-$GAPPS_BRAND" + name2="-$GAPPS_BRAND-${ANDROID_API_MAP[$ANDROID_API]}" fi if [ "$GAPPS_BRAND" = "OpenGApps" ] && [ "$DEBUG" ]; then echo ":warning: Since OpenGApps doesn't officially support Android 12.1 yet, lock the variant to pico!" fi fi -artifact_name="WSA${name1}${name2}_${WSA_VER}_${ARCH}_${WSA_REL}" +artifact_name="WSA_${WSA_VER}_${ARCH}_${WSA_REL}${name1}${name2}" echo "$artifact_name" echo -e "\nFinishing building...." if [ -f "$OUTPUT_DIR" ]; then diff --git a/scripts/extractMagisk.py b/scripts/extractMagisk.py index 9c385bd..4c899da 100644 --- a/scripts/extractMagisk.py +++ b/scripts/extractMagisk.py @@ -23,6 +23,7 @@ import sys import zipfile from pathlib import Path import platform +import os is_x86_64 = platform.machine() in ("AMD64", "x86_64") host_abi = "x64" if is_x86_64 else "arm64" @@ -40,6 +41,10 @@ def extract_as(zip, name, as_name, dir): zip.extract(info, workdir / dir) with zipfile.ZipFile(magisk_zip) as zip: + comment = zip.comment.decode('utf-8') + with open(os.environ['WSA_WORK_ENV'], 'a') as environ_file: + environ_file.write(f'{comment}\n') + print(f'{comment}', flush=True) extract_as( zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk") extract_as( diff --git a/scripts/generateWSALinks.py b/scripts/generateWSALinks.py index 38600b4..be219a8 100644 --- a/scripts/generateWSALinks.py +++ b/scripts/generateWSALinks.py @@ -93,6 +93,7 @@ for i, v, f in identities: # out_file = download_dir / out_file_name elif re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", f): wsa_long_ver = re.search(u'\d{4}.\d{5}.\d{1,}.\d{1,}', f).group() + print(f'WSA Version={wsa_long_ver}\n') main_ver = wsa_long_ver.split(".")[0] with open(os.environ['WSA_WORK_ENV'], 'a') as environ_file: environ_file.write(f"DOWN_WSA_VERSION={wsa_long_ver}\n") diff --git a/xml/FE3FileUrl.xml b/xml/FE3FileUrl.xml index de2e6ad..840504a 100644 --- a/xml/FE3FileUrl.xml +++ b/xml/FE3FileUrl.xml @@ -34,7 +34,7 @@ FileUrl FileDecryption - BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.16184.1001;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.16184.1001;DeviceFamily=Windows.Desktop; + BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.22621.900;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.22621.900;DeviceFamily=Windows.Desktop; diff --git a/xml/WUIDRequest.xml b/xml/WUIDRequest.xml index 2a1be9e..c6a7eeb 100644 --- a/xml/WUIDRequest.xml +++ b/xml/WUIDRequest.xml @@ -670,7 +670,7 @@ false - BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.16184.1001;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.16184.1001;DeviceFamily=Windows.Desktop; + BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.22621.900;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.22621.900;DeviceFamily=Windows.Desktop; Interactive=1;IsSeeker=0;