Download correct WSA version ()

The previous script was subject to a race condition, since it searched download links for multiple versions and the last one finishing was the one used

Co-authored-by: Howard Wu <HowardWu20@outlook.com>
This commit is contained in:
Riccardo Nava 2023-10-24 15:48:01 +02:00 committed by GitHub
parent 15f5d26742
commit 8548114d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,6 +144,13 @@ def send_req(i, v, out_file_name):
threads = []
wsa_build_ver = 0
for filename, values in identities.items():
if re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", filename):
tmp_wsa_build_ver = re.search(u'\d{4}.\d{5}.\d{1,}.\d{1,}', filename).group()
if(wsa_build_ver == 0):
wsa_build_ver = tmp_wsa_build_ver
elif version.parse(wsa_build_ver) < version.parse(tmp_wsa_build_ver):
wsa_build_ver = tmp_wsa_build_ver
for filename, values in identities.items():
if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", filename):
out_file_name = f"{values[1]}_{arch}.appx"
@ -156,13 +163,8 @@ for filename, values in identities.items():
out_file = download_dir / out_file_name
elif not skip_wsa_download and re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", filename):
tmp_wsa_build_ver = re.search(u'\d{4}.\d{5}.\d{1,}.\d{1,}', filename).group()
if(wsa_build_ver == 0):
wsa_build_ver = tmp_wsa_build_ver
else:
if version.parse(wsa_build_ver) < version.parse(tmp_wsa_build_ver):
wsa_build_ver = tmp_wsa_build_ver
else:
continue
if(wsa_build_ver != tmp_wsa_build_ver):
continue
version_splitted = wsa_build_ver.split(".")
major_ver = version_splitted[0]
minor_ver = version_splitted[1]