51 Commits

Author SHA1 Message Date
33f148cbe6 Update workflow (added if condition for key storage addition step) 2025-11-06 19:25:03 +07:00
cbc170c0ec New workflow step: Add keystore from secrets
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2025-11-01 23:44:49 +07:00
4c356736b0 Update Build.yml
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2025-10-01 19:53:12 +07:00
ca508c0e24 Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2025-05-18 23:24:24 +07:00
b879ad95f3 Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2025-01-28 21:32:16 +07:00
3edfdcc627 Update Build.yml
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2025-01-28 21:32:03 +07:00
d2ab1f83d7 Update README.md 2025-01-01 18:10:04 +07:00
689cf90f6a Update Build.yml 2025-01-01 16:38:54 +07:00
9c38444051 Update YouTube.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-12-01 18:29:38 +07:00
65dc96ac52 Update files
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-12-01 18:23:09 +07:00
4905811659 Update README.md
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-08-26 14:15:38 +07:00
4758eb22cf Replace '.' with '-' in youtube link
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-08-26 14:14:56 +07:00
c3c0a74bfe Move YouTube downloading to APKMirror
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-08-01 14:48:46 +07:00
2aa6170830 Update: microg downloading; workflow; readme.md
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-05-01 12:23:22 +07:00
db4d8ea6a3 Update README.md, ReleaseNotesTemplate.md
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-31 12:43:25 +07:00
c51bb19b8d Update workflow
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-31 12:42:55 +07:00
096c05b8cf Update workflow scripts
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-31 12:42:43 +07:00
82cfc6d1f6 Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-31 12:42:25 +07:00
c4e701fc83 Update workflow
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-10 21:22:11 +07:00
5c614ab6cd Fix indents
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-10 21:20:13 +07:00
83310266b7 Update Actions Scripts
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-10 21:13:28 +07:00
3381005bb2 Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-10 21:07:28 +07:00
f26e8938d4 Revert "Update Build.yml"
This reverts commit 119c8b0e2a.
2024-03-03 19:43:50 +07:00
a9787a19a4 Revert "Update Build.ps1"
This reverts commit 75f3ea82c6.
2024-03-03 19:43:32 +07:00
119c8b0e2a Update Build.yml
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-01 08:39:58 +07:00
75f3ea82c6 Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2024-03-01 08:39:44 +07:00
63e95a3a63 Update Build.yml 2024-02-02 19:28:33 +07:00
a61a5fbb8a Update MicroG.ps1 2024-02-02 19:28:12 +07:00
f10c8abf4e Update Build.ps1 2024-02-02 19:27:48 +07:00
8242b06085 Revert "Update YouTube.ps1"
This reverts commit bdca80cf21.
2024-01-02 14:17:04 +07:00
bdca80cf21 Update YouTube.ps1 2024-01-02 01:16:22 +07:00
271a6e13c6 Update YouTube.ps1 2024-01-02 01:11:11 +07:00
7f15206c6d Fix indents
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-12-01 21:08:39 +07:00
dab245fc0d Update Build.yml
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-12-01 13:03:21 +07:00
aec3595c1f Update YouTube.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-12-01 12:58:17 +07:00
6d79dcd962 Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-12-01 12:57:50 +07:00
c6fe465f1e Update README.md
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-08-28 13:21:14 +07:00
7c399049ae Change step names in CI
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-08-28 13:21:00 +07:00
cfce0e86f7 Fix interacting with latest revanced-cli
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-08-28 13:06:13 +07:00
faf94e4e29 Update ReVanced_Patches.ps1 2023-07-17 04:20:38 +07:00
ad506f52ce Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-14 14:07:15 +07:00
a110a4b243 Update Scripts/YouTube.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-11 22:19:36 +07:00
71d741090a Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-11 22:19:31 +07:00
5acbf45673 Update Scripts/YouTube.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-11 22:11:05 +07:00
0429d83c29 Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-11 22:10:05 +07:00
52588a3dd5 Restore file from previous commits and fix link
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-09 22:45:32 +07:00
c60238c508 fix youtube downloading from actions 2
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-09 22:41:45 +07:00
02582d4598 fix youtube downloading from actions
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-09 22:39:05 +07:00
6898697b69 implemented finding actual APK link (not BUNDLE)
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-07-09 22:29:17 +07:00
79ceecf058 Fix YouTube download link
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
2023-06-11 21:00:06 +07:00
ab77af47b0 Update Build.yml 2023-03-28 15:33:24 +07:00
9 changed files with 248 additions and 169 deletions

View File

@@ -1,9 +1,8 @@
name: Build
on:
push:
tags:
- "*"
on:
schedule:
- cron: "30 3 1 * *"
workflow_dispatch:
jobs:
@@ -13,84 +12,80 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Installing AngleSharp
- name: Install AngleSharp
run: |
Install-Package AngleSharp -Source https://www.nuget.org/api/v2 -SkipDependencies -Force
- name: Downloading YouTube
- name: Download YouTube
run: |
New-Item -Path Temp -ItemType Directory -Force
. Scripts\YouTube.ps1
- name: Downloading ReVanced CLI
- name: Download ReVanced CLI
run: |
. Scripts\ReVanced_CLI.ps1
- name: Downloading ReVanced Patches
- name: Download ReVanced Patches
run: |
. Scripts\ReVanced_Patches.ps1
- name: Downloading ReVanced Integrations
run: |
. Scripts\ReVanced_Intergrations.ps1
- name: Downloading Vanced MicroG
- name: Download Vanced MicroG
run: |
. Scripts\MicroG.ps1
- name: Downloading and expanding Zulu JDK
- name: Download and expanding Zulu JDK
run: |
. Scripts\Zulu_JDK.ps1
- name: Building
- name: Add keystore from secrets
env:
KEYSTORE: ${{ secrets.REVANCED_KEYSTORE }}
if: ${{ env.KEYSTORE != '' }}
run: |
[byte[]]$bytes = [convert]::FromBase64String('${{ env.KEYSTORE }}')
[System.IO.File]::WriteAllBytes("Temp\revanced.keystore", $bytes)
- name: Build
run: |
$JavaPath = (Resolve-Path -Path "Temp\jdk_windows-x64_bin\zulu*win_x64\bin\java.exe").Path
& $JavaPath `
-jar "Temp\revanced-cli.jar" `
--apk "Temp\youtube.apk" `
--bundle "Temp\revanced-patches.jar" `
--merge "Temp\revanced-integrations.apk" `
--exclude hide-time-and-seekbar `
--exclude always-autorepeat `
--exclude hide-captions-button `
--exclude disable-fullscreen-panels `
--exclude old-quality-layout `
--clean `
--temp-dir "Temp\Temp" `
--out "Temp\revanced.apk"
-jar "Temp\revanced-cli.jar" patch `
--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"
- name: Creating archive
- name: Create archive
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
}
Compress-Archive @Parameters
- name: Creating Release Notes
- name: Create Release Notes
id: read_release
run: |
# https://en.wikipedia.org/wiki/Percent-encoding
$Release = (Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw).replace("`n", "%0A").replace("`r", "%0D").replace("YouTubeTag", "${{ env.LatestSupportedYT }}").replace("CLITag", "${{ env.CLIvtag }}").replace("PatchesTag", "${{ env.Patchesvtag }}").replace("IntegrationsTag", "${{ env.IntegrationsTag }}").replace("MicroGTag", "${{ env.MicroGTag }}").replace("ZuluTag", "${{ env.ZuluTag }}")
(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/
echo "::set-output name=RELEASE_BODY::$Release"
# echo "RELEASE_BODY=$Release" >> $GITHUB_OUTPUT
# echo "RELEASE_BODY=$Release" >> $env:GITHUB_ENV
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: Uploading to Releases
uses: softprops/action-gh-release@master
- name: Upload to Releases
uses: softprops/action-gh-release@v2.2.1
with:
tag_name: ${{ env.RELEASE_NAME }}
token: ${{ github.token }}
body_path: ${{ steps.read_release.outputs.ReleaseBody }}
files: ReVanced.zip
body: ${{ steps.read_release.outputs.RELEASE_BODY }}
# body: ${{ env.RELEASE_BODY }}

189
Build.ps1
View File

@@ -5,7 +5,7 @@
* ReVanced CLI;
* ReVanced Patches;
* ReVanced Integrations;
* microG GmsCore;
* ReVanced microG GmsCore;
* Azul Zulu.
.NOTES
@@ -18,29 +18,77 @@
# 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
# Download all files to "Script location folder\ReVanced"
$WorkingFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
if (-not (Test-Path -Path "$WorkingFolder\ReVanced"))
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if ($Host.Version.Major -eq 5)
{
New-Item -Path "$WorkingFolder\ReVanced" -ItemType Directory -Force
# Progress bar can significantly impact cmdlet performance
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
}
# 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
# Download all files to "Script location folder\ReVanced"
$CurrentFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
if (-not (Test-Path -Path "$CurrentFolder\ReVanced"))
{
New-Item -Path "$CurrentFolder\ReVanced" -ItemType Directory -Force
}
# 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
#>
# https://www.apkmirror.com/apk/google-inc/youtube/
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported.replace('.', '-'))-release/"
$Parameters = @{
Uri = $apkMirrorLink
UseBasicParsing = $false # Disabled
Verbose = $true
}
$Request = Invoke-Webrequest @Parameters
$Request.ParsedHtml.getElementsByClassName("table-row headerFont") | ForEach-Object -Process {
foreach ($child in $_.children)
{
if ($child.innerText -eq "nodpi")
{
$apkPackageLink = ($_.getElementsByTagName("a") | Select-Object -First 1).nameProp
break
}
}
}
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
# Get unique key to generate direct link
# https://www.apkmirror.com/apk/google-inc/youtube/
$Parameters = @{
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/"
Uri = $apkMirrorLink
UseBasicParsing = $false # Disabled
Verbose = $true
}
@@ -48,7 +96,7 @@ $Request = Invoke-Webrequest @Parameters
$nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp}
$Parameters = @{
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/download/$($nameProp)"
Uri = $apkMirrorLink + "/download/$($nameProp)"
UseBasicParsing = $false # Disabled
Verbose = $true
}
@@ -59,72 +107,78 @@ $URL_Part = $URL_Part.Replace("&amp;", "&")
# 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
# Sometimes older version of zulu-jdk causes conflict, so remove older version before proceeding.
if (Test-Path -Path "$CurrentFolder\ReVanced\jdk")
{
Remove-Item -Path "$CurrentFolder\ReVanced\jdk" -Recurse -Force
}
$URL = (Invoke-RestMethod @Parameters).assets.browser_download_url
$Parameters = @{
Uri = $URL
Outfile = "$WorkingFolder\ReVanced\microg.apk"
UseBasicParsing = $true
Verbose = $true
}
Invoke-RestMethod @Parameters
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"
@@ -134,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
}
@@ -142,34 +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
# https://github.com/revanced/revanced-patches
& "$WorkingFolder\ReVanced\jdk\zulu*win_x64\bin\java.exe" `
-jar "$WorkingFolder\ReVanced\revanced-cli.jar" `
--apk "$WorkingFolder\ReVanced\youtube.apk" `
--bundle "$WorkingFolder\ReVanced\revanced-patches.jar" `
--merge "$WorkingFolder\ReVanced\revanced-integrations.apk" `
--exclude hide-time-and-seekbar `
--exclude always-autorepeat `
--exclude hide-captions-button `
--exclude disable-fullscreen-panels `
--exclude old-quality-layout `
--clean `
--temp-dir "$WorkingFolder\ReVanced\Temp" `
--out "$WorkingFolder\ReVanced\revanced.apk"
# Let's create patched APK
& "$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 `
--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`""

View File

@@ -9,24 +9,19 @@ 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
* enable-wide-searchbar
* disable-fullscreen-panels
* premium-heading
* tablet-mini-player
* 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);
* hide-captions-button
* hide-timestamp
* hide-seekbar
* 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.
### By using CI/CD
```powershell
git clone https://github.com/JDM170/ReVanced_Builder
```
Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflows/Build.yml) Action manually to create [release page](https://github.com/JDM170/ReVanced_Builder/releases/latest) with configured release notes showing dependencies used for building.
Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflows/Build.yml) action manually to create [release page](https://github.com/JDM170/ReVanced_Builder/releases/latest) with configured release notes showing dependencies used for building.
![image](https://user-images.githubusercontent.com/10544660/187949763-82fd7a07-8e4e-4527-b631-11920077141f.png)
@@ -36,12 +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 Manager](https://github.com/revanced/revanced-manager)
* [Telegram](https://t.me/sophia_chat)
* [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)

View File

@@ -3,6 +3,5 @@
* YouTube YouTubeTag;
* ReVanced CLI CLITag;
* ReVanced Patches PatchesTag;
* ReVanced Integrations IntegrationsTag;
* Vanced MicroG MicroGTag;
* ReVanced MicroG MicroGTag;
* Azul Zulu ZuluTag.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -4,15 +4,12 @@ $Parameters = @{
UseBasicParsing = $true
Verbose = $true
}
# $Patchesvtag = (Invoke-RestMethod @Parameters).tag_name
# $Patchestag = $Patchesvtag.replace("v", "")
$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 = "https://github.com/revanced/revanced-patches/releases/download/$Patchesvtag/revanced-patches-$Patchestag.jar"
Uri = $URL
Outfile = "Temp\revanced-patches.jar"
Outfile = "Temp\revanced-patches.rvp"
UseBasicParsing = $true
Verbose = $true
}

View File

@@ -1,36 +1,77 @@
# 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
# Get unique key to generate direct link
# Create parser object
$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.replace('.', '-'))-release/"
$Parameters = @{
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-2-android-apk-download/"
Uri = $apkMirrorLink
UseBasicParsing = $false # Disabled
Verbose = $true
}
$Request = Invoke-Webrequest @Parameters
$Parsed = (New-Object -TypeName AngleSharp.Html.Parser.HtmlParser).ParseDocument($Request.Content)
$Parsed = $angleparser.ParseDocument($Request.Content)
$Parsed.All | Where-Object -FilterScript {$_.ClassName -match "table-row headerFont"} | ForEach-Object -Process {
foreach($child in $_.children)
{
if ($child.InnerHtml -eq "nodpi")
{
$apkPackageLink = (($_.getElementsByTagName("a") | Select-Object -First 1).Href).Substring(57)
break
}
}
}
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
# Get unique key to generate direct link
$Parameters = @{
Uri = $apkMirrorLink
UseBasicParsing = $false # Disabled
Verbose = $true
}
$Request = Invoke-Webrequest @Parameters
$Parsed = $angleparser.ParseDocument($Request.Content)
$Key = $Parsed.All | Where-Object -FilterScript {$_.ClassName -match "accent_bg btn btn-flat downloadButton"} | ForEach-Object -Process {$_.Search}
$Parameters = @{
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-2-android-apk-download/download/$($Key)"
Uri = $apkMirrorLink + "download/$($Key)"
UseBasicParsing = $true
Verbose = $true
}
$Request = Invoke-Webrequest @Parameters
$Parsed = (New-Object -TypeName AngleSharp.Html.Parser.HtmlParser).ParseDocument($Request.Content)
$Parsed = $angleparser.ParseDocument($Request.Content)
$Key = ($Parsed.All | Where-Object -FilterScript { $_.InnerHtml -eq "here" }).Search
# Finally, get the real link
@@ -42,4 +83,4 @@ $Parameters = @{
}
Invoke-Webrequest @Parameters
echo "LatestSupportedYT=$LatestSupportedYT" >> $env:GITHUB_ENV
echo "LatestSupportedYT=$LatestSupported" >> $env:GITHUB_ENV