Skip to content

Commit

Permalink
Swift v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
whoeevee committed Apr 24, 2024
1 parent b2058f4 commit e9bd4e4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Several months ago, Spotilife, the only tweak to get Spotify Premium, stopped wo

Upon login, Spotify fetches user data, including active subscription, and caches it in the `offline.bnk` file in the `/Library/Application Support/PersistentCache` directory. It uses its proprietary binary format to store data, incorporating a length byte before each value, among other conventions. Certain keys, such as `player-license`, `financial-product`, and `type`, determines the user abilities.

The tweak patches this file while initializing; Spotify loads it and assumes you have Premium. To be honest, it doesn't really patch due to challenges with dynamic length and varied bytes. Ideally, there should be a parser capable of deserializing and serializing such format. However, for now, the tweak simply extracts the username from the current `offline.bnk` file and inserts it into `premiumblank.bnk` (a file containing all premium values preset), replacing `offline.bnk` (`financial-product` is trial because I have no premium `offline.bnk`, but it doesn't matter).
The tweak patches this file while initializing; Spotify loads it and assumes you have Premium. To be honest, it doesn't really patch due to challenges with dynamic length and varied bytes. Ideally, there should be a parser capable of deserializing and serializing such format. However, for now, the tweak simply extracts the username from the current `offline.bnk` file and inserts it into `premiumblank.bnk` (a file containing all premium values preset), replacing `offline.bnk`.

![Hex](Images/hex.png)

Tweak also removes the Premium tab and changes query parameters `trackRows` and `video` in HTTP requests to true, so Spotify loads videos and not just track names at the artist page. Sorry if the code seems cringe; the main focus is on the concept. It can stop working just like Spotilife, but so far, it works on the latest Spotify 8.9.## (Spotilife also patches `offline.bnk`, but it changes obscure bytes that do nothing on new versions). Spotify reloads user data from time to time (and on changing network, for example), so if Premium stops working, simply restart the app.
Tweak also changes query parameters `trackRows` and `video` in HTTP requests to true, so Spotify loads videos and not just track names at the artist page. Sorry if the code seems cringe; the main focus is on the concept. It can stop working just like Spotilife, but so far, it works on the latest Spotify 8.9.## (Spotilife also patches `offline.bnk`, but it changes obscure bytes that do nothing on new versions). Spotify reloads user data from time to time (and on changing network, for example), so if Premium stops working, simply restart the app.

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.

Expand Down
26 changes: 0 additions & 26 deletions Sources/EeveeSpotify/SpotifyHidePremium.x.swift

This file was deleted.

19 changes: 9 additions & 10 deletions Sources/EeveeSpotify/Tweak.x.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,18 @@ struct EeveeSpotify: Tweak {

try blankData.write(to: filePath)
NSLog("[EeveeSpotify] Successfully applied")

Timer.scheduledTimer(withTimeInterval: 20, repeats: true) { _ in
do {
try blankData.write(to: filePath)
NSLog("[EeveeSpotify] Successfully reapplied")
}
catch {
NSLog("[EeveeSpotify] Unable to reapply (write data): \(error)")
}
}
}

catch {

DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {

WindowHelper.shared.showPopup(
message: "Unable to apply tweak: \(error)",
buttonText: "OK"
)
}

NSLog("[EeveeSpotify] Unable to apply tweak: \(error)")
}
}
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.eevee.spotify
Name: EeveeSpotify
Version: 1.1
Version: 1.2
Architecture: iphoneos-arm
Description: A tweak to get Spotify Premium for free, just like Spotilife
Maintainer: Eevee
Expand Down
Binary file not shown.

0 comments on commit e9bd4e4

Please sign in to comment.