From 2aa6170830e4ff3908c0d9f1a3534482dab612e1 Mon Sep 17 00:00:00 2001 From: Lev Rusanov <30170278+JDM170@users.noreply.github.com> Date: Wed, 1 May 2024 12:23:22 +0700 Subject: [PATCH] Update: microg downloading; workflow; readme.md Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com> --- .github/workflows/Build.yml | 2 +- Build.ps1 | 21 ++++++++++++++------- README.md | 4 +--- Scripts/MicroG.ps1 | 20 +++++++++++++------- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index ece1d8c..b1b4c38 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -56,7 +56,7 @@ jobs: run: | Get-ChildItem Temp\Temp -Recurse -Force $Parameters = @{ - Path = "Temp\revanced.apk", "Temp\microg.apk" + Path = "Temp\revanced.apk", "Temp\microg.apk", "Temp\microg-hw.apk" DestinationPath = "ReVanced.zip" CompressionLevel = "Fastest" Force = $true diff --git a/Build.ps1 b/Build.ps1 index d3aa0d1..31f9f78 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -112,14 +112,21 @@ $Parameters = @{ UseBasicParsing = $true Verbose = $true } -$URL = (Invoke-RestMethod @Parameters).assets.browser_download_url -$Parameters = @{ - Uri = $URL - Outfile = "$WorkingFolder\ReVanced\microg.apk" - UseBasicParsing = $true - Verbose = $true +$URL = (Invoke-RestMethod @Parameters).assets +foreach($url in $URL) { + if ($url.name.Contains("-hw-")) { + $url.name = "microg-hw.apk" + } else { + $url.name = "microg.apk" + } + $Parameters = @{ + Uri = $url.browser_download_url + Outfile = "$WorkingFolder\ReVanced\$($url.name)" + UseBasicParsing = $true + Verbose = $true + } + Invoke-RestMethod @Parameters } -Invoke-RestMethod @Parameters # Sometimes older version of zulu-jdk causes conflict, so remove older version before proceeding. if (Test-Path -Path "$WorkingFolder\ReVanced\jdk") diff --git a/README.md b/README.md index d6ee4ca..6f7c850 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,7 @@ Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflo ## Requirements if you compile locally * Windows 10 x64 or Windows 11 -* Windows PowerShell 5.1 - * PowerShell 7 won't work due to it doesn't contain Trident HTML parser, so I have to use a 3rd party parser [AngleSharp](https://github.com/AngleSharp/AngleSharp); - * If you still want it, [get](https://github.com/JDM170/ReVanced_Builder/blob/main/.github/workflows/Build.yml) code from Actions (it's run in PowerShell 7). +* Windows PowerShell 5.1/7 ## Links diff --git a/Scripts/MicroG.ps1 b/Scripts/MicroG.ps1 index fbe8c0a..aa7b69f 100644 --- a/Scripts/MicroG.ps1 +++ b/Scripts/MicroG.ps1 @@ -5,14 +5,20 @@ $Parameters = @{ Verbose = $true } $apiResult = Invoke-RestMethod @Parameters -$URL = $apiResult.assets.browser_download_url $TAG = $apiResult.tag_name -$Parameters = @{ - Uri = $URL - Outfile = "Temp\microg.apk" - UseBasicParsing = $true - Verbose = $true +foreach($url in $apiResult.assets) { + if ($url.name.Contains("-hw-")) { + $url.name = "microg-hw.apk" + } else { + $url.name = "microg.apk" + } + $Parameters = @{ + Uri = $url.browser_download_url + Outfile = "Temp\$($url.name)" + UseBasicParsing = $true + Verbose = $true + } + Invoke-RestMethod @Parameters } -Invoke-RestMethod @Parameters echo "MicroGTag=$TAG" >> $env:GITHUB_ENV