├── .github └── workflows │ └── Build.yml ├── Build.ps1 ├── LICENSE ├── README.md ├── ReleaseNotesTemplate.md └── Scripts ├── MicroG.ps1 ├── ReVanced_CLI.ps1 ├── ReVanced_Patches.ps1 ├── YouTube.ps1 └── Zulu_JDK.ps1 /.github/workflows/Build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | workflow_dispatch: 8 | 9 | jobs: 10 | patch: 11 | runs-on: windows-latest 12 | timeout-minutes: 5 13 | steps: 14 | - uses: actions/checkout@main 15 | 16 | - name: AngleSharp 17 | run: | 18 | New-Item -Path ReVanced_Builder -ItemType Directory -Force 19 | 20 | # https://www.nuget.org/packages/AngleSharp/ 21 | $Parameters = @{ 22 | Uri = "https://www.nuget.org/api/v2/package/AngleSharp" 23 | OutFile = "anglesharp.nupkg" 24 | UseBasicParsing = $true 25 | Verbose = $true 26 | } 27 | Invoke-Webrequest @Parameters 28 | 29 | Add-Type -Assembly System.IO.Compression.FileSystem 30 | 31 | Add-Type -Assembly System.IO.Compression.FileSystem 32 | $ZIP = [IO.Compression.ZipFile]::OpenRead("anglesharp.nupkg") 33 | $ZIP.Entries| Where-Object -FilterScript {($_.FullName -eq "lib/net8.0/AngleSharp.xml") -or ($_.FullName -eq "lib/net8.0/AngleSharp.dll")} | ForEach-Object -Process { 34 | [IO.Compression.ZipFileExtensions]::ExtractToFile($_, "$($_.Name)", $true) 35 | } 36 | $ZIP.Dispose() 37 | 38 | - name: YouTube 39 | run: | 40 | . Scripts\YouTube.ps1 41 | 42 | - name: ReVanced CLI 43 | run: | 44 | . Scripts\ReVanced_CLI.ps1 45 | 46 | - name: Downloading ReVanced Patches 47 | run: | 48 | . Scripts\ReVanced_Patches.ps1 49 | 50 | - name: Vanced MicroG 51 | run: | 52 | . Scripts\MicroG.ps1 53 | 54 | - name: Zulu JDK 55 | run: | 56 | . Scripts\Zulu_JDK.ps1 57 | 58 | - name: Building 59 | run: | 60 | # https://revanced.app/patches?pkg=com.google.android.youtube 61 | # https://github.com/ReVanced/revanced-cli/tree/main/docs 62 | & "$env:ProgramFiles\Zulu\zulu*\bin\java.exe" ` 63 | -jar "ReVanced_Builder\revanced-cli.jar" ` 64 | patch "ReVanced_Builder\youtube.apk" ` 65 | --patches "ReVanced_Builder\revanced-patches.rvp" ` 66 | --purge ` 67 | --out "ReVanced_Builder\revanced.apk" 68 | 69 | - name: Creating archive 70 | run: | 71 | $Parameters = @{ 72 | Path = "ReVanced_Builder\revanced.apk", "ReVanced_Builder\microg.apk", "ReVanced_Builder\microg-huawei.apk" 73 | DestinationPath = "ReVanced.zip" 74 | CompressionLevel = "Fastest" 75 | Force = $true 76 | } 77 | Compress-Archive @Parameters 78 | 79 | - name: ReleaseNotesTemplate 80 | id: read_release 81 | run: | 82 | # https://en.wikipedia.org/wiki/Percent-encoding 83 | (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 84 | 85 | # https://trstringer.com/github-actions-multiline-strings/ 86 | Add-Content -Path $env:GITHUB_OUTPUT -Value "ReleaseBody=ReleaseNotesTemplate.md" 87 | 88 | $ReleaseName = Get-Date -f "yyyy.MM.dd" 89 | echo "RELEASE_NAME=$ReleaseName" >> $env:GITHUB_ENV 90 | 91 | - name: Uploading 92 | uses: softprops/action-gh-release@master 93 | with: 94 | name: ${{ env.RELEASE_NAME }} 95 | token: ${{ github.token }} 96 | files: ReVanced.zip 97 | body_path: ${{ steps.read_release.outputs.ReleaseBody }} 98 | -------------------------------------------------------------------------------- /Build.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | Build ReVanced app using latest components: 4 | YouTube (latest supported); 5 | ReVanced CLI; 6 | ReVanced Patches; 7 | ReVanced Integrations; 8 | ReVanced microG GmsCore; 9 | Azul Zulu. 10 | 11 | .NOTES 12 | After compiling, microg.apk and compiled revanced.apk will be located in "Downloads folder\ReVanced" 13 | 14 | .LINKS 15 | https://github.com/revanced 16 | #> 17 | 18 | #Requires -Version 5.1 19 | 20 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 21 | 22 | if ($Host.Version.Major -eq 5) 23 | { 24 | # Progress bar can significantly impact cmdlet performance 25 | # https://github.com/PowerShell/PowerShell/issues/2138 26 | $Script:ProgressPreference = "SilentlyContinue" 27 | } 28 | 29 | # Download all files to "Downloads folder\ReVanced" 30 | $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" 31 | if (-not (Test-Path -Path "$DownloadsFolder\ReVanced")) 32 | { 33 | New-Item -Path "$DownloadsFolder\ReVanced" -ItemType Directory -Force 34 | } 35 | 36 | # Get the latest supported YouTube version to patch 37 | # https://api.revanced.app 38 | $Parameters = @{ 39 | Uri = "https://api.revanced.app/v4/patches/list" 40 | UseBasicParsing = $true 41 | Verbose = $true 42 | } 43 | $JSON = (Invoke-Webrequest @Parameters).Content | ConvertFrom-Json 44 | $versions = ($JSON | Where-Object -FilterScript {$_.name -eq "Video ads"}) 45 | $LatestSupported = $versions.compatiblePackages.'com.google.android.youtube' | Sort-Object -Descending -Unique | Select-Object -First 1 46 | $LatestSupported = $LatestSupported.Replace(".", "-") 47 | 48 | Write-Verbose -Message "Downloading the latest supported YouTube apk" -Verbose 49 | 50 | # We need a NON-bundle version 51 | # https://www.apkmirror.com/apk/google-inc/youtube/ 52 | $Parameters = @{ 53 | Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/" 54 | UseBasicParsing = $false # Disabled 55 | Verbose = $true 56 | } 57 | $Request = Invoke-Webrequest @Parameters 58 | 59 | $Parameters = @{ 60 | Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/" 61 | UseBasicParsing = $false # Disabled 62 | Verbose = $true 63 | } 64 | $Request2 = Invoke-Webrequest @Parameters 65 | 66 | @($Request, $Request2) | ForEach-Object -Process { 67 | $RequestVariable = $_ 68 | 69 | $RequestVariable.ParsedHtml.getElementsByTagName("a") | Where-Object -FilterScript {$_.className -match "downloadButton"} | ForEach-Object -Process { 70 | if ($_.innerText -notmatch "Download APK Bundle") 71 | { 72 | $DownloadKey = $_.href.Replace("about:/", "") 73 | } 74 | } 75 | } 76 | 77 | $Parameters = @{ 78 | Uri = "https://www.apkmirror.com/$DownloadKey" 79 | UseBasicParsing = $true 80 | Verbose = $true 81 | } 82 | $Request = Invoke-Webrequest @Parameters 83 | $DownloadURL = $Request.Links.href | Where-Object -FilterScript {$_ -match "download.php"} 84 | 85 | $Parameters = @{ 86 | Uri = "https://www.apkmirror.com/$DownloadURL" 87 | OutFile = "$DownloadsFolder\ReVanced\youtube.apk" 88 | UseBasicParsing = $true 89 | Verbose = $true 90 | } 91 | Invoke-Webrequest @Parameters 92 | 93 | Write-Verbose -Message "Downloading ReVanced cli" -Verbose 94 | 95 | # https://github.com/revanced/revanced-cli 96 | $Parameters = @{ 97 | Uri = "https://api.github.com/repos/revanced/revanced-cli/releases/latest" 98 | UseBasicParsing = $true 99 | Verbose = $true 100 | } 101 | 102 | $Tag = (Invoke-RestMethod @Parameters).tag_name 103 | $Tag2 = $Tag.replace("v", "") 104 | $Parameters = @{ 105 | Uri = "https://github.com/revanced/revanced-cli/releases/download/$Tag/revanced-cli-$Tag2-all.jar" 106 | Outfile = "$DownloadsFolder\ReVanced\revanced-cli.jar" 107 | UseBasicParsing = $true 108 | Verbose = $true 109 | } 110 | Invoke-RestMethod @Parameters 111 | 112 | Write-Verbose -Message "Downloading ReVanced patches" -Verbose 113 | 114 | # https://github.com/revanced/revanced-patches 115 | $Parameters = @{ 116 | Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest" 117 | UseBasicParsing = $true 118 | Verbose = $true 119 | } 120 | 121 | $Patchesvtag = (Invoke-RestMethod @Parameters).tag_name 122 | $Patchestag = $Patchesvtag.replace("v", "") 123 | 124 | $Parameters = @{ 125 | Uri = "https://github.com/revanced/revanced-patches/releases/download/$Patchesvtag/patches-$Patchestag.rvp" 126 | Outfile = "$DownloadsFolder\ReVanced\revanced-patches.rvp" 127 | UseBasicParsing = $true 128 | Verbose = $true 129 | } 130 | Invoke-RestMethod @Parameters 131 | 132 | Write-Verbose -Message "Downloading ReVanced GmsCore" -Verbose 133 | 134 | # https://github.com/ReVanced/GmsCore 135 | $Parameters = @{ 136 | Uri = "https://api.github.com/repos/ReVanced/GmsCore/releases/latest" 137 | UseBasicParsing = $true 138 | Verbose = $true 139 | } 140 | # Default microg.apk 141 | $URL_Default = (Invoke-RestMethod @Parameters).assets.browser_download_url | Where-Object -FilterScript {$_ -notmatch "hw"} 142 | # microg.apk for Huawei, Xiaomi 143 | $URL_Vendors = (Invoke-RestMethod @Parameters).assets.browser_download_url | Where-Object -FilterScript {$_ -match "hw"} 144 | 145 | # Default microg.apk 146 | $Parameters = @{ 147 | Uri = $URL_Default 148 | Outfile = "$DownloadsFolder\ReVanced\microg.apk" 149 | UseBasicParsing = $true 150 | Verbose = $true 151 | } 152 | Invoke-RestMethod @Parameters 153 | 154 | # microg.apk for Huawei, Xiaomi 155 | $Parameters = @{ 156 | Uri = $URL_Vendors 157 | Outfile = "$DownloadsFolder\ReVanced\microg_for_huawei_xiaomi.apk" 158 | UseBasicParsing = $true 159 | Verbose = $true 160 | } 161 | Invoke-RestMethod @Parameters 162 | 163 | Remove-Item -Path "$DownloadsFolder\ReVanced\zulu-jdk-win_x64" -Recurse -Force -ErrorAction Ignore 164 | 165 | Write-Verbose -Message "Downloading Azul Zulu" -Verbose 166 | 167 | # https://app.swaggerhub.com/apis-docs/azul/zulu-download-community/1.0 168 | $Parameters = @{ 169 | Uri = "https://api.azul.com/zulu/download/community/v1.0/bundles/latest/?jdk_version=21&bundle_type=jdk&javafx=false&ext=msi&os=windows&arch=x86&hw_bitness=64" 170 | UseBasicParsing = $true 171 | Verbose = $true 172 | } 173 | $URL = (Invoke-RestMethod @Parameters).url 174 | 175 | $Parameters = @{ 176 | Uri = $URL 177 | Outfile = "$DownloadsFolder\ReVanced\zulu-jdk-win_x64.msi" 178 | UseBasicParsing = $true 179 | Verbose = $true 180 | } 181 | Invoke-RestMethod @Parameters 182 | 183 | # Extract zulu-jdk-win_x64.msi to zulu-jdk-win_x64 folder 184 | $Arguments = @( 185 | "/a `"$DownloadsFolder\ReVanced\zulu-jdk-win_x64.msi`"", 186 | "TARGETDIR=`"$DownloadsFolder\ReVanced\zulu-jdk-win_x64`"" 187 | "/qb" 188 | ) 189 | Start-Process "msiexec" -ArgumentList $Arguments -Wait 190 | 191 | Remove-Item -Path "$DownloadsFolder\ReVanced\zulu-jdk-win_x64.msi" -Force 192 | 193 | # https://revanced.app/patches?pkg=com.google.android.youtube 194 | # https://github.com/ReVanced/revanced-cli/tree/main/docs 195 | & "$DownloadsFolder\ReVanced\zulu-jdk-win_x64\Program Files\Zulu\zulu*\bin\java.exe" ` 196 | -jar "$DownloadsFolder\ReVanced\revanced-cli.jar" ` 197 | patch "$DownloadsFolder\ReVanced\youtube.apk" ` 198 | --patches "$DownloadsFolder\ReVanced\revanced-patches.rvp" ` 199 | --purge ` 200 | --out "$DownloadsFolder\ReVanced\revanced.apk" 201 | 202 | Invoke-Item -Path "$DownloadsFolder\ReVanced" 203 | 204 | $Files = @( 205 | "$DownloadsFolder\ReVanced\revanced-temporary-files", 206 | "$DownloadsFolder\ReVanced\zulu-jdk-win_x64", 207 | "$DownloadsFolder\ReVanced\revanced.keystore", 208 | "$DownloadsFolder\ReVanced\revanced-cli.jar", 209 | "$DownloadsFolder\ReVanced\revanced-patches.rvp", 210 | "$DownloadsFolder\ReVanced\youtube.apk" 211 | ) 212 | Remove-Item -Path $Files -Recurse -Force 213 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Dmitry Nefedov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Telegram](https://img.shields.io/badge/Sophia%20Chat-Telegram-blue?style=flat&logo=Telegram)](https://t.me/sophia_chat) [![Builder](https://img.shields.io/github/actions/workflow/status/farag2/ReVanced_Builder/Build.yml?label=GitHub%20Actions&logo=GitHub)](https://github.com/farag2/ReVanced_Builder/actions) 2 | 3 | # ReVanced builder 4 | 5 | Build ReVanced package (.apk) easily than ever using latest ReVanced patches and dependencies locally or via cloud 6 | 7 | ## Usage 8 | 9 | ### Locally 10 | 11 | * To build `revanced.apk` locally you need just to run [`Build.ps1`](https://github.com/farag2/ReVanced_Builder/blob/main/Build.ps1) via PowerShell; 12 | * All [patches](https://github.com/revanced/revanced-patches) except the followings applied to `revanced.apk`: 13 | * comments 14 | * premium-heading 15 | * hide-captions-button 16 | * disable-fullscreen-panels 17 | 18 | * The script downloads latest available YouTube package (having parsed [JSON](https://api.revanced.app/v2/patches/latest)) supported by ReVanced Team from and all dependencies and build package using [Zulu JDK](https://www.azul.com/downloads/?package=jdk); 19 | * Script installs no apps—everything will be held in your `Downloads folder\ReVanced`; 20 | * After compiling you get `revanced.apk` & `microg.apk` ready to be installed; 21 | * Release notes are generated dynamically using the [Release.md](https://github.com/farag2/ReVanced_Builder/blob/main/ReleaseNotesTemplate.md) template. 22 | 23 | ### By using CI/CD 24 | 25 | ```powershell 26 | git clone https://github.com/farag2/ReVanced_Builder 27 | ``` 28 | 29 | Trigger the [`Build`](https://github.com/farag2/ReVanced_Builder/actions/workflows/Build.yml) Action manually to create [release page](https://github.com/farag2/ReVanced_Builder/releases/latest) with configured release notes showing dependencies used for building. 30 | 31 | ![image](https://user-images.githubusercontent.com/10544660/187949763-82fd7a07-8e4e-4527-b631-11920077141f.png) 32 | 33 | `ReVanced.zip` will contain a built `revanced.apk` & latest `microg.apk`. 34 | 35 | ## Requirements if you compile locally 36 | 37 | * Windows 10 x64 or Windows 11 38 | * Windows PowerShell 5.1/PowerShell 7. 39 | 40 | ## Links 41 | 42 | * [ReVanced Patches](https://github.com/revanced/revanced-patches) 43 | * [ReVanced Manager](https://github.com/revanced/revanced-manager) 44 | * [Telegram](https://t.me/sophia_chat) 45 | * [AngleSharp](https://github.com/AngleSharp/AngleSharp) 46 | -------------------------------------------------------------------------------- /ReleaseNotesTemplate.md: -------------------------------------------------------------------------------- 1 | ## Automatically generated release notes 2 | 3 | * YouTube YouTubeTag; 4 | * ReVanced CLI CLITag; 5 | * ReVanced Patches PatchesTag; 6 | * ReVanced MicroG MicroGTag; 7 | * Azul Zulu ZuluTag. 8 | -------------------------------------------------------------------------------- /Scripts/MicroG.ps1: -------------------------------------------------------------------------------- 1 | # https://github.com/ReVanced/GmsCore 2 | $URLParameters = @{ 3 | Uri = "https://api.github.com/repos/ReVanced/GmsCore/releases/latest" 4 | UseBasicParsing = $true 5 | Verbose = $true 6 | } 7 | # Default apk 8 | $URL = (Invoke-RestMethod @URLParameters).assets.browser_download_url | Where-Object -FilterScript {$_ -notmatch "hw"} 9 | $MicroGTag = (Invoke-RestMethod @URLParameters).tag_name 10 | 11 | $Parameters = @{ 12 | Uri = $URL 13 | Outfile = "ReVanced_Builder\microg.apk" 14 | UseBasicParsing = $true 15 | Verbose = $true 16 | } 17 | Invoke-RestMethod @Parameters 18 | 19 | # Huawei apk 20 | $URL = (Invoke-RestMethod @URLParameters).assets.browser_download_url | Where-Object -FilterScript {$_ -match "hw"} 21 | $Parameters = @{ 22 | Uri = $URL 23 | Outfile = "ReVanced_Builder\microg-huawei.apk" 24 | UseBasicParsing = $true 25 | Verbose = $true 26 | } 27 | Invoke-RestMethod @Parameters 28 | 29 | echo "MicroGTag=$MicroGTag" >> $env:GITHUB_ENV 30 | -------------------------------------------------------------------------------- /Scripts/ReVanced_CLI.ps1: -------------------------------------------------------------------------------- 1 | # https://github.com/revanced/revanced-cli 2 | $Parameters = @{ 3 | Uri = "https://api.github.com/repos/revanced/revanced-cli/releases/latest" 4 | UseBasicParsing = $true 5 | Verbose = $true 6 | } 7 | $CLIvtag = (Invoke-RestMethod @Parameters).tag_name 8 | $CLItag = $CLIvtag.replace("v", "") 9 | 10 | $Parameters = @{ 11 | Uri = "https://github.com/revanced/revanced-cli/releases/download/$CLIvtag/revanced-cli-$CLItag-all.jar" 12 | Outfile = "ReVanced_Builder\revanced-cli.jar" 13 | Headers = $Headers 14 | UseBasicParsing = $true 15 | Verbose = $true 16 | } 17 | Invoke-RestMethod @Parameters 18 | 19 | echo "CLIvtag=$CLIvtag" >> $env:GITHUB_ENV 20 | -------------------------------------------------------------------------------- /Scripts/ReVanced_Patches.ps1: -------------------------------------------------------------------------------- 1 | # https://github.com/revanced/revanced-patches 2 | $Parameters = @{ 3 | Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest" 4 | UseBasicParsing = $true 5 | Verbose = $true 6 | } 7 | $Patchesvtag = (Invoke-RestMethod @Parameters).tag_name 8 | $Patchestag = $Patchesvtag.replace("v", "") 9 | 10 | $Parameters = @{ 11 | Uri = "https://github.com/revanced/revanced-patches/releases/download/$Patchesvtag/patches-$Patchestag.rvp" 12 | Outfile = "ReVanced_Builder\revanced-patches.rvp" 13 | UseBasicParsing = $true 14 | Verbose = $true 15 | } 16 | Invoke-RestMethod @Parameters 17 | 18 | echo "Patchesvtag=$Patchesvtag" >> $env:GITHUB_ENV 19 | -------------------------------------------------------------------------------- /Scripts/YouTube.ps1: -------------------------------------------------------------------------------- 1 | # Get the latest supported YouTube version to patch 2 | # https://api.revanced.app/docs/swagger 3 | $Parameters = @{ 4 | Uri = "https://api.revanced.app/v4/patches/list" 5 | UseBasicParsing = $true 6 | Verbose = $true 7 | } 8 | $JSON = (Invoke-Webrequest @Parameters).Content | ConvertFrom-Json 9 | $Patches = ($JSON | Where-Object -FilterScript {$_.name -eq "Video ads"}) 10 | $LatestSupportedYT = $Patches.compatiblePackages."com.google.android.youtube" | Sort-Object -Descending -Unique | Select-Object -First 1 11 | $LatestSupported = $LatestSupportedYT.Replace(".", "-") 12 | 13 | # We need a NON-bundle version 14 | # https://www.apkmirror.com/apk/google-inc/youtube/ 15 | $Parameters = @{ 16 | Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/" 17 | UseBasicParsing = $false # Disabled 18 | Verbose = $true 19 | } 20 | $Request = Invoke-Webrequest @Parameters 21 | 22 | $Parameters = @{ 23 | Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/" 24 | UseBasicParsing = $false # Disabled 25 | Verbose = $true 26 | } 27 | $Request2 = Invoke-Webrequest @Parameters 28 | 29 | # Load AngleSharp 30 | Add-Type -Path "AngleSharp.dll" 31 | 32 | @($Request, $Request2) | ForEach-Object -Process { 33 | $RequestVariable = $_ 34 | 35 | (New-Object -TypeName AngleSharp.Html.Parser.HtmlParser).ParseDocument($RequestVariable.Content).All | Where-Object -FilterScript {$_.className -match "downloadButton"} | ForEach-Object -Process { 36 | if (($_.InnerHtml -notmatch "Download APK Bundle") -and $_.Href) 37 | { 38 | $DownloadKey = "$($_.PathName)$($_.Search)" 39 | } 40 | } 41 | } 42 | 43 | $Parameters = @{ 44 | Uri = "https://www.apkmirror.com$DownloadKey" 45 | UseBasicParsing = $true 46 | Verbose = $true 47 | } 48 | $Request = Invoke-Webrequest @Parameters 49 | $DownloadURL = $Request.Links.href | Where-Object -FilterScript {$_ -match "download.php"} 50 | 51 | $Parameters = @{ 52 | Uri = "https://www.apkmirror.com/$DownloadURL" 53 | OutFile = "ReVanced_Builder\youtube.apk" 54 | UseBasicParsing = $true 55 | Verbose = $true 56 | } 57 | Invoke-Webrequest @Parameters 58 | 59 | echo "LatestSupportedYT=$LatestSupportedYT" >> $env:GITHUB_ENV 60 | -------------------------------------------------------------------------------- /Scripts/Zulu_JDK.ps1: -------------------------------------------------------------------------------- 1 | # https://app.swaggerhub.com/apis-docs/azul/zulu-download-community/1.0 2 | $Parameters = @{ 3 | Uri = "https://api.azul.com/zulu/download/community/v1.0/bundles/latest/?jdk_version=21&bundle_type=jdk&javafx=false&ext=msi&os=windows&arch=x86&hw_bitness=64" 4 | UseBasicParsing = $true 5 | Verbose = $true 6 | } 7 | $URL = (Invoke-RestMethod @Parameters).url 8 | 9 | $ZuluTag = (Invoke-RestMethod @Parameters).jdk_version -join "." 10 | echo "ZuluTag=$ZuluTag" >> $env:GITHUB_ENV 11 | 12 | $Parameters = @{ 13 | Uri = $URL 14 | Outfile = "ReVanced_Builder\zulu-jdk-win_x64.msi" 15 | UseBasicParsing = $true 16 | Verbose = $true 17 | } 18 | Invoke-RestMethod @Parameters 19 | 20 | Write-Verbose -Message "Installing Zulu JDK" -Verbose 21 | 22 | $Arguments = @( 23 | "/i `"ReVanced_Builder\zulu-jdk-win_x64.msi`"", 24 | "/quiet", 25 | "/qb", 26 | "/norestart" 27 | ) 28 | Start-Process -FilePath "msiexec" -ArgumentList $Arguments -Wait 29 | 30 | Remove-Item -Path "ReVanced_Builder\zulu-jdk-win_x64.msi" -Force 31 | --------------------------------------------------------------------------------