From bfc2fad49f00e7b5b038e3368b548450876d2c74 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 12:26:20 +0800 Subject: [PATCH 01/22] Check whether the Pull Request is regulated (#142) --- .github/pull_request_template.md | 12 ++++++++++++ .github/workflows/pull_request_check.yml | 25 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/pull_request_check.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..6afc7295f7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ + + +Checklist + +- [ ] Referenced all related issues in the PR body (e.g. "Closes #xyz") +- [ ] Have tested the modifications diff --git a/.github/workflows/pull_request_check.yml b/.github/workflows/pull_request_check.yml new file mode 100644 index 0000000000..36ccbbbbb2 --- /dev/null +++ b/.github/workflows/pull_request_check.yml @@ -0,0 +1,25 @@ +name: Pull Request checker + +on: + pull_request_target: + types: [opened, edited] + +jobs: + autoclose: + runs-on: ubuntu-latest + steps: + - name: Check Pull Request + uses: tachiyomiorg/issue-moderator-action@v1 + with: + auto-close-rules: | + [ + { + "type": "body", + "regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*", + "message": "The acknowledgment section was not removed." + } + ] + auto-close-ignore-label: | + do-not-autoclose + bug + enhancement From fe0d7c60cec928a0b391a51216716eadc9e81ecf Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 12:30:41 +0800 Subject: [PATCH 02/22] Update pull_request_check.yml --- .github/workflows/pull_request_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_check.yml b/.github/workflows/pull_request_check.yml index 36ccbbbbb2..d90f5957c0 100644 --- a/.github/workflows/pull_request_check.yml +++ b/.github/workflows/pull_request_check.yml @@ -1,7 +1,7 @@ name: Pull Request checker on: - pull_request_target: + pull_request: types: [opened, edited] jobs: From 45dbec9492793e6e7c7ba36b0c88d148aed49ba6 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 12:46:57 +0800 Subject: [PATCH 03/22] Update anti-spam workflows --- .github/workflows/anti_spam.yml | 25 ++++++++++++++++++++++++ .github/workflows/pull_request_check.yml | 25 ------------------------ 2 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/anti_spam.yml delete mode 100644 .github/workflows/pull_request_check.yml diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/anti_spam.yml new file mode 100644 index 0000000000..45b1af8abb --- /dev/null +++ b/.github/workflows/anti_spam.yml @@ -0,0 +1,25 @@ +name: Anti-spam + +on: + issues: + types: [opened] + pull_request_target: + types: [opened, edited] + +jobs: + autoclose: + runs-on: ubuntu-latest + steps: + - name: Anti-spam + uses: dessant/repo-lockdown@v2 + with: + exclude-issue-labels: | + bug + enhancement + issue-lock-reason: spam + exclude-pr-labels: | + bug + enhancement + do-not-autoclose + pr-labels: spam + pr-lock-reason: spam diff --git a/.github/workflows/pull_request_check.yml b/.github/workflows/pull_request_check.yml deleted file mode 100644 index d90f5957c0..0000000000 --- a/.github/workflows/pull_request_check.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Pull Request checker - -on: - pull_request: - types: [opened, edited] - -jobs: - autoclose: - runs-on: ubuntu-latest - steps: - - name: Check Pull Request - uses: tachiyomiorg/issue-moderator-action@v1 - with: - auto-close-rules: | - [ - { - "type": "body", - "regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*", - "message": "The acknowledgment section was not removed." - } - ] - auto-close-ignore-label: | - do-not-autoclose - bug - enhancement From 95aba7bee7e875586003e1e15ccce84e43915f65 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 12:48:10 +0800 Subject: [PATCH 04/22] Update anti_spam.yml --- .github/workflows/anti_spam.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/anti_spam.yml index 45b1af8abb..940fed0a0f 100644 --- a/.github/workflows/anti_spam.yml +++ b/.github/workflows/anti_spam.yml @@ -3,7 +3,7 @@ name: Anti-spam on: issues: types: [opened] - pull_request_target: + pull_request: types: [opened, edited] jobs: From 72e2b10c58102d64308b300b7a41fdf1e53408f0 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 12:51:14 +0800 Subject: [PATCH 05/22] Update anti_spam.yml --- .github/workflows/anti_spam.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/anti_spam.yml index 940fed0a0f..841e9a9769 100644 --- a/.github/workflows/anti_spam.yml +++ b/.github/workflows/anti_spam.yml @@ -23,3 +23,10 @@ jobs: do-not-autoclose pr-labels: spam pr-lock-reason: spam + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 0 + keep_minimum_runs: 0 From 5aed4ee14d686e08fdd5890ee77201158c8e5828 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 12:58:18 +0800 Subject: [PATCH 06/22] Update anti-spam workflows --- .github/pull_request_template.md | 1 + .github/workflows/anti_spam.yml | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6afc7295f7..0a0a0433cb 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,6 +4,7 @@ Don't forget to check all base themes and tablet mode for relevant changes. DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT. + Please set the label to bugfix or enhancement, otherwise it will be closed. --> Checklist diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/anti_spam.yml index 841e9a9769..e6f73728fc 100644 --- a/.github/workflows/anti_spam.yml +++ b/.github/workflows/anti_spam.yml @@ -18,11 +18,13 @@ jobs: enhancement issue-lock-reason: spam exclude-pr-labels: | - bug + bugfix enhancement do-not-autoclose pr-labels: spam pr-lock-reason: spam + skip-closed-pr-comment: true + skip-closed-issue-comment: true - name: Delete workflow runs uses: Mattraks/delete-workflow-runs@v2 with: From 80a30f46d1b32cd7eb40a44f21838fbf155b931b Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 13:01:02 +0800 Subject: [PATCH 07/22] Update pull_request_template.md --- .github/pull_request_template.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0a0a0433cb..1acb2c8f44 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,6 @@ Checklist diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/anti_spam.yml index e6f73728fc..9b7127733f 100644 --- a/.github/workflows/anti_spam.yml +++ b/.github/workflows/anti_spam.yml @@ -10,7 +10,7 @@ jobs: autoclose: runs-on: ubuntu-latest steps: - - name: Anti-spam + - name: Check issue uses: dessant/repo-lockdown@v2 with: exclude-issue-labels: | @@ -25,6 +25,22 @@ jobs: pr-lock-reason: spam skip-closed-pr-comment: true skip-closed-issue-comment: true + process-only: issues + - name: Check pull request + uses: tachiyomiorg/issue-moderator-action@v1 + with: + auto-close-rules: | + [ + { + "type": "body", + "regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*", + "message": "The acknowledgment section was not removed." + } + ] + auto-close-ignore-label: | + do-not-autoclose + bugfix + enhancement - name: Delete workflow runs uses: Mattraks/delete-workflow-runs@v2 with: From b59758382c50c2e9a6ec2ca4665e745e1bcb967b Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 13:25:55 +0800 Subject: [PATCH 09/22] Update anti_spam.yml --- .github/workflows/anti_spam.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/anti_spam.yml index 9b7127733f..48b42f9317 100644 --- a/.github/workflows/anti_spam.yml +++ b/.github/workflows/anti_spam.yml @@ -26,21 +26,8 @@ jobs: skip-closed-pr-comment: true skip-closed-issue-comment: true process-only: issues - - name: Check pull request - uses: tachiyomiorg/issue-moderator-action@v1 - with: - auto-close-rules: | - [ - { - "type": "body", - "regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*", - "message": "The acknowledgment section was not removed." - } - ] - auto-close-ignore-label: | - do-not-autoclose - bugfix - enhancement + - name: Check PR + uses: sumally/github-check-tasklist-action@v1 - name: Delete workflow runs uses: Mattraks/delete-workflow-runs@v2 with: From f59f0120068620e2668134542aa73668a15256a5 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 13:28:12 +0800 Subject: [PATCH 10/22] Update anti_spam.yml --- .github/workflows/anti_spam.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/anti_spam.yml index 48b42f9317..b48b89de1a 100644 --- a/.github/workflows/anti_spam.yml +++ b/.github/workflows/anti_spam.yml @@ -10,6 +10,13 @@ jobs: autoclose: runs-on: ubuntu-latest steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 0 + keep_minimum_runs: 0 - name: Check issue uses: dessant/repo-lockdown@v2 with: @@ -28,10 +35,3 @@ jobs: process-only: issues - name: Check PR uses: sumally/github-check-tasklist-action@v1 - - name: Delete workflow runs - uses: Mattraks/delete-workflow-runs@v2 - with: - token: ${{ github.token }} - repository: ${{ github.repository }} - retain_days: 0 - keep_minimum_runs: 0 From b0fee9c1910c0d1e508dfa9467d3002392187e30 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 25 Sep 2022 22:24:52 +0800 Subject: [PATCH 11/22] Update issue validation workflow --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .../{anti_spam.yml => issue_moderator.yml} | 27 +++++++++---------- 3 files changed, 14 insertions(+), 17 deletions(-) rename .github/workflows/{anti_spam.yml => issue_moderator.yml} (52%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index ad3c06b5c6..0213dfba27 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,7 +1,7 @@ name: Bug report/反馈 Bug description: Report errors or unexpected behavior./反馈错误或异常行为。 labels: [bug] -title: "[Bug] " +title: "[Bug] Short description." body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 239a4d1711..9f826830d0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -2,7 +2,7 @@ name: Feature request/新特性请求 description: Suggest an idea./提出建议 labels: [enhancement] -title: "[Feature Request] " +title: "[Feature Request] Short description." body: - type: textarea attributes: diff --git a/.github/workflows/anti_spam.yml b/.github/workflows/issue_moderator.yml similarity index 52% rename from .github/workflows/anti_spam.yml rename to .github/workflows/issue_moderator.yml index b48b89de1a..4dda6d2750 100644 --- a/.github/workflows/anti_spam.yml +++ b/.github/workflows/issue_moderator.yml @@ -1,4 +1,4 @@ -name: Anti-spam +name: Issue moderator on: issues: @@ -18,20 +18,17 @@ jobs: retain_days: 0 keep_minimum_runs: 0 - name: Check issue - uses: dessant/repo-lockdown@v2 + uses: tachiyomiorg/issue-moderator-action@v1 with: - exclude-issue-labels: | - bug - enhancement - issue-lock-reason: spam - exclude-pr-labels: | - bugfix - enhancement - do-not-autoclose - pr-labels: spam - pr-lock-reason: spam - skip-closed-pr-comment: true - skip-closed-issue-comment: true - process-only: issues + repo-token: ${{ secrets.GITHUB_TOKEN }} + auto-close-rules: | + [ + { + "type": "title", + "regex": ".*Short description.*", + "message": "You did not fill out the description in the title" + } + ] + auto-close-ignore-label: do-not-autoclose - name: Check PR uses: sumally/github-check-tasklist-action@v1 From c770a2ba7decbb64086be1c586a7f3c63fb89751 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:20:30 +0800 Subject: [PATCH 12/22] Fork detachment announcements --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c8594e056e..ce25e91713 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Magisk on WSA (with Google Apps) +:warning: For fork developers: Please detach the fork from [upstream](https://github.com/LSPosed/MagiskOnWSALocal) before building with Actions, Github will count the forked Actions usage to the upstream repository, which means if a forked repository abuses Actions, the repository that gets disabled will be upstream. We are not against forks, but please detach them from our repository. If you do not make changes one day after receiving the detachment request, our organization will ban you. + ## Support for generating from these systems - Linux (x86_64 or arm64) From ed2529e620c0ccebfa600d046b9e348f96514000 Mon Sep 17 00:00:00 2001 From: MilkClouds Date: Fri, 30 Sep 2022 01:55:43 +0900 Subject: [PATCH 13/22] Fixed typo related to f.close() (#155) --- scripts/generateGappsLink.py | 1 - scripts/generateWSALinks.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/generateGappsLink.py b/scripts/generateGappsLink.py index 4c4a1fb06d..b5742378ea 100644 --- a/scripts/generateGappsLink.py +++ b/scripts/generateGappsLink.py @@ -67,4 +67,3 @@ f.writelines(f' out={brand}-{arch}-{variant}.zip\n') elif brand == "MindTheGapps": f.writelines(f' out={brand}-{arch}.zip\n') - f.close diff --git a/scripts/generateWSALinks.py b/scripts/generateWSALinks.py index 8140143a76..3b5a92809c 100644 --- a/scripts/generateWSALinks.py +++ b/scripts/generateWSALinks.py @@ -112,4 +112,4 @@ tmpdownlist.writelines(f'https://aka.ms/Microsoft.VCLibs.{arch}.14.00.Desktop.appx\n') tmpdownlist.writelines(f' dir={download_dir}\n') tmpdownlist.writelines(f' out=vclibs-{arch}.appx\n') -tmpdownlist.close +tmpdownlist.close() From 7b1fe8a5462dd0486118c2d613f4374db0f8ae2f Mon Sep 17 00:00:00 2001 From: Roshanlal Date: Sat, 1 Oct 2022 21:37:42 +0530 Subject: [PATCH 14/22] Update README.md (#158) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce25e91713..93eb22c98c 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ There is no other variant we can choose. 1. Select the root solution (none means no root) -1. Wait for the script to complete and the artifact will be in the `output` folder -1. Move the artifact to a place you like -1. Double-click `Run.bat` +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 last step, 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` +1. Extract the compressed file and open the folder created after the extraction of the file. +1. Here look for file `Run.bat` and run it. - 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. - 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).) - If the popup windows disappear **without asking administrative permission** and WSA is not installed successfully, you should manually run `Install.ps1` as administrator: From f019514acad79c4deb4a82bb25d80c7789682261 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 2 Oct 2022 11:50:25 +0800 Subject: [PATCH 15/22] Update issue_moderator.yml --- .github/workflows/issue_moderator.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/issue_moderator.yml b/.github/workflows/issue_moderator.yml index 4dda6d2750..fb6a74a82a 100644 --- a/.github/workflows/issue_moderator.yml +++ b/.github/workflows/issue_moderator.yml @@ -10,13 +10,6 @@ jobs: autoclose: runs-on: ubuntu-latest steps: - - name: Delete workflow runs - uses: Mattraks/delete-workflow-runs@v2 - with: - token: ${{ github.token }} - repository: ${{ github.repository }} - retain_days: 0 - keep_minimum_runs: 0 - name: Check issue uses: tachiyomiorg/issue-moderator-action@v1 with: From 9672e2cfb2425c2bc47287d5027f9ee4e2e0f405 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 2 Oct 2022 19:05:08 +0800 Subject: [PATCH 16/22] Update installation script Make sure to run Powershell using the Windows console host --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 79b50d7fd4..90aa0d7282 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -691,7 +691,7 @@ function Finish { If (-Not (Test-Administrator)) { Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force - \$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs powershell.exe -Args "-ExecutionPolicy Bypass -Command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath' EVAL" + \$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs ConHost.exe -Args "powershell -ExecutionPolicy Bypass -Command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath' EVAL" \$proc.WaitForExit() If (\$proc.ExitCode -Ne 0) { Clear-Host From d072fca386756e008f5947fd9a86a1f0dbe730cf Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sun, 2 Oct 2022 20:31:42 +0900 Subject: [PATCH 17/22] Fix Improved method of adding features (#162) Co-authored-by: Howard Wu <40033067+Howard20181@users.noreply.github.com> --- .../android.software.device_admin.xml | 19 ------------------- scripts/build.sh | 7 ++++--- .../android.software.device_admin.xml | 19 ------------------- 3 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 arm64/system/system/etc/permissions/android.software.device_admin.xml delete mode 100644 x64/system/system/etc/permissions/android.software.device_admin.xml diff --git a/arm64/system/system/etc/permissions/android.software.device_admin.xml b/arm64/system/system/etc/permissions/android.software.device_admin.xml deleted file mode 100644 index 7d14dc661c..0000000000 --- a/arm64/system/system/etc/permissions/android.software.device_admin.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - diff --git a/scripts/build.sh b/scripts/build.sh index 90aa0d7282..84a6180530 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -472,6 +472,10 @@ if [ "$REMOVE_AMAZON" ]; then echo -e "done\n" fi +echo "Add device administration features" +$SUDO sed -i -e '/cts/a \ \ \ \ ' -e '/print/i \ \ \ \ ' "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml +echo -e "done\n" + if [ "$ROOT_SOL" = 'magisk' ] || [ "$ROOT_SOL" = '' ]; then echo "Integrate Magisk" $SUDO mkdir "$MOUNT_DIR"/sbin @@ -582,9 +586,6 @@ find ../"$ARCH"/system/system/priv-app/ -maxdepth 1 -mindepth 1 -printf '%P\n' | 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 {} \; 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 {} \; 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 -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/permissions/placeholder -type f -exec chmod 0644 {} \; -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/permissions/placeholder -exec chown root:root {} \; -find ../"$ARCH"/system/system/etc/permissions/ -maxdepth 1 -mindepth 1 -printf '%P\n' | xargs -I placeholder $SUDO find "$MOUNT_DIR"/system/etc/permissions/placeholder -type f -exec setfattr -n security.selinux -v "u:object_r:system_file:s0" {} \; || abort echo -e "Add extra packages done\n" if [ "$GAPPS_BRAND" != 'none' ]; then diff --git a/x64/system/system/etc/permissions/android.software.device_admin.xml b/x64/system/system/etc/permissions/android.software.device_admin.xml deleted file mode 100644 index 7d14dc661c..0000000000 --- a/x64/system/system/etc/permissions/android.software.device_admin.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - From db46b5eb1d42d710f017c1c23755a2b77c2e2560 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Sun, 2 Oct 2022 19:40:49 +0800 Subject: [PATCH 18/22] Fix config SELinux label --- scripts/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.sh b/scripts/build.sh index 84a6180530..c283fb039f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -474,6 +474,7 @@ fi echo "Add device administration features" $SUDO sed -i -e '/cts/a \ \ \ \ ' -e '/print/i \ \ \ \ ' "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml +$SUDO setfattr -n security.selinux -v "u:object_r:vendor_configs_file:s0" "$MOUNT_DIR"/vendor/etc/permissions/windows.permissions.xml || abort echo -e "done\n" if [ "$ROOT_SOL" = 'magisk' ] || [ "$ROOT_SOL" = '' ]; then From 2f59f6d32714f12e3aeb310b47cf0a85d1156908 Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sun, 2 Oct 2022 22:42:19 +0900 Subject: [PATCH 19/22] Fix d072fca (#163) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93eb22c98c..4c5ffa67c0 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ - Support all OpenGApps variants except for aroma (aroma does not support x86_64, please use super instead) - Remove Amazon Appstore - Fix VPN dialog not showing (use our [VpnDialogs app](https://github.com/LSPosed/VpnDialogs)) -- Add device management feature +- Add device administration feature - Unattended installation - Automatically activates developers mode in Windows 11 - Update to the new version while preserving data with a one-click script From 97dba57d42b05701c5d451b5e8da8c4a12765bf6 Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Wed, 5 Oct 2022 21:47:46 +0800 Subject: [PATCH 20/22] Update installation script Make sure to run Powershell on the Administrator account using the console host Check the version before installing dependencies, and install dependencies only if needed --- scripts/build.sh | 42 ++++++++++++++++++++++++++++++------- scripts/generateWSALinks.py | 7 +++---- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index c283fb039f..ee30c0b7b6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -294,8 +294,8 @@ RELEASE_NAME=${RELEASE_NAME_MAP[$RELEASE_TYPE]} || abort echo -e "Build: RELEASE_TYPE=$RELEASE_NAME" WSA_ZIP_PATH=$DOWNLOAD_DIR/wsa-$ARCH-$RELEASE_TYPE.zip -vclibs_PATH=$DOWNLOAD_DIR/vclibs-"$ARCH".appx -xaml_PATH=$DOWNLOAD_DIR/xaml-"$ARCH".appx +vclibs_PATH=$DOWNLOAD_DIR/Microsoft.VCLibs."$ARCH".14.00.Desktop.appx +xaml_PATH=$DOWNLOAD_DIR/Microsoft.UI.Xaml_"$ARCH".appx MAGISK_PATH=$DOWNLOAD_DIR/magisk-$MAGISK_VER.zip if [ "$CUSTOM_MAGISK" ]; then if [ ! -f "$MAGISK_PATH" ]; then @@ -685,13 +685,25 @@ function Test-Administrator { } } +function Test-WindowsTerminal { test-path env:WT_SESSION } + +function Get-InstalledDependencyVersion { + param ( + [string]\$Name, + [string]\$ProcessorArchitecture + ) + process { + return Get-AppxPackage -Name \$Name | ForEach-Object { if (\$_.Architecture -eq \$ProcessorArchitecture) { \$_ } } | Sort-Object -Property Version | Select-Object -ExpandProperty Version -Last 1; + } +} + function Finish { Clear-Host Start-Process "wsa://com.topjohnwu.magisk" Start-Process "wsa://com.android.vending" } -If (-Not (Test-Administrator)) { +If (-Not (Test-Administrator) -Or (Test-WindowsTerminal)) { Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force \$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs ConHost.exe -Args "powershell -ExecutionPolicy Bypass -Command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath' EVAL" \$proc.WaitForExit() @@ -703,7 +715,7 @@ If (-Not (Test-Administrator)) { exit } ElseIf ((\$args.Count -Eq 1) -And (\$args[0] -Eq "EVAL")) { - Start-Process powershell.exe -Args "-ExecutionPolicy Bypass -Command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath'" + Start-Process ConHost.exe -Args "powershell -ExecutionPolicy Bypass -Command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath'" exit } @@ -728,11 +740,27 @@ If (\$(Get-WindowsOptionalFeature -Online -FeatureName 'VirtualMachinePlatform') } } -Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path vclibs-$ARCH.appx -Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path xaml-$ARCH.appx +[xml]\$Xml = Get-Content ".\AppxManifest.xml"; +\$Name = \$Xml.Package.Identity.Name; +\$ProcessorArchitecture = \$Xml.Package.Identity.ProcessorArchitecture; +\$Dependencies = \$Xml.Package.Dependencies.PackageDependency; +\$Dependencies | ForEach-Object { + If (\$_.Name -Eq "Microsoft.VCLibs.140.00.UWPDesktop") { + \$HighestInstalledVCLibsVersion = Get-InstalledDependencyVersion -Name \$_.Name -ProcessorArchitecture \$ProcessorArchitecture; + If ( \$HighestInstalledVCLibsVersion -Lt \$_.MinVersion ) { + Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path "Microsoft.VCLibs.\$ProcessorArchitecture.14.00.Desktop.appx" + } + } + ElseIf (\$_.Name -Match "Microsoft.UI.Xaml") { + \$HighestInstalledXamlVersion = Get-InstalledDependencyVersion -Name \$_.Name -ProcessorArchitecture \$ProcessorArchitecture; + If ( \$HighestInstalledXamlVersion -Lt \$_.MinVersion ) { + Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path "Microsoft.UI.Xaml_\$ProcessorArchitecture.appx" + } + } +} \$Installed = \$null -\$Installed = Get-AppxPackage -Name 'MicrosoftCorporationII.WindowsSubsystemForAndroid' +\$Installed = Get-AppxPackage -Name \$Name If ((\$null -Ne \$Installed) -And (-Not (\$Installed.IsDevelopmentMode))) { Clear-Host diff --git a/scripts/generateWSALinks.py b/scripts/generateWSALinks.py index 3b5a92809c..8314a299fb 100644 --- a/scripts/generateWSALinks.py +++ b/scripts/generateWSALinks.py @@ -85,11 +85,11 @@ tmpdownlist = open(download_dir/tempScript, 'a') for i, v, f in identities: if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", f): - out_file_name = f"xaml-{arch}.appx" + out_file_name = f"Microsoft.UI.Xaml_{arch}.appx" out_file = download_dir / out_file_name # elif re.match(f"Microsoft\.VCLibs\..+\.UWPDesktop_.*_{arch}_.*\.appx", f): - # out_file = download_dir / "vclibs.appx" - # out_file_name = "vclibs.appx" + # out_file_name = f"Microsoft.VCLibs.140.00.UWPDesktop_{arch}.appx" + # out_file = download_dir / out_file_name elif re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", f): out_file_name = f"wsa-{arch}-{release_type}.zip" out_file = download_dir / out_file_name @@ -111,5 +111,4 @@ tmpdownlist.writelines(f' out={out_file_name}\n') tmpdownlist.writelines(f'https://aka.ms/Microsoft.VCLibs.{arch}.14.00.Desktop.appx\n') tmpdownlist.writelines(f' dir={download_dir}\n') -tmpdownlist.writelines(f' out=vclibs-{arch}.appx\n') tmpdownlist.close() From b092bcefe1bdd42c785cbb0a2571323e0d8b62fb Mon Sep 17 00:00:00 2001 From: Howard Wu <40033067+Howard20181@users.noreply.github.com> Date: Wed, 5 Oct 2022 22:20:14 +0800 Subject: [PATCH 21/22] Update build.sh Unable to detect if it is in Windows terminal --- scripts/build.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index ee30c0b7b6..8b143f4553 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -685,8 +685,6 @@ function Test-Administrator { } } -function Test-WindowsTerminal { test-path env:WT_SESSION } - function Get-InstalledDependencyVersion { param ( [string]\$Name, @@ -703,7 +701,7 @@ function Finish { Start-Process "wsa://com.android.vending" } -If (-Not (Test-Administrator) -Or (Test-WindowsTerminal)) { +If (-Not (Test-Administrator)) { Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force \$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs ConHost.exe -Args "powershell -ExecutionPolicy Bypass -Command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath' EVAL" \$proc.WaitForExit() From dcc6dcd9bea4a0064010cfbb665c99282ad31fd3 Mon Sep 17 00:00:00 2001 From: orariley70 <96967473+orariley70@users.noreply.github.com> Date: Sat, 8 Oct 2022 20:27:27 +0700 Subject: [PATCH 22/22] Improve wording and provide tutorial to detach fork (#170) Co-authored-by: Howard Wu <40033067+Howard20181@users.noreply.github.com> --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c5ffa67c0..c8199cee6d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # Magisk on WSA (with Google Apps) -:warning: For fork developers: Please detach the fork from [upstream](https://github.com/LSPosed/MagiskOnWSALocal) before building with Actions, Github will count the forked Actions usage to the upstream repository, which means if a forked repository abuses Actions, the repository that gets disabled will be upstream. We are not against forks, but please detach them from our repository. If you do not make changes one day after receiving the detachment request, our organization will ban you. +:warning: For fork developers: Please [use the GitHub Support virtual assistant chatbot](https://support.github.com/contact?flow=detach_fork&subject=Detach%20Fork&tags=rr-forks) to detach your fork from [upstream](https://github.com/LSPosed/MagiskOnWSALocal) before building with 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 because of numerous forks building GitHub Actions, and counting the forks' Action usage against this upstream repository. + +We are not against forks, but please detach them from our repository. If you do not make changes one day after receiving the detachment request, our organization will ban you. + +
+ How to detach your fork from this upstream repository (a visual guide): +

+ +

+
## Support for generating from these systems