21 Commits

Author SHA1 Message Date
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
6 changed files with 99 additions and 86 deletions

View File

@@ -1,9 +1,6 @@
name: Build name: Build
on: on:
push:
tags:
- "*"
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -13,55 +10,55 @@ jobs:
steps: steps:
- uses: actions/checkout@main - uses: actions/checkout@main
- name: Installing AngleSharp - name: Install AngleSharp
run: | run: |
Install-Package AngleSharp -Source https://www.nuget.org/api/v2 -SkipDependencies -Force Install-Package AngleSharp -Source https://www.nuget.org/api/v2 -SkipDependencies -Force
- name: Downloading YouTube - name: Download YouTube
run: | run: |
New-Item -Path Temp -ItemType Directory -Force New-Item -Path Temp -ItemType Directory -Force
. Scripts\YouTube.ps1 . Scripts\YouTube.ps1
- name: Downloading ReVanced CLI - name: Download ReVanced CLI
run: | run: |
. Scripts\ReVanced_CLI.ps1 . Scripts\ReVanced_CLI.ps1
- name: Downloading ReVanced Patches - name: Download ReVanced Patches
run: | run: |
. Scripts\ReVanced_Patches.ps1 . Scripts\ReVanced_Patches.ps1
- name: Downloading ReVanced Integrations - name: Download ReVanced Integrations
run: | run: |
. Scripts\ReVanced_Intergrations.ps1 . Scripts\ReVanced_Intergrations.ps1
- name: Downloading Vanced MicroG - name: Download Vanced MicroG
run: | run: |
. Scripts\MicroG.ps1 . Scripts\MicroG.ps1
- name: Downloading and expanding Zulu JDK - name: Download and expanding Zulu JDK
run: | run: |
. Scripts\Zulu_JDK.ps1 . Scripts\Zulu_JDK.ps1
- name: Building - name: Build
run: | run: |
$JavaPath = (Resolve-Path -Path "Temp\jdk_windows-x64_bin\zulu*win_x64\bin\java.exe").Path $JavaPath = (Resolve-Path -Path "Temp\jdk_windows-x64_bin\zulu*win_x64\bin\java.exe").Path
& $JavaPath ` & $JavaPath `
-jar "Temp\revanced-cli.jar" ` -jar "Temp\revanced-cli.jar" patch `
--apk "Temp\youtube.apk" ` --patch-bundle "Temp\revanced-patches.jar" `
--bundle "Temp\revanced-patches.jar" `
--merge "Temp\revanced-integrations.apk" ` --merge "Temp\revanced-integrations.apk" `
--exclude hide-time-and-seekbar ` --exclude "Always repeat" `
--exclude always-autorepeat ` --exclude "Hide captions button" `
--exclude hide-captions-button ` --exclude "Hide timestamp" `
--exclude disable-fullscreen-panels ` --exclude "Hide seekbar" `
--exclude old-quality-layout ` --exclude "Swipe controls" `
--clean ` --purge `
--temp-dir "Temp\Temp" ` --out "Temp\revanced.apk" `
--out "Temp\revanced.apk" "Temp\youtube.apk"
# --resource-cache "Temp\Temp" `
- name: Creating archive - name: Create archive
run: | run: |
Get-ChildItem Temp\Temp -Recurse -Force Get-ChildItem Temp\Temp -Recurse -Force
$Parameters = @{ $Parameters = @{
@@ -72,7 +69,7 @@ jobs:
} }
Compress-Archive @Parameters Compress-Archive @Parameters
- name: Creating Release Notes - name: Create Release Notes
id: read_release id: read_release
run: | run: |
# https://en.wikipedia.org/wiki/Percent-encoding # https://en.wikipedia.org/wiki/Percent-encoding
@@ -82,10 +79,9 @@ jobs:
$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: Uploading to Releases - name: Upload to Releases
uses: softprops/action-gh-release@master uses: softprops/action-gh-release@master
with: with:
tag_name: ${{ env.RELEASE_NAME }} tag_name: ${{ env.RELEASE_NAME }}
token: ${{ github.token }}
files: ReVanced.zip
body_path: ${{ steps.read_release.outputs.ReleaseBody }} body_path: ${{ steps.read_release.outputs.ReleaseBody }}
files: ReVanced.zip

View File

@@ -18,6 +18,10 @@
# Requires -Version 5.1 # 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 # 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'
# Download all files to "Script location folder\ReVanced" # Download all files to "Script location folder\ReVanced"
$WorkingFolder = Split-Path $MyInvocation.MyCommand.Path -Parent $WorkingFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
if (-not (Test-Path -Path "$WorkingFolder\ReVanced")) if (-not (Test-Path -Path "$WorkingFolder\ReVanced"))
@@ -37,32 +41,26 @@ $versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1 $LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
$LatestSupported = $LatestSupported.replace(".", "-") $LatestSupported = $LatestSupported.replace(".", "-")
# Get unique key to generate direct link # Try to find correct NON-Bundle version
# https://www.apkmirror.com/apk/google-inc/youtube/
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/"
$Parameters = @{ $Parameters = @{
Uri = $apkMirrorLink Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/"
UseBasicParsing = $false # Disabled UseBasicParsing = $false # Disabled
Verbose = $true Verbose = $true
} }
$Request = Invoke-Webrequest @Parameters $URLParse = (Invoke-Webrequest @Parameters).Links.outerHTML | Where-Object -FilterScript {$_ -like "*YouTube $($LatestSupported.replace("-", ".")) (nodpi)*"}
# Trying to find correct APK link (not BUNDLE) # Check if variable contains a data
$nameProp = $Request.ParsedHtml.getElementsByClassName("table-row headerFont") if ($URLParse)
foreach ($element in $nameProp)
{ {
foreach ($child in $element.children) $URL = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/"
{ }
if ($child.innerText -eq "nodpi") else
{ {
$apkPackageLink = ($element.getElementsByTagName("a") | Select-Object -First 1).nameProp $URL = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/"
break
}
}
} }
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
# Get unique key to generate direct link
$Parameters = @{ $Parameters = @{
Uri = $apkMirrorLink Uri = $URL
UseBasicParsing = $false # Disabled UseBasicParsing = $false # Disabled
Verbose = $true Verbose = $true
} }
@@ -70,7 +68,7 @@ $Request = Invoke-Webrequest @Parameters
$nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp} $nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp}
$Parameters = @{ $Parameters = @{
Uri = $apkMirrorLink + "/download/$($nameProp)" Uri = "$($URL)/download/$($nameProp)"
UseBasicParsing = $false # Disabled UseBasicParsing = $false # Disabled
Verbose = $true Verbose = $true
} }
@@ -132,9 +130,9 @@ $Parameters = @{
} }
Invoke-RestMethod @Parameters Invoke-RestMethod @Parameters
# https://github.com/TeamVanced/VancedMicroG # https://github.com/inotia00/VancedMicroG
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest" Uri = "https://api.github.com/repos/inotia00/VancedMicroG/releases/latest"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }
@@ -147,6 +145,12 @@ $Parameters = @{
} }
Invoke-RestMethod @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")
{
Remove-Item -Path "$WorkingFolder\ReVanced\jdk" -Recurse -Force
}
# 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"
@@ -173,20 +177,20 @@ Expand-Archive @Parameters
Remove-Item -Path "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip" -Force Remove-Item -Path "$WorkingFolder\ReVanced\jdk_windows-x64_bin.zip" -Force
# https://github.com/revanced/revanced-patches # 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" ` -jar "$WorkingFolder\ReVanced\revanced-cli.jar" patch `
--apk "$WorkingFolder\ReVanced\youtube.apk" ` --patch-bundle "$WorkingFolder\ReVanced\revanced-patches.jar" `
--bundle "$WorkingFolder\ReVanced\revanced-patches.jar" `
--merge "$WorkingFolder\ReVanced\revanced-integrations.apk" ` --merge "$WorkingFolder\ReVanced\revanced-integrations.apk" `
--exclude hide-time-and-seekbar ` --exclude "Always repeat" `
--exclude always-autorepeat ` --exclude "Hide captions button" `
--exclude hide-captions-button ` --exclude "Hide timestamp" `
--exclude disable-fullscreen-panels ` --exclude "Hide seekbar" `
--exclude old-quality-layout ` --exclude "Swipe controls" `
--clean ` --purge `
--temp-dir "$WorkingFolder\ReVanced\Temp" ` --resource-cache "$WorkingFolder\ReVanced\Temp" `
--out "$WorkingFolder\ReVanced\revanced.apk" --out "$WorkingFolder\ReVanced\revanced.apk" `
"$WorkingFolder\ReVanced\youtube.apk"
# Open working directory with builded files # Open working directory with builded files
# Invoke-Item -Path "$WorkingFolder\ReVanced" # Invoke-Item -Path "$WorkingFolder\ReVanced"

View File

@@ -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; * 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://github.com/revanced/revanced-patches) except the followings applied to `revanced.apk`:
* always-autorepeat * always-autorepeat
* enable-wide-searchbar * hide-captions-button
* disable-fullscreen-panels * hide-timestamp
* premium-heading * hide-seekbar
* 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); * 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`; * 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;
@@ -22,11 +21,7 @@ Build ReVanced package (.apk) easily than ever using latest ReVanced patches and
### By using CI/CD ### By using CI/CD
```powershell 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.
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.
![image](https://user-images.githubusercontent.com/10544660/187949763-82fd7a07-8e4e-4527-b631-11920077141f.png) ![image](https://user-images.githubusercontent.com/10544660/187949763-82fd7a07-8e4e-4527-b631-11920077141f.png)
@@ -41,7 +36,11 @@ Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflo
## Links ## Links
* [APKMirror](https://apkmirror.com)
* [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 Manager](https://github.com/revanced/revanced-manager) * [ReVanced Integrations](https://github.com/revanced/revanced-integrations)
* [Telegram](https://t.me/sophia_chat) * [Vanced MicroG](https://github.com/TeamVanced/VancedMicroG)
* [AngleSharp](https://github.com/AngleSharp/AngleSharp) * [AngleSharp](https://github.com/AngleSharp/AngleSharp)
* [Zulu JDK](https://github.com/ScoopInstaller/Java)
* [Sophia Telegram chat](https://t.me/sophia_chat)

View File

@@ -1,6 +1,6 @@
# https://github.com/TeamVanced/VancedMicroG # https://github.com/inotia00/VancedMicroG
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest" Uri = "https://api.github.com/repos/inotia00/VancedMicroG/releases/latest"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }

View File

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

View File

@@ -13,26 +13,43 @@ $LatestSupportedYT = $LatestSupported.replace(".", "-")
$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 $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 Add-Type -Path $AngleSharpAssemblyPath
# Get unique key to generate direct link # Create parser object
# https://www.apkmirror.com/apk/google-inc/youtube/ $angleparser = New-Object -TypeName AngleSharp.Html.Parser.HtmlParser
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/"
# $apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/" # Try to find correct NON-Bundle version
$Parameters = @{ $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
}
$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/"
}
# Get unique key to generate direct link
$Parameters = @{
Uri = $URL
UseBasicParsing = $false # Disabled UseBasicParsing = $false # Disabled
Verbose = $true Verbose = $true
} }
$Request = Invoke-Webrequest @Parameters $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 {$_.ClassName -match "accent_bg btn btn-flat downloadButton"} | ForEach-Object -Process {$_.Search} $Key = $Parsed.All | Where-Object -FilterScript {$_.ClassName -match "accent_bg btn btn-flat downloadButton"} | ForEach-Object -Process {$_.Search}
$Parameters = @{ $Parameters = @{
Uri = $apkMirrorLink + "download/$($Key)" Uri = "$($URL)/download/$($Key)"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }
$Request = Invoke-Webrequest @Parameters $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 $Key = ($Parsed.All | Where-Object -FilterScript { $_.InnerHtml -eq "here" }).Search
# Finally, get the real link # Finally, get the real link
@@ -44,4 +61,4 @@ $Parameters = @{
} }
Invoke-Webrequest @Parameters Invoke-Webrequest @Parameters
echo "LatestSupportedYT=$LatestSupportedYT" >> $env:GITHUB_ENV echo "LatestSupportedYT=$LatestSupported" >> $env:GITHUB_ENV