From f7bdc0133906b0708475aa9b90a9a7426b49e0f0 Mon Sep 17 00:00:00 2001 From: amd64fox <62529699+amd64fox@users.noreply.github.com> Date: Thu, 19 Aug 2021 11:13:51 +0300 Subject: [PATCH] Update Install_rus.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Сменился метод удаления меню с Css на Js - Оптимизация --- Install_rus.ps1 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Install_rus.ps1 b/Install_rus.ps1 index ac24bdc..44c8e19 100644 --- a/Install_rus.ps1 +++ b/Install_rus.ps1 @@ -160,7 +160,7 @@ Remove-Item -Recurse -LiteralPath $tempDirectory -# Removing an empty block and button +# Removing an empty block, "Upgrade button", "Upgrade to premium" menu if (!(test-path $env:APPDATA\Spotify\Apps\xpui.bak)) { Copy $env:APPDATA\Spotify\Apps\xpui.spa $env:APPDATA\Spotify\Apps\xpui.bak @@ -170,7 +170,9 @@ Rename-Item -path $env:APPDATA\Spotify\Apps\xpui.spa -NewName $env:APPDATA\Spoti Expand-Archive $env:APPDATA\Spotify\Apps\xpui.zip -DestinationPath $env:APPDATA\Spotify\Apps\temporary $file_js = Get-Content $env:APPDATA\Spotify\Apps\temporary\xpui.js -Raw If (!($file_js -match 'patched by spotx')) { - $new_js = $file_js -replace ".........................................Z.UpgradeButton.......", "" -replace 'e.ads.leaderboard.isEnabled', 'e.ads.leaderboard.isDisabled' + $file_js -match 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.' | Out-Null + $menu_split_js = $Matches[0] -split 'createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.' + $new_js = $file_js -replace ".........................................Z.UpgradeButton.......", "" -replace 'e.ads.leaderboard.isEnabled', 'e.ads.leaderboard.isDisabled' -replace 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.', $menu_split_js Set-Content -Path $env:APPDATA\Spotify\Apps\temporary\xpui.js -Force -Value $new_js add-content -Path $env:APPDATA\Spotify\Apps\temporary\xpui.js -Value '// Patched by SpotX' -passthru | Out-Null $contentjs = [System.IO.File]::ReadAllText("$env:APPDATA\Spotify\Apps\temporary\xpui.js") @@ -179,8 +181,8 @@ If (!($file_js -match 'patched by spotx')) { Compress-Archive -Path $env:APPDATA\Spotify\Apps\temporary\xpui.js -Update -DestinationPath $env:APPDATA\Spotify\Apps\xpui.zip } - -# Remove "Upgrade to premium" menu +<# +# Удаление меню (РЕЗЕРВНЫЙ) $file_css = Get-Content $env:APPDATA\Spotify\Apps\temporary\xpui.css -Raw If (!($file_css -match 'patched by spotx')) { $new_css = $file_css -replace 'table{border-collapse:collapse;border-spacing:0}', 'table{border-collapse:collapse;border-spacing:0}[target="_blank"]{display:none !important;}' @@ -191,6 +193,8 @@ If (!($file_css -match 'patched by spotx')) { [System.IO.File]::WriteAllText("$env:APPDATA\Spotify\Apps\temporary\xpui.css", $contentcss) Compress-Archive -Path $env:APPDATA\Spotify\Apps\temporary\xpui.css -Update -DestinationPath $env:APPDATA\Spotify\Apps\xpui.zip } +#> + Rename-Item -path $env:APPDATA\Spotify\Apps\xpui.zip -NewName $env:APPDATA\Spotify\Apps\xpui.spa Remove-item $env:APPDATA\Spotify\Apps\temporary -Recurse