-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
461 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
{ Filter = { Bundles = ( "com.spotify.client" ); }; } | ||
{ | ||
Filter = { | ||
Bundles = ( | ||
"com.spotify.client", | ||
); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import UIKit | ||
import Orion | ||
import Foundation | ||
|
||
class PopUpHelper { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import UIKit | ||
import Foundation | ||
|
||
class WindowHelper { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ enum GeniusDataResponse: Decodable { | |
) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ import Foundation | |
struct GeniusHitResult: Decodable { | ||
var id: Int | ||
var title: String | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,4 @@ extension String { | |
withTemplate: "" | ||
) | ||
} | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
Sources/EeveeSpotify/Premium/DynamicPremium+ModifyFunctions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import Foundation | ||
|
||
func modifyRemoteConfiguration(_ configuration: inout UcsResponse) { | ||
modifyAttributes(&configuration.attributes.accountAttributes) | ||
} | ||
|
||
func modifyAttributes(_ attributes: inout [String: AccountAttribute]) { | ||
|
||
attributes["type"] = AccountAttribute.with { | ||
$0.stringValue = "premium" | ||
} | ||
attributes["player-license"] = AccountAttribute.with { | ||
$0.stringValue = "premium" | ||
} | ||
attributes["financial-product"] = AccountAttribute.with { | ||
$0.stringValue = "pr:premium,tc:0" | ||
} | ||
attributes["name"] = AccountAttribute.with { | ||
$0.stringValue = "Spotify Premium" | ||
} | ||
attributes["payments-initial-campaign"] = AccountAttribute.with { | ||
$0.stringValue = "default" | ||
} | ||
|
||
// | ||
|
||
attributes["unrestricted"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
attributes["catalogue"] = AccountAttribute.with { | ||
$0.stringValue = "premium" | ||
} | ||
attributes["streaming-rules"] = AccountAttribute.with { | ||
$0.stringValue = "" | ||
} | ||
attributes["pause-after"] = AccountAttribute.with { | ||
$0.longValue = 0 | ||
} | ||
attributes["on-demand"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
|
||
// | ||
|
||
attributes["ads"] = AccountAttribute.with { | ||
$0.boolValue = false | ||
} | ||
|
||
attributes.removeValue(forKey: "ad-use-adlogic") | ||
attributes.removeValue(forKey: "ad-catalogues") | ||
|
||
// | ||
|
||
attributes["shuffle-eligible"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
attributes["high-bitrate"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
attributes["offline"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
attributes["nft-disabled"] = AccountAttribute.with { | ||
$0.stringValue = "1" | ||
} | ||
attributes["can_use_superbird"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
attributes["social-session"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
attributes["social-session-free-tier"] = AccountAttribute.with { | ||
$0.boolValue = false | ||
} | ||
|
||
// | ||
|
||
attributes["com.spotify.madprops.delivered.by.ucs"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
attributes["com.spotify.madprops.use.ucs.product.state"] = AccountAttribute.with { | ||
$0.boolValue = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
Sources/EeveeSpotify/Premium/Models/Extensions/BootstrapMessage+Extension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by eevee on 28/05/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
extension BootstrapMessage { | ||
|
||
var attributes: [String: AccountAttribute] { | ||
var ucsResponse: UcsResponse { | ||
get { | ||
self.wrapper.oneMoreWrapper.message.response | ||
} | ||
set(ucsResponse) { | ||
self.wrapper.oneMoreWrapper.message.response = ucsResponse | ||
} | ||
} | ||
|
||
var attributes: Dictionary<String, AccountAttribute> { | ||
get { | ||
self.wrapper.oneMoreWrapper.message.response.attributes.accountAttributes | ||
self.ucsResponse.attributes.accountAttributes | ||
} | ||
set(attributes) { | ||
self.wrapper.oneMoreWrapper.message.response.attributes.accountAttributes = attributes | ||
self.ucsResponse.attributes.accountAttributes = attributes | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Sources/EeveeSpotify/Premium/Models/Extensions/UcsResponse+Extension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Foundation | ||
|
||
extension UcsResponse { | ||
|
||
var assignedValues: [AssignedValue] { | ||
get { | ||
self.resolve.configuration.assignedValues | ||
} | ||
set(assignedValues) { | ||
self.resolve.configuration.assignedValues = assignedValues | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Orion | ||
|
||
class SPTFreeTierArtistHubRemoteURLResolverHook: ClassHook<NSObject> { | ||
|
||
static let targetName = "SPTFreeTierArtistHubRemoteURLResolver" | ||
|
||
func initWithViewURI( | ||
_ uri: NSURL, | ||
onDemandSet: Any, | ||
onDemandTrialService: Any, | ||
trackRowsEnabled: Bool, | ||
productState: SPTCoreProductState | ||
) -> Target { | ||
|
||
return orig.initWithViewURI( | ||
uri, | ||
onDemandSet: onDemandSet, | ||
onDemandTrialService: onDemandTrialService, | ||
trackRowsEnabled: UserDefaults.patchType.isPatching | ||
? true | ||
: trackRowsEnabled, | ||
productState: productState | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import Orion | ||
import UIKit | ||
|
||
class ProfileSettingsSectionHook: ClassHook<NSObject> { | ||
|
||
static let targetName = "ProfileSettingsSection" | ||
|
||
func numberOfRows() -> Int { | ||
return 2 | ||
} | ||
|
||
func didSelectRow(_ row: Int) { | ||
|
||
if row == 1 { | ||
|
||
let rootSettingsController = WindowHelper.shared.findFirstViewController( | ||
"RootSettingsViewController" | ||
)! | ||
|
||
let eeveeSettingsController = EeveeSettingsViewController(rootSettingsController.view.bounds) | ||
|
||
rootSettingsController.navigationController!.pushViewController( | ||
eeveeSettingsController, | ||
animated: true | ||
) | ||
|
||
return | ||
} | ||
|
||
orig.didSelectRow(row) | ||
} | ||
|
||
func cellForRow(_ row: Int) -> UITableViewCell { | ||
|
||
if row == 1 { | ||
|
||
let settingsTableCell = Dynamic.SPTSettingsTableViewCell | ||
.alloc(interface: SPTSettingsTableViewCell.self) | ||
.initWithStyle(3, reuseIdentifier: "EeveeSpotify") | ||
|
||
let tableViewCell = Dynamic.convert(settingsTableCell, to: UITableViewCell.self) | ||
|
||
tableViewCell.accessoryView = type( | ||
of: Dynamic.SPTDisclosureAccessoryView | ||
.alloc(interface: SPTDisclosureAccessoryView.self) | ||
) | ||
.disclosureAccessoryView() | ||
|
||
tableViewCell.textLabel?.text = "EeveeSpotify" | ||
return tableViewCell | ||
} | ||
|
||
return orig.cellForRow(row) | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Sources/EeveeSpotify/Settings/ViewControllers/EeveeSettingsViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import SwiftUI | ||
import UIKit | ||
|
||
class EeveeSettingsViewController: SPTPageViewController { | ||
|
||
let frame: CGRect | ||
|
||
init(_ frame: CGRect) { | ||
self.frame = frame | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
self.title = "EeveeSpotify" | ||
|
||
let hostingController = UIHostingController(rootView: EeveeSettingsView()) | ||
hostingController.view.frame = frame | ||
|
||
view.addSubview(hostingController.view) | ||
addChild(hostingController) | ||
hostingController.didMove(toParent: self) | ||
} | ||
} |
Oops, something went wrong.