Skip to content

Commit

Permalink
Merge remote-tracking branch 'source/main' into source
Browse files Browse the repository at this point in the history
  • Loading branch information
wxy1343 committed Oct 14, 2022
2 parents 7a7684e + dcc6dcd commit 0701d30
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
Please include a summary of the change and which issue is fixed.
Also make sure you've tested your code and also done a self-review of it.
DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.
-->

Checklist

- [ ] Referenced all related issues in the PR body (e.g. "Closes #xyz")
- [ ] Have tested the modifications
27 changes: 27 additions & 0 deletions .github/workflows/issue_moderator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Issue moderator

on:
issues:
types: [opened]
pull_request:
types: [opened, edited]

jobs:
autoclose:
runs-on: ubuntu-latest
steps:
- name: Check issue
uses: tachiyomiorg/issue-moderator-action@v1
with:
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
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Magisk on WSA (with Google Apps)

: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.

<details>
<summary>How to detach your fork from this upstream repository (a visual guide):</summary>
<p>
<img src="https://user-images.githubusercontent.com/96967473/194208623-194e5926-feb9-4172-b57f-a82179245d02.png" title="How to detach form using GitHub Support virtual assistant chatbot">
</p>
</details>

## Support for generating from these systems

- Linux (x86_64 or arm64)
Expand Down Expand Up @@ -40,7 +51,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
Expand All @@ -63,9 +74,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:
Expand Down

This file was deleted.

48 changes: 38 additions & 10 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -472,6 +472,11 @@ if [ "$REMOVE_AMAZON" ]; then
echo -e "done\n"
fi

echo "Add device administration features"
$SUDO sed -i -e '/cts/a \ \ \ \ <feature name="android.software.device_admin" />' -e '/print/i \ \ \ \ <feature name="android.software.managed_users" />' "$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
echo "Integrate Magisk"
$SUDO mkdir "$MOUNT_DIR"/sbin
Expand Down Expand Up @@ -582,9 +587,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
Expand Down Expand Up @@ -683,6 +685,16 @@ function Test-Administrator {
}
}
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"
Expand All @@ -691,7 +703,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
Expand All @@ -701,7 +713,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
}
Expand All @@ -726,11 +738,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
Expand Down
1 change: 0 additions & 1 deletion scripts/generateGappsLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions scripts/generateWSALinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
tmpdownlist.close()

This file was deleted.

0 comments on commit 0701d30

Please sign in to comment.