Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
feat: add view hierarchy logging
Vojtěch Škopeka26c4b240565
diff --git a/README.md b/README.mdindex 7470669e..098a7897 100644--- a/README.md+++ b/README.md@@ -15,5 +15,6 @@ with your own certificate and push it to the iPhone over USB; put `SIGN_P12`, `S- `plist/liquid-glass.plist` — merged into Info.plist, turns `UIDesignRequiresCompatibility` off.- `deb/` — [AutoFLEX](https://github.com/pwnless/AutoFLEX) release, injected unless `--no-flex`.-Runtime log lines are prefixed `[spotifyglass]`; read them in FLEX → System Log. The first layout-of each bar logs its full view hierarchy, which is what to paste when the styling misses a view.+Runtime log lines are prefixed `[spotifyglass]`. With the phone on USB, `./dump-log.sh > out/spotifyglass.log`+then relaunch Spotify captures them on the Mac; on the phone they are in FLEX → System Log (long-press+a row to copy it). The first layout of each bar dumps its full view hierarchy in numbered parts.diff --git a/dump-log.sh b/dump-log.shnew file mode 100755index 00000000..9f97d4d2--- /dev/null+++ b/dump-log.sh@@ -0,0 +1,8 @@+#!/usr/bin/env bash+# Streams the tweak's log lines from the iPhone plugged into this Mac. Ctrl-C stops it.+#+# ./dump-log.sh > out/spotifyglass.log # then kill and relaunch Spotify on the phone+# ./dump-log.sh -n # over Wi-Fi+#+# The hierarchy dumps arrive as numbered parts ("now playing hierarchy 3/9").+exec idevicesyslog -p Spotify -m spotifyglass "$@"diff --git a/tweak/Tweak.x b/tweak/Tweak.xindex 2f2e3bfc..e46f2137 100644--- a/tweak/Tweak.x+++ b/tweak/Tweak.x@@ -20,6 +20,23 @@#define SGLog(fmt, ...) NSLog(@"[spotifyglass] " fmt, ##__VA_ARGS__)+// The unified log cuts a message at about 1 KB, so long dumps go out as numbered parts.+static void SGLogLong(NSString *tag, NSString *text) {+ NSMutableArray<NSString *> *parts = [NSMutableArray array];+ NSMutableString *current = [NSMutableString string];+ for (NSString *line in [text componentsSeparatedByString:@"\n"]) {+ if (current.length && current.length + line.length > 800) {+ [parts addObject:[current copy]];+ [current setString:@""];+ }+ [current appendFormat:@"%@\n", line];+ }+ if (current.length) [parts addObject:current];+ [parts enumerateObjectsUsingBlock:^(NSString *part, NSUInteger i, BOOL *stop) {+ SGLog(@"%@ %lu/%lu\n%@", tag, (unsigned long)i + 1, (unsigned long)parts.count, part);+ }];+}+static const CGFloat kCardRadius = 24;static const CGFloat kTabPillHeight = 56;static const CGFloat kTabSearchSize = 52;@@ -193,8 +210,9 @@ static void styleNowPlayingBar(UIViewController *container) {static dispatch_once_t once;dispatch_once(&once, ^{- SGLog(@"now playing card %@ at %@ (bar %@, container %@)\n%@", card.class, NSStringFromCGRect(frame),- NSStringFromCGRect(bar.frame), NSStringFromCGRect(container.view.bounds), [container.view recursiveDescription]);+ SGLog(@"now playing card %@ at %@ (bar %@, container %@)", card.class, NSStringFromCGRect(frame),+ NSStringFromCGRect(bar.frame), NSStringFromCGRect(container.view.bounds));+ SGLogLong(@"now playing hierarchy", [container.view recursiveDescription]);});}@@ -235,7 +253,8 @@ static void styleTabBar(UIView *tabBar) {}]];static dispatch_once_t once;dispatch_once(&once, ^{- SGLog(@"tab bar %@ items %lu\n%@", tabBar.class, (unsigned long)outer.count, [tabBar recursiveDescription]);+ SGLog(@"tab bar %@ items %lu", tabBar.class, (unsigned long)outer.count);+ SGLogLong(@"tab bar hierarchy", [tabBar recursiveDescription]);});if (outer.count < 2) return;diff --git a/tweak/control b/tweak/controlindex 1da2ea1b..c83bceb9 100644--- a/tweak/control+++ b/tweak/control@@ -1,6 +1,6 @@Package: com.vojta.spotifyglassName: spotifyglass-Version: 0.2.1+Version: 0.2.2Architecture: iphoneos-armDescription: Liquid Glass for the Spotify iOS appMaintainer: vojta