From 65dc96ac5218d65d2c56bdcb219d02f8e1dedf5a Mon Sep 17 00:00:00 2001 From: Lev Rusanov <30170278+JDM170@users.noreply.github.com> Date: Sun, 1 Dec 2024 18:23:09 +0700 Subject: [PATCH] Update files Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com> --- .github/workflows/Build.yml | 17 ++++------ Build.ps1 | 50 +++++++++++++----------------- ReleaseNotesTemplate.md | 1 - Scripts/ReVanced_Intergrations.ps1 | 18 ----------- Scripts/ReVanced_Patches.ps1 | 4 +-- 5 files changed, 30 insertions(+), 60 deletions(-) delete mode 100644 Scripts/ReVanced_Intergrations.ps1 diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 8adc140..d8e5d81 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -28,10 +28,6 @@ jobs: run: | . Scripts\ReVanced_Patches.ps1 - - name: Download ReVanced Integrations - run: | - . Scripts\ReVanced_Intergrations.ps1 - - name: Download Vanced MicroG run: | . Scripts\MicroG.ps1 @@ -46,12 +42,11 @@ jobs: & $JavaPath ` -jar "Temp\revanced-cli.jar" patch ` - --patch-bundle "Temp\revanced-patches.jar" ` - --merge "Temp\revanced-integrations.apk" ` - --exclude "Always repeat" ` - --exclude "Hide captions button" ` - --exclude "Hide timestamp" ` - --exclude "Hide seekbar" ` + --patches "Temp\revanced-patches.rvp" ` + --disable "Always repeat" ` + --disable "Disable auto captions" ` + --disable "Hide timestamp" ` + --disable "Hide seekbar" ` --purge ` --out "Temp\revanced.apk" ` "Temp\youtube.apk" @@ -71,7 +66,7 @@ jobs: id: read_release run: | # https://en.wikipedia.org/wiki/Percent-encoding - (Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw).replace("YouTubeTag", "${{ env.LatestSupportedYT }}").replace("CLITag", "${{ env.CLIvtag }}").replace("PatchesTag", "${{ env.Patchesvtag }}").replace("IntegrationsTag", "${{ env.IntegrationsTag }}").replace("MicroGTag", "${{ env.MicroGTag }}").replace("ZuluTag", "${{ env.ZuluTag }}") | Set-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Force + (Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw).replace("YouTubeTag", "${{ env.LatestSupportedYT }}").replace("CLITag", "${{ env.CLIvtag }}").replace("PatchesTag", "${{ env.Patchesvtag }}").replace("MicroGTag", "${{ env.MicroGTag }}").replace("ZuluTag", "${{ env.ZuluTag }}") | Set-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Force # https://trstringer.com/github-actions-multiline-strings/ Add-Content -Path $env:GITHUB_OUTPUT -Value "ReleaseBody=ReleaseNotesTemplate.md" $ReleaseName = Get-Date -f "yyyy.MM.dd" diff --git a/Build.ps1 b/Build.ps1 index 655e40b..62ed59c 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -35,14 +35,16 @@ if (-not (Test-Path -Path "$WorkingFolder\ReVanced")) } # Get the latest supported YouTube version to patch -# https://api.revanced.app/docs/swagger +# https://api.revanced.app $Parameters = @{ - Uri = "https://api.revanced.app/v2/patches/latest" + Uri = "https://api.revanced.app/v4/patches/list" UseBasicParsing = $true } -$JSON = (Invoke-RestMethod @Parameters).patches -$versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq "com.google.android.youtube"}).compatiblePackages.versions -$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1 +$JSON = (Invoke-Webrequest @Parameters).Content | ConvertFrom-Json +$versions = ($JSON | Where-Object -FilterScript {$_.name -eq "Video ads"}) +$LatestSupported = $versions.compatiblePackages.'com.google.android.youtube' | Sort-Object -Descending -Unique | Select-Object -First 1 + +Write-Verbose -Message "Downloading the latest supported YouTube apk" -Verbose # We need a NON-bundle version <# @@ -110,6 +112,8 @@ $Parameters = @{ } Invoke-Webrequest @Parameters +Write-Verbose -Message "" -Verbose +Write-Verbose -Message "Downloading ReVanced CLI" -Verbose # https://github.com/revanced/revanced-cli $Parameters = @{ Uri = "https://api.github.com/repos/revanced/revanced-cli/releases/latest" @@ -125,36 +129,25 @@ $Parameters = @{ } Invoke-RestMethod @Parameters +Write-Verbose -Message "" -Verbose +Write-Verbose -Message "Downloading ReVanced patches" -Verbose # https://github.com/revanced/revanced-patches $Parameters = @{ Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest" UseBasicParsing = $true Verbose = $true } -$URL = ((Invoke-RestMethod @Parameters).assets | Where-Object -FilterScript {$_.content_type -eq "application/java-archive"}).browser_download_url +$URL = ((Invoke-RestMethod @Parameters).assets | Where-Object -FilterScript {$_.content_type -eq "text/plain"}).browser_download_url $Parameters = @{ Uri = $URL - Outfile = "$WorkingFolder\ReVanced\revanced-patches.jar" - UseBasicParsing = $true - Verbose = $true -} -Invoke-RestMethod @Parameters - -# https://github.com/revanced/revanced-integrations -$Parameters = @{ - Uri = "https://api.github.com/repos/revanced/revanced-integrations/releases/latest" - UseBasicParsing = $true - Verbose = $true -} -$URL = ((Invoke-RestMethod @Parameters).assets | Where-Object -FilterScript {$_.content_type -eq "application/vnd.android.package-archive"}).browser_download_url -$Parameters = @{ - Uri = $URL - Outfile = "$WorkingFolder\ReVanced\revanced-integrations.apk" + Outfile = "$WorkingFolder\ReVanced\revanced-patches.rvp" UseBasicParsing = $true Verbose = $true } Invoke-RestMethod @Parameters +Write-Verbose -Message "" -Verbose +Write-Verbose -Message "Downloading ReVanced GmsCore" -Verbose # https://github.com/ReVanced/GmsCore $Parameters = @{ Uri = "https://api.github.com/repos/ReVanced/GmsCore/releases/latest" @@ -183,6 +176,8 @@ if (Test-Path -Path "$WorkingFolder\ReVanced\jdk") Remove-Item -Path "$WorkingFolder\ReVanced\jdk" -Recurse -Force } +Write-Verbose -Message "" -Verbose +Write-Verbose -Message "Downloading Azul Zulu" -Verbose # https://github.com/ScoopInstaller/Java/blob/master/bucket/zulu-jdk.json $Parameters = @{ Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json" @@ -212,12 +207,11 @@ Remove-Item -Path "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip" -Force # Let's create patched APK & "$WorkingFolder\ReVanced\jdk\zulu*win_x64\bin\java.exe" ` -jar "$WorkingFolder\ReVanced\revanced-cli.jar" patch ` ---patch-bundle "$WorkingFolder\ReVanced\revanced-patches.jar" ` ---merge "$WorkingFolder\ReVanced\revanced-integrations.apk" ` ---exclude "Always repeat" ` ---exclude "Hide captions button" ` ---exclude "Hide timestamp" ` ---exclude "Hide seekbar" ` +--patches "$WorkingFolder\ReVanced\revanced-patches.rvp" ` +--disable "Always repeat" ` +--disable "Disable auto captions" ` +--disable "Hide timestamp" ` +--disable "Hide seekbar" ` --purge ` --temporary-files-path "$WorkingFolder\ReVanced\Temp" ` --out "$WorkingFolder\ReVanced\revanced.apk" ` diff --git a/ReleaseNotesTemplate.md b/ReleaseNotesTemplate.md index fa2861a..2ba2829 100644 --- a/ReleaseNotesTemplate.md +++ b/ReleaseNotesTemplate.md @@ -3,6 +3,5 @@ * YouTube YouTubeTag; * ReVanced CLI CLITag; * ReVanced Patches PatchesTag; -* ReVanced Integrations IntegrationsTag; * ReVanced MicroG MicroGTag; * Azul Zulu ZuluTag. diff --git a/Scripts/ReVanced_Intergrations.ps1 b/Scripts/ReVanced_Intergrations.ps1 deleted file mode 100644 index 55ab6cc..0000000 --- a/Scripts/ReVanced_Intergrations.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -# https://github.com/revanced/revanced-integrations -$Parameters = @{ - Uri = "https://api.github.com/repos/revanced/revanced-integrations/releases/latest" - UseBasicParsing = $true - Verbose = $true -} -$apiResult = Invoke-RestMethod @Parameters -$URL = ($apiResult.assets | Where-Object -FilterScript {$_.content_type -eq "application/vnd.android.package-archive"}).browser_download_url -$TAG = $apiResult.tag_name -$Parameters = @{ - Uri = $URL - Outfile = "Temp\revanced-integrations.apk" - UseBasicParsing = $true - Verbose = $true -} -Invoke-RestMethod @Parameters - -echo "IntegrationsTag=$TAG" >> $env:GITHUB_ENV diff --git a/Scripts/ReVanced_Patches.ps1 b/Scripts/ReVanced_Patches.ps1 index d246236..0c117fa 100644 --- a/Scripts/ReVanced_Patches.ps1 +++ b/Scripts/ReVanced_Patches.ps1 @@ -5,11 +5,11 @@ $Parameters = @{ Verbose = $true } $apiResult = Invoke-RestMethod @Parameters -$URL = ($apiResult.assets | Where-Object -FilterScript {$_.content_type -eq "application/java-archive"}).browser_download_url +$URL = ($apiResult.assets | Where-Object -FilterScript {$_.content_type -eq "text/plain"}).browser_download_url $TAG = $apiResult.tag_name $Parameters = @{ Uri = $URL - Outfile = "Temp\revanced-patches.jar" + Outfile = "Temp\revanced-patches.rvp" UseBasicParsing = $true Verbose = $true }