diff --git a/.github/workflows/magisk.yml b/.github/workflows/magisk.yml index 24f79b0..2fe9726 100644 --- a/.github/workflows/magisk.yml +++ b/.github/workflows/magisk.yml @@ -1,28 +1,87 @@ name: Build WSA on: push: + paths-ignore: + - 'README.md' pull_request: + paths-ignore: + - 'README.md' workflow_dispatch: inputs: - magisk_apk: - description: "Download link to magisk apk." + arch: + description: "Build arch" required: true - default: "https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@24.1/app-release.apk" + default: "x64 & arm64" + type: choice + options: + - x64 + - arm64 + - x64 & arm64 + magisk_apk: + description: "Magisk version" + required: true + default: "stable" + type: choice + options: + - stable + - beta + - canary gapps_variant: - description: "Variants of gapps. Should be: [none, super, stock, full, mini, micro, nano, pico, tvstock, tvmini]" + description: "Variants of gapps" required: true default: "none" + type: choice + options: + - none + - super + - stock + - full + - mini + - micro + - nano + - pico + - tvstock + - tvmini root_sol: - description: "Root solution. Should be: [magisk, none]" + description: "Root solution" required: true default: "magisk" + type: choice + options: + - magisk + - none jobs: + matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Generate build matrix + id: set-matrix + uses: actions/github-script@v6 + with: + script: | + let matrix = {}; + let arch = "${{ github.event.inputs.arch }}" + switch ( arch ) { + case "x64": + matrix.arch = ["x64"]; + break; + case "arm64": + matrix.arch = ["arm64"]; + break; + default: + matrix.arch = ["x64", "arm64"]; + break; + } + core.setOutput("matrix",JSON.stringify(matrix)); + build: runs-on: ubuntu-20.04 + needs: matrix strategy: - matrix: - arch: [x64, arm64] + matrix: ${{fromJson(needs.matrix.outputs.matrix)}} steps: - name: Dependencies run: | @@ -109,12 +168,16 @@ jobs: import urllib.request import zipfile import os + import json + import requests magisk_apk = """${{ github.event.inputs.magisk_apk }}""" if not magisk_apk: - magisk_apk = """https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@24.1/app-release.apk""" - + magisk_apk = "stable" + if magisk_apk == "stable" or magisk_apk == "beta" or magisk_apk == "canary": + magisk_apk = json.loads(requests.get(f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_apk}.json").content)['magisk']['link'] + out_file = "magisk.zip" arch = "${{ matrix.arch }}" @@ -437,7 +500,7 @@ jobs: } if (-not (Test-Administrator)) { - \$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 powershell.exe -Args "-executionpolicy bypass -command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath' EVAL" \$proc.WaitForExit() if (\$proc.ExitCode -ne 0) { Clear-Host @@ -447,7 +510,7 @@ jobs: 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 powershell.exe -Args "-executionpolicy bypass -command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath'" exit } @@ -486,7 +549,7 @@ jobs: } Clear-Host Write-Host "Installing MagiskOnWSA..." - Stop-Process -Name "wsaclient" + Stop-Process -Name "wsaclient" -ErrorAction "silentlycontinue" Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml if (\$?) { Finish diff --git a/README.md b/README.md index ffe2b35..19b4f02 100644 --- a/README.md +++ b/README.md @@ -78,13 +78,10 @@ https://user-images.githubusercontent.com/5022927/145696886-e13ebfc1-ff25-4410-8 Magisk actively remove online module repository. You can install module locally or by `adb push module.zip /data/local/tmp` and `adb shell su -c magisk --install-module /data/local/tmp/module.zip`. - Can I use Magisk 23.0 stable or lower version? - No. Magisk has bugs preventing itself running on WSA. Magisk Canary has fixed them. So try Magisk 23 canary or higher version. -- But Magisk has removed hide since 23 canary? - - Use [Magisk Alpha](https://t.me/magiskalpha) or use Zygisk with [Shamiko](https://t.me/c/1414270883/25744) for hidding. To intergrate Magisk Alpha, use this Magisk apk link https://github.com/vvb2060/magisk_files/raw/alpha/app-release.apk for the Github Action. + No. Magisk has bugs preventing itself running on WSA. Magisk 24+ has fixed them. So you must use Magisk 24 or higher version. - How can I get rid of Magisk? - Input `none` as root solution. + Choose `none` as root solution. - Github Action script is updated, how can I synchronize it? 1. In your fork repository, click `fetch upstream`