mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-04-14 04:29:09 +00:00
Download correct WSA version (#712)
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:
parent
15f5d26742
commit
8548114d79
1 changed files with 9 additions and 7 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue