From de46da7055f4eee61e2511665109ce9f6b048013 Mon Sep 17 00:00:00 2001 From: eevee Date: Mon, 22 Apr 2024 17:30:51 +0300 Subject: [PATCH] SpotifyHidePremium --- README.md | 2 -- .../EeveeSpotify/SpotifyHidePremium.x.swift | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Sources/EeveeSpotify/SpotifyHidePremium.x.swift diff --git a/README.md b/README.md index 680b1a9..b4ca580 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,4 @@ Tweak also changes query parameters `trackRows` and `video` to true, so Spotify There is no offline or very high quality (similar to Spotilife) because these features are server-sided (i.e., you can't get very high quality tracks from the server without a subscription). In theory, it might be possible to implement offline mode locally, but not in this tweak. -To hide the Premium tab, use [SpotifyHidePremium](https://t.me/SpotilifeIPAs/36). - To open Spotify links in sideloaded app, use [OpenSpotifySafariExtension](https://github.com/BillyCurtis/OpenSpotifySafariExtension). diff --git a/Sources/EeveeSpotify/SpotifyHidePremium.x.swift b/Sources/EeveeSpotify/SpotifyHidePremium.x.swift new file mode 100644 index 0000000..ec6cace --- /dev/null +++ b/Sources/EeveeSpotify/SpotifyHidePremium.x.swift @@ -0,0 +1,26 @@ +import Orion +import UIKit + +class UITabBarHook: ClassHook { + + // there is only one UITabBar, so no problem + func items() -> [UITabBarItem] { + return Array(orig.items().prefix(3)) + } +} + +class UITabBarButtonLabelHook: ClassHook { + + static let targetName = "UITabBarButtonLabel" + + func text() -> String { + + let text = orig.text() + + if text == "Premium" { + target.superview?.removeFromSuperview() + } + + return text + } +} \ No newline at end of file