mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
Compare commits
3 Commits
2024.07.01
...
2024.11.01
| Author | SHA1 | Date | |
|---|---|---|---|
|
4905811659
|
|||
|
4758eb22cf
|
|||
|
c3c0a74bfe
|
4
.github/workflows/Build.yml
vendored
4
.github/workflows/Build.yml
vendored
@@ -10,6 +10,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
|
|
||||||
|
- name: Install AngleSharp
|
||||||
|
run: |
|
||||||
|
Install-Package AngleSharp -Source https://www.nuget.org/api/v2 -SkipDependencies -Force
|
||||||
|
|
||||||
- name: Download YouTube
|
- name: Download YouTube
|
||||||
run: |
|
run: |
|
||||||
New-Item -Path Temp -ItemType Directory -Force
|
New-Item -Path Temp -ItemType Directory -Force
|
||||||
|
|||||||
49
Build.ps1
49
Build.ps1
@@ -45,6 +45,7 @@ $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
|
||||||
|
|
||||||
# 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
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = "https://apkpure.net/youtube/com.google.android.youtube/download/$($LatestSupported)"
|
Uri = "https://apkpure.net/youtube/com.google.android.youtube/download/$($LatestSupported)"
|
||||||
@@ -60,6 +61,54 @@ $Parameters = @{
|
|||||||
Verbose = $true
|
Verbose = $true
|
||||||
}
|
}
|
||||||
Invoke-Webrequest @Parameters
|
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
|
||||||
|
$Parameters = @{
|
||||||
|
Uri = $apkMirrorLink
|
||||||
|
UseBasicParsing = $false # Disabled
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
$Request = Invoke-Webrequest @Parameters
|
||||||
|
$nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp}
|
||||||
|
|
||||||
|
$Parameters = @{
|
||||||
|
Uri = $apkMirrorLink + "/download/$($nameProp)"
|
||||||
|
UseBasicParsing = $false # Disabled
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
$URL_Part = ((Invoke-Webrequest @Parameters).Links | Where-Object -FilterScript {$_.innerHTML -eq "here"}).href
|
||||||
|
# Replace "&" with "&" to make it work
|
||||||
|
$URL_Part = $URL_Part.Replace("&", "&")
|
||||||
|
|
||||||
|
# Finally, get the real link
|
||||||
|
$Parameters = @{
|
||||||
|
Uri = "https://www.apkmirror.com$URL_Part"
|
||||||
|
OutFile = "$WorkingFolder\ReVanced\youtube.apk"
|
||||||
|
UseBasicParsing = $true
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
Invoke-Webrequest @Parameters
|
||||||
|
|
||||||
# https://github.com/revanced/revanced-cli
|
# https://github.com/revanced/revanced-cli
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
|
|||||||
@@ -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 <https://apkpure.net> 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/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);
|
||||||
* 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.
|
||||||
@@ -35,6 +35,7 @@ Trigger the [`Build`](https://github.com/JDM170/ReVanced_Builder/actions/workflo
|
|||||||
## Links
|
## Links
|
||||||
|
|
||||||
* [APKPure](https://apkpure.net)
|
* [APKPure](https://apkpure.net)
|
||||||
|
* [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 Integrations](https://github.com/revanced/revanced-integrations)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ $LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -
|
|||||||
|
|
||||||
# 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
|
||||||
|
<#
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = "https://apkpure.net/youtube/com.google.android.youtube/download/$($LatestSupported)"
|
Uri = "https://apkpure.net/youtube/com.google.android.youtube/download/$($LatestSupported)"
|
||||||
UseBasicParsing = $true
|
UseBasicParsing = $true
|
||||||
@@ -24,5 +25,62 @@ $Parameters = @{
|
|||||||
Verbose = $true
|
Verbose = $true
|
||||||
}
|
}
|
||||||
Invoke-Webrequest @Parameters
|
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
|
||||||
|
|
||||||
|
# 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 = $apkMirrorLink
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$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 = $apkMirrorLink + "download/$($Key)"
|
||||||
|
UseBasicParsing = $true
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
$Request = Invoke-Webrequest @Parameters
|
||||||
|
$Parsed = $angleparser.ParseDocument($Request.Content)
|
||||||
|
$Key = ($Parsed.All | Where-Object -FilterScript { $_.InnerHtml -eq "here" }).Search
|
||||||
|
|
||||||
|
# Finally, get the real link
|
||||||
|
$Parameters = @{
|
||||||
|
Uri = "https://www.apkmirror.com/wp-content/themes/APKMirror/download.php$Key"
|
||||||
|
OutFile = "Temp\youtube.apk"
|
||||||
|
UseBasicParsing = $true
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
Invoke-Webrequest @Parameters
|
||||||
|
|
||||||
echo "LatestSupportedYT=$LatestSupported" >> $env:GITHUB_ENV
|
echo "LatestSupportedYT=$LatestSupported" >> $env:GITHUB_ENV
|
||||||
|
|||||||
Reference in New Issue
Block a user