├── .gitignore
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── feature_request.yml
│ └── bug_report.yml
├── pull_request_template.md
└── workflows
│ ├── issue_moderator.yml
│ └── wsa.yml
├── linker
├── x86_64
│ ├── libc.so
│ ├── libm.so
│ ├── libdl.so
│ └── linker64
└── aarch64
│ ├── libc.so
│ ├── libdl.so
│ ├── libm.so
│ └── linker64
├── wine
├── aarch64
│ └── makepri.exe
├── x86_64
│ └── makepri.exe
└── .cache
│ └── winetricks
│ └── msxml6
│ └── msxml6-KB973686-enu-amd64.exe
├── .gitattributes
├── x64
├── gapps
│ ├── priv-app
│ │ └── SetupWizard
│ │ │ └── SetupWizard.apk
│ └── product
│ │ └── overlay
│ │ └── GoogleWebViewOverlay.apk
└── system
│ └── system
│ └── priv-app
│ ├── WSAHelper
│ └── WSAHelper.apk
│ └── VpnDialogs
│ └── VpnDialogs.apk
├── arm64
├── gapps
│ ├── priv-app
│ │ └── SetupWizard
│ │ │ └── SetupWizard.apk
│ └── product
│ │ └── overlay
│ │ └── GoogleWebViewOverlay.apk
└── system
│ └── system
│ └── priv-app
│ ├── VpnDialogs
│ └── VpnDialogs.apk
│ └── WSAHelper
│ └── WSAHelper.apk
├── Custom-GApps.md
├── xml
├── GetCookie.xml
├── FE3FileUrl.xml
└── WUIDRequest.xml
├── scripts
├── generateMagiskLink.py
├── extractMagisk.py
├── extractWSA.py
├── generateGappsLink.py
├── fixGappsProp.py
├── generateWSALinks.py
├── run.sh
└── build.sh
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | download
2 | output
3 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [yujincheng08]
2 |
--------------------------------------------------------------------------------
/linker/x86_64/libc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/x86_64/libc.so
--------------------------------------------------------------------------------
/linker/x86_64/libm.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/x86_64/libm.so
--------------------------------------------------------------------------------
/linker/aarch64/libc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/aarch64/libc.so
--------------------------------------------------------------------------------
/linker/aarch64/libdl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/aarch64/libdl.so
--------------------------------------------------------------------------------
/linker/aarch64/libm.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/aarch64/libm.so
--------------------------------------------------------------------------------
/linker/aarch64/linker64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/aarch64/linker64
--------------------------------------------------------------------------------
/linker/x86_64/libdl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/x86_64/libdl.so
--------------------------------------------------------------------------------
/linker/x86_64/linker64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/linker/x86_64/linker64
--------------------------------------------------------------------------------
/wine/aarch64/makepri.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/wine/aarch64/makepri.exe
--------------------------------------------------------------------------------
/wine/x86_64/makepri.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/wine/x86_64/makepri.exe
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sh text eol=lf
2 | *.exe binary
3 | *.apk binary
4 | *.so binary
5 | *.xml text eol=crlf
6 |
--------------------------------------------------------------------------------
/x64/gapps/priv-app/SetupWizard/SetupWizard.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/x64/gapps/priv-app/SetupWizard/SetupWizard.apk
--------------------------------------------------------------------------------
/arm64/gapps/priv-app/SetupWizard/SetupWizard.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/arm64/gapps/priv-app/SetupWizard/SetupWizard.apk
--------------------------------------------------------------------------------
/x64/gapps/product/overlay/GoogleWebViewOverlay.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/x64/gapps/product/overlay/GoogleWebViewOverlay.apk
--------------------------------------------------------------------------------
/x64/system/system/priv-app/WSAHelper/WSAHelper.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/x64/system/system/priv-app/WSAHelper/WSAHelper.apk
--------------------------------------------------------------------------------
/arm64/gapps/product/overlay/GoogleWebViewOverlay.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/arm64/gapps/product/overlay/GoogleWebViewOverlay.apk
--------------------------------------------------------------------------------
/arm64/system/system/priv-app/VpnDialogs/VpnDialogs.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/arm64/system/system/priv-app/VpnDialogs/VpnDialogs.apk
--------------------------------------------------------------------------------
/arm64/system/system/priv-app/WSAHelper/WSAHelper.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/arm64/system/system/priv-app/WSAHelper/WSAHelper.apk
--------------------------------------------------------------------------------
/x64/system/system/priv-app/VpnDialogs/VpnDialogs.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/x64/system/system/priv-app/VpnDialogs/VpnDialogs.apk
--------------------------------------------------------------------------------
/wine/.cache/winetricks/msxml6/msxml6-KB973686-enu-amd64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wxy1343/MagiskOnWSALocal/HEAD/wine/.cache/winetricks/msxml6/msxml6-KB973686-enu-amd64.exe
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Ask a question/提问
4 | url: https://github.com/LSPosed/MagiskOnWSALocal/discussions/new?category=Q-A
5 | about: Please ask and answer questions here./如果有任何疑问请在这里提问
6 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
7 |
8 | Checklist
9 |
10 | - [ ] Referenced all related issues in the PR body (e.g. "Closes #xyz")
11 | - [ ] Have tested the modifications
12 |
--------------------------------------------------------------------------------
/Custom-GApps.md:
--------------------------------------------------------------------------------
1 | # How to install custom GApps
2 |
3 | 1. Build WSA without gapps to let the script download needed files
4 |
5 | `./build.sh --gapps-brand none`
6 | 1.
7 | - For OpenGApps
8 |
9 | Place custom OpenGApps to `download` folder and rename to `OpenGApps-{arch}-{variant}.zip` (e.g. `OpenGApps-x64-pico.zip`)
10 | - For MindTheGapps
11 |
12 | Place custom MindTheGapps to `download` folder and rename to `MindTheGapps-{arch}.zip` (e.g. `MindTheGapps-x64.zip`)
13 | 1. Build WSA offline
14 |
15 | `./build.sh --offline --gapps-brand {brand} --gapps-variant {variant}`
16 |
--------------------------------------------------------------------------------
/.github/workflows/issue_moderator.yml:
--------------------------------------------------------------------------------
1 | name: Issue moderator
2 |
3 | on:
4 | issues:
5 | types: [opened]
6 | pull_request:
7 | types: [opened, edited]
8 |
9 | jobs:
10 | autoclose:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Check issue
14 | uses: tachiyomiorg/issue-moderator-action@v1
15 | with:
16 | repo-token: ${{ secrets.GITHUB_TOKEN }}
17 | auto-close-rules: |
18 | [
19 | {
20 | "type": "title",
21 | "regex": ".*Short description.*",
22 | "message": "You did not fill out the description in the title"
23 | }
24 | ]
25 | auto-close-ignore-label: do-not-autoclose
26 | - name: Check PR
27 | uses: sumally/github-check-tasklist-action@v1
28 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request/新特性请求
3 | description: Suggest an idea./提出建议
4 | labels: [enhancement]
5 | title: "[Feature Request] Short description."
6 | body:
7 | - type: textarea
8 | attributes:
9 | label: Is your feature request related to a problem?/你的请求是否与某个问题相关?
10 | placeholder: A clear and concise description of what the problem is./请清晰准确表述该问题。
11 | validations:
12 | required: true
13 | - type: textarea
14 | attributes:
15 | label: Describe the solution you'd like/描述你想要的解决方案
16 | placeholder: A clear and concise description of what you want to happen./请清晰准确描述新特性的预期行为
17 | validations:
18 | required: true
19 | - type: textarea
20 | attributes:
21 | label: Additional context/其他信息
22 | placeholder: Add any other context or screenshots about the feature request here./其他关于新特性的信息或者截图
23 | validations:
24 | required: false
--------------------------------------------------------------------------------
/xml/GetCookie.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetCookie
4 | urn:uuid:b9b43757-2247-4d7b-ae8f-a71ba8a22386
5 | https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx
6 |
7 |
8 | 2017-12-02T00:16:15.210Z
9 | 2017-12-29T06:25:43.943Z
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 2015-10-21T17:01:07.1472913Z
23 | 2017-12-02T00:16:15.217Z
24 | 1.40
25 |
26 |
27 |
--------------------------------------------------------------------------------
/scripts/generateMagiskLink.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | import sys
22 |
23 | import json
24 | import requests
25 | from pathlib import Path
26 |
27 | magisk_ver = sys.argv[1]
28 | download_dir = Path.cwd().parent / "download" if sys.argv[2] == "" else Path(sys.argv[2]).resolve()
29 | tempScript = sys.argv[3]
30 | print(f"Generating Magisk download link: release type={magisk_ver}", flush=True)
31 | if not magisk_ver:
32 | magisk_ver = "stable"
33 | if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or magisk_ver == "debug":
34 | try:
35 | magisk_link = json.loads(requests.get(
36 | f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
37 | except Exception:
38 | print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
39 | magisk_link = json.loads(requests.get(
40 | f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['link']
41 | print(f"download link: {magisk_link}", flush=True)
42 |
43 | with open(download_dir/tempScript, 'a') as f:
44 | f.writelines(f'{magisk_link}\n')
45 | f.writelines(f' dir={download_dir}\n')
46 | f.writelines(f' out=magisk-{magisk_ver}.zip\n')
47 |
--------------------------------------------------------------------------------
/scripts/extractMagisk.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | import sys
22 |
23 | import zipfile
24 | from pathlib import Path
25 | import platform
26 |
27 | is_x86_64 = platform.machine() in ("AMD64", "x86_64")
28 | host_abi = "x64" if is_x86_64 else "arm64"
29 | arch = sys.argv[1]
30 | magisk_zip = sys.argv[2]
31 | workdir = Path(sys.argv[3]) / "magisk"
32 | if not Path(workdir).is_dir():
33 | workdir.mkdir()
34 |
35 | abi_map = {"x64": ["x86_64", "x86"], "arm64": ["arm64-v8a", "armeabi-v7a"]}
36 |
37 | def extract_as(zip, name, as_name, dir):
38 | info = zip.getinfo(name)
39 | info.filename = as_name
40 | zip.extract(info, workdir / dir)
41 |
42 | with zipfile.ZipFile(magisk_zip) as zip:
43 | extract_as(
44 | zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk")
45 | extract_as(
46 | zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk")
47 | standalone_policy = False
48 | try:
49 | zip.getinfo(f"lib/{ abi_map[arch][0] }/libmagiskpolicy.so")
50 | standalone_policy = True
51 | except:
52 | pass
53 | extract_as(
54 | zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskinit", "magisk")
55 | if standalone_policy:
56 | extract_as(
57 | zip, f"lib/{ abi_map[arch][0] }/libmagiskpolicy.so", "magiskpolicy", "magisk")
58 | else:
59 | extract_as(
60 | zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskpolicy", "magisk")
61 | extract_as(
62 | zip, f"lib/{ abi_map[arch][0] }/libmagiskboot.so", "magiskboot", "magisk")
63 | extract_as(
64 | zip, f"lib/{ abi_map[arch][0] }/libbusybox.so", "busybox", "magisk")
65 | if standalone_policy:
66 | extract_as(
67 | zip, f"lib/{ abi_map[host_abi][0] }/libmagiskpolicy.so", "magiskpolicy", ".")
68 | else:
69 | extract_as(
70 | zip, f"lib/{ abi_map[host_abi][0] }/libmagiskinit.so", "magiskpolicy", ".")
71 | extract_as(zip, f"assets/boot_patch.sh", "boot_patch.sh", "magisk")
72 | extract_as(zip, f"assets/util_functions.sh",
73 | "util_functions.sh", "magisk")
74 |
--------------------------------------------------------------------------------
/scripts/extractWSA.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | import sys
22 |
23 | import warnings
24 | import zipfile
25 | import os
26 | from pathlib import Path
27 |
28 | warnings.filterwarnings("ignore")
29 |
30 | arch = sys.argv[1]
31 |
32 | zip_name = ""
33 | wsa_zip_path= Path(sys.argv[2]).resolve()
34 | workdir = Path(sys.argv[3]) / "wsa"
35 | if not Path(workdir).is_dir():
36 | workdir.mkdir()
37 | with zipfile.ZipFile(wsa_zip_path) as zip:
38 | for f in zip.filelist:
39 | if arch in f.filename.lower():
40 | zip_name = f.filename
41 | output_name = zip_name[11:-5]
42 | if not Path(workdir / zip_name).is_file():
43 | zip_path = workdir / zip_name
44 | print(f"unzipping to {workdir}", flush=True)
45 | zip.extract(f, workdir)
46 | ver_no = zip_name.split("_")
47 | long_ver = ver_no[1]
48 | ver = long_ver.split(".")
49 | main_ver = ver[0]
50 | with open(os.environ['WSA_WORK_ENV'], 'a') as g:
51 | g.write(f'WSA_VER={long_ver}\n')
52 | with open(os.environ['WSA_WORK_ENV'], 'a') as g:
53 | g.write(f'WSA_MAIN_VER={main_ver}\n')
54 | rel = ver_no[3].split(".")
55 | rell = str(rel[0])
56 | with open(os.environ['WSA_WORK_ENV'], 'a') as g:
57 | g.write(f'WSA_REL={rell}\n')
58 | if 'language' in f.filename.lower() or 'scale' in f.filename.lower():
59 | name = f.filename.split("-", 1)[1].split(".")[0]
60 | zip.extract(f, workdir)
61 | with zipfile.ZipFile(workdir / f.filename) as l:
62 | for g in l.filelist:
63 | if g.filename == 'resources.pri':
64 | g.filename = f'{name}.pri'
65 | l.extract(g, workdir / 'pri')
66 | elif g.filename == 'AppxManifest.xml':
67 | g.filename = f'{name}.xml'
68 | l.extract(g, workdir / 'xml')
69 | with zipfile.ZipFile(zip_path) as zip:
70 | if not Path(workdir / arch).is_dir():
71 | print(f"unzipping from {zip_path}", flush=True)
72 | zip.extractall(workdir / arch)
73 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: Bug report/反馈 Bug
2 | description: Report errors or unexpected behavior./反馈错误或异常行为。
3 | labels: [bug]
4 | title: "[Bug] Short description."
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | Thanks for reporting issues of MagiskOnWSALocal!
10 |
11 | To make it easier for us to help you please enter detailed information below.
12 |
13 | 感谢给 MagiskOnWSALocal 汇报问题!
14 | 为了使我们更好地帮助你,请提供以下信息。
15 | 为了防止重复汇报,标题请务必使用英文。
16 | - type: textarea
17 | attributes:
18 | label: Steps to reproduce/复现步骤
19 | value: |
20 | 1.
21 | 2.
22 | 3.
23 | validations:
24 | required: true
25 | - type: textarea
26 | attributes:
27 | label: Expected behaviour/预期行为
28 | placeholder: Tell us what should happen/正常情况下应该发生什么
29 | validations:
30 | required: true
31 | - type: textarea
32 | attributes:
33 | label: Actual behaviour/实际行为
34 | placeholder: Tell us what happens instead/实际上发生了什么
35 | validations:
36 | required: true
37 | - type: input
38 | attributes:
39 | label: MagiskOnWSALocal commit full SHA/MagiskOnWSALocal 提交的完整哈希
40 | description: Don't use 'latest'. Copy and paste full commit SHA, otherwise your issue will be closed./不要填用“最新”。复制并粘贴完整 commit SHA,不然 issue 会被关闭。
41 | validations:
42 | required: true
43 | - type: textarea
44 | attributes:
45 | label: Linux distribution info/Linux 发行版信息
46 | validations:
47 | required: true
48 | - type: input
49 | attributes:
50 | label: Windows version/Windows 版本
51 | placeholder: 10.0.22000.978
52 | validations:
53 | required: true
54 | - type: textarea
55 | attributes:
56 | label: Build Parameters/构建参数
57 | description: The script prints the build information each time you start a build. It looks like this, please copy and paste it./每次开始构建时脚本都会打印构建信息,它看起来是这样的,请复制并粘贴上来。
58 | placeholder: |
59 | COMMAND_LINE=--arch x64 --release-type retail --magisk-ver stable --gapps-brand MindTheGapps --gapps-variant pico --root-sol magisk
60 | INFO: Architecture: x64
61 | INFO: Release Type: retail
62 | INFO: Magisk Version: stable
63 | INFO: GApps Brand: MindTheGapps
64 | INFO: GApps Variant: pico
65 | INFO: Root Solution: magisk
66 | Build: RELEASE_TYPE=Retail
67 | validations:
68 | required: true
69 | - type: checkboxes
70 | id: latest
71 | attributes:
72 | label: Version requirement/版本要求
73 | options:
74 | - label: I am using latest commit of MagiskOnWSALocal/我正在使用最新 commit 的版本
75 | required: true
76 | - type: textarea
77 | attributes:
78 | label: Logs/日志
79 | description: Please copy and paste the error or submit a screenshot. Without log, the issue will be closed. /请复制粘贴错误或提交截图。无日志提交会被关闭。
80 | value: |
81 |
82 | Details
83 |
84 |
85 |
86 |
87 | validations:
88 | required: true
89 |
--------------------------------------------------------------------------------
/scripts/generateGappsLink.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | import sys
22 |
23 | import requests
24 | import json
25 | import re
26 | from pathlib import Path
27 |
28 | arch = sys.argv[1]
29 | brand = sys.argv[2]
30 | variant = sys.argv[3]
31 | download_dir = Path.cwd().parent / \
32 | "download" if sys.argv[4] == "" else Path(sys.argv[4]).resolve()
33 | tempScript = sys.argv[5]
34 | print(
35 | f"Generating {brand} download link: arch={arch} variant={variant}", flush=True)
36 | abi_map = {"x64": "x86_64", "arm64": "arm64"}
37 | # TODO: keep it 11.0 since opengapps does not support 12+ yet
38 | # As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and
39 | # download the corresponding version
40 | release = "11.0"
41 | if brand == "OpenGApps":
42 | try:
43 | res = requests.get(f"https://api.opengapps.org/list")
44 | j = json.loads(res.content)
45 | link = {i["name"]: i for i in j["archs"][abi_map[arch]]
46 | ["apis"][release]["variants"]}[variant]["zip"]
47 | DATE=j["archs"][abi_map[arch]]["date"]
48 | print(f"DATE={DATE}", flush=True)
49 | except Exception:
50 | print("Failed to fetch from OpenGApps API, fallbacking to SourceForge RSS...")
51 | res = requests.get(
52 | f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100')
53 | link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace(
54 | '.zip/download', '.zip').replace('sourceforge.net/projects/opengapps/files', 'downloads.sourceforge.net/project/opengapps')
55 | elif brand == "MindTheGapps":
56 | res = requests.get(
57 | f'https://sourceforge.net/projects/wsa-mtg/rss?path=/{abi_map[arch]}&limit=100')
58 | link = re.search(f'https://.*{abi_map[arch]}/.*\.zip/download', res.text).group().replace(
59 | '.zip/download', '.zip').replace('sourceforge.net/projects/wsa-mtg/files', 'downloads.sourceforge.net/project/wsa-mtg')
60 |
61 | print(f"download link: {link}", flush=True)
62 |
63 | with open(download_dir/tempScript, 'a') as f:
64 | f.writelines(f'{link}\n')
65 | f.writelines(f' dir={download_dir}\n')
66 | if brand == "OpenGApps":
67 | f.writelines(f' out={brand}-{arch}-{variant}.zip\n')
68 | elif brand == "MindTheGapps":
69 | f.writelines(f' out={brand}-{arch}.zip\n')
70 |
--------------------------------------------------------------------------------
/scripts/fixGappsProp.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | from __future__ import annotations
22 | from io import TextIOWrapper
23 | from typing import OrderedDict
24 | from pathlib import Path
25 | import sys
26 | class Prop(OrderedDict):
27 | def __init__(self, file: TextIOWrapper) -> None:
28 | super().__init__()
29 | for i, line in enumerate(file.read().splitlines(False)):
30 | if '=' in line:
31 | k, v = line.split('=', 2)
32 | self[k] = v
33 | else:
34 | self[f".{i}"] = line
35 |
36 | def __str__(self) -> str:
37 | return '\n'.join([v if k.startswith('.') else f"{k}={v}" for k, v in self.items()])
38 |
39 | def __iadd__(self, other: str) -> Prop:
40 | self[f".{len(self)}"] = other
41 | return self
42 |
43 |
44 | new_props = {
45 | ("product", "brand"): "google",
46 | ("product", "manufacturer"): "Google",
47 | ("build", "product"): "redfin",
48 | ("product", "name"): "redfin",
49 | ("product", "device"): "redfin",
50 | ("product", "model"): "Pixel 5",
51 | ("build", "flavor"): "redfin-user"
52 | }
53 |
54 |
55 | def description(sec: str, p: Prop) -> str:
56 | 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']}"
57 |
58 |
59 | def fingerprint(sec: str, p: Prop) -> str:
60 | return f"""{p[f"ro.product.{sec}.brand"]}/{p[f"ro.product.{sec}.name"]}/{p[f"ro.product.{sec}.device"]}:{p[f"ro.{sec}.build.version.release"]}/{p[f"ro.{sec}.build.id"]}/{p[f"ro.{sec}.build.version.incremental"]}:{p[f"ro.{sec}.build.type"]}/{p[f"ro.{sec}.build.tags"]}"""
61 |
62 |
63 | def fix_prop(sec, prop):
64 | if not Path(prop).is_file():
65 | return
66 |
67 | print(f"fixing {prop}", flush=True)
68 | with open(prop, 'r') as f:
69 | p = Prop(f)
70 |
71 | p += "# extra prop added by MagiskOnWSA"
72 |
73 | for k, v in new_props.items():
74 | p[f"ro.{k[0]}.{k[1]}"] = v
75 |
76 | if k[0] == "build":
77 | p[f"ro.{sec}.{k[0]}.{k[1]}"] = v
78 | elif k[0] == "product":
79 | p[f"ro.{k[0]}.{sec}.{k[1]}"] = v
80 |
81 | p["ro.build.description"] = description(sec, p)
82 | p[f"ro.build.fingerprint"] = fingerprint(sec, p)
83 | p[f"ro.{sec}.build.description"] = description(sec, p)
84 | p[f"ro.{sec}.build.fingerprint"] = fingerprint(sec, p)
85 | p[f"ro.bootimage.build.fingerprint"] = fingerprint(sec, p)
86 |
87 | with open(prop, 'w') as f:
88 | f.write(str(p))
89 |
90 |
91 | sys_path = sys.argv[1]
92 | for sec, prop in {"system": sys_path+"/system/build.prop", "product": sys_path+"/product/build.prop", "system_ext": sys_path+"/system_ext/build.prop", "vendor": sys_path+"/vendor/build.prop", "odm": sys_path+"/vendor/odm/etc/build.prop"}.items():
93 | fix_prop(sec, prop)
94 |
--------------------------------------------------------------------------------
/xml/FE3FileUrl.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 | http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetExtendedUpdateInfo2
6 | urn:uuid:2cc99c2e-3b3e-4fb1-9e31-0cd30e6f43a0
7 | https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured
8 |
10 |
12 | 2017-08-01T00:29:01.868Z
13 | 2017-08-01T00:34:01.868Z
14 |
15 |
18 |
19 | dAA9AEUAdwBBAHcAQQBzAE4AMwBCAEEAQQBVADEAYgB5AHMAZQBtAGIAZQBEAFYAQwArADMAZgBtADcAbwBXAHkASAA3AGIAbgBnAEcAWQBtAEEAQQBMAGoAbQBqAFYAVQB2AFEAYwA0AEsAVwBFAC8AYwBDAEwANQBYAGUANABnAHYAWABkAGkAegBHAGwAZABjADEAZAAvAFcAeQAvAHgASgBQAG4AVwBRAGUAYwBtAHYAbwBjAGkAZwA5AGoAZABwAE4AawBIAG0AYQBzAHAAVABKAEwARAArAFAAYwBBAFgAbQAvAFQAcAA3AEgAagBzAEYANAA0AEgAdABsAC8AMQBtAHUAcgAwAFMAdQBtAG8AMABZAGEAdgBqAFIANwArADQAcABoAC8AcwA4ADEANgBFAFkANQBNAFIAbQBnAFIAQwA2ADMAQwBSAEoAQQBVAHYAZgBzADQAaQB2AHgAYwB5AEwAbAA2AHoAOABlAHgAMABrAFgAOQBPAHcAYQB0ADEAdQBwAFMAOAAxAEgANgA4AEEASABzAEoAegBnAFQAQQBMAG8AbgBBADIAWQBBAEEAQQBpAGcANQBJADMAUQAvAFYASABLAHcANABBAEIAcQA5AFMAcQBhADEAQgA4AGsAVQAxAGEAbwBLAEEAdQA0AHYAbABWAG4AdwBWADMAUQB6AHMATgBtAEQAaQBqAGgANQBkAEcAcgBpADgAQQBlAEUARQBWAEcAbQBXAGgASQBCAE0AUAAyAEQAVwA0ADMAZABWAGkARABUAHoAVQB0AHQARQBMAEgAaABSAGYAcgBhAGIAWgBsAHQAQQBUAEUATABmAHMARQBGAFUAYQBRAFMASgB4ADUAeQBRADgAagBaAEUAZQAyAHgANABCADMAMQB2AEIAMgBqAC8AUgBLAGEAWQAvAHEAeQB0AHoANwBUAHYAdAB3AHQAagBzADYAUQBYAEIAZQA4AHMAZwBJAG8AOQBiADUAQQBCADcAOAAxAHMANgAvAGQAUwBFAHgATgBEAEQAYQBRAHoAQQBYAFAAWABCAFkAdQBYAFEARQBzAE8AegA4AHQAcgBpAGUATQBiAEIAZQBUAFkAOQBiAG8AQgBOAE8AaQBVADcATgBSAEYAOQAzAG8AVgArAFYAQQBiAGgAcAAwAHAAUgBQAFMAZQBmAEcARwBPAHEAdwBTAGcANwA3AHMAaAA5AEoASABNAHAARABNAFMAbgBrAHEAcgAyAGYARgBpAEMAUABrAHcAVgBvAHgANgBuAG4AeABGAEQAbwBXAC8AYQAxAHQAYQBaAHcAegB5AGwATABMADEAMgB3AHUAYgBtADUAdQBtAHAAcQB5AFcAYwBLAFIAagB5AGgAMgBKAFQARgBKAFcANQBnAFgARQBJADUAcAA4ADAARwB1ADIAbgB4AEwAUgBOAHcAaQB3AHIANwBXAE0AUgBBAFYASwBGAFcATQBlAFIAegBsADkAVQBxAGcALwBwAFgALwB2AGUATAB3AFMAawAyAFMAUwBIAGYAYQBLADYAagBhAG8AWQB1AG4AUgBHAHIAOABtAGIARQBvAEgAbABGADYASgBDAGEAYQBUAEIAWABCAGMAdgB1AGUAQwBKAG8AOQA4AGgAUgBBAHIARwB3ADQAKwBQAEgAZQBUAGIATgBTAEUAWABYAHoAdgBaADYAdQBXADUARQBBAGYAZABaAG0AUwA4ADgAVgBKAGMAWgBhAEYASwA3AHgAeABnADAAdwBvAG4ANwBoADAAeABDADYAWgBCADAAYwBZAGoATAByAC8ARwBlAE8AegA5AEcANABRAFUASAA5AEUAawB5ADAAZAB5AEYALwByAGUAVQAxAEkAeQBpAGEAcABwAGgATwBQADgAUwAyAHQANABCAHIAUABaAFgAVAB2AEMAMABQADcAegBPACsAZgBHAGsAeABWAG0AKwBVAGYAWgBiAFEANQA1AHMAdwBFAD0AJgBwAD0A
20 |
21 |
22 |
23 |
24 |
25 |
27 |
28 |
29 | {}
30 | {}
31 |
32 |
33 |
34 | FileUrl
35 | FileDecryption
36 |
37 | BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.16184.1001;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.16184.1001;DeviceFamily=Windows.Desktop;
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/.github/workflows/wsa.yml:
--------------------------------------------------------------------------------
1 | name: Build WSA
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | arch:
7 | description: "Build arch"
8 | required: true
9 | default: "x64 & arm64"
10 | type: choice
11 | options:
12 | - x64
13 | - arm64
14 | - x64 & arm64
15 | release_type:
16 | description: "WSA release type"
17 | required: true
18 | default: "retail"
19 | type: choice
20 | options:
21 | - retail
22 | - release preview
23 | - insider slow
24 | - insider fast
25 | magisk_apk:
26 | description: "Magisk version"
27 | required: true
28 | default: "stable"
29 | type: choice
30 | options:
31 | - stable
32 | - beta
33 | - canary
34 | - debug
35 | gapps_variant:
36 | description: "Variants of gapps"
37 | required: true
38 | default: "pico"
39 | type: choice
40 | options:
41 | - none
42 | - super
43 | - stock
44 | - full
45 | - mini
46 | - micro
47 | - nano
48 | - pico
49 | - tvstock
50 | - tvmini
51 | remove_amazon:
52 | description: "Remove Amazon AppStore"
53 | required: true
54 | default: "keep"
55 | type: choice
56 | options:
57 | - keep
58 | - remove
59 | root_sol:
60 | description: "Root solution"
61 | required: true
62 | default: "magisk"
63 | type: choice
64 | options:
65 | - magisk
66 | - none
67 | jobs:
68 | matrix:
69 | runs-on: ubuntu-latest
70 | outputs:
71 | matrix: ${{ steps.set-matrix.outputs.matrix }}
72 | steps:
73 | - name: Generate build matrix
74 | id: set-matrix
75 | uses: actions/github-script@v6
76 | with:
77 | script: |
78 | let matrix = {};
79 | let arch = "${{ github.event.inputs.arch }}"
80 | switch ( arch ) {
81 | case "x64":
82 | matrix.arch = ["x64"];
83 | break;
84 | case "arm64":
85 | matrix.arch = ["arm64"];
86 | break;
87 | default:
88 | matrix.arch = ["x64", "arm64"];
89 | break;
90 | }
91 | core.setOutput("matrix",JSON.stringify(matrix));
92 |
93 | build:
94 | runs-on: ubuntu-latest
95 | needs: matrix
96 | strategy:
97 | matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
98 | steps:
99 | - uses: actions/checkout@v3
100 |
101 | - id: run
102 | env:
103 | ARCH: ${{ matrix.arch }}
104 | RELEASE_TYPE: ${{ github.event.inputs.release_type }}
105 | MAGISK_VER: ${{ github.event.inputs.magisk_apk }}
106 | GAPPS_VARIANT: ${{ github.event.inputs.gapps_variant }}
107 | REMOVE_AMAZON: ${{ github.event.inputs.remove_amazon }}
108 | ROOT_SOL: ${{ github.event.inputs.root_sol }}
109 | run: |
110 | ./scripts/run.sh
111 | path=$(find ./output -name "*.7z"|head -n 1)
112 | echo "##[set-output name=path;]$path"
113 | echo "##[set-output name=name;]$(basename $path)"
114 |
115 | - id: vars
116 | run: |
117 | echo "::set-output name=sha_short::$(git rev-parse --short "$GITHUB_SHA")"
118 |
119 | - uses: mukunku/tag-exists-action@v1.0.0
120 | id: checkTag
121 | with:
122 | tag: ${{ steps.vars.outputs.sha_short }}
123 | env:
124 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125 |
126 | - id: create_release
127 | uses: actions/create-release@v1
128 | if: ${{ steps.checkTag.outputs.exists == 'false' }}
129 | env:
130 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131 | with:
132 | tag_name: ${{ steps.vars.outputs.sha_short }}
133 | release_name: MagiskOnWSA
134 | draft: false
135 | prerelease: false
136 |
137 | - id: release_info
138 | uses: pdamianik/release-tag-to-upload-url-action@v1.0.1
139 | with:
140 | tag: ${{ steps.vars.outputs.sha_short }}
141 | token: ${{ github.token }}
142 |
143 | - name: Upload Release Asset
144 | id: upload-release-asset
145 | uses: actions/upload-release-asset@v1
146 | env:
147 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148 | with:
149 | upload_url: ${{ steps.release_info.outputs.uploadUrl }}
150 | asset_path: ${{ steps.run.outputs.path }}
151 | asset_name: ${{ steps.run.outputs.name }}
152 | asset_content_type: application/x-7z-compressed
153 |
--------------------------------------------------------------------------------
/scripts/generateWSALinks.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | import sys
22 |
23 | import requests
24 | from xml.dom import minidom
25 | import html
26 | import warnings
27 | import re
28 | from pathlib import Path
29 |
30 | warnings.filterwarnings("ignore")
31 |
32 | arch = sys.argv[1]
33 |
34 | release_name_map = {"retail": "Retail", "RP": "Release Preview",
35 | "WIS": "Insider Slow", "WIF": "Insider Fast"}
36 | release_type = sys.argv[2] if sys.argv[2] != "" else "Retail"
37 | release_name = release_name_map[release_type]
38 | download_dir = Path.cwd().parent / "download" if sys.argv[3] == "" else Path(sys.argv[3]).resolve()
39 | tempScript = sys.argv[4]
40 | cat_id = '858014f3-3934-4abe-8078-4aa193e74ca8'
41 | print(f"Generating WSA download link: arch={arch} release_type={release_name}", flush=True)
42 | with open(Path.cwd().parent / ("xml/GetCookie.xml"), "r") as f:
43 | cookie_content = f.read()
44 |
45 | out = requests.post(
46 | 'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx',
47 | data=cookie_content,
48 | headers={'Content-Type': 'application/soap+xml; charset=utf-8'},
49 | verify=False
50 | )
51 | doc = minidom.parseString(out.text)
52 | cookie = doc.getElementsByTagName('EncryptedData')[0].firstChild.nodeValue
53 |
54 | with open(Path.cwd().parent / "xml/WUIDRequest.xml", "r") as f:
55 | cat_id_content = f.read().format(cookie, cat_id, release_type)
56 |
57 | out = requests.post(
58 | 'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx',
59 | data=cat_id_content,
60 | headers={'Content-Type': 'application/soap+xml; charset=utf-8'},
61 | verify=False
62 | )
63 |
64 | doc = minidom.parseString(html.unescape(out.text))
65 |
66 | filenames = {}
67 | for node in doc.getElementsByTagName('Files'):
68 | filenames[node.parentNode.parentNode.getElementsByTagName(
69 | 'ID')[0].firstChild.nodeValue] = f"{node.firstChild.attributes['InstallerSpecificIdentifier'].value}_{node.firstChild.attributes['FileName'].value}"
70 | pass
71 |
72 | identities = []
73 | for node in doc.getElementsByTagName('SecuredFragment'):
74 | filename = filenames[node.parentNode.parentNode.parentNode.getElementsByTagName('ID')[
75 | 0].firstChild.nodeValue]
76 | update_identity = node.parentNode.parentNode.firstChild
77 | identities += [(update_identity.attributes['UpdateID'].value,
78 | update_identity.attributes['RevisionNumber'].value, filename)]
79 |
80 | with open(Path.cwd().parent / "xml/FE3FileUrl.xml", "r") as f:
81 | file_content = f.read()
82 |
83 | if not download_dir.is_dir():
84 | download_dir.mkdir()
85 | tmpdownlist = open(download_dir/tempScript, 'a')
86 | for i, v, f in identities:
87 | if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", f):
88 | out_file_name = f"Microsoft.UI.Xaml_{arch}.appx"
89 | out_file = download_dir / out_file_name
90 | # elif re.match(f"Microsoft\.VCLibs\..+\.UWPDesktop_.*_{arch}_.*\.appx", f):
91 | # out_file_name = f"Microsoft.VCLibs.140.00.UWPDesktop_{arch}.appx"
92 | # out_file = download_dir / out_file_name
93 | elif re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", f):
94 | out_file_name = f"wsa-{arch}-{release_type}.zip"
95 | out_file = download_dir / out_file_name
96 | else:
97 | continue
98 | out = requests.post(
99 | 'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured',
100 | data=file_content.format(i, v, release_type),
101 | headers={'Content-Type': 'application/soap+xml; charset=utf-8'},
102 | verify=False
103 | )
104 | doc = minidom.parseString(out.text)
105 | for l in doc.getElementsByTagName("FileLocation"):
106 | url = l.getElementsByTagName("Url")[0].firstChild.nodeValue
107 | if len(url) != 99:
108 | print(f"download link: {url} to {out_file}", flush=True)
109 | tmpdownlist.writelines(url + '\n')
110 | tmpdownlist.writelines(f' dir={download_dir}\n')
111 | tmpdownlist.writelines(f' out={out_file_name}\n')
112 | tmpdownlist.writelines(f'https://aka.ms/Microsoft.VCLibs.{arch}.14.00.Desktop.appx\n')
113 | tmpdownlist.writelines(f' dir={download_dir}\n')
114 | tmpdownlist.close()
115 |
--------------------------------------------------------------------------------
/scripts/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | # DEBUG=--debug
22 | # CUSTOM_MAGISK=--magisk-custom
23 |
24 | if [ ! "$BASH_VERSION" ]; then
25 | echo "Please do not use sh to run this script, just execute it directly" 1>&2
26 | exit 1
27 | fi
28 | cd "$(dirname "$0")" || exit 1
29 | SUDO="$(which sudo 2>/dev/null)"
30 | abort() {
31 | echo "Dependencies: an error has occurred, exit"
32 | exit 1
33 | }
34 | require_su() {
35 | if test "$(whoami)" != "root"; then
36 | if [ -z "$SUDO" ] && [ "$($SUDO whoami)" != "root" ]; then
37 | echo "ROOT/SUDO is required to run this script"
38 | abort
39 | fi
40 | fi
41 | }
42 | echo "Checking and ensuring dependencies"
43 | check_dependencies() {
44 | command -v whiptail >/dev/null 2>&1 || command -v dialog >/dev/null 2>&1 || NEED_INSTALL+=("whiptail")
45 | command -v seinfo >/dev/null 2>&1 || NEED_INSTALL+=("setools")
46 | command -v lzip >/dev/null 2>&1 || NEED_INSTALL+=("lzip")
47 | command -v wine64 >/dev/null 2>&1 || NEED_INSTALL+=("wine")
48 | command -v winetricks >/dev/null 2>&1 || NEED_INSTALL+=("winetricks")
49 | command -v patchelf >/dev/null 2>&1 || NEED_INSTALL+=("patchelf")
50 | command -v resize2fs >/dev/null 2>&1 || NEED_INSTALL+=("e2fsprogs")
51 | command -v pip >/dev/null 2>&1 || NEED_INSTALL+=("python3-pip")
52 | command -v aria2c >/dev/null 2>&1 || NEED_INSTALL+=("aria2")
53 | command -v 7z > /dev/null 2>&1 || NEED_INSTALL+=("p7zip-full")
54 | command -v setfattr > /dev/null 2>&1 || NEED_INSTALL+=("attr")
55 | command -v xz > /dev/null 2>&1 || NEED_INSTALL+=("xz-utils")
56 | command -v unzip > /dev/null 2>&1 || NEED_INSTALL+=("unzip")
57 | }
58 | check_dependencies
59 | osrel=$(sed -n '/^ID_LIKE=/s/^.*=//p' /etc/os-release);
60 | declare -A os_pm_install;
61 | # os_pm_install["/etc/redhat-release"]=yum
62 | # os_pm_install["/etc/arch-release"]=pacman
63 | # os_pm_install["/etc/gentoo-release"]=emerge
64 | os_pm_install["/etc/SuSE-release"]=zypper
65 | os_pm_install["/etc/debian_version"]=apt-get
66 | # os_pm_install["/etc/alpine-release"]=apk
67 |
68 | declare -A PM_UPDATE_MAP;
69 | PM_UPDATE_MAP["yum"]="check-update"
70 | PM_UPDATE_MAP["pacman"]="-Syu --noconfirm"
71 | PM_UPDATE_MAP["emerge"]="-auDN @world"
72 | PM_UPDATE_MAP["zypper"]="ref"
73 | PM_UPDATE_MAP["apt-get"]="update"
74 | PM_UPDATE_MAP["apk"]="update"
75 |
76 | declare -A PM_INSTALL_MAP;
77 | PM_INSTALL_MAP["yum"]="install -y"
78 | PM_INSTALL_MAP["pacman"]="-S --noconfirm --needed"
79 | PM_INSTALL_MAP["emerge"]="-a"
80 | PM_INSTALL_MAP["zypper"]="in -y"
81 | PM_INSTALL_MAP["apt-get"]="install -y"
82 | PM_INSTALL_MAP["apk"]="add"
83 |
84 | check_package_manager() {
85 | for f in "${!os_pm_install[@]}"; do
86 | if [[ -f $f ]]; then
87 | PM="${os_pm_install[$f]}"
88 | break
89 | fi
90 | done
91 | if [[ "$osrel" = *"suse"* ]]; then
92 | PM="zypper"
93 | fi
94 | if [ -n "$PM" ]; then
95 | readarray -td ' ' UPDATE_OPTION <<<"${PM_UPDATE_MAP[$PM]} "; unset 'UPDATE_OPTION[-1]';
96 | readarray -td ' ' INSTALL_OPTION <<<"${PM_INSTALL_MAP[$PM]} "; unset 'INSTALL_OPTION[-1]';
97 | fi
98 | }
99 |
100 | check_package_manager
101 | if [ -n "${NEED_INSTALL[*]}" ]; then
102 | if [ -z "$PM" ]; then
103 | echo "Unable to determine package manager: Unsupported distros"
104 | abort
105 | else
106 | if [ "$PM" = "zypper" ]; then
107 | NEED_INSTALL_FIX=${NEED_INSTALL[*]}
108 | {
109 | NEED_INSTALL_FIX=${NEED_INSTALL_FIX//setools/setools-console} 2>&1
110 | NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1
111 | NEED_INSTALL_FIX=${NEED_INSTALL_FIX//xz-utils/xz} 2>&1
112 | } >> /dev/null
113 |
114 | readarray -td ' ' NEED_INSTALL <<<"$NEED_INSTALL_FIX "; unset 'NEED_INSTALL[-1]';
115 | elif [ "$PM" = "apk" ]; then
116 | NEED_INSTALL_FIX=${NEED_INSTALL[*]}
117 | readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL_FIX//p7zip-full/p7zip} "; unset 'NEED_INSTALL[-1]';
118 | fi
119 | require_su
120 | if ! ($SUDO "$PM" "${UPDATE_OPTION[@]}" && $SUDO "$PM" "${INSTALL_OPTION[@]}" "${NEED_INSTALL[@]}") then abort; fi
121 | fi
122 | fi
123 | pip list --disable-pip-version-check | grep -E "^requests " >/dev/null 2>&1 || python3 -m pip install requests
124 |
125 | winetricks list-installed | grep -E "^msxml6" >/dev/null 2>&1 || {
126 | cp -r ../wine/.cache/* ~/.cache
127 | winetricks msxml6 || abort
128 | }
129 | WHIPTAIL=$(command -v whiptail 2>/dev/null)
130 | DIALOG=$(command -v dialog 2>/dev/null)
131 | DIALOG=${WHIPTAIL:-$DIALOG}
132 | function Radiolist {
133 | declare -A o="$1"
134 | shift
135 | if ! $DIALOG --nocancel --radiolist "${o[title]}" 0 0 0 "$@" 3>&1 1>&2 2>&3; then
136 | echo "${o[default]}"
137 | fi
138 | }
139 |
140 | function YesNoBox {
141 | declare -A o="$1"
142 | shift
143 | $DIALOG --title "${o[title]}" --yesno "${o[text]}" 0 0
144 | }
145 |
146 | if [ GAPPS_VARIANT != "none" ]; then
147 | GAPPS_BRAND="OpenGApps"
148 | fi
149 |
150 | COMPRESS_OUTPUT="--compress"
151 | COMPRESS_FORMAT="7z"
152 |
153 | declare -A RELEASE_TYPE_MAP=(["retail"]="retail" ["release preview"]="RP" ["insider slow"]="WIS" ["insider fast"]="WIF")
154 | COMMAND_LINE=(--arch "$ARCH" --release-type "${RELEASE_TYPE_MAP[$RELEASE_TYPE]}" --magisk-ver "$MAGISK_VER" --gapps-brand "$GAPPS_BRAND" --gapps-variant "$GAPPS_VARIANT" "$REMOVE_AMAZON" --root-sol "$ROOT_SOL" "$COMPRESS_OUTPUT" "$OFFLINE" "$DEBUG" "$CUSTOM_MAGISK" --debug --compress-format "$COMPRESS_FORMAT")
155 | echo "COMMAND_LINE=${COMMAND_LINE[*]}"
156 | ./build.sh "${COMMAND_LINE[@]}"
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Magisk on WSA (with Google Apps)
2 |
3 | :warning: For fork developers: Please don't build using GitHub Actions, as GitHub will count your forked GitHub Actions usage against this upstream repository, which may cause this upstream repository gets disabled by GitHub staff like [MagiskOnWSA](https://github.com/LSPosed/MagiskOnWSA) because of numerous forks building GitHub Actions, and counting the forks' Action usage against this upstream repository.
4 |
5 | ## Support for generating from these systems
6 |
7 | - Linux (x86_64 or arm64)
8 |
9 | The following dependencies are required: `setools lzip wine patchelf e2fsprogs aria2 python3 attr`
10 |
11 | The following components need to be installed using `winetricks`: `msxml6`
12 |
13 | The python3 library `requests` is used.
14 |
15 | Python version ≥ 3.7.
16 | - Recommended Use
17 | - Ubuntu (You can use [WSL2](https://apps.microsoft.com/store/search?publisher=Canonical%20Group%20Limited))
18 |
19 | Ready to use right out of the box.
20 | - Debian (You can use [WSL2](https://apps.microsoft.com/store/detail/debian/9MSVKQC78PK6))
21 |
22 | Need to add `contrib` sources to the source list to install winetricks.
23 |
24 | - OpenSUSE (You can use [WSL2](https://apps.microsoft.com/store/search?publisher=SUSE))
25 |
26 | Ready to use right out of the box.
27 |
28 | `run.sh` will handle all dependencies automatically.
29 |
30 | No need to type any commands.
31 | - Other Distributions
32 |
33 | Install the dependencies manually.
34 |
35 | Use the command-line program `build.sh`.
36 |
37 | ## Features
38 |
39 | - Integrate Magisk and GApps in a few clicks within minutes
40 | - Keep each build up to date
41 | - Support both ARM64 and x64
42 | - Support all OpenGApps variants except for aroma (aroma does not support x86_64, please use super instead)
43 | - Remove Amazon Appstore
44 | - Fix VPN dialog not showing (use our [VpnDialogs app](https://github.com/LSPosed/VpnDialogs))
45 | - Add device administration feature
46 | - Unattended installation
47 | - Automatically activates developers mode in Windows 11
48 | - Update to the new version while preserving data with a one-click script
49 | - Merged all language packs
50 | - Support managing start menu icons (manually installing [WSAHelper](https://github.com/LSPosed/WSAHelper/releases/latest) to use this feature)
51 |
52 | ## Text Guide
53 |
54 | 1. Star (if you like)
55 | 1. Clone the repo to local
56 | - Run `cd scripts`
57 | - Then run `./build.sh --help` (optional) to get the usage if you want to use CLI.
58 | 1. Run `./run.sh` under scripts directory.
59 | 1. Select the WSA version and its architecture (mostly x64).
60 | 1. Select the version of Magisk.
61 | 1. Choose which brand of GApps you want to install
62 | - OpenGApps
63 |
64 | Select the [OpenGApps variant](https://github.com/opengapps/opengapps/wiki#variants) you like.
65 | - MindtheGapps
66 |
67 | There is no other variant we can choose.
68 | 1. Select the root solution (none means no root)
69 | 1. If you are running the script for the first time, it will take some time to complete. After the script completes, two new folders named `output` and `download` will be generated in the `MagiskOnWSALocal` folder. Go to the `output` folder. While running the `./run.sh` script in the step 3, if you selected `Yes` for `Do you want to compress the output?` then in `output` folder you will see a compressed file called `WSA-with-magisk-stable-MindTheGapps_2207.40000.8.0_x64_Release-Nightly`or else there will be folder with the `WSA-with-magisk-stable-MindTheGapps_2207.40000.8.0_x64_Release-Nightly`. If there is a folder open it and skip to step 10. NOTE: The name of compressed file or the folder generated in the `output` folder may be different for you. It will be dependent on the choices made when executing `./run.sh`
70 | 1. Extract the compressed file and open the folder created after the extraction of the file.
71 | 1. Here look for file `Run.bat` and run it.
72 | - If you previously have a MagiskOnWSA installation, it will automatically uninstall the previous one while **preserving all user data** and install the new one, so don't worry about your data.
73 | - If you have an official WSA installation, you should uninstall it first. (In case you want to preserve your data, you can backup `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx` before uninstallation and restore it after installation.) (If you want to restore the icons to the start menu, please install and use [WSAHelper](https://github.com/LSPosed/WSAHelper/releases/latest).)
74 | - If the popup windows disappear **without asking administrative permission** and WSA is not installed successfully, you should manually run `Install.ps1` as administrator:
75 | 1. Press `Win+x` and select `Windows Terminal (Admin)`
76 | 2. Input `cd "{X:\path\to\your\extracted\folder}"` and press `enter`, and remember to replace `{X:\path\to\your\extracted\folder}` including the `{}`, for example `cd "D:\wsa"`
77 | 3. Input `PowerShell.exe -ExecutionPolicy Bypass -File .\Install.ps1` and press `enter`
78 | 4. The script will run and WSA will be installed
79 | 5. If this workaround does not work, your PC is not supported for WSA
80 | 1. Magisk/Play store will be launched. Enjoy by installing LSPosed-zygisk with zygisk enabled or Riru and LSPosed-riru
81 |
82 | ## FAQ
83 |
84 | - Can I delete the installed folder?
85 |
86 | No.
87 | - How can I update WSA to a new version?
88 |
89 | Delete the `download` folder
90 | Rerun the script, replace the content of your previous installation and rerun `Install.ps1`. Don't worry, your data will be preserved.
91 | - How can I get the logcat from WSA?
92 |
93 | `%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalState\diagnostics\logcat`
94 | - How can I update Magisk to a new version?
95 |
96 | Do the same as updating WSA
97 | - How to pass safetynet?
98 |
99 | Like all the other emulators, no way.
100 | - Virtualization is not enabled?
101 |
102 | `Install.ps1` helps you enable it if not enabled. After rebooting, rerun `Install.ps1` to install WSA. If it's still not working, you have to enable virtualization in BIOS. That's a long story so ask Google for help.
103 | - How to remount the system as read-write?
104 |
105 | No way in WSA since it's mounted as read-only by Hyper-V. You can modify the system by making a Magisk module. Or directly modify the system.img. Ask Google for help.
106 | - I cannot `adb connect localhost:58526`
107 |
108 | Make sure developer mode is enabled. If the issue persists, check the IP address of WSA on the setting page and try `adb connect ip:5555`.
109 | - Magisk online module list is empty?
110 |
111 | Magisk actively removes the online module repository. You can install the module locally or by `adb push module.zip /data/local/tmp` and `adb shell su -c magisk --install-module /data/local/tmp/module.zip`.
112 | - Can I use Magisk 23.0 stable or a lower version?
113 |
114 | No. Magisk has bugs preventing itself from running on WSA. Magisk 24+ has fixed them. So you must use Magisk 24 or higher version.
115 | - How can I get rid of Magisk?
116 |
117 | Choose `none` as the root solution.
118 | - How to install custom GApps?
119 |
120 | [Tutorial](./Custom-GApps.md)
121 | - Where can I download MindtheGapps?
122 |
123 | You can download from here [MindtheGapps](https://androidfilehost.com/?w=files&flid=322935) ([mirror](http://downloads.codefi.re/jdcteam/javelinanddart/gapps))
124 |
125 | Note that there is no x86_64 pre-build, so you need to build it by yourself ([Repository](https://gitlab.com/MindTheGapps/vendor_gapps)).
126 | - Can I switch OpenGApps to MindTheGapps and keep user data in a previous build?
127 |
128 | No. You should wipe data after changing the GApps brand. Otherwise, you will find that the installed GApps are not recognized.
129 |
130 | ## Credits
131 |
132 | - [StoreLib](https://github.com/StoreDev/StoreLib): API for downloading WSA
133 | - [Magisk](https://github.com/topjohnwu/Magisk): The most famous root solution on Android
134 | - [The Open GApps Project](https://opengapps.org): One of the most famous Google Apps packages solution
135 | - [WSA-Kernel-SU](https://github.com/LSPosed/WSA-Kernel-SU) and [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/): The kernel `su` for debugging Magisk Integration
136 | - [WSAGAScript](https://github.com/ADeltaX/WSAGAScript): The first GApps integration script for WSA
137 |
--------------------------------------------------------------------------------
/xml/WUIDRequest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 | http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/SyncUpdates
6 | urn:uuid:175df68c-4b91-41ee-b70b-f2208c65438e
7 | https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx
8 |
10 |
12 | 2017-08-05T02:03:05.038Z
13 | 2017-08-05T02:08:05.038Z
14 |
15 |
18 |
19 | dAA9AEUAdwBBAHcAQQBzAE4AMwBCAEEAQQBVADEAYgB5AHMAZQBtAGIAZQBEAFYAQwArADMAZgBtADcAbwBXAHkASAA3AGIAbgBnAEcAWQBtAEEAQQBMAGoAbQBqAFYAVQB2AFEAYwA0AEsAVwBFAC8AYwBDAEwANQBYAGUANABnAHYAWABkAGkAegBHAGwAZABjADEAZAAvAFcAeQAvAHgASgBQAG4AVwBRAGUAYwBtAHYAbwBjAGkAZwA5AGoAZABwAE4AawBIAG0AYQBzAHAAVABKAEwARAArAFAAYwBBAFgAbQAvAFQAcAA3AEgAagBzAEYANAA0AEgAdABsAC8AMQBtAHUAcgAwAFMAdQBtAG8AMABZAGEAdgBqAFIANwArADQAcABoAC8AcwA4ADEANgBFAFkANQBNAFIAbQBnAFIAQwA2ADMAQwBSAEoAQQBVAHYAZgBzADQAaQB2AHgAYwB5AEwAbAA2AHoAOABlAHgAMABrAFgAOQBPAHcAYQB0ADEAdQBwAFMAOAAxAEgANgA4AEEASABzAEoAegBnAFQAQQBMAG8AbgBBADIAWQBBAEEAQQBpAGcANQBJADMAUQAvAFYASABLAHcANABBAEIAcQA5AFMAcQBhADEAQgA4AGsAVQAxAGEAbwBLAEEAdQA0AHYAbABWAG4AdwBWADMAUQB6AHMATgBtAEQAaQBqAGgANQBkAEcAcgBpADgAQQBlAEUARQBWAEcAbQBXAGgASQBCAE0AUAAyAEQAVwA0ADMAZABWAGkARABUAHoAVQB0AHQARQBMAEgAaABSAGYAcgBhAGIAWgBsAHQAQQBUAEUATABmAHMARQBGAFUAYQBRAFMASgB4ADUAeQBRADgAagBaAEUAZQAyAHgANABCADMAMQB2AEIAMgBqAC8AUgBLAGEAWQAvAHEAeQB0AHoANwBUAHYAdAB3AHQAagBzADYAUQBYAEIAZQA4AHMAZwBJAG8AOQBiADUAQQBCADcAOAAxAHMANgAvAGQAUwBFAHgATgBEAEQAYQBRAHoAQQBYAFAAWABCAFkAdQBYAFEARQBzAE8AegA4AHQAcgBpAGUATQBiAEIAZQBUAFkAOQBiAG8AQgBOAE8AaQBVADcATgBSAEYAOQAzAG8AVgArAFYAQQBiAGgAcAAwAHAAUgBQAFMAZQBmAEcARwBPAHEAdwBTAGcANwA3AHMAaAA5AEoASABNAHAARABNAFMAbgBrAHEAcgAyAGYARgBpAEMAUABrAHcAVgBvAHgANgBuAG4AeABGAEQAbwBXAC8AYQAxAHQAYQBaAHcAegB5AGwATABMADEAMgB3AHUAYgBtADUAdQBtAHAAcQB5AFcAYwBLAFIAagB5AGgAMgBKAFQARgBKAFcANQBnAFgARQBJADUAcAA4ADAARwB1ADIAbgB4AEwAUgBOAHcAaQB3AHIANwBXAE0AUgBBAFYASwBGAFcATQBlAFIAegBsADkAVQBxAGcALwBwAFgALwB2AGUATAB3AFMAawAyAFMAUwBIAGYAYQBLADYAagBhAG8AWQB1AG4AUgBHAHIAOABtAGIARQBvAEgAbABGADYASgBDAGEAYQBUAEIAWABCAGMAdgB1AGUAQwBKAG8AOQA4AGgAUgBBAHIARwB3ADQAKwBQAEgAZQBUAGIATgBTAEUAWABYAHoAdgBaADYAdQBXADUARQBBAGYAZABaAG0AUwA4ADgAVgBKAGMAWgBhAEYASwA3AHgAeABnADAAdwBvAG4ANwBoADAAeABDADYAWgBCADAAYwBZAGoATAByAC8ARwBlAE8AegA5AEcANABRAFUASAA5AEUAawB5ADAAZAB5AEYALwByAGUAVQAxAEkAeQBpAGEAcABwAGgATwBQADgAUwAyAHQANABCAHIAUABaAFgAVAB2AEMAMABQADcAegBPACsAZgBHAGsAeABWAG0AKwBVAGYAWgBiAFEANQA1AHMAdwBFAD0AJgBwAD0A
20 |
21 |
22 |
23 |
24 |
25 |
27 |
28 | 2045-03-11T02:02:48Z
29 | {}
30 |
31 |
32 | false
33 |
34 | 1
35 | 2
36 | 3
37 | 11
38 | 19
39 | 544
40 | 549
41 | 2359974
42 | 2359977
43 | 5169044
44 | 8788830
45 | 23110993
46 | 23110994
47 | 54341900
48 | 54343656
49 | 59830006
50 | 59830007
51 | 59830008
52 | 60484010
53 | 62450018
54 | 62450019
55 | 62450020
56 | 66027979
57 | 66053150
58 | 97657898
59 | 98822896
60 | 98959022
61 | 98959023
62 | 98959024
63 | 98959025
64 | 98959026
65 | 104433538
66 | 104900364
67 | 105489019
68 | 117765322
69 | 129905029
70 | 130040031
71 | 132387090
72 | 132393049
73 | 133399034
74 | 138537048
75 | 140377312
76 | 143747671
77 | 158941041
78 | 158941042
79 | 158941043
80 | 158941044
81 | 159123858
82 | 159130928
83 | 164836897
84 | 164847386
85 | 164848327
86 | 164852241
87 | 164852246
88 | 164852252
89 | 164852253
90 |
91 |
92 | 10
93 | 17
94 | 2359977
95 | 5143990
96 | 5169043
97 | 5169047
98 | 8806526
99 | 9125350
100 | 9154769
101 | 10809856
102 | 23110995
103 | 23110996
104 | 23110999
105 | 23111000
106 | 23111001
107 | 23111002
108 | 23111003
109 | 23111004
110 | 24513870
111 | 28880263
112 | 30077688
113 | 30486944
114 | 30526991
115 | 30528442
116 | 30530496
117 | 30530501
118 | 30530504
119 | 30530962
120 | 30535326
121 | 30536242
122 | 30539913
123 | 30545142
124 | 30545145
125 | 30545488
126 | 30546212
127 | 30547779
128 | 30548797
129 | 30548860
130 | 30549262
131 | 30551160
132 | 30551161
133 | 30551164
134 | 30553016
135 | 30553744
136 | 30554014
137 | 30559008
138 | 30559011
139 | 30560006
140 | 30560011
141 | 30561006
142 | 30563261
143 | 30565215
144 | 30578059
145 | 30664998
146 | 30677904
147 | 30681618
148 | 30682195
149 | 30685055
150 | 30702579
151 | 30708772
152 | 30709591
153 | 30711304
154 | 30715418
155 | 30720106
156 | 30720273
157 | 30732075
158 | 30866952
159 | 30866964
160 | 30870749
161 | 30877852
162 | 30878437
163 | 30890151
164 | 30892149
165 | 30990917
166 | 31049444
167 | 31190936
168 | 31196961
169 | 31197811
170 | 31198836
171 | 31202713
172 | 31203522
173 | 31205442
174 | 31205557
175 | 31207585
176 | 31208440
177 | 31208451
178 | 31209591
179 | 31210536
180 | 31211625
181 | 31212713
182 | 31213588
183 | 31218518
184 | 31219420
185 | 31220279
186 | 31220302
187 | 31222086
188 | 31227080
189 | 31229030
190 | 31238236
191 | 31254198
192 | 31258008
193 | 36436779
194 | 36437850
195 | 36464012
196 | 41916569
197 | 47249982
198 | 47283134
199 | 58577027
200 | 58578040
201 | 58578041
202 | 58628920
203 | 59107045
204 | 59125697
205 | 59142249
206 | 60466586
207 | 60478936
208 | 66450441
209 | 66467021
210 | 66479051
211 | 75202978
212 | 77436021
213 | 77449129
214 | 85159569
215 | 90199702
216 | 90212090
217 | 96911147
218 | 97110308
219 | 98528428
220 | 98665206
221 | 98837995
222 | 98842922
223 | 98842977
224 | 98846632
225 | 98866485
226 | 98874250
227 | 98879075
228 | 98904649
229 | 98918872
230 | 98945691
231 | 98959458
232 | 98984707
233 | 100220125
234 | 100238731
235 | 100662329
236 | 100795834
237 | 100862457
238 | 103124811
239 | 103348671
240 | 104369981
241 | 104372472
242 | 104385324
243 | 104465831
244 | 104465834
245 | 104467697
246 | 104473368
247 | 104482267
248 | 104505005
249 | 104523840
250 | 104550085
251 | 104558084
252 | 104659441
253 | 104659675
254 | 104664678
255 | 104668274
256 | 104671092
257 | 104673242
258 | 104674239
259 | 104679268
260 | 104686047
261 | 104698649
262 | 104751469
263 | 104752478
264 | 104755145
265 | 104761158
266 | 104762266
267 | 104786484
268 | 104853747
269 | 104873258
270 | 104983051
271 | 105063056
272 | 105116588
273 | 105178523
274 | 105318602
275 | 105362613
276 | 105364552
277 | 105368563
278 | 105369591
279 | 105370746
280 | 105373503
281 | 105373615
282 | 105376634
283 | 105377546
284 | 105378752
285 | 105379574
286 | 105381626
287 | 105382587
288 | 105425313
289 | 105495146
290 | 105862607
291 | 105939029
292 | 105995585
293 | 106017178
294 | 106129726
295 | 106768485
296 | 107825194
297 | 111906429
298 | 115121473
299 | 115578654
300 | 116630363
301 | 117835105
302 | 117850671
303 | 118638500
304 | 118662027
305 | 118872681
306 | 118873829
307 | 118879289
308 | 118889092
309 | 119501720
310 | 119551648
311 | 119569538
312 | 119640702
313 | 119667998
314 | 119674103
315 | 119697201
316 | 119706266
317 | 119744627
318 | 119773746
319 | 120072697
320 | 120144309
321 | 120214154
322 | 120357027
323 | 120392612
324 | 120399120
325 | 120553945
326 | 120783545
327 | 120797092
328 | 120881676
329 | 120889689
330 | 120999554
331 | 121168608
332 | 121268830
333 | 121341838
334 | 121729951
335 | 121803677
336 | 122165810
337 | 125408034
338 | 127293130
339 | 127566683
340 | 127762067
341 | 127861893
342 | 128571722
343 | 128647535
344 | 128698922
345 | 128701748
346 | 128771507
347 | 129037212
348 | 129079800
349 | 129175415
350 | 129317272
351 | 129319665
352 | 129365668
353 | 129378095
354 | 129424803
355 | 129590730
356 | 129603714
357 | 129625954
358 | 129692391
359 | 129714980
360 | 129721097
361 | 129886397
362 | 129968371
363 | 129972243
364 | 130009862
365 | 130033651
366 | 130040030
367 | 130040032
368 | 130040033
369 | 130091954
370 | 130100640
371 | 130131267
372 | 130131921
373 | 130144837
374 | 130171030
375 | 130172071
376 | 130197218
377 | 130212435
378 | 130291076
379 | 130402427
380 | 130405166
381 | 130676169
382 | 130698471
383 | 130713390
384 | 130785217
385 | 131396908
386 | 131455115
387 | 131682095
388 | 131689473
389 | 131701956
390 | 132142800
391 | 132525441
392 | 132765492
393 | 132801275
394 | 133399034
395 | 134522926
396 | 134524022
397 | 134528994
398 | 134532942
399 | 134536993
400 | 134538001
401 | 134547533
402 | 134549216
403 | 134549317
404 | 134550159
405 | 134550214
406 | 134550232
407 | 134551154
408 | 134551207
409 | 134551390
410 | 134553171
411 | 134553237
412 | 134554199
413 | 134554227
414 | 134555229
415 | 134555240
416 | 134556118
417 | 134557078
418 | 134560099
419 | 134560287
420 | 134562084
421 | 134562180
422 | 134563287
423 | 134565083
424 | 134566130
425 | 134568111
426 | 134624737
427 | 134666461
428 | 134672998
429 | 134684008
430 | 134916523
431 | 135100527
432 | 135219410
433 | 135222083
434 | 135306997
435 | 135463054
436 | 135779456
437 | 135812968
438 | 136097030
439 | 136131333
440 | 136146907
441 | 136157556
442 | 136320962
443 | 136450641
444 | 136466000
445 | 136745792
446 | 136761546
447 | 136840245
448 | 138160034
449 | 138181244
450 | 138210071
451 | 138210107
452 | 138232200
453 | 138237088
454 | 138277547
455 | 138287133
456 | 138306991
457 | 138324625
458 | 138341916
459 | 138372035
460 | 138372036
461 | 138375118
462 | 138378071
463 | 138380128
464 | 138380194
465 | 138534411
466 | 138618294
467 | 138931764
468 | 139536037
469 | 139536038
470 | 139536039
471 | 139536040
472 | 140367832
473 | 140406050
474 | 140421668
475 | 140422973
476 | 140423713
477 | 140436348
478 | 140483470
479 | 140615715
480 | 140802803
481 | 140896470
482 | 141189437
483 | 141192744
484 | 141382548
485 | 141461680
486 | 141624996
487 | 141627135
488 | 141659139
489 | 141872038
490 | 141993721
491 | 142006413
492 | 142045136
493 | 142095667
494 | 142227273
495 | 142250480
496 | 142518788
497 | 142544931
498 | 142546314
499 | 142555433
500 | 142653044
501 | 143191852
502 | 143258496
503 | 143299722
504 | 143331253
505 | 143432462
506 | 143632431
507 | 143695326
508 | 144219522
509 | 144590916
510 | 145410436
511 | 146720405
512 | 150810438
513 | 151258773
514 | 151315554
515 | 151400090
516 | 151429441
517 | 151439617
518 | 151453617
519 | 151466296
520 | 151511132
521 | 151636561
522 | 151823192
523 | 151827116
524 | 151850642
525 | 152016572
526 | 153111675
527 | 153114652
528 | 153123147
529 | 153267108
530 | 153389799
531 | 153395366
532 | 153718608
533 | 154171028
534 | 154315227
535 | 154559688
536 | 154978771
537 | 154979742
538 | 154985773
539 | 154989370
540 | 155044852
541 | 155065458
542 | 155578573
543 | 156403304
544 | 159085959
545 | 159776047
546 | 159816630
547 | 160733048
548 | 160733049
549 | 160733050
550 | 160733051
551 | 160733056
552 | 164824922
553 | 164824924
554 | 164824926
555 | 164824930
556 | 164831646
557 | 164831647
558 | 164831648
559 | 164831650
560 | 164835050
561 | 164835051
562 | 164835052
563 | 164835056
564 | 164835057
565 | 164835059
566 | 164836898
567 | 164836899
568 | 164836900
569 | 164845333
570 | 164845334
571 | 164845336
572 | 164845337
573 | 164845341
574 | 164845342
575 | 164845345
576 | 164845346
577 | 164845349
578 | 164845350
579 | 164845353
580 | 164845355
581 | 164845358
582 | 164845361
583 | 164845364
584 | 164847387
585 | 164847388
586 | 164847389
587 | 164847390
588 | 164848328
589 | 164848329
590 | 164848330
591 | 164849448
592 | 164849449
593 | 164849451
594 | 164849452
595 | 164849454
596 | 164849455
597 | 164849457
598 | 164849461
599 | 164850219
600 | 164850220
601 | 164850222
602 | 164850223
603 | 164850224
604 | 164850226
605 | 164850227
606 | 164850228
607 | 164850229
608 | 164850231
609 | 164850236
610 | 164850237
611 | 164850240
612 | 164850242
613 | 164850243
614 | 164852242
615 | 164852243
616 | 164852244
617 | 164852247
618 | 164852248
619 | 164852249
620 | 164852250
621 | 164852251
622 | 164852254
623 | 164852256
624 | 164852257
625 | 164852258
626 | 164852259
627 | 164852260
628 | 164852261
629 | 164852262
630 | 164853061
631 | 164853063
632 | 164853071
633 | 164853072
634 | 164853075
635 | 168118980
636 | 168118981
637 | 168118983
638 | 168118984
639 | 168180375
640 | 168180376
641 | 168180378
642 | 168180379
643 | 168270830
644 | 168270831
645 | 168270833
646 | 168270834
647 | 168270835
648 |
649 | false
650 | true
651 |
652 |
653 | {}
654 |
655 |
656 | true
657 | false
658 |
659 |
660 |
661 | Extended
662 |
663 |
664 | en-US
665 | en
666 |
667 |
668 |
669 | en-US
670 |
671 |
672 | false
673 | BranchReadinessLevel=CB;CurrentBranch=rs_prerelease;OEMModel=Virtual Machine;FlightRing={};AttrDataVer=21;SystemManufacturer=Microsoft Corporation;InstallLanguage=en-US;OSUILocale=en-US;InstallationType=Client;FlightingBranchName=external;FirmwareVersion=Hyper-V UEFI Release v2.5;SystemProductName=Virtual Machine;OSSkuId=48;FlightContent=Branch;App=WU;OEMName_Uncleaned=Microsoft Corporation;AppVer=10.0.16184.1001;OSArchitecture=AMD64;SystemSKU=None;UpdateManagementGroup=2;IsFlightingEnabled=1;IsDeviceRetailDemo=0;TelemetryLevel=3;OSVersion=10.0.16184.1001;DeviceFamily=Windows.Desktop;
674 | Interactive=1;IsSeeker=0;
675 |
676 |
677 |
678 |
679 |
680 |
681 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/scripts/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This file is part of MagiskOnWSALocal.
4 | #
5 | # MagiskOnWSALocal is free software: you can redistribute it and/or modify
6 | # it under the terms of the GNU Affero General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # MagiskOnWSALocal is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU Affero General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Affero General Public License
16 | # along with MagiskOnWSALocal. If not, see .
17 | #
18 | # Copyright (C) 2022 LSPosed Contributors
19 | #
20 |
21 | if [ ! "$BASH_VERSION" ]; then
22 | echo "Please do not use sh to run this script, just execute it directly" 1>&2
23 | exit 1
24 | fi
25 | HOST_ARCH=$(uname -m)
26 | if [ "$HOST_ARCH" != "x86_64" ] && [ "$HOST_ARCH" != "aarch64" ]; then
27 | echo "Unsupported architectures: $HOST_ARCH"
28 | exit 1
29 | fi
30 | cd "$(dirname "$0")" || exit 1
31 | trap umount_clean EXIT
32 | # export TMPDIR=$(dirname "$PWD")/WORK_DIR_
33 | if [ "$TMPDIR" ] && [ ! -d "$TMPDIR" ]; then
34 | mkdir -p "$TMPDIR"
35 | fi
36 | WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1
37 | DOWNLOAD_DIR=../download
38 | DOWNLOAD_CONF_NAME=download.list
39 | OUTPUT_DIR=../output
40 | MOUNT_DIR="$WORK_DIR"/system
41 | SUDO="$(which sudo 2>/dev/null)"
42 | if [ -z "$SUDO" ]; then
43 | unset SUDO
44 | fi
45 | umount_clean() {
46 | if [ -d "$MOUNT_DIR" ]; then
47 | echo "Cleanup Work Directory"
48 | if [ -d "$MOUNT_DIR/vendor" ]; then
49 | $SUDO umount "$MOUNT_DIR"/vendor
50 | fi
51 | if [ -d "$MOUNT_DIR/product" ]; then
52 | $SUDO umount "$MOUNT_DIR"/product
53 | fi
54 | if [ -d "$MOUNT_DIR/system_ext" ]; then
55 | $SUDO umount "$MOUNT_DIR"/system_ext
56 | fi
57 | $SUDO umount "$MOUNT_DIR"
58 | $SUDO rm -rf "${WORK_DIR:?}"
59 | else
60 | rm -rf "${WORK_DIR:?}"
61 | fi
62 | if [ "$TMPDIR" ] && [ -d "$TMPDIR" ]; then
63 | rm -rf "${TMPDIR:?}"
64 | unset TMPDIR
65 | fi
66 | }
67 | clean_download() {
68 | if [ -d "$DOWNLOAD_DIR" ]; then
69 | echo "Cleanup Download Directory"
70 | if [ "$CLEAN_DOWNLOAD_WSA" ]; then
71 | rm -f "${WSA_ZIP_PATH:?}"
72 | fi
73 | if [ "$CLEAN_DOWNLOAD_MAGISK" ]; then
74 | rm -f "${MAGISK_PATH:?}"
75 | fi
76 | if [ "$CLEAN_DOWNLOAD_GAPPS" ]; then
77 | rm -f "${GAPPS_PATH:?}"
78 | fi
79 | fi
80 | }
81 | abort() {
82 | echo "Build: an error has occurred, exit"
83 | if [ -d "$WORK_DIR" ]; then
84 | umount_clean
85 | fi
86 | clean_download
87 | exit 1
88 | }
89 | trap abort INT TERM
90 |
91 | function Gen_Rand_Str {
92 | echo $(date +%s%N|md5sum|base64|head -c "$1")
93 | }
94 |
95 | default() {
96 | ARCH=x64
97 | RELEASE_TYPE=retail
98 | MAGISK_VER=stable
99 | GAPPS_BRAND=MindTheGapps
100 | GAPPS_VARIANT=pico
101 | ROOT_SOL=magisk
102 | }
103 |
104 | exit_with_message() {
105 | echo "ERROR: $1"
106 | usage
107 | exit 1
108 | }
109 |
110 | ARCH_MAP=(
111 | "x64"
112 | "arm64"
113 | )
114 |
115 | RELEASE_TYPE_MAP=(
116 | "retail"
117 | "RP"
118 | "WIS"
119 | "WIF"
120 | )
121 |
122 | MAGISK_VER_MAP=(
123 | "stable"
124 | "beta"
125 | "canary"
126 | "debug"
127 | "release"
128 | )
129 |
130 | GAPPS_BRAND_MAP=(
131 | "OpenGApps"
132 | "MindTheGapps"
133 | "none"
134 | )
135 |
136 | GAPPS_VARIANT_MAP=(
137 | "super"
138 | "stock"
139 | "full"
140 | "mini"
141 | "micro"
142 | "nano"
143 | "pico"
144 | "tvstock"
145 | "tvmini"
146 | )
147 |
148 | ROOT_SOL_MAP=(
149 | "magisk"
150 | "none"
151 | )
152 |
153 | COMPRESS_FORMAT_MAP=(
154 | "7z"
155 | "xz"
156 | "zip"
157 | )
158 |
159 | ARR_TO_STR() {
160 | local arr=("$@")
161 | local joined
162 | printf -v joined "%s, " "${arr[@]}"
163 | echo "${joined%, }"
164 | }
165 | usage() {
166 | default
167 | echo "Usage:
168 | --arch Architecture of WSA.
169 |
170 | Possible values: $(ARR_TO_STR "${ARCH_MAP[@]}")
171 | Default: $ARCH
172 |
173 | --release-type Release type of WSA.
174 | RP means Release Preview, WIS means Insider Slow, WIF means Insider Fast.
175 |
176 | Possible values: $(ARR_TO_STR "${RELEASE_TYPE_MAP[@]}")
177 | Default: $RELEASE_TYPE
178 |
179 | --magisk-ver Magisk version.
180 |
181 | Possible values: $(ARR_TO_STR "${MAGISK_VER_MAP[@]}")
182 | Default: $MAGISK_VER
183 |
184 | --gapps-brand GApps brand.
185 | \"none\" for no integration of GApps
186 |
187 | Possible values: $(ARR_TO_STR "${GAPPS_BRAND_MAP[@]}")
188 | Default: $GAPPS_BRAND
189 |
190 | --gapps-variant GApps variant.
191 |
192 | Possible values: $(ARR_TO_STR "${GAPPS_VARIANT_MAP[@]}")
193 | Default: $GAPPS_VARIANT
194 |
195 | --root-sol Root solution.
196 | \"none\" means no root.
197 |
198 | Possible values: $(ARR_TO_STR "${ROOT_SOL_MAP[@]}")
199 | Default: $ROOT_SOL
200 |
201 | --compress-format
202 | Compress format of output file.
203 | If this option is not specified and --compress is not specified, the generated file will not be compressed
204 |
205 | Possible values: $(ARR_TO_STR "${COMPRESS_FORMAT_MAP[@]}")
206 |
207 | Additional Options:
208 | --remove-amazon Remove Amazon Appstore from the system
209 | --compress Compress the WSA, The default format is 7z, you can use the format specified by --compress-format
210 | --offline Build WSA offline
211 | --magisk-custom Install custom Magisk
212 | --debug Debug build mode
213 | --help Show this help message and exit
214 |
215 | Example:
216 | ./build.sh --release-type RP --magisk-ver beta --gapps-variant pico --remove-amazon
217 | ./build.sh --arch arm64 --release-type WIF --gapps-brand MindTheGapps
218 | ./build.sh --release-type WIS --gapps-brand none
219 | ./build.sh --offline --gapps-variant pico --magisk-custom
220 | "
221 | }
222 |
223 | ARGUMENT_LIST=(
224 | "arch:"
225 | "release-type:"
226 | "magisk-ver:"
227 | "gapps-brand:"
228 | "gapps-variant:"
229 | "root-sol:"
230 | "compress-format:"
231 | "remove-amazon"
232 | "compress"
233 | "offline"
234 | "magisk-custom"
235 | "debug"
236 | "help"
237 | )
238 |
239 | default
240 |
241 | opts=$(
242 | getopt \
243 | --longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
244 | --name "$(basename "$0")" \
245 | --options "" \
246 | -- "$@"
247 | ) || exit_with_message "Failed to parse options, please check your input"
248 |
249 | eval set --"$opts"
250 | while [[ $# -gt 0 ]]; do
251 | case "$1" in
252 | --arch ) ARCH="$2"; shift 2 ;;
253 | --release-type ) RELEASE_TYPE="$2"; shift 2 ;;
254 | --gapps-brand ) GAPPS_BRAND="$2"; shift 2 ;;
255 | --gapps-variant ) GAPPS_VARIANT="$2"; shift 2 ;;
256 | --root-sol ) ROOT_SOL="$2"; shift 2 ;;
257 | --compress-format ) COMPRESS_FORMAT="$2"; shift 2 ;;
258 | --remove-amazon ) REMOVE_AMAZON="remove"; shift ;;
259 | --compress ) COMPRESS_OUTPUT="yes"; shift ;;
260 | --offline ) OFFLINE="on"; shift ;;
261 | --magisk-custom ) CUSTOM_MAGISK="debug"; MAGISK_VER=$CUSTOM_MAGISK; shift ;;
262 | --magisk-ver ) MAGISK_VER="$2"; shift 2 ;;
263 | --debug ) DEBUG="on"; shift ;;
264 | --help ) usage; exit 0 ;;
265 | -- ) shift; break;;
266 | esac
267 | done
268 |
269 | check_list() {
270 | local input=$1
271 | if [ -n "$input" ]; then
272 | local name=$2
273 | shift
274 | local arr=("$@")
275 | local list_count=${#arr[@]}
276 | for i in "${arr[@]}"; do
277 | if [ "$input" == "$i" ]; then
278 | echo "INFO: $name: $input"
279 | break
280 | fi
281 | ((list_count--))
282 | if (("$list_count" <= 0)); then
283 | exit_with_message "Invalid $name: $input"
284 | fi
285 | done
286 | fi
287 | }
288 |
289 | check_list "$ARCH" "Architecture" "${ARCH_MAP[@]}"
290 | check_list "$RELEASE_TYPE" "Release Type" "${RELEASE_TYPE_MAP[@]}"
291 | check_list "$MAGISK_VER" "Magisk Version" "${MAGISK_VER_MAP[@]}"
292 | check_list "$GAPPS_BRAND" "GApps Brand" "${GAPPS_BRAND_MAP[@]}"
293 | check_list "$GAPPS_VARIANT" "GApps Variant" "${GAPPS_VARIANT_MAP[@]}"
294 | check_list "$ROOT_SOL" "Root Solution" "${ROOT_SOL_MAP[@]}"
295 | check_list "$COMPRESS_FORMAT" "Compress Format" "${COMPRESS_FORMAT_MAP[@]}"
296 |
297 | if [ "$DEBUG" ]; then
298 | set -x
299 | fi
300 |
301 | require_su() {
302 | if test "$(whoami)" != "root"; then
303 | if [ -z "$SUDO" ] || [ "$($SUDO whoami)" != "root" ]; then
304 | echo "ROOT/SUDO is required to run this script"
305 | abort
306 | fi
307 | fi
308 | }
309 |
310 | declare -A RELEASE_NAME_MAP=(["retail"]="Retail" ["RP"]="Release Preview" ["WIS"]="Insider Slow" ["WIF"]="Insider Fast")
311 | RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort
312 |
313 | echo -e "Build: RELEASE_TYPE=$RELEASE_NAME"
314 |
315 | WSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$ARCH-$RELEASE_TYPE.zip
316 | vclibs_PATH=$DOWNLOAD_DIR/Microsoft.VCLibs."$ARCH".14.00.Desktop.appx
317 | xaml_PATH=$DOWNLOAD_DIR/Microsoft.UI.Xaml_"$ARCH".appx
318 | MAGISK_ZIP=magisk-$MAGISK_VER.zip
319 | MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP
320 | if [ "$CUSTOM_MAGISK" ]; then
321 | if [ ! -f "$MAGISK_PATH" ]; then
322 | echo "Custom Magisk $MAGISK_ZIP not found"
323 | MAGISK_ZIP=app-$MAGISK_VER.apk
324 | echo "Fallback to $MAGISK_ZIP"
325 | MAGISK_PATH=$DOWNLOAD_DIR/$MAGISK_ZIP
326 | if [ ! -f "$MAGISK_PATH" ]; then
327 | echo -e "Custom Magisk $MAGISK_ZIP not found\nPlease put custom Magisk in $DOWNLOAD_DIR"
328 | abort
329 | fi
330 | fi
331 | fi
332 | if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
333 | GAPPS_PATH="$DOWNLOAD_DIR"/OpenGApps-$ARCH-$GAPPS_VARIANT.zip
334 | else
335 | GAPPS_PATH="$DOWNLOAD_DIR"/MindTheGapps-"$ARCH".zip
336 | fi
337 |
338 | if [ -z "${OFFLINE+x}" ]; then
339 | trap 'rm -f -- "${DOWNLOAD_DIR:?}/${DOWNLOAD_CONF_NAME}"' EXIT
340 | require_su
341 | echo "Generate Download Links"
342 | python3 generateWSALinks.py "$ARCH" "$RELEASE_TYPE" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
343 | if [ -z "${CUSTOM_MAGISK+x}" ]; then
344 | python3 generateMagiskLink.py "$MAGISK_VER" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
345 | fi
346 | if [ "$GAPPS_BRAND" != "none" ]; then
347 | python3 generateGappsLink.py "$ARCH" "$GAPPS_BRAND" "$GAPPS_VARIANT" "$DOWNLOAD_DIR" "$DOWNLOAD_CONF_NAME" || abort
348 | fi
349 |
350 | echo "Download Artifacts"
351 | if ! aria2c --no-conf --log-level=info --log="$DOWNLOAD_DIR/aria2_download.log" -x16 -s16 -j5 -c -R -m0 --async-dns=false --check-integrity=true --continue=true --allow-overwrite=true --conditional-get=true -d"$DOWNLOAD_DIR" -i"$DOWNLOAD_DIR"/"$DOWNLOAD_CONF_NAME"; then
352 | echo "We have encountered an error while downloading files."
353 | exit 1
354 | fi
355 | else
356 | declare -A FILES_CHECK_LIST=([WSA_ZIP_PATH]="$WSA_ZIP_PATH" [xaml_PATH]="$xaml_PATH" [vclibs_PATH]="$vclibs_PATH" [MAGISK_PATH]="$MAGISK_PATH")
357 | for i in "${FILES_CHECK_LIST[@]}"; do
358 | if [ ! -f "$i" ]; then
359 | echo "Offline mode: missing [$i]."
360 | OFFLINE_ERR="1"
361 | fi
362 | done
363 | if [ "$GAPPS_BRAND" != 'none' ]; then
364 | if [ ! -f "$GAPPS_PATH" ]; then
365 | echo "Offline mode: missing [$GAPPS_PATH]."
366 | OFFLINE_ERR="1"
367 | fi
368 | fi
369 | if [ "$OFFLINE_ERR" ]; then
370 | echo "Offline mode: Some files are missing, please disable offline mode."
371 | exit 1
372 | fi
373 | require_su
374 | fi
375 |
376 | echo "Extract WSA"
377 | if [ -f "$WSA_ZIP_PATH" ]; then
378 | WSA_WORK_ENV="${WORK_DIR:?}"/ENV
379 | if [ -f "$WSA_WORK_ENV" ]; then rm -f "${WSA_WORK_ENV:?}"; fi
380 | touch "$WSA_WORK_ENV"
381 | export WSA_WORK_ENV
382 | if ! python3 extractWSA.py "$ARCH" "$WSA_ZIP_PATH" "$WORK_DIR"; then
383 | echo "Unzip WSA failed, is the download incomplete?"
384 | CLEAN_DOWNLOAD_WSA=1
385 | abort
386 | fi
387 | echo -e "Extract done\n"
388 | # shellcheck disable=SC1091
389 | source "${WORK_DIR:?}/ENV" || abort
390 | else
391 | echo "The WSA zip package does not exist, is the download incomplete?"
392 | exit 1
393 | fi
394 |
395 | echo "Extract Magisk"
396 | if [ -f "$MAGISK_PATH" ]; then
397 | if ! python3 extractMagisk.py "$ARCH" "$MAGISK_PATH" "$WORK_DIR"; then
398 | echo "Unzip Magisk failed, is the download incomplete?"
399 | CLEAN_DOWNLOAD_MAGISK=1
400 | abort
401 | fi
402 | $SUDO patchelf --replace-needed libc.so "../linker/$HOST_ARCH/libc.so" "$WORK_DIR"/magisk/magiskpolicy || abort
403 | $SUDO patchelf --replace-needed libm.so "../linker/$HOST_ARCH/libm.so" "$WORK_DIR"/magisk/magiskpolicy || abort
404 | $SUDO patchelf --replace-needed libdl.so "../linker/$HOST_ARCH/libdl.so" "$WORK_DIR"/magisk/magiskpolicy || abort
405 | chmod +x "../linker/$HOST_ARCH/linker64" || abort
406 | $SUDO patchelf --set-interpreter "../linker/$HOST_ARCH/linker64" "$WORK_DIR"/magisk/magiskpolicy || abort
407 | chmod +x "$WORK_DIR"/magisk/magiskpolicy || abort
408 | elif [ -z "${CUSTOM_MAGISK+x}" ]; then
409 | echo "The Magisk zip package does not exist, is the download incomplete?"
410 | exit 1
411 | else
412 | echo "The Magisk zip package does not exist, rename it to magisk-debug.zip and put it in the download folder."
413 | exit 1
414 | fi
415 | echo -e "done\n"
416 |
417 | if [ "$GAPPS_BRAND" != 'none' ]; then
418 | echo "Extract $GAPPS_BRAND"
419 | mkdir -p "$WORK_DIR"/gapps || abort
420 | if [ -f "$GAPPS_PATH" ]; then
421 | if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
422 | if ! unzip -p "$GAPPS_PATH" {Core,GApps}/'*.lz' | tar --lzip -C "$WORK_DIR"/gapps -xf - -i --strip-components=2 --exclude='setupwizardtablet-x86_64' --exclude='packageinstallergoogle-all' --exclude='speech-common' --exclude='markup-lib-arm' --exclude='markup-lib-arm64' --exclude='markup-all' --exclude='setupwizarddefault-x86_64' --exclude='pixellauncher-all' --exclude='pixellauncher-common'; then
423 | echo "Unzip OpenGApps failed, is the download incomplete?"
424 | CLEAN_DOWNLOAD_GAPPS=1
425 | abort
426 | fi
427 | else
428 | if ! unzip "$GAPPS_PATH" "system/*" -x "system/addon.d/*" "system/system_ext/priv-app/SetupWizard/*" -d "$WORK_DIR"/gapps; then
429 | echo "Unzip MindTheGapps failed, package is corrupted?"
430 | abort
431 | fi
432 | mv "$WORK_DIR"/gapps/system/* "$WORK_DIR"/gapps || abort
433 | rm -rf "${WORK_DIR:?}"/gapps/system || abort
434 | fi
435 | cp -r ../"$ARCH"/gapps/* "$WORK_DIR"/gapps || abort
436 | if [ "$GAPPS_BRAND" = "MindTheGapps" ]; then
437 | mv "$WORK_DIR"/gapps/priv-app/* "$WORK_DIR"/gapps/system_ext/priv-app || abort
438 | rm -rf "${WORK_DIR:?}"/gapps/priv-app || abort
439 | fi
440 | else
441 | echo "The $GAPPS_BRAND zip package does not exist."
442 | abort
443 | fi
444 | echo -e "Extract done\n"
445 | fi
446 |
447 | echo "Expand images"
448 | if [ ! -f /etc/mtab ]; then $SUDO ln -s /proc/self/mounts /etc/mtab; fi
449 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort
450 | SYSTEM_EXT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system_ext.img | cut -f1) + 20000))
451 | if [ -d "$WORK_DIR"/gapps/system_ext ]; then
452 | SYSTEM_EXT_SIZE=$(( SYSTEM_EXT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) ))
453 | fi
454 | resize2fs "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$SYSTEM_EXT_SIZE"s || abort
455 |
456 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort
457 | PRODUCT_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/product.img | cut -f1) + 20000))
458 | if [ -d "$WORK_DIR"/gapps/product ]; then
459 | PRODUCT_SIZE=$(( PRODUCT_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) ))
460 | fi
461 | resize2fs "$WORK_DIR"/wsa/"$ARCH"/product.img "$PRODUCT_SIZE"s || abort
462 |
463 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort
464 | SYSTEM_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/system.img | cut -f1) + 20000))
465 | if [ -d "$WORK_DIR"/gapps ]; then
466 | SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/gapps | cut -f1) - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/product | cut -f1) ))
467 | if [ -d "$WORK_DIR"/gapps/system_ext ]; then
468 | SYSTEM_SIZE=$(( SYSTEM_SIZE - $(du --apparent-size -sB512 "$WORK_DIR"/gapps/system_ext | cut -f1) ))
469 | fi
470 | fi
471 | if [ -d "$WORK_DIR"/magisk ]; then
472 | SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$WORK_DIR"/magisk/magisk | cut -f1) ))
473 | fi
474 | if [ -f "$MAGISK_PATH" ]; then
475 | SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "$MAGISK_PATH" | cut -f1) ))
476 | fi
477 | if [ -d "../$ARCH/system" ]; then
478 | SYSTEM_SIZE=$(( SYSTEM_SIZE + $(du --apparent-size -sB512 "../$ARCH/system" | cut -f1) ))
479 | fi
480 | resize2fs "$WORK_DIR"/wsa/"$ARCH"/system.img "$SYSTEM_SIZE"s || abort
481 |
482 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort
483 | VENDOR_SIZE=$(($(du --apparent-size -sB512 "$WORK_DIR"/wsa/"$ARCH"/vendor.img | cut -f1) + 20000))
484 | resize2fs "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$VENDOR_SIZE"s || abort
485 | echo -e "Expand images done\n"
486 |
487 | echo "Mount images"
488 | $SUDO mkdir "$MOUNT_DIR" || abort
489 | $SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/system.img "$MOUNT_DIR" || abort
490 | $SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/vendor.img "$MOUNT_DIR"/vendor || abort
491 | $SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/product.img "$MOUNT_DIR"/product || abort
492 | $SUDO mount -o loop "$WORK_DIR"/wsa/"$ARCH"/system_ext.img "$MOUNT_DIR"/system_ext || abort
493 | echo -e "done\n"
494 |
495 | if [ "$REMOVE_AMAZON" ]; then
496 | echo "Remove Amazon Appstore"
497 | find "${MOUNT_DIR:?}"/product/{etc/permissions,etc/sysconfig,framework,priv-app} | grep -e amazon -e venezia | $SUDO xargs rm -rf
498 | echo -e "done\n"
499 | fi
500 |
501 | echo "Add device administration features"
502 | $SUDO sed -i -e '/cts/a \ \ \ \ ' -e '/print/i \ \ \ \ ' "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml
503 | $SUDO setfattr -n security.selinux -v "u:object_r:vendor_configs_file:s0" "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml || abort
504 | echo -e "done\n"
505 |
506 | if [ "$ROOT_SOL" = 'magisk' ] || [ "$ROOT_SOL" = '' ]; then
507 | echo "Integrate Magisk"
508 | $SUDO mkdir "$MOUNT_DIR"/sbin
509 | $SUDO setfattr -n security.selinux -v "u:object_r:rootfs:s0" "$MOUNT_DIR"/sbin || abort
510 | $SUDO chown root:root "$MOUNT_DIR"/sbin
511 | $SUDO chmod 0700 "$MOUNT_DIR"/sbin
512 | $SUDO cp "$WORK_DIR"/magisk/magisk/* "$MOUNT_DIR"/sbin/
513 | $SUDO cp "$MAGISK_PATH" "$MOUNT_DIR"/sbin/magisk.apk
514 | $SUDO tee -a "$MOUNT_DIR"/sbin/loadpolicy.sh <
601 |
602 |
603 |
604 |
605 |
606 |
607 | EOF
608 | wine64 ../wine/"$HOST_ARCH"/makepri.exe new /pr "$WORK_DIR"/wsa/pri /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$WORK_DIR"/wsa/priconfig.xml /of "$WORK_DIR"/wsa/"$ARCH"/resources.pri /o
609 | sed -i -zE "s//\n$(cat "$WORK_DIR"/wsa/xml/* | grep -Po ']*/>' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's/\//\\\//g')\n<\/Resources>/g" "$WORK_DIR"/wsa/"$ARCH"/AppxManifest.xml
610 | echo -e "Merge Language Resources done\n"
611 |
612 | echo "Add extra packages"
613 | $SUDO cp -r ../"$ARCH"/system/* "$MOUNT_DIR" || abort
614 | find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec chmod 0755 {} \;
615 | find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec chmod 0644 {} \;
616 | find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec chown root:root {} \;
617 | find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
618 | echo -e "Add extra packages done\n"
619 |
620 | if [ "$GAPPS_BRAND" != 'none' ]; then
621 | echo "Integrate $GAPPS_BRAND"
622 |
623 | find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chmod 0755 {} \;
624 | find "$WORK_DIR/gapps/" -mindepth 1 -type d -exec $SUDO chown root:root {} \;
625 | file_list="$(find "$WORK_DIR/gapps/" -mindepth 1 -type f | cut -d/ -f5-)"
626 | for file in $file_list; do
627 | $SUDO chown root:root "$WORK_DIR/gapps/${file}"
628 | $SUDO chmod 0644 "$WORK_DIR/gapps/${file}"
629 | done
630 |
631 | if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
632 | find "$WORK_DIR"/gapps/ -maxdepth 1 -mindepth 1 -type d -not -path '*product' -exec $SUDO cp --preserve=all -r {} "$MOUNT_DIR"/system \; || abort
633 | elif [ "$GAPPS_BRAND" = "MindTheGapps" ]; then
634 | $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/system_ext/* "$MOUNT_DIR"/system_ext/ || abort
635 | if [ -e "$MOUNT_DIR"/system_ext/priv-app/SetupWizard ]; then
636 | rm -rf "${MOUNT_DIR:?}/system_ext/priv-app/Provision"
637 | fi
638 | fi
639 | $SUDO cp --preserve=all -r "$WORK_DIR"/gapps/product/* "$MOUNT_DIR"/product || abort
640 |
641 | find "$WORK_DIR"/gapps/product/overlay -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/overlay/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:vendor_overlay_file:s0" {} \; || abort
642 |
643 | if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
644 | find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
645 | find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
646 | find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
647 | find "$WORK_DIR"/gapps/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
648 | find "$WORK_DIR"/gapps/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
649 | find "$WORK_DIR"/gapps/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
650 | find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
651 | find "$WORK_DIR"/gapps/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
652 | else
653 | find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
654 | find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
655 | find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
656 | find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
657 |
658 | find "$WORK_DIR"/gapps/product/app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
659 | find "$WORK_DIR"/gapps/product/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/etc/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
660 | find "$WORK_DIR"/gapps/product/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
661 | find "$WORK_DIR"/gapps/product/framework/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/framework/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
662 | find "$WORK_DIR"/gapps/system_ext/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
663 |
664 | $SUDO setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" "$MOUNT_DIR"/product/lib || abort
665 | find "$WORK_DIR"/gapps/product/lib/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib/placeholder -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort
666 | find "$WORK_DIR"/gapps/product/lib64/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/product/lib64/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_lib_file:s0" {} \; || abort
667 | find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
668 | find "$WORK_DIR"/gapps/system_ext/etc/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/etc/placeholder -type d -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
669 | find "$WORK_DIR"/gapps/system_ext/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system_ext/priv-app/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort
670 | fi
671 |
672 | $SUDO "$WORK_DIR"/magisk/magiskpolicy --load "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy --save "$MOUNT_DIR"/vendor/etc/selinux/precompiled_sepolicy "allow gmscore_app gmscore_app vsock_socket { create connect write read }" "allow gmscore_app device_config_runtime_native_boot_prop file read" "allow gmscore_app system_server_tmpfs dir search" "allow gmscore_app system_server_tmpfs file open" "allow gmscore_app system_server_tmpfs filesystem getattr" "allow gmscore_app gpu_device dir search" || abort
673 | echo -e "Integrate $GAPPS_BRAND done\n"
674 | fi
675 |
676 | if [ "$GAPPS_BRAND" != 'none' ]; then
677 | echo "Fix $GAPPS_BRAND prop"
678 | $SUDO python3 fixGappsProp.py "$MOUNT_DIR" || abort
679 | echo -e "done\n"
680 | fi
681 |
682 | echo "Umount images"
683 | $SUDO find "$MOUNT_DIR" -exec touch -hamt 200901010000.00 {} \;
684 | $SUDO umount "$MOUNT_DIR"/vendor
685 | $SUDO umount "$MOUNT_DIR"/product
686 | $SUDO umount "$MOUNT_DIR"/system_ext
687 | $SUDO umount "$MOUNT_DIR"
688 | echo -e "done\n"
689 |
690 | echo "Shrink images"
691 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system.img || abort
692 | resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system.img || abort
693 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort
694 | resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/vendor.img || abort
695 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/product.img || abort
696 | resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/product.img || abort
697 | e2fsck -pf "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort
698 | resize2fs -M "$WORK_DIR"/wsa/"$ARCH"/system_ext.img || abort
699 | echo -e "Shrink images done\n"
700 |
701 | echo "Remove signature and add scripts"
702 | $SUDO rm -rf "${WORK_DIR:?}"/wsa/"$ARCH"/\[Content_Types\].xml "$WORK_DIR"/wsa/"$ARCH"/AppxBlockMap.xml "$WORK_DIR"/wsa/"$ARCH"/AppxSignature.p7x "$WORK_DIR"/wsa/"$ARCH"/AppxMetadata || abort
703 | cp "$vclibs_PATH" "$xaml_PATH" "$WORK_DIR"/wsa/"$ARCH" || abort
704 | tee "$WORK_DIR"/wsa/"$ARCH"/Install.ps1 <nul
829 | exit 1
830 | ) else (
831 | start powershell.exe -ExecutionPolicy Bypass -File .\Install.ps1
832 | exit
833 | )
834 | EOF
835 | echo -e "Remove signature and add scripts done\n"
836 |
837 | echo "Generate info"
838 |
839 | if [[ "$ROOT_SOL" = "none" ]]; then
840 | name1=""
841 | elif [[ "$ROOT_SOL" = "" ]]; then
842 | name1="-with-magisk-$MAGISK_VER"
843 | else
844 | name1="-with-$ROOT_SOL-$MAGISK_VER"
845 | fi
846 | if [ "$GAPPS_BRAND" = "none" ]; then
847 | name2="-NoGApps"
848 | else
849 | if [ "$GAPPS_BRAND" = "OpenGApps" ]; then
850 | name2="-$GAPPS_BRAND-${GAPPS_VARIANT}"
851 | else
852 | name2="-$GAPPS_BRAND"
853 | fi
854 | if [ "$GAPPS_BRAND" = "OpenGApps" ] && [ "$DEBUG" ]; then
855 | echo ":warning: Since OpenGApps doesn't officially support Android 12.1 yet, lock the variant to pico!"
856 | fi
857 | fi
858 | artifact_name="WSA${name1}${name2}_${WSA_VER}_${ARCH}_${WSA_REL}"
859 | echo "$artifact_name"
860 | echo -e "\nFinishing building...."
861 | if [ -f "$OUTPUT_DIR" ]; then
862 | $SUDO rm -rf "${OUTPUT_DIR:?}"
863 | fi
864 | if [ ! -d "$OUTPUT_DIR" ]; then
865 | mkdir -p "$OUTPUT_DIR"
866 | fi
867 | OUTPUT_PATH="${OUTPUT_DIR:?}/$artifact_name"
868 | if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then
869 | mv "$WORK_DIR/wsa/$ARCH" "$WORK_DIR/wsa/$artifact_name"
870 | if [ -z "$COMPRESS_FORMAT" ]; then
871 | COMPRESS_FORMAT="7z"
872 | fi
873 | if [ -n "$COMPRESS_FORMAT" ]; then
874 | FILE_EXT=".$COMPRESS_FORMAT"
875 | if [ "$FILE_EXT" = ".xz" ]; then
876 | FILE_EXT=".tar$FILE_EXT"
877 | fi
878 | OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT"
879 | fi
880 | rm -f "${OUTPUT_PATH:?}" || abort
881 | if [ "$COMPRESS_FORMAT" = "7z" ]; then
882 | echo "Compressing with 7z"
883 | 7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort
884 | elif [ "$COMPRESS_FORMAT" = "xz" ]; then
885 | echo "Compressing with tar xz"
886 | if ! (tar -cP -I 'xz -9 -T0' -f "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name"); then
887 | echo "Out of memory? Trying again with single threads..."
888 | tar -cPJvf "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort
889 | fi
890 | elif [ "$COMPRESS_FORMAT" = "zip" ]; then
891 | 7z -tzip a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort
892 | fi
893 | else
894 | rm -rf "${OUTPUT_PATH:?}" || abort
895 | cp -r "$WORK_DIR"/wsa/"$ARCH" "$OUTPUT_PATH" || abort
896 | fi
897 | echo -e "done\n"
898 |
899 | echo "Cleanup Work Directory"
900 | $SUDO rm -rf "${WORK_DIR:?}"
901 | echo "done"
902 |
--------------------------------------------------------------------------------