6 Commits

Author SHA1 Message Date
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
7 changed files with 47 additions and 68 deletions

View File

@@ -28,10 +28,6 @@ jobs:
run: | run: |
. Scripts\ReVanced_Patches.ps1 . Scripts\ReVanced_Patches.ps1
- name: Download ReVanced Integrations
run: |
. Scripts\ReVanced_Intergrations.ps1
- name: Download Vanced MicroG - name: Download Vanced MicroG
run: | run: |
. Scripts\MicroG.ps1 . Scripts\MicroG.ps1
@@ -46,12 +42,11 @@ jobs:
& $JavaPath ` & $JavaPath `
-jar "Temp\revanced-cli.jar" patch ` -jar "Temp\revanced-cli.jar" patch `
--patch-bundle "Temp\revanced-patches.jar" ` --patches "Temp\revanced-patches.rvp" `
--merge "Temp\revanced-integrations.apk" ` --disable "Always repeat" `
--exclude "Always repeat" ` --disable "Disable auto captions" `
--exclude "Hide captions button" ` --disable "Hide timestamp" `
--exclude "Hide timestamp" ` --disable "Hide seekbar" `
--exclude "Hide seekbar" `
--purge ` --purge `
--out "Temp\revanced.apk" ` --out "Temp\revanced.apk" `
"Temp\youtube.apk" "Temp\youtube.apk"
@@ -71,14 +66,14 @@ jobs:
id: read_release id: read_release
run: | run: |
# https://en.wikipedia.org/wiki/Percent-encoding # 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/ # https://trstringer.com/github-actions-multiline-strings/
Add-Content -Path $env:GITHUB_OUTPUT -Value "ReleaseBody=ReleaseNotesTemplate.md" Add-Content -Path $env:GITHUB_OUTPUT -Value "ReleaseBody=ReleaseNotesTemplate.md"
$ReleaseName = Get-Date -f "yyyy.MM.dd" $ReleaseName = Get-Date -f "yyyy.MM.dd"
echo "RELEASE_NAME=$ReleaseName" >> $env:GITHUB_ENV echo "RELEASE_NAME=$ReleaseName" >> $env:GITHUB_ENV
- name: Upload to Releases - name: Upload to Releases
uses: softprops/action-gh-release@master uses: softprops/action-gh-release@v2.2.1
with: with:
tag_name: ${{ env.RELEASE_NAME }} tag_name: ${{ env.RELEASE_NAME }}
body_path: ${{ steps.read_release.outputs.ReleaseBody }} body_path: ${{ steps.read_release.outputs.ReleaseBody }}

View File

@@ -35,14 +35,16 @@ if (-not (Test-Path -Path "$WorkingFolder\ReVanced"))
} }
# Get the latest supported YouTube version to patch # Get the latest supported YouTube version to patch
# https://api.revanced.app/docs/swagger # https://api.revanced.app
$Parameters = @{ $Parameters = @{
Uri = "https://api.revanced.app/v2/patches/latest" Uri = "https://api.revanced.app/v4/patches/list"
UseBasicParsing = $true UseBasicParsing = $true
} }
$JSON = (Invoke-RestMethod @Parameters).patches $JSON = (Invoke-Webrequest @Parameters).Content | ConvertFrom-Json
$versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq "com.google.android.youtube"}).compatiblePackages.versions $versions = ($JSON | Where-Object -FilterScript {$_.name -eq "Video ads"})
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1 $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 # We need a NON-bundle version
<# <#
@@ -110,6 +112,8 @@ $Parameters = @{
} }
Invoke-Webrequest @Parameters Invoke-Webrequest @Parameters
Write-Verbose -Message "" -Verbose
Write-Verbose -Message "Downloading ReVanced CLI" -Verbose
# https://github.com/revanced/revanced-cli # https://github.com/revanced/revanced-cli
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/revanced/revanced-cli/releases/latest" Uri = "https://api.github.com/repos/revanced/revanced-cli/releases/latest"
@@ -125,36 +129,25 @@ $Parameters = @{
} }
Invoke-RestMethod @Parameters Invoke-RestMethod @Parameters
Write-Verbose -Message "" -Verbose
Write-Verbose -Message "Downloading ReVanced patches" -Verbose
# https://github.com/revanced/revanced-patches # https://github.com/revanced/revanced-patches
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest" Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $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 = @{ $Parameters = @{
Uri = $URL Uri = $URL
Outfile = "$WorkingFolder\ReVanced\revanced-patches.jar" Outfile = "$WorkingFolder\ReVanced\revanced-patches.rvp"
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"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }
Invoke-RestMethod @Parameters Invoke-RestMethod @Parameters
Write-Verbose -Message "" -Verbose
Write-Verbose -Message "Downloading ReVanced GmsCore" -Verbose
# https://github.com/ReVanced/GmsCore # https://github.com/ReVanced/GmsCore
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/ReVanced/GmsCore/releases/latest" 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 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 # https://github.com/ScoopInstaller/Java/blob/master/bucket/zulu-jdk.json
$Parameters = @{ $Parameters = @{
Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json" 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 # Let's create patched APK
& "$WorkingFolder\ReVanced\jdk\zulu*win_x64\bin\java.exe" ` & "$WorkingFolder\ReVanced\jdk\zulu*win_x64\bin\java.exe" `
-jar "$WorkingFolder\ReVanced\revanced-cli.jar" patch ` -jar "$WorkingFolder\ReVanced\revanced-cli.jar" patch `
--patch-bundle "$WorkingFolder\ReVanced\revanced-patches.jar" ` --patches "$WorkingFolder\ReVanced\revanced-patches.rvp" `
--merge "$WorkingFolder\ReVanced\revanced-integrations.apk" ` --disable "Always repeat" `
--exclude "Always repeat" ` --disable "Disable auto captions" `
--exclude "Hide captions button" ` --disable "Hide timestamp" `
--exclude "Hide timestamp" ` --disable "Hide seekbar" `
--exclude "Hide seekbar" `
--purge ` --purge `
--temporary-files-path "$WorkingFolder\ReVanced\Temp" ` --temporary-files-path "$WorkingFolder\ReVanced\Temp" `
--out "$WorkingFolder\ReVanced\revanced.apk" ` --out "$WorkingFolder\ReVanced\revanced.apk" `
@@ -229,4 +223,13 @@ Remove-Item -Path "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip" -Force
# Remove temp directory, because cli failed to clean up directory # Remove temp directory, because cli failed to clean up directory
# Remove-Item -Path "$WorkingFolder\ReVanced\Temp" -Recurse -Force -Confirm:$false # Remove-Item -Path "$WorkingFolder\ReVanced\Temp" -Recurse -Force -Confirm:$false
$Files = @(
"$WorkingFolder\ReVanced\Temp",
"$WorkingFolder\ReVanced\jdk",
"$WorkingFolder\ReVanced\revanced-cli.jar",
"$WorkingFolder\ReVanced\revanced-patches.rvp",
"$WorkingFolder\ReVanced\youtube.apk"
)
Remove-Item -Path $Files -Recurse -Force
Write-Warning -Message "Latest available revanced.apk & microg.apk are ready in `"$WorkingFolder\ReVanced`"" Write-Warning -Message "Latest available revanced.apk & microg.apk are ready in `"$WorkingFolder\ReVanced`""

View File

@@ -14,7 +14,7 @@ Build ReVanced package (.apk) easily than ever using latest ReVanced patches and
* hide-captions-button * hide-captions-button
* hide-timestamp * hide-timestamp
* hide-seekbar * hide-seekbar
* The script downloads latest available YouTube package (having parsed [ReVanced API](https://api.revanced.app/v2/patches/latest)) 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); * 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`; * 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; * 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. * Release notes are generated dynamically using the [ReleaseNotesTemplate.md](https://github.com/JDM170/ReVanced_Builder/blob/main/ReleaseNotesTemplate.md) template.
@@ -30,7 +30,8 @@ Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflo
## Requirements if you compile locally ## Requirements if you compile locally
* Windows 10 x64 or Windows 11 * Windows 10 x64 or Windows 11
* Windows PowerShell 5.1/7 * Windows PowerShell 5.1
* if you want to use PowerShell 7, you will have to install a 3rd party HTML parser ([AngleSharp](https://github.com/AngleSharp/AngleSharp))
## Links ## Links
@@ -38,7 +39,6 @@ Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflo
* [APKMirror](https://apkmirror.com) * [APKMirror](https://apkmirror.com)
* [ReVanced CLI](https://github.com/revanced/revanced-cli) * [ReVanced CLI](https://github.com/revanced/revanced-cli)
* [ReVanced Patches](https://github.com/revanced/revanced-patches) * [ReVanced Patches](https://github.com/revanced/revanced-patches)
* [ReVanced Integrations](https://github.com/revanced/revanced-integrations)
* [ReVanced MicroG](https://github.com/ReVanced/GmsCore) * [ReVanced MicroG](https://github.com/ReVanced/GmsCore)
* [AngleSharp](https://github.com/AngleSharp/AngleSharp) * [AngleSharp](https://github.com/AngleSharp/AngleSharp)
* [Zulu JDK](https://github.com/ScoopInstaller/Java) * [Zulu JDK](https://github.com/ScoopInstaller/Java)

View File

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

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

View File

@@ -5,11 +5,11 @@ $Parameters = @{
Verbose = $true Verbose = $true
} }
$apiResult = Invoke-RestMethod @Parameters $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 $TAG = $apiResult.tag_name
$Parameters = @{ $Parameters = @{
Uri = $URL Uri = $URL
Outfile = "Temp\revanced-patches.jar" Outfile = "Temp\revanced-patches.rvp"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }

View File

@@ -1,12 +1,12 @@
# Get the latest supported YouTube version to patch # Get the latest supported YouTube version to patch
# https://api.revanced.app/docs/swagger # https://api.revanced.app/docs/swagger
$Parameters = @{ $Parameters = @{
Uri = "https://api.revanced.app/v2/patches/latest" Uri = "https://api.revanced.app/v4/patches/list"
UseBasicParsing = $true UseBasicParsing = $true
} }
$JSON = (Invoke-RestMethod @Parameters).patches $JSON = (Invoke-Webrequest @Parameters).Content | ConvertFrom-Json
$versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq "com.google.android.youtube"}).compatiblePackages.versions $versions = ($JSON | Where-Object -FilterScript {$_.name -eq "Video ads"})
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1 $LatestSupported = $versions.compatiblePackages.'com.google.android.youtube' | Sort-Object -Descending -Unique | Select-Object -First 1
# We need a NON-bundle version # We need a NON-bundle version
# https://apkpure.net/ru/youtube/com.google.android.youtube/versions # https://apkpure.net/ru/youtube/com.google.android.youtube/versions