mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
Update Build.ps1
This commit is contained in:
38
Build.ps1
38
Build.ps1
@@ -1,7 +1,7 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Build ReVanced app using latest components:
|
Build ReVanced app using latest components:
|
||||||
* YouTube 17.33.42 (latest supported);
|
* YouTube (latest supported);
|
||||||
* ReVanced CLI;
|
* ReVanced CLI;
|
||||||
* ReVanced Patches;
|
* ReVanced Patches;
|
||||||
* ReVanced Integrations;
|
* ReVanced Integrations;
|
||||||
@@ -21,17 +21,41 @@ if (-not (Test-Path -Path "$DownloadsFolder\ReVanced"))
|
|||||||
New-Item -Path "$DownloadsFolder\ReVanced" -ItemType Directory -Force
|
New-Item -Path "$DownloadsFolder\ReVanced" -ItemType Directory -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
# https://apkpure.com/youtube/com.google.android.youtube/versions
|
# Get latest supported YouTube client version via ReVanced JSON
|
||||||
# YouTube 17.33.42
|
# It will let us to download always latest supported YouTube apk supportd by ReVanced team
|
||||||
|
# https://github.com/revanced/revanced-patches/blob/main/patches.json
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = "https://apkpure.com/youtube/com.google.android.youtube/download/1531188672-APK-1d33a9dd6b47ec963ea80d2437ef7d3f"
|
Uri = "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json"
|
||||||
UseBasicParsing = $true
|
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 -Last 1
|
||||||
|
$LatestSupported = $LatestSupported.replace(".", "-")
|
||||||
|
|
||||||
|
# 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/"
|
||||||
|
UseBasicParsing = $false # Disabled
|
||||||
Verbose = $true
|
Verbose = $true
|
||||||
}
|
}
|
||||||
$URL = ((Invoke-Webrequest @Parameters).Links | Where-Object -FilterScript {$_.href -match "https://download.apkpure.com"}).href
|
$Request = Invoke-Webrequest @Parameters
|
||||||
|
$nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp}
|
||||||
|
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = $URL
|
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/download/$($nameProp)"
|
||||||
Outfile = "$DownloadsFolder\ReVanced\youtube.apk"
|
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 = "$DownloadsFolder\ReVanced\youtube.apk"
|
||||||
UseBasicParsing = $true
|
UseBasicParsing = $true
|
||||||
Verbose = $true
|
Verbose = $true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user