Add Install.ps1

Close #30
This commit is contained in:
LoveSy 2021-10-31 16:37:54 +08:00
parent 6074f60327
commit 222415a126
2 changed files with 24 additions and 4 deletions

View File

@ -129,7 +129,7 @@ jobs:
if: ${{ github.event.inputs.gapps_variant != 'none' && github.event.inputs.gapps_variant != '' }}
run: |
mkdir gapps
unzip -p gapps.zip {Core,GApps}/'*.lz' | tar --lzip -C gapps -xvf - -i --strip-components=2 --exclude='setupwizardtablet-x86_64' --exclude='packageinstallergoogle-all' --exclude='speech-common' --exclude='markup-lib-arm' --exclude='markup-all'
unzip -p gapps.zip {Core,GApps}/'*.lz' | tar --lzip -C gapps -xvf - -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'
e2fsck -yf ${{ matrix.arch }}/system.img
resize2fs ${{ matrix.arch }}/system.img $(( $(du -sB512 gapps | cut -f1) + $(du -sB512 ${{ matrix.arch }}/system.img | cut -f1) ))s
@ -326,9 +326,29 @@ jobs:
resize2fs -M ${{ matrix.arch }}/product.img
e2fsck -yf ${{ matrix.arch }}/system_ext.img
resize2fs -M ${{ matrix.arch }}/system_ext.img
- name: Remove signature
- name: Remove signature and add scripts
run: |
rm -rf ${{ matrix.arch }}/\[Content_Types\].xml ${{ matrix.arch }}/AppxBlockMap.xml ${{ matrix.arch }}/AppxSignature.p7x ${{ matrix.arch }}/AppxMetadata
tee Install.ps1 <<EOF
function Test-Administrator
{
[OutputType([bool])]
param()
process {
[Security.Principal.WindowsPrincipal]\$user = [Security.Principal.WindowsIdentity]::GetCurrent();
return \$user.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator);
}
}
if(-not (Test-Administrator))
{
Start-Process -Verb RunAs powershell.exe -Args "-executionpolicy bypass -command Set-Location \`"\$PSScriptRoot\`"; \`"\$PSCommandPath\`""
exit
}
\$ErrorActionPreference = "Stop";
Add-AppxPackage -Register .\AppxManifest.xml
EOF
- name: Generate artifact name
run: |
variant="${{ github.event.inputs.gapps_variant }}"

View File

@ -23,9 +23,9 @@
![Download](https://docs.github.com/assets/images/help/repository/artifact-drop-down-updated.png)
1. Unzip the artifact and uninstall WSA if you have an official installation or replace the pevious unzipped artifact if you have a manual installation
1. Enable developer mode on Windows
1. Open powershell with admin privileges and run `Add-AppxPackage -Register .\AppxManifest.xml` under the unzipped artifact directory
1. Right click `Install.ps1` and select `Run with PowerShell`
1. Launch WSA and enable developer mode, launch the file manager, and wait until the file manager popup
1. Run `adb connect localhost:58526` to connect to WSA and install Magisk app (the one you use to build) and launch it
1. Make sure you have [Platform tools](https://developer.android.com/studio/releases/platform-tools)m run `adb connect localhost:58526` to connect to WSA, `adb install magisk.apk` to install Magisk App (the one you used to build) and launch it
1. Fix the environment as Magisk app will prompt and reboot (sometimes it keeps prompting even after environment fix, just ignore it)
1. Enjoy by installing Riru and LSPosed