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 about section and update check
Vojtěch Škopek76f9e7a6810b
diff --git a/scripts/make-manifests.py b/scripts/make-manifests.pynew file mode 100755index 00000000..0455e405--- /dev/null+++ b/scripts/make-manifests.py@@ -0,0 +1,118 @@+#!/usr/bin/env python3+"""Write site/version.json, site/altstore.json and site/scarlet.json for a built IPA.++The IPA itself is never hosted here: --url is where it actually lives (catbox, archive.org), and+the manifests are the only thing the site serves. version.json is what the Updates row in Mod+Settings reads; the other two are the sources AltStore/SideStore and Scarlet subscribe to, so a+user who has added one gets every later build without going looking for it.++ scripts/make-manifests.py --ipa out/Spotify-9.1.78-glass.ipa \+ --url https://files.catbox.moe/xxxxxx.ipa --notes "Adds the About section."+"""+import argparse, json, plistlib, re, zipfile+from datetime import date+from pathlib import Path++ROOT = Path(__file__).resolve().parent.parent+SITE = ROOT / 'site'++# Everything the manifests say about the project, in one place.+NAME = 'spotifyglass'+SUBTITLE = 'Liquid Glass for Spotify'+DEVELOPER = 'vojta'+SITE_URL = 'https://spoti.pw'+SOURCE_ID = 'pw.spoti.source'+ICON_URL = f'{SITE_URL}/icon.png'+TINT = '1ED760'+MIN_IOS = '16.0'+DESCRIPTION = (+ "Spotify's own Liquid Glass design, unhidden from its feature flags, plus a pure black AMOLED "+ "background, a decluttered player and Home, a tab bar you can reorder or add your own links to, "+ "an editor for all of Spotify's internal flags, and telemetry blocking.\n\n"+ "Purely cosmetic. It does not unlock Premium."+)+SCREENSHOTS = [f'{SITE_URL}/shot-{n}.png' for n in (1, 2, 3)]+++def tweak_version():+ return re.search(r'^Version: (.+)$', (ROOT / 'tweak' / 'control').read_text(), re.M).group(1).strip()+++def ipa_info(ipa):+ with zipfile.ZipFile(ipa) as z:+ name = next(n for n in z.namelist() if re.fullmatch(r'Payload/[^/]+\.app/Info\.plist', n))+ info = plistlib.loads(z.read(name))+ return info['CFBundleIdentifier'], info['CFBundleShortVersionString']+++def main():+ ap = argparse.ArgumentParser()+ ap.add_argument('--ipa', required=True, type=Path)+ ap.add_argument('--url', required=True, help='where the IPA is actually hosted')+ ap.add_argument('--notes', default='', help='changelog for this build')+ args = ap.parse_args()++ version = tweak_version()+ bundle_id, spotify = ipa_info(args.ipa)+ size = args.ipa.stat().st_size+ when = date.today().isoformat()+ # AltStore orders by the version string, so the mod's version carries Spotify's alongside it.+ full = f'{version}-{spotify}'+ SITE.mkdir(exist_ok=True)++ (SITE / 'version.json').write_text(json.dumps({+ 'version': version,+ 'spotify': spotify,+ 'date': when,+ 'notes': args.notes,+ 'url': SITE_URL,+ 'download': args.url,+ }, indent=2) + '\n')++ (SITE / 'altstore.json').write_text(json.dumps({+ 'name': NAME,+ 'identifier': SOURCE_ID,+ 'subtitle': SUBTITLE,+ 'website': SITE_URL,+ 'iconURL': ICON_URL,+ 'apps': [{+ 'name': NAME,+ 'bundleIdentifier': bundle_id,+ 'developerName': DEVELOPER,+ 'subtitle': SUBTITLE,+ 'localizedDescription': DESCRIPTION,+ 'iconURL': ICON_URL,+ 'tintColor': TINT,+ 'screenshotURLs': SCREENSHOTS,+ 'versions': [{+ 'version': full,+ 'date': when,+ 'localizedDescription': args.notes,+ 'downloadURL': args.url,+ 'size': size,+ 'minOSVersion': MIN_IOS,+ }],+ }],+ 'news': [],+ }, indent=2) + '\n')++ (SITE / 'scarlet.json').write_text(json.dumps({+ 'META': {'repoName': NAME, 'repoIcon': ICON_URL},+ 'Tweaked': [{+ 'name': NAME,+ 'version': full,+ 'bundleID': bundle_id,+ 'down': args.url,+ 'description': DESCRIPTION,+ 'icon': ICON_URL,+ 'dev': DEVELOPER,+ }],+ }, indent=2) + '\n')++ print(f'{NAME} {version} on Spotify {spotify}, {size / 1e6:.0f} MB -> {args.url}')+ for f in ('version.json', 'altstore.json', 'scarlet.json'):+ print(f' site/{f}')+++if __name__ == '__main__':+ main()diff --git a/site/altstore.json b/site/altstore.jsonnew file mode 100644index 00000000..c0ec84ac--- /dev/null+++ b/site/altstore.json@@ -0,0 +1,34 @@+{+ "name": "spotifyglass",+ "identifier": "pw.spoti.source",+ "subtitle": "Liquid Glass for Spotify",+ "website": "https://spoti.pw",+ "iconURL": "https://spoti.pw/icon.png",+ "apps": [+ {+ "name": "spotifyglass",+ "bundleIdentifier": "com.spotify.client2",+ "developerName": "vojta",+ "subtitle": "Liquid Glass for Spotify",+ "localizedDescription": "Spotify's own Liquid Glass design, unhidden from its feature flags, plus a pure black AMOLED background, a decluttered player and Home, a tab bar you can reorder or add your own links to, an editor for all of Spotify's internal flags, and telemetry blocking.\n\nPurely cosmetic. It does not unlock Premium.",+ "iconURL": "https://spoti.pw/icon.png",+ "tintColor": "1ED760",+ "screenshotURLs": [+ "https://spoti.pw/shot-1.png",+ "https://spoti.pw/shot-2.png",+ "https://spoti.pw/shot-3.png"+ ],+ "versions": [+ {+ "version": "0.14.1-9.1.78",+ "date": "2026-09-07",+ "localizedDescription": "Adds an About section with the version, an update check and links.",+ "downloadURL": "https://files.catbox.moe/REPLACE.ipa",+ "size": 124769128,+ "minOSVersion": "16.0"+ }+ ]+ }+ ],+ "news": []+}diff --git a/site/scarlet.json b/site/scarlet.jsonnew file mode 100644index 00000000..efaf0626--- /dev/null+++ b/site/scarlet.json@@ -0,0 +1,17 @@+{+ "META": {+ "repoName": "spotifyglass",+ "repoIcon": "https://spoti.pw/icon.png"+ },+ "Tweaked": [+ {+ "name": "spotifyglass",+ "version": "0.14.1-9.1.78",+ "bundleID": "com.spotify.client2",+ "down": "https://files.catbox.moe/REPLACE.ipa",+ "description": "Spotify's own Liquid Glass design, unhidden from its feature flags, plus a pure black AMOLED background, a decluttered player and Home, a tab bar you can reorder or add your own links to, an editor for all of Spotify's internal flags, and telemetry blocking.\n\nPurely cosmetic. It does not unlock Premium.",+ "icon": "https://spoti.pw/icon.png",+ "dev": "vojta"+ }+ ]+}diff --git a/site/version.json b/site/version.jsonnew file mode 100644index 00000000..0fafb87e--- /dev/null+++ b/site/version.json@@ -0,0 +1,8 @@+{+ "version": "0.14.1",+ "spotify": "9.1.78",+ "date": "2026-09-07",+ "notes": "Adds an About section with the version, an update check and links.",+ "url": "https://spoti.pw",+ "download": "https://files.catbox.moe/REPLACE.ipa"+}diff --git a/tweak/src/SGCommon.h b/tweak/src/SGCommon.hindex 29c28d37..d1bcb091 100644--- a/tweak/src/SGCommon.h+++ b/tweak/src/SGCommon.h@@ -155,6 +155,19 @@ NSArray<NSString *> *SGBlockedLabels(void);NSUInteger SGBlockedCount(NSString *label);void SGResetBlocked(void);+// The site (SGUpdate.m): where the build points its user, and whether a newer one is out. The+// status is a string for the Updates row; the page's ticker reads it, so the check needs no+// callback. SGCheckForUpdate(NO) respects a six hour cache, SGCheckForUpdate(YES) always asks.+extern NSString *const SGSiteURL;+extern NSString *const SGRepoURL;+extern NSString *const SGChatURL;+extern NSString *const SGUpdateURL;+NSString *SGUpdateVersion(void); // nil unless the site has one newer than this build+NSString *SGUpdateNotes(void);+NSString *SGUpdateStatus(void);+void SGCheckForUpdate(BOOL force);+void SGOpenURL(NSString *url);+// Diagnostics (SGDiagnostics.x)BOOL SGIsDebugBuild(void);NSString *SGScreenTree(void);diff --git a/tweak/src/SGUpdate.m b/tweak/src/SGUpdate.mnew file mode 100644index 00000000..37ad9276--- /dev/null+++ b/tweak/src/SGUpdate.m@@ -0,0 +1,93 @@+// The site's version.json, so a build that is already on someone's phone can tell them a newer one+// exists. Fetched when the Mod Settings page opens, at most once every six hours, and on demand+// from the Updates row; the reply is a static file and nothing but the request itself leaves.+#import "SGCommon.h"++NSString *const SGSiteURL = @"https://spoti.pw";+NSString *const SGRepoURL = @"https://github.com/CHANGEME/CHANGEME";+NSString *const SGChatURL = @"https://t.me/CHANGEME";+NSString *const SGUpdateURL = @"https://spoti.pw/version.json";++static NSString *const kChecked = @"spotifyglass.update.checked";+static NSString *const kLatest = @"spotifyglass.update.latest";+static NSString *const kNotes = @"spotifyglass.update.notes";+static const NSTimeInterval kInterval = 6 * 60 * 60;++static NSString *sg_failure;+static BOOL sg_running;++// "0.14.1" against "0.15": the numbers position by position, a missing one counting zero.+static BOOL isNewer(NSString *candidate, NSString *current) {+ NSArray<NSString *> *left = [candidate componentsSeparatedByString:@"."];+ NSArray<NSString *> *right = [current componentsSeparatedByString:@"."];+ for (NSUInteger i = 0; i < MAX(left.count, right.count); i++) {+ NSInteger a = i < left.count ? left[i].integerValue : 0;+ NSInteger b = i < right.count ? right[i].integerValue : 0;+ if (a != b) return a > b;+ }+ return NO;+}++NSString *SGUpdateVersion(void) {+ NSString *latest = [NSUserDefaults.standardUserDefaults stringForKey:kLatest];+ return latest && isNewer(latest, @(SG_VERSION)) ? latest : nil;+}++NSString *SGUpdateNotes(void) {+ return [NSUserDefaults.standardUserDefaults stringForKey:kNotes] ?: @"";+}++// What the Updates row shows on the right; the page's own ticker reads it while the page is open,+// so the async check lands in the cell without anything having to be told about it.+NSString *SGUpdateStatus(void) {+ if (sg_running) return @"checking…";+ if (sg_failure) return sg_failure;+ NSString *latest = SGUpdateVersion();+ if (latest) return [latest stringByAppendingString:@" is out"];+ if ([NSUserDefaults.standardUserDefaults doubleForKey:kChecked] > 0) return @"up to date";+ return @"not checked";+}++void SGCheckForUpdate(BOOL force) {+ NSUserDefaults *store = NSUserDefaults.standardUserDefaults;+ NSTimeInterval last = [store doubleForKey:kChecked];+ if (sg_running) return;+ if (!force && last > 0 && NSDate.date.timeIntervalSince1970 - last < kInterval) return;++ sg_running = YES;+ sg_failure = nil;+ NSURLSessionConfiguration *configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration;+ configuration.timeoutIntervalForRequest = 10;+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:SGUpdateURL]+ cachePolicy:NSURLRequestReloadIgnoringLocalCacheData+ timeoutInterval:10];+ NSURLSessionDataTask *task = [[NSURLSession sessionWithConfiguration:configuration]+ dataTaskWithRequest:request+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {+ NSDictionary *json = data ? [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL] : nil;+ if (![json isKindOfClass:NSDictionary.class]) json = nil;+ NSString *version = [json[@"version"] isKindOfClass:NSString.class] ? json[@"version"] : nil;+ NSString *notes = [json[@"notes"] isKindOfClass:NSString.class] ? json[@"notes"] : @"";+ dispatch_async(dispatch_get_main_queue(), ^{+ sg_running = NO;+ if (!version) {+ sg_failure = @"check failed";+ SGLog(@"update check failed: %@", error.localizedDescription ?: @"no version in the reply");+ return;+ }+ [store setObject:version forKey:kLatest];+ [store setObject:notes forKey:kNotes];+ [store setDouble:NSDate.date.timeIntervalSince1970 forKey:kChecked];+ SGLog(@"update check: the site has %@, this build is %s", version, SG_VERSION);+ });+ }];+ [task resume];+}++void SGOpenURL(NSString *url) {+ NSURL *target = url ? [NSURL URLWithString:url] : nil;+ if (!target) return;+ dispatch_async(dispatch_get_main_queue(), ^{+ [UIApplication.sharedApplication openURL:target options:@{} completionHandler:nil];+ });+}diff --git a/tweak/src/ui/Settings.x b/tweak/src/ui/Settings.xindex 2d9693f4..5081a3b6 100644--- a/tweak/src/ui/Settings.x+++ b/tweak/src/ui/Settings.x@@ -185,6 +185,21 @@ static SGModRow *pageRow(NSString *title, NSString *subtitle, UIViewController *return row;}+static SGModRow *linkRow(NSString *title, NSString *subtitle, NSString *url) {+ return actionRow(title, subtitle, ^{ SGOpenURL(url); });+}++// A value on the right and a tap: the Updates row reads its status out of SGUpdate.m every tick,+// and a tap asks the site again instead of waiting for the six hour cache to lapse.+static SGModRow *statActionRow(NSString *title, NSString *subtitle, NSString *(^value)(void), void (^action)(void)) {+ SGModRow *row = [SGModRow new];+ row.title = title;+ row.subtitle = subtitle;+ row.value = value;+ row.action = action;+ return row;+}+static SGModSection *section(NSString *title, NSArray<SGModRow *> *rows) {SGModSection *s = [SGModSection new];s.title = title;@@ -350,6 +365,7 @@ static UITableViewCell *dequeue(UITableView *table, NSString *identifier) {label.text = row.value();[label sizeToFit];cell.accessoryView = label;+ cell.selectionStyle = row.action ? UITableViewCellSelectionStyleDefault : UITableViewCellSelectionStyleNone;} else if (row.action) {cell.selectionStyle = UITableViewCellSelectionStyleDefault;}@@ -975,9 +991,25 @@ static UIViewController *privacyPage(void) {] footer:nil];}+// Which build this is, whether the site has a newer one, and where to reach the mod: without these+// rows a build that is already installed has no way of telling its user that anything moved on.+static SGModSection *aboutSection(void) {+ NSString *spotify = [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: @"unknown";+ return section(@"About", @[+ statRow(@"Version", ^NSString *{ return @(SG_VERSION); }),+ statRow(@"Spotify", ^NSString *{ return spotify; }),+ statActionRow(@"Updates", @"Asks the site for the newest build; tap to check now", ^NSString *{+ return SGUpdateStatus();+ }, ^{ SGCheckForUpdate(YES); }),+ linkRow(@"Website", @"Downloads, and the source to add to AltStore or SideStore", SGSiteURL),+ linkRow(@"GitHub", @"Source, releases and issues", SGRepoURL),+ linkRow(@"Telegram", @"Updates and support", SGChatURL),+ ]);+}+static UIViewController *modSettingsPage(void) {- NSString *spotify = [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];- NSString *about = [NSString stringWithFormat:@"spotifyglass %s · Spotify %@", SG_VERSION, spotify];+ // Opening the page is the only thing that asks; the cache keeps it to once every six hours.+ SGCheckForUpdate(NO);return [[SGModPage alloc] initWithTitle:@"Mod Settings" intro:nil sections:@[section(nil, @[pageRow(@"UI Tweaks", @"Liquid Glass • AMOLED background", ^UIViewController *{ return uiTweaksPage(); }),@@ -988,7 +1020,8 @@ static UIViewController *modSettingsPage(void) {pageRow(@"Privacy", @"Block telemetry, and what it has blocked so far", ^UIViewController *{ return privacyPage(); }),pageRow(@"All flags", @"Search and force any of Spotify's remote-config flags", ^UIViewController *{ return [SGFlagsPage new]; }),]),- ] footer:about];+ aboutSection(),+ ] footer:nil];}#pragma mark - row in the settings list