Islet/CLAUDE.md
astar76 dfecc24142 Add CLAUDE.md and tools/verify for future sessions
tools/verify runs every check that doesn't need an install. The test harness
now holds a keep-awake assertion and a longer limit, because idle phones froze
runs partway through.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 22:55:49 -06:00

3.5 KiB

Islet

A Dynamic Island for notched iPhones: a SpringBoard tweak in Objective-C, no Theos. Built for an iPhone XR on iOS 18.7.1 with Dopamine rootless. Read HANDOFF.md first if it exists: it is local-only and holds the phone's address, setup and what is confirmed on device.

Never do these

  • Never respring, reboot, run sbreload or install anything. The owner installs and resprings by hand.
  • Never break the arm64e rules below. A mistake takes SpringBoard down, not just the build.
  • Never put private details in tracked files: this repo is public. Local details go in HANDOFF.md, which is gitignored.

arm64e rules

This clang can't produce the signed pointers the arm64e runtime wants, so these crash at runtime, not at compile time. tools/lint catches what it can.

  • No static Objective-C classes. Create them at runtime with MakeClass.
  • No @"..." literals in src/Islet.m or src/IsletPrefs.m: use NS("..."). Test executables built arm64 may use them.
  • No global or static blocks. Use HB(^{ (void)_islet_z; ... }) with int _islet_z = 0; (void)_islet_z; in scope.
  • Every selector used as a gesture or notification target must be registered on its runtime class.
  • IsletPing loads into a daemon: Foundation only, built with tools/build-arch <arch> mini.
  • Hooks go through SwizzleChecked, which refuses a missing method or an unexpected return type.

Finding private APIs

Don't guess a selector. On the phone, /var/mobile/probe4 <framework path> <Class> dumps a class. SpringBoard's classes can be probed from outside by passing /System/Library/PrivateFrameworks/SpringBoard.framework/SpringBoard. Also like:<text>, proto:<text>, sym:<name> and call:Class.selector. The source is src/probe.m.

Prefer an event over polling, and when a stock UI signal is unreliable find the real one: the lock pill uses authentication state because the lock screen's own signals also fire for Notification Center.

Working on it

  1. Change the code, and add a check to SelfTest in src/Islet.m for anything testable.
  2. Bump VERSION when a new build is going to the phone.
  3. Run tools/verify: lint, package, self test, Settings test and load tests, then it copies the deb to /var/mobile/islet.deb.
  4. Look at the PNGs in build/selftest. Passing checks say nothing about how a card looks.
  5. Tell the owner what to install and what to try. Say plainly what only ran offscreen.

Before trusting a report from the phone, check the running version: isletctl dump, then the first line of /var/jb/var/mobile/islet-dump.txt. A report once turned out to be about the previous build.

New settings need a default in both the code and pkg/prefs/Root.plist: tools/lint fails if they differ.

Layout

  • src/Islet.m: the tweak. Sections are #pragma marks: Arbitration, Sources, Accessories and batteries, System state, Hooks.
  • src/IsletPrefs.m and pkg/prefs/: the Settings page. src/IsletPing.m: the Watch ping hook. src/isletctl.m: the CLI.
  • tools/: verify, package.sh, build-arch, selftest, lint, film and film-edit.py.
  • Activities are dictionaries (Act). Long-running ones go in gOngoing with a priority, popups go through PostTransient. Suppressed() decides when the island steps aside, and stock UI must come back whenever it does.

Releases

docs/releases/<version>.md holds the notes. See the global instructions for the folder and upload steps, and tell the owner the version and contents before publishing. The showcase video is tools/film then tools/film-edit.py.