Skip to content

Commit e258ebc

Browse files
committed
something
1 parent 400a289 commit e258ebc

23 files changed

+461
-381
lines changed

EeveeSpotify.plist

+7-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
{ Filter = { Bundles = ( "com.spotify.client" ); }; }
1+
{
2+
Filter = {
3+
Bundles = (
4+
"com.spotify.client",
5+
);
6+
};
7+
}

Sources/EeveeSpotify/DataLoaderServiceHooks.x.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class SPTDataLoaderServiceHook: ClassHook<NSObject> {
114114
OfflineHelper.dataBuffer = Data()
115115

116116
var customizeMessage = try CustomizeMessage(serializedData: buffer)
117-
modifyAttributes(&customizeMessage.response.attributes.accountAttributes)
117+
modifyRemoteConfiguration(&customizeMessage.response)
118118

119119
orig.URLSession(
120120
session,

Sources/EeveeSpotify/Helpers/PopUpHelper.swift

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import UIKit
22
import Orion
3-
import Foundation
43

54
class PopUpHelper {
65

Sources/EeveeSpotify/Helpers/WindowHelper.swift

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import UIKit
2-
import Foundation
32

43
class WindowHelper {
54

Sources/EeveeSpotify/Lyrics/Helpers/LyricsHelper.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import UIKit
2-
import Foundation
32

43
class LyricsHelper {
54

@@ -40,7 +39,7 @@ class LyricsHelper {
4039
lyricLines = lines.map { line in
4140

4241
let match = line.firstMatch(
43-
"\\[(?<minute>\\d{2}):(?<seconds>\\d{2}\\.\\d{2})\\] ?(?<content>.*)"
42+
"\\[(?<minute>\\d{2}):(?<seconds>\\d{2}\\.?\\d*)\\] ?(?<content>.*)"
4443
)!
4544

4645
var captures: [String: String] = [:]

Sources/EeveeSpotify/Lyrics/Models/Genius/GeniusDataResponse.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ enum GeniusDataResponse: Decodable {
2323
)
2424
}
2525
}
26-
}
26+
}

Sources/EeveeSpotify/Lyrics/Models/Genius/GeniusHitResult.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import Foundation
33
struct GeniusHitResult: Decodable {
44
var id: Int
55
var title: String
6-
}
6+
}

Sources/EeveeSpotify/Models/Extensions/String+Extension.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ extension String {
4444
withTemplate: ""
4545
)
4646
}
47-
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import Foundation
2+
3+
func modifyRemoteConfiguration(_ configuration: inout UcsResponse) {
4+
modifyAttributes(&configuration.attributes.accountAttributes)
5+
}
6+
7+
func modifyAttributes(_ attributes: inout [String: AccountAttribute]) {
8+
9+
attributes["type"] = AccountAttribute.with {
10+
$0.stringValue = "premium"
11+
}
12+
attributes["player-license"] = AccountAttribute.with {
13+
$0.stringValue = "premium"
14+
}
15+
attributes["financial-product"] = AccountAttribute.with {
16+
$0.stringValue = "pr:premium,tc:0"
17+
}
18+
attributes["name"] = AccountAttribute.with {
19+
$0.stringValue = "Spotify Premium"
20+
}
21+
attributes["payments-initial-campaign"] = AccountAttribute.with {
22+
$0.stringValue = "default"
23+
}
24+
25+
//
26+
27+
attributes["unrestricted"] = AccountAttribute.with {
28+
$0.boolValue = true
29+
}
30+
attributes["catalogue"] = AccountAttribute.with {
31+
$0.stringValue = "premium"
32+
}
33+
attributes["streaming-rules"] = AccountAttribute.with {
34+
$0.stringValue = ""
35+
}
36+
attributes["pause-after"] = AccountAttribute.with {
37+
$0.longValue = 0
38+
}
39+
attributes["on-demand"] = AccountAttribute.with {
40+
$0.boolValue = true
41+
}
42+
43+
//
44+
45+
attributes["ads"] = AccountAttribute.with {
46+
$0.boolValue = false
47+
}
48+
49+
attributes.removeValue(forKey: "ad-use-adlogic")
50+
attributes.removeValue(forKey: "ad-catalogues")
51+
52+
//
53+
54+
attributes["shuffle-eligible"] = AccountAttribute.with {
55+
$0.boolValue = true
56+
}
57+
attributes["high-bitrate"] = AccountAttribute.with {
58+
$0.boolValue = true
59+
}
60+
attributes["offline"] = AccountAttribute.with {
61+
$0.boolValue = true
62+
}
63+
attributes["nft-disabled"] = AccountAttribute.with {
64+
$0.stringValue = "1"
65+
}
66+
attributes["can_use_superbird"] = AccountAttribute.with {
67+
$0.boolValue = true
68+
}
69+
attributes["social-session"] = AccountAttribute.with {
70+
$0.boolValue = true
71+
}
72+
attributes["social-session-free-tier"] = AccountAttribute.with {
73+
$0.boolValue = false
74+
}
75+
76+
//
77+
78+
attributes["com.spotify.madprops.delivered.by.ucs"] = AccountAttribute.with {
79+
$0.boolValue = true
80+
}
81+
attributes["com.spotify.madprops.use.ucs.product.state"] = AccountAttribute.with {
82+
$0.boolValue = true
83+
}
84+
}

Sources/EeveeSpotify/Premium/DynamicPremium.x.swift

+1-65
Original file line numberDiff line numberDiff line change
@@ -20,70 +20,6 @@ func showOfflineBnkMethodSetPopUp() {
2020
)
2121
}
2222

23-
func modifyAttributes(_ attributes: inout [String: AccountAttribute]) {
24-
25-
attributes["type"] = AccountAttribute.with {
26-
$0.stringValue = "premium"
27-
}
28-
attributes["player-license"] = AccountAttribute.with {
29-
$0.stringValue = "premium"
30-
}
31-
attributes["financial-product"] = AccountAttribute.with {
32-
$0.stringValue = "pr:premium,tc:0"
33-
}
34-
attributes["name"] = AccountAttribute.with {
35-
$0.stringValue = "Spotify Premium"
36-
}
37-
38-
//
39-
40-
attributes["unrestricted"] = AccountAttribute.with {
41-
$0.boolValue = true
42-
}
43-
attributes["catalogue"] = AccountAttribute.with {
44-
$0.stringValue = "premium"
45-
}
46-
attributes["streaming-rules"] = AccountAttribute.with {
47-
$0.stringValue = ""
48-
}
49-
attributes["pause-after"] = AccountAttribute.with {
50-
$0.longValue = 0
51-
}
52-
53-
//
54-
55-
attributes["ads"] = AccountAttribute.with {
56-
$0.boolValue = false
57-
}
58-
59-
attributes.removeValue(forKey: "ad-use-adlogic")
60-
attributes.removeValue(forKey: "ad-catalogues")
61-
62-
//
63-
64-
attributes["shuffle-eligible"] = AccountAttribute.with {
65-
$0.boolValue = true
66-
}
67-
attributes["high-bitrate"] = AccountAttribute.with {
68-
$0.boolValue = true
69-
}
70-
attributes["offline"] = AccountAttribute.with {
71-
$0.boolValue = true
72-
}
73-
attributes["nft-disabled"] = AccountAttribute.with {
74-
$0.stringValue = "1"
75-
}
76-
attributes["can_use_superbird"] = AccountAttribute.with {
77-
$0.boolValue = true
78-
}
79-
80-
//
81-
82-
attributes["com.spotify.madprops.use.ucs.product.state"] = AccountAttribute.with {
83-
$0.boolValue = true
84-
}
85-
}
86-
8723
class SPTCoreURLSessionDataDelegateHook: ClassHook<NSObject> {
8824

8925
static let targetName = "SPTCoreURLSessionDataDelegate"
@@ -128,7 +64,7 @@ class SPTCoreURLSessionDataDelegateHook: ClassHook<NSObject> {
12864

12965
if UserDefaults.patchType == .requests {
13066

131-
modifyAttributes(&bootstrapMessage.attributes)
67+
modifyRemoteConfiguration(&bootstrapMessage.ucsResponse)
13268

13369
orig.URLSession(
13470
session,
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
//
2-
// File.swift
3-
//
4-
//
5-
// Created by eevee on 28/05/2024.
6-
//
7-
81
import Foundation
92

103
extension BootstrapMessage {
114

12-
var attributes: [String: AccountAttribute] {
5+
var ucsResponse: UcsResponse {
6+
get {
7+
self.wrapper.oneMoreWrapper.message.response
8+
}
9+
set(ucsResponse) {
10+
self.wrapper.oneMoreWrapper.message.response = ucsResponse
11+
}
12+
}
13+
14+
var attributes: Dictionary<String, AccountAttribute> {
1315
get {
14-
self.wrapper.oneMoreWrapper.message.response.attributes.accountAttributes
16+
self.ucsResponse.attributes.accountAttributes
1517
}
1618
set(attributes) {
17-
self.wrapper.oneMoreWrapper.message.response.attributes.accountAttributes = attributes
19+
self.ucsResponse.attributes.accountAttributes = attributes
1820
}
1921
}
2022
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Foundation
2+
3+
extension UcsResponse {
4+
5+
var assignedValues: [AssignedValue] {
6+
get {
7+
self.resolve.configuration.assignedValues
8+
}
9+
set(assignedValues) {
10+
self.resolve.configuration.assignedValues = assignedValues
11+
}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Orion
2+
3+
class SPTFreeTierArtistHubRemoteURLResolverHook: ClassHook<NSObject> {
4+
5+
static let targetName = "SPTFreeTierArtistHubRemoteURLResolver"
6+
7+
func initWithViewURI(
8+
_ uri: NSURL,
9+
onDemandSet: Any,
10+
onDemandTrialService: Any,
11+
trackRowsEnabled: Bool,
12+
productState: SPTCoreProductState
13+
) -> Target {
14+
15+
return orig.initWithViewURI(
16+
uri,
17+
onDemandSet: onDemandSet,
18+
onDemandTrialService: onDemandTrialService,
19+
trackRowsEnabled: UserDefaults.patchType.isPatching
20+
? true
21+
: trackRowsEnabled,
22+
productState: productState
23+
)
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import Orion
2+
import UIKit
3+
4+
class ProfileSettingsSectionHook: ClassHook<NSObject> {
5+
6+
static let targetName = "ProfileSettingsSection"
7+
8+
func numberOfRows() -> Int {
9+
return 2
10+
}
11+
12+
func didSelectRow(_ row: Int) {
13+
14+
if row == 1 {
15+
16+
let rootSettingsController = WindowHelper.shared.findFirstViewController(
17+
"RootSettingsViewController"
18+
)!
19+
20+
let eeveeSettingsController = EeveeSettingsViewController(rootSettingsController.view.bounds)
21+
22+
rootSettingsController.navigationController!.pushViewController(
23+
eeveeSettingsController,
24+
animated: true
25+
)
26+
27+
return
28+
}
29+
30+
orig.didSelectRow(row)
31+
}
32+
33+
func cellForRow(_ row: Int) -> UITableViewCell {
34+
35+
if row == 1 {
36+
37+
let settingsTableCell = Dynamic.SPTSettingsTableViewCell
38+
.alloc(interface: SPTSettingsTableViewCell.self)
39+
.initWithStyle(3, reuseIdentifier: "EeveeSpotify")
40+
41+
let tableViewCell = Dynamic.convert(settingsTableCell, to: UITableViewCell.self)
42+
43+
tableViewCell.accessoryView = type(
44+
of: Dynamic.SPTDisclosureAccessoryView
45+
.alloc(interface: SPTDisclosureAccessoryView.self)
46+
)
47+
.disclosureAccessoryView()
48+
49+
tableViewCell.textLabel?.text = "EeveeSpotify"
50+
return tableViewCell
51+
}
52+
53+
return orig.cellForRow(row)
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import SwiftUI
2+
import UIKit
3+
4+
class EeveeSettingsViewController: SPTPageViewController {
5+
6+
let frame: CGRect
7+
8+
init(_ frame: CGRect) {
9+
self.frame = frame
10+
super.init(nibName: nil, bundle: nil)
11+
}
12+
13+
required init?(coder: NSCoder) {
14+
fatalError("init(coder:) has not been implemented")
15+
}
16+
17+
override func viewDidLoad() {
18+
super.viewDidLoad()
19+
20+
self.title = "EeveeSpotify"
21+
22+
let hostingController = UIHostingController(rootView: EeveeSettingsView())
23+
hostingController.view.frame = frame
24+
25+
view.addSubview(hostingController.view)
26+
addChild(hostingController)
27+
hostingController.didMove(toParent: self)
28+
}
29+
}

0 commit comments

Comments
 (0)