mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
First commit
This commit is contained in:
commit
f787d29824
14 files changed
+241
No files matched your search
Executable
+29
@@ -0,0 +1,29 @@
|
||||
import Foundation
|
||||
import libroot
|
||||
|
||||
class BundleHelper {
|
||||
|
||||
private let bundleName = "EeveeSpotify"
|
||||
|
||||
private let bundle: Bundle
|
||||
static let shared = BundleHelper()
|
||||
|
||||
private init() {
|
||||
self.bundle = Bundle(
|
||||
path: Bundle.main.path(
|
||||
forResource: bundleName,
|
||||
ofType: "bundle"
|
||||
)
|
||||
?? jbRootPath("/Library/Application Support/\(bundleName).bundle")
|
||||
)!
|
||||
}
|
||||
|
||||
func premiumBlankData() throws -> Data {
|
||||
return try Data(
|
||||
contentsOf: self.bundle.url(
|
||||
forResource: "premiumblank",
|
||||
withExtension: "bnk"
|
||||
)!
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import Orion
|
||||
|
||||
class URLHook: ClassHook<NSURL> {
|
||||
|
||||
func initWithString(_ urlString: String, relativeToURL URL: NSURL) -> NSURL {
|
||||
|
||||
var finalString = urlString
|
||||
|
||||
if finalString.contains("artistview") {
|
||||
finalString = finalString.replacingOccurrences(
|
||||
of: "trackRows=false",
|
||||
with: "trackRows=true"
|
||||
)
|
||||
finalString = finalString.replacingOccurrences(
|
||||
of: "video=false",
|
||||
with: "video=true"
|
||||
)
|
||||
}
|
||||
|
||||
return orig.initWithString(finalString, relativeToURL: URL)
|
||||
}
|
||||
}
|
||||
|
||||
struct EeveeSpotify: Tweak {
|
||||
|
||||
init() {
|
||||
|
||||
do {
|
||||
|
||||
let filePath = FileManager.default.urls(
|
||||
for: .applicationSupportDirectory, in: .userDomainMask
|
||||
)
|
||||
.first!
|
||||
.appendingPathComponent("PersistentCache")
|
||||
.appendingPathComponent("offline.bnk")
|
||||
|
||||
let fileData = try Data(contentsOf: filePath)
|
||||
|
||||
let usernameLength = Int(fileData[8])
|
||||
let username = Data(fileData[9..<9 + usernameLength])
|
||||
|
||||
var blankData = try BundleHelper.shared.premiumBlankData()
|
||||
|
||||
blankData.insert(UInt8(usernameLength), at: 8)
|
||||
blankData.insert(contentsOf: username, at: 9)
|
||||
|
||||
try blankData.write(to: filePath)
|
||||
NSLog("[EeveeSpotify] Successfully applied")
|
||||
}
|
||||
|
||||
catch {
|
||||
NSLog("[EeveeSpotify] Unable to apply tweak: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#import <Orion/Orion.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
__attribute__((constructor)) static void init() {
|
||||
// Initialize Orion - do not remove this line.
|
||||
orion_init();
|
||||
// Custom initialization code goes here.
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,4 @@
|
||||
module EeveeSpotifyC {
|
||||
umbrella "."
|
||||
export *
|
||||
}
|
||||
Reference in new issue
Block a user