Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
fix: the app changes warning names what the install lacks, and its settings say so too
My-Name-Is-Jeff84ad4be502fc
diff --git a/docs/tweaks.md b/docs/tweaks.mdindex ddd1c8f1..4ac66221 100644--- a/docs/tweaks.md+++ b/docs/tweaks.md@@ -575,8 +575,10 @@ App:that came over from upstream is left out, so a build without its own has no sheet). The Modpage offers both again. Environment.m says once per install state, a few seconds in, whenEeveeSpotify is injected too (a dyld image named so, or its settings page's Swift class) or Spotify is not the version the mod is- supports (SGSpotifySupportedVersions in Onboarding.h: 9.1.78, which it is made for, and 9.1.88) or likely works on (SGSpotifyLikelyWorksVersions: 9.1.90, which ran cleanly in a short test), and when a redesign below iOS 26 did not start, and when the redesign runs without the app- changes the IPA build makes (UIDesignRequiresCompatibility, as with a .deb injected by hand); all but+ supports (SGSpotifySupportedVersions in Onboarding.h: 9.1.78, which it is made for, and 9.1.88) or likely works on (SGSpotifyLikelyWorksVersions: 9.1.90, which ran cleanly in a short test), and when a redesign below iOS 26 did not start, and when the install lacks the app+ changes the IPA build makes, as with a .deb injected by hand: Spotify's own glass opt-out set (9.1.88's+ UIDesignRequiresCompatibility, under the redesign), or NSSupportsLiveActivities or MusicHapticsSupported+ missing, each named in the warning and the last two under Live Activity and Vibrations too; all butthe third stay as red rows at the top of Mod Settings. What Chroma left in Spotify's storage when Vitrinereplaced it (its Karaoke model and saved lock screen videos, never its listening history or audioeffects) is offered for deleting once, and stays a row there until it goes. Laid out on the simulator by harness/onboarding/diff --git a/tweak/Sources/App/Onboarding/Environment.m b/tweak/Sources/App/Onboarding/Environment.mindex 942c3412..eaadc151 100644--- a/tweak/Sources/App/Onboarding/Environment.m+++ b/tweak/Sources/App/Onboarding/Environment.m@@ -4,6 +4,8 @@// redesign below iOS 26 that did not start (Core/SGUIMode.h), which turned itself off. Also what Chroma, installed// over the same Spotify before, left behind, offered once for deleting.#import "Shared/Lyrics/Lyrics.h"+#import "Shared/Haptics/Haptics.h"+#import "Shared/LiveActivity/LiveActivity.h"#import "Core/SGCore.h"#import "Settings/SGModPage.h"#import "Settings/SGPageStyle.h"@@ -52,17 +54,29 @@ static SGProblem version(void) {joined([SGSpotifySupportedVersions arrayByAddingObjectsFromArray:likely], @"or")]];}-// Installed without the app changes Vitrine's IPA build makes (scripts/pipeline.sh: plist/liquid-glass.plist and the-// Live Activity), as when its .deb is injected by hand: the system keeps its old bars, so the glass tab bar is gone, and-// without MusicHapticsSupported iOS leaves Spotify out of Music Haptics.-static BOOL withoutAppChanges(void) {+// What this install lacks of the app changes Vitrine's IPA build makes (scripts/pipeline.sh: plist/liquid-glass.plist),+// as when its .deb is injected by hand, each said as what it costs. Spotify's own plist opting out of the system's glass+// (9.1.88's) costs the redesign its glass bars. 9.1.90 has no such key, and none is the same as glass on. The Live+// Activity and Music Haptics keys matter in either look, and their own settings say so too.+static NSArray<NSString *> *missingAppChanges(void) {+ NSMutableArray<NSString *> *missing = [NSMutableArray array];id compatibility = [NSBundle.mainBundle objectForInfoDictionaryKey:@"UIDesignRequiresCompatibility"];- return SGRedesignAvailable() && SGRedesignedUIStored() && !([compatibility isKindOfClass:NSNumber.class] && ![compatibility boolValue]);+ if (SGRedesignAvailable() && SGRedesignedUIStored() && [compatibility isKindOfClass:NSNumber.class] && [compatibility boolValue])+ [missing addObject:@"the tab bar stays Spotify's own, without its glass"];+ if (!SGLiveActivityAllowedByInstall()) [missing addObject:@"the Live Activity is missing"];+ if (!SGMusicHapticsListedByInstall())+ [missing addObject:@"iOS does not list Spotify for Music Haptics, which stops vibrations in the background"];+ return missing;+}++static BOOL withoutAppChanges(void) {+ return missingAppChanges().count > 0;}static SGProblem appChanges(void) {return @[@"Installed without Vitrine's app changes",- @"The redesign needs changes to the app that only Vitrine's IPA build makes, so the tab bar stays Spotify's own, the Live Activity is missing, and iOS does not list Spotify for Music Haptics, which stops vibrations in the background. Build the IPA with Vitrine instead of injecting its .deb."];+ [NSString stringWithFormat:@"Some of what Vitrine does needs changes to the app that only its IPA build makes. Without them, %@. Build the IPA with Vitrine instead of injecting its .deb.",+ joined(missingAppChanges(), @"and")]];}static SGProblem fellBack(void) {diff --git a/tweak/Sources/Shared/Haptics/Haptics.h b/tweak/Sources/Shared/Haptics/Haptics.hindex 9a0cc517..dadcbfee 100644--- a/tweak/Sources/Shared/Haptics/Haptics.h+++ b/tweak/Sources/Shared/Haptics/Haptics.h@@ -74,6 +74,9 @@ void SGPrepareFeedback(SGFeedback feedback);// In the Background reads off below iOS 18, which has no Music Haptics. Main thread.BOOL SGMusicHapticsOn(void);BOOL SGMusicHapticsInBackground(void);+// Whether iOS lists this install for Music Haptics: MusicHapticsSupported, which only Vitrine's IPA build writes+// into Info.plist. Without it In the Background has nothing to hand the song to.+BOOL SGMusicHapticsListedByInstall(void);// The choice of before moved to the switches, once: Generated turns Music Haptics on, Native iOS In the// Background, None neither. Each reader of the switches calls it first, since none can know it runs first.void SGMigrateMusicHaptics(void);diff --git a/tweak/Sources/Shared/Haptics/HapticsSettings.m b/tweak/Sources/Shared/Haptics/HapticsSettings.mindex cef6bba6..ef4829e8 100644--- a/tweak/Sources/Shared/Haptics/HapticsSettings.m+++ b/tweak/Sources/Shared/Haptics/HapticsSettings.m@@ -9,6 +9,7 @@// new strength with each step, and the preview ripples with it.#import "Core/SGCore.h"#import "Settings/SGModPage.h"+#import "Settings/SGPageStyle.h"#import "Haptics.h"#import "SGVibrationsPreview.h"@@ -49,6 +50,10 @@ BOOL SGMusicHapticsOn(void) {return SGFlag(SGKeyMusicHaptics, NO);}+BOOL SGMusicHapticsListedByInstall(void) {+ return [[NSBundle.mainBundle objectForInfoDictionaryKey:@"MusicHapticsSupported"] boolValue];+}+BOOL SGMusicHapticsInBackground(void) {return backgroundAvailable() && SGFlag(SGKeyMusicHapticsBackground, NO);}@@ -145,12 +150,22 @@ static NSArray<SGModSection *> *sections(SGVibrationsPreview *preview, void (^ex// What iOS's own is doing, or, while it is off in Accessibility, a row saying where to turn it on.SGModRow *status = SGStatRow(@"Status", ^NSString *{ return SGMusicHapticsStatus(); });status.visible = ^BOOL { return SGMusicHapticsInBackground() && SGSystemMusicHapticsOn(); };+ // Under In the Background while the install lacks the key iOS lists apps for Music Haptics by.+ SGModRow *unlisted = SGWarningRow(@"In the Background is missing from this install", @"Tap for why", ^{+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"In the Background is missing"+ message:@"iOS plays Music Haptics only for apps that say they support it, and only Vitrine's IPA build writes that into Spotify. This Spotify was put together another way, such as with Vitrine's .deb injected by hand, so the vibrations stop when Spotify leaves the screen. Music Haptics above still works while Spotify is open. Build the IPA with Vitrine to get both."+ preferredStyle:UIAlertControllerStyleAlert];+ alert.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;+ [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];+ [SGTopController() presentViewController:alert animated:YES completion:nil];+ });+ unlisted.visible = ^BOOL { return backgroundAvailable() && !SGMusicHapticsListedByInstall(); };SGModRow *systemOff = SGActionRow(@"Music Haptics is off in iOS", @"Tap to turn it on in Settings", explain);systemOff.visible = ^BOOL { return SGMusicHapticsInBackground() && !SGSystemMusicHapticsOn(); };return @[SGSection(nil, @[SGWithSymbol(controls, @"hand.tap"), controlStrength]),- SGSection(nil, @[SGWithSymbol(music, @"waveform"), musicStrength, follows, background, status, systemOff]),+ SGSection(nil, @[SGWithSymbol(music, @"waveform"), musicStrength, follows, background, unlisted, status, systemOff]),];}diff --git a/tweak/Sources/Shared/LiveActivity/LiveActivity.h b/tweak/Sources/Shared/LiveActivity/LiveActivity.hindex d9d54e74..47689574 100644--- a/tweak/Sources/Shared/LiveActivity/LiveActivity.h+++ b/tweak/Sources/Shared/LiveActivity/LiveActivity.h@@ -90,3 +90,6 @@ void SGSetLiveActivityEnabled(BOOL on);// The Live Activity page: a preview of the card (SGLiveActivityPreview.m), its switch, which view it shows, the// lyrics' options and the card's.UIViewController *SGLiveActivitySettingsPage(void);+// Whether this install lets Spotify start a Live Activity: NSSupportsLiveActivities, which only Vitrine's IPA+// build writes into Info.plist. Without it iOS turns every one down.+BOOL SGLiveActivityAllowedByInstall(void);diff --git a/tweak/Sources/Shared/LiveActivity/LiveActivitySettings.m b/tweak/Sources/Shared/LiveActivity/LiveActivitySettings.mindex dfc627a5..9b8589e7 100644--- a/tweak/Sources/Shared/LiveActivity/LiveActivitySettings.m+++ b/tweak/Sources/Shared/LiveActivity/LiveActivitySettings.m@@ -3,6 +3,7 @@// apply at once to a card that is showing.#import "Core/SGCore.h"#import "Settings/SGModPage.h"+#import "Settings/SGPageStyle.h"#import "Shared/Player/SleepTimer.h"#import "LiveActivity.h"#import "SGLiveActivityPreview.h"@@ -64,6 +65,24 @@ static SGModRow *menuRow(NSString *title, NSString *key, NSArray<NSString *> *na});}+BOOL SGLiveActivityAllowedByInstall(void) {+ return [[NSBundle.mainBundle objectForInfoDictionaryKey:@"NSSupportsLiveActivities"] boolValue];+}++// At the top while the install lacks the key, saying why nothing shows and what to do.+static SGModRow *missingRow(void) {+ SGModRow *row = SGWarningRow(@"Missing from this install", @"Tap for why", ^{+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Live Activity is missing"+ message:@"iOS shows a Live Activity only for an app that says it has one, and only Vitrine's IPA build writes that into Spotify. This Spotify was put together another way, such as with Vitrine's .deb injected by hand, so iOS turns the card down. Build the IPA with Vitrine to get it."+ preferredStyle:UIAlertControllerStyleAlert];+ alert.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;+ [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];+ [SGTopController() presentViewController:alert animated:YES completion:nil];+ });+ row.visible = ^BOOL { return !SGLiveActivityAllowedByInstall(); };+ return row;+}+UIViewController *SGLiveActivitySettingsPage(void) {SGLiveActivityPreview *preview = [SGLiveActivityPreview new];__weak SGLiveActivityPreview *weakPreview = preview;@@ -91,7 +110,7 @@ UIViewController *SGLiveActivitySettingsPage(void) {SGModRow *fade = SGMenuRow(@"Fade out", fades, ^NSString *{ return fades[(NSUInteger)SGSleepTimerFadeChoice()]; },^(NSInteger index) { SGSetInt(SGKeySleepTimerFade, index); });SGLiveActivityPage *page = [[SGLiveActivityPage alloc] initWithTitle:@"Live Activity" intro:nil sections:@[- SGSection(nil, @[on, view, without, alignment, translation, size]),+ SGSection(nil, @[missingRow(), on, view, without, alignment, translation, size]),SGNotedSection(@"Card", @[artwork, colors, progress],@"Colors: Spotify puts the cover's color behind Spotify's green, Artwork takes the green from the cover too, "@"and Plain is white on the lock screen's own background. "