mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
fixes
This commit is contained in:
@@ -10,20 +10,18 @@ func modifyRemoteConfiguration(_ configuration: inout UcsResponse) {
|
||||
modifyAssignedValues(&configuration.assignedValues)
|
||||
}
|
||||
|
||||
private let propertyToRemoveNames = [
|
||||
"enable_common_capping",
|
||||
"enable_pns_common_capping",
|
||||
"enable_pick_and_shuffle_common_capping",
|
||||
"enable_pick_and_shuffle_dynamic_cap",
|
||||
"pick_and_shuffle_timecap", // capping
|
||||
"should_nova_scroll_use_scrollsita" // 😡😡😡
|
||||
// spotify, stop changing the scroll logic
|
||||
]
|
||||
|
||||
func modifyAssignedValues(_ values: inout [AssignedValue]) {
|
||||
if let index = values.firstIndex(where: { $0.propertyID.name == "enable_pick_and_shuffle_common_capping" }) {
|
||||
values[index].enumValue = EnumValue.with {
|
||||
$0.value = "Disabled"
|
||||
}
|
||||
}
|
||||
|
||||
if let index = values.firstIndex(where: { $0.propertyID.name == "enable_pick_and_shuffle_dynamic_cap" }) {
|
||||
values[index].boolValue = BoolValue.with {
|
||||
$0.value = false
|
||||
}
|
||||
}
|
||||
|
||||
values.removeAll(where: { $0.propertyID.name == "pick_and_shuffle_timecap" })
|
||||
values.removeAll(where: { propertyToRemoveNames.contains($0.propertyID.name) })
|
||||
values.removeAll(where: { $0.propertyID.scope == "ios-feature-queue" })
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,31 @@ private func showHighQualityPopUp() {
|
||||
)
|
||||
}
|
||||
|
||||
private func showPlaylistDownloadingPopUp(_ isPlaylist: Bool, onSecondaryClick: (() -> Void)?) {
|
||||
PopUpHelper.showPopUp(
|
||||
message: "playlist_downloading_popup".localized,
|
||||
buttonText: "OK".uiKitLocalized,
|
||||
secondButtonText: isPlaylist
|
||||
? "download_local_playlist".localized
|
||||
: nil,
|
||||
onSecondaryClick: onSecondaryClick
|
||||
)
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
class StreamQualitySettingsSectionHook: ClassHook<NSObject> {
|
||||
typealias Group = IOS14PremiumPatchingGroup
|
||||
static let targetName = "StreamQualitySettingsSection"
|
||||
|
||||
func shouldResetSelection() -> Bool {
|
||||
showHighQualityPopUp()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
class ListRowInteractionListenerViewHook: ClassHook<UIView> {
|
||||
typealias Group = ModernPremiumPatchingGroup
|
||||
typealias Group = NonIOS14PremiumPatchingGroup
|
||||
static let targetName = "_TtC15Settings_ECMKit30ListRowInteractionListenerView"
|
||||
|
||||
func performAction() {
|
||||
@@ -25,18 +48,10 @@ class ListRowInteractionListenerViewHook: ClassHook<UIView> {
|
||||
}
|
||||
}
|
||||
|
||||
class StreamQualitySettingsSectionHook: ClassHook<NSObject> {
|
||||
typealias Group = LegacyPremiumPatchingGroup
|
||||
static let targetName = "StreamQualitySettingsSection"
|
||||
|
||||
func shouldResetSelection() -> Bool {
|
||||
showHighQualityPopUp()
|
||||
return true
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
class ContentOffliningUIHelperImplementationHook: ClassHook<NSObject> {
|
||||
typealias Group = BasePremiumPatchingGroup
|
||||
typealias Group = IOS14And15PremiumPatchingGroup
|
||||
static let targetName = "Offline_ContentOffliningUIImpl.ContentOffliningUIHelperImplementation"
|
||||
|
||||
func downloadToggledWithCurrentAvailability(
|
||||
@@ -48,13 +63,9 @@ class ContentOffliningUIHelperImplementationHook: ClassHook<NSObject> {
|
||||
) {
|
||||
let isPlaylist = Dynamic.convert(pageURI, to: SPTURL.self)
|
||||
.isPlaylistURL()
|
||||
|
||||
PopUpHelper.showPopUp(
|
||||
message: "playlist_downloading_popup".localized,
|
||||
buttonText: "OK".uiKitLocalized,
|
||||
secondButtonText: isPlaylist
|
||||
? "download_local_playlist".localized
|
||||
: nil,
|
||||
|
||||
showPlaylistDownloadingPopUp(
|
||||
isPlaylist,
|
||||
onSecondaryClick: isPlaylist
|
||||
? {
|
||||
self.orig.downloadToggledWithCurrentAvailability(
|
||||
@@ -69,3 +80,36 @@ class ContentOffliningUIHelperImplementationHook: ClassHook<NSObject> {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class ContentOffliningUIHelperImplementationModernHook: ClassHook<NSObject> {
|
||||
typealias Group = LatestPremiumPatchingGroup
|
||||
static let targetName = "Offline_ContentOffliningUIImpl.ContentOffliningUIHelperImplementation"
|
||||
|
||||
func downloadToggledWithCurrentAvailability(
|
||||
_ availability: NSInteger,
|
||||
addAction: NSObject,
|
||||
removeAction: NSObject,
|
||||
pageIdentifier: NSString,
|
||||
pageURI: NSURL,
|
||||
interactionID: NSString
|
||||
) {
|
||||
let isPlaylist = Dynamic.convert(pageURI, to: SPTURL.self)
|
||||
.isPlaylistURL()
|
||||
|
||||
showPlaylistDownloadingPopUp(
|
||||
isPlaylist,
|
||||
onSecondaryClick: isPlaylist
|
||||
? {
|
||||
self.orig.downloadToggledWithCurrentAvailability(
|
||||
availability,
|
||||
addAction: addAction,
|
||||
removeAction: removeAction,
|
||||
pageIdentifier: pageIdentifier,
|
||||
pageURI: pageURI,
|
||||
interactionID: interactionID
|
||||
)
|
||||
}
|
||||
: nil
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,17 +11,26 @@ func exitApplication() {
|
||||
|
||||
struct BasePremiumPatchingGroup: HookGroup { }
|
||||
|
||||
struct LegacyPremiumPatchingGroup: HookGroup { }
|
||||
struct ModernPremiumPatchingGroup: HookGroup { }
|
||||
struct IOS14PremiumPatchingGroup: HookGroup { }
|
||||
struct NonIOS14PremiumPatchingGroup: HookGroup { }
|
||||
struct IOS14And15PremiumPatchingGroup: HookGroup { }
|
||||
struct LatestPremiumPatchingGroup: HookGroup { }
|
||||
|
||||
func activatePremiumPatchingGroup() {
|
||||
BasePremiumPatchingGroup().activate()
|
||||
|
||||
if EeveeSpotify.hookTarget == .lastAvailableiOS14 {
|
||||
LegacyPremiumPatchingGroup().activate()
|
||||
IOS14PremiumPatchingGroup().activate()
|
||||
}
|
||||
else {
|
||||
ModernPremiumPatchingGroup().activate()
|
||||
NonIOS14PremiumPatchingGroup().activate()
|
||||
|
||||
if EeveeSpotify.hookTarget == .lastAvailableiOS15 {
|
||||
IOS14And15PremiumPatchingGroup().activate()
|
||||
}
|
||||
else {
|
||||
LatestPremiumPatchingGroup().activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +51,8 @@ struct EeveeSpotify: Tweak {
|
||||
}
|
||||
|
||||
init() {
|
||||
OfflineHelper.resetData(clearCaches: true)
|
||||
|
||||
if UserDefaults.experimentsOptions.showInstagramDestination {
|
||||
InstgramDestinationGroup().activate()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user