From b43fec04b228625221991695f5f3fcc58d04a207 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Fri, 23 Sep 2022 00:39:58 +0300 Subject: [PATCH] Add files via upload --- Scripts/MicroG.ps1 | 16 +++++++++++ Scripts/ReVanced_CLI.ps1 | 17 +++++++++++ Scripts/ReVanced_Intergrations.ps1 | 16 +++++++++++ Scripts/ReVanced_Patches.ps1 | 36 ++++++++++++------------ Scripts/YouTube.ps1 | 45 ++++++++++++++++++++++++++++++ Scripts/Zulu_JDK.ps1 | 17 +++++++++++ 6 files changed, 129 insertions(+), 18 deletions(-) create mode 100644 Scripts/MicroG.ps1 create mode 100644 Scripts/ReVanced_CLI.ps1 create mode 100644 Scripts/ReVanced_Intergrations.ps1 create mode 100644 Scripts/YouTube.ps1 create mode 100644 Scripts/Zulu_JDK.ps1 diff --git a/Scripts/MicroG.ps1 b/Scripts/MicroG.ps1 new file mode 100644 index 0000000..9b9bf4c --- /dev/null +++ b/Scripts/MicroG.ps1 @@ -0,0 +1,16 @@ +# https://github.com/TeamVanced/VancedMicroG +$Parameters = @{ + Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest" + UseBasicParsing = $true + Verbose = $true +} +$MicroGTag = (Invoke-RestMethod @Parameters).tag_name +$Parameters = @{ + Uri = "https://github.com/TeamVanced/VancedMicroG/releases/download/$MicroGTag/microg.apk" + Outfile = "$PSScriptRoot\microg.apk" + UseBasicParsing = $true + Verbose = $true +} +Invoke-RestMethod @Parameters + +echo "MicroGTag=$MicroGTag" >> $env:GITHUB_ENV diff --git a/Scripts/ReVanced_CLI.ps1 b/Scripts/ReVanced_CLI.ps1 new file mode 100644 index 0000000..8254177 --- /dev/null +++ b/Scripts/ReVanced_CLI.ps1 @@ -0,0 +1,17 @@ +# https://github.com/revanced/revanced-cli +$Parameters = @{ + Uri = "https://api.github.com/repos/revanced/revanced-cli/releases/latest" + UseBasicParsing = $true + Verbose = $true +} +$CLIvtag = (Invoke-RestMethod @Parameters).tag_name +$CLItag = $CLIvtag.replace("v", "") +$Parameters = @{ + Uri = "https://github.com/revanced/revanced-cli/releases/download/$CLIvtag/revanced-cli-$CLItag-all.jar" + Outfile = "$PSScriptRoot\revanced-cli.jar" + UseBasicParsing = $true + Verbose = $true +} +Invoke-RestMethod @Parameters + +echo "CLIvtag=$CLIvtag" >> $env:GITHUB_ENV diff --git a/Scripts/ReVanced_Intergrations.ps1 b/Scripts/ReVanced_Intergrations.ps1 new file mode 100644 index 0000000..d082a6b --- /dev/null +++ b/Scripts/ReVanced_Intergrations.ps1 @@ -0,0 +1,16 @@ +# https://github.com/revanced/revanced-integrations +$Parameters = @{ + Uri = "https://api.github.com/repos/revanced/revanced-integrations/releases/latest" + UseBasicParsing = $true + Verbose = $true +} +$IntegrationsTag = (Invoke-RestMethod @Parameters).tag_name +$Parameters = @{ + Uri = "https://github.com/revanced/revanced-integrations/releases/download/$IntegrationsTag/app-release-unsigned.apk" + Outfile = "$PSScriptRoot\app-release-unsigned.apk" + UseBasicParsing = $true + Verbose = $true +} +Invoke-RestMethod @Parameters + +echo "IntegrationsTag=$IntegrationsTag" >> $env:GITHUB_ENV diff --git a/Scripts/ReVanced_Patches.ps1 b/Scripts/ReVanced_Patches.ps1 index 452c70c..3ae1a30 100644 --- a/Scripts/ReVanced_Patches.ps1 +++ b/Scripts/ReVanced_Patches.ps1 @@ -1,18 +1,18 @@ - -# https://github.com/revanced/revanced-patches -$Parameters = @{ - Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest" - UseBasicParsing = $true - Verbose = $true -} -$Patchesvtag = (Invoke-RestMethod @Parameters).tag_name -$Patchestag = $Patchesvtag.replace("v", "") -$Parameters = @{ - Uri = "https://github.com/revanced/revanced-patches/releases/download/$Patchesvtag/revanced-patches-$Patchestag.jar" - Outfile = "$PSScriptRoot\revanced-patches.jar" - UseBasicParsing = $true - Verbose = $true -} -Invoke-RestMethod @Parameters - -echo "Patchesvtag=$Patchesvtag" >> $env:GITHUB_ENV + +# https://github.com/revanced/revanced-patches +$Parameters = @{ + Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest" + UseBasicParsing = $true + Verbose = $true +} +$Patchesvtag = (Invoke-RestMethod @Parameters).tag_name +$Patchestag = $Patchesvtag.replace("v", "") +$Parameters = @{ + Uri = "https://github.com/revanced/revanced-patches/releases/download/$Patchesvtag/revanced-patches-$Patchestag.jar" + Outfile = "$PSScriptRoot\revanced-patches.jar" + UseBasicParsing = $true + Verbose = $true +} +Invoke-RestMethod @Parameters + +echo "Patchesvtag=$Patchesvtag" >> $env:GITHUB_ENV diff --git a/Scripts/YouTube.ps1 b/Scripts/YouTube.ps1 new file mode 100644 index 0000000..c84e964 --- /dev/null +++ b/Scripts/YouTube.ps1 @@ -0,0 +1,45 @@ +# Get latest supported YouTube client version via ReVanced JSON +# It will let us to download always latest YouTube apk supported by ReVanced team +# https://github.com/revanced/revanced-patches/blob/main/patches.json +$Parameters = @{ + Uri = "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json" + 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 -First 1 +$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 +Add-Type -Path $AngleSharpAssemblyPath + +# 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-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-2-android-apk-download/" + UseBasicParsing = $false # Disabled + Verbose = $true +} +$Request = Invoke-Webrequest @Parameters +$Parsed = (New-Object -TypeName AngleSharp.Html.Parser.HtmlParser).ParseDocument($Request.Content) +$Key = $Parsed.All | Where-Object -FilterScript {$_.ClassName -match "accent_bg btn btn-flat downloadButton"} | ForEach-Object -Process {$_.Search} + +$Parameters = @{ + Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-2-android-apk-download/download/$($Key)" + UseBasicParsing = $true + Verbose = $true +} +$Request = Invoke-Webrequest @Parameters +$Parsed = (New-Object -TypeName AngleSharp.Html.Parser.HtmlParser).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 = "$PSScriptRoot\youtube.apk" + UseBasicParsing = $true + Verbose = $true +} +Invoke-Webrequest @Parameters + +echo "LatestSupportedYT=$LatestSupportedYT" >> $env:GITHUB_ENV diff --git a/Scripts/Zulu_JDK.ps1 b/Scripts/Zulu_JDK.ps1 new file mode 100644 index 0000000..956639b --- /dev/null +++ b/Scripts/Zulu_JDK.ps1 @@ -0,0 +1,17 @@ +# https://github.com/ScoopInstaller/Java/blob/master/bucket/zulu-jdk.json +$Parameters = @{ + Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json" + UseBasicParsing = $true + Verbose = $true +} +$URL = (Invoke-RestMethod @Parameters).architecture."64bit".url +$ZuluTag = (Invoke-RestMethod @Parameters).version +$Parameters = @{ + Uri = $URL + Outfile = "$PSScriptRoot\jdk_windows-x64_bin.zip" + UseBasicParsing = $true + Verbose = $true +} +Invoke-RestMethod @Parameters + +echo "ZuluTag=$ZuluTag" >> $env:GITHUB_ENV