Skip to content

Commit

Permalink
Merge remote-tracking branch 'source/main' into source
Browse files Browse the repository at this point in the history
  • Loading branch information
wxy1343 committed Aug 26, 2022
2 parents 0df5bbb + bc4664d commit 8905ee9
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 184 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
- Keep each build up to date
- Support both ARM64 and x64
- Support all OpenGApps variants except for aroma (aroma does not support x86_64, please use super instead)
- Remove Amazon AppStore
- Fix VPN dialog not showing (use our [VpnDialogs app](https://github.com/LSPosed/VpnDialogs))
- Add device management feature
- Unattended installation
- Automatically activates developers mode in Windows 11
- Update to the new version while preserving data with a one-click script
Expand Down Expand Up @@ -73,12 +75,6 @@
- How can I get rid of Magisk?

Choose `none` as the root solution.
- Github script is updated, how can I synchronize it?

1. In your fork repository, click `fetch upstream`
![fetch](https://docs.github.com/assets/cb-33284/images/help/repository/fetch-upstream-drop-down.png)
1. Then click `fetch and merge`
![merge](https://docs.github.com/assets/cb-128489/images/help/repository/fetch-and-merge-button.png)

## Credits

Expand Down
5 changes: 2 additions & 3 deletions scripts/extractMagisk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
#!/usr/bin/python
#
# This file is part of MagiskOnWSALocal.
#
# MagiskOnWSALocal is free software: you can redistribute it and/or modify
Expand All @@ -17,8 +18,6 @@
# Copyright (C) 2022 LSPosed Contributors
#

#!/usr/bin/python

import sys

import zipfile
Expand Down
15 changes: 5 additions & 10 deletions scripts/extractWSA.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
#!/usr/bin/python
#
# This file is part of MagiskOnWSALocal.
#
# MagiskOnWSALocal is free software: you can redistribute it and/or modify
Expand All @@ -17,18 +18,11 @@
# Copyright (C) 2022 LSPosed Contributors
#

#!/usr/bin/python

import sys

import requests
from xml.dom import minidom
import html
import warnings
import re
import zipfile
import os
import urllib.request
from pathlib import Path

warnings.filterwarnings("ignore")
Expand All @@ -38,8 +32,9 @@
if not os.path.exists(Path.cwd().parent / sys.argv[2] / "wsa"):
os.makedirs(Path.cwd().parent / sys.argv[2] / "wsa")
zip_name = ""
workdir = Path.cwd().parent / sys.argv[2] / "wsa"
with zipfile.ZipFile(Path.cwd().parent / "download/wsa.zip") as zip:
wsa_zip_path= Path(sys.argv[2]).resolve()
workdir = Path.cwd().parent / sys.argv[3] / "wsa"
with zipfile.ZipFile(wsa_zip_path) as zip:
for f in zip.filelist:
if arch in f.filename.lower():
zip_name = f.filename
Expand Down
3 changes: 2 additions & 1 deletion scripts/fixGappsProp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
#!/usr/bin/python
#
# This file is part of MagiskOnWSALocal.
#
# MagiskOnWSALocal is free software: you can redistribute it and/or modify
Expand Down
23 changes: 9 additions & 14 deletions scripts/generateGappsLink.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
#!/usr/bin/python
#
# This file is part of MagiskOnWSALocal.
#
# MagiskOnWSALocal is free software: you can redistribute it and/or modify
Expand All @@ -17,8 +18,6 @@
# Copyright (C) 2022 LSPosed Contributors
#

#!/usr/bin/python

import sys

import requests
Expand All @@ -31,7 +30,7 @@
variant = sys.argv[2]
download_dir = Path.cwd().parent / "download" if sys.argv[3] == "" else Path(sys.argv[3]).resolve()
tempScript = sys.argv[4]
print(f"Generating OpenGapps download link: arch={arch} variant={variant}", flush=True)
print(f"Generating OpenGApps download link: arch={arch} variant={variant}", flush=True)
abi_map = {"x64": "x86_64", "arm64": "arm64"}
# TODO: keep it 11.0 since opengapps does not support 12+ yet
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and
Expand All @@ -43,20 +42,16 @@
link = {i["name"]: i for i in j["archs"][abi_map[arch]]
["apis"][release]["variants"]}[variant]["zip"]
except Exception:
print("Failed to fetch from opengapps api, fallbacking to sourceforge rss...")
print("Failed to fetch from OpenGApps API, fallbacking to SourceForge RSS...")
res = requests.get(
f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100')
link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace(
'.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps')

print(f"download link: {link}", flush=True)

out_file = download_dir / "gapps.zip"

if not os.path.isfile(out_file):
# urllib.request.urlretrieve(link, out_file)
with open(download_dir/tempScript, 'a') as f:
f.writelines(f'{link}\n')
f.writelines(f' dir={download_dir}\n')
f.writelines(f' out=gapps.zip\n')
f.close
with open(download_dir/tempScript, 'a') as f:
f.writelines(f'{link}\n')
f.writelines(f' dir={download_dir}\n')
f.writelines(f' out=OpenGApps-{arch}-{variant}.zip\n')
f.close
32 changes: 14 additions & 18 deletions scripts/generateMagiskLink.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
#!/usr/bin/python
#
# This file is part of MagiskOnWSALocal.
#
# MagiskOnWSALocal is free software: you can redistribute it and/or modify
Expand All @@ -17,30 +18,25 @@
# Copyright (C) 2022 LSPosed Contributors
#

#!/usr/bin/python

import sys

import os
import json
import requests
from pathlib import Path

magisk_apk = sys.argv[1]
magisk_ver = sys.argv[1]
download_dir = Path.cwd().parent / "download" if sys.argv[2] == "" else Path(sys.argv[2]).resolve()
tempScript = sys.argv[3]
print(f"Generating Magisk download link: release type={magisk_apk}", flush=True)
if not magisk_apk:
magisk_apk = "stable"
if magisk_apk == "stable" or magisk_apk == "beta" or magisk_apk == "canary" or magisk_apk == "debug":
magisk_apk = json.loads(requests.get(
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_apk}.json").content)['magisk']['link']
print(f"download link: {magisk_apk}", flush=True)
out_file = download_dir / "magisk.zip"
print(f"Generating Magisk download link: release type={magisk_ver}", flush=True)
if not magisk_ver:
magisk_ver = "stable"
if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or magisk_ver == "debug":
magisk_link = json.loads(requests.get(
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
print(f"download link: {magisk_link}", flush=True)

if not os.path.isfile(out_file):
# urllib.request.urlretrieve(magisk_apk, out_file)
with open(download_dir/tempScript, 'a') as f:
f.writelines(f'{magisk_apk}\n')
f.writelines(f' dir={download_dir}\n')
f.writelines(f' out=magisk.zip\n')
with open(download_dir/tempScript, 'a') as f:
f.writelines(f'{magisk_link}\n')
f.writelines(f' dir={download_dir}\n')
f.writelines(f' out=magisk-{magisk_ver}.zip\n')
25 changes: 11 additions & 14 deletions scripts/generateWSALinks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
#!/usr/bin/python
#
# This file is part of MagiskOnWSALocal.
#
# MagiskOnWSALocal is free software: you can redistribute it and/or modify
Expand All @@ -17,8 +18,6 @@
# Copyright (C) 2022 LSPosed Contributors
#

#!/usr/bin/python

import sys

import requests
Expand Down Expand Up @@ -86,14 +85,14 @@
tmpdownlist = open(download_dir/tempScript, 'a')
for i, v, f in identities:
if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", f):
out_file = download_dir / "xaml.appx"
out_file_name = "xaml.appx"
out_file_name = f"xaml-{arch}.appx"
out_file = download_dir / out_file_name
# elif re.match(f"Microsoft\.VCLibs\..+\.UWPDesktop_.*_{arch}_.*\.appx", f):
# out_file = download_dir / "vclibs.appx"
# out_file_name = "vclibs.appx"
elif re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", f):
out_file = download_dir / "wsa.zip"
out_file_name = "wsa.zip"
out_file_name = f"wsa-{arch}-{release_type}.zip"
out_file = download_dir / out_file_name
else:
continue
out = requests.post(
Expand All @@ -106,13 +105,11 @@
for l in doc.getElementsByTagName("FileLocation"):
url = l.getElementsByTagName("Url")[0].firstChild.nodeValue
if len(url) != 99:
if not os.path.isfile(out_file):
print(f"download link: {url} to {out_file}", flush=True)
# urllib.request.urlretrieve(url, out_file)
tmpdownlist.writelines(url + '\n')
tmpdownlist.writelines(f' dir={download_dir}\n')
tmpdownlist.writelines(f' out={out_file_name}\n')
print(f"download link: {url} to {out_file}", flush=True)
tmpdownlist.writelines(url + '\n')
tmpdownlist.writelines(f' dir={download_dir}\n')
tmpdownlist.writelines(f' out={out_file_name}\n')
tmpdownlist.writelines(f'https://aka.ms/Microsoft.VCLibs.{arch}.14.00.Desktop.appx\n')
tmpdownlist.writelines(f' dir={download_dir}\n')
tmpdownlist.writelines(f' out=vclibs.appx\n')
tmpdownlist.writelines(f' out=vclibs-{arch}.appx\n')
tmpdownlist.close
Loading

0 comments on commit 8905ee9

Please sign in to comment.