mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
Compare commits
14 Commits
2023.08.28
...
2024.03.01
| Author | SHA1 | Date | |
|---|---|---|---|
|
119c8b0e2a
|
|||
|
75f3ea82c6
|
|||
|
63e95a3a63
|
|||
|
a61a5fbb8a
|
|||
|
f10c8abf4e
|
|||
|
8242b06085
|
|||
| bdca80cf21 | |||
| 271a6e13c6 | |||
|
7f15206c6d
|
|||
|
dab245fc0d
|
|||
|
aec3595c1f
|
|||
|
6d79dcd962
|
|||
|
c6fe465f1e
|
|||
|
7c399049ae
|
41
.github/workflows/Build.yml
vendored
41
.github/workflows/Build.yml
vendored
@@ -1,9 +1,6 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -13,37 +10,37 @@ 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
|
||||
- name: Download 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: Build
|
||||
run: |
|
||||
$JavaPath = (Resolve-Path -Path "Temp\jdk_windows-x64_bin\zulu*win_x64\bin\java.exe").Path
|
||||
|
||||
@@ -51,16 +48,17 @@ jobs:
|
||||
-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" `
|
||||
--exclude "Always repeat" `
|
||||
--exclude "Hide captions button" `
|
||||
--exclude "Hide timestamp" `
|
||||
--exclude "Hide seekbar" `
|
||||
--exclude "Swipe controls" `
|
||||
--purge `
|
||||
--resource-cache "Temp\Temp" `
|
||||
--out "Temp\revanced.apk" `
|
||||
"Temp\youtube.apk"
|
||||
# --resource-cache "Temp\Temp" `
|
||||
|
||||
- name: Creating archive
|
||||
- name: Create archive
|
||||
run: |
|
||||
Get-ChildItem Temp\Temp -Recurse -Force
|
||||
$Parameters = @{
|
||||
@@ -71,7 +69,7 @@ jobs:
|
||||
}
|
||||
Compress-Archive @Parameters
|
||||
|
||||
- name: Creating Release Notes
|
||||
- name: Create Release Notes
|
||||
id: read_release
|
||||
run: |
|
||||
# https://en.wikipedia.org/wiki/Percent-encoding
|
||||
@@ -81,10 +79,9 @@ jobs:
|
||||
$ReleaseName = Get-Date -f "yyyy.MM.dd"
|
||||
echo "RELEASE_NAME=$ReleaseName" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Uploading to Releases
|
||||
- name: Upload to Releases
|
||||
uses: softprops/action-gh-release@master
|
||||
with:
|
||||
tag_name: ${{ env.RELEASE_NAME }}
|
||||
token: ${{ github.token }}
|
||||
files: ReVanced.zip
|
||||
body_path: ${{ steps.read_release.outputs.ReleaseBody }}
|
||||
files: ReVanced.zip
|
||||
|
||||
46
Build.ps1
46
Build.ps1
@@ -41,30 +41,26 @@ $versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq
|
||||
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
|
||||
$LatestSupported = $LatestSupported.replace(".", "-")
|
||||
|
||||
# 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/"
|
||||
# Try to find correct NON-Bundle version
|
||||
$Parameters = @{
|
||||
Uri = $apkMirrorLink
|
||||
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/"
|
||||
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
|
||||
}
|
||||
}
|
||||
$URLParse = (Invoke-Webrequest @Parameters).Links.outerHTML | Where-Object -FilterScript {$_ -like "*YouTube $($LatestSupported.replace("-", ".")) (nodpi)*"}
|
||||
# Check if variable contains a data
|
||||
if ($URLParse)
|
||||
{
|
||||
$URL = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/"
|
||||
}
|
||||
else
|
||||
{
|
||||
$URL = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/"
|
||||
}
|
||||
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
|
||||
|
||||
# Get unique key to generate direct link
|
||||
$Parameters = @{
|
||||
Uri = $apkMirrorLink
|
||||
Uri = $URL
|
||||
UseBasicParsing = $false # Disabled
|
||||
Verbose = $true
|
||||
}
|
||||
@@ -72,7 +68,7 @@ $Request = Invoke-Webrequest @Parameters
|
||||
$nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp}
|
||||
|
||||
$Parameters = @{
|
||||
Uri = $apkMirrorLink + "/download/$($nameProp)"
|
||||
Uri = "$($URL)/download/$($nameProp)"
|
||||
UseBasicParsing = $false # Disabled
|
||||
Verbose = $true
|
||||
}
|
||||
@@ -134,9 +130,9 @@ $Parameters = @{
|
||||
}
|
||||
Invoke-RestMethod @Parameters
|
||||
|
||||
# https://github.com/TeamVanced/VancedMicroG
|
||||
# https://github.com/inotia00/VancedMicroG
|
||||
$Parameters = @{
|
||||
Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest"
|
||||
Uri = "https://api.github.com/repos/inotia00/VancedMicroG/releases/latest"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
@@ -150,7 +146,8 @@ $Parameters = @{
|
||||
Invoke-RestMethod @Parameters
|
||||
|
||||
# Sometimes older version of zulu-jdk causes conflict, so remove older version before proceeding.
|
||||
if (Test-Path -Path "$WorkingFolder\ReVanced\jdk") {
|
||||
if (Test-Path -Path "$WorkingFolder\ReVanced\jdk")
|
||||
{
|
||||
Remove-Item -Path "$WorkingFolder\ReVanced\jdk" -Recurse -Force
|
||||
}
|
||||
|
||||
@@ -185,10 +182,11 @@ Remove-Item -Path "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip" -Force
|
||||
-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" `
|
||||
--exclude "Always repeat" `
|
||||
--exclude "Hide captions button" `
|
||||
--exclude "Hide timestamp" `
|
||||
--exclude "Hide seekbar" `
|
||||
--exclude "Swipe controls" `
|
||||
--purge `
|
||||
--resource-cache "$WorkingFolder\ReVanced\Temp" `
|
||||
--out "$WorkingFolder\ReVanced\revanced.apk" `
|
||||
|
||||
21
README.md
21
README.md
@@ -11,10 +11,9 @@ Build ReVanced package (.apk) easily than ever using latest ReVanced patches and
|
||||
* 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`:
|
||||
* always-autorepeat
|
||||
* enable-wide-searchbar
|
||||
* disable-fullscreen-panels
|
||||
* premium-heading
|
||||
* tablet-mini-player
|
||||
* 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);
|
||||
* 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;
|
||||
@@ -22,11 +21,7 @@ Build ReVanced package (.apk) easily than ever using latest ReVanced patches and
|
||||
|
||||
### 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.
|
||||
|
||||

|
||||
|
||||
@@ -41,7 +36,11 @@ Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflo
|
||||
|
||||
## Links
|
||||
|
||||
* [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 Integrations](https://github.com/revanced/revanced-integrations)
|
||||
* [Vanced MicroG](https://github.com/TeamVanced/VancedMicroG)
|
||||
* [AngleSharp](https://github.com/AngleSharp/AngleSharp)
|
||||
* [Zulu JDK](https://github.com/ScoopInstaller/Java)
|
||||
* [Sophia Telegram chat](https://t.me/sophia_chat)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# https://github.com/TeamVanced/VancedMicroG
|
||||
# https://github.com/inotia00/VancedMicroG
|
||||
$Parameters = @{
|
||||
Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest"
|
||||
Uri = "https://api.github.com/repos/inotia00/VancedMicroG/releases/latest"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
|
||||
@@ -16,31 +16,26 @@ Add-Type -Path $AngleSharpAssemblyPath
|
||||
# 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)-release/"
|
||||
# Try to find correct NON-Bundle version
|
||||
$Parameters = @{
|
||||
Uri = $apkMirrorLink
|
||||
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-android-apk-download/"
|
||||
UseBasicParsing = $false # Disabled
|
||||
Verbose = $true
|
||||
}
|
||||
$Request = Invoke-Webrequest @Parameters
|
||||
$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
|
||||
}
|
||||
}
|
||||
$URLParse = (Invoke-Webrequest @Parameters).Links.outerHTML | Where-Object -FilterScript {$_ -like "*YouTube $($LatestSupported) (nodpi)*"}
|
||||
# Check if variable contains a data
|
||||
if ($URLParse)
|
||||
{
|
||||
$URL = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-android-apk-download/"
|
||||
}
|
||||
else
|
||||
{
|
||||
$URL = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-2-android-apk-download/"
|
||||
}
|
||||
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
|
||||
|
||||
# Get unique key to generate direct link
|
||||
$Parameters = @{
|
||||
Uri = $apkMirrorLink
|
||||
Uri = $URL
|
||||
UseBasicParsing = $false # Disabled
|
||||
Verbose = $true
|
||||
}
|
||||
@@ -49,7 +44,7 @@ $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 = $apkMirrorLink + "download/$($Key)"
|
||||
Uri = "$($URL)/download/$($Key)"
|
||||
UseBasicParsing = $true
|
||||
Verbose = $true
|
||||
}
|
||||
@@ -66,4 +61,4 @@ $Parameters = @{
|
||||
}
|
||||
Invoke-Webrequest @Parameters
|
||||
|
||||
echo "LatestSupportedYT=$LatestSupportedYT" >> $env:GITHUB_ENV
|
||||
echo "LatestSupportedYT=$LatestSupported" >> $env:GITHUB_ENV
|
||||
|
||||
Reference in New Issue
Block a user