Compare commits
10 Commits
e854cc2be5
...
f7a13456e7
Author | SHA1 | Date |
---|---|---|
ColdWindScholar | f7a13456e7 | |
MustardChef | 45ab480fa4 | |
MustardChef | 7d667a07c0 | |
MustardChef | d7f5437f16 | |
MustardChef | 1ffac1d69a | |
ColdWindScholar | 548b24f7ba | |
ColdWindScholar | 05823d089d | |
ColdWindScholar | fa7b65b2d7 | |
ColdWindScholar | 28ac3beba3 | |
ColdWindScholar | 6090a01d09 |
|
@ -13,6 +13,7 @@ from xml.dom import minidom
|
|||
from requests import Session
|
||||
from packaging import version
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, props: str = ...) -> None:
|
||||
super().__init__()
|
||||
|
@ -29,15 +30,16 @@ class Prop(OrderedDict):
|
|||
def __repr__(self):
|
||||
return '\n'.join(f'{item}={self[item]}' for item in self)
|
||||
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = getenv('GITHUB_ENV')
|
||||
token = getenv("API_KEY")
|
||||
authorization = f'Bearer {token}'
|
||||
reqheaders = {
|
||||
"Accept": "application/vnd.github.v3+json",
|
||||
"Authorization" : authorization,
|
||||
"Authorization": authorization,
|
||||
}
|
||||
#Catagory ID
|
||||
# Catagory ID
|
||||
cat_id = '858014f3-3934-4abe-8078-4aa193e74ca8'
|
||||
|
||||
release_type = "WIF"
|
||||
|
@ -51,29 +53,37 @@ git = (
|
|||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
|
||||
|
||||
def MagiskandGappsChecker(type):
|
||||
global new_version_found
|
||||
# Get current version
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/" + type + ".appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/{type}.appversion").text.replace('\n',
|
||||
'')
|
||||
# Write for pushing later
|
||||
file = open('../' + type + '.appversion', 'w')
|
||||
file = open(f'../{type}.appversion', 'w')
|
||||
file.write(currentver)
|
||||
if new_version_found:
|
||||
return 0;
|
||||
return 0
|
||||
|
||||
# Get latest version
|
||||
latestver = ""
|
||||
msg = ""
|
||||
if (type == "magisk"):
|
||||
latestver = json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)['magisk']['version'].replace('\n', '')
|
||||
msg="Update Magisk Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
elif (type == "gapps"):
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/YT-Advanced/MindTheGappsBuilder/releases/latest", headers=reqheaders).content)['name']
|
||||
msg="Update MindTheGapps Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if type == "magisk":
|
||||
latestver = \
|
||||
json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)[
|
||||
'magisk'][
|
||||
'version'].replace('\n', '')
|
||||
msg = f"Update Magisk Version from `v{currentver}` to `v{latestver}`"
|
||||
elif type == "gapps":
|
||||
latestver = json.loads(
|
||||
requests.get(f"https://api.github.com/repos/YT-Advanced/MindTheGappsBuilder/releases/latest",
|
||||
).content)['name']
|
||||
msg = f"Update MindTheGapps Version from `v{currentver}` to `v{latestver}`"
|
||||
|
||||
# Check if version is the same or not
|
||||
if (currentver != latestver):
|
||||
print("New version found: " + latestver)
|
||||
if currentver != latestver:
|
||||
print(f"New version found: {latestver}")
|
||||
new_version_found = True
|
||||
# Write appversion content
|
||||
subprocess.Popen(git, shell=True, stdout=None, stderr=None, executable='/bin/bash').wait()
|
||||
|
@ -82,19 +92,22 @@ def MagiskandGappsChecker(type):
|
|||
file.write(latestver)
|
||||
# Write Github Environment
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write("SHOULD_BUILD=yes\nMSG=" + msg)
|
||||
wr.write(f"SHOULD_BUILD=yes\nMSG={msg}")
|
||||
file.close()
|
||||
|
||||
|
||||
def WSAChecker(user, release_type):
|
||||
global new_version_found
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/" + release_type + ".appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/{release_type}.appversion").text.replace(
|
||||
'\n', '')
|
||||
|
||||
# Write for pushing later
|
||||
file = open('../' + release_type + '.appversion', 'w')
|
||||
file.write(currentver)
|
||||
|
||||
if new_version_found:
|
||||
return 0;
|
||||
return 0
|
||||
# Get information
|
||||
with open("../xml/GetCookie.xml", "r") as f:
|
||||
cookie_content = f.read().format(user)
|
||||
|
@ -124,7 +137,8 @@ def WSAChecker(user, release_type):
|
|||
return 1
|
||||
doc = minidom.parseString(html.unescape(out.text))
|
||||
filenames = {}
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0].getElementsByTagName('Update'):
|
||||
for node in (doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0]
|
||||
.getElementsByTagName('Update')):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
node_files = node_xml.getElementsByTagName('Files')
|
||||
if not node_files:
|
||||
|
@ -132,8 +146,9 @@ def WSAChecker(user, release_type):
|
|||
else:
|
||||
for node_file in node_files[0].getElementsByTagName('File'):
|
||||
if node_file.hasAttribute('InstallerSpecificIdentifier') and node_file.hasAttribute('FileName'):
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (
|
||||
f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
identities = {}
|
||||
for node in doc.getElementsByTagName('NewUpdates')[0].getElementsByTagName('UpdateInfo'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
|
@ -146,16 +161,16 @@ def WSAChecker(user, release_type):
|
|||
fileinfo = filenames[id]
|
||||
if fileinfo[0] not in identities:
|
||||
identities[fileinfo[0]] = ([update_identity.attributes['UpdateID'].value,
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
wsa_build_ver = 0
|
||||
for filename, value in identities.items():
|
||||
if re.match(f"MicrosoftCorporationII.WindowsSubsystemForAndroid_.*.msixbundle", filename):
|
||||
tmp_wsa_build_ver = re.search(r"\d{4}.\d{5}.\d{1,}.\d{1,}", filename).group()
|
||||
if (wsa_build_ver == 0):
|
||||
tmp_wsa_build_ver = re.search(r"\d{4}.\d{5}.\d+.\d+", 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
|
||||
|
||||
|
||||
# Check new WSA version
|
||||
if version.parse(currentver) < version.parse(wsa_build_ver):
|
||||
print("New version found: " + wsa_build_ver)
|
||||
|
@ -166,11 +181,12 @@ def WSAChecker(user, release_type):
|
|||
file.truncate()
|
||||
file.write(wsa_build_ver)
|
||||
# Write Github Environment
|
||||
msg = 'Update WSA Version from `v' + currentver + '` to `v' + wsa_build_ver + '`'
|
||||
msg = f'Update WSA Version from `v{currentver}` to `v{wsa_build_ver}`'
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write("SHOULD_BUILD=yes\nRELEASE_TYPE=" + release_type + "\nMSG=" + msg)
|
||||
wr.write(f"SHOULD_BUILD=yes\nRELEASE_TYPE={release_type}\nMSG={msg}")
|
||||
file.close()
|
||||
|
||||
|
||||
# Get user_code (Thanks to @bubbles-wow because of his repository)
|
||||
users = {""}
|
||||
try:
|
||||
|
|
|
@ -71,7 +71,7 @@ with zipfile.ZipFile(magisk_zip) as zip:
|
|||
env.MAGISK_VERSION_CODE = versionCode
|
||||
with open(os.environ['WSA_WORK_ENV'], 'w') as environ_file:
|
||||
environ_file.write(str(env))
|
||||
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk")
|
||||
extract_as(zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk")
|
||||
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskinit", "magisk")
|
||||
extract_as(zip, f"lib/{ abi_map[host_abi][0] }/libmagiskboot.so", "magiskboot", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[arch][0]}/libmagisk64.so", "magisk64", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[arch][1]}/libmagisk32.so", "magisk32", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[arch][0]}/libmagiskinit.so", "magiskinit", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[host_abi][0]}/libmagiskboot.so", "magiskboot", "magisk")
|
||||
|
|
|
@ -23,6 +23,8 @@ from io import TextIOWrapper
|
|||
from typing import OrderedDict
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, file: TextIOWrapper) -> None:
|
||||
super().__init__()
|
||||
|
@ -40,6 +42,7 @@ class Prop(OrderedDict):
|
|||
self[f".{len(self)}"] = other
|
||||
return self
|
||||
|
||||
|
||||
new_props = {
|
||||
("product", "brand"): "google",
|
||||
("system", "brand"): "google",
|
||||
|
@ -55,6 +58,7 @@ new_props = {
|
|||
("build", "flavor"): sys.argv[2] + "-user"
|
||||
}
|
||||
|
||||
|
||||
def description(sec: str, p: Prop) -> str:
|
||||
return f"{p[f'ro.{sec}.build.flavor']} {p[f'ro.{sec}.build.version.release_or_codename']} {p[f'ro.{sec}.build.id']} {p[f'ro.{sec}.build.version.incremental']} {p[f'ro.{sec}.build.tags']}"
|
||||
|
||||
|
@ -92,5 +96,7 @@ def fix_prop(sec, prop):
|
|||
|
||||
|
||||
sys_path = sys.argv[1]
|
||||
for sec, prop in {"system": sys_path+"/system/build.prop", "vendor": sys_path+"/vendor/build.prop", "odm": sys_path+"/vendor/odm/etc/build.prop", "vendor_dlkm": sys_path+"/vendor/vendor_dlkm/etc/build.prop"}.items():
|
||||
for sec, prop in {"system": sys_path + "/system/build.prop", "vendor": sys_path + "/vendor/build.prop",
|
||||
"odm": sys_path + "/vendor/odm/etc/build.prop",
|
||||
"vendor_dlkm": sys_path + "/vendor/vendor_dlkm/etc/build.prop"}.items():
|
||||
fix_prop(sec, prop)
|
||||
|
|
|
@ -70,7 +70,7 @@ if res.status_code == 200:
|
|||
if re.match(f'kernel-WSA-{abi_map[arch]}-{kernelVersion}.*\.zip$', asset_name) and asset["content_type"] == "application/zip":
|
||||
tmp_kernel_ver = re.search(
|
||||
u'\d{1}.\d{1,}.\d{1,}.\d{1,}', asset_name.split("-")[3]).group()
|
||||
if (kernel_ver == 0):
|
||||
if kernel_ver == 0:
|
||||
kernel_ver = tmp_kernel_ver
|
||||
elif version.parse(kernel_ver) < version.parse(tmp_kernel_ver):
|
||||
kernel_ver = tmp_kernel_ver
|
||||
|
|
|
@ -26,11 +26,12 @@ import json
|
|||
import requests
|
||||
from pathlib import Path
|
||||
|
||||
#Android header
|
||||
# Android header
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 13; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.163 Mobile Safari/537.36',
|
||||
}
|
||||
|
||||
|
||||
class BearerAuth(requests.auth.AuthBase):
|
||||
def __init__(self, token):
|
||||
self.token = token
|
||||
|
@ -49,7 +50,7 @@ if Path.cwd().joinpath('token').exists():
|
|||
magisk_branch = sys.argv[1]
|
||||
magisk_ver = sys.argv[2]
|
||||
download_dir = Path.cwd().parent / \
|
||||
"download" if sys.argv[3] == "" else Path(sys.argv[3])
|
||||
"download" if sys.argv[3] == "" else Path(sys.argv[3])
|
||||
tempScript = sys.argv[4]
|
||||
download_files = {}
|
||||
print(
|
||||
|
@ -60,7 +61,8 @@ if not magisk_ver:
|
|||
if magisk_branch == "vvb2060":
|
||||
try:
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true", headers=headers).content)['download_url']
|
||||
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true",
|
||||
headers=headers).content)['download_url']
|
||||
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
|
||||
except Exception:
|
||||
print("Failed to fetch from AppCenter API...")
|
||||
|
@ -72,7 +74,8 @@ else:
|
|||
except Exception:
|
||||
print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['link']
|
||||
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk'][
|
||||
'link']
|
||||
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
|
||||
res = requests.get(
|
||||
f"https://api.github.com/repos/LSPosed/WSA-Addon/releases/latest", auth=github_auth)
|
||||
|
@ -94,7 +97,7 @@ elif res.status_code == 403 and x_ratelimit_remaining == '0':
|
|||
print(
|
||||
f"The current rate limit window resets in {ratelimit_reset}", flush=True)
|
||||
exit(1)
|
||||
with open(download_dir/tempScript, 'a') as f:
|
||||
with open(download_dir / tempScript, 'a') as f:
|
||||
for key, value in download_files.items():
|
||||
print(
|
||||
f"download link: {value}\npath: {download_dir / key}\n", flush=True)
|
||||
|
|
|
@ -70,7 +70,7 @@ if ms_account_conf.is_file():
|
|||
user = conf.get('user_code')
|
||||
print(
|
||||
f"Generating WSA download link: arch={arch} release_type={release_name}\n", flush=True)
|
||||
with open(Path.cwd().parent / ("xml/GetCookie.xml"), "r") as f:
|
||||
with open(Path.cwd().parent / "xml/GetCookie.xml", "r") as f:
|
||||
cookie_content = f.read().format(user)
|
||||
|
||||
out = session.post(
|
||||
|
@ -147,7 +147,7 @@ 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):
|
||||
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
|
||||
|
@ -164,7 +164,7 @@ for filename, values in identities.items():
|
|||
elif not release_name == 'latest' 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 != tmp_wsa_build_ver):
|
||||
if wsa_build_ver != tmp_wsa_build_ver:
|
||||
continue
|
||||
version_splitted = wsa_build_ver.split(".")
|
||||
major_ver = version_splitted[0]
|
||||
|
|
|
@ -3,20 +3,21 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/kernelsu.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/kernelsu.appversion").text.replace('\n', '')
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
with open('kernelsu.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
kernelsumsg = ""
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/tiann/kernelsu/releases/latest").content)['tag_name'].replace('v', '').replace('\n', '')
|
||||
kernelsumsg="Update KernelSU Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/tiann/kernelsu/releases/latest").content)[
|
||||
'tag_name'].replace('v', '').replace('\n', '')
|
||||
kernelsumsg = "Update KernelSU Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -26,9 +27,9 @@ if not new_version_found:
|
|||
file.truncate()
|
||||
file.write(latestver)
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
else:
|
||||
kernelsumsg = "KernelSU Version: `" + latestver + "`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
file.close()
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
file.close()
|
||||
|
|
|
@ -3,20 +3,23 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/gapps.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/gapps.appversion").text.replace('\n', '')
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
with open('gapps.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
mtgmsg = ""
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/MustardChef/MindTheGappsArchived/releases/latest").content)['name'].replace('\n', '')
|
||||
mtgmsg="Update MindTheGapps Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = \
|
||||
json.loads(
|
||||
requests.get(f"https://api.github.com/repos/MustardChef/MindTheGappsArchived/releases/latest").content)[
|
||||
'name'].replace('\n', '')
|
||||
mtgmsg = "Update MindTheGapps Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -26,9 +29,9 @@ if not new_version_found:
|
|||
file.truncate()
|
||||
file.write(latestver)
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
else:
|
||||
mtgmsg = "MindTheGapps Package Version: `" + latestver + "`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
file.close()
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
file.close()
|
||||
|
|
|
@ -3,20 +3,22 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskcanary.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskcanary.appversion").text.replace('\n', '')
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
with open('magiskcanary.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
magiskcanarymsg = ""
|
||||
latestver = json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/canary.json").content)['magisk']['version'].replace('\n', '')
|
||||
magiskcanarymsg="Update Magisk Canary Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = \
|
||||
json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/canary.json").content)['magisk'][
|
||||
'version'].replace('\n', '')
|
||||
magiskcanarymsg = "Update Magisk Canary Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -28,7 +30,7 @@ if not new_version_found:
|
|||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_CANARY_MSG={magiskcanarymsg}\n")
|
||||
else:
|
||||
magiskcanarymsg = "Magisk Canary Version: `" + latestver + "`"
|
||||
magiskcanarymsg = "Magisk Canary Version: `" + latestver + "`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_CANARY_MSG={magiskcanarymsg}\n")
|
||||
file.close()
|
||||
file.close()
|
||||
|
|
|
@ -3,20 +3,22 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskstable.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskstable.appversion").text.replace('\n', '')
|
||||
with open('magiskstable.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
magiskstablemsg = ""
|
||||
latestver = json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)['magisk']['version'].replace('\n', '')
|
||||
magiskstablemsg="Update Magisk Stable Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = \
|
||||
json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)['magisk'][
|
||||
'version'].replace('\n', '')
|
||||
magiskstablemsg = "Update Magisk Stable Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -28,7 +30,7 @@ if not new_version_found:
|
|||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_STABLE_MSG={magiskstablemsg}\n")
|
||||
else:
|
||||
magiskstablemsg = "Magisk Stable Version: `" + latestver + "`"
|
||||
magiskstablemsg = "Magisk Stable Version: `" + latestver + "`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_STABLE_MSG={magiskstablemsg}\n")
|
||||
file.close()
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import base64
|
||||
import os
|
||||
import html
|
||||
import json
|
||||
import re
|
||||
import requests
|
||||
import logging
|
||||
|
@ -13,6 +12,7 @@ from xml.dom import minidom
|
|||
from requests import Session
|
||||
from packaging import version
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, props: str = ...) -> None:
|
||||
super().__init__()
|
||||
|
@ -29,6 +29,7 @@ class Prop(OrderedDict):
|
|||
def __repr__(self):
|
||||
return '\n'.join(f'{item}={self[item]}' for item in self)
|
||||
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
|
||||
|
@ -66,10 +67,12 @@ except:
|
|||
users = {"", user_code}
|
||||
|
||||
# The code inside the function WSAInsiderUpdateChecker starts here
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/WIF.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/WIF.appversion").text.replace('\n', '')
|
||||
|
||||
print("Current working directory:", os.getcwd())
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml':", os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml'))
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml':",
|
||||
os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml'))
|
||||
|
||||
# Write for pushing later
|
||||
try:
|
||||
|
@ -109,7 +112,8 @@ if not new_version_found:
|
|||
exit(1)
|
||||
doc = minidom.parseString(html.unescape(out.text))
|
||||
filenames = {}
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0].getElementsByTagName('Update'):
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[
|
||||
0].getElementsByTagName('Update'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
node_files = node_xml.getElementsByTagName('Files')
|
||||
if not node_files:
|
||||
|
@ -117,8 +121,9 @@ if not new_version_found:
|
|||
else:
|
||||
for node_file in node_files[0].getElementsByTagName('File'):
|
||||
if node_file.hasAttribute('InstallerSpecificIdentifier') and node_file.hasAttribute('FileName'):
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (
|
||||
f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
identities = {}
|
||||
for node in doc.getElementsByTagName('NewUpdates')[0].getElementsByTagName('UpdateInfo'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
|
@ -131,16 +136,16 @@ if not new_version_found:
|
|||
fileinfo = filenames[id]
|
||||
if fileinfo[0] not in identities:
|
||||
identities[fileinfo[0]] = ([update_identity.attributes['UpdateID'].value,
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
wsa_build_ver = 0
|
||||
for filename, value in identities.items():
|
||||
if re.match(f"MicrosoftCorporationII.WindowsSubsystemForAndroid_.*.msixbundle", filename):
|
||||
tmp_wsa_build_ver = re.search(r"\d{4}.\d{5}.\d{1,}.\d{1,}", filename).group()
|
||||
if (wsa_build_ver == 0):
|
||||
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
|
||||
|
||||
|
||||
if version.parse(currentver) < version.parse(wsa_build_ver):
|
||||
print(f"New version found: {wsa_build_ver}")
|
||||
new_version_found = True
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
import base64
|
||||
import os
|
||||
import html
|
||||
import json
|
||||
import re
|
||||
import requests
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from typing import Any, OrderedDict
|
||||
from xml.dom import minidom
|
||||
|
||||
from requests import Session
|
||||
import requests
|
||||
from packaging import version
|
||||
from requests import Session
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, props: str = ...) -> None:
|
||||
|
@ -29,10 +27,11 @@ class Prop(OrderedDict):
|
|||
def __repr__(self):
|
||||
return '\n'.join(f'{item}={self[item]}' for item in self)
|
||||
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
|
||||
#Category ID
|
||||
# Category ID
|
||||
cat_id = '858014f3-3934-4abe-8078-4aa193e74ca8'
|
||||
|
||||
release_type = "retail"
|
||||
|
@ -50,9 +49,11 @@ user_code = ""
|
|||
users = {""}
|
||||
|
||||
print("Current working directory:", os.getcwd())
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml':", os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml'))
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml':",
|
||||
os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml'))
|
||||
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/retail.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/retail.appversion").text.replace('\n', '')
|
||||
|
||||
# Write for pushing later
|
||||
try:
|
||||
|
@ -92,7 +93,8 @@ if not new_version_found:
|
|||
exit(1)
|
||||
doc = minidom.parseString(html.unescape(out.text))
|
||||
filenames = {}
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0].getElementsByTagName('Update'):
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[
|
||||
0].getElementsByTagName('Update'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
node_files = node_xml.getElementsByTagName('Files')
|
||||
if not node_files:
|
||||
|
@ -100,8 +102,9 @@ if not new_version_found:
|
|||
else:
|
||||
for node_file in node_files[0].getElementsByTagName('File'):
|
||||
if node_file.hasAttribute('InstallerSpecificIdentifier') and node_file.hasAttribute('FileName'):
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (
|
||||
f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
identities = {}
|
||||
for node in doc.getElementsByTagName('NewUpdates')[0].getElementsByTagName('UpdateInfo'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
|
@ -114,16 +117,16 @@ if not new_version_found:
|
|||
fileinfo = filenames[id]
|
||||
if fileinfo[0] not in identities:
|
||||
identities[fileinfo[0]] = ([update_identity.attributes['UpdateID'].value,
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
wsa_build_ver = 0
|
||||
for filename, value in identities.items():
|
||||
if re.match(f"MicrosoftCorporationII.WindowsSubsystemForAndroid_.*.msixbundle", filename):
|
||||
tmp_wsa_build_ver = re.search(r"\d{4}.\d{5}.\d{1,}.\d{1,}", filename).group()
|
||||
if (wsa_build_ver == 0):
|
||||
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
|
||||
|
||||
|
||||
if version.parse(currentver) < version.parse(wsa_build_ver):
|
||||
print(f"New version found: {wsa_build_ver}")
|
||||
new_version_found = True
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
from bs4 import BeautifulSoup, Tag
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
# Load the README.md file
|
||||
with open('README.md', 'r') as file:
|
||||
|
@ -89,4 +90,4 @@ for (row_num, col_num), env_var in release_types[release_type]:
|
|||
|
||||
# Write the updated content back to the README.md file
|
||||
with open('README.md', 'w') as file:
|
||||
file.write(str(soup))
|
||||
file.write(str(soup))
|
||||
|
|
|
@ -18,7 +18,8 @@ target_table = None
|
|||
for table in soup.find_all('table'):
|
||||
ths = table.find_all('th')
|
||||
if len(ths) == 3:
|
||||
th_texts = [th.get_text(strip=True) if th.img is None else (th.img['alt'] if 'alt' in th.img.attrs else '') for th in ths]
|
||||
th_texts = [th.get_text(strip=True) if th.img is None else (th.img['alt'] if 'alt' in th.img.attrs else '') for
|
||||
th in ths]
|
||||
if all(header_text == header for header_text, header in zip(th_texts, headers)):
|
||||
target_table = table
|
||||
break
|
||||
|
@ -38,4 +39,4 @@ target_table.find_all('tr')[row_num].find_all('td')[col_num].string = github_env
|
|||
|
||||
# Write the updated content back to the README.md file
|
||||
with open('README.md', 'w') as file:
|
||||
file.write(str(soup))
|
||||
file.write(str(soup))
|
||||
|
|
|
@ -13,6 +13,7 @@ from xml.dom import minidom
|
|||
from requests import Session
|
||||
from packaging import version
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, props: str = ...) -> None:
|
||||
super().__init__()
|
||||
|
@ -29,13 +30,14 @@ class Prop(OrderedDict):
|
|||
def __repr__(self):
|
||||
return '\n'.join(f'{item}={self[item]}' for item in self)
|
||||
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = getenv('GITHUB_ENV')
|
||||
token = getenv("API_KEY")
|
||||
authorization = f'Bearer {token}'
|
||||
reqheaders = {
|
||||
"Accept": "application/vnd.github.v3+json",
|
||||
"Authorization" : authorization,
|
||||
"Authorization": authorization,
|
||||
}
|
||||
#Catagory ID
|
||||
cat_id = '858014f3-3934-4abe-8078-4aa193e74ca8'
|
||||
|
@ -51,28 +53,35 @@ git = (
|
|||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
|
||||
|
||||
def MagiskandGappsChecker(type):
|
||||
global new_version_found
|
||||
# Get current version
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/" + type + ".appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/" + type + ".appversion").text.replace('\n',
|
||||
'')
|
||||
# Write for pushing later
|
||||
file = open('../' + type + '.appversion', 'w')
|
||||
file.write(currentver)
|
||||
if new_version_found:
|
||||
return 0;
|
||||
return 0
|
||||
|
||||
# Get latest version
|
||||
latestver = ""
|
||||
msg = ""
|
||||
if (type == "magisk"):
|
||||
latestver = json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)['magisk']['version'].replace('\n', '')
|
||||
msg="Update Magisk Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
elif (type == "gapps"):
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/YT-Advanced/MindTheGappsBuilder/releases/latest", headers=reqheaders).content)['name']
|
||||
msg="Update MindTheGapps Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if type == "magisk":
|
||||
latestver = \
|
||||
json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)['magisk'][
|
||||
'version'].replace('\n', '')
|
||||
msg = "Update Magisk Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
elif type == "gapps":
|
||||
latestver = json.loads(
|
||||
requests.get(f"https://api.github.com/repos/YT-Advanced/MindTheGappsBuilder/releases/latest",
|
||||
headers=reqheaders).content)['name']
|
||||
msg = "Update MindTheGapps Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
|
||||
# Check if version is the same or not
|
||||
if (currentver != latestver):
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
# Write appversion content
|
||||
|
@ -85,16 +94,19 @@ def MagiskandGappsChecker(type):
|
|||
wr.write("SHOULD_BUILD=yes\nMSG=" + msg)
|
||||
file.close()
|
||||
|
||||
|
||||
def WSAChecker(user, release_type):
|
||||
global new_version_found
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/" + release_type + ".appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/YT-Advanced/WSA-Script/update/" + release_type + ".appversion").text.replace(
|
||||
'\n', '')
|
||||
|
||||
# Write for pushing later
|
||||
file = open('../' + release_type + '.appversion', 'w')
|
||||
file.write(currentver)
|
||||
|
||||
if new_version_found:
|
||||
return 0;
|
||||
return 0
|
||||
# Get information
|
||||
with open("../xml/GetCookie.xml", "r") as f:
|
||||
cookie_content = f.read().format(user)
|
||||
|
@ -124,7 +136,8 @@ def WSAChecker(user, release_type):
|
|||
return 1
|
||||
doc = minidom.parseString(html.unescape(out.text))
|
||||
filenames = {}
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0].getElementsByTagName('Update'):
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[
|
||||
0].getElementsByTagName('Update'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
node_files = node_xml.getElementsByTagName('Files')
|
||||
if not node_files:
|
||||
|
@ -132,8 +145,9 @@ def WSAChecker(user, release_type):
|
|||
else:
|
||||
for node_file in node_files[0].getElementsByTagName('File'):
|
||||
if node_file.hasAttribute('InstallerSpecificIdentifier') and node_file.hasAttribute('FileName'):
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (
|
||||
f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
identities = {}
|
||||
for node in doc.getElementsByTagName('NewUpdates')[0].getElementsByTagName('UpdateInfo'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
|
@ -146,19 +160,17 @@ def WSAChecker(user, release_type):
|
|||
fileinfo = filenames[id]
|
||||
if fileinfo[0] not in identities:
|
||||
identities[fileinfo[0]] = ([update_identity.attributes['UpdateID'].value,
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
wsa_build_ver = 0
|
||||
for filename, value in identities.items():
|
||||
if re.match(f"MicrosoftCorporationII.WindowsSubsystemForAndroid_.*.msixbundle", filename):
|
||||
tmp_wsa_build_ver = re.search(r"\d{4}.\d{5}.\d{1,}.\d{1,}", filename).group()
|
||||
if (wsa_build_ver == 0):
|
||||
if wsa_build_ver == 0 or version.parse(wsa_build_ver) < version.parse(tmp_wsa_build_ver):
|
||||
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
|
||||
|
||||
|
||||
# Check new WSA version
|
||||
if version.parse(currentver) < version.parse(wsa_build_ver):
|
||||
print("New version found: " + wsa_build_ver)
|
||||
print(f"New version found: {wsa_build_ver}")
|
||||
new_version_found = True
|
||||
# Write appversion content
|
||||
subprocess.Popen(git, shell=True, stdout=None, stderr=None, executable='/bin/bash').wait()
|
||||
|
@ -166,11 +178,12 @@ def WSAChecker(user, release_type):
|
|||
file.truncate()
|
||||
file.write(wsa_build_ver)
|
||||
# Write Github Environment
|
||||
msg = 'Update WSA Version from `v' + currentver + '` to `v' + wsa_build_ver + '`'
|
||||
msg = f'Update WSA Version from `v{currentver}` to `v{wsa_build_ver}`'
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write("SHOULD_BUILD=yes\nRELEASE_TYPE=" + release_type + "\nMSG=" + msg)
|
||||
wr.write(f"SHOULD_BUILD=yes\nRELEASE_TYPE={release_type}\nMSG={msg}")
|
||||
file.close()
|
||||
|
||||
|
||||
# Get user_code (Thanks to @bubbles-wow because of his repository)
|
||||
users = {""}
|
||||
try:
|
||||
|
@ -190,10 +203,8 @@ try:
|
|||
except:
|
||||
user_code = ""
|
||||
|
||||
if user_code == "":
|
||||
users = {""}
|
||||
else:
|
||||
users = {"", user_code}
|
||||
|
||||
users = {""} if user_code == "" else {"", user_code}
|
||||
for user in users:
|
||||
if user == "":
|
||||
print("Checking WSA Stable version...\n")
|
||||
|
|
|
@ -71,7 +71,7 @@ with zipfile.ZipFile(magisk_zip) as zip:
|
|||
env.MAGISK_VERSION_CODE = versionCode
|
||||
with open(os.environ['WSA_WORK_ENV'], 'w') as environ_file:
|
||||
environ_file.write(str(env))
|
||||
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk")
|
||||
extract_as(zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk")
|
||||
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskinit", "magisk")
|
||||
extract_as(zip, f"lib/{ abi_map[host_abi][0] }/libmagiskboot.so", "magiskboot", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[arch][0]}/libmagisk64.so", "magisk64", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[arch][1]}/libmagisk32.so", "magisk32", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[arch][0]}/libmagiskinit.so", "magiskinit", "magisk")
|
||||
extract_as(zip, f"lib/{abi_map[host_abi][0]}/libmagiskboot.so", "magiskboot", "magisk")
|
||||
|
|
|
@ -23,6 +23,8 @@ from io import TextIOWrapper
|
|||
from typing import OrderedDict
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, file: TextIOWrapper) -> None:
|
||||
super().__init__()
|
||||
|
@ -40,6 +42,7 @@ class Prop(OrderedDict):
|
|||
self[f".{len(self)}"] = other
|
||||
return self
|
||||
|
||||
|
||||
new_props = {
|
||||
("product", "brand"): "google",
|
||||
("system", "brand"): "google",
|
||||
|
@ -55,6 +58,7 @@ new_props = {
|
|||
("build", "flavor"): sys.argv[2] + "-user"
|
||||
}
|
||||
|
||||
|
||||
def description(sec: str, p: Prop) -> str:
|
||||
return f"{p[f'ro.{sec}.build.flavor']} {p[f'ro.{sec}.build.version.release_or_codename']} {p[f'ro.{sec}.build.id']} {p[f'ro.{sec}.build.version.incremental']} {p[f'ro.{sec}.build.tags']}"
|
||||
|
||||
|
@ -92,5 +96,7 @@ def fix_prop(sec, prop):
|
|||
|
||||
|
||||
sys_path = sys.argv[1]
|
||||
for sec, prop in {"system": sys_path+"/system/build.prop", "vendor": sys_path+"/vendor/build.prop", "odm": sys_path+"/vendor/odm/etc/build.prop", "vendor_dlkm": sys_path+"/vendor/vendor_dlkm/etc/build.prop"}.items():
|
||||
for sec, prop in {"system": sys_path + "/system/build.prop", "vendor": sys_path + "/vendor/build.prop",
|
||||
"odm": sys_path + "/vendor/odm/etc/build.prop",
|
||||
"vendor_dlkm": sys_path + "/vendor/vendor_dlkm/etc/build.prop"}.items():
|
||||
fix_prop(sec, prop)
|
||||
|
|
|
@ -70,7 +70,7 @@ if res.status_code == 200:
|
|||
if re.match(f'kernel-WSA-{abi_map[arch]}-{kernelVersion}.*\.zip$', asset_name) and asset["content_type"] == "application/zip":
|
||||
tmp_kernel_ver = re.search(
|
||||
u'\d{1}.\d{1,}.\d{1,}.\d{1,}', asset_name.split("-")[3]).group()
|
||||
if (kernel_ver == 0):
|
||||
if kernel_ver == 0:
|
||||
kernel_ver = tmp_kernel_ver
|
||||
elif version.parse(kernel_ver) < version.parse(tmp_kernel_ver):
|
||||
kernel_ver = tmp_kernel_ver
|
||||
|
|
|
@ -31,6 +31,7 @@ headers = {
|
|||
'User-Agent': 'Mozilla/5.0 (Linux; Android 13; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.163 Mobile Safari/537.36',
|
||||
}
|
||||
|
||||
|
||||
class BearerAuth(requests.auth.AuthBase):
|
||||
def __init__(self, token):
|
||||
self.token = token
|
||||
|
@ -49,7 +50,7 @@ if Path.cwd().joinpath('token').exists():
|
|||
magisk_branch = sys.argv[1]
|
||||
magisk_ver = sys.argv[2]
|
||||
download_dir = Path.cwd().parent / \
|
||||
"download" if sys.argv[3] == "" else Path(sys.argv[3])
|
||||
"download" if sys.argv[3] == "" else Path(sys.argv[3])
|
||||
tempScript = sys.argv[4]
|
||||
download_files = {}
|
||||
print(
|
||||
|
@ -60,7 +61,8 @@ if not magisk_ver:
|
|||
if magisk_branch == "vvb2060":
|
||||
try:
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true", headers=headers).content)['download_url']
|
||||
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true",
|
||||
headers=headers).content)['download_url']
|
||||
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
|
||||
except Exception:
|
||||
print("Failed to fetch from AppCenter API...")
|
||||
|
@ -72,7 +74,8 @@ else:
|
|||
except Exception:
|
||||
print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['link']
|
||||
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk'][
|
||||
'link']
|
||||
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
|
||||
res = requests.get(
|
||||
f"https://api.github.com/repos/LSPosed/WSA-Addon/releases/latest", auth=github_auth)
|
||||
|
@ -94,7 +97,7 @@ elif res.status_code == 403 and x_ratelimit_remaining == '0':
|
|||
print(
|
||||
f"The current rate limit window resets in {ratelimit_reset}", flush=True)
|
||||
exit(1)
|
||||
with open(download_dir/tempScript, 'a') as f:
|
||||
with open(download_dir / tempScript, 'a') as f:
|
||||
for key, value in download_files.items():
|
||||
print(
|
||||
f"download link: {value}\npath: {download_dir / key}\n", flush=True)
|
||||
|
|
|
@ -70,7 +70,7 @@ if ms_account_conf.is_file():
|
|||
user = conf.get('user_code')
|
||||
print(
|
||||
f"Generating WSA download link: arch={arch} release_type={release_name}\n", flush=True)
|
||||
with open(Path.cwd().parent / ("xml/GetCookie.xml"), "r") as f:
|
||||
with open(Path.cwd().parent / "xml/GetCookie.xml", "r") as f:
|
||||
cookie_content = f.read().format(user)
|
||||
|
||||
out = session.post(
|
||||
|
@ -147,7 +147,7 @@ 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):
|
||||
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
|
||||
|
@ -164,7 +164,7 @@ for filename, values in identities.items():
|
|||
elif not release_name == 'latest' 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 != tmp_wsa_build_ver):
|
||||
if wsa_build_ver != tmp_wsa_build_ver:
|
||||
continue
|
||||
version_splitted = wsa_build_ver.split(".")
|
||||
major_ver = version_splitted[0]
|
||||
|
|
|
@ -3,20 +3,21 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/kernelsu.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/kernelsu.appversion").text.replace('\n', '')
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
with open('kernelsu.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
kernelsumsg = ""
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/tiann/kernelsu/releases/latest").content)['tag_name'].replace('v', '').replace('\n', '')
|
||||
kernelsumsg="Update KernelSU Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/tiann/kernelsu/releases/latest").content)[
|
||||
'tag_name'].replace('v', '').replace('\n', '')
|
||||
kernelsumsg = "Update KernelSU Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -26,9 +27,9 @@ if not new_version_found:
|
|||
file.truncate()
|
||||
file.write(latestver)
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
else:
|
||||
kernelsumsg = "KernelSU Version: `" + latestver + "`"
|
||||
kernelsumsg = f"KernelSU Version: `{latestver}`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
file.close()
|
||||
wr.write(f"KERNEL_SU_MSG={kernelsumsg}\n")
|
||||
file.close()
|
||||
|
|
|
@ -3,20 +3,22 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/gapps.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/gapps.appversion").text.replace('\n', '')
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
with open('gapps.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
mtgmsg = ""
|
||||
latestver = json.loads(requests.get(f"https://api.github.com/repos/MustardChef/MindTheGappsArchived/releases/latest").content)['name'].replace('\n', '')
|
||||
mtgmsg="Update MindTheGapps Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = \
|
||||
json.loads(requests.get(f"https://api.github.com/repos/MustardChef/MindTheGappsArchived/releases/latest").content)[
|
||||
'name'].replace('\n', '')
|
||||
mtgmsg = "Update MindTheGapps Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -26,9 +28,9 @@ if not new_version_found:
|
|||
file.truncate()
|
||||
file.write(latestver)
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
else:
|
||||
mtgmsg = "MindTheGapps Package Version: `" + latestver + "`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
file.close()
|
||||
wr.write(f"MTG_MSG={mtgmsg}\n")
|
||||
file.close()
|
||||
|
|
|
@ -3,20 +3,22 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskcanary.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskcanary.appversion").text.replace('\n', '')
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
with open('magiskcanary.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
magiskcanarymsg = ""
|
||||
latestver = json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/canary.json").content)['magisk']['version'].replace('\n', '')
|
||||
magiskcanarymsg="Update Magisk Canary Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = \
|
||||
json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/canary.json").content)['magisk'][
|
||||
'version'].replace('\n', '')
|
||||
magiskcanarymsg = "Update Magisk Canary Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -28,7 +30,7 @@ if not new_version_found:
|
|||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_CANARY_MSG={magiskcanarymsg}\n")
|
||||
else:
|
||||
magiskcanarymsg = "Magisk Canary Version: `" + latestver + "`"
|
||||
magiskcanarymsg = "Magisk Canary Version: `" + latestver + "`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_CANARY_MSG={magiskcanarymsg}\n")
|
||||
file.close()
|
||||
file.close()
|
||||
|
|
|
@ -3,20 +3,22 @@ import json
|
|||
import requests
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
new_version_found = False
|
||||
git = (
|
||||
"git checkout -f update || git switch --discard-changes --orphan update"
|
||||
)
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskstable.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/magiskstable.appversion").text.replace('\n', '')
|
||||
with open('magiskstable.appversion', 'w') as file:
|
||||
file.write(currentver)
|
||||
if not new_version_found:
|
||||
latestver = ""
|
||||
magiskstablemsg = ""
|
||||
latestver = json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)['magisk']['version'].replace('\n', '')
|
||||
magiskstablemsg="Update Magisk Stable Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
latestver = \
|
||||
json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/stable.json").content)['magisk'][
|
||||
'version'].replace('\n', '')
|
||||
magiskstablemsg = "Update Magisk Stable Version from `v" + currentver + "` to `v" + latestver + "`"
|
||||
if currentver != latestver:
|
||||
print("New version found: " + latestver)
|
||||
new_version_found = True
|
||||
|
@ -28,7 +30,7 @@ if not new_version_found:
|
|||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_STABLE_MSG={magiskstablemsg}\n")
|
||||
else:
|
||||
magiskstablemsg = "Magisk Stable Version: `" + latestver + "`"
|
||||
magiskstablemsg = "Magisk Stable Version: `" + latestver + "`"
|
||||
with open(env_file, "a") as wr:
|
||||
wr.write(f"MAGISK_STABLE_MSG={magiskstablemsg}\n")
|
||||
file.close()
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import base64
|
||||
import os
|
||||
import html
|
||||
import json
|
||||
import re
|
||||
import requests
|
||||
import logging
|
||||
|
@ -13,6 +12,7 @@ from xml.dom import minidom
|
|||
from requests import Session
|
||||
from packaging import version
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, props: str = ...) -> None:
|
||||
super().__init__()
|
||||
|
@ -29,10 +29,11 @@ class Prop(OrderedDict):
|
|||
def __repr__(self):
|
||||
return '\n'.join(f'{item}={self[item]}' for item in self)
|
||||
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
|
||||
#Category ID
|
||||
# Category ID
|
||||
cat_id = '858014f3-3934-4abe-8078-4aa193e74ca8'
|
||||
|
||||
release_type = "WIF"
|
||||
|
@ -66,10 +67,12 @@ except:
|
|||
users = {"", user_code}
|
||||
|
||||
# The code inside the function WSAInsiderUpdateChecker starts here
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/WIF.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/WIF.appversion").text.replace('\n', '')
|
||||
|
||||
print("Current working directory:", os.getcwd())
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml':", os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml'))
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml':",
|
||||
os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal2/xml'))
|
||||
|
||||
# Write for pushing later
|
||||
try:
|
||||
|
@ -109,7 +112,8 @@ if not new_version_found:
|
|||
exit(1)
|
||||
doc = minidom.parseString(html.unescape(out.text))
|
||||
filenames = {}
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0].getElementsByTagName('Update'):
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[
|
||||
0].getElementsByTagName('Update'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
node_files = node_xml.getElementsByTagName('Files')
|
||||
if not node_files:
|
||||
|
@ -117,8 +121,9 @@ if not new_version_found:
|
|||
else:
|
||||
for node_file in node_files[0].getElementsByTagName('File'):
|
||||
if node_file.hasAttribute('InstallerSpecificIdentifier') and node_file.hasAttribute('FileName'):
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (
|
||||
f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
identities = {}
|
||||
for node in doc.getElementsByTagName('NewUpdates')[0].getElementsByTagName('UpdateInfo'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
|
@ -131,16 +136,16 @@ if not new_version_found:
|
|||
fileinfo = filenames[id]
|
||||
if fileinfo[0] not in identities:
|
||||
identities[fileinfo[0]] = ([update_identity.attributes['UpdateID'].value,
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
wsa_build_ver = 0
|
||||
for filename, value in identities.items():
|
||||
if re.match(f"MicrosoftCorporationII.WindowsSubsystemForAndroid_.*.msixbundle", filename):
|
||||
tmp_wsa_build_ver = re.search(r"\d{4}.\d{5}.\d{1,}.\d{1,}", filename).group()
|
||||
if (wsa_build_ver == 0):
|
||||
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
|
||||
|
||||
|
||||
if version.parse(currentver) < version.parse(wsa_build_ver):
|
||||
print(f"New version found: {wsa_build_ver}")
|
||||
new_version_found = True
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import base64
|
||||
import os
|
||||
import html
|
||||
import json
|
||||
import re
|
||||
import requests
|
||||
import logging
|
||||
|
@ -13,6 +11,7 @@ from xml.dom import minidom
|
|||
from requests import Session
|
||||
from packaging import version
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, props: str = ...) -> None:
|
||||
super().__init__()
|
||||
|
@ -29,6 +28,7 @@ class Prop(OrderedDict):
|
|||
def __repr__(self):
|
||||
return '\n'.join(f'{item}={self[item]}' for item in self)
|
||||
|
||||
|
||||
logging.captureWarnings(True)
|
||||
env_file = os.getenv('GITHUB_ENV')
|
||||
|
||||
|
@ -50,9 +50,11 @@ user_code = ""
|
|||
users = {""}
|
||||
|
||||
print("Current working directory:", os.getcwd())
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml':", os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml'))
|
||||
print("Files in '/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml':",
|
||||
os.listdir('/home/runner/work/WSABuilds/WSABuilds/MagiskOnWSALocal1/xml'))
|
||||
|
||||
currentver = requests.get(f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/retail.appversion").text.replace('\n', '')
|
||||
currentver = requests.get(
|
||||
f"https://raw.githubusercontent.com/MustardChef/WSABuilds/update/retail.appversion").text.replace('\n', '')
|
||||
|
||||
# Write for pushing later
|
||||
try:
|
||||
|
@ -92,7 +94,8 @@ if not new_version_found:
|
|||
exit(1)
|
||||
doc = minidom.parseString(html.unescape(out.text))
|
||||
filenames = {}
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[0].getElementsByTagName('Update'):
|
||||
for node in doc.getElementsByTagName('ExtendedUpdateInfo')[0].getElementsByTagName('Updates')[
|
||||
0].getElementsByTagName('Update'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
node_files = node_xml.getElementsByTagName('Files')
|
||||
if not node_files:
|
||||
|
@ -100,8 +103,9 @@ if not new_version_found:
|
|||
else:
|
||||
for node_file in node_files[0].getElementsByTagName('File'):
|
||||
if node_file.hasAttribute('InstallerSpecificIdentifier') and node_file.hasAttribute('FileName'):
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
filenames[node.getElementsByTagName('ID')[0].firstChild.nodeValue] = (
|
||||
f"{node_file.attributes['InstallerSpecificIdentifier'].value}_{node_file.attributes['FileName'].value}",
|
||||
node_xml.getElementsByTagName('ExtendedProperties')[0].attributes['PackageIdentityName'].value)
|
||||
identities = {}
|
||||
for node in doc.getElementsByTagName('NewUpdates')[0].getElementsByTagName('UpdateInfo'):
|
||||
node_xml = node.getElementsByTagName('Xml')[0]
|
||||
|
@ -114,16 +118,16 @@ if not new_version_found:
|
|||
fileinfo = filenames[id]
|
||||
if fileinfo[0] not in identities:
|
||||
identities[fileinfo[0]] = ([update_identity.attributes['UpdateID'].value,
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
update_identity.attributes['RevisionNumber'].value], fileinfo[1])
|
||||
wsa_build_ver = 0
|
||||
for filename, value in identities.items():
|
||||
if re.match(f"MicrosoftCorporationII.WindowsSubsystemForAndroid_.*.msixbundle", filename):
|
||||
tmp_wsa_build_ver = re.search(r"\d{4}.\d{5}.\d{1,}.\d{1,}", filename).group()
|
||||
if (wsa_build_ver == 0):
|
||||
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
|
||||
|
||||
|
||||
if version.parse(currentver) < version.parse(wsa_build_ver):
|
||||
print(f"New version found: {wsa_build_ver}")
|
||||
new_version_found = True
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
from bs4 import BeautifulSoup, Tag
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
# Load the README.md file
|
||||
with open('README.md', 'r') as file:
|
||||
|
@ -89,4 +89,4 @@ for (row_num, col_num), env_var in release_types[release_type]:
|
|||
|
||||
# Write the updated content back to the README.md file
|
||||
with open('README.md', 'w') as file:
|
||||
file.write(str(soup))
|
||||
file.write(str(soup))
|
||||
|
|
|
@ -72,33 +72,33 @@ with zipfile.ZipFile(magisk_zip) as zip:
|
|||
with open(os.environ['WSA_WORK_ENV'], 'w') as environ_file:
|
||||
environ_file.write(str(env))
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk")
|
||||
zip, f"lib/{abi_map[arch][0]}/libmagisk64.so", "magisk64", "magisk")
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk")
|
||||
zip, f"lib/{abi_map[arch][1]}/libmagisk32.so", "magisk32", "magisk")
|
||||
standalone_policy = False
|
||||
try:
|
||||
zip.getinfo(f"lib/{ abi_map[arch][0] }/libmagiskpolicy.so")
|
||||
zip.getinfo(f"lib/{abi_map[arch][0]}/libmagiskpolicy.so")
|
||||
standalone_policy = True
|
||||
except:
|
||||
pass
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskinit", "magisk")
|
||||
zip, f"lib/{abi_map[arch][0]}/libmagiskinit.so", "magiskinit", "magisk")
|
||||
if standalone_policy:
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[arch][0] }/libmagiskpolicy.so", "magiskpolicy", "magisk")
|
||||
zip, f"lib/{abi_map[arch][0]}/libmagiskpolicy.so", "magiskpolicy", "magisk")
|
||||
else:
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskpolicy", "magisk")
|
||||
zip, f"lib/{abi_map[arch][0]}/libmagiskinit.so", "magiskpolicy", "magisk")
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[arch][0] }/libmagiskboot.so", "magiskboot", "magisk")
|
||||
zip, f"lib/{abi_map[arch][0]}/libmagiskboot.so", "magiskboot", "magisk")
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[arch][0] }/libbusybox.so", "busybox", "magisk")
|
||||
zip, f"lib/{abi_map[arch][0]}/libbusybox.so", "busybox", "magisk")
|
||||
if standalone_policy:
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[host_abi][0] }/libmagiskpolicy.so", "magiskpolicy", ".")
|
||||
zip, f"lib/{abi_map[host_abi][0]}/libmagiskpolicy.so", "magiskpolicy", ".")
|
||||
else:
|
||||
extract_as(
|
||||
zip, f"lib/{ abi_map[host_abi][0] }/libmagiskinit.so", "magiskpolicy", ".")
|
||||
zip, f"lib/{abi_map[host_abi][0]}/libmagiskinit.so", "magiskpolicy", ".")
|
||||
extract_as(zip, f"assets/boot_patch.sh", "boot_patch.sh", "magisk")
|
||||
extract_as(zip, f"assets/util_functions.sh",
|
||||
"util_functions.sh", "magisk")
|
||||
|
|
|
@ -23,6 +23,8 @@ from io import TextIOWrapper
|
|||
from typing import OrderedDict
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
|
||||
class Prop(OrderedDict):
|
||||
def __init__(self, file: TextIOWrapper) -> None:
|
||||
super().__init__()
|
||||
|
@ -40,6 +42,7 @@ class Prop(OrderedDict):
|
|||
self[f".{len(self)}"] = other
|
||||
return self
|
||||
|
||||
|
||||
new_props = {
|
||||
("product", "brand"): "google",
|
||||
("system", "brand"): "google",
|
||||
|
@ -55,6 +58,7 @@ new_props = {
|
|||
("build", "flavor"): sys.argv[2] + "-user"
|
||||
}
|
||||
|
||||
|
||||
def description(sec: str, p: Prop) -> str:
|
||||
return f"{p[f'ro.{sec}.build.flavor']} {p[f'ro.{sec}.build.version.release_or_codename']} {p[f'ro.{sec}.build.id']} {p[f'ro.{sec}.build.version.incremental']} {p[f'ro.{sec}.build.tags']}"
|
||||
|
||||
|
@ -92,5 +96,7 @@ def fix_prop(sec, prop):
|
|||
|
||||
|
||||
sys_path = sys.argv[1]
|
||||
for sec, prop in {"system": sys_path+"/system/build.prop", "vendor": sys_path+"/vendor/build.prop", "odm": sys_path+"/vendor/odm/etc/build.prop", "vendor_dlkm": sys_path+"/vendor/vendor_dlkm/etc/build.prop"}.items():
|
||||
for sec, prop in {"system": sys_path + "/system/build.prop", "vendor": sys_path + "/vendor/build.prop",
|
||||
"odm": sys_path + "/vendor/odm/etc/build.prop",
|
||||
"vendor_dlkm": sys_path + "/vendor/vendor_dlkm/etc/build.prop"}.items():
|
||||
fix_prop(sec, prop)
|
||||
|
|
|
@ -66,7 +66,7 @@ if res.status_code == 200:
|
|||
for asset in assets:
|
||||
if re.match(f'kernel-WSA-{abi_map[arch]}-{kernelVersion}.*.zip$', asset["name"]) and asset["content_type"] == "application/zip":
|
||||
link = asset["browser_download_url"]
|
||||
if re.match(f'KernelSU_{release_name}_.*-release.*.apk$', asset["name"]) and asset["content_type"] == "application/vnd.android.package-archive":
|
||||
if re.match(f'KernelSU_{release_name}_.*-release.*.apk$', asset["name"]) or re.match(f'KernelSU_v.*-release.apk$', asset["name"]) and asset["content_type"] == "application/vnd.android.package-archive":
|
||||
apk = asset["browser_download_url"]
|
||||
break
|
||||
if link == "":
|
||||
|
|
|
@ -24,7 +24,7 @@ import json
|
|||
import requests
|
||||
from pathlib import Path
|
||||
|
||||
#Android header
|
||||
# Android header
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 13; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.163 Mobile Safari/537.36',
|
||||
}
|
||||
|
@ -38,28 +38,33 @@ if not magisk_ver:
|
|||
if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or magisk_ver == "debug":
|
||||
try:
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json", headers=headers).content)['magisk']['link']
|
||||
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json", headers=headers).content)[
|
||||
'magisk']['link']
|
||||
except Exception:
|
||||
print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json", headers=headers).content)['magisk']['link']
|
||||
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json",
|
||||
headers=headers).content)['magisk']['link']
|
||||
elif magisk_ver == "delta":
|
||||
try:
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://raw.githubusercontent.com/HuskyDG/magisk-files/main/canary.json", headers=headers).content)['magisk']['link']
|
||||
f"https://raw.githubusercontent.com/HuskyDG/magisk-files/main/canary.json", headers=headers).content)[
|
||||
'magisk']['link']
|
||||
except Exception:
|
||||
print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://fastly.jsdelivr.net/gh/HuskyDG/magisk-files@main/canary.json", headers=headers).content)['magisk']['link']
|
||||
f"https://fastly.jsdelivr.net/gh/HuskyDG/magisk-files@main/canary.json", headers=headers).content)[
|
||||
'magisk']['link']
|
||||
elif magisk_ver == "alpha":
|
||||
try:
|
||||
magisk_link = json.loads(requests.get(
|
||||
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true", headers=headers).content)['download_url']
|
||||
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true",
|
||||
headers=headers).content)['download_url']
|
||||
except Exception:
|
||||
print("Failed to fetch from AppCenter API...")
|
||||
print(f"download link: {magisk_link}", flush=True)
|
||||
|
||||
with open(download_dir/tempScript, 'a') as f:
|
||||
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')
|
||||
|
|
|
@ -70,7 +70,7 @@ if ms_account_conf.is_file():
|
|||
conf = Prop(f.read())
|
||||
user = conf.get('user_code')
|
||||
print(f"Generating WSA download link: arch={arch} release_type={release_name}\n", flush=True)
|
||||
with open(Path.cwd().parent / ("xml/GetCookie.xml"), "r") as f:
|
||||
with open(Path.cwd().parent / "xml/GetCookie.xml", "r") as f:
|
||||
cookie_content = f.read().format(user)
|
||||
|
||||
out = session.post(
|
||||
|
|
22
README.md
22
README.md
|
@ -7,8 +7,11 @@
|
|||
---
|
||||
|
||||
## Next LTS Release Date:
|
||||
### WSABuilds LTS 1: ~~``Wednesday 03rd April 2024``~~ **Available Now**
|
||||
### WSABuilds LTS 2: ``Wednesday 03rd May 2024``
|
||||
### WSABuilds LTS 1:
|
||||
~~``Wednesday 03rd April 2024``~~ **Available Now (via the Pre-release buttons in [Downloads](https://github.com/MustardChef/WSABuilds#downloads))**
|
||||
### WSABuilds LTS 2:
|
||||
~~``Wednesday 03rd May 2024``~~ **Available Now (via the Pre-release buttons in [Downloads](https://github.com/MustardChef/WSABuilds#downloads))**
|
||||
|
||||
---
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -229,6 +232,11 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>v2311.40000.5.0_LTS_1</td>
|
||||
<td>✅</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>v2311.40000.5.0_LTS_2</td>
|
||||
<td>➖</td>
|
||||
<td>➖</td>
|
||||
</tr>
|
||||
|
@ -290,12 +298,12 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td><b>Current Version:</b></td>
|
||||
<td>2311.40000.5.0_LTS_1</td>
|
||||
<td>2311.40000.5.0_LTS_2</td>
|
||||
<td colspan="2">2311.40000.5.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Release Date:</b></td>
|
||||
<td>03/04/2024</td>
|
||||
<td>03/05/2024</td>
|
||||
<td colspan="2">10/01/2024</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -316,11 +324,11 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="4"><img src="https://upload.wikimedia.org/wikipedia/commons/e/e6/Windows_11_logo.svg" style="width: 200px;"/></td>
|
||||
<td><p><a href="https://github.com/MustardChef/WSABuilds/releases/tag/Windows_11_2311.40000.5.0_LTS_1"><img alt="win11x64downpre" src="https://img.shields.io/badge/Download%20Latest%20Pre--Release%20Builds-Windows%2011%20x64-orange?style=for-the-badge&logo=windows11"/></a></p></td>
|
||||
<td><p><a href="https://github.com/MustardChef/WSABuilds/releases/tag/Windows_11_2311.40000.5.0_LTS_2"><img alt="win11x64downpre" src="https://img.shields.io/badge/Download%20Latest%20Pre--Release%20Builds-Windows%2011%20x64-orange?style=for-the-badge&logo=windows11"/></a></p></td>
|
||||
<td rowspan="2"><p><a href="https://x6cgr-my.sharepoint.com/:f:/g/personal/mcdt_x6cgr_onmicrosoft_com/EoVMTqCKkgVFvFlJTcz1u0gBdOBqLIwjT-9okE8eCpp3Aw?e=7y5PIT"><img src="https://img.shields.io/badge/OneDrive-white?style=for-the-badge&logo=Microsoft%20OneDrive&logoColor=0078D4" style="width: 150px;"/></a></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><a href="https://github.com/MustardChef/WSABuilds/releases/tag/Windows_11_2311.40000.5.0_LTS_1_arm64"><img alt="win11arm64downpre" src="https://img.shields.io/badge/Download%20Latest%20Pre--Release%20Builds-Windows%2011%20arm64-orange?style=for-the-badge&logo=windows11"/></a></p></td>
|
||||
<td><p><a href="https://github.com/MustardChef/WSABuilds/releases/tag/Windows_11_2311.40000.5.0_LTS_2_arm64"><img alt="win11arm64downpre" src="https://img.shields.io/badge/Download%20Latest%20Pre--Release%20Builds-Windows%2011%20arm64-orange?style=for-the-badge&logo=windows11"/></a></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><a href="https://github.com/MustardChef/WSABuilds/releases/tag/Windows_11_2311.40000.5.0"><img alt="win11x64downstable" src="https://img.shields.io/badge/Download%20Latest%20Stable%20Builds-Windows%2011%20x64-blue?style=for-the-badge&logo=windows11"/></a></p></td>
|
||||
|
@ -332,7 +340,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2"><img src="https://upload.wikimedia.org/wikipedia/commons/0/05/Windows_10_Logo.svg" style="width: 200px;"/></td>
|
||||
<td><p><a href="https://github.com/MustardChef/WSABuilds/releases/tag/Windows_10_2311.40000.5.0_LTS_1"><img alt="win10x64down" src="https://img.shields.io/badge/Download%20Latest%20Pre--Release%20Builds-Windows%2010%20x64-orange?style=for-the-badge&logo=windows"/></a></p></td>
|
||||
<td><p><a href="https://github.com/MustardChef/WSABuilds/releases/tag/Windows_10_2311.40000.5.0_LTS_2"><img alt="win10x64down" src="https://img.shields.io/badge/Download%20Latest%20Pre--Release%20Builds-Windows%2010%20x64-orange?style=for-the-badge&logo=windows"/></a></p></td>
|
||||
<td><p><a href="https://x6cgr-my.sharepoint.com/:f:/g/personal/mcdt_x6cgr_onmicrosoft_com/Enm0Tn0BRMlFmrfCWP9Omf0BCiQU0zybeXZtAyOfOVSQqA?e=v6UQyp"><img src="https://img.shields.io/badge/OneDrive-white?style=for-the-badge&logo=Microsoft%20OneDrive&logoColor=0078D4" style="width: 150px;"/></a></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -30,6 +30,7 @@ import logging
|
|||
import tkinter as tk
|
||||
from tkinter import messagebox
|
||||
|
||||
|
||||
# Check if the script is running as an administrator
|
||||
def is_admin():
|
||||
try:
|
||||
|
@ -37,6 +38,7 @@ def is_admin():
|
|||
except:
|
||||
return False
|
||||
|
||||
|
||||
if not is_admin():
|
||||
print("Please run this script as an administrator.")
|
||||
exit()
|
||||
|
@ -49,14 +51,18 @@ start_menu_dir = "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs"
|
|||
|
||||
# Define the directories to check
|
||||
dirs_to_check = [
|
||||
os.path.expandvars(r'%LocalAppData%\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(
|
||||
r'%LocalAppData%\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(r'%LocalAppData%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(r'C:\Windows\System32\config\systemprofile\AppData\Local\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(r'%LocalAppData%\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(
|
||||
r'C:\Windows\System32\config\systemprofile\AppData\Local\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(
|
||||
r'%LocalAppData%\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(r'C:\ProgramData\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe'),
|
||||
os.path.expandvars(r'%LocalAppData%\Local\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe')
|
||||
]
|
||||
|
||||
|
||||
def with_restore_point_creation_frequency(minutes, func):
|
||||
# Define the key path
|
||||
key_path = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore'
|
||||
|
@ -86,6 +92,7 @@ def with_restore_point_creation_frequency(minutes, func):
|
|||
# Close the key
|
||||
winreg.CloseKey(key)
|
||||
|
||||
|
||||
def create_restore_point(name):
|
||||
# Define the command
|
||||
cmd = f'powershell.exe -Command "Checkpoint-Computer -Description \'{name}\' -RestorePointType \'MODIFY_SETTINGS\'"'
|
||||
|
@ -97,6 +104,7 @@ def create_restore_point(name):
|
|||
if result.returncode != 0:
|
||||
raise Exception(f'Failed to create restore point. Command returned {result.returncode}')
|
||||
|
||||
|
||||
def uninstall_msix_package(package_full_name):
|
||||
# Define the PowerShell command
|
||||
cmd = f'powershell.exe -Command "Get-AppxPackage *{package_full_name}* | Remove-AppxPackage"'
|
||||
|
@ -104,15 +112,18 @@ def uninstall_msix_package(package_full_name):
|
|||
# Run the command
|
||||
subprocess.run(cmd, shell=True)
|
||||
|
||||
|
||||
def delete_directory(dir_path):
|
||||
# Check if the directory exists
|
||||
if os.path.exists(dir_path):
|
||||
# Delete the directory
|
||||
shutil.rmtree(dir_path)
|
||||
|
||||
|
||||
def delete_registry_folders():
|
||||
try:
|
||||
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 0, winreg.KEY_ALL_ACCESS)
|
||||
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 0,
|
||||
winreg.KEY_ALL_ACCESS)
|
||||
except WindowsError as e:
|
||||
logging.error(f"Failed to open key: {e}")
|
||||
return
|
||||
|
@ -132,25 +143,27 @@ def delete_registry_folders():
|
|||
break
|
||||
winreg.CloseKey(key)
|
||||
|
||||
|
||||
def delete_folders_and_files(root_path):
|
||||
target_string = 'MicrosoftCorporationII.WindowsSubsystemForAndroid'
|
||||
|
||||
|
||||
# Walk through the file system starting from the root_path
|
||||
for dirpath, dirnames, filenames in os.walk(root_path):
|
||||
|
||||
|
||||
# Check each directory
|
||||
for dirname in dirnames:
|
||||
if target_string in dirname:
|
||||
full_dir_path = os.path.join(dirpath, dirname)
|
||||
print(f"Deleting directory: {full_dir_path}")
|
||||
shutil.rmtree(full_dir_path)
|
||||
|
||||
|
||||
# Check each file
|
||||
for filename in filenames:
|
||||
if target_string in filename:
|
||||
full_file_path = os.path.join(dirpath, filename)
|
||||
print(f"Deleting file: {full_file_path}")
|
||||
os.remove(full_file_path)
|
||||
os.remove(full_file_path)
|
||||
|
||||
|
||||
def delete_shortcuts(target_string, start_menu_dir):
|
||||
# Walk through the file system starting from the start_menu_dir
|
||||
|
@ -163,7 +176,6 @@ def delete_shortcuts(target_string, start_menu_dir):
|
|||
os.remove(full_file_path)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
# Create a system restore point
|
||||
create_restore_point("WSABuilds Uninstallation Script Restore Point")
|
||||
|
@ -180,9 +192,10 @@ def main():
|
|||
|
||||
# Delete the registry folders
|
||||
delete_registry_folders()
|
||||
|
||||
|
||||
# Delete the shortcuts
|
||||
delete_shortcuts(target_string, start_menu_dir)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
with_restore_point_creation_frequency(0, main)
|
||||
with_restore_point_creation_frequency(0, main)
|
||||
|
|
Loading…
Reference in New Issue