This commit is contained in:
eevee committed 2024-09-26 15:27:16 +03:00
1 parent 69a35534e8
commit 7cc86d3d37
7 files changed
+13 -20

No files matched your search

@@ -32,7 +32,7 @@ class SPTDataLoaderServiceHook: ClassHook<NSObject>, SpotifySessionDelegate {
session,
dataTask: task,
didReceiveData: try getLyricsForCurrentTrack(
originalLyrics: try? Lyrics(serializedData: buffer)
originalLyrics: try? Lyrics(serializedBytes: buffer)
)
)
@@ -46,13 +46,13 @@ class SPTDataLoaderServiceHook: ClassHook<NSObject>, SpotifySessionDelegate {
}
do {
var customizeMessage = try CustomizeMessage(serializedData: buffer)
var customizeMessage = try CustomizeMessage(serializedBytes: buffer)
modifyRemoteConfiguration(&customizeMessage.response)
orig.URLSession(
session,
dataTask: task,
didReceiveData: try customizeMessage.serializedData()
didReceiveData: try customizeMessage.serializedBytes()
)
orig.URLSession(session, task: task, didCompleteWithError: nil)
@@ -280,5 +280,5 @@ func getLyricsForCurrentTrack(originalLyrics: Lyrics? = nil) throws -> Data {
}
preloadedLyrics = nil
return try lyrics.serializedData()
return try lyrics.serializedBytes()
}
@@ -78,13 +78,6 @@ class MusixmatchLyricsRepository: LyricsRepository {
}
private func getFirstSubtitle(_ subtitlesMessage: [String: Any]) throws -> [String: Any] {
guard
let subtitlesHeader = subtitlesMessage["header"] as? [String: Any],
let subtitlesStatusCode = subtitlesHeader["status_code"] as? Int
else {
throw LyricsError.DecodingError
}
guard
let subtitlesBody = subtitlesMessage["body"] as? [String: Any],
let subtitleList = subtitlesBody["subtitle_list"] as? [[String: Any]],
@@ -60,7 +60,7 @@ class SpotifySessionDelegateBootstrapHook: ClassHook<NSObject>, SpotifySessionDe
let buffer = URLSessionHelper.shared.obtainData(for: url)!
do {
var bootstrapMessage = try BootstrapMessage(serializedData: buffer)
var bootstrapMessage = try BootstrapMessage(serializedBytes: buffer)
if UserDefaults.patchType == .notSet {
if bootstrapMessage.attributes["type"]?.stringValue == "premium" {
@@ -81,7 +81,7 @@ class SpotifySessionDelegateBootstrapHook: ClassHook<NSObject>, SpotifySessionDe
orig.URLSession(
session,
dataTask: task,
didReceiveData: try bootstrapMessage.serializedData()
didReceiveData: try bootstrapMessage.serializedBytes()
)
NSLog("[EeveeSpotify] Modified bootstrap data")
@@ -33,7 +33,7 @@ class BundleHelper {
func resolveConfiguration() throws -> ResolveConfiguration {
return try ResolveConfiguration(
serializedData: try Data(
serializedBytes: try Data(
contentsOf: self.bundle.url(
forResource: "resolveconfiguration",
withExtension: "bnk"