First commit

This commit is contained in:
eevee committed 2024-04-20 22:28:44 +03:00
commit f787d29824
14 files changed
+241

No files matched your search

+29
View File
@@ -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"
)!
)
}
}
+55
View File
@@ -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)")
}
}
}
+8
View File
@@ -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 *
}