Islet 0.7.6: a Dynamic Island for notched iPhones

SpringBoard tweak for the iPhone XR on iOS 18.7.1 (Dopamine rootless),
built without Theos using the swift.org clang and linked on the phone.

The island shows music with Apple's audio analyzer and live lyrics, timers,
calls, flashlight, screen recording, accessories and their batteries, calendar,
notifications with actions, and system popups, in portrait and landscape.
Includes a Settings page, a Watch ping hook, an offscreen self test and the
tools that capture the showcase video.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-05 19:03:58 -06:00
commit c88455c759
3 changed files with 4824 additions and 0 deletions

14
tests/loadtest.m Normal file
View file

@ -0,0 +1,14 @@
// Loads a tweak dylib into a throwaway process (harmless check that the arm64e slice loads and its constructor runs).
// loadtest <dylib> [seconds]. With ISLET_SELFTEST=<dir> the dylib renders its cards there and exits by itself.
#import <Foundation/Foundation.h>
#import <dlfcn.h>
int main(int argc, char **argv) {
@autoreleasepool {
void *h = dlopen(argv[1], RTLD_NOW);
printf("dlopen: %s\n", h ? "ok" : dlerror());
if (!h) return 1;
[[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:argc > 2 ? atof(argv[2]) : 4]];
printf("PASS\n");
}
return 0;
}

35
tests/prefstest.m Normal file
View file

@ -0,0 +1,35 @@
// Drives the Settings bundle's list controller in a throwaway process: class, plist loading, read and write.
// Env ISLET_PREFS_BUNDLE points at the unpacked bundle, ISLET_PREFS_FILE at a scratch plist. Build arm64 (uses literals).
#import <Foundation/Foundation.h>
#import <objc/message.h>
#import <dlfcn.h>
int main(int argc, char **argv) { @autoreleasepool {
void *h = dlopen(argv[1], RTLD_NOW);
printf("dlopen: %s\n", h ? "ok" : dlerror());
Class c = NSClassFromString(@"IsletRootListController");
printf("class: %s\n", c ? "ok" : "MISSING");
if (!c) return 1;
id lc = [[c alloc] init];
NSBundle *b = [lc performSelector:@selector(bundle)];
printf("bundle: %s\n", b.bundlePath.UTF8String);
NSArray *specs = [lc performSelector:@selector(specifiers)];
printf("specifiers: %lu\n", (unsigned long)specs.count);
int switches = 0, sliders = 0, withKey = 0; id target = nil;
for (id s in specs) {
id key = [s performSelector:@selector(propertyForKey:) withObject:@"key"];
if (key) withKey++;
if ([[key description] isEqual:@"hideSeconds"]) target = s;
NSString *cell = [s description]; (void)cell;
id def = [s performSelector:@selector(propertyForKey:) withObject:@"default"];
if ([def isKindOfClass:NSClassFromString(@"__NSCFBoolean")]) switches++; else if (def) sliders++;
}
printf("keys=%d switches=%d sliders=%d\n", withKey, switches, sliders);
id before = [lc performSelector:@selector(readPreferenceValue:) withObject:target];
[lc performSelector:@selector(setPreferenceValue:specifier:) withObject:@33 withObject:target];
id after = [lc performSelector:@selector(readPreferenceValue:) withObject:target];
printf("read default=%s after write=%s\n", [before description].UTF8String, [after description].UTF8String);
[lc performSelector:@selector(resetNow)];
id reset = [lc performSelector:@selector(readPreferenceValue:) withObject:target];
printf("after reset=%s\n", [reset description].UTF8String);
printf("%s\n", [after intValue] == 33 && [reset isEqual:before] && specs.count > 30 ? "PASS" : "FAIL");
} return 0; }

28
tests/systest.m Normal file
View file

@ -0,0 +1,28 @@
// Exercises the private calls Islet's sentinel makes, in a throwaway process (never in SpringBoard).
#import <Foundation/Foundation.h>
#import <objc/message.h>
#import <objc/runtime.h>
#import <dlfcn.h>
#import <Network/Network.h>
int main(void) { @autoreleasepool {
dlopen("/System/Library/PrivateFrameworks/DoNotDisturb.framework/DoNotDisturb", RTLD_NOW);
dlopen("/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport", RTLD_NOW);
dlopen("/System/Library/PrivateFrameworks/AVFCore.framework/AVFCore", RTLD_NOW);
Class rc = NSClassFromString(@"RadiosPreferences"), fc = NSClassFromString(@"AVFlashlight"), dc = NSClassFromString(@"DNDStateService");
printf("classes: radios=%d flash=%d dnd=%d\n", !!rc, !!fc, !!dc);
if (rc) { id r = [[rc alloc] init]; printf("airplane=%d\n", ((BOOL (*)(id, SEL))objc_msgSend)(r, NSSelectorFromString(@"airplaneMode"))); }
if (fc) { id f = [[fc alloc] init]; printf("flash avail=%d level=%f\n", ((BOOL (*)(id, SEL))objc_msgSend)(f, NSSelectorFromString(@"isAvailable")), ((float (*)(id, SEL))objc_msgSend)(f, NSSelectorFromString(@"flashlightLevel"))); }
if (dc) {
id svc = ((id (*)(id, SEL, id))objc_msgSend)(dc, NSSelectorFromString(@"serviceForClientIdentifier:"), @"com.astar76.islet.test");
id st = ((id (*)(id, SEL, id *))objc_msgSend)(svc, NSSelectorFromString(@"queryCurrentStateWithError:"), NULL);
printf("dnd state=%s active=%d\n", st ? "ok" : "nil", st ? ((BOOL (*)(id, SEL))objc_msgSend)(st, NSSelectorFromString(@"isActive")) : -1);
}
nw_path_monitor_t m = nw_path_monitor_create();
dispatch_queue_t q = dispatch_queue_create("t", 0);
nw_path_monitor_set_queue(m, q);
int z = 0;
nw_path_monitor_set_update_handler(m, ^(nw_path_t p) { printf("net status=%d wifi=%d cell=%d z=%d\n", nw_path_get_status(p), nw_path_uses_interface_type(p, nw_interface_type_wifi), nw_path_uses_interface_type(p, nw_interface_type_cellular), z); });
nw_path_monitor_start(m);
[[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:2]];
printf("PASS\n");
} return 0; }