mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
Compare commits
33 Commits
2023.10.29
...
2025.06.01
| Author | SHA1 | Date | |
|---|---|---|---|
|
ca508c0e24
|
|||
|
b879ad95f3
|
|||
|
3edfdcc627
|
|||
| d2ab1f83d7 | |||
| 689cf90f6a | |||
|
9c38444051
|
|||
|
65dc96ac52
|
|||
|
4905811659
|
|||
|
4758eb22cf
|
|||
|
c3c0a74bfe
|
|||
|
2aa6170830
|
|||
|
db4d8ea6a3
|
|||
|
c51bb19b8d
|
|||
|
096c05b8cf
|
|||
|
82cfc6d1f6
|
|||
|
c4e701fc83
|
|||
|
5c614ab6cd
|
|||
|
83310266b7
|
|||
|
3381005bb2
|
|||
|
f26e8938d4
|
|||
|
a9787a19a4
|
|||
|
119c8b0e2a
|
|||
|
75f3ea82c6
|
|||
|
63e95a3a63
|
|||
|
a61a5fbb8a
|
|||
|
f10c8abf4e
|
|||
|
8242b06085
|
|||
| bdca80cf21 | |||
| 271a6e13c6 | |||
|
7f15206c6d
|
|||
|
dab245fc0d
|
|||
|
aec3595c1f
|
|||
|
6d79dcd962
|
30
.github/workflows/Build.yml
vendored
30
.github/workflows/Build.yml
vendored
@@ -1,9 +1,6 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -31,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
|
||||
@@ -49,14 +42,12 @@ jobs:
|
||||
|
||||
& $JavaPath `
|
||||
-jar "Temp\revanced-cli.jar" patch `
|
||||
--patch-bundle "Temp\revanced-patches.jar" `
|
||||
--merge "Temp\revanced-integrations.apk" `
|
||||
--exclude "always-autorepeat" `
|
||||
--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 `
|
||||
--resource-cache "Temp\Temp" `
|
||||
--out "Temp\revanced.apk" `
|
||||
"Temp\youtube.apk"
|
||||
|
||||
@@ -64,7 +55,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
|
||||
@@ -75,16 +66,15 @@ 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"
|
||||
echo "RELEASE_NAME=$ReleaseName" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Upload to Releases
|
||||
uses: softprops/action-gh-release@master
|
||||
uses: softprops/action-gh-release@v2.2.1
|
||||
with:
|
||||
tag_name: ${{ env.RELEASE_NAME }}
|
||||
token: ${{ github.token }}
|
||||
files: ReVanced.zip
|
||||
body_path: ${{ steps.read_release.outputs.ReleaseBody }}
|
||||
files: ReVanced.zip
|
||||
|
||||
165
Build.ps1
165
Build.ps1
@@ -5,7 +5,7 @@
|
||||
* ReVanced CLI;
|
||||
* ReVanced Patches;
|
||||
* ReVanced Integrations;
|
||||
* microG GmsCore;
|
||||
* ReVanced microG GmsCore;
|
||||
* Azul Zulu.
|
||||
|
||||
.NOTES
|
||||
@@ -18,32 +18,56 @@
|
||||
# Requires -Version 5.1
|
||||
# Doesn't work on PowerShell 7.2 due it doesn't contains IE parser engine. You have to use a 3rd party module to make it work like it's presented in CI/CD config: AngleSharp
|
||||
|
||||
# Invoke-Webrequest speedup workaround. Improved downloads speeds significantly.
|
||||
# Ref: https://www.codewrecks.com/post/azdo/pills/powershell-download/
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
if ($Host.Version.Major -eq 5)
|
||||
{
|
||||
# Progress bar can significantly impact cmdlet performance
|
||||
# https://github.com/PowerShell/PowerShell/issues/2138
|
||||
$Script:ProgressPreference = "SilentlyContinue"
|
||||
}
|
||||
|
||||
# Download all files to "Script location folder\ReVanced"
|
||||
$WorkingFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
if (-not (Test-Path -Path "$WorkingFolder\ReVanced"))
|
||||
$CurrentFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
if (-not (Test-Path -Path "$CurrentFolder\ReVanced"))
|
||||
{
|
||||
New-Item -Path "$WorkingFolder\ReVanced" -ItemType Directory -Force
|
||||
New-Item -Path "$CurrentFolder\ReVanced" -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# Get latest supported YouTube client version via ReVanced JSON
|
||||
# It will let us to download always latest YouTube apk supported by ReVanced team
|
||||
# https://github.com/revanced/revanced-patches/blob/main/patches.json
|
||||
# Get the latest supported YouTube version to patch
|
||||
# https://api.revanced.app
|
||||
$Parameters = @{
|
||||
Uri = "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json"
|
||||
Uri = "https://api.revanced.app/v4/patches/list"
|
||||
UseBasicParsing = $true
|
||||
}
|
||||
$JSON = Invoke-RestMethod @Parameters
|
||||
$versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq "com.google.android.youtube"}).compatiblePackages.versions
|
||||
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
|
||||
$LatestSupported = $LatestSupported.replace(".", "-")
|
||||
$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 "" -Verbose
|
||||
Write-Verbose -Message "Downloading the latest supported YouTube apk" -Verbose
|
||||
|
||||
# We need a NON-bundle version
|
||||
<#
|
||||
# https://apkpure.net/ru/youtube/com.google.android.youtube/versions
|
||||
$Parameters = @{
|
||||
Uri = "https://apkpure.net/youtube/com.google.android.youtube/download/$($LatestSupported)"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
$URL = (Invoke-Webrequest @Parameters).Links.href | Where-Object -FilterScript {$_ -match "APK/com.google.android.youtube"} | Select-Object -Index 1
|
||||
|
||||
$Parameters = @{
|
||||
Uri = $URL
|
||||
OutFile = "$CurrentFolder\ReVanced\youtube.apk"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
Invoke-Webrequest @Parameters
|
||||
#>
|
||||
|
||||
# Trying to find correct APK link (not BUNDLE)
|
||||
# https://www.apkmirror.com/apk/google-inc/youtube/
|
||||
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/"
|
||||
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported.replace('.', '-'))-release/"
|
||||
$Parameters = @{
|
||||
Uri = $apkMirrorLink
|
||||
UseBasicParsing = $false # Disabled
|
||||
@@ -83,77 +107,78 @@ $URL_Part = $URL_Part.Replace("&", "&")
|
||||
# Finally, get the real link
|
||||
$Parameters = @{
|
||||
Uri = "https://www.apkmirror.com$URL_Part"
|
||||
OutFile = "$WorkingFolder\ReVanced\youtube.apk"
|
||||
OutFile = "$CurrentFolder\ReVanced\youtube.apk"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
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"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
$URL = (Invoke-RestMethod @Parameters).assets.browser_download_url
|
||||
$URL = ((Invoke-RestMethod @Parameters).assets | Where-Object -FilterScript {$_.content_type -eq "application/java-archive"}).browser_download_url
|
||||
$Parameters = @{
|
||||
Uri = $URL
|
||||
Outfile = "$WorkingFolder\ReVanced\revanced-cli.jar"
|
||||
Outfile = "$CurrentFolder\ReVanced\revanced-cli.jar"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
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"
|
||||
Outfile = "$CurrentFolder\ReVanced\revanced-patches.rvp"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
Invoke-RestMethod @Parameters
|
||||
|
||||
# https://github.com/revanced/revanced-integrations
|
||||
Write-Verbose -Message "" -Verbose
|
||||
Write-Verbose -Message "Downloading ReVanced GmsCore" -Verbose
|
||||
# https://github.com/ReVanced/GmsCore
|
||||
$Parameters = @{
|
||||
Uri = "https://api.github.com/repos/revanced/revanced-integrations/releases/latest"
|
||||
Uri = "https://api.github.com/repos/ReVanced/GmsCore/releases/latest"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
$URL = (Invoke-RestMethod @Parameters).assets.browser_download_url
|
||||
$Parameters = @{
|
||||
Uri = $URL
|
||||
Outfile = "$WorkingFolder\ReVanced\revanced-integrations.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 = "$CurrentFolder\ReVanced\$($url.name)"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
Invoke-RestMethod @Parameters
|
||||
}
|
||||
Invoke-RestMethod @Parameters
|
||||
|
||||
# https://github.com/TeamVanced/VancedMicroG
|
||||
$Parameters = @{
|
||||
Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
$URL = (Invoke-RestMethod @Parameters).assets.browser_download_url
|
||||
$Parameters = @{
|
||||
Uri = $URL
|
||||
Outfile = "$WorkingFolder\ReVanced\microg.apk"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
Invoke-RestMethod @Parameters
|
||||
|
||||
# Sometimes older version of zulu-jdk causes conflict, so remove older version before proceeding.
|
||||
if (Test-Path -Path "$WorkingFolder\ReVanced\jdk") {
|
||||
Remove-Item -Path "$WorkingFolder\ReVanced\jdk" -Recurse -Force
|
||||
if (Test-Path -Path "$CurrentFolder\ReVanced\jdk")
|
||||
{
|
||||
Remove-Item -Path "$CurrentFolder\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"
|
||||
@@ -163,7 +188,7 @@ $Parameters = @{
|
||||
$URL = (Invoke-RestMethod @Parameters).architecture."64bit".url
|
||||
$Parameters = @{
|
||||
Uri = $URL
|
||||
Outfile = "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip"
|
||||
Outfile = "$CurrentFolder\ReVanced\jdk_windows-x64_bin.zip"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
@@ -171,33 +196,41 @@ Invoke-RestMethod @Parameters
|
||||
|
||||
# Expand jdk_windows-x64_bin archive
|
||||
$Parameters = @{
|
||||
Path = "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip"
|
||||
DestinationPath = "$WorkingFolder\ReVanced\jdk"
|
||||
Path = "$CurrentFolder\ReVanced\jdk_windows-x64_bin.zip"
|
||||
DestinationPath = "$CurrentFolder\ReVanced\jdk"
|
||||
Force = $true
|
||||
Verbose = $true
|
||||
}
|
||||
Expand-Archive @Parameters
|
||||
|
||||
Remove-Item -Path "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip" -Force
|
||||
Remove-Item -Path "$CurrentFolder\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-autorepeat" `
|
||||
--exclude "hide-captions-button" `
|
||||
--exclude "hide-timestamp" `
|
||||
--exclude "hide-seekbar" `
|
||||
& "$CurrentFolder\ReVanced\jdk\zulu*win_x64\bin\java.exe" `
|
||||
-jar "$CurrentFolder\ReVanced\revanced-cli.jar" patch `
|
||||
--patches "$CurrentFolder\ReVanced\revanced-patches.rvp" `
|
||||
--disable "Always repeat" `
|
||||
--disable "Disable auto captions" `
|
||||
--disable "Hide timestamp" `
|
||||
--disable "Hide seekbar" `
|
||||
--purge `
|
||||
--resource-cache "$WorkingFolder\ReVanced\Temp" `
|
||||
--out "$WorkingFolder\ReVanced\revanced.apk" `
|
||||
"$WorkingFolder\ReVanced\youtube.apk"
|
||||
--temporary-files-path "$CurrentFolder\ReVanced\Temp" `
|
||||
--out "$CurrentFolder\ReVanced\revanced.apk" `
|
||||
"$CurrentFolder\ReVanced\youtube.apk"
|
||||
|
||||
# Open working directory with builded files
|
||||
# Invoke-Item -Path "$WorkingFolder\ReVanced"
|
||||
# Invoke-Item -Path "$CurrentFolder\ReVanced"
|
||||
|
||||
# Remove temp directory, because cli failed to clean up directory
|
||||
# Remove-Item -Path "$WorkingFolder\ReVanced\Temp" -Recurse -Force -Confirm:$false
|
||||
# Remove-Item -Path "$CurrentFolder\ReVanced\Temp" -Recurse -Force -Confirm:$false
|
||||
|
||||
Write-Warning -Message "Latest available revanced.apk & microg.apk are ready in `"$WorkingFolder\ReVanced`""
|
||||
$Files = @(
|
||||
"$CurrentFolder\ReVanced\Temp",
|
||||
"$CurrentFolder\ReVanced\jdk",
|
||||
"$CurrentFolder\ReVanced\revanced-cli.jar",
|
||||
"$CurrentFolder\ReVanced\revanced-patches.rvp",
|
||||
"$CurrentFolder\ReVanced\youtube.apk"
|
||||
)
|
||||
Remove-Item -Path $Files -Recurse -Force
|
||||
|
||||
Write-Warning -Message "Latest available revanced.apk & microg.apk are ready in `"$CurrentFolder\ReVanced`""
|
||||
|
||||
11
README.md
11
README.md
@@ -9,12 +9,12 @@ Build ReVanced package (.apk) easily than ever using latest ReVanced patches and
|
||||
### Locally
|
||||
|
||||
* To build `revanced.apk` locally you need just to run [`Build.ps1`](https://github.com/JDM170/ReVanced_Builder/blob/main/Build.ps1) via PowerShell;
|
||||
* All [patches](https://github.com/revanced/revanced-patches) except the followings applied to `revanced.apk`:
|
||||
* All [patches](https://revanced.app/patches?pkg=com.google.android.youtube) except the followings applied to `revanced.apk`:
|
||||
* always-autorepeat
|
||||
* hide-captions-button
|
||||
* hide-timestamp
|
||||
* hide-seekbar
|
||||
* The script downloads latest available YouTube package (having parsed [JSON](https://github.com/revanced/revanced-patches/blob/main/patches.json)) supported by ReVanced Team from <https://apkmirror.com> and all dependencies and build package using [Zulu JDK](https://www.azul.com/downloads/?package=jdk);
|
||||
* The script downloads latest available YouTube package (having parsed [ReVanced API](https://api.revanced.app/v4/patches/list)) supported by ReVanced Team from [APKMirror](https://apkmirror.com) and all dependencies and build package using [Zulu JDK](https://www.azul.com/downloads/?package=jdk);
|
||||
* Script installs no apps — everything will be held in your `Script location folder\ReVanced`;
|
||||
* After compiling you get `revanced.apk` & `microg.apk` ready to be installed;
|
||||
* Release notes are generated dynamically using the [ReleaseNotesTemplate.md](https://github.com/JDM170/ReVanced_Builder/blob/main/ReleaseNotesTemplate.md) template.
|
||||
@@ -31,16 +31,15 @@ Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflo
|
||||
|
||||
* 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).
|
||||
* if you want to use PowerShell 7, you will have to install a 3rd party HTML parser ([AngleSharp](https://github.com/AngleSharp/AngleSharp))
|
||||
|
||||
## Links
|
||||
|
||||
* [APKPure](https://apkpure.net)
|
||||
* [APKMirror](https://apkmirror.com)
|
||||
* [ReVanced CLI](https://github.com/revanced/revanced-cli)
|
||||
* [ReVanced Patches](https://github.com/revanced/revanced-patches)
|
||||
* [ReVanced Integrations](https://github.com/revanced/revanced-integrations)
|
||||
* [Vanced MicroG](https://github.com/TeamVanced/VancedMicroG)
|
||||
* [ReVanced MicroG](https://github.com/ReVanced/GmsCore)
|
||||
* [AngleSharp](https://github.com/AngleSharp/AngleSharp)
|
||||
* [Zulu JDK](https://github.com/ScoopInstaller/Java)
|
||||
* [Sophia Telegram chat](https://t.me/sophia_chat)
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
* YouTube YouTubeTag;
|
||||
* ReVanced CLI CLITag;
|
||||
* ReVanced Patches PatchesTag;
|
||||
* ReVanced Integrations IntegrationsTag;
|
||||
* Vanced MicroG MicroGTag;
|
||||
* ReVanced MicroG MicroGTag;
|
||||
* Azul Zulu ZuluTag.
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
# https://github.com/TeamVanced/VancedMicroG
|
||||
# https://github.com/ReVanced/GmsCore
|
||||
$Parameters = @{
|
||||
Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest"
|
||||
Uri = "https://api.github.com/repos/ReVanced/GmsCore/releases/latest"
|
||||
UseBasicParsing = $true
|
||||
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
|
||||
|
||||
@@ -5,7 +5,7 @@ $Parameters = @{
|
||||
Verbose = $true
|
||||
}
|
||||
$apiResult = Invoke-RestMethod @Parameters
|
||||
$URL = $apiResult.assets.browser_download_url
|
||||
$URL = ($apiResult.assets | Where-Object -FilterScript {$_.content_type -eq "application/java-archive"}).browser_download_url
|
||||
$TAG = $apiResult.tag_name
|
||||
$Parameters = @{
|
||||
Uri = $URL
|
||||
|
||||
@@ -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.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
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,14 +1,31 @@
|
||||
# Get latest supported YouTube client version via ReVanced JSON
|
||||
# It will let us to download always latest YouTube apk supported by ReVanced team
|
||||
# https://github.com/revanced/revanced-patches/blob/main/patches.json
|
||||
# Get the latest supported YouTube version to patch
|
||||
# https://api.revanced.app/docs/swagger
|
||||
$Parameters = @{
|
||||
Uri = "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json"
|
||||
Uri = "https://api.revanced.app/v4/patches/list"
|
||||
UseBasicParsing = $true
|
||||
}
|
||||
$JSON = Invoke-RestMethod @Parameters
|
||||
$versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq "com.google.android.youtube"}).compatiblePackages.versions
|
||||
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
|
||||
$LatestSupportedYT = $LatestSupported.replace(".", "-")
|
||||
$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
|
||||
|
||||
# We need a NON-bundle version
|
||||
# https://apkpure.net/ru/youtube/com.google.android.youtube/versions
|
||||
<#
|
||||
$Parameters = @{
|
||||
Uri = "https://apkpure.net/youtube/com.google.android.youtube/download/$($LatestSupported)"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
$URL = (Invoke-Webrequest @Parameters).Links.href | Where-Object -FilterScript {$_ -match "APK/com.google.android.youtube"} | Select-Object -Index 1
|
||||
|
||||
$Parameters = @{
|
||||
Uri = $URL
|
||||
OutFile = "Temp\youtube.apk"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
Invoke-Webrequest @Parameters
|
||||
#>
|
||||
|
||||
$AngleSharpAssemblyPath = (Get-ChildItem -Path (Split-Path -Path (Get-Package -Name AngleSharp).Source) -Filter "*.dll" -Recurse | Where-Object -FilterScript {$_ -match "standard"} | Select-Object -Last 1).FullName
|
||||
Add-Type -Path $AngleSharpAssemblyPath
|
||||
@@ -18,7 +35,7 @@ $angleparser = New-Object -TypeName AngleSharp.Html.Parser.HtmlParser
|
||||
|
||||
# Trying to find correct APK link (not BUNDLE)
|
||||
# https://www.apkmirror.com/apk/google-inc/youtube/
|
||||
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/"
|
||||
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported.replace('.', '-'))-release/"
|
||||
$Parameters = @{
|
||||
Uri = $apkMirrorLink
|
||||
UseBasicParsing = $false # Disabled
|
||||
@@ -66,4 +83,4 @@ $Parameters = @{
|
||||
}
|
||||
Invoke-Webrequest @Parameters
|
||||
|
||||
echo "LatestSupportedYT=$LatestSupportedYT" >> $env:GITHUB_ENV
|
||||
echo "LatestSupportedYT=$LatestSupported" >> $env:GITHUB_ENV
|
||||
|
||||
Reference in New Issue
Block a user