Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Research: iPhone Duo simulator baseline and vphone-duo comparison

Jacky34f488b94adb
diff --git a/Research/Guest/Evidence/duo-sim-baseline/BASELINE.md b/Research/Guest/Evidence/duo-sim-baseline/BASELINE.md
new file mode 100644
index 00000000..e8629f02
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/BASELINE.md
@@ -0,0 +1,270 @@
+# iPhone Duo simulator baseline: alignment table
+
+Ground truth for vphone-duo, collected 2026-10-29 from Apple's iPhone Duo
+simulator (iPhone19,4, V68, iOS 27.1 24A94425, Xcode 27.1). The simulator
+folds through SpringBoard's own display-swap coordinator (README.md, "Posture").
+
+The `vphone-duo` column was filled on 2026-10-29 from the VM `duobase-01`
+(bundle 2.14.0-local.21dc0c06, upstream main 82afdb9a, two-display Duo path),
+iPhone19,4 / iOS 27.1 24A94425, with the simulator probes run in the guest
+through `tools/vm-probe.zsh` (VM versions `probes/vm-*.lldb`; why they are
+needed is in `vm-notes.md`). Each cell gives the VM value, then **match**,
+**differs** or **n/a**. Rows that were marked **VM differs** before the column
+was filled say whether the measurement confirmed or corrected that note.
+Method, step list and caveats: `vm-notes.md`. VM data: `vm-*.json`, raw
+transcripts `raw/vm/steps/<step>/`.
+
+On 2026-10-30 the rows the duo-sim-align fix can affect were measured again on
+`duobase-01` with bundle **2.14.0-local.9064efca** (branch duo-sim-align:
+V68 `product-id`, `/product/display0`+`display1` panel nodes, CoreMotion's
+device-state relay fed through `VPhone Host Controls`). The pose now reaches
+SpringBoard through CoreMotion, not through the test-automation override.
+Those cells give the new value; where it changed, "(was: …)" holds the first
+pass. Rows not named in "Changes since the first VM pass" were not re-measured
+unless their cell says so. Records: the `vm-*.json` records with
+`"bundle": "2.14.0-local.9064efca"` and `step` `fx-<label>`; transcripts
+`raw/vm/steps/fx-<label>/`; method and the two incidents of this pass in
+`vm-notes.md` ("2026-10-30").
+
+## Diff summary
+
+Remaining **differs** rows, most consequential first (state after the
+2026-10-30 pass). Struck items are aligned now.
+
+1. **Auto-lock / AOD.** The VM has no always-on display (`DeviceSupportsAlwaysOnDisplay` NO, `BLSHBacklightHost deviceSupportsAlwaysOn` NO). Auto-lock in open turns the inner fully off (backlight 4) instead of AOD (3); folding while auto-locked gives FullyClosed with the cover primary on the lock screen but **off** (4), inner off. The old note "VM lights the folded inner display" did not reproduce: the inner stayed off and blanked.
+2. **Inner display identity** (not changed by the fix; another session owns the names). CADisplay `VPhone Duo Inner` / `VPhone Duo Inner` / displayId 7 (sim `LCD-1` / `primary-1` / 3); FBS identity `Unknown[7]` (sim `Unknown.main[3]`), not UIKitMainLike; `UIScreen._isEmbeddedScreen` NO; UIScreen display corner radius 0, sRGB. Re-read on 2026-10-30: unchanged.
+3. **Inner display mode.** Now 2007×2853 @3 like the sim (was: native 2853×2007 at pointScale 1), but **120 Hz** (sim 60 Hz), **sRGB** (sim P3), and FBS/UIScreen still list a second mode, 2853×2007 (951×669 @3). The cover runs 120 Hz (sim 60 Hz).
+4. **MobileGestalt identity.** `ModelNumber` VM0001 (sim A3447), `RegulatoryModelNumber` nil, `HWModelStr` V68AP (sim iPhone19,4), AOD keys NO. ~~`DisplayExtendedProperties` nil, logical display count 1~~: aligned (item 5 of "Changes").
+5. **Display power model** (not re-measured beyond the posture rows; `stateControl` still nil). No `CADisplayStateControl` on any CADisplay. The cover `LCD` is the one real panel (the composited output) and is never blanked while the guest is awake, also in book/open; the inner window-server display is enabled when unfolded and blanked when closed. The sim blanks the cover when open.
+6. **Digitizer** (not re-measured). One `Virtual USB Touch Screen` (USB, builtIn) as `mainDisplayDigitizerService`, re-routed to the inner UUID while unfolded; the sim has one CoreDevice touchscreen per panel.
+7. **Resolver transition style at a SpringBoard start.** 2 `.continuousLive` right after a SpringBoard start in closed (sim 1 `.fade` until the first swap). After a swap it now matches: 2 in every posture, 3 with Safari in front (was: 0 at start, then 1, 2 or 3 by path).
+8. **Per-panel pose orientation when closed.** Device landscapeRight (4) gives cover 4 and landscapeLeft (3) cover 3, now computed by CoreMotion (`cmMagicPose` cover 4 / 3); the sim gives cover 3 / 4. CoreMotion's own table (identical in the sim) maps a closed hinge to the cover unchanged, so the sim's value comes from its synthetic swap-tool pose. Open matches.
+9. **Cover corner radii.** `extendedProperties` and MobileGestalt `DisplayExtendedProperties` say [5,5,59,59] (Apple's device tree); the sim's device type says [8,8,59,59]. Everything else in both dictionaries matches.
+10. **Pixel density.** Both panels 460×460 ppi (was: inner 0 / nil); the sim reads 316×669 (cover) and 324×654 (inner). The physical sizes are the sim's (3.0391×4.4217 and 4.3630×6.2022 in) with width and height swapped; the sim's ppi is the native pixel size divided by those swapped axes.
+11. **Book angle, residual.** 99.444° (position 0.552, closed region 0→0.2747, toClosed 0.5525→0.03) against the sim's synthetic 100° (0.556, 0→0.2761, 0.5556→0.03) (was: 90°, 0.500, 0→0.25). The host controls send 100 and the provider's mechanical angle is 100; CoreMotion's angle is 99.444 (= 100 × 179/180). Not investigated further.
+12. **Auto-lock default.** The VM runs the real Auto-Lock (60 s; timer warn 40 s, total 60 s); the sim holds the `SBDisableAutoDim` assertion. Configuration, not behaviour.
+
+Aligned or reclassified by the 2026-10-30 pass (details in the next section):
+~~CoreMotion is absent~~; ~~inner `extendedProperties` carry only DeviceSurfaceType~~;
+~~MobileGestalt `DisplayExtendedProperties` nil / display count 1~~;
+~~hinge HID: one unnamed 0xFF0C/0x21 service~~; ~~book at 90°~~;
+~~inner portrait-shaped `statusBarFrame` 0-rect~~; ~~transition style 1/2/3 by
+path after a swap~~; lock-screen clock height: **personalization** (the VM's
+lock screen uses another poster, `v68.colorB`, with a taller adaptive time;
+see "System chrome").
+
+Corrected notes: the VM **does** turn the cover landscape for Safari (678×466,
+C/C, `statusBarFrame` 0×0, like the sim); the CoreMotion tabletop and A=7
+table rows **match** (they are CoreMotion's own class methods, not
+FoldDisplay); the folded inner does **not** light after auto-lock.
+
+## Changes since the first VM pass
+
+Bundle 2.14.0-local.21dc0c06 → 2.14.0-local.9064efca, same VM, same iOS.
+
+| # | item | first pass | now | sim |
+|---|---|---|---|---|
+| 1 | pose source | test-automation override (`display.pose`) | CoreMotion: `SBFDevicePoseProvider` reads `CMAngleManager` / `CMMagicPoseManager`; `display.posture` replies `source: coremotion` | swap tool writes the provider |
+| 2 | book angle / position | 90° / 0.500 | 99.444° / 0.552 (`uiHingeStatus` 99.444, `cmAngle` 99.444, mechanical 100) | 100° / 0.556 |
+| 3 | hinge regions in book | closed 0→0.25, toClosed 0.50→0.03 | closed 0→0.2747, toClosed 0.5525→0.03 | 0→0.2761, 0.5556→0.03 |
+| 4 | CoreMotion managers | `+isAvailable` NO ×3, `sharedManager` nil, provider managers nil, `_accelerometer` BKSAccelerometer | `+isAvailable` YES ×3; `sharedManager` non-nil and not the provider's (`isSharedManager` NO); provider `_cmMagicPoseManager` registered with both handlers, `_cmAngleManager` active at 0.01 s; `_accelerometer` nil; `currentDeviceState` live | the same objects, frozen at boot values; `_accelerometer` nil |
+| 5 | MobileGestalt screen | `DisplayExtendedProperties` nil, `MGGetLogicalDeviceDisplayCount` 1 | 2 entries equal to the sim's except the cover corners; count 2 | 2 entries; 2 |
+| 6 | `extendedProperties` | `{DeviceSurfaceType 1}` / `{DeviceSurfaceType 2}` | full dictionaries: DisplayRotation 0 / 270, DeviceSurfaceType and kMGQDeviceSurfaceType 1 / 2, DisplayScale 3, ChromeIdentifier phone15 / phone14, FramebufferIdentifier as the sim, corners [5,5,59,59] / 55×4 | the same, cover corners [8,8,59,59] |
+| 7 | inner physical size, ppi | 0×0, 0 / `pixelDensity` nil | 6.2022×4.3630 in, 460×460 (FBS 460×460) | 4.3630×6.2022, 324×654 |
+| 8 | inner mode | 2853×2007 pointScale 1 + 951×669 mode, 60 Hz | 669×951@3x (2007×2853/3) current and preferred, + 951×669@3x; 120 Hz | 2007×2853 @3, 60 Hz, one mode |
+| 9 | hinge HID services | one unnamed Virtual 0xFF0C/0x21 | `CoreMotion_DeviceStateRelay_Crane` 0xFF0C/0x21 and `_DeviceState` 0xFF0C/0x22 (Virtual), plus `VPhone Host Controls` 0xFF61/0x5B (Virtual) | the two relay services |
+| 10 | inner portrait-shaped status bar (io 1) | 0-rect, one capture | {592,0,77,951}, two captures (25 s after the rotation, and again after a round trip through io 2) | {592,0,77,951} |
+| 11 | transition style | 0 at start; 1 / 2 / 3 by path | 2 at start; 2 after every swap; 3 with Safari | 1 at boot; 2; 3 with Safari |
+| 12 | per-panel pose, closed | cover = device orientation (override) | the same, now from CoreMotion's table: reclassified as a sim artefact | cover = opposite landscape (synthetic) |
+| 13 | lock-screen clock | "differs" | personalization: poster `v68.colorB` vs `celosia.timeOfDay` | |
+
+Row 8's refresh rate comes from upstream's "run the inner display at the
+panel's 120 Hz" (in this branch), not from the alignment change.
+
+## Data files
+
+| file | records | scope | notes |
+|---|---|---|---|
+| `smoke.json` | 60 | harness smoke run | |
+| `display.json` + `display.md` | 46085 | backboardd CADisplay / CAWindowServer / BKS, SpringBoard UIScreen / FBS display configurations, digitizers | getters enumerated at runtime; extra field `capture` |
+| `springboard.json` + `springboard.md` | 37408 | content-mode coordinator and resolver, window scenes, traits pipeline, continuous fold, backlight, auto-lock | 45 steps, all four device orientations |
+| `sensors.json` + `sensors.md` | 10932 | CMMagicPose / CMDeviceStateEvent tables, hinge HID, SBFDevicePoseProvider, UIDevice, 527 MobileGestalt keys | `sim_note` marks 2578 sim-only or synthetic values; do not align to them |
+| `appkit.json` + `appkit.md` | 20829 | Preferences, MobileSafari, VPAppKitProbe: scenes, geometry, traits, safe area, migration callbacks | probe app source in `raw/appkit/probe-app` |
+| `chrome.json` + `chrome.md` | 127674 | status bar, icon grid, dock, quick actions, notification list, clock, wallpaper | `meta.skipped_getters` lists getters that throw |
+| `vm-springboard.json`, `vm-display.json`, `vm-sensors.json`, `vm-chrome.json`, `vm-appkit.json` + `vm-notes.md` | see `vm-notes.md` | the same probes on duobase-01 | `meta.vm`, `meta.steps` (per-step display.pose, orientation, screenshot size and lit/dark, SpringBoard pid); extra fields `probe`, `step`. Second pass (2026-10-30): records with `bundle` 2.14.0-local.9064efca and `step` `fx-<label>`, described in `meta.fix` |
+
+Every record has `api, kind, process, posture, orientation, call, value, error`.
+`posture` includes the path, e.g. `open(after-closed)`, because many values
+depend on history. Display UUIDs change on every boot, so join on name or identity.
+
+```zsh
+# every value of one call, by posture
+jq -c '.records[] | select(.call | test("primaryWindowScene")) | {posture, orientation, value}' springboard.json
+```
+
+## Posture and policy
+
+| posture | hinge | policy | primary scene | content mode cover / inner | backlight cover / inner | vphone-duo |
+|---|---|---|---|---|---|---|
+| closed | 0°, `.closed` | FullyClosed | `SB-main` (cover) | 2 / 1 | on / off | 0°, `.closed`, FullyClosed, `SB-main`, 2 / 1, on (1) / off (4); screenshot 1398×2034 lit; the same after a SpringBoard start, after open and after book (2026-10-30, CoreMotion) — **match** |
+| book | 100°, `.partiallyOpen` | FoldingDual | `com.apple.springboard.bringup` (inner) | 3 / 2 | off / on | **99.444°** (0.552), `.partiallyOpen`, FoldingDual, `bringup`, 3 / 2, off (4) / on (1); screenshot 2034×1398 lit; after closed and after open — **differs** (angle residual 0.556°) (was: 90°, 0.500) |
+| open | 180°, `.openFlat` | FoldingDual | inner | 3 / 2 | off / on | 180°, `.openFlat`, FoldingDual, `bringup`, 3 / 2, off / on; screenshot 2034×1398 lit; after book and after closed (2026-10-30) — **match** |
+
+Content mode: 1 disabled, 2 primary, 3 auxiliary. The CA display state is
+1 / 0 when closed and 0 / 1 when open, and both panels keep power state 1.
+Book and open are identical across the display stack. They differ only in
+the scene region `innerCover` (active in book only) and in the hinge state.
+
+VM: the same history paths (after-open, after-closed, after-book, after a
+SpringBoard start) give the same rows. There is no `CADisplayStateControl` on
+the VM; the window server shows cover `LCD` enabled and unblanked in every
+awake posture and the inner enabled when unfolded, blanked when closed
+(**differs**, Diff summary 5). Book and open differ only in `innerCover` and
+the hinge state on the VM too.
+
+2026-10-30: one exception seen once, outside the measured steps. After an
+unplanned SpringBoard restart had dropped the idle-timer assertion, the guest
+auto-locked in closed; an unfold then woke it to the lock screen and the
+resolver's prevailing policy read **`Yoink(inner)`** instead of FoldingDual in
+open and in the following book (`raw/vm/steps/discarded/fx-*-sb1064-autolock-on`).
+With the screen kept lit the same paths give FoldingDual. The sim has no
+reference for an unfold from a dark, locked cover.
+
+## Display identity
+
+| item | cover | inner | vphone-duo |
+|---|---|---|---|
+| CADisplay name / deviceName / displayId | LCD / primary / 1, `mainDisplay` | LCD-1 / primary-1 / 3 | cover LCD / primary / 1, `mainDisplay`; inner `VPhone Duo Inner` / `VPhone Duo Inner` / 7 — **differs** (unchanged on 2026-10-30; names owned by another session) |
+| CADisplay `tag` | 0 | 65536 | 0 / 65536 — **match** |
+| native size, scale, refresh | 1398×2034 @3, 60 Hz, P3 | 2007×2853 @3, 60 Hz | cover 1398×2034 @3, **120 Hz**, P3; inner FBS current/preferred mode 669×951@3x (2007×2853/3), UIScreen currentMode 2007×2853, scale 3, **120 Hz**, **sRGB**; FBS/UIScreen still add a 951×669@3x (2853×2007) mode; CADisplay currentMode 2853×2007 — **differs** (refresh, gamut, extra mode) (was: inner 2853×2007, pointScale 1, 60 Hz, extra 951×669 mode at /2) |
+| CAWindowServerDisplay orientation | rot0 / portrait | rot90 / landscapeLeft, from boot | cover rot0 / portrait; inner rot90 / landscapeLeft from SpringBoard start — **match** |
+| `extendedProperties` | DisplayRotation 0, DeviceSurfaceType 1, corners 8,8,59,59 | DisplayRotation 270, DeviceSurfaceType 2, corners 55×4 | cover DisplayRotation 0, DeviceSurfaceType 1, kMGQDeviceSurfaceType 1, DisplayScale 3, ChromeIdentifier `…chrome.phone15`, FramebufferIdentifier `1C896A2B-…`, corners **5,5,59,59**; inner DisplayRotation 270, DeviceSurfaceType 2, kMGQDeviceSurfaceType 2, DisplayScale 3, `…chrome.phone14`, `BF0DC480-…`, corners 55×4 — equal to the sim's dictionaries key by key except the cover corners — **differs** (cover corner radii only: Apple's device tree vs the sim device type) (was: `{DeviceSurfaceType 1}` / `{DeviceSurfaceType 2}` only) |
+| `BKSDisplayService traitsForDisplayUUID:` surfaceType | 1 | 2 | inner 2 (also on 2026-10-30); cover not queried (its `UIScreen._displayID` is nil, so the probe has no cover UUID) — **match** (inner), cover n/a |
+| UIScreen | index 0, `Main`, 466×678, `_isMainScreen` YES | index 1, `Unknown.main[3]`, `_isMainScreen` NO, `_isEmbeddedScreen` YES | cover index 0, `Main`, 466×678, YES; inner index 1, `Unknown[7]`, `_isMainScreen` NO, **`_isEmbeddedScreen` NO**, `_isMainLikeScreen` NO, corner radius 0, sRGB — **differs** (unchanged on 2026-10-30) |
+| FBSDisplayIdentity | type 0, isMain, isMainRoot, isRoot | type 7, displayID 3, isRoot, UIKitMainLike, alwaysConnected | cover type 0, isMain, isMainRoot, isRoot; inner type 7, **displayID 7**, isRoot, **not UIKitMainLike**, alwaysConnected — **differs** (unchanged on 2026-10-30) |
+| FBS config name / bounds | Main / 466×678 | Unknown / 669×951 (never rotates) | Main / 466×678; Unknown / 669×951, unchanged through all four inner orientations — **match** |
+| `_exclusionArea` | {399,30,37,37} | the same {399,30,37,37}, copied from the cover | {399,30,37,37} on both — **match** |
+| pixelsPerInch | 316×669 | 324×654 | cover 460×460; inner CADisplay 460×460, FBS `pixelDensity` 460×460; physical size cover 4.4217×3.0391 in, inner 6.2022×4.3630 in (the sim's 3.0391×4.4217 and 4.3630×6.2022 with the axes swapped; the sim's ppi divides the native pixels by those swapped axes) — **differs** (was: inner 0×0, `pixelDensity` nil, physical size 0) |
+| `sbh_screenType` | 31 | 32 | 31 / 32 — **match** |
+| digitizer | `CoreDevice touchscreen(<cover UUID>)`, main display digitizer | `CoreDevice touchscreen(<inner UUID>)` | one `Virtual USB Touch Screen` (USB, builtIn, authenticated) = `mainDisplayDigitizerService`, mapped to the inner UUID while unfolded and to the main display when closed — **differs** |
+
+CAWindowServer lists five displays: LCD, TVOut, LCD-1, Wireless, Resizable.
+VM: seven, `LCD`, `Wireless`, `Wireless-1`…`Wireless-4`, `VPhone Duo Inner` (no TVOut, no Resizable).
+
+## Orientation
+
+| item | sim | vphone-duo |
+|---|---|---|
+| inner interface orientation for device portrait / landscapeLeft / landscapeRight / upside-down | 4 / 1 / 2 / 3 | 4 / 1 / 2 / 3 (`display.rotation` 90 / 0 / 180 / 270 in open) — **match** |
+| inner accepts | all four orientations, home screen (mask 30) and apps | all four on the home screen, HomeScreen participant mask 30 — **match** |
+| cover with home screen or lock screen in front | stays portrait (participant mask 2), device orientation still changes | home screen stays portrait (mask 2): device 4, `systemArbitratedDeviceOrientation` 4, interface 1; vphoned reports "The device did not apply the requested rotation" — **match** |
+| cover with a landscape-capable app in front (Safari, VPAppKitProbe) | **goes landscape**: 678×466, size classes C/C, `statusBarFrame` 0×0 | Safari: 678×466, interface 4 (`display.rotation` 90) or 3 (270), C/C, `statusBarFrame` 0×0, safe area 0,0,34,84 / 0,84,34,0, SwitcherLiveOverlay mask 26 — **match**. The old note "VM refuses cover landscape outright" is corrected: only the home screen refuses, as in the sim |
+| cover, portrait-only app (Preferences) | stays portrait | stays portrait 466×678 with `UIDevice.orientation` 4 — **match** |
+| `UIDevice.orientation` | follows the lit panel; on the cover the name is the opposite of the requested one (landscapeLeft → 4) | follows the lit panel (open: 3 for landscapeLeft; closed: equals the cover's orientation) — **match**; the cover mapping is the next row |
+| per-panel pose orientation | landscapeLeft: cover 4 / inner 3; landscapeRight: cover 3 / inner 4 | 2026-10-30, through CoreMotion: open, `display.rotation` 0 → device 3, cover 4 / inner 3; 180 → device 4, cover 3 / inner 4 — **match**. **Closed with Safari on the cover**: `display.rotation` 90 → device 4, **cover 4**, inner 1 (`cmMagicPose` 4 / 4 / 0); 270 → device 3, **cover 3**, inner 1 (`cmMagicPose` 3 / 3 / 0); Safari interface 4 / 3, 678×466 — **differs (sim synthetic)**: CoreMotion's own table (the "propertyA table" row, identical in the sim) maps a closed hinge to the cover unchanged, so the VM value is CoreMotion's and the sim's cover 3 for device 4 comes from its swap tool. Upside-down not measured (the host controls have no upside-down orientation) (was: the same cover values from the override) |
+
+## History-dependent values
+
+| item | sim | vphone-duo |
+|---|---|---|
+| inner UIScreen bounds | 669×951, orientation 0, size classes 0/0 at boot; afterwards it follows the inner's orientation (951×669 for 3/4) | 669×951 at boot (observed before this run); 951×669 at orientation 4 or 3, 669×951 at 1 or 2, Regular/Regular after an unfold — **match** (boot size classes not measured) |
+| inner `SBWindowScene.interfaceOrientation` | 1 from boot until the first rotation reaches the inner panel, then 4 in portrait | 1 from SpringBoard start (two starts: pid 1440, 2384) through every fold and unfold, then 1/2/3/4 with the rotations and 4 in portrait — **match** |
+| cover UIScreen after a landscape app | keeps 678×466 while the inner is in use | cover rotated with Safari, then unfolded: 678×466, orientation 4, also after the inner returned to portrait — **match** |
+| resolver `_preferredTransitionStyle` | `.fade` until the first swap, then `.continuousLive` (`.continuousSnapshot` with Safari) | 2026-10-30, after a forced respring in closed: **2** before any swap (sim 1), then 2 after every fold and unfold (book, open, closed, both history orders, and after rotations), 3 with Safari in front (closed landscape, book, open) — **differs** at the start only (was: 0 after a SpringBoard start; 1 after the first fold; 2 after book→open; 1 or 3 with Safari/Preferences by path) |
+| app client orientation | 1 if launched on the cover and then unfolded; 4 if launched on the inner, and stays 4 after folding | Safari and Preferences launched on the cover, unfolded: 1; Preferences launched on the inner: 4, still 4 on the cover after folding — **match** |
+| hinge regions (hysteresis) | closed region 0→0.47 at boot, 0→0.28 after book, 0→0.11 after a fold | 2026-10-30: 0→0.47 after a SpringBoard start (closed), after open and after every fold; **0→0.2747** after book (toClosed 0.5525→0.03, partiallyOpen 0.2747→0.97), from the 99.444° angle — **match** within the angle residual (sim 0→0.2761, toClosed 0.5556→0.03) (was: 0→0.25, toClosed 0.50→0.03). The sim's own `springboard.json` also reads 0→0.47 after folds; 0→0.11 is from `sensors.md` |
+
+## Hinge, pose and identity
+
+| item | sim | vphone-duo |
+|---|---|---|
+| hinge HID service | `CoreMotion_DeviceStateRelay_Crane`, 0xFF0C/0x21 (sibling `_DeviceState` 0xFF0C/0x22), frozen at boot values | 2026-10-30 (vphoned `device.input_devices`): `CoreMotion_DeviceStateRelay_Crane` 0xFF0C/0x21 and `CoreMotion_DeviceStateRelay_DeviceState` 0xFF0C/0x22, Transport Virtual, published by locationd's relay, plus the feed `VPhone Host Controls` 0xFF61/0x5B (Virtual, from libvphonehinge in backboardd); values live, not frozen — **match** (names, usages, transport). `systemEventOfType:0x2c` not re-read: the backboardd probe that reads it wedged locationd's relay (`vm-notes.md`) (was: one unnamed Virtual 0xFF0C/0x21, no 0x22 sibling) |
+| CoreMotion device state | frozen at boot: the sim fold bypasses HID and CoreMotion and writes into `SBFDevicePoseProvider` | 2026-10-30: `+isAvailable` YES for `CMDeviceStateManager`, `CMMagicPoseManager`, `CMAngleManager` (SpringBoard and Safari); the provider's `_cmMagicPoseManager` (registered, client and internal handlers set) and `_cmAngleManager` (`isAngleActive` YES, interval 0.01) are CoreMotion objects as in the sim; `_accelerometer` nil (sim nil); `currentDeviceState` live (open: propertyA 1, propertyB 3); `cmMagicPose` follows the hinge (1 / 2 / 3), the sim's stays at boot values; `internal.isOnVM` still YES — **match** (was: `+isAvailable` NO, managers nil, pose from vphoned's override) |
+| `CMMagicPoseManager sharedManager` | non-nil | 2026-10-30: non-nil, its `_manager` a `CMDeviceStateManager` with no handlers, and not the provider's instance (`isSharedManager` NO, as in the sim) — **match** (was: nil, `+isAvailable` NO). `+orientationForMagicPose:deviceSurface:` is CoreMotion's own class method and runs normally (next row) |
+| `orientationForMagicPose:deviceSurface:` | equals `propertyAForConfigType:surface propertyA:orientation propertyB:hinge propertyC:tabletop` for every input | identical to the sim on all 896 sim inputs; tabletop 0..11 probed — **match** |
+| propertyA table, tabletop 0 | surface 1: hinge 1 → identity, hinge 2/3 → 0,1,2,4,3,6,5,0; surface 2: hinge 1 → 0, hinge 2/3 → 0,1,2,3,4,5,6,0; hinge 0/4/5/6 → 0 | identical on all 1120 sim inputs — **match** |
+| propertyA, tabletop 1..10 with hinge 2/3 | constants (surface 1: 3,4,1,2,6,3,4,5,6,1; surface 2: 0,0, then 1,2,3,4,6,6,5,1) | surface 1: 3,4,1,2,6,3,4,5,6,1; surface 2: 0,0,1,2,3,4,6,6,5,1 — **match** (corrects "FoldDisplay does not model tabletop": the table is CoreMotion's) |
+| propertyA, A=7 with hinge 2/3 | 0 | 0 — **match** (corrects "not covered") |
+| hinge enums | SpringBoard `uiHingeStatus` 1/2/3; app `_UIHingeState` 1/3/4; public `UIHinge` status 1/2/3, angle in radians | 2026-10-30: `uiHingeStatus` 1/2/3 (angle 0 / 99.444 / 180); Safari `_UIHingeState` closed / partiallyOpen (99.4) / openFlat (180), scene `_UISceneHingeState` closed / partiallyOpen / fullyOpen — **match** (was: angle 90 in book); public `UIHingeInteraction` not measured (VPAppKitProbe not installed) — n/a |
+| hinge state delivery | only to scenes whose client sets `wantsSceneHingeState`; `FBSSceneSettings.hingeAngle/hingeStatus/magicPose` stay 0 | 2026-10-30: Safari (`wantsSceneHingeState` YES) gets it closed / book / open; `FBSSceneSettings.hingeAngle` and `hingeStatus` 0 — **match**; Preferences (nil in the first pass) not re-measured |
+| MobileGestalt identity | iPhone19,4, DeviceClass iPhone, A3447, "iPhone Duo", HomeButtonType 2, DeviceCornerRadius 59, DynamicIsland, AlwaysOnDisplay, EnhancedMultitasking false | iPhone19,4, iPhone, **VM0001** (RegulatoryModelNumber nil), "iPhone Duo", 2, 59, DynamicIsland YES, **AlwaysOnDisplay NO**, EnhancedMultitasking NO; HWModelStr V68AP (sim iPhone19,4) — **differs** (re-read on 2026-10-30: unchanged) |
+| MobileGestalt screen | main-screen 1398×2034 @3, pitch 460 (the cover); `DisplayExtendedProperties` has 2 entries; logical display count 2 | 2026-10-30: 1398×2034 @3, pitch 460; `DisplayExtendedProperties` 2 entries, equal to the sim's except the cover's `DeviceCornerRadius` [5,5,59,59] (sim [8,8,59,59]); `MGGetLogicalDeviceDisplayCount` 2 — **differs** (cover corner radii only) (was: `DisplayExtendedProperties` nil, count 1) |
+| UIDevice | no hinge, tabletop, fold or posture getter exists | none exists — **match** |
+
+## What an app sees
+
+| item | closed (cover) | book / open (inner) | vphone-duo |
+|---|---|---|---|
+| `[UIScreen mainScreen]` | cover | cover | cover (`screens[0] LCD Main`) in every posture; 2026-10-30, Safari closed / book / open: the same — **match** |
+| `[UIScreen screens]` count | 1 | 2 (the inner connects and disconnects with the fold) | 1 / 2; 2026-10-30 Safari: 1 / 2 / 2 — **match** |
+| scene bounds | 466×678 | 951×669 | 466×678 / 951×669 (Safari and Preferences); 2026-10-30 Safari: 466×678 / 951×669 / 951×669 — **match** |
+| size classes | C/R | R/R | C/R / R/R; 2026-10-30 Safari: C/R / R/R / R/R — **match** |
+| interface orientation (device portrait) | portrait | landscapeRight (4) | 1 / 4; 2026-10-30 Safari: 1 / 4 / 4 — **match** |
+| safe area t,l,b,r | 0,0,34,84 (right status column) | 0,0,34,84; Safari 82,0,34,0 | 0,0,34,84 / 0,0,34,84; Safari 82,0,34,0; 2026-10-30 Safari: the same — **match** |
+| idiom | Phone | Phone | Phone (0) — **match** |
+| scene `cornerRadiusConfiguration` | 8,8,59,59 | 55×4 | 8,8,59,59 / 55×4; 2026-10-30 Safari: the same (the scene keeps 8,8,59,59 although `extendedProperties` now say 5,5,59,59) — **match** |
+| `ssk_surfaceType` | 1 | 2 (4 during launch) | 1 / 2 (no launch-time capture); 2026-10-30 Safari: 1 / 2 / 2 — **match** |
+| scene regions | | `fold` {0,455.5,669,40}, `innerCover` active in book only, `statusBarOcclusion` {0,0,124,84} | cover: cover, coverCamera, statusBarOcclusion; inner: innerCover, innerRear, inner, fold {0,455.5,669,40} margins 20, innerCamera, statusBarOcclusion; `innerCover` active YES in book, NO in open; 2026-10-30 Safari: closed cover, coverCamera, statusBarOcclusion active; book innerCover, innerRear, inner, fold active; open innerCover, innerRear, fold inactive — **match** |
+| Preferences split column | compact | 475.67 in book (sidebar ends at the fold), 320 in open | collapsed (466) / 475.67 in book, 320 in open — **match** |
+
+Migration moves the existing scene: same `UIWindowScene`, same persistent
+identifier, foregroundActive throughout, with no lifecycle callbacks.
+- Unfold: hinge 2, then about 110 ms later `UIScreenDidConnect` → one
+ `didUpdateEffectiveGeometry:` → trait C→R.
+- Fold: hinge 1, then about 70 ms later trait R→C → geometry → `UIScreenDidDisconnect`.
+
+VM: the callback sequence was not measured (it needs VPAppKitProbe). In the
+app the inner screen's identity is `Unknown.main[7]` and its `_name` is
+`VPhone Duo Inner`.
+
+## System chrome (points)
+
+| item | cover | inner, landscape-shaped (orientation 4/3) | inner, portrait-shaped (1/2) | vphone-duo |
+|---|---|---|---|---|
+| status bar class | `…AxisAlignableSplitV68Cover` | `…AxisAlignableSplit2007` | same | the same classes — **match** |
+| status bar frame | right column {389,0,77,678} | `statusBarFrame` 0-rect; foreground 88×123.67 top right | {592,0,77,951} | cover {389,0,77,678}; inner landscape 0-rect — **match**; 2026-10-30 inner portrait-shaped (interface orientation 1, `display.rotation` 0): **{592,0,77,951}**, wrapper height 77, in both captures (25 s after the rotation, and after a round trip through orientation 2) — **match** (was: 0-rect, one capture). At orientation 1 straight after a SpringBoard start, before any rotation, it is 0-rect, as in the sim's `open-after-closed` and first `open-landscapeLeft` runs |
+| icon grid | 4×6, 60×60 icons, label 12 pt, spacing 28×38.8 | 4×6, list 324 wide at x=470 (open) / 512.67 (book) | 4×6 over 669×951 | cover spacing 28×38.8, list 466×678; inner list 324×669 at x=470 (open) / 512.67 (book), spacing 28×38; portrait-shaped list 669×951 — **match** |
+| dock | right side column {376.17,45,84,678}, capacity 1×4 | right side column {861.17,45,84,669} | bottom dock {0,851,669,100} | {376.17,45,84,678}; {861.17,45,84,669}; {0,851,669,100} — **match** (the VM dock holds 4 icons, the sim 1) |
+| quick action button | 84×84 at {376,573} | 84×84 at {861,564} | 84×84 at {579,846} | 84×84 at {376,573}, {861,564}, {579,846} — **match**; the VM shows them (hidden NO) with the real torch and camera glyphs (28.33×22 and 17.33×30.67 in the 48-point icon area), the sim hides them with a placeholder |
+| notification platter width | 350 (list 370 at boot, 378 after open) | open 450 (list 478, centred); book 350 (list 378, right half) | 450 | no notifications on the VM (no `simctl push`) — n/a |
+| clock frame | 372×132.26 at {11,47} | open 400×132.26 at {275.5,51.67}; book x=487.25 | | cover 372×240.28 at {11,47}; inner open 400×232.16 at {275.5,51.67} (2026-10-30; first pass 235.61) — **personalization (poster: VM `com.apple.MercuryPoster` `v68.colorB`, sim `celosia.timeOfDay`)**. The height follows the poster's adaptive time: `adaptiveTimeTextHeight` 213.01 (sim 105), time font `.SFAdaptiveSoftNumeric` weight `wght3200000` at 128.77 pt (sim `wght2800000` at 110.03 pt), `intrinsicContentSize` 272×244.67 (sim 196.67×131.67); the limits are the same (`minimum`/`maximumAdaptiveTimeTextHeight` 104.74 / 303.68), as are `titleContentStyle` (vibrant material) and the glass renderer. Screenshots: `raw/vm/steps/fx-closed-lockscreen/shot.jpg` (photo poster, tall time) against `raw/chrome/shots/closed-after-open-lock-d1.png` (abstract time-of-day poster) |
+| wallpaper window | | portrait-anchored 669×951 while the other windows are 951×669 | | cover 466×678; inner 669×951 while the other inner windows are 951×669 — **match** |
+
+Quick action glyph: button 84, icon area 48 (insets 18), glyph view 27×25,
+image 19.33×18. Glyph/button is 0.321 × 0.298. The sim hides the quick action
+buttons and shows the placeholder symbol `questionmark.app`, so this does not
+measure the flashlight or camera glyph. The VM's 0.68 glyph scale has no
+direct sim reference.
+
+## Power and auto-lock
+
+| item | sim | vphone-duo |
+|---|---|---|
+| auto-lock default | off (`SBDisableAutoDim` assertion); real timer dim 40 s, lock 60 s | on: Auto-Lock 60 s, `SBBacklightIdleTimer` warn 40 s, total 60 s, no disable assertion — **differs** (configuration) |
+| auto-lock in book/open | inner goes always-on dimmed and stays primary | measured in open: inner stays primary but goes **off** (backlight 4, not 3), both panels off, screenshot black, window server blanks both — **differs** (no AOD) |
+| fold after auto-lock | FullyClosed; the cover becomes primary, always-on dimmed, lock screen; inner off | FullyClosed, cover primary on the lock screen but **off** (4), inner off (4) and blanked; still so 20 s later; screenshot black — **differs** (no AOD). Corrected: the folded inner does **not** light |
+| fold right after a lock-button press | the cover turns fully on | cover on (1), lock screen, inner off; screenshot lit — **match** |
+
+## Limits
+
+- The sim fold does not go through HID or CoreMotion, so the VM's
+ HID → CoreMotion → pose provider path has no reference. Only values from
+ `SBFDevicePoseProvider` onward compare.
+- Values with `sim_note` (host Mac model, memory, CPU, `IsSimulator`, the
+ `SIMULATOR_*` environment) do not exist on the VM.
+- `posture.zsh`'s 3 s readback during a 180° inner rotation once crashed
+ SpringBoard mid-animation (`_SBSystemApertureContainerViewRotatingContentView setTransform:`).
+ Use a longer settle for rotations.
+- Known harness defects, worked around but not fixed in `tools/`:
+ - `POSTURE_OUT` defaults to the shared `raw/posture`.
+ - `smoke.zsh` labels interface orientations 3 and 4 with device-orientation names.
+ - `posture.zsh unlock` releases the testing lock, not the device lock screen.
+ - `sim.zsh pid` fails while lldb is attached.
+- VM side: see `vm-notes.md` for the lldb traps (EXC_GUARD from more than one cast
+ `objc_msgSend` per expression, garbage `strcmp`/`strncmp`, unlowered PAuth_LR code) and
+ the getters skipped on the VM.
+- 2026-10-30, bundle 2.14.0-local.9064efca: do not run `probes/vm-sensors-backboardd.lldb`
+ (an `IOHIDServiceCopyProperty` walk from backboardd's main thread). With the CoreMotion
+ relay present it was interrupted and left the relay wedged until locationd was restarted,
+ which restarted backboardd and SpringBoard too. Read the service list with vphoned's
+ `device.input_devices` instead (`vm-notes.md`, "Incident 1").
diff --git a/Research/Guest/Evidence/duo-sim-baseline/README.md b/Research/Guest/Evidence/duo-sim-baseline/README.md
new file mode 100644
index 00000000..4d72fcde
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/README.md
@@ -0,0 +1,338 @@
+# iPhone Duo simulator baseline harness
+
+Shared tooling for recording what Apple's own iPhone Duo simulator returns from
+public and private APIs in each fold posture, so vphone-duo (iPhone19,4, iOS 27.1
+24A94425 in a Virtualization.framework VM) can be compared against it.
+
+**In the repository:** the tables (`BASELINE.md`, `<domain>.md`, `vm-notes.md`),
+`tools/`, `probes/` and `smoke.json`. The per-domain record files
+(`<domain>.json`, `vm-<domain>.json`, 2–63 MB each) and the transcripts and
+screenshots under `raw/` (about 1 GB) are not committed; rerunning the probes
+recreates them. Paths to them in these notes refer to that local output.
+
+- Xcode 27.1 (27A9275), runtime iOS 27.1 (24A94425), device type
+ `com.apple.CoreSimulator.SimDeviceType.iPhone-Duo` (iPhone19,4).
+- Harness simulator: **`duo-baseline-harness`, UDID `D13582ED-1932-4E12-800F-A44CFE16EA8E`**
+ (left shut down; clone it with `tools/sim.zsh clone`). Locale is zh-Hans, so
+ screenshots show Chinese UI.
+- Never boot, erase or delete the two pre-existing "iPhone Duo" devices
+ (`B738069B-…`, `4D48BBE9-…`). `sim.zsh` refuses to boot or shut them down.
+
+| Path | What |
+| --- | --- |
+| `tools/sim.zsh` | create / clone / boot / shutdown, UDID and pid lookup, runtime root, screenshots, lit/dark check |
+| `tools/probe.zsh` | attach lldb to one sim process, run a command file, detach, save a cleaned transcript |
+| `tools/prelude.lldb` | sourced before every probe: `thread select 1`, `@import Foundation/UIKit/ObjectiveC/Darwin` |
+| `tools/posture.zsh` | drive closed / book / open / an angle, then verify with screenshots and a SpringBoard readback |
+| `tools/smoke.zsh` | the end-to-end smoke run that produced `smoke.json` |
+| `probes/smoke-springboard.lldb` | the smoke probe; also the template for a probe that emits records |
+| `smoke.json` | smoke result (60 records, 3 postures) |
+| `raw/smoke/` | smoke transcripts and screenshots |
+| `raw/posture/` | posture-driver runs, including the hysteresis evidence below |
+
+All tools are zsh; there is no Python. `jq` is `/opt/homebrew/bin/jq`.
+
+## Quick start
+
+```sh
+cd Research/Guest/Evidence/duo-sim-baseline
+tools/sim.zsh boot duo-baseline-harness # boots, waits, prints the UDID
+tools/posture.zsh duo-baseline-harness book # → JSON, exit 0 when verified
+tools/probe.zsh duo-baseline-harness SpringBoard my-probe.lldb raw/<domain>/book-springboard.txt
+tools/sim.zsh shutdown duo-baseline-harness
+```
+
+For your own simulator: `tools/sim.zsh clone duo-baseline-harness duo-baseline-<you>`
+(the source must be shut down), then use that name everywhere.
+
+## sim.zsh
+
+```
+sim.zsh create [name] iPhone Duo / iOS 27.1, prints the UDID
+sim.zsh clone <src> <new-name>
+sim.zsh boot <name|udid> boot + bootstatus -b
+sim.zsh shutdown <name|udid>
+sim.zsh udid <name|udid>
+sim.zsh pid <name|udid> <process> SpringBoard, backboardd, Preferences, MobileSafari, …
+sim.zsh ps <name|udid> every process of that sim (children of its launchd_sim)
+sim.zsh runtime-root mounted RuntimeRoot (only while a 27.1 sim is booted)
+sim.zsh shared-cache …/System/Library/Caches/com.apple.dyld/dyld_sim_shared_cache_arm64
+sim.zsh shot <name|udid> <dir> <tag> <dir>/<tag>-d1.png (cover) and -d3.png (inner) + lit/dark
+sim.zsh lit <png> "lit|dark mean=… max=…"
+```
+
+`pid` matches the executable's basename among the children of the sim's own
+`launchd_sim`, so several booted sims never get mixed up.
+
+A panel that is not being driven captures as pure black (`max=0`); `lit` means
+some pixel of a 32×32 downscale exceeds 24. Display 1 captures 1398×2034
+(portrait); display 3 captures **2853×2007** (landscape — the panel's native
+rotation is 270).
+
+`simctl io screenshot` works headless on this host. (An older note in
+`Research/Guest/iphone_duo_bringup.md` says it captures black without
+Simulator.app; that is not the case for this runtime — a black capture means the
+panel is off.)
+
+## probe.zsh
+
+```
+probe.zsh <udid|name> <process|pid> <cmdfile|-> [out.txt]
+ PROBE_TIMEOUT=120 watchdog: SIGINT lldb, again after 10 s, SIGTERM after 10 more
+ PROBE_FULL_SYMBOLS=1 load all symbol tables up front (≈16 s/attach instead of ≈3 s)
+ PROBE_NO_PRELUDE=1 skip prelude.lldb
+```
+
+It runs `lldb --batch --no-lldbinit -p PID`, with `symbols.load-on-demand`
+on, sources `prelude.lldb` and then your file with stop-on-error **off**, then
+`process detach` and `quit`. Afterwards it checks the target: if it was left
+stopped (`T`) it gets `SIGCONT` and a warning; if it disappeared, a warning.
+With `out.txt` it writes the cleaned transcript there and lldb's untouched
+output to `out.raw.txt`; without, it prints the cleaned transcript. Cleaning
+keeps everything after your file's `command source` echo and drops lldb's
+chatter (attach banner, "Executing commands in", the Objective-C++ note,
+detach lines). Each `(lldb) expr …` echo stays as the delimiter for its result.
+Exit status 124 means the watchdog fired. An interrupted expression cancels the
+rest of the command file, and lldb still detaches (tested with an endless loop
+in Preferences: the app kept running).
+
+Avoid side effects in SpringBoard beyond what a probe needs: every probe stops
+the whole process for ~3 s.
+
+### Writing probes
+
+An expression can span lines: `expr -l objc -O --` alone on a line, the body,
+then an **empty line**. One-line `expr -l objc -O -- …` works too.
+
+Rules learned the hard way:
+
+- **Prefix locals** (`vpScreens`, `vi`): short names such as `names` or `m`
+ collide with symbols in the shared cache ("Multiple internal symbols found").
+- **Do not rely on lldb persistent `$variables`**. An `id $x` cannot be messaged
+ later ("no known method"), and after declaring a persistent struct variable
+ other `$variables` became "undeclared". Do the whole job inside one expression.
+- **Cast an `id` to `(NSObject *)` before `-description`** and similar NSObject
+ protocol methods (`[(NSObject *)[obj valueForKey:@"x"] description]`);
+ `[id description]` fails with "no known method".
+- **Non-object returns and struct arguments go through a cast `objc_msgSend`**:
+ `((long (*)(id, SEL, id))objc_msgSend)(obj, @selector(displayContentModeForWindowScene:), scene)`.
+- **C functions — exported or private, in the shared cache only — via `dlsym`**,
+ cast to their real signature:
+ `((id (*)(NSString *))dlsym(RTLD_DEFAULT, "MGCopyAnswer"))(@"ProductType")` → `iPhone19,4`.
+ Declare structs inline (`struct VPSwapSettings { … };`) when the function
+ takes or fills one; see `posture.zsh`.
+- **Classes that exist only in the shared cache** need no headers:
+ `NSClassFromString(@"SBDisplayToolService")`, then KVC (`valueForKey:` also
+ reads ivars such as `@"_displayToolService"`) or cast `objc_msgSend`. To read a
+ struct ivar: `class_getInstanceVariable` + `ivar_getOffset` on
+ `(__bridge void *)obj` (see the readback in `posture.zsh`).
+- **Never let a block escape the expression.** Blocks written in an expression
+ live in lldb's JIT memory; one stored by the target (a completion handler, an
+ observer) can outlive it. Pass `nil` completions; blocks used only inside the
+ expression (helpers like `vpAdd` in the smoke probe) are fine.
+- Discovery inside the target: `class_copyMethodList` / `class_copyIvarList` /
+ `objc_copyClassNamesForImage` / protocol conformance in an expression;
+ `image lookup -r -n <regex>` and `disassemble -n <symbol>` as plain lldb
+ commands. `ipsw class-dump <sim cache> <framework>` works for frameworks in the
+ sim cache, but `ipsw dyld disass` crashed on this cache (objc stub parsing),
+ and SpringBoard.framework is not in the cache — use lldb against the live
+ process for those.
+- **Emit records as JSON from inside the expression**: build an `NSArray` of
+ `NSDictionary`, end with
+ `[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:… options:0 error:nil] encoding:NSUTF8StringEncoding]`;
+ `-O` prints it as one line that `jq` takes as is (`probes/smoke-springboard.lldb`).
+
+### Probing an app
+
+```sh
+xcrun simctl launch D13582ED-1932-4E12-800F-A44CFE16EA8E com.apple.Preferences # prints "com.apple.Preferences: <pid>"
+tools/probe.zsh duo-baseline-harness Preferences my-probe.lldb out.txt # or pass the pid
+xcrun simctl launch D13582ED-1932-4E12-800F-A44CFE16EA8E com.apple.mobilesafari # process name MobileSafari
+```
+
+Probe apps the same way as SpringBoard; `[[UIApplication sharedApplication]
+connectedScenes]` there returns the app's own `UIWindowScene`. Daemons work too
+(backboardd: `tools/probe.zsh … backboardd …`); UIKit is not loaded there, so do
+not call UIKit in those probes. For a daemon that is not running yet, trigger it
+first (launch the client, or `xcrun simctl spawn <udid> launchctl kickstart …`).
+
+App-side hinge API seen in Preferences (for whoever takes that domain):
+`UIHingeInteraction` / `UIHingeInteractionUpdate`, `_UISceneHingeStateClientComponent
+-hingeState`, `_UIHingeState -hingeAngle`, and `UIApplication
+-currentHingePoseStateForTesting` / `-setHingePoseStateForTesting:`.
+
+## Posture: the mechanism
+
+**SpringBoard has a built-in display tool, and the harness calls it in-process.**
+SpringBoardFoundation in the sim shared cache embeds the help text of Apple's
+internal `suiatool` swap command
+(`[-duration=<seconds>] [-deviceOrientation=<orientation>] [-position=<closed|book|open|0.0-1.0>] [-fade | -continuous] [-wait]`,
+printed in full by `SBFDisplayToolSwapSettingsUsageDescription()`). The client is
+`SBSDisplayToolService` (SpringBoardServices) and talks over BSServiceConnection
+`com.apple.springboard.sbdisplay`. SpringBoard's server, `SBDisplayToolService`
+(held in `-[SpringBoard _displayToolService]`), checks the caller for the
+entitlement `com.apple.springboard.sbdisplay.service`, hops to the main queue,
+parses the options with `SBFDisplayToolSwapSettingsFromDictionary` and calls
+`-[SBDisplayToolServiceCoordinator performDisplaySwapWithSettings:completion:]`.
+No binary in the sim runtime carries that entitlement (and there is no
+`suiatool` binary), so `posture.zsh` skips the XPC front door and does in
+SpringBoard, over lldb, exactly what the server does after its entitlement check:
+
+```objc
+SBFDisplayToolSwapSettingsFromArguments(@[@"-position=book", …], &settings, &error); // BOOL, fills the struct
+[[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_swapCoordinator"]
+ performDisplaySwapWithSettings:settings completion:nil]; // BOOL: started
+// settings = {q state; d duration; q deviceOrientation; q profileOverride; B waitForCompletion;
+// q targetMode; d targetHingePosition; d lockedForTestingUntil}
+```
+
+The coordinator runs a synthetic hinge sweep and pushes it through
+`SBFDevicePoseProvider` (`_pushCurrentSettingsThroughPose:`), so the hinge state
+machine, `SBDisplayContentModeCoordinator` and `SBFDisplayContentModeResolver`
+resolve the displays the same way they would for real hinge motion. The device
+turns on and off panels and moves the foreground app between them. `targetMode`
+1 means an absolute position: closed 0.0, book 0.5556 (100°), open 1.0 (180°).
+Each swap takes a 10-second testing lock (`lockForTesting`) so real hinge input is
+ignored; `posture.zsh … unlock` releases it early. In the sim the state persists
+after the lock expires (checked 30 s after the swap: unchanged).
+
+`posture.zsh` then waits until the coordinator is idle (`_currentSettings.state
+== 0`, no instant swap or replay running), reads SpringBoard once (the resolver
+description, which includes the pose provider's), screenshots both displays,
+and prints one JSON object. Exit 0 means the lit panel matches the posture
+(closed → cover, book/open → inner), 3 a mismatch.
+
+```
+posture.zsh <udid|name> closed|book|open [-duration=<s>] [-fade|-continuous] [-deviceOrientation=<o>]
+posture.zsh <udid|name> angle <degrees> [same options] # position = degrees / 180
+posture.zsh <udid|name> status # readback + screenshots only
+posture.zsh <udid|name> unlock # release the testing lock
+ POSTURE_OUT=dir artifacts (default raw/posture)
+ POSTURE_SETTLE=3 seconds before the first readback
+ POSTURE_ANCHOR=closed|open|none
+```
+
+### Results (smoke run, `raw/smoke/`)
+
+| posture | hinge state (pose provider) | prevailing policy | primary on | inner applied | cover applied | display 1 | display 3 |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| closed | `.closed`, 0.000 (0°) | FullyClosed | cover | disabled | primaryContent | lit | dark |
+| book | `.partiallyOpen`, 0.556 (100°) | FoldingDual | inner | primaryContent | auxiliaryContent | dark | lit |
+| open | `.openFlat`, 1.000 (180°) | FoldingDual | inner | primaryContent | auxiliaryContent | dark | lit |
+
+Screenshots: `raw/smoke/20261029-134407-closed-d{1,3}.png`,
+`20261029-134427-book-d{1,3}.png`, `20261029-134502-open-d{1,3}.png`; readbacks
+in the matching `-readback.txt`; posture JSON in the matching `.json` and in
+`smoke.json` `meta.postures`. Preferences was in the foreground: closed shows its
+compact layout on the cover, book and open show the split layout on the inner.
+
+`-[SBDisplayContentModeCoordinator displayContentModeForWindowScene:]` returns
+1 = disabled, 2 = primaryContent, 3 = auxiliaryContent (matched against the
+resolver's names). The cover's scene is `SB-main` (display identity `Main`),
+the inner's is `com.apple.springboard.bringup` (`Unknown.main[3]`).
+`primaryWindowScene` and `activeWindowScene` follow the posture. Resolver
+policies listed: Single, FoldingDual, Yoink, Tent, FullyClosed,
+ForceCoverDisplayEnabledOnly; preferred transition style `.continuousLive`.
+
+### Hysteresis — why `book` anchors at closed
+
+The hinge regions move with where the hinge last stopped
+(`raw/posture/*-readback.txt`):
+
+- At rest at 0°: `closed 0.00→0.47`, `partiallyOpen 0.47→0.97` — a sweep to 100° swaps to the inner.
+- Closed at 0° → `angle 60`: stays `.closed` on the cover; regions become `closed 0.00→0.63`, `toOpen 0.33→0.97`.
+- Then `book` without an anchor (`20261029-134037-book.json`): 100° < 113°, so it stays `.closed` on the cover — the run that failed verification.
+- `book` → `angle 60` stays `.partiallyOpen` on the inner (`toClosed` needs more).
+
+So `posture.zsh book` first does an instant swap to closed (`-duration=0`,
+artifacts under `<out>/anchor/`) and then sweeps 0° → 100°, which is the
+"book from closed swaps cover to inner" case in Apple's help text. A sweep from
+open to book also lands on `.partiallyOpen`/inner (checked). `closed` and `open`
+are the ends of the range and need no anchor; `angle` sweeps from wherever the
+hinge is unless `POSTURE_ANCHOR` says otherwise — record the starting posture
+with any angle result.
+
+### Other mechanisms, not used
+
+- `-[SBDisplayToolServiceCoordinator performHingeReplayWithSettings:samplesPath:completion:]`
+ replays loops of the recorded `hinge-samples.csv` (SBFHingeReplaySettings,
+ `-mode=swap|party -loop= -band=fast|medium|slow …`). It is for motion studies,
+ not for landing in a posture; reachable the same way if a later agent needs
+ realistic sweeps.
+- Hinge-angle HID events into the sim's backboardd (the VM's Hinge dylib path)
+ were not tried: the display tool already exercises SpringBoard's resolver path
+ with Apple's own sweep, and the sim's CoreSimulator side offers no hinge HID
+ service (`simctl io enumerate` lists none).
+- Xcode/CoreSimulator: no fold control found (no Simulator.app on this host;
+ DeviceKit has no hinge strings; `simctl` has no posture subcommand).
+
+## Limits
+
+- **CoreMotion is not driven.** The sweep lives in SpringBoard's
+ `SBFDevicePoseProvider`. `CMAngleManager +isAvailable` is YES (range 0–180°) and
+ SpringBoard's `_cmAngleManager` reports `isAngleActive` YES, and
+ `CMMagicPoseManager +isAvailable` is YES, but nothing here makes locationd's
+ angle stream or magic pose follow the posture. Treat app-side CMAngleManager /
+ CMMagicPoseManager / CoreDevice hinge values as unverified until a probe shows
+ them changing. Likewise backboardd sees no hinge HID event.
+- **What reaches apps is unverified.** Preferences moves between panels, but
+ whether `UIHingeInteraction` / `_UISceneHingeStateClientComponent` report the
+ posture in an app is for the app-side domain to establish.
+- Every probe stops the target for ~3 s; a swap started by a probe begins only
+ after lldb detaches.
+- SpringBoard's `[UIScreen mainScreen]` is the cover (`Main`, "LCD") in every
+ posture. The inner `UIScreen` ("LCD-1") reported bounds 669×951 right after
+ boot and **951×669 after the first unfold**, and stayed 951×669 in all later
+ postures, closed included. Record the posture history with any inner-screen
+ value.
+- Only portrait device orientation was exercised (`Device: portrait (1)`;
+ `interfaceOrientation` 1 in every record). `-deviceOrientation=` is accepted by
+ the swap.
+
+## Record format
+
+One JSON file per domain (`<domain>.json`, e.g. `screens.json`, `mobilegestalt.json`),
+raw transcripts under `raw/<domain>/`:
+
+```json
+{
+ "meta": {
+ "domain": "screens",
+ "runtime": {"identifier": "com.apple.CoreSimulator.SimRuntime.iOS-27-1", "version": "27.1", "buildversion": "24A94425"},
+ "device": {"name": "duo-baseline-harness", "udid": "D13582ED-…", "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-Duo"},
+ "xcode": "Xcode 27.1 Build version 27A9275",
+ "host": "27.0.1 Apple M5 Pro",
+ "date": "2026-10-29T05:44:07Z",
+ "postures": [ /* the posture.zsh JSON for each posture used */ ]
+ },
+ "records": [
+ {
+ "api": "UIScreen.nativeBounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].nativeBounds",
+ "value": {"x": 0, "y": 0, "width": 2007, "height": 2853},
+ "error": null
+ }
+ ]
+}
+```
+
+- `api`: stable `Class.member` or function name — the join key with vphone-duo.
+- `kind`: `public` (SDK headers) or `private`.
+- `process`: executable name the call ran in (`SpringBoard`, `backboardd`, `Preferences`, …).
+- `posture`: `closed` | `book` | `open` | `angle<deg>` as passed to `posture.zsh`
+ (add the starting posture in `call` or `meta` for angles).
+- `orientation`: `portrait` | `portraitUpsideDown` | `landscapeLeft` |
+ `landscapeRight` — the interface orientation of the scene the call ran under
+ (SpringBoard: the primary window scene).
+- `call`: the exact expression, enough to re-run it.
+- `value`: JSON — numbers and booleans as such, `CGRect` as `{x, y, width, height}`,
+ `CGSize` as `{width, height}`, objects as their `description` string, `null`
+ when there is none.
+- `error`: `null`, or the error / exception / lldb error text (then `value` is `null`).
+
+`smoke.json` is in this format; `tools/smoke.zsh` shows how a probe's JSON line is
+tagged with process, posture and orientation and merged with `meta`.
diff --git a/Research/Guest/Evidence/duo-sim-baseline/appkit.md b/Research/Guest/Evidence/duo-sim-baseline/appkit.md
new file mode 100644
index 00000000..1956d1ee
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/appkit.md
@@ -0,0 +1,163 @@
+# appkit: what an app sees on the iPhone Duo simulator
+
+Domain notes for `appkit.json` (20 829 records, 54 posture runs). Simulator
+`duo-baseline-appkit` (E5E4D334-6E6E-4021-A3A4-DA0A743C8B64), iOS 27.1 24A94425,
+Xcode 27.1. All values are as observed; enums are listed in `appkit.json` `meta.enums`.
+
+## Files
+
+| Path | What |
+| --- | --- |
+| `appkit.json` | all records, README format plus `scenario`, `device_orientation_requested`, `transcript` |
+| `probes/appkit-scenes.lldb` | the probe: process, screens, every connected scene, its FBSScene settings and client settings, trait collection, status bar, every window, root view controller, view-controller tree with split state |
+| `probes/appkit-introspect.lldb`, `probes/appkit-hinge-classes.lldb` | getter enumeration (`class_copyMethodList` / properties / ivars) used to choose the getters; output in `raw/appkit/introspect-*.txt` |
+| `probes/appkit-run.zsh` | driver: posture, launch, probe, screenshots, callback log per state |
+| `probes/appkit-merge.zsh` | builds `appkit.json` from `raw/appkit/<app>/<scenario>/records.jsonl` |
+| `raw/appkit/probe-app/` | VPAppKitProbe source (`main.m`, `Info.plist`, `build.zsh`) |
+| `raw/appkit/<app>/<scenario>/` | per state `NN-<label>.txt` (transcript), `.json` (probe output), `.posture.json`, `shots/NN-<label>-d{1,3}.png`, `posture/` (posture.zsh artifacts), `events.jsonl` (VPAppKitProbe callback log) |
+
+Apps: Preferences (SwiftUI `SettingsNavigationSplitView`), MobileSafari, and
+VPAppKitProbe, a minimal ObjC UIKit app built for this run (all four orientations in
+Info.plist, one window scene, `UIDeviceFamily` 1, a `UIHingeInteraction` on its root view)
+that logs every scene, geometry, trait, screen and hinge callback. No Notes / Calendar
+exists in this runtime (`simctl listapps`).
+
+## Per app, portrait device orientation
+
+Columns: screen the scene is on, `effectiveGeometry.coordinateSpace.bounds`,
+horizontal/vertical size class, interface orientation, window `safeAreaInsets`
+(top,left,bottom,right).
+
+| app | posture | screen | scene bounds | size classes | orientation | safe area |
+| --- | --- | --- | --- | --- | --- | --- |
+| VPAppKitProbe | closed | screens[0] LCD Main | 466×678 | C/R | portrait | 0,0,34,84 |
+| VPAppKitProbe | book, open | screens[1] LCD-1 Unknown.main[3] | 951×669 | R/R | landscapeRight | 0,0,34,84 |
+| Preferences | closed | screens[0] LCD Main | 466×678 | C/R | portrait | 0,0,34,84 |
+| Preferences | book, open | screens[1] LCD-1 | 951×669 | R/R | landscapeRight | 0,0,34,84 |
+| MobileSafari | closed | screens[0] LCD Main | 466×678 | C/R | portrait | 0,0,34,84 |
+| MobileSafari | book, open | screens[1] LCD-1 | 951×669 | R/R | landscapeRight | 82,0,34,0 |
+
+- `[UIScreen mainScreen]` is the cover (`LCD`, `Main`) in every posture. `[UIScreen screens]`
+ has **1** entry when closed and **2** in book/open: the inner `UIScreen` exists in the app
+ only while the inner panel is lit (`UIScreenDidConnectNotification` on unfold,
+ `…DidDisconnect…` on fold). Inner `nativeBounds` 2007×2853, `scale` 3; its `bounds` follow
+ the interface orientation (951×669 landscape, 669×951 portrait). No 669×951-at-boot effect
+ was seen in apps (the README's SpringBoard history effect); the connect notification
+ carries `{669, 951}` for an instant before the scene settles at 951×669.
+- `userInterfaceIdiom` is Phone (0) everywhere, also on the inner panel with regular/regular.
+- The cover status bar is vertical (`statusBarAxis` 1, `UIStatusBarManager.statusBarFrame`
+ 466×2), so the cover's safe area is right 84 rather than top. On the inner panel in
+ landscape the probe app and Preferences keep right 84; Safari reports top 82 (its client
+ `statusBarAxis` 0, horizontal).
+- Preferences is portrait-only (`supportedInterfaceOrientations` mask 2, scene
+ `_currentlySupportedInterfaceOrientations` 2) yet runs landscapeRight (4) on the inner
+ panel in every posture. Safari and the probe app: scene mask 26 (no upside-down); the probe
+ app's `supportedInterfaceOrientationsForWindow` is 30.
+- Corners: `FBSSceneSettings.cornerRadiusConfiguration` cover (8, 8, 59, 59), inner 55 on all
+ corners; `UITraitCollection.displayCornerRadius` and `UIScreen._displayCornerRadius` are
+ 59 in every posture (`_displayCornerRadius` does not exist on UITraitCollection).
+- `ssk_surfaceType` (FBSScene settings, ShellSceneKit): cover 1, inner 2, 4 while a launch is
+ still in progress; the probe app does not load ShellSceneKit (does not respond).
+
+## Book vs open
+
+Book and open give the same bounds, size classes and orientation. What differs:
+
+- `FBSSceneSettings.sceneRegions`: the inner scene has `inner` {{0,0},{669,951}},
+ `innerRear` {{0,0},{669,475.5}}, `innerCover` {{0,475.5},{669,475.5}}, `fold` (boundary)
+ {{0,455.5},{669,40}} margins {20,0,20,0}, `innerCamera` (exclusion, inactive),
+ `statusBarOcclusion` {{0,0},{124,84}}. In **book** `innerCover` is `active: YES`, in
+ **open** `active: NO`. The cover scene has `cover`, `coverCamera`, `statusBarOcclusion`.
+- Preferences' split view: `primaryColumnWidth` **475.67 in book** (the sidebar ends at the
+ fold), **320 in open**; client `primaryWindowOverlayInsets.left` 495.67 vs 320. Screenshots:
+ `raw/appkit/Preferences/launch-closed/shots/02-book_after-closed_-d3.png` and `03-open_after-book_-d3.png`.
+- Hinge state: `_UISceneHingeStateClientComponent.hingeState` partiallyOpen 100° / openFlat
+ 180°; scene settings `sceneHingeState` partiallyOpen / fullyOpen. Only scenes whose client
+ sets `wantsSceneHingeState` get it: the probe app (has a UIHingeInteraction) and Safari
+ always, Preferences never (nil). The separate `FBSSceneSettings.hingeAngle/hingeStatus/
+ magicPose` getters stay 0 in every posture.
+- Public `UIHingeInteraction`: closed status 1 angle 0; book status 2 angle 1.745 (radians);
+ open status 3 angle 3.142. Updates stream during the sweep (10–23 per transition).
+- No geometry callback between book and open.
+
+## Device orientation (`posture.zsh -deviceOrientation=`)
+
+The swap's device orientation reaches apps (`UIDevice.orientation` and scene orientation):
+
+| posture | requested | probe app / Safari orientation, bounds | Preferences | `UIDevice.orientation` |
+| --- | --- | --- | --- | --- |
+| open, book | landscapeLeft | portrait, 669×951, safe 82,0,34,0 | portrait 669×951, split 250.33 | 3 |
+| open, book | landscapeRight | portraitUpsideDown, 669×951 | portraitUpsideDown 669×951 | 4 |
+| closed | landscapeLeft | landscapeRight, 678×466, C/C | portrait 466×678 | 4 |
+| closed | landscapeRight | landscapeLeft, 678×466, C/C | portrait 466×678 | 3 |
+
+The inner panel is landscape-native, so a landscape device is a portrait inner panel, and
+the inner panel allows upside-down even for portrait-only Preferences. On the cover,
+`UIDevice.orientation` is the opposite of the requested name (landscapeLeft → 4), on the
+inner panel it matches (landscapeLeft → 3). Cover landscape `statusBarFrame` is 0×0.
+
+## Migration and callbacks
+
+- The scene **migrates**: same `UIWindowScene`, same `persistentIdentifier`, same windows;
+ it stays `foregroundActive` through every fold and unfold (no scene lifecycle callback,
+ no reconnect). Unfold moves it to `screens[1]` (FBS display `Unknown.main[3]`, hosting
+ space `SB-display-<inner UUID>`); fold moves it back to `Main`.
+- Probe-app callback order on unfold (`book(after-closed)`): hinge updates status 1→2, a few
+ deprecated `windowScene:didUpdateCoordinateSpace:…` calls with no change, then within ~1 ms
+ `UIScreenDidConnectNotification` → `windowScene:didUpdateEffectiveGeometry:` (466×678
+ portrait → 951×669 landscapeRight) → KVO `effectiveGeometry` → `viewWillTransitionToSize`
+ → trait change C→R → layout. Geometry lands ~110 ms after the hinge status flips to 2.
+ On fold: trait change R→C first, then `didUpdateEffectiveGeometry:` (→ 466×678 portrait),
+ `viewWillTransitionToSize`, then `UIScreenDidDisconnectNotification`; ~70 ms after the
+ status flips to 1. Exactly one `didUpdateEffectiveGeometry:` per fold/unfold. The
+ deprecated delegate method still fires (7–12 times per transition). Full sequences:
+ records `VPAppKitProbe.callbackSequence`, raw logs `raw/appkit/VPAppKitProbe/*/events.jsonl`.
+- `UIWindowSceneGeometry.systemFrame` is {inf, inf, 0, 0} and
+ `UIApplication.statusBarFrame` {inf, inf, 0, 0} (recorded as the strings "inf");
+ `UIScreen.applicationFrame` has NaN y/height.
+
+## History-dependent values
+
+Same posture, different path (all in `appkit.json`; compare `posture` labels):
+
+- `FBSSceneClientSettings.interfaceOrientation` and `UIWindow._sceneClientOrientation`: 1 when
+ the app was launched on the cover and unfolded, 4 when it had been on the inner panel
+ first; after folding back to the cover from an inner launch they stay **4** on the cover
+ (portrait UI). Preferences shows the same.
+- `FBSSceneSettings.statusBarAvoidanceFrame`: y 951 after an unfold from closed, 0 otherwise.
+- `UIWindowScene._hasOrientationDependentSafeArea{Edge,Corner}Insets`: true after an unfold
+ from closed, false after an inner launch (book/open).
+- Launch timing: 6 s after `simctl launch` Preferences and Safari launched on the inner
+ panel were still `foregroundInactive` (activationState 1, `deactivationReasons` 32, root
+ view 0×0, no scene regions, Safari `wantsSceneHingeState` NO). The `launch-settled`
+ scenario repeats both launches with 15 s; use those as the steady state.
+
+## Missing / nil / errors
+
+- nil everywhere: `UIWindowScene.sizeRestrictions`, `.windowingBehaviors`, `.focusSystem`,
+ `UITraitCollection.typesettingLanguage`, `FBSDisplayConfiguration.uniqueIdentifier`,
+ `FBSSceneSettings.traitCollection`, `FBSSceneClientSettings.pairedSceneDisplayConfiguration`,
+ `.requestedDisplayMode`, `.displayConfigurationRequest`.
+- nil for some: `UISceneConfiguration.name` (Preferences, Safari), hinge state (Preferences
+ always; Safari mid-launch), `sceneRegions` / `systemShellHostingSpaceIdentifier` mid-launch,
+ `UITraitCollection.deviceDeterminedConfiguration` (Preferences, Safari).
+- does not respond: `UITraitCollection._displayCornerRadius` (all), and
+ SpringBoard-category getters in apps that do not load those frameworks
+ (`ssk_surfaceType`, `sbsui_surfaceTypeClient`, `sb_supportsResizing`, `avkit_screenType`,
+ `sbh_screenType`, `sbf_displayProxyIdentifier`, `pui_fbsDisplayIdentity`,
+ `isSmallScreenDevice`).
+- No fold/hinge/posture trait exists on UITraitCollection (method list enumerated).
+- `UIApplication.currentHingePoseStateForTesting` is {0,0,0,0} in every posture.
+
+## Harness notes
+
+- Background apps cannot be probed: the sim suspends them and the lldb expression hangs
+ until the watchdog (a VPAppKitProbe probe timed out this way). Probe only the foreground app.
+- `simctl launch` of an app that already has a process did not bring it to the front here;
+ the driver terminates and relaunches.
+- In lldb expressions here `@try` is unavailable and any ObjC exception aborts the whole
+ expression: `FBSSettings` throws from `valueForKey:`, and `NSJSONSerialization` throws on
+ NaN/inf. The probe calls getters through `NSInvocation` after `respondsToSelector:` and
+ turns non-finite numbers into strings. lldb symbol collisions also hit block parameters
+ named `d`, `key` and `obj`; `strchr` fails to resolve (use NSString).
+- A wait loop using `pgrep -f <script>` matches its own command line; avoid it.
diff --git a/Research/Guest/Evidence/duo-sim-baseline/chrome.md b/Research/Guest/Evidence/duo-sim-baseline/chrome.md
new file mode 100644
index 00000000..c9ab4516
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/chrome.md
@@ -0,0 +1,143 @@
+# chrome: SpringBoard chrome layout metrics (iPhone Duo simulator)
+
+Simulator `duo-baseline-chrome` (A9C09C26-9AD3-4DF7-809D-E155D2D3F544), iOS 27.1 24A94425, Xcode 27.1.
+Output: `chrome.json` (127,674 records, 31 runs, compact JSON, about 54 MB). Raw transcripts: `raw/chrome/`.
+Screenshots: `raw/chrome/shots/<run>-{state,lock,hinge}-d{1,3}.png`.
+
+## Files
+
+| Path | What |
+| --- | --- |
+| `probes/parts/chrome-*.inc` | probe sources: lib (generic getter walk), emit helpers, scene, statusbar, home, wallpaper, lock, hinge, footer |
+| `probes/chrome-build.zsh` | assembles `probes/chrome-state.lldb`, `chrome-lock.lldb`, `chrome-hinge.lldb` (one lldb expression each) |
+| `probes/chrome-run.zsh` | `posture` (retries once after a status check on exit 3), `state`, `lock` (lock, push 3 notifications, probe, unlock) |
+| `probes/chrome-assemble.zsh` | merges the transcripts into `chrome.json` |
+| `probes/chrome-discover-*.lldb` | discovery probes (window lists, view trees, class introspection); output in `raw/chrome/discover-*` |
+| `raw/chrome/<run>-{state,lock}.txt.gz` | cleaned probe transcripts (gzipped; the `.raw.txt.gz` beside each one is lldb's unedited output) |
+| `raw/chrome/<run>-posture.json` | posture.zsh result for each run; `raw/chrome/posture/` holds the posture driver's artifacts |
+| `raw/chrome/payloads/` | the `simctl push` payloads (com.apple.Preferences is the only bundle authorized in this sim) |
+
+## Method
+
+- The values come from introspection in SpringBoard, not from guesses. For each object, the probe takes every
+ declared ObjC property and every zero-argument method whose name looks like a getter, through the class chain
+ down to UIView, UIViewController or NSObject. It reads each one with KVC. A name filter skips
+ mutators (`vpDeny`), and only object, scalar or pointer-free struct return types are read.
+ Struct values made only of doubles are decoded as `{objCType, fields}`. `*.view` records give
+ `frameInWindow` (`convertRect:bounds toView:window`), frame, bounds, transform, layer transform, hidden,
+ alpha, safeAreaInsets, and label text and font size or image size where the view has them.
+- The probes only read. The exceptions are the actions the matrix needs: the posture swap (`tools/posture.zsh`),
+ `lockUIFromSource:1` and `_finishUIUnlockFromSource:14` on the primary scene's `SBLockScreenManager`, and
+ `simctl push`. One experimental `[[UIDevice currentDevice] setOrientation:]` call (1, then 3) was made
+ during `open-landscapeLeft` before it was clear how orientation works. It changed nothing; SpringBoard
+ stayed at 1. Nothing was swizzled. CSQuickActionImageGlyphView was only read.
+- Getters that crash or throw are skipped everywhere. They are listed in `meta.skipped_getters`.
+- `chrome.json` leaves out two kinds of records, which are still in the transcripts. The first is pointer-only
+ object descriptions that have no layout keyword. The second is non-layout getters on large state
+ controllers. See `meta.omitted*`.
+
+## Orientation: what actually happens
+
+The cover (SB-main) is **always interface orientation 1** for every `-deviceOrientation`, both on the home
+screen and on the lock screen. The inner scene does rotate. It follows the swap's `-deviceOrientation` with
+a 90° offset, which matches the panel's native 270° rotation:
+
+| -deviceOrientation | inner interfaceOrientation | inner layout |
+| --- | --- | --- |
+| portrait | 4 (landscapeLeft) | landscape-shaped 951×669 windows |
+| portraitUpsideDown | 3 (landscapeRight) | landscape-shaped 951×669 |
+| landscapeLeft | 1 (portrait) | portrait-shaped 669×951 |
+| landscapeRight | 2 (portraitUpsideDown) | portrait-shaped 669×951 |
+| none: first unfold from closed(boot) | 1 | **landscape-shaped 951×669, the same as 4**. This is a history artifact: the windows were never re-laid out for 1 |
+
+`UIScreen` / `coordinateSpace` bounds for the inner stay 669×951 throughout this run. That run had already
+unfolded, so compare the README's 669×951 → 951×669 note for inner `UIScreen.bounds`, which
+`screens.json` covers. `chrome.json` names orientations with UIKit interface-orientation names
+(3 = landscapeRight, 4 = landscapeLeft). **`tools/smoke.zsh` maps 3 → landscapeLeft and 4 → landscapeRight,
+which is the UIDeviceOrientation mapping, not the interface one.** The README says the field is the interface
+orientation, so smoke.json's names for 3/4 would be swapped. Smoke only saw 1, so it is unaffected.
+
+## Key metrics (points, window coordinates)
+
+Status bar
+- Cover: `STUIStatusBarVisualProvider_AxisAlignableSplitV68Cover` (→ AxisAlignableSplit → Split → Phone → iOS).
+ It is a vertical **right-hand status column**. `UIStatusBarManager.statusBarFrame` = {389,0,77,678};
+ wrapper `currentHeight`/`defaultHeight` 77; `_statusBarFrameIgnoringVisibility` {0,0,466,77}.
+ The foreground view is {378,0,88,176.33}. Sensor/cutout: `sensorAreaRect` = `effectiveSensorAreaRect` =
+ cutout guide = `UIScreen._exclusionArea` = {399,30,37,37}. `avoidanceFrame` is {399.67,29.33,37,37}.
+ Time label {≈400,83,≈36,19.33} (rounded bold 16 pt), round battery {394.67,106.67,47,47}.
+ `isVerticalLayout` YES; `_verticalCombinedBoundingBoxHeight` 104; `_peripheryInsets` top 50.67;
+ display corner radius 59.
+- Inner: `STUIStatusBarVisualProvider_AxisAlignableSplit2007` (→ AxisAlignableSplit2670 → AxisAlignableSplit).
+ - Landscape-shaped (4/3): foreground {863,0,88,123.67}, time at {≈885,30.33}, battery {879.67,54,47,47}.
+ `UIStatusBarManager.statusBarFrame` = **{0,0,0,0}** and wrapper `currentHeight` **0**.
+ - Portrait-shaped (1/2): foreground {581,0,88,123.67}, `statusBarFrame` {592,0,77,951}, height 77.
+ - `effectiveSensorAreaRect` is {0,0,0,0} on the inner. `sensorAreaRect` still reports the cover's
+ {399,30,37,37}. The cutout guide is empty.
+
+Home screen
+- Root grid on both displays: 4 columns × 6 rows (`maximumIconCount` 24). Icons are 60×60 at scale 3 with a
+ 15.6 corner radius; the icon view is 60×74. Label font is SFUI-Medium 12 pt (label config: baseline offset 16,
+ height 26, extra width 37).
+- Cover: portrait insets {top 54, left 27, bottom 70, right 115}, with the right inset reserved for the side
+ dock. `effectiveIconSpacing` is 28×38.8. The list spans {0,0,466,678}; the first icon is at {27,54}.
+ `numberOfLandscape*` is 0 (no landscape config).
+- Inner: portrait insets {82,145.5,219,145.5} and landscape insets {54,0,65,0}; landscape rows×cols 6×4;
+ `effectiveIconSpacing` 28×38.
+ - Landscape-shaped: the list is 324 wide, at x=470 (open), 459.33 (open after landscapeRight) or
+ 512.67 (book), and 669 tall.
+ - Portrait-shaped: the list spans {0,0,669,951}; the first icon is at {145.67,82}.
+- Dock: `SBFloatingDock*` (iPad-style floating dock). `SBDockView` is not present. The dock list grid is
+ 1×4 portrait, 4×1 landscape (capacity 4). Dock icons are 60×60 in a 48×48 list cell.
+ - Cover: the side dock is a vertical column at the right edge. `SBFloatingDockView` {376.17,45,84,678};
+ platter 72×72 at {382.17,348} for 1 icon; `floatingDockHeight` 84.
+ - Inner landscape-shaped: also a right-hand column, {861.17,45,84,669}.
+ - Inner portrait-shaped: a horizontal bottom dock, {0,851,669,100}; `floatingDockHeight` 100;
+ platter 244×92.
+ - The search button (48×48) sits under the dock: {394.33,606} on the cover, {879.33,597} on the inner.
+- App Library (`SBHLibraryPodFolderView`) and the Today view list exist on both displays.
+- Wallpaper: `_SBWallpaperSecureWindow` is **portrait-anchored**. It stays {0,0,669,951} on the inner even
+ while every other inner window is 951×669; on the cover it is 466×678. The wallpaper is a PosterBoard
+ scene (`PBUIPosterSceneLayerHostView`). `SBWallpaperController` exists per scene, and its
+ `wallpaperConfigurationManager` reports wallpaperSize {466,678} with wallpaperSizeType "iPhone (N56)".
+ `SBWallpaperHingeProgressController` stores no progress value. It only gates: `_enabled` and
+ `_backlightOn` are YES on the lit display and NO on the other.
+
+Lock screen (cover sheet)
+- Quick actions: two `CSQuickActionsButton`s, **84×84**, both at the same frame. They are **hidden** in every
+ posture and orientation of this simulator.
+ - Positions: cover {376,573}; inner landscape-shaped {861,564}; inner portrait-shaped {579,846}.
+ - Button: `iconImageSize` 48×48, `edgeInsets` 18 on all sides, `containerCornerRadius` 24.
+ - `CSQuickActionImageGlyphView`: frame 27×25 at {28.67,29.67} in the button ({10.67,11.67} in the
+ 48-point icon area). Transform and layer transform are identity. contentMode 1 (aspect fit).
+ - The image is 19.33×18 at @3x, so it renders aspect-fit at about 26.85×25.
+ - Ratios: glyph/button width 0.321, height 0.298; glyph/iconImage 0.5625; image/glyph-view 0.716.
+ - **Caveat:** the image is the SF symbol `questionmark.app`. The simulator has no torch or camera
+ action configured, so this is a placeholder glyph, not the flashlight or camera glyph.
+- Notifications. Three pushes to Preferences group into one stack of `NCNotificationShortLookView`s:
+ - Cover: platter width **350** (bounds); the structured list is 370 at x=12 at boot and 378 at x=8 after open.
+ - Inner, open, both shapes: platter **450**; list 478, centred at x=236.5 (landscape-shaped) or x=95.5
+ (portrait-shaped).
+ - Inner, book, landscape-shaped: platter **350**; list 378 at x=498.25 (or 370 at 502.25), i.e. on the
+ right half. Inner, book, portrait-shaped: 450.
+ - The stacked platters behind are scaled 0.94 and 0.88. Short-look continuous corner radius is 23.5.
+- Clock: `CSProminentTimeView`. The time is drawn by a SwiftUI `TitleLabelView`, so no UIFont is readable.
+ - Cover {11,47,372,132.26}.
+ - Inner open landscape-shaped {275.5,51.67,400,132.26}; book {487.25,51.67,400,132.26} (right half);
+ portrait-shaped {134.5,64.67,400,132.26}.
+ - The date (`_UIAnimatingLabel`) is SFUI-Semibold 22 pt.
+
+## Missing / nil / errors
+
+- On the cover, during open/book lock runs, `CSCombinedListView(Controller)`, `NCNotificationStructuredList*`,
+ `NCNotificationListView`, and `CSProminentTimeView` are nil: the cover sheet content is on the inner.
+ The reverse holds in `closed-after-open`: the inner `SBCoverSheetWindow` still exists but has no content.
+ In `closed-boot` (never unfolded) the inner scene has no `SBCoverSheetWindow` at all.
+- Skipped because they crash or throw: `SBWindowScene.liftToWakeController` (stack overflow),
+ `UIWindowScene._preferredIntelligentAssistantVisibility` / `…Configuration` /
+ `SBSUI_preferredSystemRootLayerTransform`, `SBIconView.iconImageAlignment`, and
+ `SBIconListPageControl.maximumNumberOfPages`.
+- `SBHIconListLayoutProvider` location constants were resolved with dlsym where they exist. The call text
+ marks the ones where a literal was used instead.
+- Present but empty or zero: inner `UIStatusBarManager.statusBarFrame` (landscape-shaped),
+ inner `effectiveSensorAreaRect`.
diff --git a/Research/Guest/Evidence/duo-sim-baseline/display.md b/Research/Guest/Evidence/duo-sim-baseline/display.md
new file mode 100644
index 00000000..8be3d269
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/display.md
@@ -0,0 +1,282 @@
+# Display stack baseline (iPhone Duo simulator)
+
+Simulator `duo-baseline-display` (28D2B766-…), iPhone19,4, iOS 27.1 24A94425,
+Xcode 27.1. Data: `display.json` (46085 records, 21 captures), transcripts in
+`raw/display/states/<capture>-{backboardd,springboard,safari}.txt`, posture-driver
+output in `raw/display/posture/` (screenshots downscaled to 480 px).
+
+## How it was collected
+
+- `probes/display-backboardd.lldb`, `probes/display-springboard.lldb`,
+ `probes/display-safari.lldb` are generated by `raw/display/gen-probe.zsh` from
+ `raw/display/src/{helpers.lldbfrag,*.body,footer.lldbfrag}`.
+- Getters are enumerated, not listed by hand. For each object, the probe takes
+ every declared property getter plus every zero-argument, non-void method of
+ the class and its superclasses below NSObject (`class_copyPropertyList`,
+ `class_copyMethodList`). It then drops names with side effects: `set*`,
+ `add*`, `remove*`, `invalidate*`, `_lock_*`, `_queue_*`, `_workQueue_*`,
+ `copy*`, `create*`, `start*`/`stop*`, focus and drag lazy getters, and others.
+ The full lists are in `helpers.lldbfrag`. The probe calls each getter through
+ a typed `objc_msgSend` cast chosen from the method's return type encoding. A
+ getter that returns a block, a pointer, a union or an unknown struct gets a
+ record with an error and is never called. UITraitCollection is the exception:
+ 32 display-relevant getters are named in the probe, because third-party
+ categories add hundreds more.
+- lldb expressions here cannot use `@try`. A getter that raises an exception
+ aborts the whole expression, so `raw/display/iterate.zsh` traced the last
+ getter called to a file and added it to a skip list. Only one getter raised:
+ `-[CAWindowServerDisplay secureIndicatorsEnabled]`. It is recorded with the
+ error "raises an Objective-C exception in this process (not called)".
+- Each capture: `posture.zsh` (swap or status), then the backboardd probe, then
+ the SpringBoard probe (plus MobileSafari for 08-13). `raw/display/capture.zsh`,
+ `orient-cycle.zsh`, `merge.zsh`.
+
+## Captures
+
+| capture | posture | orientation | foreground |
+| --- | --- | --- | --- |
+| 01-boot | closed(boot) | portrait | home |
+| 02-open-after-closed | open(after-closed), the first unfold | portrait | home |
+| 03-closed-after-open | closed(after-open) | portrait | home |
+| 04-book-after-closed | book(after-closed) | portrait | home |
+| 05-open-after-book | open(after-book) | portrait | home |
+| 06-book-after-open | book(after-open), `POSTURE_ANCHOR=none` | portrait | home |
+| 07-closed-after-book | closed(after-book) | portrait | home |
+| 08-closed-{P,LL,LR} | closed(after-closed) | portrait / landscapeLeft / landscapeRight | Safari |
+| 09-book-{P,LL,LR} | book(after-closed) | 〃 | Safari |
+| 10-open-P | open(after-book) | portrait | Safari |
+| 11-reboot | closed(boot2): shutdown and boot again | portrait | home |
+| 12-open-{P,LL,LR} | P: open(after-closed); LL, LR: open(after-open) | 〃 | Safari |
+| 13-book-{P,LL,LR} | book(after-closed) | 〃 | Safari |
+
+Every posture verified (`posture.zsh` exit 0: closed → cover lit, book/open → inner lit).
+
+### Orientation: what took, and how
+
+- iPhone SpringBoard on the cover is portrait-only, so the home screen gives no
+ orientation data. Captures 08-13 put MobileSafari in front.
+- The swap tool's `-deviceOrientation=<o>` option is what rotates apps. It
+ drives SpringBoard's pose. It does **not** change backboardd's
+ `BKOrientationManager.currentRawDeviceOrientation`, which stays 0 after boot.
+- `BKSHIDServicesSetDeviceOrientationForAutomation` (BackBoardServices, called
+ in SpringBoard) changes BK's raw orientation and SpringBoard's `UIDevice`
+ orientation. While the swap tool's pose orientation was landscape, it did not
+ rotate the app back. Captures made that way were discarded
+ (`raw/display/states/discarded/`). It was last called with 1, so captures 08-10
+ show raw orientation 1; after the reboot it is 0 again.
+- Mapping that was observed (Safari = the app's own `UIDevice` and scene orientation):
+
+| swap option | cover: Safari dev/io, scene bounds | inner: Safari dev/io, scene bounds |
+| --- | --- | --- |
+| portrait | 1/1, 466×678 | 1/**4**, 951×669 |
+| landscapeLeft | 4/4, 678×466 | 3/**1**, 669×951 |
+| landscapeRight | 3/3, 678×466 | 4/**2**, 669×951 |
+
+On the inner display the interface orientation is a quarter turn from the
+device orientation: holding the device in portrait gives landscape UI on the
+inner panel. The `orientation` field in the records is the swap option name.
+
+## Cover vs inner: where they differ in kind
+
+All values are from `02-open-after-closed` unless a capture is named. Both
+displays are always present and always connected. Only the power state and the
+lit panel follow the posture.
+
+| | cover | inner |
+| --- | --- | --- |
+| CADisplay name / deviceName | `LCD` / `primary` | `LCD-1` / `primary-1` |
+| CADisplay displayId | 1 | 3 (2 is `TVOut`/`external-0`, 4 `Wireless`, 5 `Resizable`) |
+| `[CADisplay mainDisplay]` | this one (index 0) | — |
+| CADisplay tag (also CAWindowServerDisplay tag, FBS `tags`) | 0 | **65536** |
+| CADisplay bounds / nativeSize / mode | 1398×2034, `internal_panel (fixed)`, single mode | 2007×2853, `internal_panel (fixed)`, single mode |
+| CADisplay nativeOrientation | rot0 | rot0 |
+| CADisplay currentOrientation | rot0 (rot90 / rot270 with the app in LL / LR) | rot90 at io 4; rot0 at io 1; rot180 at io 2 |
+| CADisplay pointScale, refreshRate | 3, 1/60 | 3, 1/60 |
+| CADisplay physicalSize (in) | 3.0391×4.4217 | 4.3630×6.2022 |
+| CADisplay pixelsPerInch | 316.165 × 669.270 | 323.596 × 653.901 |
+| CADisplay displayType / isExternal / transportType | 0 / NO / `other` | same |
+| CADisplay seed (02) | 3 | 5 (rises with every rotation) |
+| mode colorGamut / bitDepth | gamut_P3 / 8 | same |
+| CAWindowServerDisplay orientation | portrait (landscapeLeft / landscapeRight when the cover app rotates) | **landscapeLeft** (portrait at io 1, portraitUpsideDown at io 2) |
+| CAWindowServerDisplay extendedProperties | `DisplayRotation 0, DeviceSurfaceType 1, kMGQDeviceSurfaceType 1, ChromeIdentifier com.apple.dt.devicekit.chrome.phone15, DeviceCornerRadius [8,8,59,59], DisplayScale 3` | `DisplayRotation 270, DeviceSurfaceType 2, kMGQDeviceSurfaceType 2, ChromeIdentifier …chrome.phone14, DeviceCornerRadius [55,55,55,55], DisplayScale 3` |
+| CAWindowServerDisplay panelPhysicalSize | 3.0391×4.4217 | 4.3630×6.2022 |
+| CAWindowServerDisplay scale / scales / touchScales | 1 / 1×1 / 1×1 | same |
+| CAWindowServerDisplay flipBook enabled/active/suppressed | NO/NO/NO | NO/NO/NO |
+| BKSDisplayService traitsForDisplayUUID: | `surfaceType: 1` | `surfaceType: 2` |
+| BKDisplayController geometryForDisplayUUID: | {1398×2034, 3, 0, {0,0,1,1}} | {2007×2853, 3, 0, {0,0,1,1}} |
+| BK digitizer (`BKHIDDirectTouchEventProcessor`) | `CoreDevice touchscreen(<cover UUID>)`, builtIn, authenticated; this is `mainDisplayDigitizerService` | `CoreDevice touchscreen(<inner UUID>)`, builtIn, authenticated |
+| UIScreen index in `[UIScreen screens]` | 0, `== mainScreen` in every capture | 1 |
+| UIScreen `_name` / displayIdentity | `LCD` / **`Main`** | `LCD-1` / **`Unknown.main[3]`** |
+| UIScreen bounds | 466×678 (678×466 after the cover app was landscape; see History) | 669×951 at boot, then 951×669 (io 4) or 669×951 (io 1/2) |
+| UIScreen nativeBounds / `_nativeDisplayBounds` / `_unjailedReferenceBoundsInPixels` | 1398×2034 | 2007×2853 |
+| UIScreen scale / nativeScale / maximumFramesPerSecond | 3 / 3 / 60 | 3 / 3 / 60 |
+| UIScreen `_isMainScreen` / `_isEmbeddedScreen` / `_isMainLikeScreen` | YES / YES / YES | **NO** / YES / YES |
+| UIScreen `_integerDisplayID` / `_displayID` | 1 / cover UUID | 3 / inner UUID |
+| UIScreen `sbh_screenType` / `_screenType` | 31 / -1 | 32 / -1 |
+| UIScreen `_displayCornerRadius` | 59 | 59 |
+| UIScreen `_peripheryInsets` | t/b 50.667 (l/r when io 3/4) | l/r 50.667 at io 4; t/b at io 1/2 and at boot |
+| UIScreen `_displayPeripheryInsets` / `_bn_portraitPeripheryInsets` | top 50.667 / t/b 50.667 | same as the cover |
+| UIScreen `_exclusionArea` | single rect {399, 30, 37, 37} | **the same rect** |
+| UIScreen `_displayInfoProvider` (UISDisplayContext) | safeAreaInsets bottom 34 in all four orientations, peripheryInsets top 50.667 | identical to the cover's |
+| UIScreen `_pointsPerInch` / `_nativePointsPerMillimeter` | 153.333 / 6.0367 | same |
+| UIScreen traitCollection horizontal/vertical size class | compact/regular (1/2) | 0/0 at boot, **regular/regular (2/2)** after the first unfold |
+| FBSDisplayConfiguration `_nameForDisplayType` / `type` | `Main` / 0 | **`Unknown` / 7** |
+| FBSDisplayIdentity displayID / type / isMainDisplay / isMainRootDisplay / isRootIdentity / isUIKitMainLike / isAlwaysConnected | 1 / 0 / YES / YES / YES / YES / YES | 3 / **7** / **NO** / **NO** / YES / YES / YES |
+| FBSDisplayIdentity connectionType / connectionSeed / pid / uniqueIdentifier | 0 / 0 / 0 / nil | same |
+| FBSDisplayConfiguration hardwareIdentifier | cover CADisplay uniqueId | inner CADisplay uniqueId |
+| FBSDisplayConfiguration bounds / pixelSize / pointScale | 466×678 / 1398×2034 / 3 | 669×951 / 2007×2853 / 3 (never rotates) |
+| FBSDisplayMode | `466x678@3x (1398x2034/3) 60Hz p3 SDR`, `_rotation` 0 | `669x951@3x (2007x2853/3) 60Hz p3 SDR`, `_rotation` 0 |
+| FBSDisplayConfiguration nativeOrientation / `_nativeRotation` | 0 / 0 | 0 / 0 |
+| FBSDisplayConfiguration renderingCenter / nativeCenter | {699, 1017} | {1003.5, 1426.5} |
+| FBS/UIScreen `sbui_systemArbitratedInterfaceOrientation` | 1 | 4 |
+| FBSDisplayIdentity `sb_displayWindowingMode` | 1 | 1 |
+| FBS colorGamut / refreshRate / overscanCompensation / safeOverscanRatio | 1 / 60 / 0 / 0.9 | same |
+| `[FBDisplayManager mainIdentity]` | `Main` | — |
+| SpringBoard scene | `SB-main` | `com.apple.springboard.bringup` |
+
+For the VM's two-display path, these are the identities the inner display must
+reproduce:
+
+- FBS identity `Unknown.main[3]`: type 7, displayID 3, not main, its own root
+ identity, UIKit-main-like, always connected.
+- CA `LCD-1` / `primary-1` with tag 65536 (0x10000).
+- `extendedProperties` with DisplayRotation 270 and DeviceSurfaceType 2.
+- BKS surfaceType 2.
+
+The cover is `Main`, displayId 1, tag 0, surface type 1, and it is always
+`mainScreen` and `mainDisplay`.
+
+## Posture-dependent values (home screen, portrait)
+
+| | closed | book / open |
+| --- | --- | --- |
+| cover CADisplayStateControl displayState / targetDisplayState / powerState | 1 / 1 / 1 (`displayState: on`) | 0 / 0 / 1 (`off`, power stays on) |
+| inner CADisplayStateControl displayState | 0 | 1 |
+| CAWindowServerDisplay `enabled` / `isBlanked` | cover YES/NO, inner NO/YES | cover NO/YES, inner YES/NO |
+| `BKDisplayController displayIsBlanked:` | cover NO, inner YES | cover YES, inner NO |
+| SB-main / bringup displayContentMode | 2 primary / 1 disabled | 3 auxiliary / 2 primary |
+| BK touch-stream clients | SpringBoard system-gestures on the cover only | SpringBoard system-gestures client on the inner (the inner aggregate is empty again when closed) |
+
+Book and open are identical in every display-stack value (02 vs 04, 05 vs 06).
+CADisplay seed, bounds, modes and identities do not change with the posture.
+
+## History-dependent values
+
+1. **The inner UIScreen before and after the first unfold.** At boot
+ (01, and again 11 after a reboot):
+ - bounds 669×951 and `_interfaceOrientation` 0 (`orientation: unknown (0)`)
+ - `_peripheryInsets` t/b
+ - traitCollection without size classes (0/0)
+
+ From the first unfold on, in every posture including closed (02-07):
+ - bounds 951×669 and `_interfaceOrientation` 4
+ - `_peripheryInsets` l/r
+ - horizontal/vertical size class Regular (2/2)
+
+ Closed after open (03, 07) keeps the post-unfold values. The FBS current
+ configuration seed goes 3 → 5 at the first unfold. The inner
+ CAWindowServerDisplay is `landscapeLeft`, the CADisplay `rot90`, and BK
+ holds orientation 4 for the inner UUID, already at boot.
+2. **The cover UIScreen keeps the last orientation the cover had.**
+ - After 08-closed-LL/LR it stays 678×466 with `_interfaceOrientation` 4/3
+ while the inner is in use (09-book-LL/LR, 13-book-LL/LR). The `book`
+ anchor swap to closed inherits the current device orientation, so the
+ cover rotates first.
+ - `12-open-LL/LR` (no anchor) keeps the cover at 466×678.
+3. **The SpringBoard inner primary scene orientation with device portrait.**
+ - It is 1 when the swap unfolded from closed: 09-book-P, 12-open-P, and
+ 02/04 on the home screen.
+ - It is 4 when the swap started on the inner: 10-open-P, 13-book-P.
+ - Safari is at io 4 in both cases, and
+ `UIApplication.activeInterfaceOrientation` is 4.
+4. **Display UUIDs change on every boot.** CADisplay uniqueId/UUID, FBS
+ hardwareIdentifier, CAWindowServerDisplay systemIdentifiers and
+ FramebufferIdentifier all change. Compare by name, displayId and identity,
+ never by UUID.
+
+Repeatability: closed 03 vs 07, open 02 vs 05 and book 04 vs 06 match except
+for the volatile fields (touch-stream creation times).
+
+## Digitizer → display mapping (backboardd)
+
+From `_queue_perDisplayInfo` and `_queue_displayUUIDForDigitizerService:`:
+
+| display | service | flags |
+| --- | --- | --- |
+| cover (LCD) | `CoreDevice touchscreen(<cover UUID>)`, senderID …03 | builtIn, authenticated, transport CoreDevice, `mainDisplayDigitizerService` |
+| inner (LCD-1) | `CoreDevice touchscreen(<inner UUID>)`, senderID …04 | builtIn, authenticated |
+| Resizable | `CoreDevice touchscreen(<Resizable UUID>)` …05 and an accessory 0xACEFADE… (eventSource 2, displayIntegrated, not authenticated) | |
+
+Each `BKDirectTouchState._interfaceOrientation` follows its display's BK
+orientation: the cover 1, the inner 4 (1 or 2 when the inner app is rotated).
+There is no AOP or pencil digitizer, and no chamois display.
+
+Incident: at 14:45:36 every CoreDevice HID service disappeared from backboardd
+("*** lost main display digitizer ***", IOHIDEventSystem connections removed).
+The host side caused it; this sim did nothing at that moment. It left
+10-open-LL/LR without digitizers. Those two captures were discarded, the sim was
+rebooted, and the open orientations were redone as 12-open-*.
+
+## Other values (both displays unless stated)
+
+- `[CAWindowServer serverIfRunning]`: 5 displays (LCD 1398×2034, TVOut 0×0,
+ LCD-1 2007×2853, Wireless 0×0, Resizable 0×0), rendererFlags 3, not secure,
+ mirroring off, `lss_extendedDisplays` empty, `_lss_primaryDisplay` LCD.
+- `BKDisplayRenderOverlayManager`: one active overlay,
+ `BKDisplayRenderOverlaySpinny` (gear, level -1, background) on the **cover**,
+ in every capture. `lockedOrientation` 0, `backlightLocked` NO.
+- `BKDisplayBrightnessController`: brightnessLevel 0.5, curve 1, ALS / auto
+ brightness / level control unavailable. `UIScreen.brightness` 0.5. No
+ per-display brightness getter exists.
+- `UISDisplayContext defaultContext`: the cover (`Main`) configuration;
+ displayEdgeInfo and exclusionArea are nil.
+
+## Missing, nil and errored
+
+- **nil on both panels:**
+ - CADisplay: productName, containerId, externalDisplayAttributes,
+ allowed/preferred/supportedHDRModes, availablePresets, currentPreset,
+ `_copyDebugProperties` (NULL)
+ - CADisplayStateControl: `_copyAll{Power,FrameRate}AssertionInfo`
+ - CAWindowServerDisplay: brightnessCapabilities, virtualDisplayMode,
+ averagePixelConstraints, TVMode, cloneMaster, cursorDictionary
+ - CAWindowServer: displayExternalSyncManager
+ - FBS: `FBSDisplayIdentity.uniqueIdentifier`,
+ `FBSDisplayConfiguration.uniqueIdentifier`, `originatingConfiguration`
+ - UIScreen: mirroredScreen, `_overrideTraitCollection`, `__eventDisplay`,
+ `_initialDisplayContext`, `_previousHardwareIdentifier`,
+ focusGroupIdentifier
+ - `+[UIScreen _carScreen]`, `UITraitCollection._systemDisplayIdentifier`,
+ `UISDisplayContext.displayEdgeInfo` / `exclusionArea`
+ - BK: mainDisplayAOP/PencilDigitizerService, chamoisDisplayUUID,
+ `_frozenDisplayIDs`
+- **Not called (type):**
+ - CADisplay.timingsControl (`^v`)
+ - CAWindowServerDisplay blend/displayColorSpace (`^{CGColorSpace}`),
+ detachingDisplay, systemGamma and blackpointAdaptation (`CGColorTRC`
+ union), the six callback blocks
+ - UIScreen `_fallbackTraitCollection` (`^v`)
+- **Raises:** `CAWindowServerDisplay.secureIndicatorsEnabled`.
+- **Declared but not implemented:** UIScreen `_isEligibleForFocusInteraction`,
+ `_isEligibleForFocusOcclusion`, `_linearFocusMovementSequences`,
+ `_preferredFocusMovementStyle`, `traitOverrides` (protocol properties).
+- **Absent APIs:**
+ - CAWindowServerDisplay has no `contextIds` getter. The probe records
+ `contextIdAtPosition:` at the panel centre instead; it is volatile.
+ - There is no `CADisplay.maximumFramesPerSecond`, `colorGamut` or
+ `overscan` getter. The equivalents are `refreshRate`,
+ `currentMode.colorGamut` and `overscanAmount` / `overscanAdjustment`.
+ - `extendedProperties` exists only on CAWindowServerDisplay, not on FBS.
+ - `_UIScreenDisplayConfiguration` does not exist; it is
+ `UIScreen.displayConfiguration` / `fbsDisplay`.
+ - `SpringBoard._accessibilityFrontMostApplication` (a probe convenience) is
+ not available.
+
+## Volatile fields (ignore when comparing)
+
+- CAWindowServerDisplay nextWakeupTime, previousVBL, vblDelta and
+ contextIdAtPosition
+- pointer addresses inside descriptions
+- touch-stream client creationTime
+- brightness freeze times
+- seeds: CADisplay seed and FBS config seed rise with rotations and swaps
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-hinge-classes.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-hinge-classes.lldb
new file mode 100644
index 00000000..bb4b3ab8
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-hinge-classes.lldb
@@ -0,0 +1,25 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+unsigned int vpCount = 0;
+Class *vpAll = objc_copyClassList(&vpCount);
+NSMutableArray *vpNames = [NSMutableArray array];
+for (unsigned int vi = 0; vi < vpCount; vi++) {
+ NSString *vpN = @(class_getName(vpAll[vi]));
+ NSString *vpL = [vpN lowercaseString];
+ if ([vpL containsString:@"hinge"] || [vpL containsString:@"fold"] || [vpL containsString:@"posture"] || [vpL containsString:@"devicedetermined"] || [vpL containsString:@"magicpose"] || [vpL containsString:@"surfacetype"] || [vpL containsString:@"displaycontentmode"]) [vpNames addObject:vpN];
+}
+free(vpAll);
+[vpNames sortUsingSelector:@selector(compare:)];
+for (NSString *vpN in vpNames) {
+ Class vpC = NSClassFromString(vpN);
+ const char *vpImg = class_getImageName(vpC);
+ [vpOut appendFormat:@"== CLASS %@ super=%s image=%s\n", vpN, class_getName(class_getSuperclass(vpC)), vpImg ?: "?"];
+ unsigned int vpMN = 0; Method *vpML = class_copyMethodList(vpC, &vpMN);
+ for (unsigned int vj = 0; vj < vpMN; vj++) { char vpRT[128]; method_getReturnType(vpML[vj], vpRT, sizeof(vpRT)); [vpOut appendFormat:@" M %@ (%s)\n", NSStringFromSelector(method_getName(vpML[vj])), vpRT]; }
+ free(vpML);
+ vpMN = 0; vpML = class_copyMethodList(object_getClass((id)vpC), &vpMN);
+ for (unsigned int vj = 0; vj < vpMN; vj++) { char vpRT[128]; method_getReturnType(vpML[vj], vpRT, sizeof(vpRT)); [vpOut appendFormat:@" + %@ (%s)\n", NSStringFromSelector(method_getName(vpML[vj])), vpRT]; }
+ free(vpML);
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-introspect.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-introspect.lldb
new file mode 100644
index 00000000..1f15d3a4
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-introspect.lldb
@@ -0,0 +1,37 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+UIWindowScene *vpWS = nil;
+for (UIScene *vpSc in [[UIApplication sharedApplication] connectedScenes]) { if ([vpSc isKindOfClass:[UIWindowScene class]]) { vpWS = (UIWindowScene *)vpSc; break; } }
+id (^vpGet)(id, NSString *) = ^id(id o, NSString *s) { SEL vs = NSSelectorFromString(s); return (o && [(NSObject *)o respondsToSelector:vs]) ? ((id (*)(id, SEL))objc_msgSend)(o, vs) : nil; };
+NSObject *vpFBS = vpGet(vpWS, @"_FBSScene");
+NSObject *vpSet = vpGet(vpFBS, @"settings");
+NSObject *vpCS = vpGet(vpFBS, @"clientSettings");
+NSMutableArray *vpObjs = [NSMutableArray array];
+for (id vpO in @[vpWS ?: [NSNull null], vpWS.effectiveGeometry ?: [NSNull null], vpWS.traitCollection ?: [NSNull null], vpWS.screen ?: [NSNull null], vpWS.session ?: [NSNull null], vpWS.sizeRestrictions ?: [NSNull null], vpWS.statusBarManager ?: [NSNull null], vpFBS ?: [NSNull null], vpSet ?: [NSNull null], vpCS ?: [NSNull null], vpWS.windows.firstObject ?: [NSNull null], vpGet(vpSet, @"displayConfiguration") ?: [NSNull null], (id)vpWS.screen.coordinateSpace ?: [NSNull null], (id)vpWS.screen.fixedCoordinateSpace ?: [NSNull null], [UIApplication sharedApplication]]) [vpObjs addObject:vpO];
+NSMutableSet *vpSeen = [NSMutableSet set];
+for (NSObject *vpO in vpObjs) {
+ if (vpO == (NSObject *)[NSNull null]) { [vpOut appendString:@"== <null>\n"]; continue; }
+ [vpOut appendFormat:@"== OBJECT %s\n", class_getName(object_getClass(vpO))];
+ for (Class vpC = object_getClass(vpO); vpC && vpC != [NSObject class]; vpC = class_getSuperclass(vpC)) {
+ NSString *vpCN = @(class_getName(vpC));
+ if ([vpSeen containsObject:vpCN]) continue;
+ [vpSeen addObject:vpCN];
+ [vpOut appendFormat:@"== CLASS %@\n", vpCN];
+ unsigned int vpN = 0; Method *vpML = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vj = 0; vj < vpN; vj++) {
+ NSString *vpSel = NSStringFromSelector(method_getName(vpML[vj]));
+ if ([vpSel containsString:@":"]) continue;
+ char vpRT[256]; method_getReturnType(vpML[vj], vpRT, sizeof(vpRT));
+ [vpOut appendFormat:@"M %@ %@ %s\n", vpCN, vpSel, vpRT];
+ }
+ free(vpML);
+ unsigned int vpPN = 0; objc_property_t *vpPL = class_copyPropertyList(vpC, &vpPN);
+ for (unsigned int vj = 0; vj < vpPN; vj++) [vpOut appendFormat:@"P %@ %s %s\n", vpCN, property_getName(vpPL[vj]), property_getAttributes(vpPL[vj])];
+ free(vpPL);
+ unsigned int vpIN = 0; Ivar *vpIL = class_copyIvarList(vpC, &vpIN);
+ for (unsigned int vj = 0; vj < vpIN; vj++) [vpOut appendFormat:@"I %@ %s %s\n", vpCN, ivar_getName(vpIL[vj]), ivar_getTypeEncoding(vpIL[vj]) ?: ""];
+ free(vpIL);
+ }
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-merge.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-merge.zsh
new file mode 100755
index 00000000..16451df9
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-merge.zsh
@@ -0,0 +1,63 @@
+#!/bin/zsh
+# appkit-merge.zsh <udid|name> [out.json]
+# Merge raw/appkit/<app>/<scenario>/records.jsonl (written by probes/appkit-run.zsh) into
+# appkit.json in the README's record format. Extra per-record fields: scenario,
+# device_orientation_requested (the -deviceOrientation passed to posture.zsh), transcript.
+set -euo pipefail
+here=${0:a:h}
+root=${here:h}
+jq=/opt/homebrew/bin/jq
+udid=$($root/tools/sim.zsh udid ${1:?udid})
+out=${2:-$root/appkit.json}
+work=$(mktemp -d -t appkitmerge); trap 'rm -rf "$work"' EXIT
+
+files=()
+for app in Preferences MobileSafari VPAppKitProbe; do
+ for scenario in launch-closed launch-open launch-settled orientations; do
+ f=$root/raw/appkit/$app/$scenario/records.jsonl
+ [[ -s $f ]] && files+=($f)
+ done
+done
+cat $files > $work/records.jsonl
+postures=( $root/raw/appkit/*/*/[0-9][0-9]-*.posture.json(N) )
+for p in $postures; do
+ [[ -s $p ]] || continue
+ $jq -c --arg f "${p#$root/}" '. + {file: $f}' $p
+done > $work/postures.jsonl
+
+runtime=$(xcrun simctl list runtimes -j | $jq -c '.runtimes[] | select(.identifier == "com.apple.CoreSimulator.SimRuntime.iOS-27-1") | {identifier, version, buildversion}')
+device=$(xcrun simctl list devices -j | $jq -c --arg u $udid '.devices[] | .[] | select(.udid == $u) | {name, udid, deviceTypeIdentifier}')
+xcode=$(xcodebuild -version | tr '\n' ' ' | sed 's/ *$//')
+
+$jq -n --argjson runtime "$runtime" --argjson device "$device" --arg xcode "$xcode" \
+ --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg host "$(sw_vers -productVersion) $(sysctl -n machdep.cpu.brand_string)" \
+ --slurpfile recs $work/records.jsonl --slurpfile post $work/postures.jsonl '
+ {
+ meta: {
+ domain: "appkit", runtime: $runtime, device: $device, xcode: $xcode, host: $host, date: $date,
+ posture_mechanism: "SBDisplayToolServiceCoordinator performDisplaySwapWithSettings: (tools/posture.zsh); -deviceOrientation= sets the device orientation that SpringBoard and the app see",
+ apps: {
+ Preferences: "com.apple.Preferences",
+ MobileSafari: "com.apple.mobilesafari",
+ VPAppKitProbe: "com.vphone.duobaseline.appkitprobe: minimal ObjC UIKit app, all 4 orientations in Info.plist, one window scene, UIDeviceFamily 1; source raw/appkit/probe-app (build.zsh); logs every scene/geometry/trait/screen/hinge callback to Documents/events.jsonl"
+ },
+ scenarios: {
+ "launch-closed": "closed (portrait) -> launch app -> book (anchored at closed) -> open (from book) -> closed",
+ "launch-open": "open (portrait) -> launch app -> book (from open, no anchor) -> closed -> open",
+ "launch-settled": "closed -> launch, probe 15 s later; open -> launch, probe 15 s later. The launch-closed and launch-open launch snapshots are taken 6 s after simctl launch: Preferences and MobileSafari open(launched-open) were still foregroundInactive there (activationState 1, deactivationReasons 32, view bounds 0x0); use the settled15s snapshots as the steady state",
+ "orientations": "open portrait -> launch -> open landscapeLeft, landscapeRight -> book landscapeLeft (anchored at closed) -> book landscapeRight (no anchor) -> closed landscapeLeft, landscapeRight -> closed portrait"
+ },
+ record_fields: "README record format plus: scenario, device_orientation_requested (posture.zsh -deviceOrientation), transcript (probe transcript). orientation = the app window scene effectiveGeometry.interfaceOrientation. posture = posture plus the path that led there, e.g. book(after-closed); open(launched-open) = the app was launched in that posture",
+ enums: {
+ UIInterfaceOrientation: "1 portrait, 2 portraitUpsideDown, 3 landscapeLeft, 4 landscapeRight",
+ UIDeviceOrientation: "1 portrait, 2 portraitUpsideDown, 3 landscapeLeft, 4 landscapeRight, 5 faceUp, 6 faceDown",
+ UIInterfaceOrientationMask: "2 portrait, 4 upsideDown, 8 landscapeRight, 16 landscapeLeft; 26 = all but upside down, 30 = all",
+ UIUserInterfaceSizeClass: "1 compact, 2 regular",
+ UISceneActivationState: "-1 unattached, 0 foregroundActive, 1 foregroundInactive, 2 background",
+ UIHingeStatus: "0 unknown, 1 closed, 2 partiallyOpen, 3 fullyOpen; UIHinge.angle is in radians"
+ },
+ postures: $post
+ },
+ records: [ $recs[] | {api, kind, process, posture, orientation, call, value, error, scenario, device_orientation_requested, transcript} ]
+ }' > $out
+print -- "appkit-merge.zsh: $($jq '.records | length' $out) records, $($jq '.meta.postures | length' $out) posture runs -> $out"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-run.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-run.zsh
new file mode 100755
index 00000000..2e274e45
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-run.zsh
@@ -0,0 +1,130 @@
+#!/bin/zsh
+# appkit-run.zsh <udid|name> <app> [scenario ...]
+#
+# appkit domain driver: what a foreground app sees (UIKit geometry, scene migration).
+# app: Preferences | MobileSafari | VPAppKitProbe
+# scenarios: launch-closed launch closed (cover), unfold book, open, fold closed
+# launch-open launch open (inner), fold to book (no anchor), closed, unfold open
+# launch-settled closed and open launches probed 15 s after launch (the others: 6 s)
+# orientations landscapeLeft/Right in open, book and closed, then portrait closed
+# Each state: tools/posture.zsh, then probes/appkit-scenes.lldb in the app, screenshots of both
+# panels, and (VPAppKitProbe only) the app's own callback log since the posture change started.
+# Output: raw/appkit/<app>/<scenario>/NN-<label>.{txt,json,...} and one tagged record file
+# raw/appkit/<app>/<scenario>/records.jsonl (merged into appkit.json by probes/appkit-merge.zsh).
+set -euo pipefail
+here=${0:a:h}
+root=${here:h}
+tools=$root/tools
+jq=/opt/homebrew/bin/jq
+udid=$($tools/sim.zsh udid ${1:?udid})
+app=${2:?app}; shift 2
+case $app in
+ Preferences) bundle=com.apple.Preferences ;;
+ MobileSafari) bundle=com.apple.mobilesafari ;;
+ VPAppKitProbe) bundle=com.vphone.duobaseline.appkitprobe ;;
+ *) print -u2 "unknown app $app"; exit 2 ;;
+esac
+scenarios=("$@"); (( ${#scenarios} )) || scenarios=(launch-closed launch-open orientations)
+events() { print -- "$(xcrun simctl get_app_container $udid $bundle data)/Documents/events.jsonl" }
+
+# drive <label> <posture args...>: posture.zsh with one retry after the 10 s testing lock.
+drive() {
+ local label=$1; shift
+ local rc=0
+ t0=$(perl -MTime::HiRes=time -e 'printf "%.3f", time')
+ POSTURE_ANCHOR=${anchor:-} POSTURE_OUT=$dir/posture $tools/posture.zsh $udid "$@" > $dir/$n-$label.posture.json 2> $dir/$n-$label.posture.err || rc=$?
+ if (( rc == 3 )); then
+ print -u2 "appkit-run: $label did not verify; status, wait out the lock, retry"
+ POSTURE_OUT=$dir/posture $tools/posture.zsh $udid status > $dir/$n-$label.status-before-retry.json 2>/dev/null || true
+ sleep 11; rc=0
+ POSTURE_ANCHOR=${anchor:-} POSTURE_OUT=$dir/posture $tools/posture.zsh $udid "$@" > $dir/$n-$label.posture.json 2>> $dir/$n-$label.posture.err || rc=$?
+ fi
+ print -u2 "appkit-run: [$app/$scenario] $n $label posture rc=$rc $($jq -c '{ok, hinge: .springboard.hinge_state, lit: .screenshots.lit_panel}' $dir/$n-$label.posture.json 2>/dev/null)"
+ last_post=$dir/$n-$label.posture.json; anchor=""
+ sleep 2
+}
+
+# snap <posture-label> <device-orientation-requested>
+snap() {
+ local plabel=$1 devo=$2 base=$dir/$n-${1//[()]/_}
+ sleep 1
+ $tools/probe.zsh $udid $app $here/appkit-scenes.lldb $base.txt 2>> $dir/probe.err || print -u2 "appkit-run: probe rc=$?"
+ local shots; shots=$($tools/sim.zsh shot $udid $dir/shots $n-${1//[()]/_})
+ local line; line=$(grep -E '^\{"(records|orientation)"' $base.txt || true)
+ [[ -n $line ]] || { print -u2 "appkit-run: no JSON in $base.txt"; line='{"orientation":0,"records":[{"api":"harness.probe","kind":"private","call":"probes/appkit-scenes.lldb","value":null,"error":"probe produced no JSON; see transcript"}]}' }
+ print -r -- "$line" > $base.json
+ local evjson='[]'
+ if [[ $app == VPAppKitProbe && -n ${t0:-} ]]; then
+ evjson=$($jq -c --argjson t0 $t0 -s '[ .[] | select(.t + 978307200 >= $t0) |
+ {t_rel: ((.t + 978307200 - $t0) * 1000 | round / 1000), event, detail,
+ sceneBounds: .snapshot.sceneBounds, geometryBounds: .snapshot.geometryBounds, interfaceOrientation: .snapshot.interfaceOrientation,
+ hsc: .snapshot.hsc, vsc: .snapshot.vsc, screen: .snapshot.screen, screenIsMain: .snapshot.screenIsMain, screens: (.snapshot.screens | length),
+ screenBounds: .snapshot.screenBounds, windowSafeArea: .snapshot.windowSafeArea, deviceOrientation: .snapshot.deviceOrientation,
+ activationState: .snapshot.activationState} ]' "$(events)")
+ fi
+ $jq -c -n --argjson p "$(cat $base.json)" --arg process $app --arg posture "$plabel" --arg devo "$devo" --arg scenario $scenario \
+ --arg shots "$shots" --argjson post "$( [[ -n ${last_post:-} && -s $last_post ]] && cat $last_post || print null)" --arg t0 "${t0:-}" --argjson ev "$evjson" \
+ --arg transcript "${base#$root/}.txt" --arg rootp "$root/" '
+ def orient: {"1": "portrait", "2": "portraitUpsideDown", "3": "landscapeLeft", "4": "landscapeRight"}[tostring] // "unknown";
+ def tag: . + {process: $process, posture: $posture, orientation: ($p.orientation | orient),
+ device_orientation_requested: $devo, scenario: $scenario, transcript: $transcript};
+ ($p.records[] | {api, kind, process: null, posture: null, orientation: null, call, value, error} | tag),
+ ({api: "harness.postureDriver", kind: "private", call: "tools/posture.zsh JSON for the posture change before this probe (null: no posture change, e.g. after a relaunch)", value: $post, error: null} | tag),
+ ({api: "harness.screenshots", kind: "private", call: "tools/sim.zsh shot (display 1 = cover, display 3 = inner)",
+ value: ($shots | split("\n") | map(split(" ") | {path: (.[0] | sub($rootp; "")), state: .[1]})), error: null} | tag),
+ (if $app_is_probe then
+ {api: "VPAppKitProbe.callbackSequence", kind: "public",
+ call: "UIWindowSceneDelegate / UISceneDelegate / UIViewController / UIHingeInteraction / NSNotification callbacks logged by raw/appkit/probe-app since the posture change started (t_rel seconds after posture.zsh was invoked; the swap itself begins after its lldb detach, ~3-4 s later)",
+ value: $ev, error: (if ($ev | length) == 0 then "no callbacks since the posture change started" else null end)} | tag
+ else empty end)
+ ' --argjson app_is_probe $([[ $app == VPAppKitProbe ]] && print true || print false) >> $dir/records.jsonl
+ print -u2 "appkit-run: [$app/$scenario] $n snap $plabel ($devo): $($jq -c '[.orientation, (.records|length)]' $base.json) $(print -- $shots | awk '{printf "%s ", $2}')"
+ t0=""; last_post=""
+ n=$(printf %02d $((10#$n + 1)))
+}
+
+relaunch() {
+ xcrun simctl terminate $udid $bundle >/dev/null 2>&1 || true
+ sleep 1
+ t0=$(perl -MTime::HiRes=time -e 'printf "%.3f", time')
+ xcrun simctl launch $udid $bundle > /dev/null
+ sleep ${1:-5}
+}
+
+for scenario in $scenarios; do
+ dir=$root/raw/appkit/$app/$scenario
+ rm -rf $dir; mkdir -p $dir
+ n=01; t0=""
+ case $scenario in
+ launch-closed)
+ drive closed closed -deviceOrientation=portrait
+ relaunch; snap "closed(launched-closed)" portrait
+ drive book book; snap "book(after-closed)" portrait
+ anchor=none drive open open; snap "open(after-book)" portrait
+ drive closed closed; snap "closed(after-open)" portrait ;;
+ launch-open)
+ drive open open -deviceOrientation=portrait
+ relaunch; snap "open(launched-open)" portrait
+ anchor=none drive book book; snap "book(after-open)" portrait
+ drive closed closed; snap "closed(after-book)" portrait
+ drive open open; snap "open(after-closed)" portrait ;;
+ orientations)
+ drive open open -deviceOrientation=portrait
+ relaunch; snap "open(launched-open)" portrait
+ for o in landscapeLeft landscapeRight; do
+ drive open open -deviceOrientation=$o; snap "open" $o
+ done
+ drive book book -deviceOrientation=landscapeLeft; snap "book(after-closed)" landscapeLeft
+ anchor=none drive book book -deviceOrientation=landscapeRight; snap "book" landscapeRight
+ drive closed closed -deviceOrientation=landscapeLeft; snap "closed(after-book)" landscapeLeft
+ drive closed closed -deviceOrientation=landscapeRight; snap "closed" landscapeRight
+ drive closed closed -deviceOrientation=portrait; snap "closed" portrait ;;
+ launch-settled)
+ drive closed closed -deviceOrientation=portrait
+ relaunch 15; snap "closed(launched-closed,settled15s)" portrait
+ drive open open
+ relaunch 15; snap "open(launched-open,settled15s)" portrait ;;
+ *) print -u2 "unknown scenario $scenario"; exit 2 ;;
+ esac
+ [[ $app == VPAppKitProbe ]] && cp "$(events)" $dir/events.jsonl
+done
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-scenes.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-scenes.lldb
new file mode 100644
index 00000000..6c3a4017
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/appkit-scenes.lldb
@@ -0,0 +1,248 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vpApi, NSString *vpKind, NSString *vpCallArg, id vpValue, NSString *vpError) {
+ [[NSThread currentThread] threadDictionary][@"vpAppkitLast"] = vpCallArg;
+ id vpVal = vpValue;
+ if (vpVal && ![NSJSONSerialization isValidJSONObject:@[vpVal]]) { vpVal = [NSString stringWithFormat:@"%@", vpVal]; vpError = vpError ?: @"value not representable in JSON (NaN, infinity or a non-JSON object); recorded as its string form"; }
+ [vpRecs addObject:@{@"api": vpApi, @"kind": vpKind, @"call": vpCallArg, @"value": vpVal ?: [NSNull null], @"error": vpError ?: [NSNull null]}];
+};
+// Non-finite doubles become the strings "inf", "-inf" or "nan" (JSON has no such numbers).
+id (^vpNum)(double) = ^id(double vpDbl) { if (vpDbl - vpDbl == 0) return (id)@(vpDbl); return (id)(vpDbl != vpDbl ? @"nan" : (vpDbl > 0 ? @"inf" : @"-inf")); };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vpRc) {
+ return @{@"x": vpNum(vpRc.origin.x), @"y": vpNum(vpRc.origin.y), @"width": vpNum(vpRc.size.width), @"height": vpNum(vpRc.size.height)};
+};
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vpIn) {
+ return @{@"top": vpNum(vpIn.top), @"left": vpNum(vpIn.left), @"bottom": vpNum(vpIn.bottom), @"right": vpNum(vpIn.right)};
+};
+id (^vpConv)(id) = ^id(id vpR) {
+ if (!vpR) return (id)nil;
+ if ([(NSObject *)vpR isKindOfClass:[NSNumber class]] || [(NSObject *)vpR isKindOfClass:[NSString class]]) return vpR;
+ if ([(NSObject *)vpR isKindOfClass:[NSValue class]]) {
+ NSValue *vpNV = (NSValue *)vpR;
+ NSString *vpT = @([vpNV objCType]);
+ if ([vpT hasPrefix:@"{CGRect"]) return (id)vpRect([vpNV CGRectValue]);
+ if ([vpT hasPrefix:@"{CGSize"]) { CGSize vpSz = [vpNV CGSizeValue]; return (id)@{@"width": @(vpSz.width), @"height": @(vpSz.height)}; }
+ if ([vpT hasPrefix:@"{CGPoint"]) { CGPoint vpPt = [vpNV CGPointValue]; return (id)@{@"x": @(vpPt.x), @"y": @(vpPt.y)}; }
+ if ([vpT hasPrefix:@"{UIEdgeInsets"]) return (id)vpInsets([vpNV UIEdgeInsetsValue]);
+ if ([vpT hasPrefix:@"{NSDirectionalEdgeInsets"]) { NSDirectionalEdgeInsets vpD = [vpNV directionalEdgeInsetsValue]; return (id)@{@"top": @(vpD.top), @"leading": @(vpD.leading), @"bottom": @(vpD.bottom), @"trailing": @(vpD.trailing)}; }
+ NSUInteger vpSize = 0; NSGetSizeAndAlignment([vpNV objCType], &vpSize, NULL);
+ NSString *vpFlat = [[[NSRegularExpression regularExpressionWithPattern:@"\\{[^=]*=|\\}" options:0 error:nil] stringByReplacingMatchesInString:vpT options:0 range:NSMakeRange(0, vpT.length) withTemplate:@""] copy];
+ NSMutableArray *vpEl = [NSMutableArray array];
+ unsigned char *vpBuf = (unsigned char *)calloc(1, vpSize + 16);
+ [vpNV getValue:vpBuf size:vpSize];
+ if (vpFlat.length > 0 && [[vpFlat stringByReplacingOccurrencesOfString:@"d" withString:@""] length] == 0 && vpSize == 8 * vpFlat.length) {
+ for (NSUInteger vk = 0; vk < vpFlat.length; vk++) [vpEl addObject:vpNum(((double *)vpBuf)[vk])];
+ } else if (vpFlat.length > 0 && [[[vpFlat stringByReplacingOccurrencesOfString:@"c" withString:@""] stringByReplacingOccurrencesOfString:@"C" withString:@""] length] == 0 && vpSize == vpFlat.length) {
+ for (NSUInteger vk = 0; vk < vpSize; vk++) [vpEl addObject:@((int)(signed char)vpBuf[vk])];
+ } else if (vpFlat.length > 0 && [[[vpFlat stringByReplacingOccurrencesOfString:@"q" withString:@""] stringByReplacingOccurrencesOfString:@"Q" withString:@""] length] == 0 && vpSize == 8 * vpFlat.length) {
+ for (NSUInteger vk = 0; vk < vpFlat.length; vk++) [vpEl addObject:@(((long long *)vpBuf)[vk])];
+ }
+ free(vpBuf);
+ if (vpEl.count) return (id)@{@"objCType": vpT, @"elements": vpEl};
+ return (id)@{@"objCType": vpT, @"description": [(NSObject *)vpNV description]};
+ }
+ return (id)[(NSObject *)vpR description];
+};
+// Call a zero-argument getter with NSInvocation and box the result (no KVC: FBSSettings and
+// other classes override valueForKey:, and an exception would abort the whole expression).
+id (^vpInvoke)(id, NSString *) = ^id(id vpTarget, NSString *vpKey) {
+ SEL vpSel = NSSelectorFromString(vpKey);
+ NSMethodSignature *vpSig = [(NSObject *)vpTarget methodSignatureForSelector:vpSel];
+ if (!vpSig || vpSig.numberOfArguments != 2) return (id)nil;
+ const char *vpRT = vpSig.methodReturnType;
+ NSUInteger vpLen = vpSig.methodReturnLength;
+ NSInvocation *vpInv = [NSInvocation invocationWithMethodSignature:vpSig];
+ vpInv.target = vpTarget; vpInv.selector = vpSel;
+ [vpInv invoke];
+ if (vpRT[0] == '@') { __unsafe_unretained id vpO = nil; [vpInv getReturnValue:&vpO]; return vpO; }
+ if (vpRT[0] == 'v' || vpLen == 0) return (id)@"<void>";
+ unsigned char *vpB = (unsigned char *)calloc(1, vpLen + 16);
+ [vpInv getReturnValue:vpB];
+ id vpBox = nil;
+ switch (vpRT[0]) {
+ case 'c': vpBox = @(*(signed char *)vpB); break;
+ case 'C': vpBox = @(*(unsigned char *)vpB); break;
+ case 'B': vpBox = @(*(bool *)vpB); break;
+ case 's': vpBox = @(*(short *)vpB); break;
+ case 'S': vpBox = @(*(unsigned short *)vpB); break;
+ case 'i': vpBox = @(*(int *)vpB); break;
+ case 'I': vpBox = @(*(unsigned int *)vpB); break;
+ case 'l': vpBox = @(*(long *)vpB); break;
+ case 'L': vpBox = @(*(unsigned long *)vpB); break;
+ case 'q': vpBox = @(*(long long *)vpB); break;
+ case 'Q': vpBox = @(*(unsigned long long *)vpB); break;
+ case 'f': vpBox = vpNum(*(float *)vpB); break;
+ case 'd': vpBox = vpNum(*(double *)vpB); break;
+ case '#': vpBox = @(class_getName(*(Class *)vpB)); break;
+ case ':': vpBox = NSStringFromSelector(*(SEL *)vpB); break;
+ default: vpBox = [NSValue valueWithBytes:vpB objCType:vpRT]; break;
+ }
+ free(vpB);
+ return vpBox;
+};
+// Getter through NSInvocation, guarded by respondsToSelector (an exception would abort the expression).
+void (^vpGet)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vpApi, NSString *vpKind, NSString *vpLabel, id vpTarget, NSString *vpKey) {
+ NSString *vpCall = [NSString stringWithFormat:@"%@.%@", vpLabel, vpKey];
+ if (!vpTarget) { vpAdd(vpApi, vpKind, vpCall, nil, @"receiver is nil"); return; }
+ if (![(NSObject *)vpTarget respondsToSelector:NSSelectorFromString(vpKey)]) { vpAdd(vpApi, vpKind, vpCall, nil, [NSString stringWithFormat:@"%s does not respond to %@", class_getName(object_getClass(vpTarget)), vpKey]); return; }
+ [[NSThread currentThread] threadDictionary][@"vpAppkitLast"] = vpCall;
+ id vpR = vpConv(vpInvoke(vpTarget, vpKey));
+ vpAdd(vpApi, vpKind, vpCall, vpR, vpR ? nil : @"returned nil");
+};
+id (^vpObj)(id, NSString *) = ^id(id vpTarget, NSString *vpKey) {
+ return (vpTarget && [(NSObject *)vpTarget respondsToSelector:NSSelectorFromString(vpKey)]) ? vpInvoke(vpTarget, vpKey) : nil;
+};
+UIApplication *vpApp = [UIApplication sharedApplication];
+NSArray *vpScreens = [UIScreen screens];
+UIScreen *vpMain = [UIScreen mainScreen];
+NSString *(^vpScreenName)(UIScreen *) = ^NSString *(UIScreen *vpScr) {
+ if (!vpScr) return @"nil";
+ NSUInteger vpIdx = [vpScreens indexOfObjectIdenticalTo:vpScr];
+ return [NSString stringWithFormat:@"screens[%@] %@ %@", vpIdx == NSNotFound ? @"?" : @(vpIdx), [(NSObject *)vpObj(vpScr, @"_name") description], [(NSObject *)vpObj(vpScr, @"displayIdentity") description]];
+};
+// MARK: - process-level
+vpAdd(@"UIDevice.orientation", @"public", @"[UIDevice currentDevice].orientation", @([[UIDevice currentDevice] orientation]), nil);
+vpAdd(@"UIDevice.userInterfaceIdiom", @"public", @"[UIDevice currentDevice].userInterfaceIdiom", @([[UIDevice currentDevice] userInterfaceIdiom]), nil);
+vpAdd(@"UIApplication.connectedScenes", @"public", @"[UIApplication sharedApplication].connectedScenes.count", @(vpApp.connectedScenes.count), nil);
+vpAdd(@"UIApplication.openSessions", @"public", @"[UIApplication sharedApplication].openSessions.count", @(vpApp.openSessions.count), nil);
+for (NSString *vpK in @[@"supportsMultipleScenes", @"applicationState"]) vpGet([@"UIApplication." stringByAppendingString:vpK], @"public", @"[UIApplication sharedApplication]", vpApp, vpK);
+for (NSString *vpK in @[@"statusBarOrientation", @"statusBarFrame", @"interfaceOrientation", @"activeInterfaceOrientation", @"_appAdoptsUISceneLifecycle", @"_appSupportsMultipleScenes", @"_frontMostAppOrientation", @"_safeInterfaceOrientationForNoWindow", @"currentHingePoseStateForTesting", @"_mainScene"])
+ vpGet([@"UIApplication." stringByAppendingString:vpK], ([vpK isEqualToString:@"statusBarOrientation"] || [vpK isEqualToString:@"statusBarFrame"]) ? @"public" : @"private", @"[UIApplication sharedApplication]", vpApp, vpK);
+// MARK: - screens
+vpAdd(@"UIScreen.screens", @"public", @"[UIScreen screens].count", @(vpScreens.count), nil);
+vpAdd(@"UIScreen.mainScreen", @"public", @"[UIScreen mainScreen] (index in [UIScreen screens], _name, displayIdentity)", vpScreenName(vpMain), nil);
+for (NSUInteger vi = 0; vi < vpScreens.count; vi++) {
+ UIScreen *vpS = vpScreens[vi];
+ NSString *vpL = [NSString stringWithFormat:@"[UIScreen screens][%lu]", (unsigned long)vi];
+ vpAdd(@"UIScreen.isMainScreen", @"public", [vpL stringByAppendingString:@" == [UIScreen mainScreen]"], @(vpS == vpMain), nil);
+ for (NSString *vpK in @[@"bounds", @"nativeBounds", @"scale", @"nativeScale", @"maximumFramesPerSecond", @"overscanCompensationInsets", @"referenceDisplayModeStatus", @"isCaptured", @"applicationFrame", @"currentMode", @"preferredMode", @"traitCollection", @"brightness", @"calibratedLatency"])
+ vpGet([@"UIScreen." stringByAppendingString:vpK], @"public", vpL, vpS, vpK);
+ vpAdd(@"UIScreen.coordinateSpace.bounds", @"public", [vpL stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIScreen.fixedCoordinateSpace.bounds", @"public", [vpL stringByAppendingString:@".fixedCoordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpS.fixedCoordinateSpace, @selector(bounds))), nil);
+ for (NSString *vpK in @[@"displayIdentity", @"_name", @"_displayID", @"_integerDisplayID", @"gamut", @"_referenceBounds", @"_unjailedReferenceBounds", @"_nativeDisplayBounds", @"_mainSceneReferenceBounds", @"_mainSceneFrame", @"_interfaceOrientedMainSceneBounds", @"_interfaceOrientation", @"_applicationFrame", @"_displayCornerRadius", @"_displayCornerRadiusIgnoringZoom", @"_traitCollectionDisplayCornerRadius", @"_peripheryInsets", @"_displayPeripheryInsets", @"_isMainScreen", @"_isMainLikeScreen", @"_isEmbeddedScreen", @"_isExternal", @"_isRotatable", @"_screenType", @"_userInterfaceIdiom", @"_nativePointsPerMillimeter", @"_maximumSupportedScale", @"_wantsWideContentMargins", @"_imageOrientation", @"displayConfiguration"])
+ vpGet([@"UIScreen." stringByAppendingString:vpK], @"private", vpL, vpS, vpK);
+}
+// MARK: - scenes
+NSArray *vpScenes = [[vpApp.connectedScenes allObjects] sortedArrayUsingComparator:^NSComparisonResult(UIScene *vpSa, UIScene *vpSb) { return [vpSa.session.persistentIdentifier compare:vpSb.session.persistentIdentifier]; }];
+long long vpTagOrientation = 0;
+NSUInteger vpSi = 0;
+for (UIScene *vpSc in vpScenes) {
+ NSString *vpL = [NSString stringWithFormat:@"connectedScenes[%lu]<%@>", (unsigned long)vpSi++, vpSc.session.persistentIdentifier];
+ vpAdd(@"UIScene.class", @"public", [vpL stringByAppendingString:@".class"], @(class_getName([vpSc class])), nil);
+ vpAdd(@"UISceneSession.role", @"public", [vpL stringByAppendingString:@".session.role"], vpSc.session.role, nil);
+ vpAdd(@"UISceneSession.persistentIdentifier", @"public", [vpL stringByAppendingString:@".session.persistentIdentifier"], vpSc.session.persistentIdentifier, nil);
+ vpAdd(@"UISceneConfiguration.name", @"public", [vpL stringByAppendingString:@".session.configuration.name"], vpSc.session.configuration.name, vpSc.session.configuration.name ? nil : @"returned nil");
+ vpAdd(@"UISceneConfiguration.delegateClass", @"public", [vpL stringByAppendingString:@".session.configuration.delegateClass"], vpSc.session.configuration.delegateClass ? NSStringFromClass(vpSc.session.configuration.delegateClass) : nil, vpSc.session.configuration.delegateClass ? nil : @"returned nil");
+ vpAdd(@"UIScene.activationState", @"public", [vpL stringByAppendingString:@".activationState"], @(vpSc.activationState), nil);
+ vpAdd(@"UIScene.title", @"public", [vpL stringByAppendingString:@".title"], vpSc.title, vpSc.title ? nil : @"returned nil");
+ for (NSString *vpK in @[@"_sceneIdentifier", @"_identifier", @"_persistenceIdentifier", @"_referenceBounds", @"_safeAreaCornerInsets", @"_systemMinimumMargin", @"_isActive", @"_isRunningInTaskSwitcher", @"_affectsScreenOrientation"])
+ vpGet([@"UIScene." stringByAppendingString:vpK], @"private", vpL, vpSc, vpK);
+ if (![vpSc isKindOfClass:[UIWindowScene class]]) continue;
+ UIWindowScene *vpWS = (UIWindowScene *)vpSc;
+ if (vpTagOrientation == 0 || vpWS.activationState == UISceneActivationStateForegroundActive) vpTagOrientation = vpWS.effectiveGeometry.interfaceOrientation;
+ vpAdd(@"UIWindowScene.screen", @"public", [vpL stringByAppendingString:@".screen (index in [UIScreen screens], _name, displayIdentity)"], vpScreenName(vpWS.screen), nil);
+ vpAdd(@"UIWindowScene.screen.isMainScreen", @"public", [vpL stringByAppendingString:@".screen == [UIScreen mainScreen]"], @(vpWS.screen == vpMain), nil);
+ vpAdd(@"UIWindowScene.screen.bounds", @"public", [vpL stringByAppendingString:@".screen.bounds"], vpRect(vpWS.screen.bounds), nil);
+ vpAdd(@"UIWindowScene.screen.nativeBounds", @"public", [vpL stringByAppendingString:@".screen.nativeBounds"], vpRect(vpWS.screen.nativeBounds), nil);
+ vpAdd(@"UIWindowScene.screen.scale", @"public", [vpL stringByAppendingString:@".screen.scale"], @(vpWS.screen.scale), nil);
+ vpAdd(@"UIWindowScene.coordinateSpace.bounds", @"public", [vpL stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpWS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [vpL stringByAppendingString:@".interfaceOrientation"], @(vpWS.interfaceOrientation), nil);
+ UIWindowSceneGeometry *vpG = vpWS.effectiveGeometry;
+ NSString *vpGL = [vpL stringByAppendingString:@".effectiveGeometry"];
+ vpAdd(@"UIWindowSceneGeometry.description", @"public", [vpGL stringByAppendingString:@".description"], [(NSObject *)vpG description], nil);
+ vpAdd(@"UIWindowSceneGeometry.coordinateSpace.bounds", @"public", [vpGL stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpG.coordinateSpace, @selector(bounds))), nil);
+ for (NSString *vpK in @[@"interfaceOrientation", @"isInteractivelyResizing", @"isInterfaceOrientationLocked", @"resizingRestrictions", @"systemFrame"])
+ vpGet([@"UIWindowSceneGeometry." stringByAppendingString:vpK], ([vpK isEqualToString:@"systemFrame"]) ? @"private" : @"public", vpGL, vpG, vpK);
+ for (NSString *vpK in @[@"sizeRestrictions", @"isFullScreen", @"keyWindow", @"windowingBehaviors", @"focusSystem"])
+ vpGet([@"UIWindowScene." stringByAppendingString:vpK], @"public", vpL, vpWS, vpK);
+ for (NSString *vpK in @[@"_interfaceOrientation", @"_referenceBounds", @"_peripheryInsets", @"_safeAreaCornerInsets", @"_systemMinimumMargin", @"_currentlySupportedInterfaceOrientations", @"_supportedInterfaceOrientationsFromDelegate", @"_enhancedWindowingEnabled", @"_isKeyWindowScene", @"_isInLiveResize", @"_screenRequestedDisplayNativePixelSize", @"_resolvedOverscanCompensation", @"_usesSceneSettingBasedSafeAreaInsets", @"_usesMinimumSafeAreaInsets", @"_hasOrientationDependentSafeAreaEdgeInsets", @"_hasOrientationDependentSafeAreaCornerInsets", @"_hasStatusBarAxisDependentSafeAreas", @"_shouldRotateSafeAreaInsetsToInterfaceOrientation", @"_windowsIgnoreSceneClientOrientation", @"_canReceiveDeviceOrientationEvents", @"_systemUserInterfaceStyle", @"_orientationDebugDescription", @"interfaceElementCategory", @"sb_supportsResizing", @"avkit_screenType", @"sbh_screenType", @"sbf_displayProxyIdentifier", @"pui_fbsDisplayIdentity"])
+ vpGet([@"UIWindowScene." stringByAppendingString:vpK], @"private", vpL, vpWS, vpK);
+ UIStatusBarManager *vpSB = vpWS.statusBarManager;
+ NSString *vpSBL = [vpL stringByAppendingString:@".statusBarManager"];
+ for (NSString *vpK in @[@"statusBarFrame", @"isStatusBarHidden", @"statusBarStyle"]) vpGet([@"UIStatusBarManager." stringByAppendingString:vpK], @"public", vpSBL, vpSB, vpK);
+ for (NSString *vpK in @[@"statusBarHeight", @"defaultStatusBarHeight", @"statusBarAxis", @"_statusBarFrameIgnoringVisibility", @"statusBarAlpha"]) vpGet([@"UIStatusBarManager." stringByAppendingString:vpK], @"private", vpSBL, vpSB, vpK);
+ // trait collection
+ UITraitCollection *vpTC = vpWS.traitCollection;
+ NSString *vpTL = [vpL stringByAppendingString:@".traitCollection"];
+ for (NSString *vpK in @[@"horizontalSizeClass", @"verticalSizeClass", @"userInterfaceIdiom", @"displayScale", @"displayGamut", @"layoutDirection", @"forceTouchCapability", @"activeAppearance", @"userInterfaceStyle", @"userInterfaceLevel", @"preferredContentSizeCategory", @"accessibilityContrast", @"legibilityWeight", @"imageDynamicRange", @"sceneCaptureState", @"toolbarItemPresentationSize", @"listEnvironment", @"typesettingLanguage", @"splitViewControllerLayoutEnvironment", @"tabAccessoryEnvironment", @"hdrHeadroomUsageLimit", @"resolvesNaturalAlignmentWithBaseWritingDirection", @"systemPrefersReducedResourceUsage"])
+ vpGet([@"UITraitCollection." stringByAppendingString:vpK], @"public", vpTL, vpTC, vpK);
+ for (NSString *vpK in @[@"_displayCornerRadius", @"displayCornerRadius", @"primaryInteractionModel", @"interactionModel", @"touchLevel", @"artworkSubtype", @"glassUserInterfaceStyle", @"verticalBarEdge", @"_verticalBarEdge", @"_verticalBarEdgeInternal", @"_verticalBarAllowed", @"_verticalBarHorizontalEdge", @"_systemVerticalBarHorizontalEdge", @"_isInVerticalBar", @"_sceneBarPosition", @"_systemDisplayIdentifier", @"_sceneUserResizability", @"_windowSceneInterfaceOrientationBehavior", @"_splitViewControllerContext", @"_presentationSemanticContext", @"_userInterfaceRenderingMode", @"_viewControllerContentMarginStyle", @"_activationInteractionPolicy", @"_interfaceProtectionState", @"deviceDeterminedConfiguration", @"isSmallScreenDevice", @"_traitsDescription"])
+ vpGet([@"UITraitCollection." stringByAppendingString:vpK], @"private", vpTL, vpTC, vpK);
+ // FBSScene the client sees
+ NSObject *vpFBS = vpObj(vpWS, @"_FBSScene");
+ NSString *vpFL = [vpL stringByAppendingString:@"._FBSScene"];
+ for (NSString *vpK in @[@"identifier", @"ssk_surfaceType", @"ui_hingeState"]) vpGet([@"FBSScene." stringByAppendingString:vpK], @"private", vpFL, vpFBS, vpK);
+ vpGet(@"SBSUISurfaceTypeClientComponent.sbsui_surfaceType", @"private", [vpFL stringByAppendingString:@".sbsui_surfaceTypeClient"], vpObj(vpFBS, @"sbsui_surfaceTypeClient"), @"sbsui_surfaceType");
+ NSObject *vpHC = vpObj(vpFBS, @"ui_hingeStateClientComponent");
+ vpGet(@"_UISceneHingeStateClientComponent.hingeState", @"private", [vpFL stringByAppendingString:@".ui_hingeStateClientComponent"], vpHC, @"hingeState");
+ vpGet(@"_UISceneHingeStateClientComponent.sceneHingeState", @"private", [vpFL stringByAppendingString:@".ui_hingeStateClientComponent"], vpHC, @"sceneHingeState");
+ NSObject *vpSet = vpObj(vpFBS, @"settings");
+ NSString *vpSL = [vpFL stringByAppendingString:@".settings"];
+ vpAdd(@"FBSSceneSettings.class", @"private", [vpSL stringByAppendingString:@".class"], vpSet ? @(class_getName([vpSet class])) : nil, vpSet ? nil : @"nil");
+ for (NSString *vpK in @[@"frame", @"bounds", @"displayConfiguration", @"displayIdentity", @"interfaceOrientation", @"deviceOrientation", @"level", @"isForeground", @"isOccluded", @"isBackgrounded", @"interfaceOrientationMode", @"interfaceOrientationMapResolver", @"interfaceOrientationLockState", @"safeAreaInsetsPortrait", @"safeAreaInsetsPortraitUpsideDown", @"safeAreaInsetsLandscapeLeft", @"safeAreaInsetsLandscapeRight", @"safeAreaEdgeInsets", @"safeAreaCornerInsets", @"peripheryInsets", @"cornerRadiusConfiguration", @"statusBarHeight", @"statusBarParts", @"statusBarAvoidanceFrame", @"statusBarDisabled", @"homeAffordanceOverlayAllowance", @"homeAffordanceSceneReferenceFrame", @"systemMinimumMargin", @"screenReferenceDisplayModeStatus", @"screenBoundsIgnoresSceneOrientation", @"angleFromHostReferenceUprightDirection", @"hostReferenceAngleMode", @"enhancedWindowingEnabled", @"inLiveResize", @"_userResizability", @"activeAppearance", @"systemDisplayIdentifier", @"horizontalSizeClassResolver", @"verticalSizeClassResolver", @"sceneRegions", @"ssk_surfaceType", @"systemShellHostingSpaceIdentifier", @"sceneHingeState", @"hingeAngle", @"hingeStatus", @"nextHingeStatus", @"nextHingeStatusProgress", @"magicPose", @"sceneFrameInKeyboardReferenceSpace", @"preferredKeyboardNamespaceIdentifier", @"barPositionResolver", @"barAlignmentResolver", @"barSizeClassResolver", @"systemProvidesVerticalBars", @"userInterfaceStyle", @"persistenceIdentifier", @"traitCollection", @"isCapturingContentForAdditionalRenderingDestination", @"deactivationReasons", @"underLock", @"canShowAlerts"])
+ vpGet([@"FBSSceneSettings." stringByAppendingString:vpK], @"private", vpSL, vpSet, vpK);
+ NSObject *vpDC = vpObj(vpSet, @"displayConfiguration");
+ NSString *vpDL = [vpSL stringByAppendingString:@".displayConfiguration"];
+ for (NSString *vpK in @[@"name", @"identity", @"deviceName", @"hardwareIdentifier", @"uniqueIdentifier", @"bounds", @"_nativeBounds", @"pixelSize", @"scale", @"pointScale", @"nativeOrientation", @"_nativeRotation", @"isMainDisplay", @"isMainRootDisplay", @"isExternal", @"type", @"tags", @"refreshRate", @"colorGamut", @"currentMode"])
+ vpGet([@"FBSDisplayConfiguration." stringByAppendingString:vpK], @"private", vpDL, vpDC, vpK);
+ NSObject *vpCS = vpObj(vpFBS, @"clientSettings");
+ NSString *vpCL = [vpFL stringByAppendingString:@".clientSettings"];
+ for (NSString *vpK in @[@"interfaceOrientation", @"supportedInterfaceOrientations", @"preferredInterfaceOrientation", @"interfaceOrientationLockPreference", @"primaryWindowOverlayInsets", @"statusBarHidden", @"statusBarAxis", @"compatibilityMode", @"wantsSceneHingeState", @"deviceOrientationEventsEnabled", @"preferredContentSize", @"preferredMinimumWidth", @"preferredMinimumHeight", @"preferredMaximumWidth", @"preferredMaximumHeight", @"pairedSceneDisplayConfiguration", @"pairedSceneInterfaceOrientation", @"requestedDisplayMode", @"displayConfigurationRequest"])
+ vpGet([@"FBSSceneClientSettings." stringByAppendingString:vpK], @"private", vpCL, vpCS, vpK);
+ vpAdd(@"FBSSceneSettings.description", @"private", [vpSL stringByAppendingString:@".description"], [vpSet description], vpSet ? nil : @"nil");
+ vpAdd(@"FBSSceneClientSettings.description", @"private", [vpCL stringByAppendingString:@".description"], [vpCS description], vpCS ? nil : @"nil");
+ // windows
+ NSUInteger vpWi = 0;
+ for (UIWindow *vpW in vpWS.windows) {
+ NSString *vpWL = [NSString stringWithFormat:@"%@.windows[%lu]<%s>", vpL, (unsigned long)vpWi++, class_getName([vpW class])];
+ vpAdd(@"UIWindow.class", @"public", [vpWL stringByAppendingString:@".class"], @(class_getName([vpW class])), nil);
+ vpAdd(@"UIWindow.frame", @"public", [vpWL stringByAppendingString:@".frame"], vpRect(vpW.frame), nil);
+ vpAdd(@"UIWindow.bounds", @"public", [vpWL stringByAppendingString:@".bounds"], vpRect(vpW.bounds), nil);
+ vpAdd(@"UIWindow.safeAreaInsets", @"public", [vpWL stringByAppendingString:@".safeAreaInsets"], vpInsets(vpW.safeAreaInsets), nil);
+ vpAdd(@"UIWindow.layoutMargins", @"public", [vpWL stringByAppendingString:@".layoutMargins"], vpInsets(vpW.layoutMargins), nil);
+ NSDirectionalEdgeInsets vpDM = vpW.directionalLayoutMargins;
+ vpAdd(@"UIWindow.directionalLayoutMargins", @"public", [vpWL stringByAppendingString:@".directionalLayoutMargins"], @{@"top": @(vpDM.top), @"leading": @(vpDM.leading), @"bottom": @(vpDM.bottom), @"trailing": @(vpDM.trailing)}, nil);
+ vpAdd(@"UIWindow.screen", @"public", [vpWL stringByAppendingString:@".screen"], vpScreenName(vpW.screen), nil);
+ vpAdd(@"UIWindow.isKeyWindow", @"public", [vpWL stringByAppendingString:@".isKeyWindow"], @(vpW.isKeyWindow), nil);
+ vpAdd(@"UIWindow.isHidden", @"public", [vpWL stringByAppendingString:@".isHidden"], @(vpW.isHidden), nil);
+ vpAdd(@"UIWindow.windowLevel", @"public", [vpWL stringByAppendingString:@".windowLevel"], @(vpW.windowLevel), nil);
+ vpAdd(@"UIWindow.traitCollection.sizeClasses", @"public", [vpWL stringByAppendingString:@".traitCollection.{horizontal,vertical}SizeClass"], @{@"horizontal": @(vpW.traitCollection.horizontalSizeClass), @"vertical": @(vpW.traitCollection.verticalSizeClass)}, nil);
+ vpAdd(@"UIApplication.supportedInterfaceOrientationsForWindow", @"public", [NSString stringWithFormat:@"[UIApplication supportedInterfaceOrientationsForWindow:%@]", vpWL], @([vpApp supportedInterfaceOrientationsForWindow:vpW]), nil);
+ for (NSString *vpK in @[@"_sceneReferenceBounds", @"_sceneBounds", @"_sceneBoundsInWindowOrientation", @"_usableSceneBounds", @"interfaceOrientation", @"_windowInterfaceOrientation", @"_sceneOrientation", @"_sceneClientOrientation", @"_orientationInSceneSpace", @"_normalizedSafeAreaInsets", @"_safeAreaCornerInsets", @"_statusBarAxisForSafeAreaInsets", @"_isSceneSized", @"_supportedInterfaceOrientationsForRootViewController", @"_preferredInterfaceOrientationForRootViewController", @"_orientationDebugDescription"])
+ vpGet([@"UIWindow." stringByAppendingString:vpK], @"private", vpWL, vpW, vpK);
+ UIViewController *vpRVC = vpW.rootViewController;
+ vpAdd(@"UIWindow.rootViewController.class", @"public", [vpWL stringByAppendingString:@".rootViewController.class"], vpRVC ? @(class_getName([vpRVC class])) : nil, vpRVC ? nil : @"returned nil");
+ if (!vpRVC) continue;
+ vpAdd(@"UIViewController.view.bounds", @"public", [vpWL stringByAppendingString:@".rootViewController.view.bounds"], vpRect(vpRVC.view.bounds), nil);
+ vpAdd(@"UIViewController.view.safeAreaInsets", @"public", [vpWL stringByAppendingString:@".rootViewController.view.safeAreaInsets"], vpInsets(vpRVC.view.safeAreaInsets), nil);
+ vpAdd(@"UIViewController.view.layoutMargins", @"public", [vpWL stringByAppendingString:@".rootViewController.view.layoutMargins"], vpInsets(vpRVC.view.layoutMargins), nil);
+ vpAdd(@"UIViewController.additionalSafeAreaInsets", @"public", [vpWL stringByAppendingString:@".rootViewController.additionalSafeAreaInsets"], vpInsets(vpRVC.additionalSafeAreaInsets), nil);
+ vpAdd(@"UIViewController.supportedInterfaceOrientations", @"public", [vpWL stringByAppendingString:@".rootViewController.supportedInterfaceOrientations"], @([vpRVC supportedInterfaceOrientations]), nil);
+ vpAdd(@"UIViewController.traitCollection.sizeClasses", @"public", [vpWL stringByAppendingString:@".rootViewController.traitCollection.{horizontal,vertical}SizeClass"], @{@"horizontal": @(vpRVC.traitCollection.horizontalSizeClass), @"vertical": @(vpRVC.traitCollection.verticalSizeClass)}, nil);
+ // view controller tree, split views
+ NSMutableArray *vpTree = [NSMutableArray array];
+ NSMutableArray *vpStack = [NSMutableArray arrayWithObject:@[vpRVC, @0]];
+ while (vpStack.count && vpTree.count < 60) {
+ NSArray *vpTop = vpStack.lastObject; [vpStack removeLastObject];
+ UIViewController *vpVC = vpTop[0]; long vpDepth = [(NSNumber *)vpTop[1] longValue];
+ NSMutableString *vpLine = [NSMutableString stringWithFormat:@"%@%s view=%@", [@"" stringByPaddingToLength:vpDepth * 2 withString:@" " startingAtIndex:0], class_getName([vpVC class]), NSStringFromCGRect(vpVC.isViewLoaded ? vpVC.view.frame : CGRectZero)];
+ if ([vpVC isKindOfClass:[UISplitViewController class]]) {
+ UISplitViewController *vpSplit = (UISplitViewController *)vpVC;
+ [vpLine appendFormat:@" split{collapsed=%d displayMode=%ld style=%ld splitBehavior=%ld primaryColumnWidth=%.1f supplementaryColumnWidth=%.1f viewControllers=%lu}", vpSplit.isCollapsed, (long)vpSplit.displayMode, (long)vpSplit.style, (long)vpSplit.splitBehavior, vpSplit.primaryColumnWidth, vpSplit.supplementaryColumnWidth, (unsigned long)vpSplit.viewControllers.count];
+ vpAdd(@"UISplitViewController.state", @"public", [NSString stringWithFormat:@"%@ split VC %s {isCollapsed, displayMode, style, splitBehavior, primaryColumnWidth, viewControllers.count}", vpWL, class_getName([vpVC class])],
+ @{@"isCollapsed": @(vpSplit.isCollapsed), @"displayMode": @(vpSplit.displayMode), @"style": @(vpSplit.style), @"splitBehavior": @(vpSplit.splitBehavior), @"primaryColumnWidth": @(vpSplit.primaryColumnWidth), @"supplementaryColumnWidth": @(vpSplit.supplementaryColumnWidth), @"viewControllers": @(vpSplit.viewControllers.count), @"traitHorizontalSizeClass": @(vpSplit.traitCollection.horizontalSizeClass)}, nil);
+ }
+ [vpTree addObject:vpLine];
+ NSArray *vpKids = vpVC.childViewControllers;
+ for (NSInteger vk = (NSInteger)vpKids.count - 1; vk >= 0; vk--) [vpStack addObject:@[vpKids[vk], @(vpDepth + 1)]];
+ if (vpVC.presentedViewController && vpVC.presentedViewController.presentingViewController == vpVC) [vpStack addObject:@[vpVC.presentedViewController, @(vpDepth + 1)]];
+ }
+ vpAdd(@"UIViewController.hierarchy", @"public", [vpWL stringByAppendingString:@".rootViewController childViewControllers tree (class, view.frame, split state)"], [vpTree componentsJoinedByString:@"\n"], nil);
+ }
+}
+[[[NSThread currentThread] threadDictionary] removeObjectForKey:@"vpAppkitLast"];
+NSDictionary *vpOut = @{@"orientation": @(vpTagOrientation), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpOut options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-assemble.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-assemble.zsh
new file mode 100755
index 00000000..b97db783
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-assemble.zsh
@@ -0,0 +1,73 @@
+#!/bin/zsh
+# chrome-assemble.zsh: merge raw/chrome/<label>-{state,lock}.txt into chrome.json (README record format plus
+# extra fields: run, screen, display, scene, deviceOrientation, sceneInterfaceOrientation).
+set -euo pipefail
+root=${0:a:h:h}; cd $root
+jq=/opt/homebrew/bin/jq
+U=A9C09C26-9AD3-4DF7-809D-E155D2D3F544
+work=$(mktemp -d -t chromeasm); trap 'rm -rf "$work"' EXIT
+# label | posture(path) | deviceOrientation passed to the swap | note
+runs=(
+ "closed-boot|closed(boot)|none|fresh boot, never unfolded; lock screen captured first (locked at boot by lldb lockUIFromSource:1), then home after unlock"
+ "open-after-closed|open(after-closed)|none|first unfold: closed(boot) -> open, no -deviceOrientation"
+ "open-landscapeLeft|open(after-open)|landscapeLeft|open -> open with -deviceOrientation=landscapeLeft"
+ "open-landscapeRight|open(after-open)|landscapeRight|after open-landscapeLeft"
+ "open-portrait-after-landscapeRight|open(after-open)|portrait|after open-landscapeRight"
+ "open-portraitUpsideDown|open(after-open)|portraitUpsideDown|after open-portrait-after-landscapeRight"
+ "open-landscapeLeft-2|open(after-open)|landscapeLeft|after open-portraitUpsideDown (repeat of open-landscapeLeft from another orientation)"
+ "closed-after-open|closed(after-open)|portrait|fold: open(landscapeLeft) -> closed with -deviceOrientation=portrait"
+ "closed-landscapeLeft|closed(after-closed)|landscapeLeft|closed -> closed"
+ "closed-landscapeRight|closed(after-closed)|landscapeRight|closed -> closed"
+ "closed-portraitUpsideDown|closed(after-closed)|portraitUpsideDown|closed -> closed"
+ "book-after-closed|book(after-closed)|portrait|posture.zsh book anchors at closed (instant) then sweeps to 100 deg"
+ "book-landscapeLeft|book(after-book)|landscapeLeft|book -> book (POSTURE_ANCHOR=none)"
+ "book-landscapeRight|book(after-book)|landscapeRight|book -> book (POSTURE_ANCHOR=none)"
+ "book-portraitUpsideDown|book(after-book)|portraitUpsideDown|book -> book (POSTURE_ANCHOR=none)"
+ "open-after-book|open(after-book)|portrait|book -> open"
+ "closed-after-book|closed(after-book)|portrait|book -> closed (the hinge probe ran here too)"
+ "book-hinge|book(after-closed)|portrait|closed -> book (anchored); supplemental SBWallpaperHingeProgressController probe only"
+ "open-hinge|open(after-book)|portrait|book -> open; supplemental SBWallpaperHingeProgressController probe only"
+)
+print -n '[]' > $work/recs.json; print -n '[]' > $work/runs.json
+for r in $runs; do
+ IFS='|' read -r label posture devo note <<< "$r"
+ for screen in state lock hinge; do
+ f=raw/chrome/$label-$screen.txt
+ [[ -e $f ]] || f=$f.gz
+ [[ -e $f ]] || continue
+ gzcat -f $f | grep '^{"' > $work/one.json || { print -u2 "no JSON in $f"; continue }
+ scr=$(case $screen in (state) print home ;; (lock) print lockScreen ;; (hinge) print home-hingeProbe ;; esac)
+ $jq -c --arg run "$label" --arg posture "$posture" --arg devo "$devo" --arg screen "$scr" '
+ def orient: {"1": "portrait", "2": "portraitUpsideDown", "3": "landscapeRight", "4": "landscapeLeft"}[tostring] // "unknown";
+ .records | map(select((.api | test("^(SBRootFolderView|SBRootFolderController|SBHIconManager|SBHomeScreenController|CSCoverSheetViewController|SBFloatingDockViewController|SBFloatingDockRootViewController|CSProminentDisplayViewController|CSCombinedListViewController|NCNotificationStructuredListViewController|SBIconListView\\[[^]]*\\]\\.firstIconView)\\.[^.]+$")) and ((.api | sub(".*\\."; "")) | test("size|height|width|frame|inset|rect|spacing|count|scale|layout|style|mode|orientation|font|row|column|margin|padding|region|bounds|offset|alignment|position|radius|length|gap|center|origin|edge|metric|configuration|progress|factor|alpha|transform|placement|location|axis|side|display|visible|hidden|grid|max|min|page|dock|label|library|today|widget|sidebar|class|rotat|fold|hinge|cover|notification|list|clock|date|time|quick|button|glyph|image"; "i") | not) | not) | select(((.value|type) == "string" and (.value|test("^<[^>]*0x[0-9a-f]+")) and ((.api + .value)|test("font|Font|Constraint|LayoutGuide|Configuration|Placement|frame|Size|Insets|Orientation|orientation|Display|Screen|Mode|Style|style")|not)) | not)
+ | {api, kind, process: "SpringBoard", posture: $posture, orientation: (.sceneOrientation | orient),
+ call: (.call | sub("\\[SBWindowScene <SB-main>\\]"; "[cover]") | sub("\\[SBWindowScene <com.apple.springboard.bringup>\\]"; "[inner]")), value, error, run: $run, screen: $screen, display})' $work/one.json > $work/part.json
+ $jq -s '.[0] + .[1]' $work/recs.json $work/part.json > $work/n.json && mv $work/n.json $work/recs.json
+ pj=null; [[ -e raw/chrome/$label-posture.json ]] && pj=$(cat raw/chrome/$label-posture.json)
+ $jq --arg label "$label" --arg posture "$posture" --arg devo "$devo" --arg note "$note" --arg screen "$scr" --arg t "$f" --arg ftag "$screen" \
+ --argjson prim "$($jq -c '{primaryScene, primaryOrientation}' $work/one.json)" --argjson pj "$pj" \
+ '. + [{run: $label, screen: $screen, posture: $posture, deviceOrientation: $devo, note: $note, transcript: $t,
+ screenshots: ["raw/chrome/shots/\($label)-\($ftag)-d1.png", "raw/chrome/shots/\($label)-\($ftag)-d3.png"],
+ primary: $prim, posture_driver: $pj}]' $work/runs.json > $work/n.json && mv $work/n.json $work/runs.json
+ done
+done
+runtime=$(xcrun simctl list runtimes -j | $jq -c '.runtimes[] | select(.identifier == "com.apple.CoreSimulator.SimRuntime.iOS-27-1") | {identifier, version, buildversion}')
+device=$(xcrun simctl list devices -j | $jq -c --arg u $U '.devices[] | .[] | select(.udid == $u) | {name, udid, deviceTypeIdentifier}')
+xcode=$(xcodebuild -version | tr '\n' ' ' | sed 's/ *$//')
+$jq -c -n --argjson runtime "$runtime" --argjson device "$device" --arg xcode "$xcode" \
+ --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg host "$(sw_vers -productVersion) $(sysctl -n machdep.cpu.brand_string)" \
+ --slurpfile runs $work/runs.json --slurpfile recs $work/recs.json '
+ {meta: {domain: "chrome", runtime: $runtime, device: $device, xcode: $xcode, host: $host, date: $date,
+ posture_mechanism: "SBDisplayToolServiceCoordinator performDisplaySwapWithSettings: (tools/posture.zsh), driven by probes/chrome-run.zsh",
+ probes: ["probes/chrome-state.lldb (home: scene, status bar, home screen, dock, wallpaper)", "probes/chrome-lock.lldb (lock screen: scene, status bar, cover sheet)"],
+ probe_sources: "probes/parts/*.inc assembled by probes/chrome-build.zsh",
+ record_extras: {run: "joins meta.runs[].run (posture path, -deviceOrientation passed to the swap, screenshots, transcript)", screen: "home | lockScreen | home-hingeProbe", display: "cover (scene SB-main, call prefix [cover]) | inner (scene com.apple.springboard.bringup, call prefix [inner])"},
+ orientation_names: "orientation is the UIInterfaceOrientation of the scene the record belongs to: 1 portrait, 2 portraitUpsideDown, 3 landscapeRight, 4 landscapeLeft (UIKit interface-orientation names; note smoke.zsh maps 3/4 the device-orientation way)",
+ skipped_getters: {"SBWindowScene.liftToWakeController": "EXC_BAD_ACCESS (stack overflow) when read with -valueForKey: + -description", "UIWindowScene._preferredIntelligentAssistantVisibility": "ObjC exception", "UIWindowScene._preferredIntelligentAssistantConfiguration": "ObjC exception", "UIWindowScene.SBSUI_preferredSystemRootLayerTransform": "ObjC exception", "SBIconView.iconImageAlignment": "ObjC exception", "SBIconListPageControl.maximumNumberOfPages": "ObjC exception", note: "the generic getter walk (probes/parts/chrome-lib.inc vpSkip) skips these names on every object; no record is emitted for them"},
+ probe_versions: "all home runs used probes/chrome-state.lldb without the hinge part; the hinge part was added afterwards and run alone as probes/chrome-hinge.lldb (runs closed-after-book, book-hinge, open-hinge, screen home-hingeProbe)",
+ omitted_state: "for the state-holding controllers and the first icon view (SBRootFolderView, SBRootFolderController, SBHIconManager, SBHomeScreenController, CSCoverSheetViewController, SBFloatingDock*ViewController, CSProminentDisplayViewController, CSCombinedListViewController, NCNotificationStructuredListViewController, SBIconListView[...].firstIconView) only getters whose name has a layout word (size, frame, inset, spacing, count, scale, layout, style, orientation, font, row, column, margin, bounds, offset, radius, position, alignment, configuration, visible, hidden, page, dock, label, icon image ...) are kept; the rest are in the raw transcripts",
+ omitted: "records whose value is only an object -description with a pointer and no layout keyword (font|Constraint|LayoutGuide|Configuration|Placement|frame|Size|Insets|Orientation|Display|Screen|Mode|Style) are left out of chrome.json; they are in the raw transcripts",
+ value_conventions: "frames in points; *.view records: frameInWindow = [view convertRect:view.bounds toView:view.window]; objects as -description truncated to 400 chars (pointer values included); structs of doubles decoded as {objCType, fields}; non-finite numbers as strings",
+ runs: $runs[0]},
+ records: $recs[0]}' > chrome.json
+print -- "chrome.json: $($jq '.records | length' chrome.json) records, $($jq '.meta.runs | length' chrome.json) runs, $(du -h chrome.json | cut -f1)"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-build.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-build.zsh
new file mode 100755
index 00000000..fdc12318
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-build.zsh
@@ -0,0 +1,9 @@
+#!/bin/zsh
+# build.zsh: assemble probes/chrome-*.lldb from probes/parts/ (one lldb expression each).
+set -euo pipefail
+here=${0:a:h}; p=$here/parts
+mk() { local out=$1; shift; { print -- 'expr -l objc -O --'; cat $p/chrome-lib.inc $p/chrome-emit.inc; for s in "$@"; do cat $p/chrome-$s.inc; done; cat $p/chrome-footer.inc; print; } > $here/$out }
+mk chrome-state.lldb scene statusbar home wallpaper hinge
+mk chrome-lock.lldb scene statusbar lock
+[[ -z ${CHROME_TEST_PARTS:-} ]] || mk chrome-test.lldb ${=CHROME_TEST_PARTS}
+mk chrome-hinge.lldb hinge
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-home.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-home.lldb
new file mode 100644
index 00000000..0f76315b
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-home.lldb
@@ -0,0 +1,136 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null]}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": @(vaR.origin.x), @"y": @(vaR.origin.y), @"width": @(vaR.size.width), @"height": @(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": @(vaS.width), @"height": @(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": @(vaI.top), @"left": @(vaI.left), @"bottom": @(vaI.bottom), @"right": @(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": @(vaT.a), @"b": @(vaT.b), @"c": @(vaT.c), @"d": @(vaT.d), @"tx": @(vaT.tx), @"ty": @(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return (id)[vaV description]; return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!strcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!strcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!strcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": @(vaP.x), @"y": @(vaP.y)}; }
+ if (!strcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!strcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": @(vaI.top), @"leading": @(vaI.leading), @"bottom": @(vaI.bottom), @"trailing": @(vaI.trailing)}; }
+ if (!strcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? @(vaBuf[vaJ]) : @(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 700) vaS = [[vaS substringToIndex:700] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vpAllow firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSMutableDictionary *vpRes = [NSMutableDictionary dictionary];
+NSDictionary *(^vpAll)(NSObject *) = ^NSDictionary *(NSObject *vaO) { if (!vaO) return (NSDictionary *)@{@"nil": @YES}; return (NSDictionary *)@{@"chain": vpChain(vaO), @"props": vpProps(vaO, nil), @"getters": vpGetters(vaO, nil)}; };
+for (UIWindowScene *vpWS in vpSBScenes) {
+ NSMutableDictionary *vpD = [NSMutableDictionary dictionary];
+ UIWindow *vpHW = vpWin(vpWS, @"SBHomeScreenWindow");
+ UIView *vpList = vpFind(vpHW, @"SBIconListView");
+ vpD[@"listView"] = vpAll(vpList);
+ NSObject *vpLayout = [vpList valueForKey:@"layout"];
+ vpD[@"layout"] = vpAll(vpLayout);
+ vpD[@"layoutConfiguration"] = vpAll([vpLayout respondsToSelector:@selector(layoutConfiguration)] ? [vpLayout valueForKey:@"layoutConfiguration"] : nil);
+ vpD[@"rootFolderView"] = vpAll(vpFind(vpHW, @"SBRootFolderView"));
+ vpD[@"iconView"] = vpAll(vpFind(vpList, @"SBIconView"));
+ vpD[@"homeVC"] = vpAll(vpHW.rootViewController);
+ UIWindow *vpDW = vpWin(vpWS, @"SBFloatingDockWindow");
+ vpD[@"dockRootVC"] = vpAll(vpDW.rootViewController);
+ vpD[@"dockView"] = vpAll(vpFind(vpDW, @"SBFloatingDockView"));
+ vpD[@"dockList"] = vpAll(vpFind(vpDW, @"SBFloatingDockIconListView"));
+ vpD[@"wallWin"] = vpAll(vpWin(vpWS, @"_SBWallpaperSecureWindow"));
+ vpD[@"scene"] = vpAll(vpWS);
+ vpRes[vpSceneId(vpWS)] = vpD;
+}
+[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:vpRes options:NSJSONWritingSortedKeys error:nil] encoding:NSUTF8StringEncoding]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-statusbar.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-statusbar.lldb
new file mode 100644
index 00000000..8c04a7d7
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-statusbar.lldb
@@ -0,0 +1,23 @@
+expr -l objc -O --
+NSMutableArray *vpOut = [NSMutableArray array];
+NSMutableArray *vpStack = [NSMutableArray array];
+for (UIScene *vpSc in [[UIApplication sharedApplication] connectedScenes]) {
+ if (![vpSc isKindOfClass:NSClassFromString(@"SBWindowScene")]) continue;
+ for (UIWindow *vpW in [(UIWindowScene *)vpSc windows]) {
+ if (![NSStringFromClass([vpW class]) isEqualToString:@"SBStatusBarWindow"]) continue;
+ [vpOut addObject:[NSString stringWithFormat:@"== %@ window %@ frame=%@ bounds=%@ transform=%@", vpSc.session.persistentIdentifier, NSStringFromClass([vpW class]), NSStringFromCGRect(vpW.frame), NSStringFromCGRect(vpW.bounds), NSStringFromCGAffineTransform(vpW.transform)]];
+ [vpStack removeAllObjects];
+ [vpStack addObject:@[vpW, @0]];
+ while (vpStack.count) {
+ NSArray *vpTop = [vpStack lastObject]; [vpStack removeLastObject];
+ UIView *vpV = vpTop[0]; long vpD = [(NSNumber *)vpTop[1] longValue];
+ CGRect vpF = [vpV convertRect:vpV.bounds toView:vpW];
+ NSString *vpExtra = @"";
+ if ([vpV respondsToSelector:@selector(text)]) vpExtra = [NSString stringWithFormat:@" text=%@", [(NSObject *)[vpV valueForKey:@"text"] description]];
+ if (!CGAffineTransformIsIdentity(vpV.transform)) vpExtra = [vpExtra stringByAppendingFormat:@" xf=%@", NSStringFromCGAffineTransform(vpV.transform)];
+ [vpOut addObject:[NSString stringWithFormat:@"%@%@ %p win=%@ frame=%@ h=%d a=%.2f%@", [@"" stringByPaddingToLength:vpD*2 withString:@" " startingAtIndex:0], NSStringFromClass([vpV class]), vpV, NSStringFromCGRect(vpF), NSStringFromCGRect(vpV.frame), vpV.hidden, vpV.alpha, vpExtra]];
+ if (vpD < 14) { NSArray *vpSubs = vpV.subviews; for (NSInteger vk = (NSInteger)vpSubs.count - 1; vk >= 0; vk--) [vpStack addObject:@[vpSubs[vk], @(vpD + 1)]]; }
+ }
+ }
+}
+[vpOut componentsJoinedByString:[NSString stringWithFormat:@"%c", 10]]
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-stui.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-stui.lldb
new file mode 100644
index 00000000..4cf0f8b8
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-stui.lldb
@@ -0,0 +1,116 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null]}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": @(vaR.origin.x), @"y": @(vaR.origin.y), @"width": @(vaR.size.width), @"height": @(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": @(vaS.width), @"height": @(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": @(vaI.top), @"left": @(vaI.left), @"bottom": @(vaI.bottom), @"right": @(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": @(vaT.a), @"b": @(vaT.b), @"c": @(vaT.c), @"d": @(vaT.d), @"tx": @(vaT.tx), @"ty": @(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return (id)[vaV description]; return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!strcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!strcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!strcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": @(vaP.x), @"y": @(vaP.y)}; }
+ if (!strcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!strcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": @(vaI.top), @"leading": @(vaI.leading), @"bottom": @(vaI.bottom), @"trailing": @(vaI.trailing)}; }
+ if (!strcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 700) vaS = [[vaS substringToIndex:700] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { return !vaK || vaK == vaStop || vaK == [NSObject class] || vaK == [UIView class] || vaK == [UIResponder class] || vaK == [UIViewController class] || vaK == [UIWindow class] || vaK == [UIScrollView class]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ([vaTs containsString:@"CGRect"] || [vaTs containsString:@"CGSize"] || [vaTs containsString:@"CGPoint"] || [vaTs containsString:@"UIEdgeInsets"] || [vaTs containsString:@"NSDirectionalEdgeInsets"] || [vaTs containsString:@"CGAffineTransform"]);
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vpAllow firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSMutableDictionary *vpRes = [NSMutableDictionary dictionary];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ UIWindow *vpSBW = vpWin(vpWS, @"SBStatusBarWindow");
+ UIView *vpSB = vpFind(vpSBW, @"STUIStatusBar");
+ NSObject *vpVP = [vpSB valueForKey:@"visualProvider"];
+ UIView *vpWrap = vpFind(vpSBW, @"STUIStatusBar_Wrapper");
+ vpRes[vpSceneId(vpWS)] = @{@"wrapperChain": vpChain(vpWrap), @"wrapperProps": vpProps(vpWrap, nil), @"wrapperGetters": vpGetters(vpWrap, nil),
+ @"sbChain": vpChain(vpSB), @"sbProps": vpProps(vpSB, nil), @"sbGetters": vpGetters(vpSB, nil),
+ @"vpChain": vpChain(vpVP), @"vpProps": vpProps(vpVP, nil), @"vpGetters": vpGetters(vpVP, nil)};
+}
+[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:vpRes options:NSJSONWritingSortedKeys error:nil] encoding:NSUTF8StringEncoding]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-tree-coversheet.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-tree-coversheet.lldb
new file mode 100644
index 00000000..792aff5f
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-tree-coversheet.lldb
@@ -0,0 +1,137 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+id (^vpNum)(double) = ^id(double vaX) { if (vaX != vaX) return (id)@"nan"; if (vaX > 1e300) return (id)@"inf"; if (vaX < -1e300) return (id)@"-inf"; return (id)@(vaX); };
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null]}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": vpNum(vaR.origin.x), @"y": vpNum(vaR.origin.y), @"width": vpNum(vaR.size.width), @"height": vpNum(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": vpNum(vaS.width), @"height": vpNum(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": vpNum(vaI.top), @"left": vpNum(vaI.left), @"bottom": vpNum(vaI.bottom), @"right": vpNum(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": vpNum(vaT.a), @"b": vpNum(vaT.b), @"c": vpNum(vaT.c), @"d": vpNum(vaT.d), @"tx": vpNum(vaT.tx), @"ty": vpNum(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return vpNum(vaD); return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!strcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!strcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!strcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": vpNum(vaP.x), @"y": vpNum(vaP.y)}; }
+ if (!strcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!strcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": vpNum(vaI.top), @"leading": vpNum(vaI.leading), @"bottom": vpNum(vaI.bottom), @"trailing": vpNum(vaI.trailing)}; }
+ if (!strcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? vpNum(vaBuf[vaJ]) : (id)@(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 700) vaS = [[vaS substringToIndex:700] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController", @"liftToWakeController", @"_preferredIntelligentAssistantVisibility", @"_preferredIntelligentAssistantConfiguration", @"SBSUI_preferredSystemRootLayerTransform"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vpSkip containsObject:vaGetter] || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vpAllow firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSMutableArray *vpOut = [NSMutableArray array];
+NSArray *vpWinClasses = @[@"SBCoverSheetWindow", @"SBWindowSceneAuxiliaryContentWindow"];
+NSArray *vpCollapse = @[@"_UIContextLayerHostView"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ for (UIWindow *vpW in vpWS.windows) {
+ if (![vpWinClasses containsObject:NSStringFromClass([vpW class])]) continue;
+ [vpOut addObject:[NSString stringWithFormat:@"== %@ %@ frame=%@ orient=%ld", vpSceneId(vpWS), NSStringFromClass([vpW class]), NSStringFromCGRect(vpW.frame), (long)vpWS.interfaceOrientation]];
+ NSMutableArray *vpStack = [NSMutableArray arrayWithObject:@[vpW, @0]];
+ while (vpStack.count) {
+ NSArray *vpTop = [vpStack lastObject]; [vpStack removeLastObject];
+ UIView *vpV = vpTop[0]; long vpD = [(NSNumber *)vpTop[1] longValue];
+ CGRect vpF = [vpV convertRect:vpV.bounds toView:vpW];
+ NSString *vpExtra = @"";
+ if ([vpV isKindOfClass:[UILabel class]]) vpExtra = [NSString stringWithFormat:@" text=%@ font=%.2f", [(UILabel *)vpV text], [(UILabel *)vpV font].pointSize];
+ if (!CGAffineTransformIsIdentity(vpV.transform)) vpExtra = [vpExtra stringByAppendingFormat:@" xf=%@", NSStringFromCGAffineTransform(vpV.transform)];
+ BOOL vpColl = NO; for (NSString *vpCC in vpCollapse) if ([vpV isKindOfClass:NSClassFromString(vpCC)]) vpColl = YES;
+ [vpOut addObject:[NSString stringWithFormat:@"%@%@ win=%@ h=%d a=%.2f n=%lu%@", [@"" stringByPaddingToLength:vpD*2 withString:@" " startingAtIndex:0], NSStringFromClass([vpV class]), NSStringFromCGRect(vpF), vpV.hidden, vpV.alpha, (unsigned long)vpV.subviews.count, vpExtra]];
+ if (vpD < 30 && !vpColl && !vpV.hidden) { NSArray *vpSubs = vpV.subviews; for (NSInteger vk = (NSInteger)vpSubs.count - 1; vk >= 0; vk--) [vpStack addObject:@[vpSubs[vk], @(vpD + 1)]]; }
+ }
+ }
+}
+[vpOut componentsJoinedByString:[NSString stringWithFormat:@"%c", 10]]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-tree-home.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-tree-home.lldb
new file mode 100644
index 00000000..7c2f9131
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-tree-home.lldb
@@ -0,0 +1,136 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null]}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": @(vaR.origin.x), @"y": @(vaR.origin.y), @"width": @(vaR.size.width), @"height": @(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": @(vaS.width), @"height": @(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": @(vaI.top), @"left": @(vaI.left), @"bottom": @(vaI.bottom), @"right": @(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": @(vaT.a), @"b": @(vaT.b), @"c": @(vaT.c), @"d": @(vaT.d), @"tx": @(vaT.tx), @"ty": @(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return (id)[vaV description]; return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!strcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!strcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!strcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": @(vaP.x), @"y": @(vaP.y)}; }
+ if (!strcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!strcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": @(vaI.top), @"leading": @(vaI.leading), @"bottom": @(vaI.bottom), @"trailing": @(vaI.trailing)}; }
+ if (!strcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? @(vaBuf[vaJ]) : @(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 700) vaS = [[vaS substringToIndex:700] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vpAllow firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSMutableArray *vpOut = [NSMutableArray array];
+NSArray *vpWinClasses = @[@"SBHomeScreenWindow", @"SBFloatingDockWindow", @"_SBWallpaperSecureWindow", @"SBFolderWindow"];
+NSArray *vpCollapse = @[@"SBIconView"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ for (UIWindow *vpW in vpWS.windows) {
+ if (![vpWinClasses containsObject:NSStringFromClass([vpW class])]) continue;
+ [vpOut addObject:[NSString stringWithFormat:@"== %@ %@ frame=%@ orient=%ld", vpSceneId(vpWS), NSStringFromClass([vpW class]), NSStringFromCGRect(vpW.frame), (long)vpWS.interfaceOrientation]];
+ NSMutableArray *vpStack = [NSMutableArray arrayWithObject:@[vpW, @0]];
+ while (vpStack.count) {
+ NSArray *vpTop = [vpStack lastObject]; [vpStack removeLastObject];
+ UIView *vpV = vpTop[0]; long vpD = [(NSNumber *)vpTop[1] longValue];
+ CGRect vpF = [vpV convertRect:vpV.bounds toView:vpW];
+ NSString *vpExtra = @"";
+ if ([vpV isKindOfClass:[UILabel class]]) vpExtra = [NSString stringWithFormat:@" text=%@ font=%.2f", [(UILabel *)vpV text], [(UILabel *)vpV font].pointSize];
+ if (!CGAffineTransformIsIdentity(vpV.transform)) vpExtra = [vpExtra stringByAppendingFormat:@" xf=%@", NSStringFromCGAffineTransform(vpV.transform)];
+ BOOL vpColl = NO; for (NSString *vpCC in vpCollapse) if ([vpV isKindOfClass:NSClassFromString(vpCC)]) vpColl = YES;
+ [vpOut addObject:[NSString stringWithFormat:@"%@%@ win=%@ h=%d a=%.2f n=%lu%@", [@"" stringByPaddingToLength:vpD*2 withString:@" " startingAtIndex:0], NSStringFromClass([vpV class]), NSStringFromCGRect(vpF), vpV.hidden, vpV.alpha, (unsigned long)vpV.subviews.count, vpExtra]];
+ if (vpD < 16 && !vpColl && !vpV.hidden) { NSArray *vpSubs = vpV.subviews; for (NSInteger vk = (NSInteger)vpSubs.count - 1; vk >= 0; vk--) [vpStack addObject:@[vpSubs[vk], @(vpD + 1)]]; }
+ }
+ }
+}
+[vpOut componentsJoinedByString:[NSString stringWithFormat:@"%c", 10]]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-windows.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-windows.lldb
new file mode 100644
index 00000000..635faa31
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-discover-windows.lldb
@@ -0,0 +1,12 @@
+expr -l objc -O --
+NSMutableArray *vpOut = [NSMutableArray array];
+for (UIScene *vpSc in [[UIApplication sharedApplication] connectedScenes]) {
+ [vpOut addObject:[NSString stringWithFormat:@"SCENE %@ %@ id=%@", NSStringFromClass([vpSc class]), vpSc.session.persistentIdentifier, [(NSObject *)[[(UIWindowScene *)vpSc screen] valueForKey:@"displayIdentity"] description]]];
+ if (![vpSc isKindOfClass:[UIWindowScene class]]) continue;
+ UIWindowScene *vpWS = (UIWindowScene *)vpSc;
+ [vpOut addObject:[NSString stringWithFormat:@" orient=%ld screenBounds=%@", (long)vpWS.interfaceOrientation, NSStringFromCGRect(vpWS.screen.bounds)]];
+ for (UIWindow *vpW in vpWS.windows) {
+ [vpOut addObject:[NSString stringWithFormat:@" WIN %@ %p frame=%@ level=%.0f hidden=%d alpha=%.2f key=%d subviews=%lu root=%@", NSStringFromClass([vpW class]), vpW, NSStringFromCGRect(vpW.frame), vpW.windowLevel, vpW.hidden, vpW.alpha, vpW.isKeyWindow, (unsigned long)vpW.subviews.count, vpW.rootViewController ? NSStringFromClass([vpW.rootViewController class]) : @"-"]];
+ }
+}
+[vpOut componentsJoinedByString:[NSString stringWithFormat:@"%c", 10]]
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-hinge.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-hinge.lldb
new file mode 100644
index 00000000..b9ced348
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-hinge.lldb
@@ -0,0 +1,178 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+__block NSString *vpCurDisp = @"-"; __block NSString *vpCurScene = @"-"; __block long vpCurOrient = 0;
+id (^vpNum)(double) = ^id(double vaX) { if (vaX != vaX) return (id)@"nan"; if (vaX > 1e300) return (id)@"inf"; if (vaX < -1e300) return (id)@"-inf"; return (id)@(vaX); };
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null], @"display": vpCurDisp, @"scene": vpCurScene, @"sceneOrientation": @(vpCurOrient)}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": vpNum(vaR.origin.x), @"y": vpNum(vaR.origin.y), @"width": vpNum(vaR.size.width), @"height": vpNum(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": vpNum(vaS.width), @"height": vpNum(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": vpNum(vaI.top), @"left": vpNum(vaI.left), @"bottom": vpNum(vaI.bottom), @"right": vpNum(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": vpNum(vaT.a), @"b": vpNum(vaT.b), @"c": vpNum(vaT.c), @"d": vpNum(vaT.d), @"tx": vpNum(vaT.tx), @"ty": vpNum(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return vpNum(vaD); return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!strcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!strcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!strcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": vpNum(vaP.x), @"y": vpNum(vaP.y)}; }
+ if (!strcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!strcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": vpNum(vaI.top), @"leading": vpNum(vaI.leading), @"bottom": vpNum(vaI.bottom), @"trailing": vpNum(vaI.trailing)}; }
+ if (!strcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? vpNum(vaBuf[vaJ]) : (id)@(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 400) vaS = [[vaS substringToIndex:400] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController", @"liftToWakeController", @"_preferredIntelligentAssistantVisibility", @"_preferredIntelligentAssistantConfiguration", @"SBSUI_preferredSystemRootLayerTransform", @"iconImageAlignment", @"maximumNumberOfPages"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vpSkip containsObject:vaGetter] || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGettersRx)(NSObject *, Class, NSRegularExpression *) = ^NSDictionary *(NSObject *vaO, Class vaStop, NSRegularExpression *vaAllowRx) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vaAllowRx firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) { return vpGettersRx(vaO, vaStop, vpAllow); };
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSSet *vpDataKeys = [NSSet setWithArray:@[@"currentAggregatedData", @"currentData", @"dataAggregator", @"displayItemStates", @"items", @"dependentDataEntryKeys", @"overlayData", @"animationContextId"]];
+void (^vpObj)(NSString *, NSString *, NSObject *) = ^(NSString *vaRole, NSString *vaCall, NSObject *vaO) {
+ if (!vaO) { vpAdd([vaRole stringByAppendingString:@".class"], @"private", vaCall, nil, @"nil"); return; }
+ vpAdd([vaRole stringByAppendingString:@".class"], @"private", [vaCall stringByAppendingString:@".class"], vpChain(vaO), nil);
+ NSMutableDictionary *vaAll = [NSMutableDictionary dictionaryWithDictionary:vpGetters(vaO, nil)];
+ [vaAll addEntriesFromDictionary:vpProps(vaO, nil)];
+ for (NSString *vaK in [[vaAll allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ if ([vpDataKeys containsObject:vaK]) continue;
+ vpAdd([NSString stringWithFormat:@"%@.%@", vaRole, vaK], @"private", [NSString stringWithFormat:@"%@.%@", vaCall, vaK], vaAll[vaK], nil);
+ }
+};
+void (^vpViewRec)(NSString *, NSString *, UIView *) = ^(NSString *vaRole, NSString *vaCall, UIView *vaV) {
+ if (!vaV) { vpAdd([vaRole stringByAppendingString:@".view"], @"public", vaCall, nil, @"nil (view not found)"); return; }
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionaryWithDictionary:vpView(vaV)];
+ if ([vaV isKindOfClass:[UILabel class]]) { vaD[@"text"] = [(UILabel *)vaV text] ?: (id)[NSNull null]; vaD[@"fontPointSize"] = @([(UILabel *)vaV font].pointSize); vaD[@"font"] = [[(UILabel *)vaV font] description] ?: @""; }
+ if ([vaV isKindOfClass:[UIImageView class]]) { UIImage *vaI = [(UIImageView *)vaV image]; vaD[@"imageSize"] = vaI ? vpSize(vaI.size) : (id)[NSNull null]; vaD[@"imageScale"] = vaI ? @(vaI.scale) : (id)[NSNull null]; vaD[@"contentMode"] = @(vaV.contentMode); }
+ CATransform3D vaT = vaV.layer.transform;
+ if (!CATransform3DIsIdentity(vaT)) vaD[@"layerTransform"] = @[vpNum(vaT.m11), vpNum(vaT.m12), vpNum(vaT.m21), vpNum(vaT.m22), vpNum(vaT.m41), vpNum(vaT.m42), vpNum(vaT.m43)];
+ vaD[@"layerBounds"] = vpRect(vaV.layer.bounds);
+ if (vaV.window) vaD[@"safeAreaInsets"] = vpInsets(vaV.safeAreaInsets);
+ vpAdd([vaRole stringByAppendingString:@".view"], @"public", [vaCall stringByAppendingString:@" frame/bounds/transform (frameInWindow = convertRect:bounds toView:window)"], vaD, nil);
+};
+void (^vpViewsOf)(NSString *, UIView *, NSArray *) = ^(NSString *vaPrefix, UIView *vaRoot, NSArray *vaClasses) {
+ NSMutableDictionary *vaSeen = [NSMutableDictionary dictionary];
+ NSMutableArray *vaQ = [NSMutableArray array]; if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) {
+ UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0];
+ NSString *vaCls = NSStringFromClass([vaV class]);
+ BOOL vaHit = (vaClasses == nil && vaV != vaRoot); for (NSString *vaC in vaClasses) if ([vaCls rangeOfString:vaC].location != NSNotFound) vaHit = YES;
+ if (vaHit) { NSInteger vaN = [(NSNumber *)vaSeen[vaCls] integerValue]; vaSeen[vaCls] = @(vaN + 1); vpViewRec([NSString stringWithFormat:@"%@.%@#%ld", vaPrefix, vaCls, (long)vaN], [NSString stringWithFormat:@"BFS(%@) %@ #%ld", vaPrefix, vaCls, (long)vaN], vaV); }
+ [vaQ addObjectsFromArray:vaV.subviews];
+ }
+};
+NSString *(^vpDispOf)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return [vaWS.session.persistentIdentifier isEqualToString:@"SB-main"] ? @"cover" : ([vaWS.session.persistentIdentifier isEqualToString:@"com.apple.springboard.bringup"] ? @"inner" : vaWS.session.persistentIdentifier); };
+NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"];
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ NSObject *vpWC = [vpWS valueForKey:@"wallpaperController"];
+ NSObject *vpHPC = [vpWC respondsToSelector:NSSelectorFromString(@"hingeProgressController")] ? [vpWC valueForKey:@"hingeProgressController"] : nil;
+ vpObj(@"SBWallpaperHingeProgressController", [vpC stringByAppendingString:@".wallpaperController.hingeProgressController"], vpHPC);
+ unsigned int vpIN = 0; Ivar *vpIvs = vpHPC ? class_copyIvarList([vpHPC class], &vpIN) : NULL;
+ for (unsigned int vpI = 0; vpI < vpIN; vpI++) {
+ NSString *vpName = [NSString stringWithUTF8String:ivar_getName(vpIvs[vpI])];
+ const char *vpT = ivar_getTypeEncoding(vpIvs[vpI]);
+ NSString *vpTs = vpT ? [NSString stringWithUTF8String:vpT] : @"";
+ id vpVv = nil;
+ if ([vpTs isEqualToString:@"d"]) vpVv = vpNum(*(double *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs isEqualToString:@"q"]) vpVv = @(*(long long *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs isEqualToString:@"B"]) vpVv = @(*(BOOL *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs hasPrefix:@"@"]) vpVv = vpVal(object_getIvar(vpHPC, vpIvs[vpI]));
+ else vpVv = [@"type " stringByAppendingString:vpTs];
+ vpAdd([@"SBWallpaperHingeProgressController.ivar." stringByAppendingString:vpName], @"private", [NSString stringWithFormat:@"%@ hingeProgressController ivar %@ (%@)", vpC, vpName, vpTs], vpVv, nil);
+ }
+ if (vpIvs) free(vpIvs);
+}
+NSDictionary *vpOutD = @{@"primaryScene": vpPrimary ? vpSceneId(vpPrimary) : @"", @"primaryOrientation": @(vpPrimary.interfaceOrientation), @"records": vpRecs};
+NSError *vpJErr = nil;
+NSData *vpJD = [NSJSONSerialization isValidJSONObject:vpOutD] ? [NSJSONSerialization dataWithJSONObject:vpOutD options:0 error:&vpJErr] : nil;
+vpJD ? [[NSString alloc] initWithData:vpJD encoding:NSUTF8StringEncoding] : [NSString stringWithFormat:@"INVALID JSON %@", vpJErr]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-lock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-lock.lldb
new file mode 100644
index 00000000..7438e0fe
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-lock.lldb
@@ -0,0 +1,298 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+__block NSString *vpCurDisp = @"-"; __block NSString *vpCurScene = @"-"; __block long vpCurOrient = 0;
+id (^vpNum)(double) = ^id(double vaX) { if (vaX != vaX) return (id)@"nan"; if (vaX > 1e300) return (id)@"inf"; if (vaX < -1e300) return (id)@"-inf"; return (id)@(vaX); };
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null], @"display": vpCurDisp, @"scene": vpCurScene, @"sceneOrientation": @(vpCurOrient)}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": vpNum(vaR.origin.x), @"y": vpNum(vaR.origin.y), @"width": vpNum(vaR.size.width), @"height": vpNum(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": vpNum(vaS.width), @"height": vpNum(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": vpNum(vaI.top), @"left": vpNum(vaI.left), @"bottom": vpNum(vaI.bottom), @"right": vpNum(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": vpNum(vaT.a), @"b": vpNum(vaT.b), @"c": vpNum(vaT.c), @"d": vpNum(vaT.d), @"tx": vpNum(vaT.tx), @"ty": vpNum(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return vpNum(vaD); return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!strcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!strcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!strcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": vpNum(vaP.x), @"y": vpNum(vaP.y)}; }
+ if (!strcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!strcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": vpNum(vaI.top), @"leading": vpNum(vaI.leading), @"bottom": vpNum(vaI.bottom), @"trailing": vpNum(vaI.trailing)}; }
+ if (!strcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? vpNum(vaBuf[vaJ]) : (id)@(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 400) vaS = [[vaS substringToIndex:400] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController", @"liftToWakeController", @"_preferredIntelligentAssistantVisibility", @"_preferredIntelligentAssistantConfiguration", @"SBSUI_preferredSystemRootLayerTransform", @"iconImageAlignment", @"maximumNumberOfPages"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vpSkip containsObject:vaGetter] || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGettersRx)(NSObject *, Class, NSRegularExpression *) = ^NSDictionary *(NSObject *vaO, Class vaStop, NSRegularExpression *vaAllowRx) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vaAllowRx firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) { return vpGettersRx(vaO, vaStop, vpAllow); };
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSSet *vpDataKeys = [NSSet setWithArray:@[@"currentAggregatedData", @"currentData", @"dataAggregator", @"displayItemStates", @"items", @"dependentDataEntryKeys", @"overlayData", @"animationContextId"]];
+void (^vpObj)(NSString *, NSString *, NSObject *) = ^(NSString *vaRole, NSString *vaCall, NSObject *vaO) {
+ if (!vaO) { vpAdd([vaRole stringByAppendingString:@".class"], @"private", vaCall, nil, @"nil"); return; }
+ vpAdd([vaRole stringByAppendingString:@".class"], @"private", [vaCall stringByAppendingString:@".class"], vpChain(vaO), nil);
+ NSMutableDictionary *vaAll = [NSMutableDictionary dictionaryWithDictionary:vpGetters(vaO, nil)];
+ [vaAll addEntriesFromDictionary:vpProps(vaO, nil)];
+ for (NSString *vaK in [[vaAll allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ if ([vpDataKeys containsObject:vaK]) continue;
+ vpAdd([NSString stringWithFormat:@"%@.%@", vaRole, vaK], @"private", [NSString stringWithFormat:@"%@.%@", vaCall, vaK], vaAll[vaK], nil);
+ }
+};
+void (^vpViewRec)(NSString *, NSString *, UIView *) = ^(NSString *vaRole, NSString *vaCall, UIView *vaV) {
+ if (!vaV) { vpAdd([vaRole stringByAppendingString:@".view"], @"public", vaCall, nil, @"nil (view not found)"); return; }
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionaryWithDictionary:vpView(vaV)];
+ if ([vaV isKindOfClass:[UILabel class]]) { vaD[@"text"] = [(UILabel *)vaV text] ?: (id)[NSNull null]; vaD[@"fontPointSize"] = @([(UILabel *)vaV font].pointSize); vaD[@"font"] = [[(UILabel *)vaV font] description] ?: @""; }
+ if ([vaV isKindOfClass:[UIImageView class]]) { UIImage *vaI = [(UIImageView *)vaV image]; vaD[@"imageSize"] = vaI ? vpSize(vaI.size) : (id)[NSNull null]; vaD[@"imageScale"] = vaI ? @(vaI.scale) : (id)[NSNull null]; vaD[@"contentMode"] = @(vaV.contentMode); }
+ CATransform3D vaT = vaV.layer.transform;
+ if (!CATransform3DIsIdentity(vaT)) vaD[@"layerTransform"] = @[vpNum(vaT.m11), vpNum(vaT.m12), vpNum(vaT.m21), vpNum(vaT.m22), vpNum(vaT.m41), vpNum(vaT.m42), vpNum(vaT.m43)];
+ vaD[@"layerBounds"] = vpRect(vaV.layer.bounds);
+ if (vaV.window) vaD[@"safeAreaInsets"] = vpInsets(vaV.safeAreaInsets);
+ vpAdd([vaRole stringByAppendingString:@".view"], @"public", [vaCall stringByAppendingString:@" frame/bounds/transform (frameInWindow = convertRect:bounds toView:window)"], vaD, nil);
+};
+void (^vpViewsOf)(NSString *, UIView *, NSArray *) = ^(NSString *vaPrefix, UIView *vaRoot, NSArray *vaClasses) {
+ NSMutableDictionary *vaSeen = [NSMutableDictionary dictionary];
+ NSMutableArray *vaQ = [NSMutableArray array]; if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) {
+ UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0];
+ NSString *vaCls = NSStringFromClass([vaV class]);
+ BOOL vaHit = (vaClasses == nil && vaV != vaRoot); for (NSString *vaC in vaClasses) if ([vaCls rangeOfString:vaC].location != NSNotFound) vaHit = YES;
+ if (vaHit) { NSInteger vaN = [(NSNumber *)vaSeen[vaCls] integerValue]; vaSeen[vaCls] = @(vaN + 1); vpViewRec([NSString stringWithFormat:@"%@.%@#%ld", vaPrefix, vaCls, (long)vaN], [NSString stringWithFormat:@"BFS(%@) %@ #%ld", vaPrefix, vaCls, (long)vaN], vaV); }
+ [vaQ addObjectsFromArray:vaV.subviews];
+ }
+};
+NSString *(^vpDispOf)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return [vaWS.session.persistentIdentifier isEqualToString:@"SB-main"] ? @"cover" : ([vaWS.session.persistentIdentifier isEqualToString:@"com.apple.springboard.bringup"] ? @"inner" : vaWS.session.persistentIdentifier); };
+NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"];
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [vpC stringByAppendingString:@".interfaceOrientation"], @(vpWS.interfaceOrientation), nil);
+ vpAdd(@"UIWindowScene.screen.bounds", @"public", [vpC stringByAppendingString:@".screen.bounds"], vpRect(vpWS.screen.bounds), nil);
+ vpAdd(@"UIWindowScene.coordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpWS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIWindowScene.effectiveGeometry", @"public", [vpC stringByAppendingString:@".effectiveGeometry"], [(NSObject *)vpWS.effectiveGeometry description], nil);
+ vpAdd(@"SBWindowScene.isPrimaryWindowScene", @"private", @"vpWS == [SBDisplayContentModeCoordinator primaryWindowScene]", @(vpWS == vpPrimary), nil);
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<%@>]", vpCurScene], @(((long (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS)), nil);
+ for (NSString *vpK in @[@"_interfaceOrientation", @"sb_displayContentMode", @"pbui_hostInformedOrientation", @"sbui_systemArbitratedInterfaceOrientation", @"_safeAreaCornerInsets", @"_hasOrientationDependentSafeAreaCornerInsets", @"_hasOrientationDependentSafeAreaEdgeInsets", @"_shouldRotateSafeAreaInsetsToInterfaceOrientation", @"_windowsIgnoreSceneClientOrientation", @"_peripheryInsets", @"_systemMinimumMargin", @"_referenceBounds"]) {
+ if ([vpWS respondsToSelector:NSSelectorFromString(vpK)]) vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], vpVal([vpWS valueForKey:vpK]), nil);
+ else vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], nil, @"does not respond");
+ }
+ NSObject *vpSBM = [vpWS valueForKey:@"statusBarManager"];
+ if ([vpSBM isKindOfClass:[UIStatusBarManager class]]) {
+ UIStatusBarManager *vpPub = (UIStatusBarManager *)vpSBM;
+ vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarFrame"], vpRect(vpPub.statusBarFrame), nil);
+ vpAdd(@"UIStatusBarManager.statusBarHidden", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarHidden"], @(vpPub.statusBarHidden), nil);
+ vpAdd(@"UIStatusBarManager.statusBarStyle", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarStyle"], @(vpPub.statusBarStyle), nil);
+ } else vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager"], vpChain(vpSBM), @"statusBarManager is not a UIStatusBarManager");
+ vpObj(@"SBWindowSceneStatusBarManager", [vpC stringByAppendingString:@".statusBarManager"], vpSBM);
+ vpObj(@"SBHIDUISensorModeController", [vpC stringByAppendingString:@".HIDUISensorModeController"], [vpWS valueForKey:@"HIDUISensorModeController"]);
+ vpObj(@"SBContinuousFoldController", [vpC stringByAppendingString:@".continuousFoldController"], [vpWS valueForKey:@"continuousFoldController"]);
+ NSRegularExpression *vpScrRx = [NSRegularExpression regularExpressionWithPattern:@"(xclusion|ensor|eriphery|utout|sland|otch|ornerRadius|Shape|afeArea|Aperture|Bezel|Corner|Hinge|Fold)" options:0 error:nil];
+ NSDictionary *vpScrG = vpGettersRx(vpWS.screen, nil, vpScrRx);
+ for (NSString *vpK in [[vpScrG allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"UIScreen." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@.screen.%@", vpC, vpK], vpScrG[vpK], nil);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ UIWindow *vpSBW = vpWin(vpWS, @"SBStatusBarWindow");
+ vpViewRec(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ vpObj(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ UIView *vpWrap = vpFind(vpSBW, @"STUIStatusBar_Wrapper");
+ UIView *vpSB = vpFind(vpSBW, @"STUIStatusBar");
+ vpViewRec(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpObj(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpViewRec(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ vpObj(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ if (!vpSB) continue;
+ vpObj(@"STUIStatusBarStyleAttributes", [vpC stringByAppendingString:@" STUIStatusBar.styleAttributes"], [vpSB valueForKey:@"styleAttributes"]);
+ vpObj(@"SBWindowSceneStatusBarAssertionManager", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper.manager"], [vpWrap respondsToSelector:NSSelectorFromString(@"manager")] ? [vpWrap valueForKey:@"manager"] : nil);
+ NSObject *vpVP = [vpSB valueForKey:@"visualProvider"];
+ vpAdd(@"STUIStatusBar.visualProviderClass", @"private", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider.class"], NSStringFromClass([vpVP class]), nil);
+ vpObj(@"STUIStatusBarVisualProvider", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider"], vpVP);
+ NSDictionary *vpCls = vpGetters((NSObject *)[vpVP class], nil);
+ for (NSString *vpK in [[vpCls allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"STUIStatusBarVisualProvider+" stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"+[%@ %@]", NSStringFromClass([vpVP class]), vpK], vpCls[vpK], nil);
+ unsigned int vpPN = 0;
+ for (Class vpK = [vpVP class]; vpK && vpK != [NSObject class]; vpK = class_getSuperclass(vpK)) {
+ objc_property_t *vpPs = class_copyPropertyList(vpK, &vpPN);
+ for (unsigned int vpI = 0; vpI < vpPN; vpI++) {
+ NSString *vpName = [NSString stringWithUTF8String:property_getName(vpPs[vpI])];
+ char *vpTy = property_copyAttributeValue(vpPs[vpI], "T");
+ BOOL vpIsGuide = vpTy && [[NSString stringWithUTF8String:vpTy] containsString:@"UILayoutGuide"];
+ if (vpTy) free(vpTy);
+ if (!vpIsGuide) continue;
+ UILayoutGuide *vpG = [vpVP valueForKey:vpName];
+ if (!vpG) { vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", vpName, nil, @"nil"); continue; }
+ CGRect vpLF = vpG.layoutFrame; UIView *vpOV = vpG.owningView;
+ vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", [NSString stringWithFormat:@"%@ visualProvider.%@.layoutFrame (owningView coords) + converted to window", vpC, vpName],
+ @{@"identifier": vpG.identifier ?: @"", @"layoutFrame": vpRect(vpLF), @"owningView": vpOV ? NSStringFromClass([vpOV class]) : (id)[NSNull null], @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpLF toView:vpOV.window]) : (id)[NSNull null]}, nil);
+ }
+ if (vpPs) free(vpPs);
+ }
+ NSDictionary *vpRegions = [vpSB valueForKey:@"regions"];
+ for (NSString *vpRK in [[vpRegions allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vpR = vpRegions[vpRK];
+ vpObj([NSString stringWithFormat:@"STUIStatusBarRegion[%@]", vpRK], [NSString stringWithFormat:@"%@ STUIStatusBar.regions[%@]", vpC, vpRK], vpR);
+ for (NSString *vpItemKey in @[@"layoutItem", @"contentView", @"containerView", @"containerItem"]) {
+ if (![vpR respondsToSelector:NSSelectorFromString(vpItemKey)]) continue;
+ NSObject *vpItem = [vpR valueForKey:vpItemKey];
+ if ([vpItem isKindOfClass:[UIView class]]) vpViewRec([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@", vpRK, vpItemKey], [NSString stringWithFormat:@"%@ regions[%@].%@", vpC, vpRK, vpItemKey], (UIView *)vpItem);
+ else if ([vpItem isKindOfClass:[UILayoutGuide class]]) { UILayoutGuide *vpG = (UILayoutGuide *)vpItem; UIView *vpOV = vpG.owningView; vpAdd([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@.layoutFrame", vpRK, vpItemKey], @"private", [NSString stringWithFormat:@"%@ regions[%@].%@.layoutFrame", vpC, vpRK, vpItemKey], @{@"layoutFrame": vpRect(vpG.layoutFrame), @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpG.layoutFrame toView:vpOV.window]) : (id)[NSNull null]}, nil); }
+ }
+ }
+ UIView *vpFG = [vpSB valueForKey:@"foregroundView"];
+ vpViewRec(@"STUIStatusBarForegroundView", [vpC stringByAppendingString:@" STUIStatusBar.foregroundView"], vpFG);
+ vpViewsOf(@"STUIStatusBarForegroundView", vpFG, nil);
+}
+UIViewController *(^vpVCOf)(UIView *) = ^UIViewController *(UIView *vaV) { UIResponder *vaR = vaV; while (vaR && ![vaR isKindOfClass:[UIViewController class]]) vaR = [vaR nextResponder]; return (UIViewController *)vaR; };
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ NSObject *vpLSM = [vpWS valueForKey:@"lockScreenManager"];
+ vpAdd(@"SBLockScreenManager.isUILocked", @"private", [vpC stringByAppendingString:@".lockScreenManager.isUILocked"], [vpLSM respondsToSelector:NSSelectorFromString(@"isUILocked")] ? [vpLSM valueForKey:@"isUILocked"] : nil, [vpLSM respondsToSelector:NSSelectorFromString(@"isUILocked")] ? nil : @"does not respond");
+ vpAdd(@"SBLockScreenManager.isLockScreenVisible", @"private", [vpC stringByAppendingString:@".lockScreenManager.isLockScreenVisible"], [vpLSM respondsToSelector:NSSelectorFromString(@"isLockScreenVisible")] ? [vpLSM valueForKey:@"isLockScreenVisible"] : nil, nil);
+ UIWindow *vpCW = vpWin(vpWS, @"SBCoverSheetWindow");
+ vpViewRec(@"SBCoverSheetWindow", [vpC stringByAppendingString:@" SBCoverSheetWindow"], vpCW);
+ if (!vpCW) continue;
+ UIView *vpCSV = vpFind(vpCW, @"CSCoverSheetView");
+ vpViewRec(@"CSCoverSheetView", [vpC stringByAppendingString:@" SBCoverSheetWindow/CSCoverSheetView"], vpCSV);
+ vpObj(@"CSCoverSheetViewController", [vpC stringByAppendingString:@" CSCoverSheetView.(next responder VC)"], vpVCOf(vpCSV));
+ UIView *vpQAV = vpFind(vpCW, @"CSQuickActionsView");
+ vpViewRec(@"CSQuickActionsView", [vpC stringByAppendingString:@" CSQuickActionsView"], vpQAV);
+ vpObj(@"CSQuickActionsView", [vpC stringByAppendingString:@" CSQuickActionsView"], vpQAV);
+ vpObj(@"CSQuickActionsViewController", [vpC stringByAppendingString:@" CSQuickActionsView.(next responder VC)"], vpQAV ? vpVCOf(vpQAV) : nil);
+ UIView *vpPBV = vpFind(vpCW, @"CSProminentButtonsView");
+ vpViewRec(@"CSProminentButtonsView", [vpC stringByAppendingString:@" CSProminentButtonsView"], vpPBV);
+ vpObj(@"CSProminentButtonsView", [vpC stringByAppendingString:@" CSProminentButtonsView"], vpPBV);
+ NSArray *vpBtns = vpFindAll(vpCW, @"CSQuickActionsButton");
+ vpAdd(@"CSQuickActionsButton.count", @"private", [vpC stringByAppendingString:@" BFS count CSQuickActionsButton"], @(vpBtns.count), nil);
+ for (NSUInteger vpBI = 0; vpBI < vpBtns.count; vpBI++) {
+ UIView *vpB = vpBtns[vpBI];
+ NSString *vpRole = [NSString stringWithFormat:@"CSQuickActionsButton#%lu", (unsigned long)vpBI];
+ NSString *vpCall = [NSString stringWithFormat:@"%@ CSQuickActionsButton #%lu", vpC, (unsigned long)vpBI];
+ vpViewRec(vpRole, vpCall, vpB);
+ vpObj(vpRole, vpCall, vpB);
+ vpViewsOf(vpRole, vpB, nil);
+ NSArray *vpGlyphs = vpFindAll(vpB, @"CSQuickActionImageGlyphView");
+ for (NSUInteger vpGI = 0; vpGI < vpGlyphs.count; vpGI++) {
+ UIView *vpG = vpGlyphs[vpGI];
+ NSString *vpGRole = [NSString stringWithFormat:@"%@.CSQuickActionImageGlyphView#%lu", vpRole, (unsigned long)vpGI];
+ vpObj(vpGRole, [vpCall stringByAppendingFormat:@" CSQuickActionImageGlyphView #%lu", (unsigned long)vpGI], vpG);
+ CGRect vpBB = vpB.bounds; CGRect vpGF = [vpG convertRect:vpG.bounds toView:vpB];
+ NSMutableArray *vpImgs = [NSMutableArray array];
+ for (UIView *vpIV in vpFindAll(vpG, @"UIImageView")) { CGRect vpIF = [vpIV convertRect:vpIV.bounds toView:vpB]; [vpImgs addObject:@{@"class": NSStringFromClass([vpIV class]), @"frameInButton": vpRect(vpIF), @"imageSize": [(UIImageView *)vpIV image] ? vpSize([(UIImageView *)vpIV image].size) : (id)[NSNull null], @"widthOverButtonWidth": vpNum(vpIF.size.width / vpBB.size.width), @"heightOverButtonHeight": vpNum(vpIF.size.height / vpBB.size.height), @"hidden": @(vpIV.hidden)}]; }
+ vpAdd([vpGRole stringByAppendingString:@".ratioToButton"], @"private", [vpCall stringByAppendingString:@" glyph frame (convertRect:bounds toView:button) / button bounds; layer transform a/d"],
+ @{@"buttonBounds": vpRect(vpBB), @"glyphFrameInButton": vpRect(vpGF), @"glyphBounds": vpRect(vpG.bounds), @"glyphTransform": vpXf(vpG.transform), @"glyphWidthOverButtonWidth": vpNum(vpGF.size.width / vpBB.size.width), @"glyphHeightOverButtonHeight": vpNum(vpGF.size.height / vpBB.size.height), @"glyphBoundsWidthOverButtonWidth": vpNum(vpG.bounds.size.width / vpBB.size.width), @"imageViews": vpImgs}, nil);
+ }
+ if (!vpGlyphs.count) vpAdd([vpRole stringByAppendingString:@".CSQuickActionImageGlyphView#0.ratioToButton"], @"private", vpCall, nil, @"no CSQuickActionImageGlyphView under button");
+ }
+ UIView *vpDate = vpFind(vpCW, @"SBFLockScreenDateView");
+ vpViewRec(@"SBFLockScreenDateView", [vpC stringByAppendingString:@" SBFLockScreenDateView"], vpDate);
+ vpObj(@"SBFLockScreenDateView", [vpC stringByAppendingString:@" SBFLockScreenDateView"], vpDate);
+ UIView *vpPTV = vpFind(vpCW, @"CSProminentTimeView");
+ vpObj(@"CSProminentTimeView", [vpC stringByAppendingString:@" CSProminentTimeView"], vpPTV);
+ UIView *vpPDV = vpFind(vpCW, @"CSProminentDisplayView");
+ vpObj(@"CSProminentDisplayView", [vpC stringByAppendingString:@" CSProminentDisplayView"], vpPDV);
+ vpObj(@"CSProminentDisplayViewController", [vpC stringByAppendingString:@" CSProminentDisplayView.(next responder VC)"], vpPDV ? vpVCOf(vpPDV) : nil);
+ vpViewsOf(@"SBCoverSheetWindow", vpCW, @[@"CSProminent", @"SBFLockScreenDateView", @"TitleLabelView", @"_UIAnimatingLabel", @"CSCombinedListView", @"NCNotificationStructuredListView", @"NCNotificationModernListView", @"NCNotificationListView", @"NCNotificationListCell", @"NCPlatterView", @"NCNotificationShortLookView", @"PLPlatterView", @"NCNotificationSeamless", @"NCNotificationListCountIndicatorView", @"NCNotificationListSectionRevealHintView", @"CSMainPageView", @"CSScrollView", @"CSFixedFooterView", @"CSStatusTextView", @"CSHomeAffordanceView", @"CSTeachableMomentsContainerView", @"SBUILegibilityLabel", @"CSQuickActions", @"NCGlassGroupView"]);
+ UIView *vpCLV = vpFind(vpCW, @"CSCombinedListView");
+ vpObj(@"CSCombinedListViewController", [vpC stringByAppendingString:@" CSCombinedListView.(next responder VC)"], vpCLV ? vpVCOf(vpCLV) : nil);
+ vpObj(@"CSCombinedListView", [vpC stringByAppendingString:@" CSCombinedListView"], vpCLV);
+ UIView *vpSLV = vpFind(vpCW, @"NCNotificationStructuredListView");
+ vpObj(@"NCNotificationStructuredListViewController", [vpC stringByAppendingString:@" NCNotificationStructuredListView.(next responder VC)"], vpSLV ? vpVCOf(vpSLV) : nil);
+ vpObj(@"NCNotificationStructuredListView", [vpC stringByAppendingString:@" NCNotificationStructuredListView"], vpSLV);
+ vpObj(@"NCNotificationListView#0", [vpC stringByAppendingString:@" first NCNotificationListView"], vpFind(vpCW, @"NCNotificationListView"));
+ NSArray *vpShort = vpFindAll(vpCW, @"NCNotificationShortLookView");
+ vpAdd(@"NCNotificationShortLookView.count", @"private", [vpC stringByAppendingString:@" BFS count NCNotificationShortLookView"], @(vpShort.count), nil);
+ if (vpShort.count) vpObj(@"NCNotificationShortLookView#0", [vpC stringByAppendingString:@" first NCNotificationShortLookView"], vpShort[0]);
+}
+NSDictionary *vpOutD = @{@"primaryScene": vpPrimary ? vpSceneId(vpPrimary) : @"", @"primaryOrientation": @(vpPrimary.interfaceOrientation), @"records": vpRecs};
+NSError *vpJErr = nil;
+NSData *vpJD = [NSJSONSerialization isValidJSONObject:vpOutD] ? [NSJSONSerialization dataWithJSONObject:vpOutD options:0 error:&vpJErr] : nil;
+vpJD ? [[NSString alloc] initWithData:vpJD encoding:NSUTF8StringEncoding] : [NSString stringWithFormat:@"INVALID JSON %@", vpJErr]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-run.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-run.zsh
new file mode 100755
index 00000000..47984c8b
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-run.zsh
@@ -0,0 +1,51 @@
+#!/bin/zsh
+# chrome-run.zsh <verb> <label> [posture args...]
+# posture <label> <closed|book|open> [swap options] drive posture (retry once on exit 3), save JSON
+# state <label> run probes/chrome-state.lldb in SpringBoard + screenshots
+# lock <label> lock (SBLockScreenManager lockUIFromSource:1 on the primary scene), post 3 test
+# notifications to com.apple.Preferences (simctl push), run probes/chrome-lock.lldb,
+# screenshots, then unlock (_finishUIUnlockFromSource:14 withOptions:nil; unlockUIFromSource: returned NO here)
+# Artifacts: raw/chrome/<label>-{posture.json,state.txt,lock.txt}, raw/chrome/shots/<label>-*.png
+set -euo pipefail
+here=${0:a:h}; root=${here:h}; cd $root
+U=A9C09C26-9AD3-4DF7-809D-E155D2D3F544
+out=raw/chrome; mkdir -p $out/shots $out/posture
+verb=$1; label=$2; shift 2
+lsm='NSObject *vpLSM = nil; NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"]; UIScene *vpP = (UIScene *)[vpDCM valueForKey:@"primaryWindowScene"]; vpLSM = [vpP valueForKey:@"lockScreenManager"];'
+case $verb in
+ posture)
+ rc=0; POSTURE_OUT=$out/posture tools/posture.zsh $U "$@" > $out/$label-posture.json || rc=$?
+ if (( rc == 3 )); then
+ print -u2 "chrome-run: posture $* did not verify; status, wait 11 s, retry"
+ POSTURE_OUT=$out/posture tools/posture.zsh $U status > $out/$label-posture-status.json || true
+ sleep 11; rc=0; POSTURE_OUT=$out/posture tools/posture.zsh $U "$@" > $out/$label-posture.json || rc=$?
+ fi
+ /opt/homebrew/bin/jq -c '{posture, swap_options, hinge: .springboard.hinge_state, pos: .springboard.position, lit: .screenshots.lit_panel, ok}' $out/$label-posture.json
+ exit $rc ;;
+ state)
+ tools/probe.zsh $U SpringBoard probes/chrome-state.lldb $out/$label-state.txt
+ tools/sim.zsh shot $U $out/shots $label-state
+ grep -q '^{' $out/$label-state.txt || { print -u2 "chrome-run: no JSON in $label-state.txt"; exit 1 } ;;
+ lock)
+ tools/probe.zsh $U SpringBoard - $out/$label-lockcmd.txt <<EOT
+expr -l objc -O -- $lsm ((void (*)(id, SEL, int, id))objc_msgSend)(vpLSM, @selector(lockUIFromSource:withOptions:), 1, nil); [NSString stringWithFormat:@"locked via %@ isUILocked=%@", [vpP valueForKey:@"_persistenceIdentifier"] ?: vpP.session.persistentIdentifier, [vpLSM valueForKey:@"isUILocked"]]
+EOT
+ sleep 2
+ for f in Preferences.json pref-2.json pref-3.json; do
+ p=$out/payloads/$f; [[ $f == Preferences.json ]] && p=$out/payloads/com.apple.Preferences.json
+ xcrun simctl push $U com.apple.Preferences $p >/dev/null
+ done
+ sleep 4
+ tools/probe.zsh $U SpringBoard probes/chrome-lock.lldb $out/$label-lock.txt
+ tools/sim.zsh shot $U $out/shots $label-lock
+ tools/probe.zsh $U SpringBoard - $out/$label-unlockcmd.txt <<EOT
+expr -l objc -O -- $lsm ((void (*)(id, SEL, int, id))objc_msgSend)(vpLSM, @selector(_finishUIUnlockFromSource:withOptions:), 14, nil); @"unlock requested"
+EOT
+ sleep 3
+ tools/probe.zsh $U SpringBoard - $out/$label-unlockcheck.txt <<EOT
+expr -l objc -O -- $lsm [NSString stringWithFormat:@"isUILocked=%@", [vpLSM valueForKey:@"isUILocked"]]
+EOT
+ grep isUILocked $out/$label-unlockcheck.txt | tail -1
+ grep -q '^{' $out/$label-lock.txt || { print -u2 "chrome-run: no JSON in $label-lock.txt"; exit 1 } ;;
+ *) sed -n '2,9p' ${0:a}; exit 2 ;;
+esac
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-state.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-state.lldb
new file mode 100644
index 00000000..d3e783a5
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/chrome-state.lldb
@@ -0,0 +1,345 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+__block NSString *vpCurDisp = @"-"; __block NSString *vpCurScene = @"-"; __block long vpCurOrient = 0;
+id (^vpNum)(double) = ^id(double vaX) { if (vaX != vaX) return (id)@"nan"; if (vaX > 1e300) return (id)@"inf"; if (vaX < -1e300) return (id)@"-inf"; return (id)@(vaX); };
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null], @"display": vpCurDisp, @"scene": vpCurScene, @"sceneOrientation": @(vpCurOrient)}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": vpNum(vaR.origin.x), @"y": vpNum(vaR.origin.y), @"width": vpNum(vaR.size.width), @"height": vpNum(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": vpNum(vaS.width), @"height": vpNum(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": vpNum(vaI.top), @"left": vpNum(vaI.left), @"bottom": vpNum(vaI.bottom), @"right": vpNum(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": vpNum(vaT.a), @"b": vpNum(vaT.b), @"c": vpNum(vaT.c), @"d": vpNum(vaT.d), @"tx": vpNum(vaT.tx), @"ty": vpNum(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return vpNum(vaD); return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!strcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!strcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!strcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": vpNum(vaP.x), @"y": vpNum(vaP.y)}; }
+ if (!strcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!strcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": vpNum(vaI.top), @"leading": vpNum(vaI.leading), @"bottom": vpNum(vaI.bottom), @"trailing": vpNum(vaI.trailing)}; }
+ if (!strcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? vpNum(vaBuf[vaJ]) : (id)@(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 400) vaS = [[vaS substringToIndex:400] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController", @"liftToWakeController", @"_preferredIntelligentAssistantVisibility", @"_preferredIntelligentAssistantConfiguration", @"SBSUI_preferredSystemRootLayerTransform", @"iconImageAlignment", @"maximumNumberOfPages"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vpSkip containsObject:vaGetter] || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGettersRx)(NSObject *, Class, NSRegularExpression *) = ^NSDictionary *(NSObject *vaO, Class vaStop, NSRegularExpression *vaAllowRx) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vaAllowRx firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) { return vpGettersRx(vaO, vaStop, vpAllow); };
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSSet *vpDataKeys = [NSSet setWithArray:@[@"currentAggregatedData", @"currentData", @"dataAggregator", @"displayItemStates", @"items", @"dependentDataEntryKeys", @"overlayData", @"animationContextId"]];
+void (^vpObj)(NSString *, NSString *, NSObject *) = ^(NSString *vaRole, NSString *vaCall, NSObject *vaO) {
+ if (!vaO) { vpAdd([vaRole stringByAppendingString:@".class"], @"private", vaCall, nil, @"nil"); return; }
+ vpAdd([vaRole stringByAppendingString:@".class"], @"private", [vaCall stringByAppendingString:@".class"], vpChain(vaO), nil);
+ NSMutableDictionary *vaAll = [NSMutableDictionary dictionaryWithDictionary:vpGetters(vaO, nil)];
+ [vaAll addEntriesFromDictionary:vpProps(vaO, nil)];
+ for (NSString *vaK in [[vaAll allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ if ([vpDataKeys containsObject:vaK]) continue;
+ vpAdd([NSString stringWithFormat:@"%@.%@", vaRole, vaK], @"private", [NSString stringWithFormat:@"%@.%@", vaCall, vaK], vaAll[vaK], nil);
+ }
+};
+void (^vpViewRec)(NSString *, NSString *, UIView *) = ^(NSString *vaRole, NSString *vaCall, UIView *vaV) {
+ if (!vaV) { vpAdd([vaRole stringByAppendingString:@".view"], @"public", vaCall, nil, @"nil (view not found)"); return; }
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionaryWithDictionary:vpView(vaV)];
+ if ([vaV isKindOfClass:[UILabel class]]) { vaD[@"text"] = [(UILabel *)vaV text] ?: (id)[NSNull null]; vaD[@"fontPointSize"] = @([(UILabel *)vaV font].pointSize); vaD[@"font"] = [[(UILabel *)vaV font] description] ?: @""; }
+ if ([vaV isKindOfClass:[UIImageView class]]) { UIImage *vaI = [(UIImageView *)vaV image]; vaD[@"imageSize"] = vaI ? vpSize(vaI.size) : (id)[NSNull null]; vaD[@"imageScale"] = vaI ? @(vaI.scale) : (id)[NSNull null]; vaD[@"contentMode"] = @(vaV.contentMode); }
+ CATransform3D vaT = vaV.layer.transform;
+ if (!CATransform3DIsIdentity(vaT)) vaD[@"layerTransform"] = @[vpNum(vaT.m11), vpNum(vaT.m12), vpNum(vaT.m21), vpNum(vaT.m22), vpNum(vaT.m41), vpNum(vaT.m42), vpNum(vaT.m43)];
+ vaD[@"layerBounds"] = vpRect(vaV.layer.bounds);
+ if (vaV.window) vaD[@"safeAreaInsets"] = vpInsets(vaV.safeAreaInsets);
+ vpAdd([vaRole stringByAppendingString:@".view"], @"public", [vaCall stringByAppendingString:@" frame/bounds/transform (frameInWindow = convertRect:bounds toView:window)"], vaD, nil);
+};
+void (^vpViewsOf)(NSString *, UIView *, NSArray *) = ^(NSString *vaPrefix, UIView *vaRoot, NSArray *vaClasses) {
+ NSMutableDictionary *vaSeen = [NSMutableDictionary dictionary];
+ NSMutableArray *vaQ = [NSMutableArray array]; if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) {
+ UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0];
+ NSString *vaCls = NSStringFromClass([vaV class]);
+ BOOL vaHit = (vaClasses == nil && vaV != vaRoot); for (NSString *vaC in vaClasses) if ([vaCls rangeOfString:vaC].location != NSNotFound) vaHit = YES;
+ if (vaHit) { NSInteger vaN = [(NSNumber *)vaSeen[vaCls] integerValue]; vaSeen[vaCls] = @(vaN + 1); vpViewRec([NSString stringWithFormat:@"%@.%@#%ld", vaPrefix, vaCls, (long)vaN], [NSString stringWithFormat:@"BFS(%@) %@ #%ld", vaPrefix, vaCls, (long)vaN], vaV); }
+ [vaQ addObjectsFromArray:vaV.subviews];
+ }
+};
+NSString *(^vpDispOf)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return [vaWS.session.persistentIdentifier isEqualToString:@"SB-main"] ? @"cover" : ([vaWS.session.persistentIdentifier isEqualToString:@"com.apple.springboard.bringup"] ? @"inner" : vaWS.session.persistentIdentifier); };
+NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"];
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [vpC stringByAppendingString:@".interfaceOrientation"], @(vpWS.interfaceOrientation), nil);
+ vpAdd(@"UIWindowScene.screen.bounds", @"public", [vpC stringByAppendingString:@".screen.bounds"], vpRect(vpWS.screen.bounds), nil);
+ vpAdd(@"UIWindowScene.coordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpWS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIWindowScene.effectiveGeometry", @"public", [vpC stringByAppendingString:@".effectiveGeometry"], [(NSObject *)vpWS.effectiveGeometry description], nil);
+ vpAdd(@"SBWindowScene.isPrimaryWindowScene", @"private", @"vpWS == [SBDisplayContentModeCoordinator primaryWindowScene]", @(vpWS == vpPrimary), nil);
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<%@>]", vpCurScene], @(((long (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS)), nil);
+ for (NSString *vpK in @[@"_interfaceOrientation", @"sb_displayContentMode", @"pbui_hostInformedOrientation", @"sbui_systemArbitratedInterfaceOrientation", @"_safeAreaCornerInsets", @"_hasOrientationDependentSafeAreaCornerInsets", @"_hasOrientationDependentSafeAreaEdgeInsets", @"_shouldRotateSafeAreaInsetsToInterfaceOrientation", @"_windowsIgnoreSceneClientOrientation", @"_peripheryInsets", @"_systemMinimumMargin", @"_referenceBounds"]) {
+ if ([vpWS respondsToSelector:NSSelectorFromString(vpK)]) vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], vpVal([vpWS valueForKey:vpK]), nil);
+ else vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], nil, @"does not respond");
+ }
+ NSObject *vpSBM = [vpWS valueForKey:@"statusBarManager"];
+ if ([vpSBM isKindOfClass:[UIStatusBarManager class]]) {
+ UIStatusBarManager *vpPub = (UIStatusBarManager *)vpSBM;
+ vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarFrame"], vpRect(vpPub.statusBarFrame), nil);
+ vpAdd(@"UIStatusBarManager.statusBarHidden", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarHidden"], @(vpPub.statusBarHidden), nil);
+ vpAdd(@"UIStatusBarManager.statusBarStyle", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarStyle"], @(vpPub.statusBarStyle), nil);
+ } else vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager"], vpChain(vpSBM), @"statusBarManager is not a UIStatusBarManager");
+ vpObj(@"SBWindowSceneStatusBarManager", [vpC stringByAppendingString:@".statusBarManager"], vpSBM);
+ vpObj(@"SBHIDUISensorModeController", [vpC stringByAppendingString:@".HIDUISensorModeController"], [vpWS valueForKey:@"HIDUISensorModeController"]);
+ vpObj(@"SBContinuousFoldController", [vpC stringByAppendingString:@".continuousFoldController"], [vpWS valueForKey:@"continuousFoldController"]);
+ NSRegularExpression *vpScrRx = [NSRegularExpression regularExpressionWithPattern:@"(xclusion|ensor|eriphery|utout|sland|otch|ornerRadius|Shape|afeArea|Aperture|Bezel|Corner|Hinge|Fold)" options:0 error:nil];
+ NSDictionary *vpScrG = vpGettersRx(vpWS.screen, nil, vpScrRx);
+ for (NSString *vpK in [[vpScrG allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"UIScreen." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@.screen.%@", vpC, vpK], vpScrG[vpK], nil);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ UIWindow *vpSBW = vpWin(vpWS, @"SBStatusBarWindow");
+ vpViewRec(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ vpObj(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ UIView *vpWrap = vpFind(vpSBW, @"STUIStatusBar_Wrapper");
+ UIView *vpSB = vpFind(vpSBW, @"STUIStatusBar");
+ vpViewRec(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpObj(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpViewRec(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ vpObj(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ if (!vpSB) continue;
+ vpObj(@"STUIStatusBarStyleAttributes", [vpC stringByAppendingString:@" STUIStatusBar.styleAttributes"], [vpSB valueForKey:@"styleAttributes"]);
+ vpObj(@"SBWindowSceneStatusBarAssertionManager", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper.manager"], [vpWrap respondsToSelector:NSSelectorFromString(@"manager")] ? [vpWrap valueForKey:@"manager"] : nil);
+ NSObject *vpVP = [vpSB valueForKey:@"visualProvider"];
+ vpAdd(@"STUIStatusBar.visualProviderClass", @"private", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider.class"], NSStringFromClass([vpVP class]), nil);
+ vpObj(@"STUIStatusBarVisualProvider", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider"], vpVP);
+ NSDictionary *vpCls = vpGetters((NSObject *)[vpVP class], nil);
+ for (NSString *vpK in [[vpCls allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"STUIStatusBarVisualProvider+" stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"+[%@ %@]", NSStringFromClass([vpVP class]), vpK], vpCls[vpK], nil);
+ unsigned int vpPN = 0;
+ for (Class vpK = [vpVP class]; vpK && vpK != [NSObject class]; vpK = class_getSuperclass(vpK)) {
+ objc_property_t *vpPs = class_copyPropertyList(vpK, &vpPN);
+ for (unsigned int vpI = 0; vpI < vpPN; vpI++) {
+ NSString *vpName = [NSString stringWithUTF8String:property_getName(vpPs[vpI])];
+ char *vpTy = property_copyAttributeValue(vpPs[vpI], "T");
+ BOOL vpIsGuide = vpTy && [[NSString stringWithUTF8String:vpTy] containsString:@"UILayoutGuide"];
+ if (vpTy) free(vpTy);
+ if (!vpIsGuide) continue;
+ UILayoutGuide *vpG = [vpVP valueForKey:vpName];
+ if (!vpG) { vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", vpName, nil, @"nil"); continue; }
+ CGRect vpLF = vpG.layoutFrame; UIView *vpOV = vpG.owningView;
+ vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", [NSString stringWithFormat:@"%@ visualProvider.%@.layoutFrame (owningView coords) + converted to window", vpC, vpName],
+ @{@"identifier": vpG.identifier ?: @"", @"layoutFrame": vpRect(vpLF), @"owningView": vpOV ? NSStringFromClass([vpOV class]) : (id)[NSNull null], @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpLF toView:vpOV.window]) : (id)[NSNull null]}, nil);
+ }
+ if (vpPs) free(vpPs);
+ }
+ NSDictionary *vpRegions = [vpSB valueForKey:@"regions"];
+ for (NSString *vpRK in [[vpRegions allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vpR = vpRegions[vpRK];
+ vpObj([NSString stringWithFormat:@"STUIStatusBarRegion[%@]", vpRK], [NSString stringWithFormat:@"%@ STUIStatusBar.regions[%@]", vpC, vpRK], vpR);
+ for (NSString *vpItemKey in @[@"layoutItem", @"contentView", @"containerView", @"containerItem"]) {
+ if (![vpR respondsToSelector:NSSelectorFromString(vpItemKey)]) continue;
+ NSObject *vpItem = [vpR valueForKey:vpItemKey];
+ if ([vpItem isKindOfClass:[UIView class]]) vpViewRec([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@", vpRK, vpItemKey], [NSString stringWithFormat:@"%@ regions[%@].%@", vpC, vpRK, vpItemKey], (UIView *)vpItem);
+ else if ([vpItem isKindOfClass:[UILayoutGuide class]]) { UILayoutGuide *vpG = (UILayoutGuide *)vpItem; UIView *vpOV = vpG.owningView; vpAdd([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@.layoutFrame", vpRK, vpItemKey], @"private", [NSString stringWithFormat:@"%@ regions[%@].%@.layoutFrame", vpC, vpRK, vpItemKey], @{@"layoutFrame": vpRect(vpG.layoutFrame), @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpG.layoutFrame toView:vpOV.window]) : (id)[NSNull null]}, nil); }
+ }
+ }
+ UIView *vpFG = [vpSB valueForKey:@"foregroundView"];
+ vpViewRec(@"STUIStatusBarForegroundView", [vpC stringByAppendingString:@" STUIStatusBar.foregroundView"], vpFG);
+ vpViewsOf(@"STUIStatusBarForegroundView", vpFG, nil);
+}
+NSArray *vpLocNames = @[@"SBIconLocationRoot", @"SBIconLocationRootWithWidgets", @"SBIconLocationRootWithWidgetsOnly", @"SBIconLocationDock", @"SBIconLocationFloatingDock", @"SBIconLocationFloatingDockSuggestions", @"SBIconLocationFolder", @"SBIconLocationAppLibrary", @"SBIconLocationAppLibraryCategoryPod", @"SBIconLocationAppLibraryCategoryPodExpanded", @"SBIconLocationAppLibrarySearch", @"SBIconLocationAppLibraryOverlay", @"SBIconLocationTodayView", @"SBIconLocationStackConfiguration", @"SBIconLocationAddWidgetSheet"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ UIWindow *vpHW = vpWin(vpWS, @"SBHomeScreenWindow");
+ vpViewRec(@"SBHomeScreenWindow", [vpC stringByAppendingString:@" SBHomeScreenWindow"], vpHW);
+ vpViewRec(@"SBIconContentView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBIconContentView"], vpFind(vpHW, @"SBIconContentView"));
+ vpViewRec(@"SBStatusBarLegibilityGradientView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBStatusBarLegibilityGradientView"], vpFind(vpHW, @"SBStatusBarLegibilityGradientView"));
+ NSObject *vpHSC = [vpWS valueForKey:@"homeScreenController"];
+ vpObj(@"SBHomeScreenController", [vpC stringByAppendingString:@".homeScreenController"], vpHSC);
+ NSObject *vpIM = [vpHSC respondsToSelector:NSSelectorFromString(@"iconManager")] ? [vpHSC valueForKey:@"iconManager"] : nil;
+ vpObj(@"SBHIconManager", [vpC stringByAppendingString:@".homeScreenController.iconManager"], vpIM);
+ NSObject *vpRFC = [vpIM respondsToSelector:NSSelectorFromString(@"rootFolderController")] ? [vpIM valueForKey:@"rootFolderController"] : nil;
+ vpObj(@"SBRootFolderController", [vpC stringByAppendingString:@".homeScreenController.iconManager.rootFolderController"], vpRFC);
+ UIView *vpRFV = vpFind(vpHW, @"SBRootFolderView");
+ vpViewRec(@"SBRootFolderView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBRootFolderView"], vpRFV);
+ vpObj(@"SBRootFolderView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBRootFolderView"], vpRFV);
+ NSObject *vpLLP = [vpIM respondsToSelector:NSSelectorFromString(@"listLayoutProvider")] ? [vpIM valueForKey:@"listLayoutProvider"] : nil;
+ vpObj(@"SBHIconListLayoutProvider", [vpC stringByAppendingString:@".homeScreenController.iconManager.listLayoutProvider"], vpLLP);
+ for (NSString *vpLN in vpLocNames) {
+ NSString **vpLP = (NSString **)dlsym(RTLD_DEFAULT, [vpLN UTF8String]);
+ NSString *vpLoc = vpLP ? *vpLP : vpLN;
+ NSString *vpRole = [NSString stringWithFormat:@"SBHIconListLayoutProvider.layoutForIconLocation[%@]", vpLN];
+ NSString *vpCall = [NSString stringWithFormat:@"%@ listLayoutProvider layoutForIconLocation:%@%@", vpC, vpLoc, vpLP ? @"" : @" (constant not found via dlsym; literal used)"];
+ if (![vpLLP respondsToSelector:@selector(layoutForIconLocation:)]) { vpAdd([vpRole stringByAppendingString:@".class"], @"private", vpCall, nil, @"listLayoutProvider missing or does not respond"); continue; }
+ NSObject *vpLay = ((id (*)(id, SEL, id))objc_msgSend)(vpLLP, @selector(layoutForIconLocation:), vpLoc);
+ vpAdd([vpRole stringByAppendingString:@".class"], @"private", vpCall, vpLay ? vpChain(vpLay) : nil, vpLay ? nil : @"nil");
+ NSObject *vpCfg = [vpLay respondsToSelector:NSSelectorFromString(@"layoutConfiguration")] ? [vpLay valueForKey:@"layoutConfiguration"] : nil;
+ if (vpCfg) vpObj([vpRole stringByAppendingString:@".layoutConfiguration"], [vpCall stringByAppendingString:@".layoutConfiguration"], vpCfg);
+ }
+ NSMutableArray *vpLists = [NSMutableArray array];
+ [vpLists addObjectsFromArray:vpFindAll(vpHW, @"SBIconListView")];
+ UIWindow *vpDW = vpWin(vpWS, @"SBFloatingDockWindow");
+ [vpLists addObjectsFromArray:vpFindAll(vpDW, @"SBIconListView")];
+ NSMutableDictionary *vpLocSeen = [NSMutableDictionary dictionary];
+ for (UIView *vpL in vpLists) {
+ NSString *vpLoc = [vpL respondsToSelector:NSSelectorFromString(@"iconLocation")] ? [(NSObject *)[vpL valueForKey:@"iconLocation"] description] : @"?";
+ NSString *vpKey = [NSString stringWithFormat:@"%@/%@", NSStringFromClass([vpL class]), vpLoc];
+ NSInteger vpN = [(NSNumber *)vpLocSeen[vpKey] integerValue]; vpLocSeen[vpKey] = @(vpN + 1);
+ NSString *vpRole = [NSString stringWithFormat:@"SBIconListView[%@#%ld]", vpKey, (long)vpN];
+ NSString *vpCall = [NSString stringWithFormat:@"%@ %@ <%@> #%ld", vpC, vpL.window ? NSStringFromClass([vpL.window class]) : @"(no window)", vpKey, (long)vpN];
+ vpViewRec(vpRole, vpCall, vpL);
+ BOOL vpMainList = [vpLoc isEqualToString:@"SBIconLocationRoot"] || [vpLoc isEqualToString:@"SBIconLocationFloatingDock"];
+ if (vpMainList) vpObj(vpRole, vpCall, vpL);
+ NSObject *vpLay = [vpL respondsToSelector:NSSelectorFromString(@"layout")] ? [vpL valueForKey:@"layout"] : nil;
+ vpObj([vpRole stringByAppendingString:@".layout"], [vpCall stringByAppendingString:@".layout"], vpLay);
+ NSObject *vpCfg = [vpLay respondsToSelector:NSSelectorFromString(@"layoutConfiguration")] ? [vpLay valueForKey:@"layoutConfiguration"] : nil;
+ vpObj([vpRole stringByAppendingString:@".layout.layoutConfiguration"], [vpCall stringByAppendingString:@".layout.layoutConfiguration"], vpCfg);
+ if (vpCfg && vpMainList) {
+ unsigned int vpPN = 0; objc_property_t *vpPs = class_copyPropertyList([vpCfg class], &vpPN);
+ for (unsigned int vpI = 0; vpI < vpPN; vpI++) {
+ NSString *vpPName = [NSString stringWithUTF8String:property_getName(vpPs[vpI])];
+ if (![vpPName hasSuffix:@"VisualConfiguration"]) continue;
+ vpObj([NSString stringWithFormat:@"%@.layout.layoutConfiguration.%@", vpRole, vpPName], [NSString stringWithFormat:@"%@.layout.layoutConfiguration.%@", vpCall, vpPName], [vpCfg valueForKey:vpPName]);
+ }
+ if (vpPs) free(vpPs);
+ }
+ UIView *vpIV = vpFind(vpL, @"SBIconView");
+ if (vpIV) {
+ vpViewRec([vpRole stringByAppendingString:@".firstIconView"], [vpCall stringByAppendingString:@" first SBIconView"], vpIV);
+ if (vpMainList) { vpObj([vpRole stringByAppendingString:@".firstIconView"], [vpCall stringByAppendingString:@" first SBIconView"], vpIV);
+ vpViewsOf([vpRole stringByAppendingString:@".firstIconView"], vpIV, nil); }
+ } else vpAdd([vpRole stringByAppendingString:@".firstIconView.view"], @"public", [vpCall stringByAppendingString:@" first SBIconView"], nil, @"no SBIconView in list");
+ }
+ vpViewsOf(@"SBHomeScreenWindow", vpHW, @[@"PageControl", @"SBHSearch", @"Library", @"Today", @"Widget", @"Sidebar", @"SBFolderScrollAccessoryView", @"SBIconScrollView"]);
+ UIView *vpPC = vpFind(vpHW, @"SBIconListPageControl");
+ if (vpPC) vpObj(@"SBIconListPageControl", [vpC stringByAppendingString:@" SBIconListPageControl"], vpPC);
+ vpViewRec(@"SBFloatingDockWindow", [vpC stringByAppendingString:@" SBFloatingDockWindow"], vpDW);
+ vpObj(@"SBFloatingDockController", [vpC stringByAppendingString:@".floatingDockController"], [vpWS valueForKey:@"floatingDockController"]);
+ vpObj(@"SBFloatingDockRootViewController", [vpC stringByAppendingString:@" SBFloatingDockWindow.rootViewController"], vpDW.rootViewController);
+ NSObject *vpFDVC = [vpDW.rootViewController respondsToSelector:NSSelectorFromString(@"floatingDockViewController")] ? [vpDW.rootViewController valueForKey:@"floatingDockViewController"] : nil;
+ vpObj(@"SBFloatingDockViewController", [vpC stringByAppendingString:@" SBFloatingDockRootViewController.floatingDockViewController"], vpFDVC);
+ UIView *vpFDV = vpFind(vpDW, @"SBFloatingDockView");
+ vpViewRec(@"SBFloatingDockView", [vpC stringByAppendingString:@" SBFloatingDockWindow/SBFloatingDockView"], vpFDV);
+ vpObj(@"SBFloatingDockView", [vpC stringByAppendingString:@" SBFloatingDockWindow/SBFloatingDockView"], vpFDV);
+ vpViewsOf(@"SBFloatingDockWindow", vpDW, @[@"SBFloatingDockPlatterView", @"SBHSearchButton", @"SeparatorView"]);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ NSObject *vpWC = [vpWS valueForKey:@"wallpaperController"];
+ vpObj(@"SBWallpaperController", [vpC stringByAppendingString:@".wallpaperController"], vpWC);
+ UIWindow *vpWW = vpWin(vpWS, @"_SBWallpaperSecureWindow");
+ vpViewRec(@"_SBWallpaperSecureWindow", [vpC stringByAppendingString:@" _SBWallpaperSecureWindow"], vpWW);
+ vpObj(@"_SBWallpaperSecureWindow", [vpC stringByAppendingString:@" _SBWallpaperSecureWindow"], vpWW);
+ vpObj(@"_SBWallpaperWindowRootViewController", [vpC stringByAppendingString:@" _SBWallpaperSecureWindow.rootViewController"], vpWW.rootViewController);
+ vpViewsOf(@"_SBWallpaperSecureWindow", vpWW, @[@"PBUI", @"BSUIOrientation", @"Wallpaper", @"Poster", @"_UIScenePresentationView"]);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ NSObject *vpWC = [vpWS valueForKey:@"wallpaperController"];
+ NSObject *vpHPC = [vpWC respondsToSelector:NSSelectorFromString(@"hingeProgressController")] ? [vpWC valueForKey:@"hingeProgressController"] : nil;
+ vpObj(@"SBWallpaperHingeProgressController", [vpC stringByAppendingString:@".wallpaperController.hingeProgressController"], vpHPC);
+ unsigned int vpIN = 0; Ivar *vpIvs = vpHPC ? class_copyIvarList([vpHPC class], &vpIN) : NULL;
+ for (unsigned int vpI = 0; vpI < vpIN; vpI++) {
+ NSString *vpName = [NSString stringWithUTF8String:ivar_getName(vpIvs[vpI])];
+ const char *vpT = ivar_getTypeEncoding(vpIvs[vpI]);
+ NSString *vpTs = vpT ? [NSString stringWithUTF8String:vpT] : @"";
+ id vpVv = nil;
+ if ([vpTs isEqualToString:@"d"]) vpVv = vpNum(*(double *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs isEqualToString:@"q"]) vpVv = @(*(long long *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs isEqualToString:@"B"]) vpVv = @(*(BOOL *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs hasPrefix:@"@"]) vpVv = vpVal(object_getIvar(vpHPC, vpIvs[vpI]));
+ else vpVv = [@"type " stringByAppendingString:vpTs];
+ vpAdd([@"SBWallpaperHingeProgressController.ivar." stringByAppendingString:vpName], @"private", [NSString stringWithFormat:@"%@ hingeProgressController ivar %@ (%@)", vpC, vpName, vpTs], vpVv, nil);
+ }
+ if (vpIvs) free(vpIvs);
+}
+NSDictionary *vpOutD = @{@"primaryScene": vpPrimary ? vpSceneId(vpPrimary) : @"", @"primaryOrientation": @(vpPrimary.interfaceOrientation), @"records": vpRecs};
+NSError *vpJErr = nil;
+NSData *vpJD = [NSJSONSerialization isValidJSONObject:vpOutD] ? [NSJSONSerialization dataWithJSONObject:vpOutD options:0 error:&vpJErr] : nil;
+vpJD ? [[NSString alloc] initWithData:vpJD encoding:NSUTF8StringEncoding] : [NSString stringWithFormat:@"INVALID JSON %@", vpJErr]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-backboardd.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-backboardd.lldb
new file mode 100644
index 00000000..247d0de2
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-backboardd.lldb
@@ -0,0 +1,259 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpTrace)(NSString *) = ^(NSString *s) { [s writeToFile:@"/private/tmp/claude-501/-Users-Jacky--claude-spares-spare-SBbPAl/57b50db2-159e-4729-b15b-b24d84c6e854/scratchpad/vptrace.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil]; };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) { return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)}; };
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize s) { return @{@"width": @(s.width), @"height": @(s.height)}; };
+NSDictionary *(^vpPoint)(CGPoint) = ^NSDictionary *(CGPoint p) { return @{@"x": @(p.x), @"y": @(p.y)}; };
+__block id (^vpJSON)(id);
+vpJSON = ^id(id vIn) { NSObject *v = (NSObject *)vIn;
+ if (!v) return [NSNull null];
+ if ([v isKindOfClass:[NSString class]]) return v;
+ if ([v isKindOfClass:[NSNumber class]]) {
+ double vd = [(NSNumber *)v doubleValue];
+ if (vd != vd || vd == INFINITY || vd == -INFINITY) return [(NSObject *)v description];
+ return v;
+ }
+ if ([v isKindOfClass:[NSValue class]]) {
+ const char *vt = [(NSValue *)v objCType];
+ if (strncmp(vt, "{CGRect=", 8) == 0) { CGRect r; [(NSValue *)v getValue:&r]; return vpRect(r); }
+ if (strncmp(vt, "{CGSize=", 8) == 0) { CGSize s; [(NSValue *)v getValue:&s]; return vpSize(s); }
+ if (strncmp(vt, "{CGPoint=", 9) == 0) { CGPoint p; [(NSValue *)v getValue:&p]; return vpPoint(p); }
+ return [(NSObject *)v description];
+ }
+ if ([v isKindOfClass:[NSArray class]] || [v isKindOfClass:[NSSet class]] || [v isKindOfClass:[NSOrderedSet class]]) {
+ NSMutableArray *va = [NSMutableArray array];
+ for (id vx in (NSArray *)v) [va addObject:vpJSON(vx)];
+ return va;
+ }
+ if ([v isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *vm = [NSMutableDictionary dictionary];
+ for (id vk in (NSDictionary *)v) vm[[(NSObject *)vk description]] = vpJSON([(NSDictionary *)v objectForKey:vk]);
+ return vm;
+ }
+ if ([v isKindOfClass:[NSUUID class]]) return [(NSUUID *)v UUIDString];
+ return [(NSObject *)v description];
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ? vpJSON(value) : [NSNull null], @"error": error ?: (value ? (id)[NSNull null] : (id)@"nil")}];
+};
+NSArray *vpDenyExact = @[@"dealloc", @"invalidate", @"update", @"updateDisplays", @"_finalize", @"_invalidate", @"init", @"_init", @".cxx_destruct", @".cxx_construct", @"copy", @"mutableCopy", @"immutableCopy", @"freeze", @"acquireFrozenSurface", @"activateReplay", @"rebuildModeList", @"removeAllClones", @"resetConfiguration", @"disableDICOM", @"willUnblank", @"commitPreset", @"unregisterNotificationBlocks", @"unregisterSyncNotificationBlocks", @"clearUpdateMask", @"initializeClientPort", @"acquireWirelessDisplayStateControl", @"_detectDisplays", @"_detectSimDisplays", @"removeAllDisplays", @"enableOutOfProcessDisplayObservation", @"updateBandWidthInfoForAllDisplays", @"stopServer", @"new", @"alloc", @"class", @"self", @"retain", @"release", @"autorelease", @"retainCount", @"zone", @"hash", @"superclass", @"debugDescription", @"description", @"succinctDescription", @"succinctDescriptionBuilder", @"descriptionBuilder", @"_availableModesInternal", @"copyForSecureRendering", @"cancelTouchesOnMainDisplay", @"cancelTouchesOnAllDisplays", @"prepareForRestart", @"updateTransformsWithCompletion", @"_postInitialBookendObserverConnections", @"_cleanup", @"_freeze", @"_startAnimating", @"_stopAnimating", @"copyPrivateRepresentation", @"initForProtobufDecoding", @"_queue_resetTouchAuthenticationInitialSampleEvent", @"layoutIfNeeded", @"setNeedsLayout", @"_copyDebugProperties", @"_dragManager", @"_focusSystem", @"_interactiveHighlightEnvironment", @"focusItemContainer", @"focusedItem", @"focusedView", @"parentFocusEnvironment", @"preferredFocusEnvironments", @"preferredFocusedView", @"_preferredFocusedWindow", @"_preferredFocusedWindowScene", @"_boundingPathUtilities", @"_carSession", @"supportsFocus", @"_SwiftUITesting_currentScreenScale", @"_SwiftUITesting_wantsWideContentMargins", @"__ck_isFullscreen", @"pu_workImageSize", @"px_currentEDRHeadroom", @"px_potentialEDRHeadroom", @"ck_screenSizeCategory", @"_mapkit_display", @"postBookendConnections", @"bookendObserver", @"observers"];
+NSArray *vpDenyPrefix = @[@"set", @"_set", @"remove", @"_remove", @"add", @"cancel", @"invalidate", @"_lock_", @"_workQueue_", @"_queue_", @"_post", @"_present", @"_dismiss", @"_update", @"_wrap", @"reevaluate", @"_begin", @"_end", @"begin", @"end", @"_prepare", @"_reset", @"reset", @"_flush", @"flush", @"_notify", @"_handle", @"_init", @"init", @"_copy", @"copy", @"_create", @"create", @"_install", @"_uninstall", @"_register", @"_unregister", @"register", @"unregister", @"_perform", @"perform", @"_apply", @"apply", @"_enable", @"_disable", @"_invalidate", @"_teardown", @"_start", @"_stop", @"start", @"stop", @"_send", @"send", @"_snapshot", @"snapshot", @"_dump", @"dump", @"_run", @"_schedule", @"_will", @"_did", @"_reload", @"reload", @"_force", @"_clear", @"clear", @"_release", @"_acquire", @"acquire", @"_take", @"_capture", @"_trigger", @"_request", @"request", @"_animate", @"_show", @"_hide", @"_attach", @"_detach", @"_connect", @"_disconnect", @"_present", @"_activate", @"_deactivate", @"_destroy", @"_purge", @"_close", @"_open", @"_save", @"_load", @"_make", @"make", @"_print", @"_log", @"_toggle", @"_test", @"_simulate", @"_fake", @"_debug"];
+NSArray *vpThrowSels = @[@"secureIndicatorsEnabled"];
+BOOL (^vpAllowed)(NSString *) = ^BOOL(NSString *sel) {
+ if ([vpThrowSels containsObject:sel]) return NO;
+ if ([sel rangeOfString:@":"].location != NSNotFound) return NO;
+ if ([vpDenyExact containsObject:sel]) return NO;
+ for (NSString *vp in vpDenyPrefix) if ([sel hasPrefix:vp]) return NO;
+ return YES;
+};
+id (^vpCall)(id, NSString *, NSString **) = ^id(id obj, NSString *sel, NSString **err) {
+ SEL vs = NSSelectorFromString(sel);
+ if (![(NSObject *)obj respondsToSelector:vs]) { *err = @"does not respond"; return (id)nil; }
+ Method vm = class_getInstanceMethod(object_getClass(obj), vs);
+ if (!vm) { *err = @"no method"; return (id)nil; }
+ if (method_getNumberOfArguments(vm) != 2) { *err = @"takes arguments"; return (id)nil; }
+ char vt[256]; method_getReturnType(vm, vt, sizeof(vt));
+ const char *vr = vt; while (*vr == 'r' || *vr == 'n' || *vr == 'N' || *vr == 'o' || *vr == 'O' || *vr == 'R' || *vr == 'V') vr++;
+ switch (vr[0]) {
+ case '@': if (vr[1] == '?') { *err = @"block"; return (id)nil; }
+ { id vo = ((id (*)(id, SEL))objc_msgSend)(obj, vs); if (!vo) *err = @"nil"; return vo; }
+ case '#': { Class vc = ((Class (*)(id, SEL))objc_msgSend)(obj, vs); return vc ? NSStringFromClass(vc) : (id)nil; }
+ case 'B': return @(((BOOL (*)(id, SEL))objc_msgSend)(obj, vs) ? YES : NO);
+ case 'c': return @(((signed char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'C': return @(((unsigned char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 's': return @(((short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'S': return @(((unsigned short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'i': return @(((int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'I': return @(((unsigned int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'l': return @(((long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'L': return @(((unsigned long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'q': return @(((long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'Q': return @(((unsigned long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'f': return @(((float (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'd': return @(((double (*)(id, SEL))objc_msgSend)(obj, vs));
+ case '{':
+ if (strncmp(vr, "{CGRect=", 8) == 0) return vpRect(((CGRect (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGSize=", 8) == 0) return vpSize(((CGSize (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGPoint=", 9) == 0) return vpPoint(((CGPoint (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{UIEdgeInsets=", 14) == 0 || strncmp(vr, "{NSDirectionalEdgeInsets=", 25) == 0) { struct VPInsets { double a, b, c, d; } vi4 = ((struct VPInsets (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"top": @(vi4.a), @"left": @(vi4.b), @"bottom": @(vi4.c), @"right": @(vi4.d)}; }
+ if (strncmp(vr, "{CGAffineTransform=", 19) == 0) { CGAffineTransform vx = ((CGAffineTransform (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vx.a), @(vx.b), @(vx.c), @(vx.d), @(vx.tx), @(vx.ty)]; }
+ if (strcmp(vr, "{?=ff}") == 0) { struct VPff { float a, b; } vf = ((struct VPff (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf.a), @(vf.b)]; }
+ if (strcmp(vr, "{?={?=ff}{?=ff}{?=ff}{?=ff}}") == 0) { struct VPf8 { float a[8]; } vf8 = ((struct VPf8 (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf8.a[0]), @(vf8.a[1]), @(vf8.a[2]), @(vf8.a[3]), @(vf8.a[4]), @(vf8.a[5]), @(vf8.a[6]), @(vf8.a[7])]; }
+ if (strncmp(vr, "{CAFrameRateRange=", 18) == 0) { struct VPfff { float a, b, c; } vf3 = ((struct VPfff (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"minimum": @(vf3.a), @"maximum": @(vf3.b), @"preferred": @(vf3.c)}; }
+ *err = [NSString stringWithFormat:@"unsupported struct return %.60s", vr]; return (id)nil;
+ default: *err = [NSString stringWithFormat:@"unsupported return type %.60s", vr]; return (id)nil;
+ }
+};
+NSArray *(^vpGetters)(Class, Class) = ^NSArray *(Class cls, Class stop) {
+ char vrt[8];
+ NSMutableOrderedSet *vs = [NSMutableOrderedSet orderedSet];
+ for (Class vc = cls; vc && vc != stop && vc != [NSObject class]; vc = class_getSuperclass(vc)) {
+ unsigned int vn = 0;
+ objc_property_t *vp = class_copyPropertyList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ char *vg = property_copyAttributeValue(vp[vi], "G");
+ NSString *vgs = vg ? [NSString stringWithUTF8String:vg] : [NSString stringWithUTF8String:property_getName(vp[vi])];
+ if (vg) free(vg);
+ if (vpAllowed(vgs)) [vs addObject:vgs];
+ }
+ free(vp);
+ Method *vm = class_copyMethodList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vsel = NSStringFromSelector(method_getName(vm[vi]));
+ method_getReturnType(vm[vi], vrt, sizeof(vrt)); if (vrt[0] == 'v') continue;
+ if (method_getNumberOfArguments(vm[vi]) == 2 && vpAllowed(vsel)) [vs addObject:vsel];
+ }
+ free(vm);
+ }
+ return [[vs array] sortedArrayUsingSelector:@selector(compare:)];
+};
+void (^vpDump)(id, NSString *, NSString *, NSString *, Class) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, Class stop) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ vpAdd([apiClass stringByAppendingString:@".description"], kind, [callPrefix stringByAppendingString:@".description"], [(NSObject *)obj description], nil);
+ vpAdd([apiClass stringByAppendingString:@".class"], kind, [callPrefix stringByAppendingString:@".class"], NSStringFromClass([(NSObject *)obj class]), nil);
+ for (NSString *vsel in vpGetters([(NSObject *)obj class], stop)) {
+ vpTrace([NSString stringWithFormat:@"%@ %@", callPrefix, vsel]);
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+ for (NSString *vsel in vpThrowSels) if ([(NSObject *)obj respondsToSelector:NSSelectorFromString(vsel)]) vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], nil, @"raises an Objective-C exception in this process (not called)");
+};
+NSDictionary *(^vpObjDict)(id) = ^NSDictionary *(id objIn) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ if (!objIn) return vd;
+ for (NSString *vsel in vpGetters([(NSObject *)objIn class], nil)) { vpTrace([NSString stringWithFormat:@"objdict %@ %@", NSStringFromClass([(NSObject *)objIn class]), vsel]); NSString *verr = nil; id vv = vpCall(objIn, vsel, &verr); vd[vsel] = vv ? vpJSON(vv) : [NSString stringWithFormat:@"<error: %@>", verr]; }
+ return vd;
+};
+void (^vpDumpSel)(id, NSString *, NSString *, NSString *, NSArray *) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, NSArray *sels) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ for (NSString *vsel in sels) {
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+};
+id vpOrientation = nil;
+Class vpCADisplay = NSClassFromString(@"CADisplay");
+Class vpCADisplayMode = NSClassFromString(@"CADisplayMode");
+NSString *(^vpCStr)(char *) = ^NSString *(char *s) { if (!s) return (NSString *)nil; NSString *vs = [NSString stringWithUTF8String:s]; free(s); return vs; };
+NSArray *vpDisplays = ((id (*)(id, SEL))objc_msgSend)(vpCADisplay, @selector(displays));
+NSObject *vpMain = ((id (*)(id, SEL))objc_msgSend)(vpCADisplay, @selector(mainDisplay));
+vpAdd(@"CADisplay.displays", @"private", @"[CADisplay displays].count", @(vpDisplays.count), nil);
+vpAdd(@"CADisplay.displays.names", @"private", @"[[CADisplay displays] valueForKey:@\"name\"]", [vpDisplays valueForKey:@"name"], nil);
+vpAdd(@"CADisplay.mainDisplay.indexInDisplays", @"private", @"[[CADisplay displays] indexOfObjectIdenticalTo:[CADisplay mainDisplay]]", @((long)[vpDisplays indexOfObjectIdenticalTo:vpMain]), nil);
+NSObject *vpTV = ((id (*)(id, SEL))objc_msgSend)(vpCADisplay, NSSelectorFromString(@"TVOutDisplay"));
+vpAdd(@"CADisplay.TVOutDisplay", @"private", @"[CADisplay TVOutDisplay]", vpTV ? [(NSObject *)vpTV description] : nil, vpTV ? nil : @"nil");
+NSMutableArray *vpDispList = [NSMutableArray arrayWithArray:vpDisplays];
+NSMutableArray *vpDispCalls = [NSMutableArray array];
+for (NSUInteger vi = 0; vi < vpDisplays.count; vi++) [vpDispCalls addObject:[NSString stringWithFormat:@"[CADisplay displays][%lu]<%@>", (unsigned long)vi, [(NSObject *)vpDisplays[vi] valueForKey:@"name"]]];
+if (vpMain) { [vpDispList addObject:vpMain]; [vpDispCalls addObject:[NSString stringWithFormat:@"[CADisplay mainDisplay]<%@>", [vpMain valueForKey:@"name"]]]; }
+for (NSUInteger vi = 0; vi < vpDispList.count; vi++) {
+ NSObject *vpD = vpDispList[vi];
+ NSString *vpC = vpDispCalls[vi];
+ vpDump(vpD, @"CADisplay", @"private", vpC, nil);
+ NSObject *vpCur = [vpD valueForKey:@"currentMode"];
+ vpAdd(@"CADisplay.currentMode.getters", @"private", [vpC stringByAppendingString:@".currentMode.*"], vpCur ? vpObjDict(vpCur) : nil, vpCur ? nil : @"nil");
+ NSObject *vpPref = [vpD valueForKey:@"preferredMode"];
+ vpAdd(@"CADisplay.preferredMode.getters", @"private", [vpC stringByAppendingString:@".preferredMode.*"], vpPref ? vpObjDict(vpPref) : nil, vpPref ? nil : @"nil");
+ NSMutableArray *vpModes = [NSMutableArray array];
+ for (id vpM in (NSArray *)[vpD valueForKey:@"availableModes"]) [vpModes addObject:vpObjDict(vpM)];
+ vpAdd(@"CADisplay.availableModes.getters", @"private", [vpC stringByAppendingString:@".availableModes[*].*"], vpModes, nil);
+ NSObject *vpPrefs = [vpD valueForKey:@"preferences"];
+ vpAdd(@"CADisplay.preferences.getters", @"private", [vpC stringByAppendingString:@".preferences.*"], vpPrefs ? vpObjDict(vpPrefs) : nil, vpPrefs ? nil : @"nil");
+ NSObject *vpExt = [vpD valueForKey:@"externalDisplayAttributes"];
+ vpAdd(@"CADisplay.externalDisplayAttributes.getters", @"private", [vpC stringByAppendingString:@".externalDisplayAttributes.*"], vpExt ? vpObjDict(vpExt) : nil, vpExt ? nil : @"nil");
+ NSObject *vpSC = [vpD valueForKey:@"stateControl"];
+ vpDump(vpSC, @"CADisplayStateControl", @"private", [vpC stringByAppendingString:@".stateControl"], nil);
+ if (vpSC) {
+ vpAdd(@"CADisplayStateControl._copyStateInfo", @"private", [vpC stringByAppendingString:@".stateControl._copyStateInfo"], vpCStr(((char *(*)(id, SEL))objc_msgSend)(vpSC, NSSelectorFromString(@"_copyStateInfo"))), nil);
+ vpAdd(@"CADisplayStateControl._copyAllPowerAssertionInfo", @"private", [vpC stringByAppendingString:@".stateControl._copyAllPowerAssertionInfo"], vpCStr(((char *(*)(id, SEL))objc_msgSend)(vpSC, NSSelectorFromString(@"_copyAllPowerAssertionInfo"))), nil);
+ vpAdd(@"CADisplayStateControl._copyAllFrameRateAssertionInfo", @"private", [vpC stringByAppendingString:@".stateControl._copyAllFrameRateAssertionInfo"], vpCStr(((char *(*)(id, SEL))objc_msgSend)(vpSC, NSSelectorFromString(@"_copyAllFrameRateAssertionInfo"))), nil);
+ }
+ CFDictionaryRef vpDbg = ((CFDictionaryRef (*)(id, SEL))objc_msgSend)(vpD, NSSelectorFromString(@"_copyDebugProperties"));
+ vpAdd(@"CADisplay._copyDebugProperties", @"private", [vpC stringByAppendingString:@"._copyDebugProperties"], vpDbg ? (__bridge id)vpDbg : nil, vpDbg ? nil : @"NULL");
+}
+NSObject *vpWS = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"CAWindowServer"), NSSelectorFromString(@"serverIfRunning"));
+vpDump(vpWS, @"CAWindowServer", @"private", @"[CAWindowServer serverIfRunning]", nil);
+NSArray *vpWSD = vpWS ? [vpWS valueForKey:@"displays"] : @[];
+NSMutableDictionary *vpUUIDs = [NSMutableDictionary dictionary];
+for (NSUInteger vi = 0; vi < vpWSD.count; vi++) {
+ NSObject *vpD = vpWSD[vi];
+ NSString *vpC = [NSString stringWithFormat:@"[CAWindowServer serverIfRunning].displays[%lu]<%@>", (unsigned long)vi, [vpD valueForKey:@"name"]];
+ vpDump(vpD, @"CAWindowServerDisplay", @"private", vpC, nil);
+ CGRect vpB = ((CGRect (*)(id, SEL))objc_msgSend)(vpD, @selector(bounds));
+ unsigned int vpCtx = ((unsigned int (*)(id, SEL, CGPoint))objc_msgSend)(vpD, NSSelectorFromString(@"contextIdAtPosition:"), CGPointMake(CGRectGetMidX(vpB), CGRectGetMidY(vpB)));
+ vpAdd(@"CAWindowServerDisplay.contextIdAtPosition:center", @"private", [vpC stringByAppendingString:@" contextIdAtPosition:(center of bounds)"], @(vpCtx), nil);
+ NSString *vpU = [(NSObject *)[vpD valueForKey:@"uniqueId"] description];
+ NSObject *vpUU = [vpD valueForKey:@"uuid"];
+ vpUUIDs[[vpD valueForKey:@"name"]] = @{@"uniqueId": vpU ?: [NSNull null], @"uuid": vpUU ? [(NSUUID *)vpUU UUIDString] : [NSNull null]};
+}
+vpAdd(@"CAWindowServerDisplay.nameToIds", @"private", @"{name: {uniqueId, uuid}} over [CAWindowServer serverIfRunning].displays", vpUUIDs, nil);
+NSObject *vpOrientCtl = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKDisplayOrientationController"), @selector(sharedInstance));
+NSDictionary *vpOBU = [vpOrientCtl valueForKey:@"_orientationByDisplayUUID"];
+vpAdd(@"BKDisplayOrientationController._orientationByDisplayUUID", @"private", @"[[BKDisplayOrientationController sharedInstance] valueForKey:@\"_orientationByDisplayUUID\"]", vpOBU, nil);
+NSMutableOrderedSet *vpAllUUIDs = [NSMutableOrderedSet orderedSetWithArray:[vpOBU allKeys]];
+for (NSObject *vpD in vpDisplays) { NSObject *vu = [vpD valueForKey:@"uniqueId"]; if (vu) [vpAllUUIDs addObject:vu]; NSObject *vuu = [vpD valueForKey:@"UUID"]; if (vuu) [vpAllUUIDs addObject:[(NSUUID *)vuu UUIDString]]; }
+vpAdd(@"backboardd.displayUUIDsProbed", @"private", @"union of _orientationByDisplayUUID keys, CADisplay.uniqueId, CADisplay.UUID", [vpAllUUIDs array], nil);
+NSObject *vpDC = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKDisplayController"), @selector(sharedInstance));
+struct VPGeom { CGSize size; double scale; unsigned char orientation; CGRect rect; };
+for (NSString *vpU in vpAllUUIDs) {
+ long long vpIO = ((long long (*)(id, SEL, id))objc_msgSend)(vpOrientCtl, NSSelectorFromString(@"interfaceOrientationForDisplayUUID:"), vpU);
+ vpAdd(@"BKDisplayOrientationController.interfaceOrientationForDisplayUUID:", @"private", [NSString stringWithFormat:@"[[BKDisplayOrientationController sharedInstance] interfaceOrientationForDisplayUUID:@\"%@\"]", vpU], @(vpIO), nil);
+ NSObject *vpDD = ((id (*)(id, SEL, id))objc_msgSend)(vpDC, NSSelectorFromString(@"displayForUUID:"), vpU);
+ vpAdd(@"BKDisplayController.displayForUUID:", @"private", [NSString stringWithFormat:@"[[BKDisplayController sharedInstance] displayForUUID:@\"%@\"]", vpU], vpDD ? [(NSObject *)vpDD description] : nil, vpDD ? nil : @"nil");
+ struct VPGeom vpG = ((struct VPGeom (*)(id, SEL, id))objc_msgSend)(vpDC, NSSelectorFromString(@"geometryForDisplayUUID:"), vpU);
+ vpAdd(@"BKDisplayController.geometryForDisplayUUID:", @"private", [NSString stringWithFormat:@"[[BKDisplayController sharedInstance] geometryForDisplayUUID:@\"%@\"] as {CGSize; double; uchar; CGRect}", vpU], @{@"size": vpSize(vpG.size), @"double": @(vpG.scale), @"uchar": @(vpG.orientation), @"rect": vpRect(vpG.rect)}, nil);
+ BOOL vpBl = ((BOOL (*)(id, SEL, id))objc_msgSend)(vpDC, NSSelectorFromString(@"displayIsBlanked:"), vpU);
+ vpAdd(@"BKDisplayController.displayIsBlanked:", @"private", [NSString stringWithFormat:@"[[BKDisplayController sharedInstance] displayIsBlanked:@\"%@\"]", vpU], @(vpBl), nil);
+}
+NSObject *vpProv = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKSharedCADisplayProvider"), @selector(sharedInstance));
+vpAdd(@"BKSharedCADisplayProvider.displays", @"private", @"[[BKSharedCADisplayProvider sharedInstance] displays]", [vpProv valueForKey:@"displays"], nil);
+vpAdd(@"BKSharedCADisplayProvider.mainDisplay", @"private", @"[[BKSharedCADisplayProvider sharedInstance] mainDisplay]", [(NSObject *)[vpProv valueForKey:@"mainDisplay"] description], nil);
+NSObject *vpOM = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKOrientationManager"), @selector(sharedInstance));
+vpDump(vpOM, @"BKOrientationManager", @"private", @"[BKOrientationManager sharedInstance]", nil);
+NSObject *vpBC = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKDisplayBrightnessController"), @selector(sharedInstance));
+vpDump(vpBC, @"BKDisplayBrightnessController", @"private", @"[BKDisplayBrightnessController sharedInstance]", nil);
+NSObject *vpOvM = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKDisplayRenderOverlayManager"), @selector(sharedInstance));
+vpDump(vpOvM, @"BKDisplayRenderOverlayManager", @"private", @"[BKDisplayRenderOverlayManager sharedInstance]", nil);
+vpAdd(@"BKDisplayRenderOverlayManager._frozenDisplayIDs", @"private", @"[[BKDisplayRenderOverlayManager sharedInstance] valueForKey:@\"_frozenDisplayIDs\"]", [(NSObject *)[vpOvM valueForKey:@"_frozenDisplayIDs"] description], nil);
+NSArray *vpOverlays = [[(NSSet *)[vpOvM valueForKey:@"activeOverlays"] allObjects] copy];
+for (NSUInteger vi = 0; vi < vpOverlays.count; vi++) vpDump(vpOverlays[vi], @"BKDisplayRenderOverlay", @"private", [NSString stringWithFormat:@"[[BKDisplayRenderOverlayManager sharedInstance] activeOverlays][%lu]", (unsigned long)vi], nil);
+NSObject *vpReg = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKHIDEventProcessorRegistry"), @selector(sharedInstance));
+NSDictionary *vpProcs = [vpReg valueForKey:@"_eventProcessorsByClassName"];
+vpAdd(@"BKHIDEventProcessorRegistry._eventProcessorsByClassName.keys", @"private", @"[[[BKHIDEventProcessorRegistry sharedInstance] valueForKey:@\"_eventProcessorsByClassName\"] allKeys]", [[vpProcs allKeys] sortedArrayUsingSelector:@selector(compare:)], nil);
+NSObject *vpDT = vpProcs[@"BKHIDDirectTouchEventProcessor"];
+NSString *vpDTC = @"[[BKHIDEventProcessorRegistry sharedInstance] valueForKey:@\"_eventProcessorsByClassName\"][@\"BKHIDDirectTouchEventProcessor\"]";
+vpAdd(@"BKHIDDirectTouchEventProcessor.description", @"private", [vpDTC stringByAppendingString:@".description"], vpDT ? [(NSObject *)vpDT description] : nil, vpDT ? nil : @"nil");
+if (vpDT) {
+ for (NSString *vpK in @[@"mainDisplayDigitizerService", @"mainDisplayAOPDigitizerService", @"mainDisplayPencilDigitizerService", @"chamoisDisplayUUID", @"shouldIgnoreTouchesWhileObjectInProximity", @"_queue_interfaceOrientation", @"_queue_chamoisDisplayUUID", @"_queue_serviceSenderIDToChamoisDisplayUUID", @"_queue_accessoryTouchscreenServices"]) {
+ id vv = [vpDT valueForKey:vpK];
+ vpAdd([@"BKHIDDirectTouchEventProcessor." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpDTC, vpK], vv, vv ? nil : @"nil");
+ }
+ NSDictionary *vpPDI = [vpDT valueForKey:@"_queue_perDisplayInfo"];
+ vpAdd(@"BKHIDDirectTouchEventProcessor._queue_perDisplayInfo.keys", @"private", [vpDTC stringByAppendingString:@" valueForKey:@\"_queue_perDisplayInfo\"].allKeys"], [vpPDI allKeys], nil);
+ for (id vpKey in vpPDI) {
+ NSObject *vpInfo = vpPDI[vpKey];
+ NSString *vpIC = [NSString stringWithFormat:@"%@._queue_perDisplayInfo[%@]", vpDTC, vpKey];
+ vpAdd(@"BKDirectTouchPerDisplayInfo.description", @"private", [vpIC stringByAppendingString:@".description"], [(NSObject *)vpInfo description], nil);
+ vpAdd(@"BKDirectTouchPerDisplayInfo._display", @"private", [vpIC stringByAppendingString:@"._display"], [(NSObject *)[vpInfo valueForKey:@"_display"] description], nil);
+ vpAdd(@"BKDirectTouchPerDisplayInfo._touchStreams", @"private", [vpIC stringByAppendingString:@"._touchStreams"], [(NSObject *)[vpInfo valueForKey:@"_touchStreams"] description], nil);
+ vpAdd(@"BKDirectTouchPerDisplayInfo._hitTestRegions", @"private", [vpIC stringByAppendingString:@"._hitTestRegions"], [vpInfo valueForKey:@"_hitTestRegions"], nil);
+ NSDictionary *vpS2D = [vpInfo valueForKey:@"_serviceToDigitizer"];
+ for (NSObject *vpSvc in vpS2D) {
+ NSObject *vpState = vpS2D[vpSvc];
+ NSString *vpSC = [NSString stringWithFormat:@"%@._serviceToDigitizer[%@]", vpIC, [vpSvc valueForKey:@"senderID"]];
+ NSObject *vpMapped = ((id (*)(id, SEL, id))objc_msgSend)(vpDT, NSSelectorFromString(@"_queue_displayUUIDForDigitizerService:"), vpSvc);
+ vpAdd(@"BKHIDDirectTouchEventProcessor._queue_displayUUIDForDigitizerService:", @"private", [NSString stringWithFormat:@"[%@ _queue_displayUUIDForDigitizerService:<service senderID %@>]", vpDTC, [vpSvc valueForKey:@"senderID"]], vpMapped, vpMapped ? nil : @"nil");
+ vpAdd(@"BKIOHIDService.getters", @"private", [vpSC stringByAppendingString:@".(service).*"], vpObjDict(vpSvc), nil);
+ vpAdd(@"BKDirectTouchState.description", @"private", [vpSC stringByAppendingString:@".description"], [(NSObject *)vpState description], nil);
+ NSMutableDictionary *vpSt = [NSMutableDictionary dictionary];
+ for (NSString *vpK in @[@"_displayUUID", @"_interfaceOrientation", @"_maximumPositionZ", @"_maxForce", @"_determinedMaxForce", @"_supportsPreciseLocations", @"_displayIntegrated", @"_builtIn", @"_hoverDisabled", @"_waitingForAllTouchesUp", @"_hitTestRegions"]) { id vv = [vpState valueForKey:vpK]; vpSt[vpK] = vv ? vpJSON(vv) : [NSNull null]; }
+ vpAdd(@"BKDirectTouchState.ivars", @"private", [vpSC stringByAppendingString:@" valueForKey:<ivar>"], vpSt, nil);
+ }
+ }
+}
+NSError *vpJErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:@{@"orientation": vpOrientation ?: [NSNull null], @"records": vpRecs} options:0 error:&vpJErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpJErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-bk.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-bk.lldb
new file mode 100644
index 00000000..0618a290
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-bk.lldb
@@ -0,0 +1,23 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpClasses = @[@"BKDisplayController", @"BKCADisplayMonitor", @"BKSharedCADisplayProvider", @"BKMainDisplayObserver", @"BKDisplayOrientationController", @"BKDisplayBrightnessController", @"BKBacklightClient", @"BKDisplayRenderOverlayManager", @"BKDisplayRenderOverlay", @"BKDisplayBootUIRenderOverlay", @"BKHIDDirectTouchEventProcessor", @"BKDirectTouchPerDisplayInfo", @"BKDirectTouchState", @"BKDisplayServiceServer", @"BKDisplayCloneMirroringManager", @"BKSHIDEventDisplay", @"BKSDisplayTraits", @"BKSDisplayArrangementItem", @"BKSDisplayService", @"BKTouchPadManager", @"BKTouchPadInfo", @"FBSDisplayMonitor", @"FBSDisplayIdentity", @"FBSDisplayConfiguration", @"FBSDisplayMode", @"FBSDisplayPixelDensity", @"FBSDisplaySource", @"UISDisplayContext", @"UISDisplayShape", @"UISDisplaySingleRectShape", @"BKSHIDEventDigitizerAttributes"];
+for (NSString *vpName in vpClasses) {
+ Class vpC = NSClassFromString(vpName);
+ [vpOut appendFormat:@"=== %@ %p super=%s\n", vpName, vpC, vpC ? class_getName(class_getSuperclass(vpC)) : "-"];
+ if (!vpC) continue;
+ unsigned int vpN = 0;
+ Method *vpM = class_copyMethodList(object_getClass(vpC), &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"+ %s %.80s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ vpM = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"- %s %.80s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ Ivar *vpI = class_copyIvarList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"ivar %s %.120s\n", ivar_getName(vpI[vi]), ivar_getTypeEncoding(vpI[vi])];
+ free(vpI);
+ objc_property_t *vpP = class_copyPropertyList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"prop %s %.100s\n", property_getName(vpP[vi]), property_getAttributes(vpP[vi])];
+ free(vpP);
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-bk2.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-bk2.lldb
new file mode 100644
index 00000000..6544b671
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-bk2.lldb
@@ -0,0 +1,23 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpClasses = @[@"BKHIDEventProcessorRegistry", @"BKHIDSystem", @"BKHIDSystemInterface", @"BKOrientationManager", @"BKIOHIDService", @"BKDigitizerTouchStreamAggregate"];
+for (NSString *vpName in vpClasses) {
+ Class vpC = NSClassFromString(vpName);
+ [vpOut appendFormat:@"=== %@ %p super=%s\n", vpName, vpC, vpC ? class_getName(class_getSuperclass(vpC)) : "-"];
+ if (!vpC) continue;
+ unsigned int vpN = 0;
+ Method *vpM = class_copyMethodList(object_getClass(vpC), &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"+ %s %.80s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ vpM = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"- %s %.80s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ Ivar *vpI = class_copyIvarList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"ivar %s %.120s\n", ivar_getName(vpI[vi]), ivar_getTypeEncoding(vpI[vi])];
+ free(vpI);
+ objc_property_t *vpP = class_copyPropertyList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"prop %s %.100s\n", property_getName(vpP[vi]), property_getAttributes(vpP[vi])];
+ free(vpP);
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-classes.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-classes.lldb
new file mode 100644
index 00000000..333f379c
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-classes.lldb
@@ -0,0 +1,23 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpClasses = @[@"CADisplay", @"CADisplayMode", @"CAWindowServer", @"CAWindowServerDisplay", @"CADisplayStateControl", @"CADisplayAttributes", @"CADisplayPreferences", @"CADisplayProperties"];
+for (NSString *vpName in vpClasses) {
+ Class vpC = NSClassFromString(vpName);
+ [vpOut appendFormat:@"=== %@ %p super=%s\n", vpName, vpC, vpC ? class_getName(class_getSuperclass(vpC)) : "-"];
+ if (!vpC) continue;
+ unsigned int vpN = 0;
+ Method *vpM = class_copyMethodList(object_getClass(vpC), &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"+ %s %s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ vpM = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"- %s %s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ Ivar *vpI = class_copyIvarList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"ivar %s %s\n", ivar_getName(vpI[vi]), ivar_getTypeEncoding(vpI[vi])];
+ free(vpI);
+ objc_property_t *vpP = class_copyPropertyList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"prop %s %s\n", property_getName(vpP[vi]), property_getAttributes(vpP[vi])];
+ free(vpP);
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-classlist.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-classlist.lldb
new file mode 100644
index 00000000..c8542a5e
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-classlist.lldb
@@ -0,0 +1,19 @@
+expr -l objc -O --
+unsigned int vpN = 0;
+Class *vpAll = objc_copyClassList(&vpN);
+NSMutableArray *vpHits = [NSMutableArray array];
+for (unsigned int vi = 0; vi < vpN; vi++) {
+ NSString *vpName = [NSString stringWithUTF8String:class_getName(vpAll[vi])];
+ BOOL vpPref = [vpName hasPrefix:@"BK"] || [vpName hasPrefix:@"CADisplay"] || [vpName hasPrefix:@"CAWindowServer"] || [vpName hasPrefix:@"FBS"] || [vpName hasPrefix:@"FBDisplay"] || [vpName hasPrefix:@"UISDisplay"] || [vpName hasPrefix:@"_UIScreen"] || [vpName hasPrefix:@"UIScreen"] || [vpName hasPrefix:@"SBDisplay"] || [vpName hasPrefix:@"SBFDisplay"] || [vpName hasPrefix:@"FBDisplay"];
+ if (!vpPref) continue;
+ NSRange vpR1 = [vpName rangeOfString:@"Display" options:NSCaseInsensitiveSearch];
+ NSRange vpR2 = [vpName rangeOfString:@"Digitizer"];
+ NSRange vpR3 = [vpName rangeOfString:@"Screen"];
+ NSRange vpR4 = [vpName rangeOfString:@"Touch"];
+ NSRange vpR5 = [vpName rangeOfString:@"Brightness"];
+ NSRange vpR6 = [vpName rangeOfString:@"Backlight"];
+ if (vpR1.location != NSNotFound || vpR2.location != NSNotFound || vpR3.location != NSNotFound || vpR4.location != NSNotFound || vpR5.location != NSNotFound || vpR6.location != NSNotFound) [vpHits addObject:vpName];
+}
+free(vpAll);
+[[vpHits sortedArrayUsingSelector:@selector(compare:)] componentsJoinedByString:@"\n"]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-sb-ivars.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-sb-ivars.lldb
new file mode 100644
index 00000000..8f0f0391
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-discover-sb-ivars.lldb
@@ -0,0 +1,35 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpClasses = @[@"FBDisplayManager", @"UIScreen", @"UISApplicationSupportDisplayEdgeInfo", @"_UIScreenDisplayInfoProvider"];
+for (NSString *vpName in vpClasses) {
+ Class vpC = NSClassFromString(vpName);
+ [vpOut appendFormat:@"=== %@ %p super=%s\n", vpName, vpC, vpC ? class_getName(class_getSuperclass(vpC)) : "-"];
+ if (!vpC) continue;
+ unsigned int vpN = 0;
+ Method *vpM = class_copyMethodList(object_getClass(vpC), &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"+ %s %.80s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ vpM = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"- %s %.80s\n", sel_getName(method_getName(vpM[vi])), method_getTypeEncoding(vpM[vi])];
+ free(vpM);
+ Ivar *vpI = class_copyIvarList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"ivar %s %.120s\n", ivar_getName(vpI[vi]), ivar_getTypeEncoding(vpI[vi])];
+ free(vpI);
+ objc_property_t *vpP = class_copyPropertyList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@"prop %s %.100s\n", property_getName(vpP[vi]), property_getAttributes(vpP[vi])];
+ free(vpP);
+}
+vpOut
+
+expr -l objc -O --
+unsigned int vpN = 0;
+Class *vpAll = objc_copyClassList(&vpN);
+NSMutableArray *vpHits = [NSMutableArray array];
+for (unsigned int vi = 0; vi < vpN; vi++) {
+ for (NSString *vpSel in @[@"extendedProperties", @"exclusionArea", @"_exclusionArea", @"connectedConfigurations", @"_displayConfiguration"]) {
+ if (class_getInstanceMethod(vpAll[vi], NSSelectorFromString(vpSel)) && class_getInstanceMethod(class_getSuperclass(vpAll[vi]), NSSelectorFromString(vpSel)) == NULL) [vpHits addObject:[NSString stringWithFormat:@"%s -%@", class_getName(vpAll[vi]), vpSel]];
+ }
+}
+free(vpAll);
+[vpHits componentsJoinedByString:@"\n"]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-safari.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-safari.lldb
new file mode 100644
index 00000000..f51566de
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-safari.lldb
@@ -0,0 +1,152 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpTrace)(NSString *) = ^(NSString *s) { [s writeToFile:@"/private/tmp/claude-501/-Users-Jacky--claude-spares-spare-SBbPAl/57b50db2-159e-4729-b15b-b24d84c6e854/scratchpad/vptrace.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil]; };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) { return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)}; };
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize s) { return @{@"width": @(s.width), @"height": @(s.height)}; };
+NSDictionary *(^vpPoint)(CGPoint) = ^NSDictionary *(CGPoint p) { return @{@"x": @(p.x), @"y": @(p.y)}; };
+__block id (^vpJSON)(id);
+vpJSON = ^id(id vIn) { NSObject *v = (NSObject *)vIn;
+ if (!v) return [NSNull null];
+ if ([v isKindOfClass:[NSString class]]) return v;
+ if ([v isKindOfClass:[NSNumber class]]) {
+ double vd = [(NSNumber *)v doubleValue];
+ if (vd != vd || vd == INFINITY || vd == -INFINITY) return [(NSObject *)v description];
+ return v;
+ }
+ if ([v isKindOfClass:[NSValue class]]) {
+ const char *vt = [(NSValue *)v objCType];
+ if (strncmp(vt, "{CGRect=", 8) == 0) { CGRect r; [(NSValue *)v getValue:&r]; return vpRect(r); }
+ if (strncmp(vt, "{CGSize=", 8) == 0) { CGSize s; [(NSValue *)v getValue:&s]; return vpSize(s); }
+ if (strncmp(vt, "{CGPoint=", 9) == 0) { CGPoint p; [(NSValue *)v getValue:&p]; return vpPoint(p); }
+ return [(NSObject *)v description];
+ }
+ if ([v isKindOfClass:[NSArray class]] || [v isKindOfClass:[NSSet class]] || [v isKindOfClass:[NSOrderedSet class]]) {
+ NSMutableArray *va = [NSMutableArray array];
+ for (id vx in (NSArray *)v) [va addObject:vpJSON(vx)];
+ return va;
+ }
+ if ([v isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *vm = [NSMutableDictionary dictionary];
+ for (id vk in (NSDictionary *)v) vm[[(NSObject *)vk description]] = vpJSON([(NSDictionary *)v objectForKey:vk]);
+ return vm;
+ }
+ if ([v isKindOfClass:[NSUUID class]]) return [(NSUUID *)v UUIDString];
+ return [(NSObject *)v description];
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ? vpJSON(value) : [NSNull null], @"error": error ?: (value ? (id)[NSNull null] : (id)@"nil")}];
+};
+NSArray *vpDenyExact = @[@"dealloc", @"invalidate", @"update", @"updateDisplays", @"_finalize", @"_invalidate", @"init", @"_init", @".cxx_destruct", @".cxx_construct", @"copy", @"mutableCopy", @"immutableCopy", @"freeze", @"acquireFrozenSurface", @"activateReplay", @"rebuildModeList", @"removeAllClones", @"resetConfiguration", @"disableDICOM", @"willUnblank", @"commitPreset", @"unregisterNotificationBlocks", @"unregisterSyncNotificationBlocks", @"clearUpdateMask", @"initializeClientPort", @"acquireWirelessDisplayStateControl", @"_detectDisplays", @"_detectSimDisplays", @"removeAllDisplays", @"enableOutOfProcessDisplayObservation", @"updateBandWidthInfoForAllDisplays", @"stopServer", @"new", @"alloc", @"class", @"self", @"retain", @"release", @"autorelease", @"retainCount", @"zone", @"hash", @"superclass", @"debugDescription", @"description", @"succinctDescription", @"succinctDescriptionBuilder", @"descriptionBuilder", @"_availableModesInternal", @"copyForSecureRendering", @"cancelTouchesOnMainDisplay", @"cancelTouchesOnAllDisplays", @"prepareForRestart", @"updateTransformsWithCompletion", @"_postInitialBookendObserverConnections", @"_cleanup", @"_freeze", @"_startAnimating", @"_stopAnimating", @"copyPrivateRepresentation", @"initForProtobufDecoding", @"_queue_resetTouchAuthenticationInitialSampleEvent", @"layoutIfNeeded", @"setNeedsLayout", @"_copyDebugProperties", @"_dragManager", @"_focusSystem", @"_interactiveHighlightEnvironment", @"focusItemContainer", @"focusedItem", @"focusedView", @"parentFocusEnvironment", @"preferredFocusEnvironments", @"preferredFocusedView", @"_preferredFocusedWindow", @"_preferredFocusedWindowScene", @"_boundingPathUtilities", @"_carSession", @"supportsFocus", @"_SwiftUITesting_currentScreenScale", @"_SwiftUITesting_wantsWideContentMargins", @"__ck_isFullscreen", @"pu_workImageSize", @"px_currentEDRHeadroom", @"px_potentialEDRHeadroom", @"ck_screenSizeCategory", @"_mapkit_display", @"postBookendConnections", @"bookendObserver", @"observers"];
+NSArray *vpDenyPrefix = @[@"set", @"_set", @"remove", @"_remove", @"add", @"cancel", @"invalidate", @"_lock_", @"_workQueue_", @"_queue_", @"_post", @"_present", @"_dismiss", @"_update", @"_wrap", @"reevaluate", @"_begin", @"_end", @"begin", @"end", @"_prepare", @"_reset", @"reset", @"_flush", @"flush", @"_notify", @"_handle", @"_init", @"init", @"_copy", @"copy", @"_create", @"create", @"_install", @"_uninstall", @"_register", @"_unregister", @"register", @"unregister", @"_perform", @"perform", @"_apply", @"apply", @"_enable", @"_disable", @"_invalidate", @"_teardown", @"_start", @"_stop", @"start", @"stop", @"_send", @"send", @"_snapshot", @"snapshot", @"_dump", @"dump", @"_run", @"_schedule", @"_will", @"_did", @"_reload", @"reload", @"_force", @"_clear", @"clear", @"_release", @"_acquire", @"acquire", @"_take", @"_capture", @"_trigger", @"_request", @"request", @"_animate", @"_show", @"_hide", @"_attach", @"_detach", @"_connect", @"_disconnect", @"_present", @"_activate", @"_deactivate", @"_destroy", @"_purge", @"_close", @"_open", @"_save", @"_load", @"_make", @"make", @"_print", @"_log", @"_toggle", @"_test", @"_simulate", @"_fake", @"_debug"];
+NSArray *vpThrowSels = @[@"secureIndicatorsEnabled"];
+BOOL (^vpAllowed)(NSString *) = ^BOOL(NSString *sel) {
+ if ([vpThrowSels containsObject:sel]) return NO;
+ if ([sel rangeOfString:@":"].location != NSNotFound) return NO;
+ if ([vpDenyExact containsObject:sel]) return NO;
+ for (NSString *vp in vpDenyPrefix) if ([sel hasPrefix:vp]) return NO;
+ return YES;
+};
+id (^vpCall)(id, NSString *, NSString **) = ^id(id obj, NSString *sel, NSString **err) {
+ SEL vs = NSSelectorFromString(sel);
+ if (![(NSObject *)obj respondsToSelector:vs]) { *err = @"does not respond"; return (id)nil; }
+ Method vm = class_getInstanceMethod(object_getClass(obj), vs);
+ if (!vm) { *err = @"no method"; return (id)nil; }
+ if (method_getNumberOfArguments(vm) != 2) { *err = @"takes arguments"; return (id)nil; }
+ char vt[256]; method_getReturnType(vm, vt, sizeof(vt));
+ const char *vr = vt; while (*vr == 'r' || *vr == 'n' || *vr == 'N' || *vr == 'o' || *vr == 'O' || *vr == 'R' || *vr == 'V') vr++;
+ switch (vr[0]) {
+ case '@': if (vr[1] == '?') { *err = @"block"; return (id)nil; }
+ { id vo = ((id (*)(id, SEL))objc_msgSend)(obj, vs); if (!vo) *err = @"nil"; return vo; }
+ case '#': { Class vc = ((Class (*)(id, SEL))objc_msgSend)(obj, vs); return vc ? NSStringFromClass(vc) : (id)nil; }
+ case 'B': return @(((BOOL (*)(id, SEL))objc_msgSend)(obj, vs) ? YES : NO);
+ case 'c': return @(((signed char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'C': return @(((unsigned char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 's': return @(((short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'S': return @(((unsigned short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'i': return @(((int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'I': return @(((unsigned int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'l': return @(((long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'L': return @(((unsigned long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'q': return @(((long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'Q': return @(((unsigned long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'f': return @(((float (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'd': return @(((double (*)(id, SEL))objc_msgSend)(obj, vs));
+ case '{':
+ if (strncmp(vr, "{CGRect=", 8) == 0) return vpRect(((CGRect (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGSize=", 8) == 0) return vpSize(((CGSize (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGPoint=", 9) == 0) return vpPoint(((CGPoint (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{UIEdgeInsets=", 14) == 0 || strncmp(vr, "{NSDirectionalEdgeInsets=", 25) == 0) { struct VPInsets { double a, b, c, d; } vi4 = ((struct VPInsets (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"top": @(vi4.a), @"left": @(vi4.b), @"bottom": @(vi4.c), @"right": @(vi4.d)}; }
+ if (strncmp(vr, "{CGAffineTransform=", 19) == 0) { CGAffineTransform vx = ((CGAffineTransform (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vx.a), @(vx.b), @(vx.c), @(vx.d), @(vx.tx), @(vx.ty)]; }
+ if (strcmp(vr, "{?=ff}") == 0) { struct VPff { float a, b; } vf = ((struct VPff (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf.a), @(vf.b)]; }
+ if (strcmp(vr, "{?={?=ff}{?=ff}{?=ff}{?=ff}}") == 0) { struct VPf8 { float a[8]; } vf8 = ((struct VPf8 (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf8.a[0]), @(vf8.a[1]), @(vf8.a[2]), @(vf8.a[3]), @(vf8.a[4]), @(vf8.a[5]), @(vf8.a[6]), @(vf8.a[7])]; }
+ if (strncmp(vr, "{CAFrameRateRange=", 18) == 0) { struct VPfff { float a, b, c; } vf3 = ((struct VPfff (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"minimum": @(vf3.a), @"maximum": @(vf3.b), @"preferred": @(vf3.c)}; }
+ *err = [NSString stringWithFormat:@"unsupported struct return %.60s", vr]; return (id)nil;
+ default: *err = [NSString stringWithFormat:@"unsupported return type %.60s", vr]; return (id)nil;
+ }
+};
+NSArray *(^vpGetters)(Class, Class) = ^NSArray *(Class cls, Class stop) {
+ char vrt[8];
+ NSMutableOrderedSet *vs = [NSMutableOrderedSet orderedSet];
+ for (Class vc = cls; vc && vc != stop && vc != [NSObject class]; vc = class_getSuperclass(vc)) {
+ unsigned int vn = 0;
+ objc_property_t *vp = class_copyPropertyList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ char *vg = property_copyAttributeValue(vp[vi], "G");
+ NSString *vgs = vg ? [NSString stringWithUTF8String:vg] : [NSString stringWithUTF8String:property_getName(vp[vi])];
+ if (vg) free(vg);
+ if (vpAllowed(vgs)) [vs addObject:vgs];
+ }
+ free(vp);
+ Method *vm = class_copyMethodList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vsel = NSStringFromSelector(method_getName(vm[vi]));
+ method_getReturnType(vm[vi], vrt, sizeof(vrt)); if (vrt[0] == 'v') continue;
+ if (method_getNumberOfArguments(vm[vi]) == 2 && vpAllowed(vsel)) [vs addObject:vsel];
+ }
+ free(vm);
+ }
+ return [[vs array] sortedArrayUsingSelector:@selector(compare:)];
+};
+void (^vpDump)(id, NSString *, NSString *, NSString *, Class) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, Class stop) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ vpAdd([apiClass stringByAppendingString:@".description"], kind, [callPrefix stringByAppendingString:@".description"], [(NSObject *)obj description], nil);
+ vpAdd([apiClass stringByAppendingString:@".class"], kind, [callPrefix stringByAppendingString:@".class"], NSStringFromClass([(NSObject *)obj class]), nil);
+ for (NSString *vsel in vpGetters([(NSObject *)obj class], stop)) {
+ vpTrace([NSString stringWithFormat:@"%@ %@", callPrefix, vsel]);
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+ for (NSString *vsel in vpThrowSels) if ([(NSObject *)obj respondsToSelector:NSSelectorFromString(vsel)]) vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], nil, @"raises an Objective-C exception in this process (not called)");
+};
+NSDictionary *(^vpObjDict)(id) = ^NSDictionary *(id objIn) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ if (!objIn) return vd;
+ for (NSString *vsel in vpGetters([(NSObject *)objIn class], nil)) { vpTrace([NSString stringWithFormat:@"objdict %@ %@", NSStringFromClass([(NSObject *)objIn class]), vsel]); NSString *verr = nil; id vv = vpCall(objIn, vsel, &verr); vd[vsel] = vv ? vpJSON(vv) : [NSString stringWithFormat:@"<error: %@>", verr]; }
+ return vd;
+};
+void (^vpDumpSel)(id, NSString *, NSString *, NSString *, NSArray *) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, NSArray *sels) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ for (NSString *vsel in sels) {
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+};
+id vpOrientation = nil;
+vpAdd(@"UIDevice.orientation", @"public", @"[[UIDevice currentDevice] orientation]", @((long)[[UIDevice currentDevice] orientation]), nil);
+NSMutableArray *vpSceneList = [NSMutableArray array];
+for (UIScene *vpSc in [[UIApplication sharedApplication] connectedScenes]) {
+ UIWindowScene *vpW = (UIWindowScene *)vpSc;
+ vpOrientation = @((long)vpW.interfaceOrientation);
+ [vpSceneList addObject:@{@"class": NSStringFromClass([vpSc class]), @"interfaceOrientation": @((long)vpW.interfaceOrientation), @"screenName": [(NSObject *)[vpW.screen valueForKey:@"_name"] description] ?: @"", @"displayIdentity": [(NSObject *)[vpW.screen valueForKey:@"displayIdentity"] description] ?: @"", @"coordinateSpaceBounds": vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpW.coordinateSpace, @selector(bounds))), @"screenBounds": vpRect(vpW.screen.bounds), @"screenNativeBounds": vpRect(vpW.screen.nativeBounds)}];
+}
+vpAdd(@"UIApplication.connectedScenes.summary", @"private", @"MobileSafari [[UIApplication sharedApplication] connectedScenes] -> {class, interfaceOrientation, screen._name, displayIdentity, coordinateSpace.bounds, screen.bounds, screen.nativeBounds}", vpSceneList, nil);
+NSArray *vpScreens = [UIScreen screens];
+NSMutableArray *vpSL = [NSMutableArray array];
+for (UIScreen *vpS in vpScreens) [vpSL addObject:@{@"name": [(NSObject *)[vpS valueForKey:@"_name"] description] ?: @"", @"bounds": vpRect(vpS.bounds), @"nativeBounds": vpRect(vpS.nativeBounds), @"scale": @(vpS.scale), @"displayIdentity": [(NSObject *)[vpS valueForKey:@"displayIdentity"] description] ?: @"", @"_interfaceOrientation": [vpS valueForKey:@"_interfaceOrientation"]}];
+vpAdd(@"UIScreen.screens.summary", @"public", @"MobileSafari [UIScreen screens] -> {_name, bounds, nativeBounds, scale, displayIdentity, _interfaceOrientation}", vpSL, nil);
+NSError *vpJErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:@{@"orientation": vpOrientation ?: [NSNull null], @"records": vpRecs} options:0 error:&vpJErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpJErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-sbdiscover.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-sbdiscover.lldb
new file mode 100644
index 00000000..41366d53
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-sbdiscover.lldb
@@ -0,0 +1,149 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpTrace)(NSString *) = ^(NSString *s) { [s writeToFile:@"/private/tmp/claude-501/-Users-Jacky--claude-spares-spare-SBbPAl/57b50db2-159e-4729-b15b-b24d84c6e854/scratchpad/vptrace.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil]; };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) { return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)}; };
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize s) { return @{@"width": @(s.width), @"height": @(s.height)}; };
+NSDictionary *(^vpPoint)(CGPoint) = ^NSDictionary *(CGPoint p) { return @{@"x": @(p.x), @"y": @(p.y)}; };
+__block id (^vpJSON)(id);
+vpJSON = ^id(id vIn) { NSObject *v = (NSObject *)vIn;
+ if (!v) return [NSNull null];
+ if ([v isKindOfClass:[NSString class]]) return v;
+ if ([v isKindOfClass:[NSNumber class]]) {
+ double vd = [(NSNumber *)v doubleValue];
+ if (vd != vd || vd == INFINITY || vd == -INFINITY) return [(NSObject *)v description];
+ return v;
+ }
+ if ([v isKindOfClass:[NSValue class]]) {
+ const char *vt = [(NSValue *)v objCType];
+ if (strncmp(vt, "{CGRect=", 8) == 0) { CGRect r; [(NSValue *)v getValue:&r]; return vpRect(r); }
+ if (strncmp(vt, "{CGSize=", 8) == 0) { CGSize s; [(NSValue *)v getValue:&s]; return vpSize(s); }
+ if (strncmp(vt, "{CGPoint=", 9) == 0) { CGPoint p; [(NSValue *)v getValue:&p]; return vpPoint(p); }
+ return [(NSObject *)v description];
+ }
+ if ([v isKindOfClass:[NSArray class]] || [v isKindOfClass:[NSSet class]] || [v isKindOfClass:[NSOrderedSet class]]) {
+ NSMutableArray *va = [NSMutableArray array];
+ for (id vx in (NSArray *)v) [va addObject:vpJSON(vx)];
+ return va;
+ }
+ if ([v isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *vm = [NSMutableDictionary dictionary];
+ for (id vk in (NSDictionary *)v) vm[[(NSObject *)vk description]] = vpJSON([(NSDictionary *)v objectForKey:vk]);
+ return vm;
+ }
+ if ([v isKindOfClass:[NSUUID class]]) return [(NSUUID *)v UUIDString];
+ return [(NSObject *)v description];
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ? vpJSON(value) : [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSArray *vpDenyExact = @[@"dealloc", @"invalidate", @"update", @"updateDisplays", @"_finalize", @"_invalidate", @"init", @"_init", @".cxx_destruct", @".cxx_construct", @"copy", @"mutableCopy", @"immutableCopy", @"freeze", @"acquireFrozenSurface", @"activateReplay", @"rebuildModeList", @"removeAllClones", @"resetConfiguration", @"disableDICOM", @"willUnblank", @"commitPreset", @"unregisterNotificationBlocks", @"unregisterSyncNotificationBlocks", @"clearUpdateMask", @"initializeClientPort", @"acquireWirelessDisplayStateControl", @"_detectDisplays", @"_detectSimDisplays", @"removeAllDisplays", @"enableOutOfProcessDisplayObservation", @"updateBandWidthInfoForAllDisplays", @"stopServer", @"new", @"alloc", @"class", @"self", @"retain", @"release", @"autorelease", @"retainCount", @"zone", @"hash", @"superclass", @"debugDescription", @"description", @"succinctDescription", @"succinctDescriptionBuilder", @"descriptionBuilder", @"_availableModesInternal", @"copyForSecureRendering", @"cancelTouchesOnMainDisplay", @"cancelTouchesOnAllDisplays", @"prepareForRestart", @"updateTransformsWithCompletion", @"_postInitialBookendObserverConnections", @"_cleanup", @"_freeze", @"_startAnimating", @"_stopAnimating", @"copyPrivateRepresentation", @"initForProtobufDecoding", @"_queue_resetTouchAuthenticationInitialSampleEvent", @"layoutIfNeeded", @"setNeedsLayout", @"_copyDebugProperties"];
+NSArray *vpDenyPrefix = @[@"set", @"_set", @"remove", @"_remove", @"add", @"cancel", @"invalidate", @"_lock_", @"_workQueue_", @"_queue_", @"_post", @"_present", @"_dismiss", @"_update", @"_wrap", @"reevaluate", @"_begin", @"_end", @"begin", @"end", @"_prepare", @"_reset", @"reset", @"_flush", @"flush", @"_notify", @"_handle", @"_init", @"init", @"_copy", @"copy", @"_create", @"create", @"_install", @"_uninstall", @"_register", @"_unregister", @"register", @"unregister", @"_perform", @"perform", @"_apply", @"apply", @"_enable", @"_disable", @"_invalidate", @"_teardown", @"_start", @"_stop", @"start", @"stop", @"_send", @"send", @"_snapshot", @"snapshot", @"_dump", @"dump", @"_run", @"_schedule", @"_will", @"_did", @"_reload", @"reload", @"_force", @"_clear", @"clear", @"_release", @"_acquire", @"acquire", @"_take", @"_capture", @"_trigger", @"_request", @"request", @"_animate", @"_show", @"_hide", @"_attach", @"_detach", @"_connect", @"_disconnect", @"_present", @"_activate", @"_deactivate", @"_destroy", @"_purge", @"_close", @"_open", @"_save", @"_load", @"_make", @"make", @"_print", @"_log", @"_toggle", @"_test", @"_simulate", @"_fake", @"_debug"];
+NSArray *vpThrowSels = @[@"secureIndicatorsEnabled"];
+BOOL (^vpAllowed)(NSString *) = ^BOOL(NSString *sel) {
+ if ([vpThrowSels containsObject:sel]) return NO;
+ if ([sel rangeOfString:@":"].location != NSNotFound) return NO;
+ if ([vpDenyExact containsObject:sel]) return NO;
+ for (NSString *vp in vpDenyPrefix) if ([sel hasPrefix:vp]) return NO;
+ return YES;
+};
+id (^vpCall)(id, NSString *, NSString **) = ^id(id obj, NSString *sel, NSString **err) {
+ SEL vs = NSSelectorFromString(sel);
+ if (![(NSObject *)obj respondsToSelector:vs]) { *err = @"does not respond"; return (id)nil; }
+ Method vm = class_getInstanceMethod(object_getClass(obj), vs);
+ if (!vm) { *err = @"no method"; return (id)nil; }
+ if (method_getNumberOfArguments(vm) != 2) { *err = @"takes arguments"; return (id)nil; }
+ char vt[256]; method_getReturnType(vm, vt, sizeof(vt));
+ const char *vr = vt; while (*vr == 'r' || *vr == 'n' || *vr == 'N' || *vr == 'o' || *vr == 'O' || *vr == 'R' || *vr == 'V') vr++;
+ switch (vr[0]) {
+ case '@': if (vr[1] == '?') { *err = @"block"; return (id)nil; }
+ { id vo = ((id (*)(id, SEL))objc_msgSend)(obj, vs); if (!vo) *err = @"nil"; return vo; }
+ case '#': { Class vc = ((Class (*)(id, SEL))objc_msgSend)(obj, vs); return vc ? NSStringFromClass(vc) : (id)nil; }
+ case 'B': return @(((BOOL (*)(id, SEL))objc_msgSend)(obj, vs) ? YES : NO);
+ case 'c': return @(((signed char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'C': return @(((unsigned char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 's': return @(((short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'S': return @(((unsigned short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'i': return @(((int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'I': return @(((unsigned int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'l': return @(((long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'L': return @(((unsigned long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'q': return @(((long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'Q': return @(((unsigned long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'f': return @(((float (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'd': return @(((double (*)(id, SEL))objc_msgSend)(obj, vs));
+ case '{':
+ if (strncmp(vr, "{CGRect=", 8) == 0) return vpRect(((CGRect (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGSize=", 8) == 0) return vpSize(((CGSize (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGPoint=", 9) == 0) return vpPoint(((CGPoint (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{UIEdgeInsets=", 14) == 0 || strncmp(vr, "{NSDirectionalEdgeInsets=", 25) == 0) { struct VPInsets { double a, b, c, d; } vi4 = ((struct VPInsets (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"top": @(vi4.a), @"left": @(vi4.b), @"bottom": @(vi4.c), @"right": @(vi4.d)}; }
+ if (strncmp(vr, "{CGAffineTransform=", 19) == 0) { CGAffineTransform vx = ((CGAffineTransform (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vx.a), @(vx.b), @(vx.c), @(vx.d), @(vx.tx), @(vx.ty)]; }
+ if (strcmp(vr, "{?=ff}") == 0) { struct VPff { float a, b; } vf = ((struct VPff (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf.a), @(vf.b)]; }
+ if (strcmp(vr, "{?={?=ff}{?=ff}{?=ff}{?=ff}}") == 0) { struct VPf8 { float a[8]; } vf8 = ((struct VPf8 (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf8.a[0]), @(vf8.a[1]), @(vf8.a[2]), @(vf8.a[3]), @(vf8.a[4]), @(vf8.a[5]), @(vf8.a[6]), @(vf8.a[7])]; }
+ if (strncmp(vr, "{CAFrameRateRange=", 18) == 0) { struct VPfff { float a, b, c; } vf3 = ((struct VPfff (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"minimum": @(vf3.a), @"maximum": @(vf3.b), @"preferred": @(vf3.c)}; }
+ *err = [NSString stringWithFormat:@"unsupported struct return %.60s", vr]; return (id)nil;
+ default: *err = [NSString stringWithFormat:@"unsupported return type %.60s", vr]; return (id)nil;
+ }
+};
+NSArray *(^vpGetters)(Class, Class) = ^NSArray *(Class cls, Class stop) {
+ char vrt[8];
+ NSMutableOrderedSet *vs = [NSMutableOrderedSet orderedSet];
+ for (Class vc = cls; vc && vc != stop && vc != [NSObject class]; vc = class_getSuperclass(vc)) {
+ unsigned int vn = 0;
+ objc_property_t *vp = class_copyPropertyList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ char *vg = property_copyAttributeValue(vp[vi], "G");
+ NSString *vgs = vg ? [NSString stringWithUTF8String:vg] : [NSString stringWithUTF8String:property_getName(vp[vi])];
+ if (vg) free(vg);
+ if (vpAllowed(vgs)) [vs addObject:vgs];
+ }
+ free(vp);
+ Method *vm = class_copyMethodList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vsel = NSStringFromSelector(method_getName(vm[vi]));
+ method_getReturnType(vm[vi], vrt, sizeof(vrt)); if (vrt[0] == 'v') continue;
+ if (method_getNumberOfArguments(vm[vi]) == 2 && vpAllowed(vsel)) [vs addObject:vsel];
+ }
+ free(vm);
+ }
+ return [[vs array] sortedArrayUsingSelector:@selector(compare:)];
+};
+void (^vpDump)(id, NSString *, NSString *, NSString *, Class) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, Class stop) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ vpAdd([apiClass stringByAppendingString:@".description"], kind, [callPrefix stringByAppendingString:@".description"], [(NSObject *)obj description], nil);
+ vpAdd([apiClass stringByAppendingString:@".class"], kind, [callPrefix stringByAppendingString:@".class"], NSStringFromClass([(NSObject *)obj class]), nil);
+ for (NSString *vsel in vpGetters([(NSObject *)obj class], stop)) {
+ vpTrace([NSString stringWithFormat:@"%@ %@", callPrefix, vsel]);
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+ for (NSString *vsel in vpThrowSels) if ([(NSObject *)obj respondsToSelector:NSSelectorFromString(vsel)]) vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], nil, @"raises an Objective-C exception in this process (not called)");
+};
+NSDictionary *(^vpObjDict)(id) = ^NSDictionary *(id objIn) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ if (!objIn) return vd;
+ for (NSString *vsel in vpGetters([(NSObject *)objIn class], nil)) { vpTrace([NSString stringWithFormat:@"objdict %@ %@", NSStringFromClass([(NSObject *)objIn class]), vsel]); NSString *verr = nil; id vv = vpCall(objIn, vsel, &verr); vd[vsel] = vv ? vpJSON(vv) : [NSString stringWithFormat:@"<error: %@>", verr]; }
+ return vd;
+};
+id vpOrientation = nil;
+NSMutableString *vpS = [NSMutableString string];
+for (NSString *vpName in @[@"UIScreen", @"FBSDisplayMonitor", @"FBDisplayManager", @"FBSDisplayConfiguration", @"FBSDisplayIdentity", @"FBSDisplayMode", @"UISDisplayContext", @"UITraitCollection", @"_UIScreenDisplayConfiguration", @"UIScreenMode"]) {
+ Class vc = NSClassFromString(vpName);
+ [vpS appendFormat:@"=== %@ %p\n", vpName, vc];
+ if (!vc) continue;
+ unsigned int vn = 0;
+ Method *vm = class_copyMethodList(vc, &vn);
+ NSMutableArray *vz = [NSMutableArray array];
+ for (unsigned int vi = 0; vi < vn; vi++) if (method_getNumberOfArguments(vm[vi]) == 2) { char vt[64]; method_getReturnType(vm[vi], vt, sizeof(vt)); [vz addObject:[NSString stringWithFormat:@"%@ %s %@", NSStringFromSelector(method_getName(vm[vi])), vt, vpAllowed(NSStringFromSelector(method_getName(vm[vi]))) ? @"" : @"DENY"]]; }
+ free(vm);
+ [vpS appendString:[[vz sortedArrayUsingSelector:@selector(compare:)] componentsJoinedByString:@"\n"]];
+ [vpS appendString:@"\n"];
+ vm = class_copyMethodList(object_getClass(vc), &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) if (method_getNumberOfArguments(vm[vi]) == 2) [vpS appendFormat:@"+ %@\n", NSStringFromSelector(method_getName(vm[vi]))];
+ free(vm);
+}
+vpAdd(@"x", @"x", @"x", vpS, nil);
+NSError *vpJErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:@{@"orientation": vpOrientation ?: [NSNull null], @"records": vpRecs} options:0 error:&vpJErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpJErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/display-springboard.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/display-springboard.lldb
new file mode 100644
index 00000000..b9efa3db
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/display-springboard.lldb
@@ -0,0 +1,249 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpTrace)(NSString *) = ^(NSString *s) { [s writeToFile:@"/private/tmp/claude-501/-Users-Jacky--claude-spares-spare-SBbPAl/57b50db2-159e-4729-b15b-b24d84c6e854/scratchpad/vptrace.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil]; };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) { return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)}; };
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize s) { return @{@"width": @(s.width), @"height": @(s.height)}; };
+NSDictionary *(^vpPoint)(CGPoint) = ^NSDictionary *(CGPoint p) { return @{@"x": @(p.x), @"y": @(p.y)}; };
+__block id (^vpJSON)(id);
+vpJSON = ^id(id vIn) { NSObject *v = (NSObject *)vIn;
+ if (!v) return [NSNull null];
+ if ([v isKindOfClass:[NSString class]]) return v;
+ if ([v isKindOfClass:[NSNumber class]]) {
+ double vd = [(NSNumber *)v doubleValue];
+ if (vd != vd || vd == INFINITY || vd == -INFINITY) return [(NSObject *)v description];
+ return v;
+ }
+ if ([v isKindOfClass:[NSValue class]]) {
+ const char *vt = [(NSValue *)v objCType];
+ if (strncmp(vt, "{CGRect=", 8) == 0) { CGRect r; [(NSValue *)v getValue:&r]; return vpRect(r); }
+ if (strncmp(vt, "{CGSize=", 8) == 0) { CGSize s; [(NSValue *)v getValue:&s]; return vpSize(s); }
+ if (strncmp(vt, "{CGPoint=", 9) == 0) { CGPoint p; [(NSValue *)v getValue:&p]; return vpPoint(p); }
+ return [(NSObject *)v description];
+ }
+ if ([v isKindOfClass:[NSArray class]] || [v isKindOfClass:[NSSet class]] || [v isKindOfClass:[NSOrderedSet class]]) {
+ NSMutableArray *va = [NSMutableArray array];
+ for (id vx in (NSArray *)v) [va addObject:vpJSON(vx)];
+ return va;
+ }
+ if ([v isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *vm = [NSMutableDictionary dictionary];
+ for (id vk in (NSDictionary *)v) vm[[(NSObject *)vk description]] = vpJSON([(NSDictionary *)v objectForKey:vk]);
+ return vm;
+ }
+ if ([v isKindOfClass:[NSUUID class]]) return [(NSUUID *)v UUIDString];
+ return [(NSObject *)v description];
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ? vpJSON(value) : [NSNull null], @"error": error ?: (value ? (id)[NSNull null] : (id)@"nil")}];
+};
+NSArray *vpDenyExact = @[@"dealloc", @"invalidate", @"update", @"updateDisplays", @"_finalize", @"_invalidate", @"init", @"_init", @".cxx_destruct", @".cxx_construct", @"copy", @"mutableCopy", @"immutableCopy", @"freeze", @"acquireFrozenSurface", @"activateReplay", @"rebuildModeList", @"removeAllClones", @"resetConfiguration", @"disableDICOM", @"willUnblank", @"commitPreset", @"unregisterNotificationBlocks", @"unregisterSyncNotificationBlocks", @"clearUpdateMask", @"initializeClientPort", @"acquireWirelessDisplayStateControl", @"_detectDisplays", @"_detectSimDisplays", @"removeAllDisplays", @"enableOutOfProcessDisplayObservation", @"updateBandWidthInfoForAllDisplays", @"stopServer", @"new", @"alloc", @"class", @"self", @"retain", @"release", @"autorelease", @"retainCount", @"zone", @"hash", @"superclass", @"debugDescription", @"description", @"succinctDescription", @"succinctDescriptionBuilder", @"descriptionBuilder", @"_availableModesInternal", @"copyForSecureRendering", @"cancelTouchesOnMainDisplay", @"cancelTouchesOnAllDisplays", @"prepareForRestart", @"updateTransformsWithCompletion", @"_postInitialBookendObserverConnections", @"_cleanup", @"_freeze", @"_startAnimating", @"_stopAnimating", @"copyPrivateRepresentation", @"initForProtobufDecoding", @"_queue_resetTouchAuthenticationInitialSampleEvent", @"layoutIfNeeded", @"setNeedsLayout", @"_copyDebugProperties", @"_dragManager", @"_focusSystem", @"_interactiveHighlightEnvironment", @"focusItemContainer", @"focusedItem", @"focusedView", @"parentFocusEnvironment", @"preferredFocusEnvironments", @"preferredFocusedView", @"_preferredFocusedWindow", @"_preferredFocusedWindowScene", @"_boundingPathUtilities", @"_carSession", @"supportsFocus", @"_SwiftUITesting_currentScreenScale", @"_SwiftUITesting_wantsWideContentMargins", @"__ck_isFullscreen", @"pu_workImageSize", @"px_currentEDRHeadroom", @"px_potentialEDRHeadroom", @"ck_screenSizeCategory", @"_mapkit_display", @"postBookendConnections", @"bookendObserver", @"observers"];
+NSArray *vpDenyPrefix = @[@"set", @"_set", @"remove", @"_remove", @"add", @"cancel", @"invalidate", @"_lock_", @"_workQueue_", @"_queue_", @"_post", @"_present", @"_dismiss", @"_update", @"_wrap", @"reevaluate", @"_begin", @"_end", @"begin", @"end", @"_prepare", @"_reset", @"reset", @"_flush", @"flush", @"_notify", @"_handle", @"_init", @"init", @"_copy", @"copy", @"_create", @"create", @"_install", @"_uninstall", @"_register", @"_unregister", @"register", @"unregister", @"_perform", @"perform", @"_apply", @"apply", @"_enable", @"_disable", @"_invalidate", @"_teardown", @"_start", @"_stop", @"start", @"stop", @"_send", @"send", @"_snapshot", @"snapshot", @"_dump", @"dump", @"_run", @"_schedule", @"_will", @"_did", @"_reload", @"reload", @"_force", @"_clear", @"clear", @"_release", @"_acquire", @"acquire", @"_take", @"_capture", @"_trigger", @"_request", @"request", @"_animate", @"_show", @"_hide", @"_attach", @"_detach", @"_connect", @"_disconnect", @"_present", @"_activate", @"_deactivate", @"_destroy", @"_purge", @"_close", @"_open", @"_save", @"_load", @"_make", @"make", @"_print", @"_log", @"_toggle", @"_test", @"_simulate", @"_fake", @"_debug"];
+NSArray *vpThrowSels = @[@"secureIndicatorsEnabled"];
+BOOL (^vpAllowed)(NSString *) = ^BOOL(NSString *sel) {
+ if ([vpThrowSels containsObject:sel]) return NO;
+ if ([sel rangeOfString:@":"].location != NSNotFound) return NO;
+ if ([vpDenyExact containsObject:sel]) return NO;
+ for (NSString *vp in vpDenyPrefix) if ([sel hasPrefix:vp]) return NO;
+ return YES;
+};
+id (^vpCall)(id, NSString *, NSString **) = ^id(id obj, NSString *sel, NSString **err) {
+ SEL vs = NSSelectorFromString(sel);
+ if (![(NSObject *)obj respondsToSelector:vs]) { *err = @"does not respond"; return (id)nil; }
+ Method vm = class_getInstanceMethod(object_getClass(obj), vs);
+ if (!vm) { *err = @"no method"; return (id)nil; }
+ if (method_getNumberOfArguments(vm) != 2) { *err = @"takes arguments"; return (id)nil; }
+ char vt[256]; method_getReturnType(vm, vt, sizeof(vt));
+ const char *vr = vt; while (*vr == 'r' || *vr == 'n' || *vr == 'N' || *vr == 'o' || *vr == 'O' || *vr == 'R' || *vr == 'V') vr++;
+ switch (vr[0]) {
+ case '@': if (vr[1] == '?') { *err = @"block"; return (id)nil; }
+ { id vo = ((id (*)(id, SEL))objc_msgSend)(obj, vs); if (!vo) *err = @"nil"; return vo; }
+ case '#': { Class vc = ((Class (*)(id, SEL))objc_msgSend)(obj, vs); return vc ? NSStringFromClass(vc) : (id)nil; }
+ case 'B': return @(((BOOL (*)(id, SEL))objc_msgSend)(obj, vs) ? YES : NO);
+ case 'c': return @(((signed char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'C': return @(((unsigned char (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 's': return @(((short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'S': return @(((unsigned short (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'i': return @(((int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'I': return @(((unsigned int (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'l': return @(((long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'L': return @(((unsigned long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'q': return @(((long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'Q': return @(((unsigned long long (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'f': return @(((float (*)(id, SEL))objc_msgSend)(obj, vs));
+ case 'd': return @(((double (*)(id, SEL))objc_msgSend)(obj, vs));
+ case '{':
+ if (strncmp(vr, "{CGRect=", 8) == 0) return vpRect(((CGRect (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGSize=", 8) == 0) return vpSize(((CGSize (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{CGPoint=", 9) == 0) return vpPoint(((CGPoint (*)(id, SEL))objc_msgSend)(obj, vs));
+ if (strncmp(vr, "{UIEdgeInsets=", 14) == 0 || strncmp(vr, "{NSDirectionalEdgeInsets=", 25) == 0) { struct VPInsets { double a, b, c, d; } vi4 = ((struct VPInsets (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"top": @(vi4.a), @"left": @(vi4.b), @"bottom": @(vi4.c), @"right": @(vi4.d)}; }
+ if (strncmp(vr, "{CGAffineTransform=", 19) == 0) { CGAffineTransform vx = ((CGAffineTransform (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vx.a), @(vx.b), @(vx.c), @(vx.d), @(vx.tx), @(vx.ty)]; }
+ if (strcmp(vr, "{?=ff}") == 0) { struct VPff { float a, b; } vf = ((struct VPff (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf.a), @(vf.b)]; }
+ if (strcmp(vr, "{?={?=ff}{?=ff}{?=ff}{?=ff}}") == 0) { struct VPf8 { float a[8]; } vf8 = ((struct VPf8 (*)(id, SEL))objc_msgSend)(obj, vs); return @[@(vf8.a[0]), @(vf8.a[1]), @(vf8.a[2]), @(vf8.a[3]), @(vf8.a[4]), @(vf8.a[5]), @(vf8.a[6]), @(vf8.a[7])]; }
+ if (strncmp(vr, "{CAFrameRateRange=", 18) == 0) { struct VPfff { float a, b, c; } vf3 = ((struct VPfff (*)(id, SEL))objc_msgSend)(obj, vs); return @{@"minimum": @(vf3.a), @"maximum": @(vf3.b), @"preferred": @(vf3.c)}; }
+ *err = [NSString stringWithFormat:@"unsupported struct return %.60s", vr]; return (id)nil;
+ default: *err = [NSString stringWithFormat:@"unsupported return type %.60s", vr]; return (id)nil;
+ }
+};
+NSArray *(^vpGetters)(Class, Class) = ^NSArray *(Class cls, Class stop) {
+ char vrt[8];
+ NSMutableOrderedSet *vs = [NSMutableOrderedSet orderedSet];
+ for (Class vc = cls; vc && vc != stop && vc != [NSObject class]; vc = class_getSuperclass(vc)) {
+ unsigned int vn = 0;
+ objc_property_t *vp = class_copyPropertyList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ char *vg = property_copyAttributeValue(vp[vi], "G");
+ NSString *vgs = vg ? [NSString stringWithUTF8String:vg] : [NSString stringWithUTF8String:property_getName(vp[vi])];
+ if (vg) free(vg);
+ if (vpAllowed(vgs)) [vs addObject:vgs];
+ }
+ free(vp);
+ Method *vm = class_copyMethodList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vsel = NSStringFromSelector(method_getName(vm[vi]));
+ method_getReturnType(vm[vi], vrt, sizeof(vrt)); if (vrt[0] == 'v') continue;
+ if (method_getNumberOfArguments(vm[vi]) == 2 && vpAllowed(vsel)) [vs addObject:vsel];
+ }
+ free(vm);
+ }
+ return [[vs array] sortedArrayUsingSelector:@selector(compare:)];
+};
+void (^vpDump)(id, NSString *, NSString *, NSString *, Class) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, Class stop) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ vpAdd([apiClass stringByAppendingString:@".description"], kind, [callPrefix stringByAppendingString:@".description"], [(NSObject *)obj description], nil);
+ vpAdd([apiClass stringByAppendingString:@".class"], kind, [callPrefix stringByAppendingString:@".class"], NSStringFromClass([(NSObject *)obj class]), nil);
+ for (NSString *vsel in vpGetters([(NSObject *)obj class], stop)) {
+ vpTrace([NSString stringWithFormat:@"%@ %@", callPrefix, vsel]);
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+ for (NSString *vsel in vpThrowSels) if ([(NSObject *)obj respondsToSelector:NSSelectorFromString(vsel)]) vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], nil, @"raises an Objective-C exception in this process (not called)");
+};
+NSDictionary *(^vpObjDict)(id) = ^NSDictionary *(id objIn) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ if (!objIn) return vd;
+ for (NSString *vsel in vpGetters([(NSObject *)objIn class], nil)) { vpTrace([NSString stringWithFormat:@"objdict %@ %@", NSStringFromClass([(NSObject *)objIn class]), vsel]); NSString *verr = nil; id vv = vpCall(objIn, vsel, &verr); vd[vsel] = vv ? vpJSON(vv) : [NSString stringWithFormat:@"<error: %@>", verr]; }
+ return vd;
+};
+void (^vpDumpSel)(id, NSString *, NSString *, NSString *, NSArray *) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, NSArray *sels) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ for (NSString *vsel in sels) {
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+};
+NSObject *vpSvc = [[UIApplication sharedApplication] valueForKey:@"_displayToolService"];
+NSObject *vpDCM = [vpSvc valueForKey:@"_displayContentModeCoordinator"];
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+id vpOrientation = vpPrimary ? @(vpPrimary.interfaceOrientation) : nil;
+for (UIWindowScene *vpWS in (NSArray *)[vpDCM valueForKey:@"_connectedWindowScenes"]) {
+ long vpMode = ((long (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS);
+ vpAdd(@"UIWindowScene.displaySummary", @"private", [NSString stringWithFormat:@"<scene %@>: interfaceOrientation, screen._name, displayIdentity, contentMode, isPrimary", vpWS.session.persistentIdentifier],
+ @{@"persistentIdentifier": vpWS.session.persistentIdentifier ?: @"", @"interfaceOrientation": @(vpWS.interfaceOrientation), @"screenName": [(NSObject *)[vpWS.screen valueForKey:@"_name"] description] ?: @"", @"displayIdentity": [(NSObject *)[vpWS.screen valueForKey:@"displayIdentity"] description] ?: @"", @"displayContentMode": @(vpMode), @"isPrimaryWindowScene": @(vpWS == vpPrimary), @"coordinateSpaceBounds": vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpWS.coordinateSpace, @selector(bounds))), @"effectiveGeometryInterfaceOrientation": @(vpWS.effectiveGeometry.interfaceOrientation)}, nil);
+}
+Class vpUIS = [UIScreen class];
+NSArray *vpScreens = [UIScreen screens];
+vpAdd(@"UIScreen.screens", @"public", @"[UIScreen screens].count", @(vpScreens.count), nil);
+vpAdd(@"UIScreen.screens.names", @"private", @"[[UIScreen screens] valueForKey:@\"_name\"]", [vpScreens valueForKey:@"_name"], nil);
+vpAdd(@"UIScreen.mainScreen.indexInScreens", @"public", @"[[UIScreen screens] indexOfObjectIdenticalTo:[UIScreen mainScreen]]", @((long)[vpScreens indexOfObjectIdenticalTo:[UIScreen mainScreen]]), nil);
+for (NSString *vpCS in @[@"_embeddedScreen", @"_carScreen", @"allActiveScreens", @"_shortScreensDescription", @"maxScreenScale", @"_screenHeightSizeClassForCurrentDevice", @"_isProbablyBeingRecorded", @"_shouldDisableJail", @"__displayConfigurationsForViewService", @"_mainScreenThreadSafeTraitCollection"]) {
+ NSString *verr = nil;
+ id vv = vpCall(vpUIS, vpCS, &verr);
+ vpAdd([@"UIScreen+" stringByAppendingString:vpCS], @"private", [NSString stringWithFormat:@"[UIScreen %@]", vpCS], vv, vv ? nil : verr);
+}
+NSArray *vpTraitSels = @[@"displayScale", @"displayGamut", @"userInterfaceIdiom", @"horizontalSizeClass", @"verticalSizeClass", @"displayCornerRadius", @"layoutDirection", @"forceTouchCapability", @"userInterfaceStyle", @"userInterfaceLevel", @"artworkSubtype", @"touchLevel", @"_backlightLuminance", @"sceneCaptureState", @"imageDynamicRange", @"primaryInteractionModel", @"interactionModel", @"_windowSceneInterfaceOrientationBehavior", @"verticalBarEdge", @"accessibilityContrast", @"legibilityWeight", @"preferredContentSizeCategory", @"activeAppearance", @"hdrHeadroomUsageLimit", @"_headroomUsage", @"isSmallScreenDevice", @"_systemDisplayIdentifier", @"widthDesignation", @"heightDesignation", @"_userInterfaceRenderingMode", @"_vibrancy", @"_traitsDescription"];
+NSMutableArray *vpScrList = [NSMutableArray arrayWithArray:vpScreens];
+NSMutableArray *vpScrCalls = [NSMutableArray array];
+for (NSUInteger vi = 0; vi < vpScreens.count; vi++) [vpScrCalls addObject:[NSString stringWithFormat:@"[UIScreen screens][%lu]<%@>", (unsigned long)vi, [(NSObject *)vpScreens[vi] valueForKey:@"_name"]]];
+[vpScrList addObject:[UIScreen mainScreen]];
+[vpScrCalls addObject:[NSString stringWithFormat:@"[UIScreen mainScreen]<%@>", [[UIScreen mainScreen] valueForKey:@"_name"]]];
+NSMutableArray *vpConfigs = [NSMutableArray array];
+NSMutableArray *vpConfigCalls = [NSMutableArray array];
+for (NSUInteger vi = 0; vi < vpScrList.count; vi++) {
+ UIScreen *vpS = vpScrList[vi];
+ NSString *vpC = vpScrCalls[vi];
+ vpDump(vpS, @"UIScreen", @"private", vpC, nil);
+ vpAdd(@"UIScreen.coordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIScreen.fixedCoordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".fixedCoordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpS.fixedCoordinateSpace, @selector(bounds))), nil);
+ CGRect vpFix = ((CGRect (*)(id, SEL, CGRect, id))objc_msgSend)((id)vpS.coordinateSpace, @selector(convertRect:toCoordinateSpace:), ((CGRect (*)(id, SEL))objc_msgSend)((id)vpS.coordinateSpace, @selector(bounds)), (id)vpS.fixedCoordinateSpace);
+ vpAdd(@"UIScreen.coordinateSpace->fixedCoordinateSpace", @"public", [vpC stringByAppendingString:@" [coordinateSpace convertRect:coordinateSpace.bounds toCoordinateSpace:fixedCoordinateSpace]"], vpRect(vpFix), nil);
+ vpDumpSel(vpS.traitCollection, @"UITraitCollection", @"public", [vpC stringByAppendingString:@".traitCollection"], vpTraitSels);
+ NSObject *vpEx = [vpS valueForKey:@"_exclusionArea"];
+ vpAdd(@"UIScreen._exclusionArea.rect", @"private", [vpC stringByAppendingString:@"._exclusionArea.rect"], vpEx && [vpEx respondsToSelector:@selector(rect)] ? vpRect(((CGRect (*)(id, SEL))objc_msgSend)(vpEx, @selector(rect))) : nil, vpEx ? ([vpEx respondsToSelector:@selector(rect)] ? nil : [NSString stringWithFormat:@"%@ has no -rect", NSStringFromClass([vpEx class])]) : @"nil");
+ NSObject *vpDIP = [vpS valueForKey:@"_displayInfoProvider"];
+ vpAdd(@"UIScreen._displayInfoProvider.getters", @"private", [vpC stringByAppendingString:@"._displayInfoProvider.*"], vpDIP ? vpObjDict(vpDIP) : nil, vpDIP ? nil : @"nil");
+ NSObject *vpIDC = [vpS valueForKey:@"_initialDisplayContext"];
+ vpAdd(@"UIScreen._initialDisplayContext.getters", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_initialDisplayContext\" .*"], vpIDC ? vpObjDict(vpIDC) : nil, vpIDC ? nil : @"nil");
+ NSObject *vpIDCEdge = vpIDC ? [vpIDC valueForKey:@"displayEdgeInfo"] : nil;
+ vpAdd(@"UIScreen._initialDisplayContext.displayEdgeInfo.getters", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_initialDisplayContext\" .displayEdgeInfo.*"], vpIDCEdge ? vpObjDict(vpIDCEdge) : nil, vpIDCEdge ? nil : @"nil");
+ vpAdd(@"UIScreen.__eventDisplay", @"private", [vpC stringByAppendingString:@" valueForKey:@\"__eventDisplay\""], [vpS valueForKey:@"__eventDisplay"], nil);
+ vpAdd(@"UIScreen._sceneProvidedCornerRadius", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_sceneProvidedCornerRadius\""], [vpS valueForKey:@"_sceneProvidedCornerRadius"], nil);
+ vpAdd(@"UIScreen._previousHardwareIdentifier", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_previousHardwareIdentifier\""], [vpS valueForKey:@"_previousHardwareIdentifier"], nil);
+ NSMutableArray *vpUM = [NSMutableArray array];
+ for (UIScreenMode *vpM in vpS.availableModes) [vpUM addObject:@{@"size": vpSize(vpM.size), @"pixelAspectRatio": @(vpM.pixelAspectRatio)}];
+ vpAdd(@"UIScreen.availableModes.sizes", @"public", [vpC stringByAppendingString:@".availableModes[*].{size,pixelAspectRatio}"], vpUM, nil);
+ vpAdd(@"UIScreen.currentMode.size", @"public", [vpC stringByAppendingString:@".currentMode.size"], vpS.currentMode ? vpSize(vpS.currentMode.size) : nil, vpS.currentMode ? nil : @"nil");
+ vpAdd(@"UIScreen.preferredMode.size", @"public", [vpC stringByAppendingString:@".preferredMode.size"], vpS.preferredMode ? vpSize(vpS.preferredMode.size) : nil, vpS.preferredMode ? nil : @"nil");
+ if (vi < vpScreens.count) {
+ NSObject *vpDC = [vpS valueForKey:@"displayConfiguration"];
+ if (vpDC) { [vpConfigs addObject:vpDC]; [vpConfigCalls addObject:[vpC stringByAppendingString:@".displayConfiguration"]]; }
+ }
+}
+NSObject *vpFBDM = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"FBDisplayManager"), @selector(sharedInstance));
+vpDump(vpFBDM, @"FBDisplayManager", @"private", @"[FBDisplayManager sharedInstance]", nil);
+for (NSString *vpCS in @[@"mainConfiguration", @"mainIdentity", @"alwaysConnectedIdentities"]) {
+ NSString *verr = nil; id vv = vpCall(NSClassFromString(@"FBDisplayManager"), vpCS, &verr);
+ vpAdd([@"FBDisplayManager+" stringByAppendingString:vpCS], @"private", [NSString stringWithFormat:@"[FBDisplayManager %@]", vpCS], vv, vv ? nil : verr);
+}
+NSArray *vpConn = [[(NSSet *)[vpFBDM valueForKey:@"connectedIdentities"] allObjects] sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"displayID" ascending:YES]]];
+vpAdd(@"FBSDisplayMonitor.connectedIdentities.count", @"private", @"[[FBDisplayManager sharedInstance] connectedIdentities].count", @(vpConn.count), nil);
+for (NSObject *vpId in vpConn) {
+ NSObject *vpCfg = ((id (*)(id, SEL, id))objc_msgSend)(vpFBDM, NSSelectorFromString(@"configurationForIdentity:"), vpId);
+ if (vpCfg) { [vpConfigs addObject:vpCfg]; [vpConfigCalls addObject:[NSString stringWithFormat:@"[[FBDisplayManager sharedInstance] configurationForIdentity:<%@>]", vpId]]; }
+ else vpAdd(@"FBSDisplayMonitor.configurationForIdentity:", @"private", [NSString stringWithFormat:@"[[FBDisplayManager sharedInstance] configurationForIdentity:<%@>]", vpId], nil, @"nil");
+}
+NSObject *vpUISDC = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"UISDisplayContext"), @selector(defaultContext));
+if (vpUISDC) { [vpConfigs addObject:[vpUISDC valueForKey:@"displayConfiguration"]]; [vpConfigCalls addObject:@"[UISDisplayContext defaultContext].displayConfiguration"]; }
+NSMutableOrderedSet *vpHWIDs = [NSMutableOrderedSet orderedSet];
+for (NSUInteger vi = 0; vi < vpConfigs.count; vi++) {
+ NSObject *vpCfg = vpConfigs[vi];
+ NSString *vpC = vpConfigCalls[vi];
+ vpDump(vpCfg, @"FBSDisplayConfiguration", @"private", vpC, nil);
+ vpAdd(@"FBSDisplayConfiguration.currentMode.getters", @"private", [vpC stringByAppendingString:@".currentMode.*"], vpObjDict([vpCfg valueForKey:@"currentMode"]), nil);
+ vpAdd(@"FBSDisplayConfiguration.preferredMode.getters", @"private", [vpC stringByAppendingString:@".preferredMode.*"], vpObjDict([vpCfg valueForKey:@"preferredMode"]), nil);
+ NSMutableArray *vpMs = [NSMutableArray array];
+ for (id vpM in (NSSet *)[vpCfg valueForKey:@"availableModes"]) [vpMs addObject:vpObjDict(vpM)];
+ vpAdd(@"FBSDisplayConfiguration.availableModes.getters", @"private", [vpC stringByAppendingString:@".availableModes[*].*"], vpMs, nil);
+ vpAdd(@"FBSDisplayConfiguration.pixelDensity.getters", @"private", [vpC stringByAppendingString:@".pixelDensity.*"], vpObjDict([vpCfg valueForKey:@"pixelDensity"]), nil);
+ NSObject *vpIdn = [vpCfg valueForKey:@"identity"];
+ vpDump(vpIdn, @"FBSDisplayIdentity", @"private", [vpC stringByAppendingString:@".identity"], nil);
+ NSObject *vpRoot = [vpIdn valueForKey:@"rootIdentity"];
+ vpAdd(@"FBSDisplayIdentity.rootIdentity.getters", @"private", [vpC stringByAppendingString:@".identity.rootIdentity.*"], vpRoot ? vpObjDict(vpRoot) : nil, vpRoot ? nil : @"nil");
+ id vpHW = [vpCfg valueForKey:@"hardwareIdentifier"];
+ if (vpHW) [vpHWIDs addObject:vpHW];
+}
+vpDump(vpUISDC, @"UISDisplayContext", @"private", @"[UISDisplayContext defaultContext]", nil);
+NSObject *vpEdge = vpUISDC ? [vpUISDC valueForKey:@"displayEdgeInfo"] : nil;
+vpAdd(@"UISDisplayContext.displayEdgeInfo.getters", @"private", @"[UISDisplayContext defaultContext].displayEdgeInfo.*", vpEdge ? vpObjDict(vpEdge) : nil, vpEdge ? nil : @"nil");
+NSObject *vpEA = vpUISDC ? [vpUISDC valueForKey:@"exclusionArea"] : nil;
+vpAdd(@"UISDisplayContext.exclusionArea.rect", @"private", @"[UISDisplayContext defaultContext].exclusionArea.rect", vpEA && [vpEA respondsToSelector:@selector(rect)] ? vpRect(((CGRect (*)(id, SEL))objc_msgSend)(vpEA, @selector(rect))) : nil, vpEA ? nil : @"nil");
+NSObject *vpBKS = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKSDisplayService"), @selector(sharedInstance));
+for (NSString *vpHW in vpHWIDs) {
+ NSObject *vpT = ((id (*)(id, SEL, id))objc_msgSend)(vpBKS, NSSelectorFromString(@"traitsForDisplayUUID:"), vpHW);
+ vpAdd(@"BKSDisplayService.traitsForDisplayUUID:", @"private", [NSString stringWithFormat:@"[[BKSDisplayService sharedInstance] traitsForDisplayUUID:@\"%@\"]", vpHW], vpT ? @{@"description": [vpT description], @"surfaceType": @(((int (*)(id, SEL))objc_msgSend)(vpT, NSSelectorFromString(@"surfaceType")))} : nil, vpT ? nil : @"nil");
+}
+vpAdd(@"UIDevice.orientation", @"public", @"[[UIDevice currentDevice] orientation]", @((long)[[UIDevice currentDevice] orientation]), nil);
+vpAdd(@"UIApplication.activeInterfaceOrientation", @"private", @"[[UIApplication sharedApplication] activeInterfaceOrientation]", @((long)[(UIApplication *)[UIApplication sharedApplication] activeInterfaceOrientation]), nil);
+NSMutableArray *vpSceneList = [NSMutableArray array];
+for (UIScene *vpSc in [[UIApplication sharedApplication] connectedScenes]) {
+ UIWindowScene *vpW = (UIWindowScene *)vpSc;
+ [vpSceneList addObject:@{@"persistentIdentifier": vpSc.session.persistentIdentifier ?: @"", @"class": NSStringFromClass([vpSc class]), @"interfaceOrientation": @((long)vpW.interfaceOrientation), @"screenName": [(NSObject *)[vpW.screen valueForKey:@"_name"] description] ?: @"", @"coordinateSpaceBounds": vpRect(((CGRect (*)(id, SEL))objc_msgSend)((id)vpW.coordinateSpace, @selector(bounds)))}];
+}
+vpAdd(@"UIApplication.connectedScenes.summary", @"private", @"[[UIApplication sharedApplication] connectedScenes] -> {persistentIdentifier, class, interfaceOrientation, screen._name, coordinateSpace.bounds}", [vpSceneList sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"persistentIdentifier" ascending:YES]]], nil);
+NSObject *vpFG = [[UIApplication sharedApplication] respondsToSelector:NSSelectorFromString(@"_accessibilityFrontMostApplication")] ? [[UIApplication sharedApplication] valueForKey:@"_accessibilityFrontMostApplication"] : nil;
+vpAdd(@"SpringBoard._accessibilityFrontMostApplication", @"private", @"[[UIApplication sharedApplication] _accessibilityFrontMostApplication].bundleIdentifier", vpFG ? [vpFG valueForKey:@"bundleIdentifier"] : nil, vpFG ? nil : @"nil (home screen or not available)");
+NSError *vpJErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:@{@"orientation": vpOrientation ?: [NSNull null], @"records": vpRecs} options:0 error:&vpJErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpJErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-app-hinge-register.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-app-hinge-register.lldb
new file mode 100644
index 00000000..41198a6c
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-app-hinge-register.lldb
@@ -0,0 +1,28 @@
+expr -l objc -O --
+NSMutableString *vpLog = [NSMutableString string];
+Class vpObsC = objc_getClass("VPSensorsHingeObserver");
+if (!vpObsC) {
+ vpObsC = objc_allocateClassPair([NSObject class], "VPSensorsHingeObserver", 0);
+ IMP vpNoop = method_getImplementation(class_getInstanceMethod([NSObject class], @selector(self)));
+ class_addMethod(vpObsC, NSSelectorFromString(@"sceneHingeStateClientComponent:didUpdateFromHingeState:toHingeState:"), vpNoop, "v40@0:8@16@24@32");
+ Protocol *vpP = objc_getProtocol("_UISceneHingeStateClientObserver");
+ if (vpP) class_addProtocol(vpObsC, vpP);
+ objc_registerClassPair(vpObsC);
+ [vpLog appendFormat:@"created class VPSensorsHingeObserver (protocol %@)\n", vpP ? @"added" : @"missing"];
+}
+NSObject *vpApp = (NSObject *)[UIApplication sharedApplication];
+NSMutableArray *vpKeep = objc_getAssociatedObject(vpApp, (void *)0x5650484e);
+if (!vpKeep) { vpKeep = [NSMutableArray array]; objc_setAssociatedObject(vpApp, (void *)0x5650484e, vpKeep, OBJC_ASSOCIATION_RETAIN); }
+for (UIScene *vpS in [UIApplication sharedApplication].connectedScenes) {
+ NSObject *vpF = ((id (*)(id, SEL))objc_msgSend)(vpS, @selector(_FBSScene));
+ NSObject *vpComp = vpF ? ((id (*)(id, SEL))objc_msgSend)(vpF, @selector(ui_hingeStateClientComponent)) : nil;
+ if (!vpComp) { [vpLog appendFormat:@"%@: no component\n", vpS.session.persistentIdentifier]; continue; }
+ NSHashTable *vpRegs = (NSHashTable *)object_getIvar(vpComp, class_getInstanceVariable(object_getClass(vpComp), "_observerRegistrations"));
+ if (vpRegs.count > 0) { [vpLog appendFormat:@"%@: already has %lu observer registrations, not registering\n", vpS.session.persistentIdentifier, (unsigned long)vpRegs.count]; continue; }
+ NSObject *vpObs = ((id (*)(id, SEL))objc_msgSend)(((id (*)(id, SEL))objc_msgSend)(vpObsC, @selector(alloc)), @selector(init));
+ NSObject *vpTok = ((id (*)(id, SEL, id))objc_msgSend)(vpComp, @selector(registerObserver:), vpObs);
+ [vpKeep addObject:vpObs]; if (vpTok) [vpKeep addObject:vpTok];
+ [vpLog appendFormat:@"%@: registered observer, token %@\n%@\n", vpS.session.persistentIdentifier, vpTok ? NSStringFromClass(object_getClass(vpTok)) : @"nil", [vpComp description]];
+}
+vpLog
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-backboardd.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-backboardd.lldb
new file mode 100644
index 00000000..a3f697b3
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-backboardd.lldb
@@ -0,0 +1,64 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSObject *vpSys = (NSObject *)((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKHIDSystem"), @selector(sharedInstance));
+vpAdd(@"BKHIDSystem.sharedInstance", @"private", @"+[BKHIDSystem sharedInstance] class", vpSys ? NSStringFromClass(object_getClass(vpSys)) : nil, vpSys ? nil : @"nil");
+NSArray *vpSvcs = vpSys ? (NSArray *)((id (*)(id, SEL, id))objc_msgSend)(vpSys, @selector(IOHIDServicesMatching:), nil) : nil;
+vpAdd(@"BKHIDSystem.IOHIDServicesMatching:.count", @"private", @"[[BKHIDSystem sharedInstance] IOHIDServicesMatching:nil].count", vpSvcs ? @(vpSvcs.count) : nil, vpSvcs ? nil : @"nil");
+id (*vpCopyProp)(void *, CFStringRef) = (id (*)(void *, CFStringRef))dlsym(RTLD_DEFAULT, "IOHIDServiceCopyProperty");
+uint64_t (*vpRegID)(void *) = (uint64_t (*)(void *))dlsym(RTLD_DEFAULT, "IOHIDServiceGetRegistryID");
+void *(*vpCopyEvent)(void *, int, void *, int) = (void *(*)(void *, int, void *, int))dlsym(RTLD_DEFAULT, "IOHIDServiceCopyEvent");
+NSArray *vpKeys = @[@"PrimaryUsagePage", @"PrimaryUsage", @"DeviceUsagePairs", @"Product", @"Manufacturer", @"Transport", @"Built-In", @"VendorID", @"ProductID", @"LocationID", @"IOClass", @"HIDServiceSupport", @"SimulatorHIDServiceIdentifier", @"SimulatorDisplayUID", @"DisplayIntegrated", @"SensorPropertySupported", @"ReportInterval", @"BatchInterval", @"SerialNumber", @"Hidden", @"HIDVirtualDevice", @"VirtualDevice", @"CreatorPID", @"DeviceOpenedByEventSystem", @"HIDEventServiceProperties", @"SensorProperties", @"CountryCode", @"VersionNumber", @"DeviceTypeHint"];
+NSMutableArray *vpList = [NSMutableArray array];
+NSMutableArray *vpHinge = [NSMutableArray array];
+for (id vpS in vpSvcs) {
+ void *vpRef = (__bridge void *)vpS;
+ NSMutableDictionary *vpD = [NSMutableDictionary dictionary];
+ vpD[@"registryID"] = vpRegID ? @(vpRegID(vpRef)) : [NSNull null];
+ vpD[@"class"] = NSStringFromClass(object_getClass(vpS));
+ for (NSString *vpK in vpKeys) { id vpV = vpCopyProp ? vpCopyProp(vpRef, (__bridge CFStringRef)vpK) : nil; if (vpV) vpD[vpK] = vpV; }
+ [vpList addObject:vpD];
+ long long vpUP = [(NSNumber *)vpD[@"PrimaryUsagePage"] longLongValue], vpU = [(NSNumber *)vpD[@"PrimaryUsage"] longLongValue];
+ BOOL vpIsHinge = (vpUP == 0xff0c && vpU == 0x21) || [[(NSObject *)vpD[@"Product"] description].lowercaseString containsString:@"hinge"];
+ for (NSDictionary *vpP in (NSArray *)vpD[@"DeviceUsagePairs"]) if ([(NSNumber *)vpP[@"DeviceUsagePage"] longLongValue] == 0xff0c && [(NSNumber *)vpP[@"DeviceUsage"] longLongValue] == 0x21) vpIsHinge = YES;
+ void *vpEv = vpCopyEvent ? vpCopyEvent(vpRef, 0x2c, NULL, 0) : NULL;
+ void *vpEv1 = (vpCopyEvent && vpUP == 0xff0c) ? vpCopyEvent(vpRef, 1, NULL, 0) : NULL;
+ if (vpIsHinge || vpEv || vpUP == 0xff0c) [vpHinge addObject:@{@"service": vpD, @"isHingeUsage": @(vpIsHinge), @"copyEvent0x2c": vpEv ? [(__bridge NSObject *)vpEv description] : [NSNull null], @"copyEvent0x01": vpEv1 ? [(__bridge NSObject *)vpEv1 description] : [NSNull null]}];
+ if (vpEv) CFRelease(vpEv);
+ if (vpEv1) CFRelease(vpEv1);
+}
+[vpList sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"registryID" ascending:YES]]];
+vpAdd(@"IOHIDService.properties", @"private", @"for each [[BKHIDSystem sharedInstance] IOHIDServicesMatching:nil]: IOHIDServiceGetRegistryID + IOHIDServiceCopyProperty(<keys>)", vpList, nil);
+vpAdd(@"IOHIDService.hingeAngle", @"private", @"services with PrimaryUsagePage 0xff0c / PrimaryUsage 0x21 (CoreMotion CLAngleNotifier's hinge usage, as the VM's Hinge dylib publishes), a 'hinge' product name, or a non-nil IOHIDServiceCopyEvent(svc, kIOHIDEventTypeHingeAngle 0x2c)", vpHinge, nil);
+NSArray *vpHM = vpSys ? (NSArray *)((id (*)(id, SEL, id))objc_msgSend)(vpSys, @selector(IOHIDServicesMatching:), @{@"PrimaryUsagePage": @0xff0c, @"PrimaryUsage": @0x21}) : nil;
+vpAdd(@"BKHIDSystem.IOHIDServicesMatching:hinge", @"private", @"[[BKHIDSystem sharedInstance] IOHIDServicesMatching:@{PrimaryUsagePage: 0xff0c, PrimaryUsage: 0x21}].count", vpHM ? @(vpHM.count) : nil, vpHM ? nil : @"nil");
+void *vpSysEv = vpSys ? ((void *(*)(id, SEL, unsigned int, void *, unsigned int))objc_msgSend)(vpSys, @selector(systemEventOfType:matchingEvent:options:), 0x2c, NULL, 0) : NULL;
+vpAdd(@"BKHIDSystem.systemEventOfType:0x2c", @"private", @"[[BKHIDSystem sharedInstance] systemEventOfType:kIOHIDEventTypeHingeAngle(0x2c) matchingEvent:NULL options:0]", vpSysEv ? [(__bridge NSObject *)vpSysEv description] : nil, vpSysEv ? nil : @"NULL");
+NSObject *vpReg = (NSObject *)((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"BKHIDEventProcessorRegistry"), @selector(sharedInstance));
+NSDictionary *vpProcs = vpReg ? (NSDictionary *)[vpReg valueForKey:@"_eventProcessorsByClassName"] : nil;
+vpAdd(@"BKHIDEventProcessorRegistry.eventProcessors", @"private", @"[[BKHIDEventProcessorRegistry sharedInstance] valueForKey:@\"_eventProcessorsByClassName\"] allKeys (sorted)", vpProcs ? [[vpProcs allKeys] sortedArrayUsingSelector:@selector(compare:)] : nil, vpProcs ? nil : @"nil");
+NSMutableArray *vpHC = [NSMutableArray array];
+unsigned int vpCC = 0; Class *vpAll = objc_copyClassList(&vpCC);
+for (unsigned int vi = 0; vi < vpCC; vi++) { NSString *vpN = NSStringFromClass(vpAll[vi]); if ([vpN.lowercaseString containsString:@"hinge"] && ([vpN hasPrefix:@"BK"] || [vpN hasPrefix:@"Sim"] || [vpN hasPrefix:@"HID"])) [vpHC addObject:vpN]; }
+free(vpAll);
+vpAdd(@"backboardd.hingeClasses", @"private", @"objc_copyClassList filtered to BK*/Sim*/HID* names containing 'hinge'", vpHC, nil);
+Class vpVES = NSClassFromString(@"HIDVirtualEventService");
+vpAdd(@"HIDVirtualEventService.class", @"private", @"NSClassFromString(@\"HIDVirtualEventService\")", vpVES ? @"present" : nil, vpVES ? nil : @"class missing");
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSDictionary *vpOut = @{@"group": @"hid", @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-cmquery.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-cmquery.lldb
new file mode 100644
index 00000000..6bea2bbf
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-cmquery.lldb
@@ -0,0 +1,34 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSObject *vpMgr = (NSObject *)((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"CMDeviceStateManager"), @selector(sharedManager));
+double vpT0 = CFAbsoluteTimeGetCurrent();
+NSObject *vpE = vpMgr ? (NSObject *)((id (*)(id, SEL))objc_msgSend)(vpMgr, @selector(queryDeviceStateBlocking)) : nil;
+double vpDT = CFAbsoluteTimeGetCurrent() - vpT0;
+NSDictionary *vpEv = vpE ? @{@"class": NSStringFromClass(object_getClass(vpE)),
+ @"propertyA": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(propertyA))), @"propertyA0": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(propertyA0))),
+ @"propertyA1": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(propertyA1))), @"propertyB": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(propertyB))),
+ @"propertyC": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(propertyC))), @"propertyD": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(propertyD))),
+ @"progressValid": @(((BOOL (*)(id, SEL))objc_msgSend)(vpE, @selector(progressValid))), @"fromPropertyB": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(fromPropertyB))),
+ @"toPropertyB": @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(toPropertyB))), @"progressValue": @(((double (*)(id, SEL))objc_msgSend)(vpE, @selector(progressValue))),
+ @"timestamp": @(((double (*)(id, SEL))objc_msgSend)(vpE, @selector(timestamp))), @"description": [vpE description] ?: @""} : nil;
+vpAdd(@"CMDeviceStateManager.queryDeviceStateBlocking", @"private", @"[[CMDeviceStateManager sharedManager] queryDeviceStateBlocking] (synchronous query to locationd)", vpEv, vpE ? nil : [NSString stringWithFormat:@"nil after %.3f s", vpDT]);
+vpAdd(@"CMDeviceStateManager.queryDeviceStateBlocking.seconds", @"private", @"wall time of the blocking query", @(vpDT), nil);
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSDictionary *vpOut = @{@"group": @"cmquery", @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-cmtables.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-cmtables.lldb
new file mode 100644
index 00000000..ca3cbe75
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-cmtables.lldb
@@ -0,0 +1,62 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+Class vpDSE = NSClassFromString(@"CMDeviceStateEvent");
+Class vpMPE = NSClassFromString(@"CMMagicPoseEvent");
+Class vpMPM = NSClassFromString(@"CMMagicPoseManager");
+NSString *(^vpStr)(Class, SEL, long long) = ^NSString *(Class c, SEL s, long long n) { NSObject *vpV = ((id (*)(id, SEL, long long))objc_msgSend)(c, s, n); return vpV ? [(NSObject *)vpV description] : @"(nil)"; };
+NSArray *vpStrSels = @[@"stringForDeviceStatePropertyAType:", @"stringForDeviceStatePropertyBType:", @"stringForDeviceStatePropertyCType:", @"stringForDeviceStatePropertyDType:"];
+for (NSString *vpSel in vpStrSels) {
+ NSMutableDictionary *vpT = [NSMutableDictionary dictionary];
+ for (long long vn = -1; vn <= 12; vn++) vpT[[NSString stringWithFormat:@"%lld", vn]] = vpStr(vpDSE, NSSelectorFromString(vpSel), vn);
+ vpAdd([@"CMDeviceStateEvent." stringByAppendingString:vpSel], @"private", [NSString stringWithFormat:@"+[CMDeviceStateEvent %@-1..12]", vpSel], vpT, nil);
+}
+for (NSString *vpSel in @[@"stringForDeviceOrientation:", @"stringForHingeState:", @"stringForTabletopPose:", @"stringForStableOrientationState:"]) {
+ NSMutableDictionary *vpT = [NSMutableDictionary dictionary];
+ for (long long vn = -1; vn <= 12; vn++) vpT[[NSString stringWithFormat:@"%lld", vn]] = vpStr(vpMPE, NSSelectorFromString(vpSel), vn);
+ vpAdd([@"CMMagicPoseEvent." stringByAppendingString:vpSel], @"private", [NSString stringWithFormat:@"+[CMMagicPoseEvent %@-1..12]", vpSel], vpT, nil);
+}
+NSMutableArray *vpPA = [NSMutableArray array];
+for (long long vc = 0; vc <= 4; vc++) for (long long va = 0; va <= 7; va++) for (long long vb = 0; vb <= 6; vb++) for (long long vt = 0; vt <= 11; vt++) {
+ long long vr = ((long long (*)(id, SEL, long long, long long, long long, long long))objc_msgSend)(vpDSE, @selector(propertyAForConfigType:propertyA:propertyB:propertyC:), vc, va, vb, vt);
+ [vpPA addObject:@[@(vc), @(va), @(vb), @(vt), @(vr)]];
+}
+vpAdd(@"CMDeviceStateEvent.propertyAForConfigType:propertyA:propertyB:propertyC:", @"private", @"+[CMDeviceStateEvent propertyAForConfigType:c propertyA:a propertyB:b propertyC:t] for c 0..4, a 0..7, b 0..6, t 0..11; rows [c, a, b, t, result]", vpPA, nil);
+NSObject *vpShared = ((id (*)(id, SEL))objc_msgSend)(vpMPM, @selector(sharedManager));
+NSMutableArray *vpOM = [NSMutableArray array];
+NSMutableArray *vpMap = [NSMutableArray array];
+for (long long vo = 0; vo <= 7; vo++) for (long long vh = 0; vh <= 6; vh++) for (long long vt = 0; vt <= 11; vt++) {
+ NSObject *vpE = ((id (*)(id, SEL, long long, long long, long long, double, double))objc_msgSend)(((id (*)(id, SEL))objc_msgSend)(vpMPE, @selector(alloc)), @selector(initWithDeviceOrientation:hingeState:tabletopPose:timestamp:continuousTimestamp:), vo, vh, vt, 0.0, 0.0);
+ for (long long vs = 0; vs <= 3; vs++) {
+ long long vr = ((long long (*)(id, SEL, id, long long))objc_msgSend)(vpMPM, @selector(orientationForMagicPose:deviceSurface:), vpE, vs);
+ [vpOM addObject:@[@(vo), @(vh), @(vt), @(vs), @(vr)]];
+ }
+ if (vpShared) {
+ NSObject *vpDS = ((id (*)(id, SEL, id))objc_msgSend)(vpShared, @selector(createDeviceStateEventFromMagicPoseEvent:), vpE);
+ [vpMap addObject:@[@(vo), @(vh), @(vt),
+ vpDS ? @(((long long (*)(id, SEL))objc_msgSend)(vpDS, @selector(propertyA))) : [NSNull null],
+ vpDS ? @(((long long (*)(id, SEL))objc_msgSend)(vpDS, @selector(propertyB))) : [NSNull null],
+ vpDS ? @(((long long (*)(id, SEL))objc_msgSend)(vpDS, @selector(propertyC))) : [NSNull null],
+ @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(deviceOrientation))), @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(hingeState))), @(((long long (*)(id, SEL))objc_msgSend)(vpE, @selector(tabletopPose)))]];
+ }
+}
+vpAdd(@"CMMagicPoseManager.orientationForMagicPose:deviceSurface:", @"private", @"+[CMMagicPoseManager orientationForMagicPose:[[CMMagicPoseEvent alloc] initWithDeviceOrientation:o hingeState:h tabletopPose:t timestamp:0 continuousTimestamp:0] deviceSurface:s] for o 0..7, h 0..6, t 0..11, s 0..3; rows [o, h, t, s, result]", vpOM, nil);
+vpAdd(@"CMMagicPoseManager.createDeviceStateEventFromMagicPoseEvent:", @"private", @"-[[CMMagicPoseManager sharedManager] createDeviceStateEventFromMagicPoseEvent:<o,h,t>] for o 0..7, h 0..6, t 0..11; rows [o, h, t, event.propertyA, event.propertyB, event.propertyC, pose.deviceOrientation, pose.hingeState, pose.tabletopPose]", vpShared ? vpMap : nil, vpShared ? nil : @"sharedManager nil");
+NSDictionary *vpOut = @{@"group": @"cmtables", @"records": vpRecs};
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-coremotion.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-coremotion.lldb
new file mode 100644
index 00000000..801bf9a3
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-coremotion.lldb
@@ -0,0 +1,119 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSObject *vpApp = ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"UIApplication"), @selector(sharedApplication));
+long vpOrient = 0;
+if ([vpApp respondsToSelector:NSSelectorFromString(@"devicePoseProvider")]) {
+ vpOrient = ((long (*)(id, SEL))objc_msgSend)([(NSObject *)[(NSObject *)[vpApp valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"] valueForKey:@"primaryWindowScene"], @selector(interfaceOrientation));
+} else if (vpApp) {
+ for (NSObject *vpS in (NSSet *)[vpApp valueForKey:@"connectedScenes"]) if ([vpS respondsToSelector:@selector(interfaceOrientation)]) { vpOrient = ((long (*)(id, SEL))objc_msgSend)(vpS, @selector(interfaceOrientation)); break; }
+}
+NSObject *(^vpIv)(NSObject *, NSString *) = ^NSObject *(NSObject *o, NSString *name) {
+ if (!o) return (NSObject *)nil;
+ Ivar vpX = class_getInstanceVariable(object_getClass(o), name.UTF8String);
+ if (!vpX) return (NSObject *)@"<no such ivar>";
+ const char *vpT = ivar_getTypeEncoding(vpX);
+ char *vpB = (char *)(__bridge void *)o + ivar_getOffset(vpX);
+ switch (vpT[0]) {
+ case 'q': return (NSObject *)@(*(long long *)vpB);
+ case 'd': return (NSObject *)@(*(double *)vpB);
+ case 'f': return (NSObject *)@(*(float *)vpB);
+ case 'B': return (NSObject *)@(*(BOOL *)vpB);
+ case 'i': return (NSObject *)@(*(int *)vpB);
+ case '@': if (vpT[1] == '?') return (NSObject *)@(*(void **)vpB != NULL); return (NSObject *)object_getIvar(o, vpX);
+ default: return (NSObject *)[NSString stringWithFormat:@"<unsupported ivar type %s>", vpT];
+ }
+};
+NSDictionary *(^vpEvt)(NSObject *) = ^NSDictionary *(NSObject *e) {
+ if (!e) return (NSDictionary *)nil;
+ return @{@"class": NSStringFromClass(object_getClass(e)),
+ @"propertyA": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(propertyA))), @"propertyA0": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(propertyA0))),
+ @"propertyA1": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(propertyA1))), @"propertyB": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(propertyB))),
+ @"propertyC": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(propertyC))), @"propertyD": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(propertyD))),
+ @"progressValid": @(((BOOL (*)(id, SEL))objc_msgSend)(e, @selector(progressValid))), @"fromPropertyB": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(fromPropertyB))),
+ @"toPropertyB": @(((long long (*)(id, SEL))objc_msgSend)(e, @selector(toPropertyB))), @"progressValue": @(((double (*)(id, SEL))objc_msgSend)(e, @selector(progressValue))),
+ @"timestamp": @(((double (*)(id, SEL))objc_msgSend)(e, @selector(timestamp))), @"description": [(NSObject *)e description] ?: @""};
+};
+NSDictionary *(^vpDSM)(NSObject *) = ^NSDictionary *(NSObject *m) {
+ if (!m) return (NSDictionary *)nil;
+ NSObject *vpI = vpIv(m, @"_internal");
+ if (!vpI) return @{@"class": NSStringFromClass(object_getClass(m)), @"_internal": [NSNull null]};
+ NSMutableDictionary *vpR = [NSMutableDictionary dictionaryWithDictionary:@{@"class": NSStringFromClass(object_getClass(m)), @"internalClass": NSStringFromClass(object_getClass(vpI))}];
+ for (NSString *vpK in @[@"fPropertyA", @"fPropertyA0", @"fPropertyA1", @"fPropertyB", @"fPropertyC", @"fPropertyD", @"fContinuousTimestamp", @"fAPArrivalTimestampSecs", @"fTimestamp", @"fNotifyAllClients", @"fRegisteredForNotifications", @"fClientID"]) {
+ NSObject *vpV = vpIv(vpI, vpK);
+ vpR[vpK] = vpV ?: [NSNull null];
+ }
+ vpR[@"fEventHandlerSet"] = vpIv(vpI, @"fEventHandler");
+ return vpR;
+};
+Class vpMPM = NSClassFromString(@"CMMagicPoseManager");
+Class vpDSMC = NSClassFromString(@"CMDeviceStateManager");
+Class vpAMC = NSClassFromString(@"CMAngleManager");
+vpAdd(@"CMMagicPoseManager.isAvailable", @"private", @"+[CMMagicPoseManager isAvailable]", vpMPM ? @(((BOOL (*)(id, SEL))objc_msgSend)(vpMPM, @selector(isAvailable))) : nil, vpMPM ? nil : @"class missing");
+NSObject *vpShared = vpMPM ? ((id (*)(id, SEL))objc_msgSend)(vpMPM, @selector(sharedManager)) : nil;
+vpAdd(@"CMMagicPoseManager.sharedManager", @"private", @"+[CMMagicPoseManager sharedManager] class", vpShared ? NSStringFromClass(object_getClass(vpShared)) : nil, vpShared ? nil : @"nil");
+if (vpShared) {
+ vpAdd(@"CMMagicPoseManager.sharedManager._manager", @"private", @"[[CMMagicPoseManager sharedManager] valueForKey:@\"_manager\"] (CMDeviceStateManager and its _internal ivars)", vpDSM(vpIv(vpShared, @"_manager")), nil);
+ vpAdd(@"CMMagicPoseManager.sharedManager.handlers", @"private", @"[[CMMagicPoseManager sharedManager] valueForKey:@\"fClientHandler\"/@\"fInternalHandler\"] != nil",
+ @{@"fClientHandlerSet": vpIv(vpShared, @"fClientHandler"), @"fInternalHandlerSet": vpIv(vpShared, @"fInternalHandler")}, nil);
+}
+if ([vpApp respondsToSelector:NSSelectorFromString(@"devicePoseProvider")]) {
+ NSObject *vpProv = [vpApp valueForKey:@"_devicePoseProvider"];
+ NSObject *vpPM = [vpProv valueForKey:@"_cmMagicPoseManager"];
+ vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager._manager", @"private", @"[[provider valueForKey:@\"_cmMagicPoseManager\"] valueForKey:@\"_manager\"] (CMDeviceStateManager and its _internal ivars)", vpDSM(vpIv(vpPM, @"_manager")), nil);
+ vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager.handlers", @"private", @"[provider._cmMagicPoseManager valueForKey:@\"fClientHandler\"/@\"fInternalHandler\"] != nil",
+ @{@"fClientHandlerSet": vpIv(vpPM, @"fClientHandler"), @"fInternalHandlerSet": vpIv(vpPM, @"fInternalHandler")}, nil);
+ NSObject *vpAM = [vpProv valueForKey:@"_cmAngleManager"];
+ vpAdd(@"SBFDevicePoseProvider._cmAngleManager.isAngleActive", @"private", @"[provider._cmAngleManager isAngleActive]", @(((BOOL (*)(id, SEL))objc_msgSend)(vpAM, @selector(isAngleActive))), nil);
+ vpAdd(@"SBFDevicePoseProvider._cmAngleManager.angleUpdateInterval", @"private", @"[provider._cmAngleManager angleUpdateInterval]", @(((double (*)(id, SEL))objc_msgSend)(vpAM, @selector(angleUpdateInterval))), nil);
+ NSObject *vpAI = vpIv(vpAM, @"_internal");
+ vpAdd(@"SBFDevicePoseProvider._cmAngleManager._internal", @"private", @"[provider._cmAngleManager valueForKey:@\"_internal\"] (_angleUpdateInterval, fHandler set)",
+ vpAI ? @{@"class": NSStringFromClass(object_getClass(vpAI)), @"_angleUpdateInterval": vpIv(vpAI, @"_angleUpdateInterval") ?: [NSNull null]} : nil, vpAI ? nil : @"nil");
+}
+vpAdd(@"CMDeviceStateManager.isAvailable", @"private", @"+[CMDeviceStateManager isAvailable]", vpDSMC ? @(((BOOL (*)(id, SEL))objc_msgSend)(vpDSMC, @selector(isAvailable))) : nil, vpDSMC ? nil : @"class missing");
+NSObject *vpDSShared = vpDSMC ? ((id (*)(id, SEL))objc_msgSend)(vpDSMC, @selector(sharedManager)) : nil;
+vpAdd(@"CMDeviceStateManager.sharedManager", @"private", @"+[CMDeviceStateManager sharedManager] (and its _internal ivars)", vpDSM(vpDSShared), vpDSShared ? nil : @"nil");
+if (vpDSShared) {
+ NSObject *vpCur = ((id (*)(id, SEL))objc_msgSend)(vpDSShared, @selector(currentDeviceState));
+ vpAdd(@"CMDeviceStateManager.currentDeviceState", @"private", @"-[[CMDeviceStateManager sharedManager] currentDeviceState]", vpEvt(vpCur), vpCur ? nil : @"nil");
+ if (vpCur) {
+ NSMutableDictionary *vpPA = [NSMutableDictionary dictionary];
+ for (long long vc = 0; vc <= 4; vc++) vpPA[[NSString stringWithFormat:@"%lld", vc]] = @(((long long (*)(id, SEL, id, long long))objc_msgSend)(vpDSMC, @selector(propertyAForDeviceState:configType:), vpCur, vc));
+ vpAdd(@"CMDeviceStateManager.propertyAForDeviceState:configType:", @"private", @"+[CMDeviceStateManager propertyAForDeviceState:<currentDeviceState> configType:0..4]", vpPA, nil);
+ }
+}
+vpAdd(@"CMAngleManager.isAvailable", @"private", @"+[CMAngleManager isAvailable]", vpAMC ? @(((BOOL (*)(id, SEL))objc_msgSend)(vpAMC, @selector(isAvailable))) : nil, vpAMC ? nil : @"class missing");
+if (vpAMC) {
+ vpAdd(@"CMAngleManager.minAngleDegrees", @"private", @"+[CMAngleManager minAngleDegrees]", @(((float (*)(id, SEL))objc_msgSend)(vpAMC, @selector(minAngleDegrees))), nil);
+ vpAdd(@"CMAngleManager.maxAngleDegrees", @"private", @"+[CMAngleManager maxAngleDegrees]", @(((float (*)(id, SEL))objc_msgSend)(vpAMC, @selector(maxAngleDegrees))), nil);
+ vpAdd(@"CMAngleManager.shouldEmitWakeLatencySignpostsOnStateChangeForTesting", @"private", @"+[CMAngleManager shouldEmitWakeLatencySignpostsOnStateChangeForTesting]", @(((BOOL (*)(id, SEL))objc_msgSend)(vpAMC, @selector(shouldEmitWakeLatencySignpostsOnStateChangeForTesting))), nil);
+ NSObject *vpAMNew = ((id (*)(id, SEL))objc_msgSend)(((id (*)(id, SEL))objc_msgSend)(vpAMC, @selector(alloc)), @selector(init));
+ vpAdd(@"CMAngleManager.isAngleActive", @"private", @"[[CMAngleManager alloc] init].isAngleActive (fresh instance, no updates started)", @(((BOOL (*)(id, SEL))objc_msgSend)(vpAMNew, @selector(isAngleActive))), nil);
+ vpAdd(@"CMAngleManager.angleUpdateInterval", @"private", @"[[CMAngleManager alloc] init].angleUpdateInterval (fresh instance)", @(((double (*)(id, SEL))objc_msgSend)(vpAMNew, @selector(angleUpdateInterval))), nil);
+}
+Class vpFAM = NSClassFromString(@"CMFactoryAngleManager");
+vpAdd(@"CMFactoryAngleManager.isAvailable", @"private", @"+[CMFactoryAngleManager isAvailable]", nil, vpFAM ? @"not called: raised SIGABRT in SpringBoard when probed (raw/sensors/test/bisect.txt)" : @"class missing");
+Class vpMMC = NSClassFromString(@"CMMotionManager");
+NSObject *vpMM = vpMMC ? ((id (*)(id, SEL))objc_msgSend)(((id (*)(id, SEL))objc_msgSend)(vpMMC, @selector(alloc)), @selector(init)) : nil;
+for (NSString *vpK in @[@"isAccelerometerAvailable", @"isGyroAvailable", @"isMagnetometerAvailable", @"isDeviceMotionAvailable"]) {
+ vpAdd([@"CMMotionManager." stringByAppendingString:vpK], @"public", [NSString stringWithFormat:@"[[CMMotionManager alloc] init].%@", vpK], vpMM ? @(((BOOL (*)(id, SEL))objc_msgSend)(vpMM, NSSelectorFromString(vpK))) : nil, vpMM ? nil : @"nil");
+}
+vpAdd(@"CMMotionManager.availableAttitudeReferenceFrames", @"public", @"+[CMMotionManager availableAttitudeReferenceFrames]", vpMMC ? @(((unsigned long (*)(id, SEL))objc_msgSend)(vpMMC, @selector(availableAttitudeReferenceFrames))) : nil, nil);
+NSDictionary *vpOut = @{@"group": @"coremotion", @"orientation": @(vpOrient), @"records": vpRecs};
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes-backboardd.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes-backboardd.lldb
new file mode 100644
index 00000000..42345561
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes-backboardd.lldb
@@ -0,0 +1,25 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpNames = @[@"SimHIDVirtualService", @"SimHIDVirtualServiceManager", @"SimHIDVirtualServicePropertyProvider", @"SimHIDVirtualServiceSimulatorUpstreamProvider", @"BKHIDSystem", @"BKHIDEventProcessorRegistry", @"BKHIDVendorDefinedEventProcessor", @"CMSensorMonitorSimulator", @"CMSensorMonitorSimulatorProxy", @"CMFactoryAngleManager", @"HIDEventSystemClient", @"HIDServiceClient"];
+for (NSString *vpN in vpNames) {
+ Class vpC = NSClassFromString(vpN);
+ if (!vpC) { [vpOut appendFormat:@"=== %@: MISSING\n", vpN]; continue; }
+ Dl_info vpInfo; dladdr((__bridge void *)vpC, &vpInfo);
+ [vpOut appendFormat:@"=== %@ super=%@ image=%s\n", vpN, NSStringFromClass(class_getSuperclass(vpC)), vpInfo.dli_fname];
+ for (int vk = 0; vk < 2; vk++) {
+ Class vpT = vk ? object_getClass(vpC) : vpC;
+ unsigned int vpCount = 0; Method *vpM = class_copyMethodList(vpT, &vpCount);
+ for (unsigned int vj = 0; vj < vpCount; vj++) {
+ [vpOut appendFormat:@" %s%s %s\n", vk ? "+" : "-", sel_getName(method_getName(vpM[vj])), method_getTypeEncoding(vpM[vj])];
+ }
+ free(vpM);
+ }
+ unsigned int vpIC = 0; Ivar *vpIv = class_copyIvarList(vpC, &vpIC);
+ for (unsigned int vj = 0; vj < vpIC; vj++) [vpOut appendFormat:@" ivar %s %s\n", ivar_getName(vpIv[vj]), ivar_getTypeEncoding(vpIv[vj])];
+ free(vpIv);
+ unsigned int vpPC = 0; objc_property_t *vpPr = class_copyPropertyList(vpC, &vpPC);
+ for (unsigned int vj = 0; vj < vpPC; vj++) [vpOut appendFormat:@" prop %s %s\n", property_getName(vpPr[vj]), property_getAttributes(vpPr[vj])];
+ free(vpPr);
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes.lldb
new file mode 100644
index 00000000..acba7beb
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes.lldb
@@ -0,0 +1,25 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpNames = @[@"CMMagicPoseManager", @"CMDeviceStateEvent", @"CMAngleManager", @"CMHingeAngleManager", @"CMMagicPose", @"CMDeviceState", @"CMDeviceStateManager", @"SBFDevicePoseProvider", @"SBFDevicePose", @"SBFHingeState", @"UIDevice", @"UIHingeInteraction", @"_UISceneHingeStateClientComponent", @"_UIHingeState", @"SBFDisplayContentModeResolver", @"SBFHingeStateMachine", @"CMMotionManager", @"CMDeviceMotion", @"CMAngleData", @"CMHingeAngle"];
+for (NSString *vpN in vpNames) {
+ Class vpC = NSClassFromString(vpN);
+ if (!vpC) { [vpOut appendFormat:@"=== %@: MISSING\n", vpN]; continue; }
+ Dl_info vpInfo; dladdr((__bridge void *)vpC, &vpInfo);
+ [vpOut appendFormat:@"=== %@ super=%@ image=%s\n", vpN, NSStringFromClass(class_getSuperclass(vpC)), vpInfo.dli_fname];
+ for (int vk = 0; vk < 2; vk++) {
+ Class vpT = vk ? object_getClass(vpC) : vpC;
+ unsigned int vpCount = 0; Method *vpM = class_copyMethodList(vpT, &vpCount);
+ for (unsigned int vj = 0; vj < vpCount; vj++) {
+ [vpOut appendFormat:@" %s%s %s\n", vk ? "+" : "-", sel_getName(method_getName(vpM[vj])), method_getTypeEncoding(vpM[vj])];
+ }
+ free(vpM);
+ }
+ unsigned int vpIC = 0; Ivar *vpIv = class_copyIvarList(vpC, &vpIC);
+ for (unsigned int vj = 0; vj < vpIC; vj++) [vpOut appendFormat:@" ivar %s %s\n", ivar_getName(vpIv[vj]), ivar_getTypeEncoding(vpIv[vj])];
+ free(vpIv);
+ unsigned int vpPC = 0; objc_property_t *vpPr = class_copyPropertyList(vpC, &vpPC);
+ for (unsigned int vj = 0; vj < vpPC; vj++) [vpOut appendFormat:@" prop %s %s\n", property_getName(vpPr[vj]), property_getAttributes(vpPr[vj])];
+ free(vpPr);
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes2.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes2.lldb
new file mode 100644
index 00000000..bde6e8ab
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classes2.lldb
@@ -0,0 +1,25 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpNames = @[@"CMAngle", @"CMMagicPoseEvent", @"CMAngleManagerInternal", @"CMDeviceStateManagerInternal", @"SBFSyntheticCMAngle", @"SBFSyntheticMagicPoseEvent", @"SBFDevicePoseDefaults", @"SBFDevicePosePTSettings", @"UIHinge", @"_UISceneHingeState", @"_UISceneHingeStateHostComponent", @"_UISceneHingeStateSettings", @"_UISceneHingeStateClientSettings", @"SBHingeMotionUnintendedInteractionMonitor", @"PUIHingeState", @"SBFHingeSweep", @"UIHingeInteractionUpdate", @"_UIApplicationHingeStateWaiter", @"BKSAccelerometer"];
+for (NSString *vpN in vpNames) {
+ Class vpC = NSClassFromString(vpN);
+ if (!vpC) { [vpOut appendFormat:@"=== %@: MISSING\n", vpN]; continue; }
+ Dl_info vpInfo; dladdr((__bridge void *)vpC, &vpInfo);
+ [vpOut appendFormat:@"=== %@ super=%@ image=%s\n", vpN, NSStringFromClass(class_getSuperclass(vpC)), vpInfo.dli_fname];
+ for (int vk = 0; vk < 2; vk++) {
+ Class vpT = vk ? object_getClass(vpC) : vpC;
+ unsigned int vpCount = 0; Method *vpM = class_copyMethodList(vpT, &vpCount);
+ for (unsigned int vj = 0; vj < vpCount; vj++) {
+ [vpOut appendFormat:@" %s%s %s\n", vk ? "+" : "-", sel_getName(method_getName(vpM[vj])), method_getTypeEncoding(vpM[vj])];
+ }
+ free(vpM);
+ }
+ unsigned int vpIC = 0; Ivar *vpIv = class_copyIvarList(vpC, &vpIC);
+ for (unsigned int vj = 0; vj < vpIC; vj++) [vpOut appendFormat:@" ivar %s %s\n", ivar_getName(vpIv[vj]), ivar_getTypeEncoding(vpIv[vj])];
+ free(vpIv);
+ unsigned int vpPC = 0; objc_property_t *vpPr = class_copyPropertyList(vpC, &vpPC);
+ for (unsigned int vj = 0; vj < vpPC; vj++) [vpOut appendFormat:@" prop %s %s\n", property_getName(vpPr[vj]), property_getAttributes(vpPr[vj])];
+ free(vpPr);
+}
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classnames-daemon.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classnames-daemon.lldb
new file mode 100644
index 00000000..6a63bd16
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classnames-daemon.lldb
@@ -0,0 +1,19 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+unsigned int vpCount = 0;
+Class *vpAll = objc_copyClassList(&vpCount);
+NSMutableArray *vpHits = [NSMutableArray array];
+for (unsigned int vi = 0; vi < vpCount; vi++) {
+ const char *vpN = class_getName(vpAll[vi]);
+ NSString *vpS = [NSString stringWithUTF8String:vpN];
+ NSString *vpL = [vpS lowercaseString];
+ if ([vpL containsString:@"hinge"] || [vpL containsString:@"magicpose"] || [vpL containsString:@"devicepose"] || [vpL containsString:@"devicestate"] || [vpL containsString:@"posture"] || [vpL containsString:@"angle"] || [vpL containsString:@"fold"] || [vpL hasPrefix:@"bkhid"] || [vpL containsString:@"hidvirtual"] || [vpL hasPrefix:@"hidevent"] || [vpL hasPrefix:@"hidservice"] || [vpL containsString:@"simulator"] || [vpL containsString:@"indigo"]) {
+ Dl_info vpInfo; dladdr((__bridge void *)vpAll[vi], &vpInfo);
+ NSString *vpB = [[NSString stringWithUTF8String:vpInfo.dli_fname] lastPathComponent];
+ [vpHits addObject:[NSString stringWithFormat:@"%@ (%@)", vpS, vpB]];
+ }
+}
+free(vpAll);
+[vpHits sortUsingSelector:@selector(compare:)];
+[vpHits componentsJoinedByString:@"\n"]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classnames.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classnames.lldb
new file mode 100644
index 00000000..5e55034b
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-classnames.lldb
@@ -0,0 +1,19 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+unsigned int vpCount = 0;
+Class *vpAll = objc_copyClassList(&vpCount);
+NSMutableArray *vpHits = [NSMutableArray array];
+for (unsigned int vi = 0; vi < vpCount; vi++) {
+ const char *vpN = class_getName(vpAll[vi]);
+ NSString *vpS = [NSString stringWithUTF8String:vpN];
+ NSString *vpL = [vpS lowercaseString];
+ if ([vpL containsString:@"hinge"] || [vpL containsString:@"magicpose"] || [vpL containsString:@"devicepose"] || [vpL containsString:@"devicestate"] || [vpL containsString:@"posture"] || [vpL containsString:@"tabletop"] || [vpL containsString:@"foldab"] || [vpL containsString:@"cmangle"] || [vpL containsString:@"flipstate"] || ([vpL containsString:@"fold"] && ![vpL containsString:@"folder"])) {
+ Dl_info vpInfo; dladdr((__bridge void *)vpAll[vi], &vpInfo);
+ NSString *vpB = [[NSString stringWithUTF8String:vpInfo.dli_fname] lastPathComponent];
+ [vpHits addObject:[NSString stringWithFormat:@"%@ (%@)", vpS, vpB]];
+ }
+}
+free(vpAll);
+[vpHits sortUsingSelector:@selector(compare:)];
+[vpHits componentsJoinedByString:@"\n"]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-selectors.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-selectors.lldb
new file mode 100644
index 00000000..7057a554
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-discover-selectors.lldb
@@ -0,0 +1,51 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpNames = @[@"UIApplication", @"UIScene", @"UIWindowScene", @"UIScreen", @"FBSScene", @"FBSSceneSettings", @"UIWindow", @"UITraitCollection", @"SpringBoard", @"SBWindowScene", @"BKSAccelerometer", @"SBDisplayToolServiceCoordinator", @"FBSDisplayConfiguration", @"_UISceneHingeStateExtension", @"_UISceneHingeStateConfiguration", @"UIHinge"];
+NSRegularExpression *vpRe = [NSRegularExpression regularExpressionWithPattern:@"hinge|pose|fold|tabletop|posture|magic|flip|surface|cover|inner" options:NSRegularExpressionCaseInsensitive error:nil];
+for (NSString *vpN in vpNames) {
+ Class vpC = NSClassFromString(vpN);
+ if (!vpC) { [vpOut appendFormat:@"=== %@: MISSING\n", vpN]; continue; }
+ [vpOut appendFormat:@"=== %@\n", vpN];
+ for (int vk = 0; vk < 2; vk++) {
+ Class vpT = vk ? object_getClass(vpC) : vpC;
+ unsigned int vpCount = 0; Method *vpM = class_copyMethodList(vpT, &vpCount);
+ for (unsigned int vj = 0; vj < vpCount; vj++) {
+ NSString *vpS = NSStringFromSelector(method_getName(vpM[vj]));
+ if ([vpRe numberOfMatchesInString:vpS options:0 range:NSMakeRange(0, vpS.length)])
+ [vpOut appendFormat:@" %s%@ %s\n", vk ? "+" : "-", vpS, method_getTypeEncoding(vpM[vj])];
+ }
+ free(vpM);
+ }
+ unsigned int vpIC = 0; Ivar *vpIv = class_copyIvarList(vpC, &vpIC);
+ for (unsigned int vj = 0; vj < vpIC; vj++) {
+ NSString *vpS = [NSString stringWithUTF8String:ivar_getName(vpIv[vj])];
+ if ([vpRe numberOfMatchesInString:vpS options:0 range:NSMakeRange(0, vpS.length)]) [vpOut appendFormat:@" ivar %@ %s\n", vpS, ivar_getTypeEncoding(vpIv[vj])];
+ }
+ free(vpIv);
+}
+id vpApp = [UIApplication sharedApplication];
+id vpProv = [[[vpApp valueForKey:@"_displayToolService"] valueForKey:@"_swapCoordinator"] valueForKey:@"_devicePoseProvider"];
+[vpOut appendString:@"=== holders of the SBFDevicePoseProvider among SpringBoard ivars\n"];
+for (Class vpC = object_getClass(vpApp); vpC; vpC = class_getSuperclass(vpC)) {
+ unsigned int vpIC = 0; Ivar *vpIv = class_copyIvarList(vpC, &vpIC);
+ for (unsigned int vj = 0; vj < vpIC; vj++) {
+ const char *vpT = ivar_getTypeEncoding(vpIv[vj]);
+ if (vpT[0] != '@') continue;
+ id vpV = object_getIvar(vpApp, vpIv[vj]);
+ if (!vpV) continue;
+ if (vpV == vpProv) [vpOut appendFormat:@" %@.%s == provider\n", NSStringFromClass(vpC), ivar_getName(vpIv[vj])];
+ else {
+ unsigned int vpIC2 = 0; Ivar *vpIv2 = class_copyIvarList(object_getClass(vpV), &vpIC2);
+ for (unsigned int vq = 0; vq < vpIC2; vq++) {
+ if (ivar_getTypeEncoding(vpIv2[vq])[0] != '@') continue;
+ if (object_getIvar(vpV, vpIv2[vq]) == vpProv) [vpOut appendFormat:@" %@.%s(%@).%s == provider\n", NSStringFromClass(vpC), ivar_getName(vpIv[vj]), NSStringFromClass(object_getClass(vpV)), ivar_getName(vpIv2[vq])];
+ }
+ free(vpIv2);
+ }
+ }
+ free(vpIv);
+}
+[vpOut appendFormat:@"provider observers: %@\n", [(NSObject *)[[vpProv valueForKey:@"_observers"] allObjects] description]];
+[vpOut appendFormat:@"likelyTransitionDelegate: %@\n", [(NSObject *)[vpProv valueForKey:@"_likelyTransitionDelegate"] description]];
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-identity.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-identity.lldb
new file mode 100644
index 00000000..cd7d986a
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-identity.lldb
@@ -0,0 +1,58 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSArray *vpKeys = @[@"720p", @"ADSCapability", @"ASTC", @"AV1DecodingCapability", @"AWDLCapability", @"AccelerometerCapability", @"AggregateDevicePhotoZoomFactor", @"AggregateDeviceVideoZoomFactor", @"AirDropCapability", @"AirplayMirroringCapability", @"AlwaysOnDisplayMaxMemory", @"AppleDisplay", @"AppleNeuralEngineSubtype", @"ArrowChipID", @"ArtworkDeviceIdiom", @"ArtworkDeviceProductDescription", @"ArtworkDeviceScaleFactor", @"ArtworkDeviceSubType", @"ArtworkDisplayGamut", @"ArtworkDynamicDisplayMode", @"ArtworkTraitDisplayGamut", @"ArtworkTraits", @"AudioExclaveMicInputCapability", @"AudioPlaybackCapability", @"AvailableDisplayZoomSizes", @"BacklightCapability", @"BasebandChipID", @"BoardId", @"BuildVersion", @"CPUArchitecture", @"CPUSubType", @"CPUType", @"CameraFrontFlashCapability", @"CameraHDR2Capability", @"CameraLiveEffectsCapability", @"CarrierInstallCapability", @"CellularTelephonyCapability", @"CertificateProductionStatus", @"ChipID", @"CloudPhotoLibraryCapability", @"CoastlineGlowRenderingCapability", @"ContinuityCapability", @"CoreRoutineCapability", @"DeviceBrand", @"DeviceClass", @"DeviceClassNumber", @"DeviceColor", @"DeviceColorMapPolicy", @"DeviceCornerRadius", @"DeviceCoverGlassCoating", @"DeviceCoverGlassColor", @"DeviceCoverGlassMaterial", @"DeviceCoverMaterial", @"DeviceEnclosureColor", @"DeviceEnclosureMaterial", @"DeviceEnclosureRGBColor", @"DeviceHasAggregateCamera", @"DeviceHasEmbeddedSIMOnlyBoard", @"DeviceHasHinge", @"DeviceHasNAN", @"DeviceHousingColor", @"DeviceHousingColorUncooked", @"DeviceIsFoldable", @"DeviceIsMuseCapable", @"DeviceIsNED", @"DeviceIsPortableMac", @"DeviceLaunchTimeLimitScale", @"DeviceMemorySize", @"DeviceName", @"DevicePerformanceMemoryClass", @"DevicePrefers3DBuildingStrokes", @"DevicePrefersBuildingStrokes", @"DevicePrefersCheapTrafficShaders", @"DevicePrefersProceduralAntiAliasing", @"DevicePrefersTrafficAlpha", @"DeviceProximityCapability", @"DeviceRequiresPetalOptimization", @"DeviceRequiresProximityAmeliorations", @"DeviceRequiresSoftwareBrightnessCalculations", @"DeviceSceneUpdateTimeLimitScale", @"DeviceSupports1080p", @"DeviceSupports3DImagery", @"DeviceSupports3DMaps", @"DeviceSupports3rdPartyHaptics", @"DeviceSupports4G", @"DeviceSupports4k", @"DeviceSupports720p", @"DeviceSupports80ChargeLimit", @"DeviceSupports9Pin", @"DeviceSupportsAODVibrancy", @"DeviceSupportsAOP", @"DeviceSupportsAOP2", @"DeviceSupportsASTC", @"DeviceSupportsAbsoluteAltimeter", @"DeviceSupportsAbsoluteDepth", @"DeviceSupportsActionAfterPowerConnect", @"DeviceSupportsActiveNFCReadingOnly", @"DeviceSupportsAdaptiveMapsUI", @"DeviceSupportsAdvancedMapRendering", @"DeviceSupportsAdvancedVoiceProcessorChatFlavor", @"DeviceSupportsAlmond", @"DeviceSupportsAlwaysAPVoiceTrigger", @"DeviceSupportsAlwaysListening", @"DeviceSupportsAlwaysListeningHeySiri", @"DeviceSupportsAlwaysOnCompass", @"DeviceSupportsAlwaysOnDisplay", @"DeviceSupportsAlwaysOnDisplayFlipbook", @"DeviceSupportsAlwaysOnTime", @"DeviceSupportsApplePencil", @"DeviceSupportsAudioIntelligence", @"DeviceSupportsAutoDim", @"DeviceSupportsAutoLowLightVideo", @"DeviceSupportsAvatars", @"DeviceSupportsBatteryInformation", @"DeviceSupportsBatteryModuleAuthentication", @"DeviceSupportsBeacon", @"DeviceSupportsBerkelium2", @"DeviceSupportsBootChime", @"DeviceSupportsBreathingDisturbancesMeasurements", @"DeviceSupportsBrook", @"DeviceSupportsCCK", @"DeviceSupportsCameraCaptureOnTouchDown", @"DeviceSupportsCameraDeferredProcessing", @"DeviceSupportsCameraHaptics", @"DeviceSupportsCarIntegration", @"DeviceSupportsClosedLoopHaptics", @"DeviceSupportsCollisionSOS", @"DeviceSupportsCompassOrienteering", @"DeviceSupportsConcurrentHPLPMics", @"DeviceSupportsContextualVolume", @"DeviceSupportsContinuousHeartRate", @"DeviceSupportsCorrectedTemperature", @"DeviceSupportsCrudeProx", @"DeviceSupportsCyclingAutoStartReminders", @"DeviceSupportsDCP", @"DeviceSupportsDClr", @"DeviceSupportsDarwinInitConfigFromNVRAM", @"DeviceSupportsDisplayPort", @"DeviceSupportsDoNotDisturbWhileDriving", @"DeviceSupportsDualDisplay", @"DeviceSupportsDynamicEndOfCharge", @"DeviceSupportsDynamicEndOfChargeLegacyHW", @"DeviceSupportsDynamicIsland", @"DeviceSupportsELabel", @"DeviceSupportsEUCapabilities", @"DeviceSupportsElton", @"DeviceSupportsEnhancedAC3", @"DeviceSupportsEnhancedMultitasking", @"DeviceSupportsEnvironmentalDosimetry", @"DeviceSupportsExternalHDR", @"DeviceSupportsFairPlaySecureVideoPath", @"DeviceSupportsFindApplePencil", @"DeviceSupportsFloorCounting", @"DeviceSupportsFoldable", @"DeviceSupportsFrameSynchronousBrightness", @"DeviceSupportsGammaContrastPreservation", @"DeviceSupportsGenerativeModelSystems", @"DeviceSupportsGrayDimming", @"DeviceSupportsGrey", @"DeviceSupportsHDRDeferredProcessing", @"DeviceSupportsHDRPhotoDisplay", @"DeviceSupportsHandwritingSynthesisModel", @"DeviceSupportsHaptics", @"DeviceSupportsHardwareDetents", @"DeviceSupportsHeartHealthAlerts", @"DeviceSupportsHeartRateVariability", @"DeviceSupportsHiResBuildings", @"DeviceSupportsHighLuminanceAlwaysOnDisplay", @"DeviceSupportsHypertensivePatternMeasurements", @"DeviceSupportsIndependentOutputOnSpeaker", @"DeviceSupportsInductiveCharging", @"DeviceSupportsInstructionFollowingPruningModels", @"DeviceSupportsLaguna", @"DeviceSupportsLandscapeFaceID", @"DeviceSupportsLanguageDownloadUI", @"DeviceSupportsLineIn", @"DeviceSupportsLiveActivities", @"DeviceSupportsLivePhotoAuto", @"DeviceSupportsLiveVideoRendering", @"DeviceSupportsLongFormAudio", @"DeviceSupportsLowLatency", @"DeviceSupportsLowPowerSoundClassification", @"DeviceSupportsLowPowerWake", @"DeviceSupportsMTP", @"DeviceSupportsMapsBlurredUI", @"DeviceSupportsMapsOpticalHeading", @"DeviceSupportsMomentCapture", @"DeviceSupportsMultiUser", @"DeviceSupportsNFC", @"DeviceSupportsNavigation", @"DeviceSupportsNewton", @"DeviceSupportsOnDemandPhotoAnalysis", @"DeviceSupportsP3ColorspaceVideoRecording", @"DeviceSupportsPeriodicALSUpdates", @"DeviceSupportsPersonalTranslator", @"DeviceSupportsPhotosInpainting", @"DeviceSupportsPhotosLocalLight", @"DeviceSupportsPortraitIntensityAdjustments", @"DeviceSupportsPortraitLightEffectFilters", @"DeviceSupportsPulseWidthMaximization", @"DeviceSupportsRGB10", @"DeviceSupportsRaiseToSpeak", @"DeviceSupportsRegionalCameraShutterRelaxation", @"DeviceSupportsReverseZoom", @"DeviceSupportsSandcat", @"DeviceSupportsSecureDoubleClick", @"DeviceSupportsSecureMicrophone", @"DeviceSupportsSiDP", @"DeviceSupportsSideButtonClickSpeed", @"DeviceSupportsSimplisticRoadMesh", @"DeviceSupportsSingleCameraPortrait", @"DeviceSupportsSingleDisplayEnhancedMultitasking", @"DeviceSupportsSiriBargeIn", @"DeviceSupportsSiriHub", @"DeviceSupportsSiriSpeaks", @"DeviceSupportsSiriSpokenMessages", @"DeviceSupportsSiriUnderstandingOnDevice", @"DeviceSupportsSpatialAudioCapture", @"DeviceSupportsSpatialFaceTimeAudioPlayback", @"DeviceSupportsSpatialOverCapture", @"DeviceSupportsStageLightPortraitPreview", @"DeviceSupportsStereoAudioRecording", @"DeviceSupportsStudioLightPortraitPreview", @"DeviceSupportsSwimmingWorkouts", @"DeviceSupportsTapToWake", @"DeviceSupportsTelephonyOverUSB", @"DeviceSupportsTethering", @"DeviceSupportsThunderbolt", @"DeviceSupportsTimeInDaylight", @"DeviceSupportsToneMapping", @"DeviceSupportsTouchSensitiveCameraControl", @"DeviceSupportsUSBTypeCDisplay", @"DeviceSupportsUSLegallyCompliantBloodOxygen", @"DeviceSupportsUltraLowPowerNetworking", @"DeviceSupportsUnconditionalPluckItCollection", @"DeviceSupportsUntrustedRemoteSysdiagnose", @"DeviceSupportsVSHCompensation", @"DeviceSupportsVirtualResearchEnvironment", @"DeviceSupportsVoiceOverCanUseSiriVoice", @"DeviceSupportsWalkingRadiusAnimation", @"DeviceSupportsWatchSpeakerPlayback", @"DeviceSupportsWebkit", @"DeviceSupportsWirelessChargingEnergyUseNotification", @"DeviceSupportsWirelessSplitting", @"DeviceSupportsYCbCr10", @"DeviceSupportseARC", @"DeviceSurfaceType", @"DeviceVariant", @"DeviceVariantGuess", @"DisplayBootRotation", @"DisplayDriverICChipID", @"DisplayExtendedProperties", @"DisplayInactiveBrightnessClass", @"DisplayMaxNits", @"DisplayPort", @"DualSIMActivationPolicyCapable", @"EUICCChipID", @"EffectiveProductionStatusAp", @"EffectiveProductionStatusSEP", @"ExclaveCapability", @"ExpandedNits", @"ExpandedNitsFailureCount", @"ExternalChargeCapability", @"ExternalDisplayCapability", @"FaceTimeFrontCameraTemporalNoiseReductionMode", @"FirstPartyLaunchTimeLimitScale", @"FloatingLiveAppOverlay", @"ForwardCameraCapability", @"FrontCameraOffsetFromDisplayCenter", @"FrontCameraRotationForISP", @"FrontCameraRotationFromDisplayNormal", @"FrontFacingCameraAutoHDRCapability", @"FrontFacingCameraBurstCapability", @"FrontFacingCameraHDRCapability", @"FrontFacingCameraHDROnCapability", @"FrontFacingCameraHFRCapability", @"FrontFacingCameraHFRVideoCapture1080pMaxFPS", @"FrontFacingCameraHFRVideoCapture720pMaxFPS", @"FrontFacingCameraMaxVideoZoomFactor", @"FrontFacingCameraStageLightPortraitCaptureCapability", @"FrontFacingCameraSuperWideCameraCapability", @"FrontFacingCameraVariableFrameRateCapability", @"FrontFacingCameraVideoCapture1080pMaxFPS", @"FrontFacingCameraVideoCapture720pMaxFPS", @"FrontFacingLowLightCameraCapability", @"GPSCapability", @"GSDeviceName", @"GraphicsFeatureSetClass", @"GraphicsFeatureSetFallbacks", @"GyroscopeCapability", @"H264EncoderCapability", @"HEVCDecoder10bitSupported", @"HEVCDecoder12bitSupported", @"HEVCDecoder8bitSupported", @"HEVCEncodingCapability", @"HWModelDescriptionForAnalytics", @"HWModelDescriptionForAudio", @"HWModelDescriptionForAutomatedTesting", @"HWModelDescriptionForCamera", @"HWModelDescriptionForPowerPerf", @"HWModelDescriptionForUserVisibility", @"HWModelStr", @"HWModelUniqueStr", @"HardwarePlatform", @"HasExtendedColorDisplay", @"HasPartiallyOccludedDisplay", @"HasSpringBoard", @"HasThinBezel", @"HearingAidAudioEqualizationCapability", @"HearingAidLowEnergyAudioCapability", @"HearingAidPowerReductionCapability", @"HingeCapability", @"HomeButtonType", @"HorsemanCapability", @"HumanReadableProductVersionString", @"IDAMCapability", @"IOSDIOProductInfo1", @"IOSurfaceFormatDictionary", @"IsEmulatedDevice", @"IsFoldable", @"IsLargeFormatPhone", @"IsSimulatedDevice", @"IsSimulator", @"IsVirtualDevice", @"LaunchTimeLimitScaleSupported", @"LisaCapability", @"LowPowerRendererCapability", @"MLEHW", @"MainDisplayRotation", @"MainScreenCanvasSizes", @"MainScreenClass", @"MainScreenScale", @"MarketingDeviceFamilyName", @"MarketingProductName", @"MarketingVersion", @"MaximumNitsToSnap", @"MaximumScreenScale", @"MedusaFloatingLiveAppCapability", @"MedusaOverlayAppCapability", @"MedusaPIPCapability", @"MedusaPinnedAppCapability", @"MetalPerfLevelCapability", @"ModelNumber", @"MultiTouchCapability", @"NikeIpodCapability", @"OLEDDisplay", @"OSMigrationCapability", @"OfflineDictationCapability", @"OysterCapability", @"PTPLargeFilesCapability", @"PanoramaCameraCapability", @"PearlCameraCapability", @"PearlIDCapability", @"PearlMotionDetectionCapability", @"PeekUICapability", @"PeekUIWidth", @"PerfLevelCapability", @"PersonalHotspotCapability", @"PhosphorusCapability", @"PhotoCapability", @"PhotosPostEffectsCapability", @"PiPOverlay", @"PiPPinned", @"PipelinedStillImageProcessingCapability", @"PlatinumCapability", @"ProductBuildVersion", @"ProductHash", @"ProductName", @"ProductType", @"ProductTypeDescForAnalytics", @"ProductTypeDescForAudio", @"ProductTypeDescForAutomatedTesting", @"ProductTypeDescForCamera", @"ProductTypeDescForPowerPerf", @"ProductTypeDescForUserVisibility", @"ProductVersion", @"ProductVersionExtra", @"QuickNoteCapability", @"RearALSCapability", @"RearCameraCapability", @"RearCameraOffsetFromDisplayCenter", @"RearFacingCamera60fpsVideoCaptureCapability", @"RearFacingCameraAutoHDRCapability", @"RearFacingCameraBurstCapability", @"RearFacingCameraFocusPixelCalibrationCapability", @"RearFacingCameraHDRCapability", @"RearFacingCameraHDROnCapability", @"RearFacingCameraHFRCapability", @"RearFacingCameraHFRVideoCapture1080pMaxFPS", @"RearFacingCameraHFRVideoCapture720pMaxFPS", @"RearFacingCameraMaxVideoZoomFactor", @"RearFacingCameraStageLightPortraitCaptureCapability", @"RearFacingCameraSuperWideCameraCapability", @"RearFacingCameraTimeOfFlightCameraCapability", @"RearFacingCameraVariableFrameRateCapability", @"RearFacingCameraVideoCapture1080pMaxFPS", @"RearFacingCameraVideoCapture720pMaxFPS", @"RearFacingLowLightCameraCapability", @"RearFacingTelephotoCameraCapability", @"ReceiveARCStreamOverAirPlayCapability", @"RegulatoryModelNumber", @"RenderWideGamutImagesAtDisplayTime", @"ResponsiveAirPlayAudioCapability", @"RingerButtonCapability", @"RoswellChipID", @"SavageChipID", @"ScaleToFit", @"ScreenCaptureHeight", @"ScreenCaptureWidth", @"ScreenDimensions", @"ScreenDimensionsCapability", @"ScreenRecorderCapability", @"SiKACapability", @"SiriGestureCapability", @"SiriOfflineCapability", @"SnapToNits", @"SpatialAudioProfileCapability", @"SphereCapability", @"StarkCapability", @"SubProductType", @"SupplementalBuildVersion", @"SupportedDeviceFamilies", @"SupportsForceTouch", @"TargetSubType", @"ThinningProductType", @"ThreadRadioCapability", @"TimeSyncCapability", @"TopModuleAuthChipID", @"TorpedoCapability", @"UIParallaxCapability", @"UIProceduralWallpaperCapability", @"VSHCompensationMinimumNits", @"VibratorCapability", @"VideoStillsCapability", @"WatchAppButtonCapability", @"WatchKeyboardCapability", @"WiFiCallingCapability", @"WifiCallingSecondaryDeviceCapability", @"WirelessChargingCapability", @"YonkersChipID", @"accelerometer", @"accessibility", @"always-on-device", @"always-on-device-flipbook", @"always-on-time", @"ambient-light-sensor", @"applicationInstallation", @"arm64", @"armv6", @"armv7", @"armv7s", @"bluetooth", @"bluetooth-le", @"cellular-data", @"contains-cellular-radio", @"cover-glass", @"cover-glass-material", @"device-name", @"device-name-localized", @"display-mirroring", @"displayGamut", @"displayport", @"displays", @"dynamicDisplayMode", @"encrypted-data-partition", @"full-6", @"gamekit", @"gas-gauge-battery", @"generative-model-systems", @"graphicsFeatureSetClass", @"graphicsFeatureSetFallbacks", @"gyroscope", @"hall-effect-sensor", @"hardware-keyboard", @"hide-non-default-apps", @"hidpi", @"homescreen-wallpaper", @"iAP2Capability", @"idiom", @"international-settings", @"ipad", @"kMGQDeviceSurfaceType", @"load-thumbnails-while-scrolling", @"location-services", @"magnetometer", @"main-screen-class", @"main-screen-height", @"main-screen-orientation", @"main-screen-pitch", @"main-screen-scale", @"main-screen-width", @"marketing-name", @"marketing-soc-name", @"marketing-software-behavior", @"memoryClass", @"metal", @"microphone", @"model-config", @"modelIdentifier", @"multitasking", @"multitasking-gestures", @"nativeOrientation", @"opengles-1", @"opengles-2", @"pearl-id", @"peer-peer", @"proximity-sensor", @"reverse-zoom", @"ringer-switch", @"scale", @"screen-capture-height", @"screen-capture-width", @"screen-dimensions", @"screenrecorder", @"shoebox", @"sms", @"software-dimming-alpha", @"stand-alone-contacts", @"subtype", @"telephony", @"touch-id", @"unified-ipod", @"unique-model", @"vm-supports-generative-models", @"watch-companion", @"wifi", @"zoomed"];
+id (*vpMG)(NSString *) = (id (*)(NSString *))dlsym(RTLD_DEFAULT, "MGCopyAnswer");
+for (NSString *vpK in vpKeys) {
+ id vpV = vpMG(vpK);
+ vpAdd([@"MGCopyAnswer." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"MGCopyAnswer(@\"%@\")", vpK], vpV, vpV ? nil : @"nil");
+}
+long long (*vpCount)(void) = (long long (*)(void))dlsym(RTLD_DEFAULT, "MGGetLogicalDeviceDisplayCount");
+long long vpN = vpCount ? vpCount() : -1;
+vpAdd(@"MGGetLogicalDeviceDisplayCount", @"private", @"MGGetLogicalDeviceDisplayCount()", vpCount ? @(vpN) : nil, vpCount ? nil : @"symbol missing");
+id (*vpMGD)(void *, long long, void *, void *) = (id (*)(void *, long long, void *, void *))dlsym(RTLD_DEFAULT, "MGCopyAnswerForDisplayAtIndex");
+for (NSString *vpQ in @[@"kMGDisplayIndexedQueryCameraButtonCGRect", @"kMGDisplayIndexedQueryCameraButtonNormalizedCGRect", @"kMGDisplayIndexedQueryFrontCameraOffsetFromDisplayCenter", @"kMGDisplayIndexedQueryRearCameraOffsetFromDisplayCenter", @"kMGDisplayIndexedQueryUserIntentPhysicalButtonCGRect", @"kMGDisplayIndexedQueryUserIntentPhysicalButtonNormalizedCGRect", @"kMGDisplayIndexedQueryVolumeDownButtonCGRect", @"kMGDisplayIndexedQueryVolumeDownButtonNormalizedCGRect", @"kMGDisplayIndexedQueryVolumeUpButtonCGRect", @"kMGDisplayIndexedQueryVolumeUpButtonNormalizedCGRect"]) {
+ void *vpSym = dlsym(RTLD_DEFAULT, vpQ.UTF8String);
+ for (long long vi = 0; vi < (vpN > 0 ? vpN : 0) + 1; vi++) {
+ id vpV = (vpMGD && vpSym) ? vpMGD(vpSym, vi, NULL, NULL) : nil;
+ vpAdd([@"MGCopyAnswerForDisplayAtIndex." stringByAppendingString:vpQ], @"private", [NSString stringWithFormat:@"MGCopyAnswerForDisplayAtIndex(&%@, %lld, NULL, NULL)", vpQ, vi], vpV ? @{@"index": @(vi), @"value": vpV} : nil, !vpSym ? @"symbol missing" : (vpV ? nil : [NSString stringWithFormat:@"nil at index %lld", vi]));
+ }
+}
+for (NSString *vpS in @[@"hw.model", @"hw.machine", @"hw.product", @"hw.target", @"hw.targettype", @"kern.osversion", @"kern.osproductversion", @"kern.osrelease", @"kern.ostype", @"kern.version", @"hw.cputype", @"hw.cpusubtype", @"hw.memsize", @"hw.ncpu", @"hw.physicalcpu", @"hw.optional.arm64", @"kern.hv_vmm_present", @"kern.bootargs"]) {
+ char vpBuf[1024]; size_t vpLen = sizeof(vpBuf); memset(vpBuf, 0, sizeof(vpBuf));
+ int vpRc = sysctlbyname(vpS.UTF8String, vpBuf, &vpLen, NULL, 0);
+ id vpV = nil;
+ if (vpRc == 0) {
+ if (vpLen == 4) vpV = @(*(int *)vpBuf);
+ else if (vpLen == 8 && ![vpS hasPrefix:@"hw.model"] && ![vpS hasPrefix:@"hw.machine"] && ![vpS hasPrefix:@"hw.product"] && ![vpS hasPrefix:@"hw.target"]) vpV = @(*(long long *)vpBuf);
+ else vpV = [NSString stringWithUTF8String:vpBuf];
+ }
+ vpAdd([@"sysctl." stringByAppendingString:vpS], @"public", [NSString stringWithFormat:@"sysctlbyname(\"%@\")", vpS], vpV, vpRc == 0 ? nil : [NSString stringWithFormat:@"rc=%d errno=%d", vpRc, errno]);
+}
+struct utsname vpU; uname(&vpU);
+vpAdd(@"uname", @"public", @"uname()", @{@"sysname": [NSString stringWithUTF8String:vpU.sysname], @"release": [NSString stringWithUTF8String:vpU.release], @"version": [NSString stringWithUTF8String:vpU.version], @"machine": [NSString stringWithUTF8String:vpU.machine]}, nil);
+NSDictionary *vpEnv = [[NSProcessInfo processInfo] environment];
+NSMutableDictionary *vpSimEnv = [NSMutableDictionary dictionary];
+for (NSString *vpK in vpEnv) if ([vpK hasPrefix:@"SIMULATOR_"] || [vpK hasPrefix:@"DYLD_"] || [vpK hasPrefix:@"CFFIXED"] || [vpK isEqualToString:@"IPHONE_SIMULATOR_ROOT"] || [vpK hasPrefix:@"XPC_SIMULATOR"]) vpSimEnv[vpK] = vpEnv[vpK];
+vpAdd(@"NSProcessInfo.environment[SIMULATOR_*]", @"public", @"[[NSProcessInfo processInfo] environment] filtered to SIMULATOR_*, DYLD_*, CFFIXED*, IPHONE_SIMULATOR_ROOT", vpSimEnv, nil);
+vpAdd(@"NSProcessInfo.operatingSystemVersionString", @"public", @"[[NSProcessInfo processInfo] operatingSystemVersionString]", [[NSProcessInfo processInfo] operatingSystemVersionString], nil);
+vpAdd(@"NSProcessInfo.isiOSAppOnMac", @"public", @"[[NSProcessInfo processInfo] isiOSAppOnMac]", @([[NSProcessInfo processInfo] isiOSAppOnMac]), nil);
+vpAdd(@"NSProcessInfo.isMacCatalystApp", @"public", @"[[NSProcessInfo processInfo] isMacCatalystApp]", @([[NSProcessInfo processInfo] isMacCatalystApp]), nil);
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSDictionary *vpOut = @{@"group": @"identity", @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-springboard.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-springboard.lldb
new file mode 100644
index 00000000..57095e7e
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-springboard.lldb
@@ -0,0 +1,136 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSString *(^vpD)(id) = ^NSString *(id o) { return o ? [(NSObject *)o description] : (NSString *)nil; };
+NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"];
+long vpOrient = ((UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"]).interfaceOrientation;
+struct VPRegion { double start; double end; BOOL isActive; BOOL canBecomeActive; };
+struct VPHinge { BOOL isAvailable; double position; long long state; struct VPRegion fullyClosed, closed, partiallyOpen, openFlat, foldAvoidance, toOpen, toClosed; BOOL isTransitioning; double transitionProgress, progressToSwap, progressFromSwap, continuousFoldPosition, velocity, acceleration; };
+struct VPUIHinge { BOOL isAvailable; long long status; long long magicPose; double hingeAngle; long long nextStatus; double progress; double timestamp; };
+struct VPCMAngle { float minAngleDegrees, maxAngleDegrees, angleDegrees, velocityDegreesPerSeconds; BOOL isAvailable; double timestamp; };
+struct VPCMMagic { long long deviceOrientation, deviceOrientationForCover, deviceOrientationForInner, tabletopPose, hingeState; BOOL progressValid; long long fromHingeState, toHingeState; double progressValue; BOOL isAvailable; double timestamp; };
+struct VPFlip { BOOL isAvailable, showYoinkingAffordance; };
+struct VPSettings { BOOL showDebugHUD, showDisplaySupport3Required, usesStrictCoreMotion, invertHingeAngles, continuousFoldEnabled; double closedToPartiallyOpenBoundary, partiallyOpenToOpenFlatBoundary, openTransitionBeginBoundary, closeTransitionBeginBoundary, transitionAutoCompleteDuration, velocitySmoothingFactor, enterFoldAvoidancePredictionWindow, sustainFoldAvoidancePredictionWindow; };
+struct VPInternal { BOOL isInitialized, forceStrictCoreMotion, invertHingeAngles, isOnVM, isDisplaySupport3Set, hingeRegionsAreDefault, needsTransitionAutocompletion; double transitionAutocompletionProgress, autocompleteStartTime, timestampOfLastTransitionProgressChange, transitionProgressWhenAutocompletionBegan, transitionSwapProgressWhenAutocompletionBegan, hingePositionWhenAutocompletionBegan; };
+struct VPDisplayTool { long long state; double duration; long long deviceOrientation, profileOverride; BOOL waitForCompletion; long long targetMode; double targetHingePosition, lockedForTestingUntil; };
+struct VPPose { long long orientation, coverOrientation, innerOrientation; struct VPHinge hinge; struct VPUIHinge uiHingeStatus; struct VPCMAngle cmAngle; struct VPCMMagic cmMagicPose; struct VPFlip flipState; struct VPSettings settings; struct VPInternal internal; struct VPDisplayTool displayTool; };
+struct VPBox { struct VPPose devicePose; double mechanicalAngleDegrees, autocompletionMinDelay, autocompletionMaxDelay, likelyToOpenVelocityDegreesPerSecond, swapDegreesForContinuousLiveStyle, swapDegreesForContinuousSnapshotStyleWhenOpening, swapDegreesForContinuousSnapshotStyleWhenClosing, swapDegreesForFadeInFadeOutStyle; long long transitionStyle; double autocompletionDelay, continuousFoldEffectProgress, continuousFoldEffectSettlingTarget; BOOL continuousFoldEffectIsSettling; };
+NSDictionary *(^vpRegion)(struct VPRegion) = ^NSDictionary *(struct VPRegion r) { return @{@"start": @(r.start), @"end": @(r.end), @"isActive": @(r.isActive), @"canBecomeActive": @(r.canBecomeActive)}; };
+NSDictionary *(^vpPoseDict)(struct VPPose) = ^NSDictionary *(struct VPPose p) {
+ return @{
+ @"orientation": @(p.orientation), @"coverOrientation": @(p.coverOrientation), @"innerOrientation": @(p.innerOrientation),
+ @"hinge": @{@"isAvailable": @(p.hinge.isAvailable), @"position": @(p.hinge.position), @"state": @(p.hinge.state),
+ @"fullyClosedRegion": vpRegion(p.hinge.fullyClosed), @"closedRegion": vpRegion(p.hinge.closed), @"partiallyOpenRegion": vpRegion(p.hinge.partiallyOpen),
+ @"openFlatRegion": vpRegion(p.hinge.openFlat), @"activateFoldAvoidanceRegion": vpRegion(p.hinge.foldAvoidance),
+ @"transitionToOpenRegion": vpRegion(p.hinge.toOpen), @"transitionToClosedRegion": vpRegion(p.hinge.toClosed),
+ @"isTransitioning": @(p.hinge.isTransitioning), @"transitionProgress": @(p.hinge.transitionProgress), @"progressToSwap": @(p.hinge.progressToSwap),
+ @"progressFromSwap": @(p.hinge.progressFromSwap), @"continuousFoldPosition": @(p.hinge.continuousFoldPosition), @"velocity": @(p.hinge.velocity), @"acceleration": @(p.hinge.acceleration)},
+ @"uiHingeStatus": @{@"isAvailable": @(p.uiHingeStatus.isAvailable), @"status": @(p.uiHingeStatus.status), @"magicPose": @(p.uiHingeStatus.magicPose), @"hingeAngle": @(p.uiHingeStatus.hingeAngle),
+ @"nextStatus": @(p.uiHingeStatus.nextStatus), @"progress": @(p.uiHingeStatus.progress), @"timestamp": @(p.uiHingeStatus.timestamp)},
+ @"cmAngle": @{@"minAngleDegrees": @(p.cmAngle.minAngleDegrees), @"maxAngleDegrees": @(p.cmAngle.maxAngleDegrees), @"angleDegrees": @(p.cmAngle.angleDegrees),
+ @"velocityDegreesPerSeconds": @(p.cmAngle.velocityDegreesPerSeconds), @"isAvailable": @(p.cmAngle.isAvailable), @"timestamp": @(p.cmAngle.timestamp)},
+ @"cmMagicPose": @{@"deviceOrientation": @(p.cmMagicPose.deviceOrientation), @"deviceOrientationForCover": @(p.cmMagicPose.deviceOrientationForCover),
+ @"deviceOrientationForInner": @(p.cmMagicPose.deviceOrientationForInner), @"tabletopPose": @(p.cmMagicPose.tabletopPose), @"hingeState": @(p.cmMagicPose.hingeState),
+ @"progressValid": @(p.cmMagicPose.progressValid), @"fromHingeState": @(p.cmMagicPose.fromHingeState), @"toHingeState": @(p.cmMagicPose.toHingeState),
+ @"progressValue": @(p.cmMagicPose.progressValue), @"isAvailable": @(p.cmMagicPose.isAvailable), @"timestamp": @(p.cmMagicPose.timestamp)},
+ @"flipState": @{@"isAvailable": @(p.flipState.isAvailable), @"showYoinkingAffordance": @(p.flipState.showYoinkingAffordance)},
+ @"settings": @{@"showDebugHUD": @(p.settings.showDebugHUD), @"showDisplaySupport3Required": @(p.settings.showDisplaySupport3Required), @"usesStrictCoreMotion": @(p.settings.usesStrictCoreMotion),
+ @"invertHingeAngles": @(p.settings.invertHingeAngles), @"continuousFoldEnabled": @(p.settings.continuousFoldEnabled),
+ @"closedToPartiallyOpenBoundary": @(p.settings.closedToPartiallyOpenBoundary), @"partiallyOpenToOpenFlatBoundary": @(p.settings.partiallyOpenToOpenFlatBoundary),
+ @"openTransitionBeginBoundary": @(p.settings.openTransitionBeginBoundary), @"closeTransitionBeginBoundary": @(p.settings.closeTransitionBeginBoundary),
+ @"transitionAutoCompleteDuration": @(p.settings.transitionAutoCompleteDuration), @"velocitySmoothingFactor": @(p.settings.velocitySmoothingFactor),
+ @"enterFoldAvoidancePredictionWindow": @(p.settings.enterFoldAvoidancePredictionWindow), @"sustainFoldAvoidancePredictionWindow": @(p.settings.sustainFoldAvoidancePredictionWindow)},
+ @"internal": @{@"isInitialized": @(p.internal.isInitialized), @"forceStrictCoreMotion": @(p.internal.forceStrictCoreMotion), @"invertHingeAngles": @(p.internal.invertHingeAngles),
+ @"isOnVM": @(p.internal.isOnVM), @"isDisplaySupport3Set": @(p.internal.isDisplaySupport3Set), @"hingeRegionsAreDefault": @(p.internal.hingeRegionsAreDefault),
+ @"needsTransitionAutocompletion": @(p.internal.needsTransitionAutocompletion), @"transitionAutocompletionProgress": @(p.internal.transitionAutocompletionProgress),
+ @"autocompleteStartTime": @(p.internal.autocompleteStartTime), @"timestampOfLastTransitionProgressChange": @(p.internal.timestampOfLastTransitionProgressChange),
+ @"transitionProgressWhenAutocompletionBegan": @(p.internal.transitionProgressWhenAutocompletionBegan),
+ @"transitionSwapProgressWhenAutocompletionBegan": @(p.internal.transitionSwapProgressWhenAutocompletionBegan), @"hingePositionWhenAutocompletionBegan": @(p.internal.hingePositionWhenAutocompletionBegan)},
+ @"displayTool": @{@"state": @(p.displayTool.state), @"duration": @(p.displayTool.duration), @"deviceOrientation": @(p.displayTool.deviceOrientation), @"profileOverride": @(p.displayTool.profileOverride),
+ @"waitForCompletion": @(p.displayTool.waitForCompletion), @"targetMode": @(p.displayTool.targetMode), @"targetHingePosition": @(p.displayTool.targetHingePosition),
+ @"lockedForTestingUntil": @(p.displayTool.lockedForTestingUntil)}
+ };
+};
+NSObject *vpProv = [[UIApplication sharedApplication] valueForKey:@"_devicePoseProvider"];
+vpAdd(@"SpringBoard.devicePoseProvider", @"private", @"[[UIApplication sharedApplication] devicePoseProvider] class", NSStringFromClass(object_getClass(vpProv)), nil);
+Method vpPoseM = class_getInstanceMethod(object_getClass(vpProv), @selector(currentPose));
+char *vpRet = method_copyReturnType(vpPoseM); NSUInteger vpSize = 0, vpAlign = 0; NSGetSizeAndAlignment(vpRet, &vpSize, &vpAlign); free(vpRet);
+Method vpBoxM = class_getInstanceMethod(object_getClass(vpProv), @selector(currentBox));
+char *vpRet2 = method_copyReturnType(vpBoxM); NSUInteger vpSize2 = 0; NSGetSizeAndAlignment(vpRet2, &vpSize2, &vpAlign); free(vpRet2);
+if (vpSize == sizeof(struct VPPose)) {
+ struct VPPose vpPose = ((struct VPPose (*)(id, SEL))objc_msgSend)(vpProv, @selector(currentPose));
+ vpAdd(@"SBFDevicePoseProvider.currentPose", @"private", @"-[SBFDevicePoseProvider currentPose] (struct decoded field by field)", vpPoseDict(vpPose), nil);
+} else {
+ vpAdd(@"SBFDevicePoseProvider.currentPose", @"private", @"-[SBFDevicePoseProvider currentPose]", nil, [NSString stringWithFormat:@"struct size mismatch: runtime %lu, probe %lu", (unsigned long)vpSize, sizeof(struct VPPose)]);
+}
+if (vpSize2 == sizeof(struct VPBox)) {
+ struct VPBox vpBox = ((struct VPBox (*)(id, SEL))objc_msgSend)(vpProv, @selector(currentBox));
+ vpAdd(@"SBFDevicePoseProvider.currentBox", @"private", @"-[SBFDevicePoseProvider currentBox] (fields beyond devicePose)",
+ @{@"mechanicalAngleDegrees": @(vpBox.mechanicalAngleDegrees), @"autocompletionMinDelay": @(vpBox.autocompletionMinDelay), @"autocompletionMaxDelay": @(vpBox.autocompletionMaxDelay),
+ @"likelyToOpenVelocityDegreesPerSecond": @(vpBox.likelyToOpenVelocityDegreesPerSecond), @"swapDegreesForContinuousLiveStyle": @(vpBox.swapDegreesForContinuousLiveStyle),
+ @"swapDegreesForContinuousSnapshotStyleWhenOpening": @(vpBox.swapDegreesForContinuousSnapshotStyleWhenOpening),
+ @"swapDegreesForContinuousSnapshotStyleWhenClosing": @(vpBox.swapDegreesForContinuousSnapshotStyleWhenClosing),
+ @"swapDegreesForFadeInFadeOutStyle": @(vpBox.swapDegreesForFadeInFadeOutStyle), @"transitionStyle": @(vpBox.transitionStyle), @"autocompletionDelay": @(vpBox.autocompletionDelay),
+ @"continuousFoldEffectProgress": @(vpBox.continuousFoldEffectProgress), @"continuousFoldEffectSettlingTarget": @(vpBox.continuousFoldEffectSettlingTarget),
+ @"continuousFoldEffectIsSettling": @(vpBox.continuousFoldEffectIsSettling)}, nil);
+} else {
+ vpAdd(@"SBFDevicePoseProvider.currentBox", @"private", @"-[SBFDevicePoseProvider currentBox]", nil, [NSString stringWithFormat:@"struct size mismatch: runtime %lu, probe %lu", (unsigned long)vpSize2, sizeof(struct VPBox)]);
+}
+vpAdd(@"SBFDevicePoseProvider.description", @"private", @"[(NSObject *)provider description]", vpD(vpProv), nil);
+vpAdd(@"SBFDevicePoseProvider.isContinuousFoldEnabled", @"private", @"-[SBFDevicePoseProvider isContinuousFoldEnabled]", @(((BOOL (*)(id, SEL))objc_msgSend)(vpProv, @selector(isContinuousFoldEnabled))), nil);
+vpAdd(@"SBFDevicePoseProvider.continuousFoldEffectProgress", @"private", @"-[SBFDevicePoseProvider continuousFoldEffectProgress]", @(((double (*)(id, SEL))objc_msgSend)(vpProv, @selector(continuousFoldEffectProgress))), nil);
+vpAdd(@"SBFDevicePoseProvider._lastNotificationTimestamp", @"private", @"[provider valueForKey:@\"_lastNotificationTimestamp\"]", [vpProv valueForKey:@"_lastNotificationTimestamp"], nil);
+vpAdd(@"SBFDevicePoseProvider._cmAngleManager", @"private", @"[provider valueForKey:@\"_cmAngleManager\"] class", NSStringFromClass(object_getClass([vpProv valueForKey:@"_cmAngleManager"])), nil);
+vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager", @"private", @"[provider valueForKey:@\"_cmMagicPoseManager\"] class", NSStringFromClass(object_getClass([vpProv valueForKey:@"_cmMagicPoseManager"])), nil);
+vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager.isSharedManager", @"private", @"[provider valueForKey:@\"_cmMagicPoseManager\"] == [CMMagicPoseManager sharedManager]",
+ @([vpProv valueForKey:@"_cmMagicPoseManager"] == ((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"CMMagicPoseManager"), @selector(sharedManager))), nil);
+NSObject *vpAccel = [vpProv valueForKey:@"_accelerometer"];
+vpAdd(@"SBFDevicePoseProvider._accelerometer", @"private", @"[provider valueForKey:@\"_accelerometer\"] class", vpAccel ? NSStringFromClass(object_getClass(vpAccel)) : nil, vpAccel ? nil : @"nil");
+if (vpAccel) {
+ vpAdd(@"BKSAccelerometer.currentDeviceOrientation", @"private", @"[provider._accelerometer currentDeviceOrientation]", @(((long long (*)(id, SEL))objc_msgSend)(vpAccel, @selector(currentDeviceOrientation))), nil);
+ vpAdd(@"BKSAccelerometer.orientationEventsEnabled", @"private", @"[provider._accelerometer orientationEventsEnabled]", @(((BOOL (*)(id, SEL))objc_msgSend)(vpAccel, @selector(orientationEventsEnabled))), nil);
+ vpAdd(@"BKSAccelerometer.passiveOrientationEvents", @"private", @"[provider._accelerometer passiveOrientationEvents]", @(((BOOL (*)(id, SEL))objc_msgSend)(vpAccel, @selector(passiveOrientationEvents))), nil);
+ vpAdd(@"BKSAccelerometer.accelerometerEventsEnabled", @"private", @"[provider._accelerometer accelerometerEventsEnabled]", @(((BOOL (*)(id, SEL))objc_msgSend)(vpAccel, @selector(accelerometerEventsEnabled))), nil);
+ vpAdd(@"BKSAccelerometer.updateInterval", @"private", @"[provider._accelerometer updateInterval]", @(((double (*)(id, SEL))objc_msgSend)(vpAccel, @selector(updateInterval))), nil);
+}
+NSObject *vpPT = [vpProv valueForKey:@"_settings"];
+NSMutableDictionary *vpPTD = [NSMutableDictionary dictionary];
+for (NSString *vpK in @[@"continuousFoldTransitionEnabled", @"partiallyOpenToOpenFlatBoundary", @"openTransitionBeginBoundary", @"closeTransitionBeginBoundary", @"transitionAutoCompleteDuration", @"swapDegreesForContinuousLiveStyle", @"swapDegreesForContinuousSnapshotStyleWhenOpening", @"swapDegreesForContinuousSnapshotStyleWhenClosing", @"swapDegreesForFadeInFadeOutStyle", @"autocompleteMinDelay", @"autocompleteMaxDelay", @"displayPrewarmDuration", @"velocitySmoothingFactor", @"likelyToOpenVelocityDegreesPerSecond", @"enterFoldAvoidancePredictionWindow", @"sustainFoldAvoidancePredictionWindow"]) {
+ vpPTD[vpK] = [vpPT valueForKey:vpK] ?: [NSNull null];
+}
+vpAdd(@"SBFDevicePosePTSettings", @"private", @"[provider valueForKey:@\"_settings\"] valueForKey:<each property>", vpPTD, nil);
+Class vpDefC = NSClassFromString(@"SBFDevicePoseDefaults");
+NSObject *vpDef = vpDefC ? ((id (*)(id, SEL))objc_msgSend)(((id (*)(id, SEL))objc_msgSend)(vpDefC, @selector(alloc)), @selector(init)) : nil;
+vpAdd(@"SBFDevicePoseDefaults.lastKnownCMAngleDictionary", @"private", @"[[SBFDevicePoseDefaults alloc] init].lastKnownCMAngleDictionary", [vpDef valueForKey:@"lastKnownCMAngleDictionary"], vpDef ? nil : @"SBFDevicePoseDefaults missing");
+vpAdd(@"SBFDevicePoseDefaults.lastKnownCMMagicPoseDictionary", @"private", @"[[SBFDevicePoseDefaults alloc] init].lastKnownCMMagicPoseDictionary", [vpDef valueForKey:@"lastKnownCMMagicPoseDictionary"], vpDef ? nil : @"SBFDevicePoseDefaults missing");
+NSMutableArray *vpObs = [NSMutableArray array];
+for (id vpO in [(NSHashTable *)[vpProv valueForKey:@"_observers"] allObjects]) [vpObs addObject:NSStringFromClass(object_getClass(vpO))];
+[vpObs sortUsingSelector:@selector(compare:)];
+vpAdd(@"SBFDevicePoseProvider._observers", @"private", @"[[provider valueForKey:@\"_observers\"] allObjects] (class names, sorted)", vpObs, nil);
+vpAdd(@"SBFDevicePoseProvider.likelyTransitionDelegate", @"private", @"[provider likelyTransitionDelegate] class", NSStringFromClass(object_getClass([vpProv valueForKey:@"_likelyTransitionDelegate"])), nil);
+UIWindowScene *vpHB = (UIWindowScene *)[vpProv valueForKey:@"_heartbeatSource"];
+vpAdd(@"SBFDevicePoseProvider._heartbeatSource", @"private", @"[provider valueForKey:@\"_heartbeatSource\"].session.persistentIdentifier", vpHB ? vpHB.session.persistentIdentifier : nil, vpHB ? nil : @"nil");
+NSObject *vpCoord = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_swapCoordinator"];
+vpAdd(@"SBDisplayToolServiceCoordinator._devicePoseProvider.isSpringBoardProvider", @"private", @"[coordinator valueForKey:@\"_devicePoseProvider\"] == [SpringBoard devicePoseProvider]", @([vpCoord valueForKey:@"_devicePoseProvider"] == vpProv), nil);
+struct VPHPS { char a; char b; char c; char d; };
+struct VPHPS vpHPS = ((struct VPHPS (*)(id, SEL))objc_msgSend)([UIApplication sharedApplication], @selector(currentHingePoseStateForTesting));
+vpAdd(@"UIApplication.currentHingePoseStateForTesting", @"private", @"-[UIApplication currentHingePoseStateForTesting] {orientation, magicPoseDeviceOrientation, magicPoseHingeState, magicPoseTabletopPose}",
+ @{@"orientation": @(vpHPS.a), @"magicPoseDeviceOrientation": @(vpHPS.b), @"magicPoseHingeState": @(vpHPS.c), @"magicPoseTabletopPose": @(vpHPS.d)}, nil);
+NSDictionary *vpOut = @{@"group": @"pose", @"orientation": @(vpOrient), @"records": vpRecs};
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-uikit.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-uikit.lldb
new file mode 100644
index 00000000..0c46afe0
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/sensors-uikit.lldb
@@ -0,0 +1,117 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSObject *vpApp = (NSObject *)[UIApplication sharedApplication];
+long vpOrient = 0;
+BOOL vpIsSB = [vpApp respondsToSelector:NSSelectorFromString(@"devicePoseProvider")];
+if (vpIsSB) vpOrient = ((long (*)(id, SEL))objc_msgSend)([(NSObject *)[(NSObject *)[vpApp valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"] valueForKey:@"primaryWindowScene"], @selector(interfaceOrientation));
+else for (UIScene *vpS in [UIApplication sharedApplication].connectedScenes) if ([vpS isKindOfClass:[UIWindowScene class]]) { vpOrient = ((UIWindowScene *)vpS).interfaceOrientation; break; }
+NSDictionary *(^vpCall)(NSObject *, SEL) = ^NSDictionary *(NSObject *o, SEL s) {
+ Method vpM = class_getInstanceMethod(object_getClass(o), s);
+ if (!vpM || ![o respondsToSelector:s]) return @{@"error": [NSString stringWithFormat:@"does not respond to %@", NSStringFromSelector(s)]};
+ char vpR[64]; method_getReturnType(vpM, vpR, sizeof(vpR));
+ if (method_getNumberOfArguments(vpM) != 2) return @{@"error": @"takes arguments"};
+ switch (vpR[0]) {
+ case 'q': case 'l': return @{@"value": @(((long long (*)(id, SEL))objc_msgSend)(o, s))};
+ case 'Q': case 'L': return @{@"value": @(((unsigned long long (*)(id, SEL))objc_msgSend)(o, s))};
+ case 'i': return @{@"value": @(((int (*)(id, SEL))objc_msgSend)(o, s))};
+ case 'I': return @{@"value": @(((unsigned int (*)(id, SEL))objc_msgSend)(o, s))};
+ case 'B': return @{@"value": @(((BOOL (*)(id, SEL))objc_msgSend)(o, s))};
+ case 'c': case 'C': return @{@"value": @(((char (*)(id, SEL))objc_msgSend)(o, s))};
+ case 'd': return @{@"value": @(((double (*)(id, SEL))objc_msgSend)(o, s))};
+ case 'f': return @{@"value": @(((float (*)(id, SEL))objc_msgSend)(o, s))};
+ case '#': { Class vpC = ((Class (*)(id, SEL))objc_msgSend)(o, s); return vpC ? @{@"value": NSStringFromClass(vpC)} : @{@"error": @"nil"}; }
+ case '@': { id vpV = ((id (*)(id, SEL))objc_msgSend)(o, s); return vpV ? @{@"value": vpV} : @{@"error": @"nil"}; }
+ default: return @{@"error": [NSString stringWithFormat:@"unsupported return type %s", vpR]};
+ }
+};
+NSSet *vpDeny = [NSSet setWithArray:@[@"init", @"dealloc", @".cxx_destruct", @"currentDevice", @"sf_serialNumberQRImage", @"sf_serialNumber", @"sf_colorCodedSerialNumber", @"sf_udidString", @"identifierForVendor", @"new", @"alloc", @"class", @"copy", @"mutableCopy", @"_tapticEngine"]];
+UIDevice *vpDev = [UIDevice currentDevice];
+for (int vk = 0; vk < 2; vk++) {
+ Class vpT = vk ? object_getClass([UIDevice class]) : [UIDevice class];
+ NSObject *vpRecv = vk ? (NSObject *)[UIDevice class] : (NSObject *)vpDev;
+ unsigned int vpCount = 0; Method *vpM = class_copyMethodList(vpT, &vpCount);
+ NSMutableArray *vpSels = [NSMutableArray array];
+ for (unsigned int vj = 0; vj < vpCount; vj++) if (method_getNumberOfArguments(vpM[vj]) == 2) [vpSels addObject:NSStringFromSelector(method_getName(vpM[vj]))];
+ free(vpM);
+ [vpSels sortUsingSelector:@selector(compare:)];
+ for (NSString *vpS in vpSels) {
+ if ([vpDeny containsObject:vpS]) { vpAdd([NSString stringWithFormat:@"UIDevice.%@%@", vk ? @"+" : @"", vpS], @"private", [NSString stringWithFormat:@"%@[UIDevice %@%@]", vk ? @"+" : @"-", vk ? @"" : @"currentDevice] ", vpS], nil, @"skipped: serial/identifier, allocator or side effect"); continue; }
+ char vpR[64]; method_getReturnType(class_getInstanceMethod(vpT, NSSelectorFromString(vpS)), vpR, sizeof(vpR));
+ if (vpR[0] == 'v') continue;
+ NSDictionary *vpRes = vpCall(vpRecv, NSSelectorFromString(vpS));
+ BOOL vpPublic = [@[@"name", @"model", @"localizedModel", @"systemName", @"systemVersion", @"orientation", @"userInterfaceIdiom", @"isMultitaskingSupported", @"batteryLevel", @"batteryState", @"isBatteryMonitoringEnabled", @"isProximityMonitoringEnabled", @"proximityState", @"isGeneratingDeviceOrientationNotifications"] containsObject:vpS] && !vk;
+ vpAdd([NSString stringWithFormat:@"UIDevice.%@%@", vk ? @"+" : @"", vpS], vpPublic ? @"public" : @"private", vk ? [NSString stringWithFormat:@"+[UIDevice %@]", vpS] : [NSString stringWithFormat:@"[[UIDevice currentDevice] %@]", vpS], vpRes[@"value"], vpRes[@"error"]);
+ }
+}
+for (NSString *vpS in @[@"hingeState", @"tabletopPose", @"_userInterfaceIdiom", @"_hingeState", @"hingeAngle", @"isFoldable", @"_isFoldable", @"foldState", @"posture", @"_deviceOrientation"]) {
+ NSDictionary *vpRes = vpCall(vpDev, NSSelectorFromString(vpS));
+ vpAdd([@"UIDevice." stringByAppendingString:vpS], @"private", [NSString stringWithFormat:@"[[UIDevice currentDevice] %@] (requested name; checked with respondsToSelector:)", vpS], vpRes[@"value"], vpRes[@"error"]);
+}
+vpAdd(@"UIDevice.currentDeviceOrientationAllowingAmbiguous:", @"private", @"+[UIDevice currentDeviceOrientationAllowingAmbiguous:YES]", @(((long long (*)(id, SEL, BOOL))objc_msgSend)([UIDevice class], @selector(currentDeviceOrientationAllowingAmbiguous:), YES)), nil);
+struct VPHPS { char a; char b; char c; char d; };
+struct VPHPS vpHPS = ((struct VPHPS (*)(id, SEL))objc_msgSend)(vpApp, @selector(currentHingePoseStateForTesting));
+vpAdd(@"UIApplication.currentHingePoseStateForTesting", @"private", @"-[UIApplication currentHingePoseStateForTesting] {orientation, magicPoseDeviceOrientation, magicPoseHingeState, magicPoseTabletopPose}",
+ @{@"orientation": @(vpHPS.a), @"magicPoseDeviceOrientation": @(vpHPS.b), @"magicPoseHingeState": @(vpHPS.c), @"magicPoseTabletopPose": @(vpHPS.d)}, nil);
+NSDictionary *(^vpHS)(NSObject *) = ^NSDictionary *(NSObject *h) {
+ if (!h) return (NSDictionary *)nil;
+ NSMutableDictionary *vpR = [NSMutableDictionary dictionaryWithDictionary:@{@"class": NSStringFromClass(object_getClass(h)), @"description": [h description] ?: @""}];
+ for (NSString *vpK in @[@"status", @"magicPose", @"hingeAngle", @"angleDegrees", @"nextStatus", @"progress", @"identifier", @"sceneRegionIdentifier"]) { NSDictionary *vpRes = vpCall(h, NSSelectorFromString(vpK)); if (vpRes[@"value"]) vpR[vpK] = vpRes[@"value"]; }
+ return vpR;
+};
+NSMutableArray *vpScenes = [[[UIApplication sharedApplication].connectedScenes allObjects] mutableCopy];
+for (UIScene *vpS in vpScenes) {
+ NSString *vpPid = vpS.session.persistentIdentifier ?: @"?";
+ NSObject *vpF = ((id (*)(id, SEL))objc_msgSend)(vpS, @selector(_FBSScene));
+ NSObject *vpSet = vpF ? ((id (*)(id, SEL))objc_msgSend)(vpF, @selector(settings)) : nil;
+ NSString *vpDisp = vpSet ? ([(NSObject *)vpCall(vpSet, @selector(displayIdentity))[@"value"] description] ?: @"?") : @"?";
+ NSMutableDictionary *vpSD = [NSMutableDictionary dictionary];
+ for (NSString *vpK in @[@"hingeAngle", @"hingeStatus", @"nextHingeStatus", @"nextHingeStatusProgress", @"magicPose", @"interfaceOrientation", @"deviceOrientation", @"ssk_surfaceType", @"pui_deviceOrientation"]) { NSDictionary *vpRes = vpSet ? vpCall(vpSet, NSSelectorFromString(vpK)) : @{@"error": @"no settings"}; vpSD[vpK] = vpRes[@"value"] ?: [@"error: " stringByAppendingString:vpRes[@"error"]]; }
+ NSObject *vpSHS = vpSet ? (NSObject *)vpCall(vpSet, @selector(sceneHingeState))[@"value"] : nil;
+ vpSD[@"sceneHingeState"] = vpHS(vpSHS) ?: (id)[NSNull null];
+ vpSD[@"displayIdentity"] = vpSet ? [(NSObject *)vpCall(vpSet, @selector(displayIdentity))[@"value"] description] ?: @"" : @"";
+ vpAdd(@"FBSSceneSettings.hinge", @"private", [NSString stringWithFormat:@"[<scene %@ on %@>._FBSScene.settings hingeAngle/hingeStatus/nextHingeStatus/nextHingeStatusProgress/magicPose/interfaceOrientation/deviceOrientation/sceneHingeState]", vpPid, vpDisp], vpSD, vpSet ? nil : @"no FBSScene settings");
+ NSObject *vpUH = vpF ? (NSObject *)vpCall(vpF, @selector(ui_hingeState))[@"value"] : nil;
+ vpAdd(@"FBSScene.ui_hingeState", @"private", [NSString stringWithFormat:@"[<scene %@ on %@>._FBSScene ui_hingeState]", vpPid, vpDisp], vpHS(vpUH), vpUH ? nil : @"nil");
+ NSObject *vpComp = vpF ? (NSObject *)vpCall(vpF, @selector(ui_hingeStateClientComponent))[@"value"] : nil;
+ NSObject *vpCHS = vpComp ? (NSObject *)vpCall(vpComp, @selector(hingeState))[@"value"] : nil;
+ NSObject *vpCSHS = vpComp ? (NSObject *)vpCall(vpComp, @selector(sceneHingeState))[@"value"] : nil;
+ vpAdd(@"_UISceneHingeStateClientComponent.hingeState", @"private", [NSString stringWithFormat:@"[[<scene %@ on %@>._FBSScene ui_hingeStateClientComponent] hingeState]", vpPid, vpDisp], vpComp ? (vpHS(vpCHS) ?: (id)[NSNull null]) : nil, vpComp ? (vpCHS ? nil : @"nil") : @"no client component");
+ vpAdd(@"_UISceneHingeStateClientComponent.sceneHingeState", @"private", [NSString stringWithFormat:@"[[<scene %@ on %@>._FBSScene ui_hingeStateClientComponent] sceneHingeState]", vpPid, vpDisp], vpComp ? (vpHS(vpCSHS) ?: (id)[NSNull null]) : nil, vpComp ? (vpCSHS ? nil : @"nil") : @"no client component");
+ if ([vpS isKindOfClass:[UIWindowScene class]]) {
+ UIWindowScene *vpWS = (UIWindowScene *)vpS;
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [NSString stringWithFormat:@"[<scene %@ on %@> interfaceOrientation]", vpPid, vpDisp], @(vpWS.interfaceOrientation), nil);
+ vpAdd(@"UIWindowScene.traitCollection.horizontalSizeClass", @"public", [NSString stringWithFormat:@"[<scene %@ on %@> traitCollection].horizontalSizeClass/verticalSizeClass/userInterfaceIdiom", vpPid, vpDisp], @{@"horizontalSizeClass": @(vpWS.traitCollection.horizontalSizeClass), @"verticalSizeClass": @(vpWS.traitCollection.verticalSizeClass), @"userInterfaceIdiom": @(vpWS.traitCollection.userInterfaceIdiom)}, nil);
+ }
+}
+if (vpIsSB) {
+ NSObject *vpW = [(NSObject *)((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"FBSceneManager"), @selector(sharedInstance)) valueForKey:@"_workspace"];
+ NSMutableArray *vpAll = [NSMutableArray array];
+ for (NSObject *vpF in (NSArray *)[[(NSObject *)((id (*)(id, SEL))objc_msgSend)(vpW, @selector(allScenes)) valueForKey:@"self"] allObjects]) {
+ NSObject *vpSet = ((id (*)(id, SEL))objc_msgSend)(vpF, @selector(settings));
+ NSMutableDictionary *vpSD = [NSMutableDictionary dictionaryWithDictionary:@{@"identifier": [(NSObject *)[vpF valueForKey:@"identifier"] description] ?: @""}];
+ for (NSString *vpK in @[@"hingeAngle", @"hingeStatus", @"nextHingeStatus", @"nextHingeStatusProgress", @"magicPose", @"interfaceOrientation", @"deviceOrientation"]) { NSDictionary *vpRes = vpCall(vpSet, NSSelectorFromString(vpK)); vpSD[vpK] = vpRes[@"value"] ?: [@"error: " stringByAppendingString:vpRes[@"error"]]; }
+ vpSD[@"displayIdentity"] = [(NSObject *)vpCall(vpSet, @selector(displayIdentity))[@"value"] description] ?: @"";
+ [vpAll addObject:vpSD];
+ }
+ [vpAll sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"identifier" ascending:YES]]];
+ vpAdd(@"FBSceneWorkspace.allScenes.settings.hinge", @"private", @"[[FBSceneManager sharedInstance]._workspace allScenes] -> each FBScene.settings hinge fields (host side, what SpringBoard sends to clients)", vpAll, nil);
+}
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSDictionary *vpOut = @{@"group": @"uikit", @"orientation": @(vpOrient), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/smoke-springboard.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/smoke-springboard.lldb
new file mode 100644
index 00000000..35768eb2
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/smoke-springboard.lldb
@@ -0,0 +1,51 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) {
+ return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)};
+};
+NSArray *vpScreens = [UIScreen screens];
+vpAdd(@"UIScreen.screens", @"public", @"[UIScreen screens].count", @(vpScreens.count), nil);
+for (NSUInteger vi = 0; vi < vpScreens.count; vi++) {
+ UIScreen *vpS = vpScreens[vi];
+ NSString *vpCall = [NSString stringWithFormat:@"[UIScreen screens][%lu]", (unsigned long)vi];
+ vpAdd(@"UIScreen.bounds", @"public", [vpCall stringByAppendingString:@".bounds"], vpRect(vpS.bounds), nil);
+ vpAdd(@"UIScreen.nativeBounds", @"public", [vpCall stringByAppendingString:@".nativeBounds"], vpRect(vpS.nativeBounds), nil);
+ vpAdd(@"UIScreen.scale", @"public", [vpCall stringByAppendingString:@".scale"], @(vpS.scale), nil);
+ vpAdd(@"UIScreen.nativeScale", @"public", [vpCall stringByAppendingString:@".nativeScale"], @(vpS.nativeScale), nil);
+ vpAdd(@"UIScreen.isMainScreen", @"public", [vpCall stringByAppendingString:@" == [UIScreen mainScreen]"], @(vpS == [UIScreen mainScreen]), nil);
+ vpAdd(@"UIScreen.displayIdentity", @"private", [vpCall stringByAppendingString:@" valueForKey:@\"displayIdentity\""], [(NSObject *)[vpS valueForKey:@"displayIdentity"] description], nil);
+ if ([vpS respondsToSelector:@selector(_name)]) {
+ vpAdd(@"UIScreen._name", @"private", [vpCall stringByAppendingString:@"._name"], [(NSObject *)[vpS performSelector:@selector(_name)] description], nil);
+ } else {
+ vpAdd(@"UIScreen._name", @"private", [vpCall stringByAppendingString:@"._name"], nil, @"does not respond to _name");
+ }
+}
+NSObject *vpSvc = [[UIApplication sharedApplication] valueForKey:@"_displayToolService"];
+NSObject *vpDCM = [vpSvc valueForKey:@"_displayContentModeCoordinator"];
+NSDictionary *(^vpScene)(UIWindowScene *) = ^NSDictionary *(UIWindowScene *ws) {
+ if (!ws) return (NSDictionary *)nil;
+ return @{@"persistentIdentifier": ws.session.persistentIdentifier ?: @"",
+ @"displayIdentity": [(NSObject *)[ws.screen valueForKey:@"displayIdentity"] description] ?: @"",
+ @"screenBounds": vpRect(ws.screen.bounds),
+ @"interfaceOrientation": @(ws.interfaceOrientation)};
+};
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+UIWindowScene *vpActive = (UIWindowScene *)[vpDCM valueForKey:@"activeWindowScene"];
+vpAdd(@"SBDisplayContentModeCoordinator.primaryWindowScene", @"private", @"[SBDisplayContentModeCoordinator primaryWindowScene]", vpScene(vpPrimary), nil);
+vpAdd(@"SBDisplayContentModeCoordinator.activeWindowScene", @"private", @"[SBDisplayContentModeCoordinator activeWindowScene]", vpScene(vpActive), nil);
+for (UIWindowScene *vpWS in (NSArray *)[vpDCM valueForKey:@"_connectedWindowScenes"]) {
+ long vpMode = ((long (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS);
+ BOOL vpUser = ((BOOL (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(isAppliedDisplayContentModeUserInitiatedForWindowScene:), vpWS);
+ NSString *vpCall = [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<%@>]", vpWS.session.persistentIdentifier];
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", vpCall,
+ @{@"scene": vpScene(vpWS), @"displayContentMode": @(vpMode), @"userInitiated": @(vpUser)}, nil);
+}
+vpAdd(@"SBFDisplayContentModeResolver.description", @"private", @"[[SBDisplayContentModeCoordinator valueForKey:@\"_resolver\"] description]", [(NSObject *)[vpDCM valueForKey:@"_resolver"] description], nil);
+NSDictionary *vpOut = @{@"orientation": @(vpPrimary.interfaceOrientation), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpOut options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-disable-autolock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-disable-autolock.lldb
new file mode 100644
index 00000000..8cf343d1
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-disable-autolock.lldb
@@ -0,0 +1,5 @@
+expr -l objc -O --
+NSObject *vpIdle = [(NSObject *)[UIApplication sharedApplication] valueForKey:@"_idleTimerGlobalCoordinator"];
+NSObject *vpA = (NSObject *)((id (*)(id, SEL, id))objc_msgSend)(vpIdle, @selector(acquireIdleTimerDisableAssertionForReason:), @"vphone baseline: auto-lock off again");
+[NSString stringWithFormat:@"assertion=%@ disabled=%d timer=%@ dict=%@", [vpA description], ((BOOL (*)(id, SEL))objc_msgSend)(vpIdle, @selector(isIdleTimerDisabled)), [(NSObject *)((id (*)(id, SEL))objc_msgSend)(vpIdle, @selector(idleTimer)) description], [(NSObject *)[vpIdle valueForKey:@"_idleTimerDisableAssertions"] description]]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-classes.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-classes.lldb
new file mode 100644
index 00000000..1f8cc965
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-classes.lldb
@@ -0,0 +1,14 @@
+expr -l objc -O --
+NSMutableString *vpOut = [NSMutableString string];
+NSArray *vpPrefixes = @[@"SBDisplayContentMode", @"SBFDisplayContentMode", @"SBWindowScene", @"SBTraits", @"ContinuousFold", @"SBHinge", @"Hinge", @"SBFDevicePose", @"DevicePose", @"SBWallpaperHinge", @"SBBacklight", @"Backlight", @"FoldDevice", @"SBDisplayTool", @"SBFDisplay", @"SBFold", @"Fold"];
+unsigned int vpCount = 0;
+Class *vpClasses = objc_copyClassList(&vpCount);
+NSMutableArray *vpNames = [NSMutableArray array];
+for (unsigned int vi = 0; vi < vpCount; vi++) {
+ NSString *vpN = [NSString stringWithUTF8String:class_getName(vpClasses[vi])];
+ for (NSString *vpP in vpPrefixes) { if ([vpN rangeOfString:vpP].location != NSNotFound) { [vpNames addObject:vpN]; break; } }
+}
+free(vpClasses);
+[vpNames sortUsingSelector:@selector(compare:)];
+[vpNames componentsJoinedByString:@"\n"]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods.lldb
new file mode 100644
index 00000000..a2570d26
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods.lldb
@@ -0,0 +1,24 @@
+expr -l objc -O --
+NSArray *vpClassNames = @[@"SBDisplayContentModeCoordinator", @"SBDisplayContentModeLockScreenActiveDisplayPolicy", @"SBDisplayContentModeTransitionStyleCoordinator", @"_SBDisplayContentModeTransitionObserverProxy", @"SBFDisplayContentModeResolver", @"SBFDisplayContentModeResolutionPolicy", @"SBFFoldingDualDisplayContentModeResolutionPolicy", @"SBFDisplayContentModeTransitionContext", @"SBFDisplayContentModeTransitionCoordinator", @"SBFDisplayContentModeTransitionLockProvider", @"SBFDisplayProxy", @"SBWindowScene", @"SBWindowSceneManager", @"SBWindowSceneDisplayContentModeContext", @"SBWindowSceneOrientationLockManager", @"SBWindowSceneStatusBarManager", @"SBWindowSceneAuxiliaryContentController", @"SBTraitsPipelineManager", @"SBTraitsEmbeddedDisplayPipelineManager", @"SBTraitsResizableDisplayPipelineManager", @"SBTraitsContinuousFoldDeviceOrientationLockAssertion", @"SBTraitsOrientationStageComponent", @"SBTraitsSceneParticipantDelegate", @"SBTraitsEmbeddedDisplayRolesAndDefaultPoliciesProvider", @"SBContinuousFoldController", @"SBContinuousFoldCoordinator", @"SBDeviceContinuousFoldInteractionDomain", @"SBDeviceContinuousFoldInteractionSettings", @"SBHingeMotionDetectionSettings", @"SBHingeMotionUnintendedInteractionMonitor", @"SBWallpaperHingeProgressController", @"PRUISHingeProgressController", @"SBFDevicePoseProvider", @"SBFDevicePosePTSettings", @"SBFDevicePosePTSettingsDomain", @"SBFDevicePoseDefaults", @"SBBacklightController", @"SBBacklightCoordinator", @"SBBacklightPlatformProvider", @"SBBacklightServicesPlatformProvider", @"SBBacklightIdleTimer", @"BLSHBacklightHost", @"BLSHAggregateBacklightHost", @"BLSHBacklightDisplayStateMachine", @"BLSHBacklightAggregateState", @"SBFoldingDualDisplayPhoneSceneSnapshotRequestStrategy", @"SBDisplayToolServiceCoordinator", @"SBDisplayToolService"];
+NSMutableString *vpOut = [NSMutableString string];
+for (NSString *vpCN in vpClassNames) {
+ Class vpC = NSClassFromString(vpCN);
+ if (!vpC) { [vpOut appendFormat:@"=== %@: MISSING\n", vpCN]; continue; }
+ [vpOut appendFormat:@"=== %@ : %s\n", vpCN, class_getName(class_getSuperclass(vpC))];
+ unsigned int vpN = 0;
+ objc_property_t *vpProps = class_copyPropertyList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" @property %s [%s]\n", property_getName(vpProps[vi]), property_getAttributes(vpProps[vi])];
+ free(vpProps);
+ Ivar *vpIvars = class_copyIvarList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" ivar %s %s\n", ivar_getName(vpIvars[vi]), ivar_getTypeEncoding(vpIvars[vi]) ?: ""];
+ free(vpIvars);
+ Method *vpMs = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" - %s %s\n", sel_getName(method_getName(vpMs[vi])), method_getTypeEncoding(vpMs[vi]) ?: ""];
+ free(vpMs);
+ vpMs = class_copyMethodList(object_getClass(vpC), &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" + %s %s\n", sel_getName(method_getName(vpMs[vi])), method_getTypeEncoding(vpMs[vi]) ?: ""];
+ free(vpMs);
+}
+BOOL vpOK = [vpOut writeToFile:@"/tmp/duo-sim-baseline-classdump.txt" atomically:YES encoding:NSUTF8StringEncoding error:nil];
+[NSString stringWithFormat:@"wrote=%d len=%lu", vpOK, (unsigned long)vpOut.length]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods2.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods2.lldb
new file mode 100644
index 00000000..12a69250
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods2.lldb
@@ -0,0 +1,24 @@
+expr -l objc -O --
+NSArray *vpClassNames = @[@"TRAArbiter", @"TRAParticipant", @"TRAArbitrationInputs", @"TRAArbitrationDeviceOrientationInputs", @"TRASettings", @"TRASettingsOrientation", @"TRAPreferencesOrientation", @"SBFResolvedDisplayContentMode", @"SBFFullyClosedDisplayContentModeResolutionPolicy", @"SBFSingleIntegratedDisplayContentModeResolutionPolicy", @"SBFTentModeDisplayContentModeResolutionPolicy", @"SBFYoinkDisplayContentModeResolutionPolicy", @"SBFForceCoverDisplayOnlyDisplayContentModeResolutionPolicy", @"SBDisplayYoinkingCoordinator", @"SBDisplayYoinkingController", @"SBDisplayYoinkingPTSettings", @"SBIdleTimerGlobalCoordinator", @"SBIdleTimerDefaults", @"SBLockScreenManager", @"SBLockStateAggregator", @"SBScreenSleepController", @"SBScreenSleepCoordinator", @"SBOrientationLockManager", @"SBDeviceOrientationUpdateDeferralManager", @"SBTraitsInputsOrientationLockValidator", @"SBFDisplayToolSystemSpace", @"SBContinuousFoldSnapshotCoordinator"];
+NSMutableString *vpOut = [NSMutableString string];
+for (NSString *vpCN in vpClassNames) {
+ Class vpC = NSClassFromString(vpCN);
+ if (!vpC) { [vpOut appendFormat:@"=== %@: MISSING\n", vpCN]; continue; }
+ [vpOut appendFormat:@"=== %@ : %s\n", vpCN, class_getName(class_getSuperclass(vpC))];
+ unsigned int vpN = 0;
+ objc_property_t *vpProps = class_copyPropertyList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" @property %s [%s]\n", property_getName(vpProps[vi]), property_getAttributes(vpProps[vi])];
+ free(vpProps);
+ Ivar *vpIvars = class_copyIvarList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" ivar %s %s\n", ivar_getName(vpIvars[vi]), ivar_getTypeEncoding(vpIvars[vi]) ?: ""];
+ free(vpIvars);
+ Method *vpMs = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" - %s %s\n", sel_getName(method_getName(vpMs[vi])), method_getTypeEncoding(vpMs[vi]) ?: ""];
+ free(vpMs);
+ vpMs = class_copyMethodList(object_getClass(vpC), &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" + %s %s\n", sel_getName(method_getName(vpMs[vi])), method_getTypeEncoding(vpMs[vi]) ?: ""];
+ free(vpMs);
+}
+BOOL vpOK = [vpOut writeToFile:@"/tmp/duo-sim-baseline-classdump2.txt" atomically:YES encoding:NSUTF8StringEncoding error:nil];
+[NSString stringWithFormat:@"wrote=%d len=%lu", vpOK, (unsigned long)vpOut.length]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods3.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods3.lldb
new file mode 100644
index 00000000..a7cd6661
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-discover-methods3.lldb
@@ -0,0 +1,24 @@
+expr -l objc -O --
+NSArray *vpClassNames = @[@"SBCoverSheetPresentationManager", @"SBLockScreenManager", @"SBScreenSleepController", @"SBScreenSleepCoordinator", @"SBIdleTimerDefaults", @"SBDisplayLayoutPublisherCoordinator", @"SBUserAgent"];
+NSMutableString *vpOut = [NSMutableString string];
+for (NSString *vpCN in vpClassNames) {
+ Class vpC = NSClassFromString(vpCN);
+ if (!vpC) { [vpOut appendFormat:@"=== %@: MISSING\n", vpCN]; continue; }
+ [vpOut appendFormat:@"=== %@ : %s\n", vpCN, class_getName(class_getSuperclass(vpC))];
+ unsigned int vpN = 0;
+ objc_property_t *vpProps = class_copyPropertyList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" @property %s [%s]\n", property_getName(vpProps[vi]), property_getAttributes(vpProps[vi])];
+ free(vpProps);
+ Ivar *vpIvars = class_copyIvarList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" ivar %s %s\n", ivar_getName(vpIvars[vi]), ivar_getTypeEncoding(vpIvars[vi]) ?: ""];
+ free(vpIvars);
+ Method *vpMs = class_copyMethodList(vpC, &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" - %s %s\n", sel_getName(method_getName(vpMs[vi])), method_getTypeEncoding(vpMs[vi]) ?: ""];
+ free(vpMs);
+ vpMs = class_copyMethodList(object_getClass(vpC), &vpN);
+ for (unsigned int vi = 0; vi < vpN; vi++) [vpOut appendFormat:@" + %s %s\n", sel_getName(method_getName(vpMs[vi])), method_getTypeEncoding(vpMs[vi]) ?: ""];
+ free(vpMs);
+}
+BOOL vpOK = [vpOut writeToFile:@"/tmp/duo-sim-baseline-classdump3.txt" atomically:YES encoding:NSUTF8StringEncoding error:nil];
+[NSString stringWithFormat:@"wrote=%d len=%lu", vpOK, (unsigned long)vpOut.length]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-enable-autolock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-enable-autolock.lldb
new file mode 100644
index 00000000..709970fe
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-enable-autolock.lldb
@@ -0,0 +1,10 @@
+expr -l objc -O --
+NSObject *vpIdle = [(NSObject *)[UIApplication sharedApplication] valueForKey:@"_idleTimerGlobalCoordinator"];
+NSDictionary *vpAs = (NSDictionary *)[vpIdle valueForKey:@"_idleTimerDisableAssertions"];
+NSMutableString *vpOut = [NSMutableString stringWithFormat:@"before: disabled=%d timer=%@ assertions=%@\n", ((BOOL (*)(id, SEL))objc_msgSend)(vpIdle, @selector(isIdleTimerDisabled)), [(NSObject *)((id (*)(id, SEL))objc_msgSend)(vpIdle, @selector(idleTimer)) description], [vpAs description]];
+for (NSString *vpK in [vpAs allKeys]) { NSObject *vpA = (NSObject *)vpAs[vpK];
+((void (*)(id, SEL))objc_msgSend)(vpA, @selector(invalidate)); }
+((void (*)(id, SEL, id))objc_msgSend)(vpIdle, @selector(resetIdleTimerForReason:), @"vphone baseline: auto-lock test");
+[vpOut appendFormat:@"after: disabled=%d timer=%@ assertions=%@", ((BOOL (*)(id, SEL))objc_msgSend)(vpIdle, @selector(isIdleTimerDisabled)), [(NSObject *)((id (*)(id, SEL))objc_msgSend)(vpIdle, @selector(idleTimer)) description], [(NSObject *)[vpIdle valueForKey:@"_idleTimerDisableAssertions"] description]];
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-home-press.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-home-press.lldb
new file mode 100644
index 00000000..857b6088
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-home-press.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- ((void (*)(id, SEL, id))objc_msgSend)((id)[UIApplication sharedApplication], NSSelectorFromString(@"_simulateHomeButtonPressWithCompletion:"), nil); @"home button press simulated"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-lock-press.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-lock-press.lldb
new file mode 100644
index 00000000..fca0c3e8
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-lock-press.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- ((void (*)(id, SEL))objc_msgSend)((id)[UIApplication sharedApplication], NSSelectorFromString(@"_simulateLockButtonPress")); @"lock button press simulated"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-lockstate.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-lockstate.lldb
new file mode 100644
index 00000000..a401fce0
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-lockstate.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- NSObject *vpL = (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance)); [NSString stringWithFormat:@"locked=%d screenOn=%d", ((BOOL (*)(id, SEL))objc_msgSend)(vpL, @selector(isUILocked)), ((BOOL (*)(id, SEL))objc_msgSend)(vpL, NSSelectorFromString(@"isScreenOn"))]
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-merge.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-merge.zsh
new file mode 100755
index 00000000..188d62eb
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-merge.zsh
@@ -0,0 +1,117 @@
+#!/bin/zsh
+# springboard-merge.zsh [out.json]
+#
+# Merge the steps recorded by springboard-run.zsh (raw/springboard/steps) into
+# springboard.json in the README record format. The step list below fixes the order, the
+# "posture" label of each step (posture + how it was reached + device orientation / app),
+# and is copied into meta.steps together with each step's posture.zsh JSON.
+#
+# Normalisation: Objective-C object addresses (0x followed by 6+ hex digits) in string
+# values are replaced by "0x*" so that values can be compared with vphone-duo; the raw
+# transcripts in raw/springboard/steps keep them.
+set -euo pipefail
+here=${0:a:h}
+root=${here:h}
+jq=/opt/homebrew/bin/jq
+out=${1:-$root/springboard.json}
+steps=$root/raw/springboard/steps
+sim=048B820B-86E8-43F9-9DF1-F76802AD6DB8
+
+# step-label | posture label | note
+table=(
+ "closed-boot|closed(boot)|first readback after boot; never unfolded; home screen"
+ "book-after-closed|book(after-closed)|posture.zsh book: instant anchor at closed, sweep 0->100 deg"
+ "open-after-book|open(after-book)|sweep 100->180 deg"
+ "closed-after-open|closed(after-open)|fold: sweep 180->0 deg"
+ "open-after-closed|open(after-closed)|unfold: sweep 0->180 deg"
+ "book-after-open|book(after-open)|POSTURE_ANCHOR=none: sweep 180->100 deg"
+ "closed-after-book|closed(after-book)|fold: sweep 100->0 deg"
+ "closed-landscapeLeft|closed[device:landscapeLeft]|-deviceOrientation=landscapeLeft, home screen"
+ "closed-landscapeRight|closed[device:landscapeRight]|-deviceOrientation=landscapeRight, home screen"
+ "closed-portraitUpsideDown|closed[device:portraitUpsideDown]|-deviceOrientation=portraitUpsideDown, home screen"
+ "closed-portrait|closed[device:portrait]|back to portrait, home screen"
+ "open-landscapeLeft|open[device:landscapeLeft]|unfold from closed with -deviceOrientation=landscapeLeft, home screen; SpringBoard crashed ~50 s later during the next step (raw/springboard/crash)"
+ "open-portraitUpsideDown|open[device:portraitUpsideDown](after SpringBoard relaunch)|first step on the relaunched SpringBoard (pid changed); home screen"
+ "open-portrait|open[device:portrait](after SpringBoard relaunch)|home screen"
+ "open-landscapeLeft-r2|open[device:landscapeLeft](after SpringBoard relaunch)|home screen, POSTURE_SETTLE=25"
+ "open-landscapeRight|open[device:landscapeRight](after SpringBoard relaunch)|home screen, POSTURE_SETTLE=25"
+ "book-landscapeLeft|book[device:landscapeLeft](after SpringBoard relaunch)|anchor closed, sweep to 100 deg in landscapeLeft"
+ "book-landscapeRight|book[device:landscapeRight](after SpringBoard relaunch)|anchor closed, sweep to 100 deg"
+ "book-portraitUpsideDown|book[device:portraitUpsideDown](after SpringBoard relaunch)|anchor closed, sweep to 100 deg"
+ "book-portrait|book[device:portrait](after SpringBoard relaunch)|anchor closed, sweep to 100 deg"
+ "closed-after-book-r2|closed(after-book)(after SpringBoard relaunch)|fold, portrait, home screen"
+ "closed-safari-landscapeLeft|closed[device:landscapeLeft,app:MobileSafari]|cover rotation with a landscape-capable app"
+ "closed-safari-landscapeRight|closed[device:landscapeRight,app:MobileSafari]|"
+ "closed-safari-portrait|closed[device:portrait,app:MobileSafari](after landscapeRight)|"
+ "open-safari-landscapeLeft|open[device:landscapeLeft,app:MobileSafari]|"
+ "open-safari-landscapeRight|open[device:landscapeRight,app:MobileSafari]|"
+ "open-safari-portraitUpsideDown|open[device:portraitUpsideDown,app:MobileSafari]|"
+ "open-safari-portrait|open[device:portrait,app:MobileSafari](after portraitUpsideDown)|"
+ "closed-safari-portrait-initial|closed[device:portrait,app:MobileSafari](just launched)|re-captured after the lock tests (the first capture was overwritten): simctl launch com.apple.mobilesafari on the cover"
+ "open-safari-portrait-unfold|open[device:portrait,app:MobileSafari](after-closed)|re-captured after the lock tests: unfold with Safari"
+ "open-before-autolock|open(home screen, before auto-lock)|Safari terminated; status only"
+ "open-autolocked|open(auto-locked)|idle-timer disable assertion invalidated, waited 80 s"
+ "closed-after-autolock-open|closed(after auto-lock in open)|fold while auto-locked"
+ "closed-after-autolock-open-wake|closed(after auto-lock in open, after simulated home press)|-[SpringBoard _simulateHomeButtonPressWithCompletion:nil]: no effect (still AOD, locked)"
+ "closed-after-autolock-open-lockwake|closed(after auto-lock in open, woken by lock button)|-[SpringBoard _simulateLockButtonPress] wakes the cover to the lock screen"
+ "book-before-autolock|book(home screen, before auto-lock)|"
+ "book-autolocked|book(auto-locked)|"
+ "closed-after-autolock-book|closed(after auto-lock in book)|fold while auto-locked"
+ "open-before-lockbutton|open(unlocked, before lock button)|auto-lock disabled again, unlocked with attemptUnlockWithPasscode:nil"
+ "open-lockbutton|open(locked by lock button)|-[SpringBoard _simulateLockButtonPress]"
+ "closed-after-lockbutton-open|closed(after lock button in open)|fold while locked by the lock button"
+ "closed-boot2|closed(boot, second boot)|after shutdown/boot"
+ "open-boot2|open(after-closed, second boot)|first unfold of the second boot, portrait"
+ "open-boot2-landscapeLeft|open[device:landscapeLeft](second boot)|"
+ "open-boot2-portrait|open[device:portrait](second boot, after a rotation)|"
+)
+
+runtime=$(xcrun simctl list runtimes -j | $jq -c '.runtimes[] | select(.identifier == "com.apple.CoreSimulator.SimRuntime.iOS-27-1") | {identifier, version, buildversion}')
+device=$(xcrun simctl list devices -j | $jq -c --arg u $sim '.devices[] | .[] | select(.udid == $u) | {name, udid, deviceTypeIdentifier}')
+xcode=$(xcodebuild -version | tr '\n' ' ' | sed 's/ *$//')
+
+work=$(mktemp -d -t sbmerge); trap 'rm -rf "$work"' EXIT
+print -n '[' > $work/records.json
+print -n '[' > $work/meta.json
+first=1
+for row in $table; do
+ step=${row%%|*}; rest=${row#*|}; label=${rest%%|*}; note=${rest#*|}
+ [[ -e $steps/$step.records.json ]] || { print -u2 "springboard-merge: skipping missing step $step"; continue }
+ (( first )) || { print -n ',' >> $work/records.json; print -n ',' >> $work/meta.json }
+ first=0
+ $jq -c --arg posture "$label" '
+ def orient: {"0": "unknown", "1": "portrait", "2": "portraitUpsideDown", "3": "landscapeLeft", "4": "landscapeRight"}[tostring] // "unknown";
+ def norm: if type == "string" then gsub("0x[0-9a-f]{6,}"; "0x*")
+ elif type == "array" then map(norm)
+ elif type == "object" then with_entries(.value |= norm) else . end;
+ (.orientation | orient) as $o
+ | [.records[] | {api, kind, process: "SpringBoard", posture: $posture, orientation: $o, call, value: (.value | norm), error}]
+ | .[]' $steps/$step.records.json | $jq -s -c '.' | sed -e 's/^\[//' -e 's/\]$//' >> $work/records.json
+ pj=null
+ [[ -e $steps/$step.posture.json ]] && pj=$(cat $steps/$step.posture.json)
+ $jq -n -c --arg step $step --arg posture "$label" --arg note "$note" --argjson pj "$pj" \
+ --slurpfile r $steps/$step.records.json \
+ '{step: $step, posture: $posture, note: $note, primary_scene_interfaceOrientation: $r[0].orientation, record_count: ($r[0].records | length), posture_tool: $pj}' >> $work/meta.json
+done
+print ']' >> $work/records.json
+print ']' >> $work/meta.json
+
+$jq -n \
+ --argjson runtime "$runtime" --argjson device "$device" --arg xcode "$xcode" \
+ --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg host "$(sw_vers -productVersion) $(sysctl -n machdep.cpu.brand_string)" \
+ --slurpfile recs $work/records.json --slurpfile meta $work/meta.json '
+ {
+ meta: {
+ domain: "springboard", runtime: $runtime, device: $device, xcode: $xcode, host: $host, date: $date,
+ posture_mechanism: "SBDisplayToolServiceCoordinator performDisplaySwapWithSettings: (tools/posture.zsh), -deviceOrientation= for device orientation",
+ probe: "probes/springboard-state.lldb (one expression; records every listed getter of the objects reached from -[SpringBoard _displayToolService])",
+ orientation_field: "UIWindowScene.interfaceOrientation of SBDisplayContentModeCoordinator.primaryWindowScene (as in smoke.json); the requested device orientation is in the posture label",
+ api_naming: "SBWindowScene[cover] = surfaceType 1 (SB-main, display Main), SBWindowScene[inner] = surfaceType 2 (com.apple.springboard.bringup, Unknown.main[3]); SBFDisplayProxy[cover|inner] likewise",
+ normalisation: "0x[0-9a-f]{6,} replaced by 0x* in string values; raw values in raw/springboard/steps/*-state.raw.txt",
+ notes: "see springboard.md",
+ postures: [$meta[0][] | .posture_tool | select(. != null)],
+ steps: [$meta[0][] | del(.posture_tool)]
+ },
+ records: $recs[0]
+ }' > $out
+print -- "springboard-merge: $($jq '.records | length' $out) records from $($jq '.meta.steps | length' $out) steps -> $out"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-run.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-run.zsh
new file mode 100755
index 00000000..8d15a086
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-run.zsh
@@ -0,0 +1,40 @@
+#!/bin/zsh
+# springboard-run.zsh <step-label> <posture verb> [posture args...]
+# springboard-run.zsh <step-label> - (no posture change: state probe only)
+#
+# One step of the SpringBoard-domain baseline: drive the posture with tools/posture.zsh
+# (artifacts in raw/springboard/posture), then run probes/springboard-state.lldb in
+# SpringBoard and keep its JSON line. Results:
+# raw/springboard/steps/<label>.posture.json posture.zsh output (+ "exit" field)
+# raw/springboard/steps/<label>-state.txt cleaned transcript (+ .raw.txt)
+# raw/springboard/steps/<label>.records.json {"orientation": n, "records": [...]}
+# Environment: POSTURE_ANCHOR / POSTURE_SETTLE are passed through to posture.zsh;
+# SB_NO_RETRY=1 keeps an unverified posture (exit 3) instead of retrying it once.
+set -euo pipefail
+here=${0:a:h}
+root=${here:h}
+jq=/opt/homebrew/bin/jq
+sim=048B820B-86E8-43F9-9DF1-F76802AD6DB8
+label=${1:?label}; shift
+steps=$root/raw/springboard/steps
+mkdir -p $steps
+
+if [[ ${1:-} != - ]]; then
+ rc=0
+ POSTURE_OUT=$root/raw/springboard/posture $root/tools/posture.zsh $sim "$@" > $steps/$label.posture.tmp || rc=$?
+ if (( rc == 3 )) && [[ -z ${SB_NO_RETRY:-} ]]; then
+ # Not verified: wait out the 10 s testing lock, read the status, retry once.
+ print -u2 "springboard-run: $label: posture exit 3, retrying after the testing lock"
+ POSTURE_OUT=$root/raw/springboard/posture $root/tools/posture.zsh $sim status > $steps/$label.status-before-retry.json || true
+ sleep 11
+ rc=0
+ POSTURE_OUT=$root/raw/springboard/posture $root/tools/posture.zsh $sim "$@" > $steps/$label.posture.tmp || rc=$?
+ fi
+ $jq --argjson rc $rc '. + {exit: $rc}' $steps/$label.posture.tmp > $steps/$label.posture.json
+ rm -f $steps/$label.posture.tmp
+ print -u2 "springboard-run: $label: posture exit $rc lit=$($jq -r .screenshots.lit_panel $steps/$label.posture.json) policy=$($jq -r .springboard.prevailing_policy $steps/$label.posture.json)"
+fi
+PROBE_TIMEOUT=${PROBE_TIMEOUT:-150} $root/tools/probe.zsh $sim SpringBoard $here/springboard-state.lldb $steps/$label-state.txt
+grep -E '^\{"(records|orientation)"' $steps/$label-state.txt > $steps/$label.records.json || {
+ print -u2 "springboard-run: $label: no JSON in $steps/$label-state.txt"; exit 1 }
+print -u2 "springboard-run: $label: $($jq '.records | length' $steps/$label.records.json) records, primary orientation $($jq .orientation $steps/$label.records.json)"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-state.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-state.lldb
new file mode 100644
index 00000000..0d5a68ef
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-state.lldb
@@ -0,0 +1,373 @@
+expr -l objc -O --
+NSMutableArray *vpRecs = [NSMutableArray array];
+NSArray *vpSkip = @[@"SBWindowScene.liftToWakeController"];
+NSString *(^vpLabel)(NSObject *) = ^NSString *(NSObject *vs) {
+ if (!vs || ![vs isKindOfClass:NSClassFromString(@"SBWindowScene")]) return (NSString *)nil;
+ long long vst = ((long long (*)(id, SEL))objc_msgSend)(vs, @selector(surfaceType));
+ NSString *vsid = [[(UIScene *)vs session] persistentIdentifier] ?: @"?";
+ NSString *vsurf = vst == 1 ? @"cover" : (vst == 2 ? @"inner" : [NSString stringWithFormat:@"surface%lld", vst]);
+ return [NSString stringWithFormat:@"%@:%@", vsurf, vsid];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) {
+ return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)};
+};
+id (^vpJ)(NSObject *) = ^id(NSObject *vo) {
+ if (!vo) return (id)[NSNull null];
+ if ([vo isKindOfClass:[NSString class]] || [vo isKindOfClass:[NSNumber class]] || [vo isKindOfClass:[NSNull class]]) return (id)vo;
+ if ([vo isKindOfClass:NSClassFromString(@"SBWindowScene")]) return (id)vpLabel(vo);
+ if ([vo isKindOfClass:[NSValue class]]) {
+ NSString *vt = [NSString stringWithUTF8String:[(NSValue *)vo objCType]];
+ if ([vt hasPrefix:@"{CGRect="]) return (id)vpRect([(NSValue *)vo CGRectValue]);
+ if ([vt hasPrefix:@"{CGSize="]) { CGSize vz = [(NSValue *)vo CGSizeValue]; return (id)@{@"width": @(vz.width), @"height": @(vz.height)}; }
+ if ([vt hasPrefix:@"{CGPoint="]) { CGPoint vp = [(NSValue *)vo CGPointValue]; return (id)@{@"x": @(vp.x), @"y": @(vp.y)}; }
+ }
+ return (id)[vo description];
+};
+id (^vpBox)(NSString *, void *) = ^id(NSString *vt, void *vb) {
+ while (vt.length && [@"rnNoORVA" containsString:[vt substringToIndex:1]]) vt = [vt substringFromIndex:1];
+ unichar vc = vt.length ? [vt characterAtIndex:0] : 'v';
+ switch (vc) {
+ case 'B': return (id)(*(BOOL *)vb ? @YES : @NO);
+ case 'c': return (id)@(*(signed char *)vb);
+ case 'C': return (id)@(*(unsigned char *)vb);
+ case 's': return (id)@(*(short *)vb);
+ case 'S': return (id)@(*(unsigned short *)vb);
+ case 'i': return (id)@(*(int *)vb);
+ case 'I': return (id)@(*(unsigned int *)vb);
+ case 'l': case 'q': return (id)@(*(long long *)vb);
+ case 'L': case 'Q': return (id)@(*(unsigned long long *)vb);
+ case 'f': return (id)@(*(float *)vb);
+ case 'd': return (id)@(*(double *)vb);
+ case '#': return (id)NSStringFromClass(*(Class *)vb);
+ case '{': return vpJ([NSValue valueWithBytes:vb objCType:vt.UTF8String]);
+ default: return (id)[NSString stringWithFormat:@"<unboxed type %@>", vt];
+ }
+};
+NSDictionary *(^vpCall)(NSObject *, NSString *) = ^NSDictionary *(NSObject *vo, NSString *vsn) {
+ if (!vo) return (NSDictionary *)@{@"e": @"receiver is nil"};
+ SEL vs = NSSelectorFromString(vsn);
+ if (![vo respondsToSelector:vs]) return (NSDictionary *)@{@"e": [NSString stringWithFormat:@"%s does not respond to %@", class_getName(object_getClass(vo)), vsn]};
+ NSMethodSignature *vsig = [vo methodSignatureForSelector:vs];
+ if (vsig.numberOfArguments != 2) return (NSDictionary *)@{@"e": @"takes arguments"};
+ NSInvocation *vinv = [NSInvocation invocationWithMethodSignature:vsig];
+ [vinv setTarget:vo]; [vinv setSelector:vs]; [vinv invoke];
+ NSString *vt = [NSString stringWithUTF8String:vsig.methodReturnType];
+ while (vt.length && [@"rnNoORVA" containsString:[vt substringToIndex:1]]) vt = [vt substringFromIndex:1];
+ if ([vt hasPrefix:@"v"]) return (NSDictionary *)@{@"v": [NSNull null]};
+ if ([vt hasPrefix:@"@"]) { void *vp = NULL; [vinv getReturnValue:&vp]; return (NSDictionary *)@{@"v": vpJ((__bridge NSObject *)vp)}; }
+ NSUInteger vlen = vsig.methodReturnLength;
+ void *vbuf = calloc(1, vlen < 16 ? 16 : vlen);
+ [vinv getReturnValue:vbuf];
+ id vr = vpBox(vt, vbuf);
+ free(vbuf);
+ return (NSDictionary *)@{@"v": vr ?: [NSNull null]};
+};
+NSObject *(^vpObj)(NSObject *, NSString *) = ^NSObject *(NSObject *vo, NSString *vsn) {
+ if (!vo || ![vo respondsToSelector:NSSelectorFromString(vsn)]) return (NSObject *)nil;
+ return (NSObject *)((id (*)(id, SEL))objc_msgSend)(vo, NSSelectorFromString(vsn));
+};
+NSObject *(^vpIvObj)(NSObject *, NSString *) = ^NSObject *(NSObject *vo, NSString *vn) {
+ if (!vo) return (NSObject *)nil;
+ Ivar viv = class_getInstanceVariable(object_getClass(vo), vn.UTF8String);
+ if (!viv) return (NSObject *)nil;
+ return (NSObject *)object_getIvar(vo, viv);
+};
+NSDictionary *(^vpIvar)(NSObject *, NSString *) = ^NSDictionary *(NSObject *vo, NSString *vn) {
+ if (!vo) return (NSDictionary *)@{@"e": @"receiver is nil"};
+ Ivar viv = class_getInstanceVariable(object_getClass(vo), vn.UTF8String);
+ if (!viv) return (NSDictionary *)@{@"e": [NSString stringWithFormat:@"%s has no ivar %@", class_getName(object_getClass(vo)), vn]};
+ NSString *vt = [NSString stringWithUTF8String:ivar_getTypeEncoding(viv) ?: ""];
+ if ([vt hasPrefix:@"@?"]) return (NSDictionary *)@{@"v": object_getIvar(vo, viv) ? @"<block>" : [NSNull null]};
+ if ([vt hasPrefix:@"@"]) return (NSDictionary *)@{@"v": vpJ((NSObject *)object_getIvar(vo, viv))};
+ if ([vt hasPrefix:@"{"]) return (NSDictionary *)@{@"e": [NSString stringWithFormat:@"struct ivar %@ not boxed", vn]};
+ return (NSDictionary *)@{@"v": vpBox(vt, (char *)(__bridge void *)vo + ivar_getOffset(viv)) ?: [NSNull null]};
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, NSDictionary *) = ^(NSString *api, NSString *kind, NSString *call, NSDictionary *res) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": res[@"v"] ?: [NSNull null], @"error": res[@"e"] ?: [NSNull null]}];
+};
+NSDictionary *(^vpV)(id) = ^NSDictionary *(id vx) { return (NSDictionary *)@{@"v": vx ?: [NSNull null]}; };
+void (^vpGetters)(NSObject *, NSString *, NSString *, NSArray *) = ^(NSObject *vo, NSString *vapi, NSString *vrecv, NSArray *vsels) {
+ for (NSString *vsn in vsels) vpAdd([NSString stringWithFormat:@"%@.%@", vapi, vsn], @"private", [NSString stringWithFormat:@"[%@ %@]", vrecv, vsn], vpCall(vo, vsn));
+};
+void (^vpIvars)(NSObject *, NSString *, NSString *, NSArray *) = ^(NSObject *vo, NSString *vapi, NSString *vrecv, NSArray *vnames) {
+ for (NSString *vn in vnames) vpAdd([NSString stringWithFormat:@"%@.%@", vapi, vn], @"private", [NSString stringWithFormat:@"%@->%@", vrecv, vn], vpIvar(vo, vn));
+};
+void (^vpProps)(NSObject *, NSString *, NSString *, Class) = ^(NSObject *vo, NSString *vapi, NSString *vrecv, Class vcls) {
+ unsigned int vn = 0;
+ objc_property_t *vps = class_copyPropertyList(vcls, &vn);
+ NSMutableArray *vnames = [NSMutableArray array];
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vpn = [NSString stringWithUTF8String:property_getName(vps[vi])];
+ if ([@[@"hash", @"superclass", @"description", @"debugDescription"] containsObject:vpn]) continue;
+ if ([vpSkip containsObject:[NSString stringWithFormat:@"%s.%@", class_getName(vcls), vpn]]) { [vpRecs addObject:@{@"api": [NSString stringWithFormat:@"%@.%@", vapi, vpn], @"kind": @"private", @"call": [NSString stringWithFormat:@"[%@ %@]", vrecv, vpn], @"value": [NSNull null], @"error": @"not called: getter crashed SpringBoard's probe expression (EXC_BAD_ACCESS on the stack) in this sim"}]; continue; }
+ NSString *vattr = [NSString stringWithUTF8String:property_getAttributes(vps[vi])];
+ NSString *vget = vpn;
+ for (NSString *va in [vattr componentsSeparatedByString:@","]) if ([va hasPrefix:@"G"]) vget = [va substringFromIndex:1];
+ [vnames addObject:@[vpn, vget, vattr]];
+ }
+ free(vps);
+ [vnames sortUsingComparator:^NSComparisonResult(NSArray *a, NSArray *b) { return [(NSString *)a[0] compare:(NSString *)b[0]]; }];
+ for (NSArray *ve in vnames) { NSString *ve0 = (NSString *)ve[0]; NSString *ve1 = (NSString *)ve[1]; NSString *ve2 = (NSString *)ve[2];
+ NSDictionary *vres = vpCall(vo, ve1);
+ if ([ve2 hasPrefix:@"T@"] && ![ve2 hasPrefix:@"T@\"NSString\""] && ![ve2 hasPrefix:@"T@\"NSNumber\""] && vres[@"v"] && ![(NSObject *)vres[@"v"] isKindOfClass:[NSNull class]]) {
+ NSObject *vobj = vpObj(vo, ve1);
+ if ([vobj isKindOfClass:NSClassFromString(@"PTSettings")] || [vobj isKindOfClass:NSClassFromString(@"SBWindowScene")]) { }
+ else if (vobj) vres = @{@"v": [NSString stringWithFormat:@"<%s>", class_getName(object_getClass(vobj))]};
+ }
+ vpAdd([NSString stringWithFormat:@"%@.%@", vapi, ve0], @"private", [NSString stringWithFormat:@"[%@ %@]", vrecv, ve1], vres);
+ }
+};
+NSObject *vpApp = (NSObject *)[UIApplication sharedApplication];
+NSObject *vpSvc = vpIvObj(vpApp, @"_displayToolService");
+NSObject *vpDCM = vpIvObj(vpSvc, @"_displayContentModeCoordinator");
+NSObject *vpWSM = vpIvObj(vpSvc, @"_windowSceneManager");
+NSObject *vpPose = vpIvObj(vpSvc, @"_devicePoseProvider");
+NSObject *vpSwap = vpIvObj(vpSvc, @"_swapCoordinator");
+NSObject *vpRes = vpIvObj(vpDCM, @"_resolver");
+NSArray *vpScenes = [[(NSSet *)vpObj(vpWSM, @"connectedWindowScenes") allObjects] sortedArrayUsingComparator:^NSComparisonResult(NSObject *a, NSObject *b) { return [vpLabel(a) compare:vpLabel(b)]; }];
+NSObject *vpPrimary = vpObj(vpDCM, @"primaryWindowScene");
+// ---- SBWindowSceneManager
+vpAdd(@"SBWindowSceneManager.connectedWindowScenes", @"private", @"[SBWindowSceneManager connectedWindowScenes]", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vs in vpScenes) [vl addObject:vpLabel(vs) ?: [(NSObject *)vs description]]; vl; })));
+vpGetters(vpWSM, @"SBWindowSceneManager", @"SBWindowSceneManager", @[@"activeDisplayWindowScene", @"embeddedDisplayWindowScene", @"_embeddedDisplayWindowScene", @"_bringupDisplayWindowScene", @"_continuityDisplayWindowScene", @"_extendedDisplayWindowScene", @"windowSceneForAlertItems", @"windowSceneForKeyboardFocus", @"windowSceneForDisplayConfigurationForClassicApps", @"lastInteractedScene", @"restartSnapshotDisplays", @"activeRestartSnapshotDisplay"]);
+// ---- SBDisplayContentModeCoordinator
+vpGetters(vpDCM, @"SBDisplayContentModeCoordinator", @"SBDisplayContentModeCoordinator", @[@"primaryWindowScene", @"activeWindowScene", @"currentTransitionContext", @"updateLinkProvider"]);
+vpAdd(@"SBDisplayContentModeCoordinator.preferredTransitionStyleForDisplayContentModeResolver", @"private", @"[SBDisplayContentModeCoordinator preferredTransitionStyleForDisplayContentModeResolver:_resolver]", vpV(@(((long long (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(preferredTransitionStyleForDisplayContentModeResolver:), vpRes))));
+vpIvars(vpDCM, @"SBDisplayContentModeCoordinator", @"SBDisplayContentModeCoordinator", @[@"_lastHingeMotionIdleTimerResetTime", @"_lastInteractiveProgressIdleTimerResetTime", @"_prewarmStartTime", @"_prewarmAssertionsBySurfaceType", @"_prewarmAttemptsBySurfaceType"]);
+vpAdd(@"SBDisplayContentModeCoordinator._connectedWindowScenes", @"private", @"SBDisplayContentModeCoordinator->_connectedWindowScenes", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vs in (NSArray *)vpIvObj(vpDCM, @"_connectedWindowScenes")) [vl addObject:vpLabel(vs) ?: [vs description]]; vl; })));
+vpAdd(@"SBDisplayContentModeCoordinator._preventBacklightActivationAssertions.count", @"private", @"SBDisplayContentModeCoordinator->_preventBacklightActivationAssertions.count", vpV(@([(NSArray *)vpIvObj(vpDCM, @"_preventBacklightActivationAssertions") count])));
+vpAdd(@"SBDisplayContentModeCoordinator._windowScenesToContexts.count", @"private", @"SBDisplayContentModeCoordinator->_windowScenesToContexts.count", vpV(@([(NSMapTable *)vpIvObj(vpDCM, @"_windowScenesToContexts") count])));
+NSMapTable *vpObsMap = (NSMapTable *)vpIvObj(vpDCM, @"_observersToProxies");
+NSMutableArray *vpObsNames = [NSMutableArray array];
+NSObject *vpLSPolicy = nil;
+for (NSObject *vk in [[vpObsMap keyEnumerator] allObjects]) {
+ NSObject *vprox = [vpObsMap objectForKey:vk];
+ NSHashTable *vint = (NSHashTable *)vpIvObj(vprox, @"_windowScenesOfInterest");
+ NSMutableArray *vil = [NSMutableArray array];
+ for (NSObject *vs in [vint allObjects]) [vil addObject:vpLabel(vs) ?: @"?"];
+ [vil sortUsingSelector:@selector(compare:)];
+ BOOL vall = ((BOOL (*)(id, SEL))objc_msgSend)(vprox, @selector(wantsAllTransitions));
+ [vpObsNames addObject:[NSString stringWithFormat:@"%s all=%d scenes=%@", class_getName(object_getClass(vk)), vall, [vil componentsJoinedByString:@"|"]]];
+ if ([vk isKindOfClass:NSClassFromString(@"SBDisplayContentModeLockScreenActiveDisplayPolicy")]) vpLSPolicy = vk;
+}
+[vpObsNames sortUsingSelector:@selector(compare:)];
+vpAdd(@"SBDisplayContentModeCoordinator.observers.count", @"private", @"[SBDisplayContentModeCoordinator->_observersToProxies count]", vpV(@(vpObsMap.count)));
+vpAdd(@"SBDisplayContentModeCoordinator.observers", @"private", @"SBDisplayContentModeCoordinator->_observersToProxies keys (class, wantsAllTransitions, windowScenesOfInterest)", vpV(vpObsNames));
+for (long long vm = 0; vm <= 3; vm++) {
+ NSMutableArray *vl = [NSMutableArray array];
+ for (NSObject *vs in (NSArray *)((id (*)(id, SEL, long long))objc_msgSend)(vpDCM, @selector(windowScenesWithDisplayContentMode:), vm)) [vl addObject:vpLabel(vs) ?: [vs description]];
+ vpAdd(@"SBDisplayContentModeCoordinator.windowScenesWithDisplayContentMode", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator windowScenesWithDisplayContentMode:%lld]", vm], vpV(vl));
+}
+// ---- resolver
+vpAdd(@"SBFDisplayContentModeResolver.description", @"private", @"[SBDisplayContentModeCoordinator->_resolver description]", vpV([vpRes description]));
+vpGetters(vpRes, @"SBFDisplayContentModeResolver", @"_resolver", @[@"succinctDescription", @"delegate", @"currentTransitionContext", @"_continuousFoldEffectProgress", @"_mechanicalHingeAngleDegrees"]);
+vpIvars(vpRes, @"SBFDisplayContentModeResolver", @"_resolver", @[@"_isReadyToResolve", @"_isInvalidated", @"_delegateCalloutDepth", @"_preferredTransitionStyle", @"_currentTransitionCoordinator"]);
+NSObject *vpResolution = vpIvObj(vpRes, @"_resolution");
+vpAdd(@"SBFResolvedDisplayContentMode.description", @"private", @"_resolver->_resolution", vpV([vpResolution description]));
+vpAdd(@"SBFResolvedDisplayContentMode.prevailingPolicy", @"private", @"[_resolver->_resolution prevailingPolicy].name", vpCall(vpObj(vpResolution, @"prevailingPolicy"), @"name"));
+vpIvars(vpResolution, @"SBFResolvedDisplayContentMode", @"_resolver->_resolution", @[@"_targetModesByIdentifier", @"_resolvedModesByIdentifier", @"_swapsContentModeByIdentifier"]);
+NSMutableArray *vpPolicies = [NSMutableArray arrayWithArray:(NSArray *)vpIvObj(vpRes, @"_policies") ?: @[]];
+if (vpIvObj(vpRes, @"_yoinkPolicy")) [vpPolicies addObject:vpIvObj(vpRes, @"_yoinkPolicy")];
+if (vpIvObj(vpRes, @"_forceCoverDisplayOnlyPolicy")) [vpPolicies addObject:vpIvObj(vpRes, @"_forceCoverDisplayOnlyPolicy")];
+NSMutableArray *vpPolList = [NSMutableArray array];
+for (NSObject *vpol in vpPolicies) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ vd[@"class"] = NSStringFromClass(object_getClass(vpol));
+ vd[@"name"] = vpCall(vpol, @"name")[@"v"];
+ vd[@"swapsContentMode"] = vpCall(vpol, @"swapsContentMode")[@"v"];
+ vd[@"isUserInitiated"] = vpCall(vpol, @"isUserInitiated")[@"v"];
+ if ([vpol respondsToSelector:@selector(preferredSurfaceType)]) vd[@"preferredSurfaceType"] = vpCall(vpol, @"preferredSurfaceType")[@"v"];
+ if ([vpol respondsToSelector:NSSelectorFromString(@"assertionSummary")]) vd[@"assertionSummary"] = vpCall(vpol, @"assertionSummary")[@"v"];
+ if (vpIvObj(vpol, @"_activationAssertions")) vd[@"activationAssertions.count"] = @([(NSSet *)vpIvObj(vpol, @"_activationAssertions") count]);
+ [vpPolList addObject:vd];
+}
+vpAdd(@"SBFDisplayContentModeResolver.policies", @"private", @"_resolver->_policies + _yoinkPolicy + _forceCoverDisplayOnlyPolicy: class/name/swapsContentMode/isUserInitiated", vpV(vpPolList));
+NSDictionary *vpProxies = (NSDictionary *)vpIvObj(vpRes, @"_displayProxies");
+for (NSString *vk in [[vpProxies allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vpx = vpProxies[vk];
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ for (NSString *vsn in @[@"identifier", @"surfaceType", @"isExternal", @"appliedContentMode", @"targetContentMode"]) vd[vsn] = vpCall(vpx, vsn)[@"v"];
+ vd[@"resolver._resolvedModeForDisplay"] = @(((long long (*)(id, SEL, id))objc_msgSend)(vpRes, NSSelectorFromString(@"_resolvedModeForDisplay:"), vpx));
+ vd[@"resolver._targetModeForDisplay"] = @(((long long (*)(id, SEL, id))objc_msgSend)(vpRes, NSSelectorFromString(@"_targetModeForDisplay:"), vpx));
+ long long vpxs = ((long long (*)(id, SEL))objc_msgSend)(vpx, @selector(surfaceType)); vpAdd([NSString stringWithFormat:@"SBFDisplayProxy[%@]", vpxs == 1 ? @"cover" : (vpxs == 2 ? @"inner" : [NSString stringWithFormat:@"surface%lld", vpxs])], @"private", [NSString stringWithFormat:@"_resolver->_displayProxies[@\"%@\"] identifier/surfaceType/isExternal/appliedContentMode/targetContentMode", vk], vpV(vd));
+}
+// ---- window scenes
+for (NSObject *vws in vpScenes) {
+ NSString *vl = vpLabel(vws);
+ NSString *vsurf = [vl componentsSeparatedByString:@":"][0];
+ NSString *vapi = [NSString stringWithFormat:@"SBWindowScene[%@]", vsurf];
+ NSString *vrecv = [NSString stringWithFormat:@"<SBWindowScene %@>", vl];
+ UIWindowScene *vu = (UIWindowScene *)vws;
+ vpAdd([vapi stringByAppendingString:@".label"], @"private", [vrecv stringByAppendingString:@" surfaceType + session.persistentIdentifier"], vpV(vl));
+ vpAdd([vapi stringByAppendingString:@".interfaceOrientation"], @"public", [vrecv stringByAppendingString:@".interfaceOrientation"], vpV(@(vu.interfaceOrientation)));
+ vpAdd([vapi stringByAppendingString:@".coordinateSpace.bounds"], @"public", [vrecv stringByAppendingString:@".coordinateSpace.bounds"], vpV(vpRect(((CGRect (*)(id, SEL))objc_msgSend)(vu.coordinateSpace, @selector(bounds)))));
+ vpAdd([vapi stringByAppendingString:@".screen.bounds"], @"public", [vrecv stringByAppendingString:@".screen.bounds"], vpV(vpRect(vu.screen.bounds)));
+ vpAdd([vapi stringByAppendingString:@".screen.isMainScreen"], @"public", [vrecv stringByAppendingString:@".screen == [UIScreen mainScreen]"], vpV(@(vu.screen == [UIScreen mainScreen])));
+ vpAdd([vapi stringByAppendingString:@".screen.displayIdentity"], @"private", [vrecv stringByAppendingString:@".screen.displayIdentity"], vpCall(vu.screen, @"displayIdentity"));
+ vpAdd([vapi stringByAppendingString:@".activationState"], @"public", [vrecv stringByAppendingString:@".activationState"], vpV(@(vu.activationState)));
+ vpAdd([vapi stringByAppendingString:@".effectiveGeometry.interfaceOrientation"], @"public", [vrecv stringByAppendingString:@".effectiveGeometry.interfaceOrientation"], vpV(@(vu.effectiveGeometry.interfaceOrientation)));
+ vpAdd([vapi stringByAppendingString:@".effectiveGeometry.coordinateSpace.bounds"], @"public", [vrecv stringByAppendingString:@".effectiveGeometry.coordinateSpace.bounds"], vpV(vpRect(((CGRect (*)(id, SEL))objc_msgSend)(vu.effectiveGeometry.coordinateSpace, @selector(bounds)))));
+ vpAdd([vapi stringByAppendingString:@".traitCollection"], @"public", [vrecv stringByAppendingString:@".traitCollection h/v sizeClass, displayScale, userInterfaceIdiom"], vpV((@{@"horizontalSizeClass": @(vu.traitCollection.horizontalSizeClass), @"verticalSizeClass": @(vu.traitCollection.verticalSizeClass), @"displayScale": @(vu.traitCollection.displayScale), @"userInterfaceIdiom": @(vu.traitCollection.userInterfaceIdiom)})));
+ vpGetters(vws, vapi, vrecv, @[@"_sceneIdentifier", @"displayIdentity", @"isMainDisplayWindowScene", @"isExternalDisplayWindowScene", @"isIntegratedDisplayWindowScene", @"isContinuityDisplayWindowScene", @"isExtendedDisplayWindowScene", @"isResizableAppHostingWindowScene", @"isLegacyMainEmbeddedScene", @"isEmbeddedScene", @"isContinuityScene", @"isExternalDisplayScene", @"supportsMultitasking", @"supportsAdvancedMultitasking", @"supportsSplitPIP", @"sbhScreenType", @"surfaceType", @"keyboardFocusCoalitionAffinity", @"sbui_systemArbitratedInterfaceOrientation", @"_displayWindowingMode", @"_hasTollFreeDeviceAndInterfaceOrientationConversion", @"_windowsIgnoreSceneClientOrientation", @"isInvalidated", @"isInvalidating", @"lastInteractedScene"]);
+ for (long long vo = 1; vo <= 4; vo++) {
+ vpAdd([vapi stringByAppendingString:@".systemSpaceOrientationForDeviceOrientation"], @"private", [NSString stringWithFormat:@"[%@ systemSpaceOrientationForDeviceOrientation:%lld]", vrecv, vo], vpV(@(((long long (*)(id, SEL, long long))objc_msgSend)(vws, @selector(systemSpaceOrientationForDeviceOrientation:), vo))));
+ vpAdd([vapi stringByAppendingString:@".deviceOrientationForSystemSpaceOrientation"], @"private", [NSString stringWithFormat:@"[%@ deviceOrientationForSystemSpaceOrientation:%lld]", vrecv, vo], vpV(@(((long long (*)(id, SEL, long long))objc_msgSend)(vws, @selector(deviceOrientationForSystemSpaceOrientation:), vo))));
+ }
+ vpProps(vws, vapi, vrecv, NSClassFromString(@"SBWindowScene"));
+ long long vmode = ((long long (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(displayContentModeForWindowScene:), vws);
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(vmode)})));
+ vpAdd(@"SBDisplayContentModeCoordinator.isAppliedDisplayContentModeUserInitiatedForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator isAppliedDisplayContentModeUserInitiatedForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((BOOL (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(isAppliedDisplayContentModeUserInitiatedForWindowScene:), vws) ? YES : NO)})));
+ vpAdd(@"SBDisplayContentModeCoordinator.isContinuousFoldCloakInstalledForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator isContinuousFoldCloakInstalledForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((BOOL (*)(id, SEL, id))objc_msgSend)(vpDCM, @selector(isContinuousFoldCloakInstalledForWindowScene:), vws) ? YES : NO)})));
+ vpAdd(@"SBFDisplayContentModeResolver.appliedContentModeOfDisplayForWindowScene", @"private", [NSString stringWithFormat:@"[_resolver appliedContentModeOfDisplayForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((long long (*)(id, SEL, id))objc_msgSend)(vpRes, @selector(appliedContentModeOfDisplayForWindowScene:), vws))})));
+ vpAdd(@"SBFDisplayContentModeResolver._surfaceTypeForWindowScene", @"private", [NSString stringWithFormat:@"[_resolver _surfaceTypeForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((long long (*)(id, SEL, id))objc_msgSend)(vpRes, NSSelectorFromString(@"_surfaceTypeForWindowScene:"), vws))})));
+ vpAdd(@"SBFDisplayContentModeResolver._identifierForWindowScene", @"private", [NSString stringWithFormat:@"[_resolver _identifierForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": vpJ((NSObject *)((id (*)(id, SEL, id))objc_msgSend)(vpRes, NSSelectorFromString(@"_identifierForWindowScene:"), vws))})));
+ NSObject *vctx = vpObj(vws, @"displayContentModeContext");
+ vpGetters(vctx, [vapi stringByAppendingString:@".displayContentModeContext"], [vrecv stringByAppendingString:@".displayContentModeContext"], @[@"currentContentMode", @"isAppliedDisplayContentModeUserInitiated", @"isTransitioning", @"isInvolvedInTransition", @"phase", @"swapTarget", @"isInteractive", @"interactiveProgress", @"progressToSwap", @"progressFromSwap", @"continuousFoldPosition", @"continuousFoldVelocity", @"_currentContext"]);
+ NSObject *vlock = vpObj(vws, @"orientationLockManager");
+ vpGetters(vlock, [vapi stringByAppendingString:@".orientationLockManager"], [vrecv stringByAppendingString:@".orientationLockManager"], @[@"isUserLocked", @"lockedDeviceOrientation", @"lockedInterfaceOrientation", @"isLandscapeOverrideEnabled", @"_isPerDisplayLockEnabled", @"_surfaceType", @"description"]);
+ NSObject *vtpm = vpObj(vws, @"traitsPipelineManager");
+ NSString *vtapi = [vapi stringByAppendingString:@".traitsPipelineManager"];
+ NSString *vtrecv = [vrecv stringByAppendingString:@".traitsPipelineManager"];
+ vpAdd([vtapi stringByAppendingString:@".class"], @"private", [vtrecv stringByAppendingString:@" class"], vpV(vtpm ? NSStringFromClass(object_getClass(vtpm)) : nil));
+ vpGetters(vtpm, vtapi, vtrecv, @[@"systemArbitratedDeviceOrientation", @"systemArbitratedInterfaceOrientation", @"lastNonFlatDeviceOrientation", @"supportsLiveDeviceRotation", @"continuousFoldPinnedInterfaceOrientation", @"_continuousFoldPinNeedsPoseSettleWindow", @"_isBacklightOn", @"_bootOrientation", @"_orientationStateDescription", @"inputs", @"orientationStageRoles"]);
+ vpIvars(vtpm, vtapi, vtrecv, @[@"_surfaceType", @"_lastNonFlatOrientation", @"_isDevicePoseOverridingOrientationLock", @"_isSceneAccessoryIgnoringOrientationLock", @"_continuousFoldPinnedDeviceOrientation", @"_continuousFoldHolderCount", @"_isContinuousFoldSettleWindowActive", @"_isCoversheetPresented", @"_suppressingOrientationUpdateAnimation", @"_backlightOffDeferralHeldInAlwaysOn", @"_arbiterRunningUpdatesCount", @"_settingUpPipeline", @"_continuousFoldLockValidator", @"_continuousFoldDeviceOrientationDeferralAssertion", @"_orientationLockInputsValidator", @"_lastNonFlatOverrideInputsValidator", @"_activeOrientationParticipant", @"_deviceOrientationUpdateDeferralAssertionsByReason"]);
+ NSObject *varb = vpObj(vws, @"traitsArbiter");
+ vpIvars(varb, [vapi stringByAppendingString:@".traitsArbiter"], [vrecv stringByAppendingString:@".traitsArbiter"], @[@"_lastRawInputs", @"_lastValidatedInputs"]);
+ NSDictionary *vparts = (NSDictionary *)vpIvObj(varb, @"_acquiredParticipantsByUniqueIdentifier");
+ vpAdd([vapi stringByAppendingString:@".traitsArbiter.participants.count"], @"private", [vrecv stringByAppendingString:@".traitsArbiter->_acquiredParticipantsByUniqueIdentifier.count"], vpV(@(vparts.count)));
+ for (NSString *vk in [[vparts allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vp = vparts[vk];
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ for (NSString *vsn in @[@"role", @"uniqueIdentifier", @"currentOrientation", @"previousOrientation", @"currentDeviceOrientation", @"previousDeviceOrientation", @"currentZOrderLevel", @"_debugLastOrientationValidationFailureReason", @"orientationResolutionPolicyInfo"]) vd[vsn] = vpCall(vp, vsn)[@"v"];
+ NSObject *vpref = vpObj(vp, @"orientationPreferences");
+ if (vpref) vd[@"orientationPreferences"] = @{@"supportedOrientations": vpCall(vpref, @"supportedOrientations")[@"v"], @"preferredOrientation": vpCall(vpref, @"preferredOrientation")[@"v"], @"canDetermineActiveOrientation": vpCall(vpref, @"canDetermineActiveOrientation")[@"v"]};
+ else vd[@"orientationPreferences"] = [NSNull null];
+ NSObject *vdel = vpObj(vp, @"delegate");
+ vd[@"delegate"] = vdel ? NSStringFromClass(object_getClass(vdel)) : [NSNull null];
+ if ([vdel isKindOfClass:NSClassFromString(@"SBTraitsSceneParticipantDelegate")]) {
+ vd[@"scene"] = [(NSObject *)vpCall(vpObj(vdel, @"scene"), @"identifier")[@"v"] description] ?: [NSNull null];
+ for (NSString *vsn in @[@"sceneCurrentOrientation", @"_supportedOrientations", @"scenePrefersOrientationLocked", @"orientationModeOverride", @"supportedOrientationsOverride", @"orientationResolutionWindowScene", @"canDetermineActiveOrientation", @"isOrientationActuationEnabled"]) vd[[@"delegate." stringByAppendingString:vsn]] = vpCall(vdel, vsn)[@"v"];
+ }
+ vpAdd([vapi stringByAppendingString:@".traitsArbiter.participant"], @"private", [NSString stringWithFormat:@"%@.traitsArbiter->_acquiredParticipantsByUniqueIdentifier[@\"%@\"]", vrecv, vk], vpV(vd));
+ }
+ NSObject *vsbm = vpObj(vws, @"statusBarManager");
+ NSString *vsapi = [vapi stringByAppendingString:@".statusBarManager"];
+ NSString *vsrecv = [vrecv stringByAppendingString:@".statusBarManager"];
+ vpAdd([vsapi stringByAppendingString:@".class"], @"public", [vsrecv stringByAppendingString:@" class"], vpV(vsbm ? NSStringFromClass(object_getClass(vsbm)) : nil));
+ vpGetters(vsbm, vsapi, vsrecv, @[@"statusBarOrientation", @"statusBarFrame", @"defaultStatusBarFrame", @"isStatusBarHidden", @"isStatusBarEffectivelyHidden", @"statusBarWindowFrame", @"_isEmbeddedDisplay", @"statusBarStyle"]);
+ NSObject *vsbw = vpObj(vsbm, @"statusBarWindow");
+ vpAdd([vsapi stringByAppendingString:@".statusBarWindow.windowScene"], @"private", [vsrecv stringByAppendingString:@".statusBarWindow.windowScene"], vpCall(vsbw, @"windowScene"));
+ vpAdd([vsapi stringByAppendingString:@".statusBarWindow.isHidden"], @"private", [vsrecv stringByAppendingString:@".statusBarWindow.isHidden"], vpCall(vsbw, @"isHidden"));
+ NSObject *vbl = vpObj(vws, @"backlightController");
+ NSString *vbapi = [vapi stringByAppendingString:@".backlightController"];
+ NSString *vbrecv = [vrecv stringByAppendingString:@".backlightController"];
+ vpGetters(vbl, vbapi, vbrecv, @[@"windowScene", @"screenIsOn", @"screenIsDim", @"backlightState", @"lastBacklightChangeSource", @"isDigitizerDisabled", @"isTapToWakeEnabled", @"tapToWakeRequiresHitTestSuppression", @"isPrewarmingDisplayContentMode", @"blsDisplay"]);
+ vpAdd([vbapi stringByAppendingString:@".isSharedInstanceForMainDisplay"], @"private", [vbrecv stringByAppendingString:@" == [SBBacklightController sharedInstanceForMainDisplay]"], vpV(@(vbl && vbl == (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBBacklightController"), NSSelectorFromString(@"sharedInstanceForMainDisplayIfExists")))));
+ NSObject *vblsb = vpObj(vbl, @"blsBacklight");
+ vpAdd([vbapi stringByAppendingString:@".blsBacklight.class"], @"private", [vbrecv stringByAppendingString:@".blsBacklight class"], vpV(vblsb ? NSStringFromClass(object_getClass(vblsb)) : nil));
+ vpGetters(vblsb, [vbapi stringByAppendingString:@".blsBacklight"], [vbrecv stringByAppendingString:@".blsBacklight"], @[@"backlightState", @"isTransitioning", @"isAlwaysOnEnabled", @"display"]);
+ NSObject *vcfc = vpObj(vws, @"continuousFoldController");
+ vpGetters(vcfc, [vapi stringByAppendingString:@".continuousFoldController"], [vrecv stringByAppendingString:@".continuousFoldController"], @[@"isEnabled", @"isSuppressed"]);
+ vpIvars(vcfc, [vapi stringByAppendingString:@".continuousFoldController"], [vrecv stringByAppendingString:@".continuousFoldController"], @[@"_lastContinuousFoldPosition", @"_lastHingeAngleDegrees", @"_lastEffectMode", @"_awaitingCloakReveal", @"_settleOrientationLock", @"_window", @"_effectViewController"]);
+ NSObject *vaux = vpObj(vws, @"auxiliaryContentController");
+ vpGetters(vaux, [vapi stringByAppendingString:@".auxiliaryContentController"], [vrecv stringByAppendingString:@".auxiliaryContentController"], @[@"isAvailable", @"isYoinkingSliderVisible", @"isHostingCompanionScene", @"_auxiliaryContentType", @"disabledSystemGestureTypes", @"continuousFoldSuppressionAssertion", @"systemGestureDisabledAssertion"]);
+ vpIvars(vaux, [vapi stringByAppendingString:@".auxiliaryContentController"], [vrecv stringByAppendingString:@".auxiliaryContentController"], @[@"_windowVisible", @"_lastActivationPolicyForParticipantsBelow"]);
+ NSObject *vyc = vpObj(vaux, @"displayYoinkingController");
+ vpGetters(vyc, [vapi stringByAppendingString:@".displayYoinkingController"], [vrecv stringByAppendingString:@".auxiliaryContentController.displayYoinkingController"], @[@"canRevealYoinkingSlider", @"shouldRevealYoinkingSlider", @"isYoinkingSliderVisible", @"isYoinkingSliderInteractionInProgress", @"isEligible", @"isVisibleOnScreen", @"_canYoinkToThisDisplay", @"currentDisplayIdentity"]);
+ NSObject *vlsm = vpObj(vws, @"lockScreenManager");
+ vpGetters(vlsm, [vapi stringByAppendingString:@".lockScreenManager"], [vrecv stringByAppendingString:@".lockScreenManager"], @[@"isUILocked", @"isLockScreenActive", @"isLockScreenVisible", @"hasUIEverBeenLocked", @"isScreenOn", @"isWaitingToLockUI", @"hasWakeToContentForInactiveDisplay", @"shouldTapToWake"]);
+ vpAdd([vapi stringByAppendingString:@".lockScreenManager.isSharedInstance"], @"private", [vrecv stringByAppendingString:@".lockScreenManager == [SBLockScreenManager sharedInstance]"], vpV(@(vlsm && vlsm == (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance)))));
+ vpAdd([vapi stringByAppendingString:@".lockScreenManager.isActiveDisplayLockScreenManager"], @"private", [vrecv stringByAppendingString:@".lockScreenManager == [SBDisplayContentModeLockScreenActiveDisplayPolicy activeDisplayLockScreenManager]"], vpV(@(vlsm && vpLSPolicy && vlsm == vpObj(vpLSPolicy, @"activeDisplayLockScreenManager"))));
+ NSObject *vcs = vpObj(vws, @"coverSheetViewController");
+ NSObject *vcsp = vpObj(vws, @"coverSheetPresentationManager");
+ NSObject *vcsw = vpObj(vcsp, @"coverSheetWindowIfLoaded");
+ vpAdd([vapi stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.windowScene"], @"private", [vrecv stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.windowScene"], vcsw ? vpCall(vcsw, @"windowScene") : vpV(@"<no coverSheetWindow loaded>"));
+ vpAdd([vapi stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.isHidden"], @"private", [vrecv stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.isHidden"], vcsw ? vpCall(vcsw, @"isHidden") : vpV(@"<no coverSheetWindow loaded>"));
+ vpGetters(vcsp, [vapi stringByAppendingString:@".coverSheetPresentationManager"], [vrecv stringByAppendingString:@".coverSheetPresentationManager"], @[@"windowScene", @"isActiveInterfaceOrientationLocked", @"idleTimerDuration", @"idleTimerMode", @"idleWarnMode", @"isCoverSheetHostingUnlockedEnvironmentWindows"]);
+ NSObject *vic = vpObj(vws, @"iconController");
+ vpAdd([vapi stringByAppendingString:@".iconController.isSharedInstance"], @"private", [vrecv stringByAppendingString:@".iconController == [SBIconController sharedInstance]"], vpV(@(vic && vic == (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBIconController"), @selector(sharedInstance)))));
+ NSObject *vhsc = vpObj(vws, @"homeScreenController");
+ vpAdd([vapi stringByAppendingString:@".homeScreenController.windowScene"], @"private", [vrecv stringByAppendingString:@".homeScreenController.windowScene"], vpCall(vhsc, @"windowScene"));
+ vpAdd([vapi stringByAppendingString:@".homeScreenController.iconManager.rootFolderController.view.window.windowScene"], @"private", [vrecv stringByAppendingString:@".homeScreenController.iconManager.rootFolderController.view.window.windowScene"], vpCall(vpObj(vpObj(vpObj(vpObj(vhsc, @"iconManager"), @"rootFolderController"), @"viewIfLoaded"), @"window"), @"windowScene"));
+ NSObject *vswc = vpObj(vws, @"switcherController");
+ vpAdd([vapi stringByAppendingString:@".switcherController.windowScene"], @"private", [vrecv stringByAppendingString:@".switcherController.windowScene"], vpCall(vswc, @"windowScene"));
+ NSObject *vwpc = vpObj(vws, @"wallpaperController");
+ NSObject *vhpc = vpIvObj(vwpc, @"_hingeProgressController");
+ vpAdd([vapi stringByAppendingString:@".wallpaperController._hingeProgressController.class"], @"private", [vrecv stringByAppendingString:@".wallpaperController->_hingeProgressController class"], vpV(vhpc ? NSStringFromClass(object_getClass(vhpc)) : nil));
+ vpGetters(vhpc, @"SBWallpaperHingeProgressController", [vrecv stringByAppendingString:@".wallpaperController->_hingeProgressController"], @[@"isHomeScreenWallpaperVisible"]);
+ vpIvars(vhpc, @"SBWallpaperHingeProgressController", [vrecv stringByAppendingString:@".wallpaperController->_hingeProgressController"], @[@"_backlightOn", @"_lockScreenIsTopElement", @"_enabled"]);
+}
+// ---- lock screen active display policy, transition style, yoinking, fold coordinator, display tool
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy.class", @"private", @"DCM observer of class SBDisplayContentModeLockScreenActiveDisplayPolicy", vpV(vpLSPolicy ? NSStringFromClass(object_getClass(vpLSPolicy)) : nil));
+NSObject *vpActiveLSM = vpObj(vpLSPolicy, @"activeDisplayLockScreenManager");
+NSString *vpActiveLSMScene = nil;
+for (NSObject *vws in vpScenes) if (vpActiveLSM && vpObj(vws, @"lockScreenManager") == vpActiveLSM) vpActiveLSMScene = vpLabel(vws);
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy.activeDisplayLockScreenManager", @"private", @"[policy activeDisplayLockScreenManager] -> owning SBWindowScene.lockScreenManager", vpLSPolicy ? vpV(vpActiveLSMScene ?: (vpActiveLSM ? [vpActiveLSM description] : nil)) : @{@"e": @"no SBDisplayContentModeLockScreenActiveDisplayPolicy among DCM observers"});
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy.overrideActiveLockScreenManager", @"private", @"[policy overrideActiveLockScreenManager]", vpCall(vpLSPolicy, @"overrideActiveLockScreenManager"));
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy._lock_lockScreenManagers.count", @"private", @"policy->_lock_lockScreenManagers.count", vpLSPolicy ? vpV(@([(NSHashTable *)vpIvObj(vpLSPolicy, @"_lock_lockScreenManagers") count])) : @{@"e": @"no policy"});
+NSObject *vpTSC = vpIvObj(vpApp, @"_displayContentModeTransitionStyleCoordinator");
+vpIvars(vpTSC, @"SBDisplayContentModeTransitionStyleCoordinator", @"SpringBoard->_displayContentModeTransitionStyleCoordinator", @[@"_continuousFoldTransitionEnabled", @"_continuousFoldTransitionDisablingAssertions"]);
+vpAdd(@"SBDisplayContentModeTransitionStyleCoordinator._windowScenes", @"private", @"SpringBoard->_displayContentModeTransitionStyleCoordinator->_windowScenes", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vs in [(NSHashTable *)vpIvObj(vpTSC, @"_windowScenes") allObjects]) [vl addObject:vpLabel(vs) ?: @"?"]; [vl sortUsingSelector:@selector(compare:)]; vl; })));
+NSObject *vpYC = vpIvObj(vpApp, @"_displayYoinkingCoordinator");
+vpGetters(vpYC, @"SBDisplayYoinkingCoordinator", @"SpringBoard->_displayYoinkingCoordinator", @[@"isDisplayToolFlipOverridden", @"_anyCameraSessionCurrentlyActive"]);
+vpIvars(vpYC, @"SBDisplayYoinkingCoordinator", @"SpringBoard->_displayYoinkingCoordinator", @[@"_cameraSessionActive", @"_listeningToFlip", @"_flipActive", @"_persistentFlipOverride"]);
+NSObject *vpCFC = vpIvObj(vpApp, @"_continuousFoldCoordinator");
+vpAdd(@"SBContinuousFoldCoordinator._activeControllerAssertions.count", @"private", @"SpringBoard->_continuousFoldCoordinator->_activeControllerAssertions.count", vpV(vpCFC ? @([(NSMapTable *)vpIvObj(vpCFC, @"_activeControllerAssertions") count]) : nil));
+vpAdd(@"SBContinuousFoldCoordinator._foldControllers.count", @"private", @"SpringBoard->_continuousFoldCoordinator->_foldControllers.count", vpV(vpCFC ? @([(NSHashTable *)vpIvObj(vpCFC, @"_foldControllers") count]) : nil));
+vpIvars(vpCFC, @"SBContinuousFoldCoordinator", @"SpringBoard->_continuousFoldCoordinator", @[@"_suppressionAssertion"]);
+Ivar vpSwIv = class_getInstanceVariable(object_getClass(vpSwap), "_currentSettings");
+long long *vpSwP = (long long *)((char *)(__bridge void *)vpSwap + ivar_getOffset(vpSwIv));
+vpAdd(@"SBDisplayToolServiceCoordinator._currentSettings.state", @"private", @"SBDisplayToolServiceCoordinator->_currentSettings.state", vpV(@(vpSwP[0])));
+vpIvars(vpSwap, @"SBDisplayToolServiceCoordinator", @"SBDisplayToolServiceCoordinator", @[@"_currentDirection", @"_replayIsRunning", @"_instantSwapIsRunning", @"_testLockExpiryTimer"]);
+// ---- device pose provider
+vpAdd(@"SBFDevicePoseProvider.description", @"private", @"[SBFDevicePoseProvider description]", vpV([vpPose description]));
+vpGetters(vpPose, @"SBFDevicePoseProvider", @"SBFDevicePoseProvider", @[@"isContinuousFoldEnabled", @"continuousFoldEffectProgress", @"likelyTransitionDelegate"]);
+for (NSString *vbox in @[@"_lock_currentDevicePoseBox", @"_lock_devicePoseBox"]) {
+ Ivar vbiv = class_getInstanceVariable(object_getClass(vpPose), vbox.UTF8String);
+ char *vbp = (char *)(__bridge void *)vpPose + ivar_getOffset(vbiv);
+ vpAdd([NSString stringWithFormat:@"SBFDevicePoseProvider.%@", vbox], @"private", [NSString stringWithFormat:@"SBFDevicePoseProvider->%@.devicePose {orientation@0, coverOrientation@8, innerOrientation@16, hinge.isAvailable@24, hinge.position@32, hinge.state@40}", vbox], vpV((@{@"orientation": @(*(long long *)vbp), @"coverOrientation": @(*(long long *)(vbp + 8)), @"innerOrientation": @(*(long long *)(vbp + 16)), @"hinge.isAvailable": (*(BOOL *)(vbp + 24) ? @YES : @NO), @"hinge.position": @(*(double *)(vbp + 32)), @"hinge.state": @(*(long long *)(vbp + 40))})));
+}
+NSObject *vpAccel = vpIvObj(vpPose, @"_accelerometer");
+vpGetters(vpAccel, @"BKSAccelerometer", @"SBFDevicePoseProvider->_accelerometer", @[@"currentDeviceOrientation", @"orientationEventsEnabled", @"passiveOrientationEvents"]);
+vpAdd(@"UIDevice.orientation", @"public", @"[[UIDevice currentDevice] orientation]", vpV(@([[UIDevice currentDevice] orientation])));
+vpAdd(@"UIApplication.activeInterfaceOrientation", @"private", @"[[UIApplication sharedApplication] activeInterfaceOrientation]", vpCall(vpApp, @"activeInterfaceOrientation"));
+// ---- settings domains
+vpProps(vpIvObj(vpPose, @"_settings"), @"SBFDevicePosePTSettings", @"SBFDevicePoseProvider->_settings", NSClassFromString(@"SBFDevicePosePTSettings"));
+NSObject *vpCFS = (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBDeviceContinuousFoldInteractionDomain"), @selector(rootSettings));
+vpAdd(@"SBDeviceContinuousFoldInteractionDomain.rootSettings.isDCMInstance", @"private", @"[SBDeviceContinuousFoldInteractionDomain rootSettings] == SBDisplayContentModeCoordinator->_continuousFoldSettings", vpV(@(vpCFS == vpIvObj(vpDCM, @"_continuousFoldSettings"))));
+vpProps(vpCFS, @"SBDeviceContinuousFoldInteractionSettings", @"[SBDeviceContinuousFoldInteractionDomain rootSettings]", NSClassFromString(@"SBDeviceContinuousFoldInteractionSettings"));
+NSObject *vpHMon = vpIvObj(vpApp, @"_hingeMotionUnintendedInteractionMonitor");
+vpProps(vpIvObj(vpHMon, @"_detectionSettings"), @"SBHingeMotionDetectionSettings", @"SpringBoard->_hingeMotionUnintendedInteractionMonitor->_detectionSettings", NSClassFromString(@"SBHingeMotionDetectionSettings"));
+vpIvars(vpHMon, @"SBHingeMotionUnintendedInteractionMonitor", @"SpringBoard->_hingeMotionUnintendedInteractionMonitor", @[@"_hingeMotionPastThreshold", @"_interactionSuppressionAssertion", @"_strictTouchCoverageAssertion", @"_detectionWindowBeganTimestamp", @"_motionBeganTimestamp", @"_motionEndedTimestamp"]);
+if (vpHMon) {
+ Ivar vriv = class_getInstanceVariable(object_getClass(vpHMon), "_referenceAngle");
+ char *vrp = (char *)(__bridge void *)vpHMon + ivar_getOffset(vriv);
+ vpAdd(@"SBHingeMotionUnintendedInteractionMonitor._referenceAngle", @"private", @"SpringBoard->_hingeMotionUnintendedInteractionMonitor->_referenceAngle {f min, f max, f angle, f velocity, B isAvailable, d timestamp}", vpV((@{@"minAngleDegrees": @(*(float *)vrp), @"maxAngleDegrees": @(*(float *)(vrp + 4)), @"angleDegrees": @(*(float *)(vrp + 8)), @"velocityDegreesPerSeconds": @(*(float *)(vrp + 12)), @"isAvailable": (*(BOOL *)(vrp + 16) ? @YES : @NO), @"timestamp": @(*(double *)(vrp + 24))})));
+}
+NSObject *vpYS = (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBDisplayYoinkingPTSettingsDomain"), @selector(rootSettings));
+vpProps(vpYS, @"SBDisplayYoinkingPTSettings", @"[SBDisplayYoinkingPTSettingsDomain rootSettings]", NSClassFromString(@"SBDisplayYoinkingPTSettings"));
+// ---- backlight
+NSObject *vpBLC = vpIvObj(vpApp, @"_backlightCoordinator");
+vpGetters(vpBLC, @"SBBacklightCoordinator", @"SpringBoard->_backlightCoordinator", @[@"aggregateBacklightState", @"pendingAggregateBacklightState", @"isAnyBacklightOn", @"aggregateBacklightStateExcludingPrewarms", @"pendingAggregateBacklightStateExcludingPrewarms", @"lastBacklightChangeSource", @"idleSleepPreventionInterval", @"_mostActiveBacklightState", @"_mostActivePendingBacklightState"]);
+vpAdd(@"SBBacklightCoordinator.backlightControllers", @"private", @"SpringBoard->_backlightCoordinator->_backlightControllers: windowScene/backlightState/screenIsOn", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vc in [(NSHashTable *)vpIvObj(vpBLC, @"_backlightControllers") allObjects]) [vl addObject:[NSString stringWithFormat:@"%@ state=%@ on=%@", vpLabel(vpObj(vc, @"windowScene")) ?: @"nil", vpCall(vc, @"backlightState")[@"v"], vpCall(vc, @"screenIsOn")[@"v"]]]; [vl sortUsingSelector:@selector(compare:)]; vl; })));
+vpAdd(@"SBBacklightCoordinator.targetBacklightControllersForActiveDim", @"private", @"[SpringBoard->_backlightCoordinator targetBacklightControllersForActiveDim]", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vc in (NSArray *)vpObj(vpBLC, @"targetBacklightControllersForActiveDim")) [vl addObject:vpLabel(vpObj(vc, @"windowScene")) ?: @"nil"]; [vl sortUsingSelector:@selector(compare:)]; vl; })));
+NSObject *vpBLHost = (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"BLSHBacklightHost"), NSSelectorFromString(@"sharedBacklightHost"));
+vpAdd(@"BLSHBacklightHost.sharedBacklightHost.class", @"private", @"[BLSHBacklightHost sharedBacklightHost] class", vpV(vpBLHost ? NSStringFromClass(object_getClass(vpBLHost)) : nil));
+vpGetters(vpBLHost, @"BLSHBacklightHost.sharedBacklightHost", @"[BLSHBacklightHost sharedBacklightHost]", @[@"backlightState", @"settledBacklightState", @"backlightDisplayMode", @"targetBacklightDisplayMode", @"flipbookState", @"isTransitioning", @"isAlwaysOnEnabled", @"deviceSupportsAlwaysOn", @"backlightStateDescription", @"display"]);
+NSArray *vpHosts = (NSArray *)vpIvObj(vpBLHost, @"_backlightHosts");
+for (NSUInteger vi = 0; vi < vpHosts.count; vi++) {
+ NSObject *vh = vpHosts[vi];
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ vd[@"class"] = NSStringFromClass(object_getClass(vh));
+ for (NSString *vsn in @[@"backlightState", @"settledBacklightState", @"backlightDisplayMode", @"targetBacklightDisplayMode", @"isTransitioning", @"isAlwaysOnEnabled", @"display"]) vd[vsn] = vpCall(vh, vsn)[@"v"] ?: [NSNull null];
+ vpAdd(@"BLSHBacklightHost.sharedBacklightHost._backlightHosts", @"private", [NSString stringWithFormat:@"[BLSHBacklightHost sharedBacklightHost]->_backlightHosts[%lu]", (unsigned long)vi], vpV(vd));
+}
+NSObject *vpIdle = vpIvObj(vpApp, @"_idleTimerGlobalCoordinator");
+vpGetters(vpIdle, @"SBIdleTimerGlobalCoordinator", @"SpringBoard->_idleTimerGlobalCoordinator", @[@"isIdleTimerDisabled", @"idleTimer"]);
+vpIvars(vpIdle, @"SBIdleTimerGlobalCoordinator", @"SpringBoard->_idleTimerGlobalCoordinator", @[@"_enabledIdleTimerDescriptor", @"_idleTimerSourceEnabled", @"_currentDisablingClientBundleIdentifier"]);
+NSObject *vpLSM = (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance));
+vpGetters(vpLSM, @"SBLockScreenManager.sharedInstance", @"[SBLockScreenManager sharedInstance]", @[@"isUILocked", @"isLockScreenActive", @"isLockScreenVisible", @"isScreenOn", @"isWaitingToLockUI"]);
+NSDictionary *vpOut = @{@"orientation": @(((UIWindowScene *)vpPrimary).interfaceOrientation), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpOut options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-unlock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-unlock.lldb
new file mode 100644
index 00000000..fcf87882
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-unlock.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- NSObject *vpL = (NSObject *)((id (*)(id, SEL))objc_msgSend)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance)); ((void (*)(id, SEL, id, BOOL, id))objc_msgSend)(vpL, @selector(attemptUnlockWithPasscode:finishUIUnlock:completion:), nil, YES, nil); @"attemptUnlockWithPasscode:nil finishUIUnlock:YES"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-wake.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-wake.lldb
new file mode 100644
index 00000000..ed81691f
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/springboard-wake.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- ((void (*)(id, SEL))objc_msgSend)((id)[UIApplication sharedApplication], NSSelectorFromString(@"resetIdleTimerAndUndim")); @"resetIdleTimerAndUndim"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-app-keys.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-app-keys.zsh
new file mode 100755
index 00000000..abd0fcef
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-app-keys.zsh
@@ -0,0 +1,24 @@
+#!/bin/zsh
+# vm-app-keys.zsh <records.jsonl [process] | appkit.json process posture-label>
+# The BASELINE "What an app sees" values from appkit-scenes records: screens count, main screen,
+# the scene's screen and bounds, size classes, interface orientation, window safe area, idiom,
+# corner radii, ssk_surfaceType, scene regions (identifier + active), split column width,
+# hinge state, UIDevice.orientation.
+set -euo pipefail
+jq=/opt/homebrew/bin/jq
+if [[ $1 == *.jsonl ]]; then src=($jq -s -c --arg p "${2:-}" '[.[] | select(.probe == "appkit-scenes" and ($p == "" or .process == $p))]' $1)
+else src=($jq -c --arg p "$2" --arg l "$3" '[.records[] | select(.process == $p and .posture == $l)]' $1); fi
+"${src[@]}" | $jq -c '
+ def v($a): [.[] | select(.api == $a) | .value] | first;
+ {process: (.[0].process), screens: v("UIScreen.screens"), main: v("UIScreen.mainScreen"), sceneScreen: v("UIWindowScene.screen"),
+ screenBounds: (v("UIWindowScene.screen.bounds") | if type == "object" then [.width, .height] else . end),
+ io: v("UIWindowScene.interfaceOrientation"), hsc: v("UITraitCollection.horizontalSizeClass"), vsc: v("UITraitCollection.verticalSizeClass"),
+ safe: (v("UIWindow.safeAreaInsets") | if type == "object" then [.top, .left, .bottom, .right] else . end),
+ idiom: v("UIDevice.userInterfaceIdiom"), deviceOrientation: v("UIDevice.orientation"),
+ corners: (v("FBSSceneSettings.cornerRadiusConfiguration") | tostring | .[0:90]),
+ ssk: v("FBSScene.ssk_surfaceType"),
+ regions: (v("FBSSceneSettings.sceneRegions") | tostring | [scan("identifier: com\\.apple\\.springboard\\.([A-Za-z]+)")] | map(.[0]) | join(",")),
+ innerCoverActive: (v("FBSSceneSettings.sceneRegions") | if . == null then null else tostring | split("_UISceneRegion") | map(select(test("innerCover>"))) | first // "" | (capture("active: (?<a>YES|NO)")? // {a: null}).a end),
+ hinge: v("_UISceneHingeStateClientComponent.hingeState"),
+ split: (v("UISplitViewController.state") | if type == "object" then .primaryColumnWidth * 100 | round / 100 else . end),
+ clientIO: v("FBSSceneClientSettings.interfaceOrientation")}'
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-appkit-scenes.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-appkit-scenes.lldb
new file mode 100644
index 00000000..5d480742
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-appkit-scenes.lldb
@@ -0,0 +1,249 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vpApi, NSString *vpKind, NSString *vpCallArg, id vpValue, NSString *vpError) {
+ [[NSThread currentThread] threadDictionary][@"vpAppkitLast"] = vpCallArg;
+ id vpVal = vpValue;
+ if (vpVal && ![NSJSONSerialization isValidJSONObject:@[vpVal]]) { vpVal = [NSString stringWithFormat:@"%@", vpVal]; vpError = vpError ?: @"value not representable in JSON (NaN, infinity or a non-JSON object); recorded as its string form"; }
+ [vpRecs addObject:@{@"api": vpApi, @"kind": vpKind, @"call": vpCallArg, @"value": vpVal ?: [NSNull null], @"error": vpError ?: [NSNull null]}];
+};
+// Non-finite doubles become the strings "inf", "-inf" or "nan" (JSON has no such numbers).
+id (^vpNum)(double) = ^id(double vpDbl) { if (vpDbl - vpDbl == 0) return (id)@(vpDbl); return (id)(vpDbl != vpDbl ? @"nan" : (vpDbl > 0 ? @"inf" : @"-inf")); };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vpRc) {
+ return @{@"x": vpNum(vpRc.origin.x), @"y": vpNum(vpRc.origin.y), @"width": vpNum(vpRc.size.width), @"height": vpNum(vpRc.size.height)};
+};
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vpIn) {
+ return @{@"top": vpNum(vpIn.top), @"left": vpNum(vpIn.left), @"bottom": vpNum(vpIn.bottom), @"right": vpNum(vpIn.right)};
+};
+id (^vpConv)(id) = ^id(id vpR) {
+ if (!vpR) return (id)nil;
+ if ([(NSObject *)vpR isKindOfClass:[NSNumber class]] || [(NSObject *)vpR isKindOfClass:[NSString class]]) return vpR;
+ if ([(NSObject *)vpR isKindOfClass:[NSValue class]]) {
+ NSValue *vpNV = (NSValue *)vpR;
+ NSString *vpT = @([vpNV objCType]);
+ if ([vpT hasPrefix:@"{CGRect"]) return (id)vpRect([vpNV CGRectValue]);
+ if ([vpT hasPrefix:@"{CGSize"]) { CGSize vpSz = [vpNV CGSizeValue]; return (id)@{@"width": @(vpSz.width), @"height": @(vpSz.height)}; }
+ if ([vpT hasPrefix:@"{CGPoint"]) { CGPoint vpPt = [vpNV CGPointValue]; return (id)@{@"x": @(vpPt.x), @"y": @(vpPt.y)}; }
+ if ([vpT hasPrefix:@"{UIEdgeInsets"]) return (id)vpInsets([vpNV UIEdgeInsetsValue]);
+ if ([vpT hasPrefix:@"{NSDirectionalEdgeInsets"]) { NSDirectionalEdgeInsets vpD = [vpNV directionalEdgeInsetsValue]; return (id)@{@"top": @(vpD.top), @"leading": @(vpD.leading), @"bottom": @(vpD.bottom), @"trailing": @(vpD.trailing)}; }
+ NSUInteger vpSize = 0; NSGetSizeAndAlignment([vpNV objCType], &vpSize, NULL);
+ NSString *vpFlat = [[[NSRegularExpression regularExpressionWithPattern:@"\\{[^=]*=|\\}" options:0 error:nil] stringByReplacingMatchesInString:vpT options:0 range:NSMakeRange(0, vpT.length) withTemplate:@""] copy];
+ NSMutableArray *vpEl = [NSMutableArray array];
+ unsigned char *vpBuf = (unsigned char *)calloc(1, vpSize + 16);
+ [vpNV getValue:vpBuf size:vpSize];
+ if (vpFlat.length > 0 && [[vpFlat stringByReplacingOccurrencesOfString:@"d" withString:@""] length] == 0 && vpSize == 8 * vpFlat.length) {
+ for (NSUInteger vk = 0; vk < vpFlat.length; vk++) [vpEl addObject:vpNum(((double *)vpBuf)[vk])];
+ } else if (vpFlat.length > 0 && [[[vpFlat stringByReplacingOccurrencesOfString:@"c" withString:@""] stringByReplacingOccurrencesOfString:@"C" withString:@""] length] == 0 && vpSize == vpFlat.length) {
+ for (NSUInteger vk = 0; vk < vpSize; vk++) [vpEl addObject:@((int)(signed char)vpBuf[vk])];
+ } else if (vpFlat.length > 0 && [[[vpFlat stringByReplacingOccurrencesOfString:@"q" withString:@""] stringByReplacingOccurrencesOfString:@"Q" withString:@""] length] == 0 && vpSize == 8 * vpFlat.length) {
+ for (NSUInteger vk = 0; vk < vpFlat.length; vk++) [vpEl addObject:@(((long long *)vpBuf)[vk])];
+ }
+ free(vpBuf);
+ if (vpEl.count) return (id)@{@"objCType": vpT, @"elements": vpEl};
+ return (id)@{@"objCType": vpT, @"description": [(NSObject *)vpNV description]};
+ }
+ return (id)[(NSObject *)vpR description];
+};
+// Call a zero-argument getter with NSInvocation and box the result (no KVC: FBSSettings and
+// other classes override valueForKey:, and an exception would abort the whole expression).
+id (^vpInvoke)(id, NSString *) = ^id(id vpTarget, NSString *vpKey) {
+ SEL vpSel = NSSelectorFromString(vpKey);
+ NSMethodSignature *vpSig = [(NSObject *)vpTarget methodSignatureForSelector:vpSel];
+ if (!vpSig || vpSig.numberOfArguments != 2) return (id)nil;
+ const char *vpRT = vpSig.methodReturnType;
+ NSUInteger vpLen = vpSig.methodReturnLength;
+ NSInvocation *vpInv = [NSInvocation invocationWithMethodSignature:vpSig];
+ vpInv.target = vpTarget; vpInv.selector = vpSel;
+ [vpInv invoke];
+ if (vpRT[0] == '@') { __unsafe_unretained id vpO = nil; [vpInv getReturnValue:&vpO]; return vpO; }
+ if (vpRT[0] == 'v' || vpLen == 0) return (id)@"<void>";
+ unsigned char *vpB = (unsigned char *)calloc(1, vpLen + 16);
+ [vpInv getReturnValue:vpB];
+ id vpBox = nil;
+ switch (vpRT[0]) {
+ case 'c': vpBox = @(*(signed char *)vpB); break;
+ case 'C': vpBox = @(*(unsigned char *)vpB); break;
+ case 'B': vpBox = @(*(bool *)vpB); break;
+ case 's': vpBox = @(*(short *)vpB); break;
+ case 'S': vpBox = @(*(unsigned short *)vpB); break;
+ case 'i': vpBox = @(*(int *)vpB); break;
+ case 'I': vpBox = @(*(unsigned int *)vpB); break;
+ case 'l': vpBox = @(*(long *)vpB); break;
+ case 'L': vpBox = @(*(unsigned long *)vpB); break;
+ case 'q': vpBox = @(*(long long *)vpB); break;
+ case 'Q': vpBox = @(*(unsigned long long *)vpB); break;
+ case 'f': vpBox = vpNum(*(float *)vpB); break;
+ case 'd': vpBox = vpNum(*(double *)vpB); break;
+ case '#': vpBox = @(class_getName(*(Class *)vpB)); break;
+ case ':': vpBox = NSStringFromSelector(*(SEL *)vpB); break;
+ default: vpBox = [NSValue valueWithBytes:vpB objCType:vpRT]; break;
+ }
+ free(vpB);
+ return vpBox;
+};
+// Getter through NSInvocation, guarded by respondsToSelector (an exception would abort the expression).
+void (^vpGet)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vpApi, NSString *vpKind, NSString *vpLabel, id vpTarget, NSString *vpKey) {
+ NSString *vpCall = [NSString stringWithFormat:@"%@.%@", vpLabel, vpKey];
+ if (!vpTarget) { vpAdd(vpApi, vpKind, vpCall, nil, @"receiver is nil"); return; }
+ if (![(NSObject *)vpTarget respondsToSelector:NSSelectorFromString(vpKey)]) { vpAdd(vpApi, vpKind, vpCall, nil, [NSString stringWithFormat:@"%s does not respond to %@", class_getName(object_getClass(vpTarget)), vpKey]); return; }
+ [[NSThread currentThread] threadDictionary][@"vpAppkitLast"] = vpCall;
+ id vpR = vpConv(vpInvoke(vpTarget, vpKey));
+ vpAdd(vpApi, vpKind, vpCall, vpR, vpR ? nil : @"returned nil");
+};
+id (^vpObj)(id, NSString *) = ^id(id vpTarget, NSString *vpKey) {
+ return (vpTarget && [(NSObject *)vpTarget respondsToSelector:NSSelectorFromString(vpKey)]) ? vpInvoke(vpTarget, vpKey) : nil;
+};
+UIApplication *vpApp = [UIApplication sharedApplication];
+NSArray *vpScreens = [UIScreen screens];
+UIScreen *vpMain = [UIScreen mainScreen];
+NSString *(^vpScreenName)(UIScreen *) = ^NSString *(UIScreen *vpScr) {
+ if (!vpScr) return @"nil";
+ NSUInteger vpIdx = [vpScreens indexOfObjectIdenticalTo:vpScr];
+ return [NSString stringWithFormat:@"screens[%@] %@ %@", vpIdx == NSNotFound ? @"?" : @(vpIdx), [(NSObject *)vpObj(vpScr, @"_name") description], [(NSObject *)vpObj(vpScr, @"displayIdentity") description]];
+};
+// MARK: - process-level
+vpAdd(@"UIDevice.orientation", @"public", @"[UIDevice currentDevice].orientation", @([[UIDevice currentDevice] orientation]), nil);
+vpAdd(@"UIDevice.userInterfaceIdiom", @"public", @"[UIDevice currentDevice].userInterfaceIdiom", @([[UIDevice currentDevice] userInterfaceIdiom]), nil);
+vpAdd(@"UIApplication.connectedScenes", @"public", @"[UIApplication sharedApplication].connectedScenes.count", @(vpApp.connectedScenes.count), nil);
+vpAdd(@"UIApplication.openSessions", @"public", @"[UIApplication sharedApplication].openSessions.count", @(vpApp.openSessions.count), nil);
+for (NSString *vpK in @[@"supportsMultipleScenes", @"applicationState"]) vpGet([@"UIApplication." stringByAppendingString:vpK], @"public", @"[UIApplication sharedApplication]", vpApp, vpK);
+for (NSString *vpK in @[@"statusBarOrientation", @"statusBarFrame", @"interfaceOrientation", @"activeInterfaceOrientation", @"_appAdoptsUISceneLifecycle", @"_appSupportsMultipleScenes", @"_frontMostAppOrientation", @"_safeInterfaceOrientationForNoWindow", @"currentHingePoseStateForTesting", @"_mainScene"])
+ vpGet([@"UIApplication." stringByAppendingString:vpK], ([vpK isEqualToString:@"statusBarOrientation"] || [vpK isEqualToString:@"statusBarFrame"]) ? @"public" : @"private", @"[UIApplication sharedApplication]", vpApp, vpK);
+// MARK: - screens
+vpAdd(@"UIScreen.screens", @"public", @"[UIScreen screens].count", @(vpScreens.count), nil);
+vpAdd(@"UIScreen.mainScreen", @"public", @"[UIScreen mainScreen] (index in [UIScreen screens], _name, displayIdentity)", vpScreenName(vpMain), nil);
+for (NSUInteger vi = 0; vi < vpScreens.count; vi++) {
+ UIScreen *vpS = vpScreens[vi];
+ NSString *vpL = [NSString stringWithFormat:@"[UIScreen screens][%lu]", (unsigned long)vi];
+ vpAdd(@"UIScreen.isMainScreen", @"public", [vpL stringByAppendingString:@" == [UIScreen mainScreen]"], @(vpS == vpMain), nil);
+ for (NSString *vpK in @[@"bounds", @"nativeBounds", @"scale", @"nativeScale", @"maximumFramesPerSecond", @"overscanCompensationInsets", @"referenceDisplayModeStatus", @"isCaptured", @"applicationFrame", @"currentMode", @"preferredMode", @"traitCollection", @"brightness", @"calibratedLatency"])
+ vpGet([@"UIScreen." stringByAppendingString:vpK], @"public", vpL, vpS, vpK);
+ vpAdd(@"UIScreen.coordinateSpace.bounds", @"public", [vpL stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIScreen.fixedCoordinateSpace.bounds", @"public", [vpL stringByAppendingString:@".fixedCoordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpS.fixedCoordinateSpace, @selector(bounds))), nil);
+ for (NSString *vpK in @[@"displayIdentity", @"_name", @"_displayID", @"_integerDisplayID", @"gamut", @"_referenceBounds", @"_unjailedReferenceBounds", @"_nativeDisplayBounds", @"_mainSceneReferenceBounds", @"_mainSceneFrame", @"_interfaceOrientedMainSceneBounds", @"_interfaceOrientation", @"_applicationFrame", @"_displayCornerRadius", @"_displayCornerRadiusIgnoringZoom", @"_traitCollectionDisplayCornerRadius", @"_peripheryInsets", @"_displayPeripheryInsets", @"_isMainScreen", @"_isMainLikeScreen", @"_isEmbeddedScreen", @"_isExternal", @"_isRotatable", @"_screenType", @"_userInterfaceIdiom", @"_nativePointsPerMillimeter", @"_maximumSupportedScale", @"_wantsWideContentMargins", @"_imageOrientation", @"displayConfiguration"])
+ vpGet([@"UIScreen." stringByAppendingString:vpK], @"private", vpL, vpS, vpK);
+}
+// MARK: - scenes
+NSArray *vpScenes = [[vpApp.connectedScenes allObjects] sortedArrayUsingComparator:^NSComparisonResult(UIScene *vpSa, UIScene *vpSb) { return [vpSa.session.persistentIdentifier compare:vpSb.session.persistentIdentifier]; }];
+long long vpTagOrientation = 0;
+NSUInteger vpSi = 0;
+for (UIScene *vpSc in vpScenes) {
+ NSString *vpL = [NSString stringWithFormat:@"connectedScenes[%lu]<%@>", (unsigned long)vpSi++, vpSc.session.persistentIdentifier];
+ vpAdd(@"UIScene.class", @"public", [vpL stringByAppendingString:@".class"], @(class_getName([vpSc class])), nil);
+ vpAdd(@"UISceneSession.role", @"public", [vpL stringByAppendingString:@".session.role"], vpSc.session.role, nil);
+ vpAdd(@"UISceneSession.persistentIdentifier", @"public", [vpL stringByAppendingString:@".session.persistentIdentifier"], vpSc.session.persistentIdentifier, nil);
+ vpAdd(@"UISceneConfiguration.name", @"public", [vpL stringByAppendingString:@".session.configuration.name"], vpSc.session.configuration.name, vpSc.session.configuration.name ? nil : @"returned nil");
+ vpAdd(@"UISceneConfiguration.delegateClass", @"public", [vpL stringByAppendingString:@".session.configuration.delegateClass"], vpSc.session.configuration.delegateClass ? NSStringFromClass(vpSc.session.configuration.delegateClass) : nil, vpSc.session.configuration.delegateClass ? nil : @"returned nil");
+ vpAdd(@"UIScene.activationState", @"public", [vpL stringByAppendingString:@".activationState"], @(vpSc.activationState), nil);
+ vpAdd(@"UIScene.title", @"public", [vpL stringByAppendingString:@".title"], vpSc.title, vpSc.title ? nil : @"returned nil");
+ for (NSString *vpK in @[@"_sceneIdentifier", @"_identifier", @"_persistenceIdentifier", @"_referenceBounds", @"_safeAreaCornerInsets", @"_systemMinimumMargin", @"_isActive", @"_isRunningInTaskSwitcher", @"_affectsScreenOrientation"])
+ vpGet([@"UIScene." stringByAppendingString:vpK], @"private", vpL, vpSc, vpK);
+ if (![vpSc isKindOfClass:[UIWindowScene class]]) continue;
+ UIWindowScene *vpWS = (UIWindowScene *)vpSc;
+ if (vpTagOrientation == 0 || vpWS.activationState == UISceneActivationStateForegroundActive) vpTagOrientation = vpWS.effectiveGeometry.interfaceOrientation;
+ vpAdd(@"UIWindowScene.screen", @"public", [vpL stringByAppendingString:@".screen (index in [UIScreen screens], _name, displayIdentity)"], vpScreenName(vpWS.screen), nil);
+ vpAdd(@"UIWindowScene.screen.isMainScreen", @"public", [vpL stringByAppendingString:@".screen == [UIScreen mainScreen]"], @(vpWS.screen == vpMain), nil);
+ vpAdd(@"UIWindowScene.screen.bounds", @"public", [vpL stringByAppendingString:@".screen.bounds"], vpRect(vpWS.screen.bounds), nil);
+ vpAdd(@"UIWindowScene.screen.nativeBounds", @"public", [vpL stringByAppendingString:@".screen.nativeBounds"], vpRect(vpWS.screen.nativeBounds), nil);
+ vpAdd(@"UIWindowScene.screen.scale", @"public", [vpL stringByAppendingString:@".screen.scale"], @(vpWS.screen.scale), nil);
+ vpAdd(@"UIWindowScene.coordinateSpace.bounds", @"public", [vpL stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpWS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [vpL stringByAppendingString:@".interfaceOrientation"], @(vpWS.interfaceOrientation), nil);
+ UIWindowSceneGeometry *vpG = vpWS.effectiveGeometry;
+ NSString *vpGL = [vpL stringByAppendingString:@".effectiveGeometry"];
+ vpAdd(@"UIWindowSceneGeometry.description", @"public", [vpGL stringByAppendingString:@".description"], [(NSObject *)vpG description], nil);
+ vpAdd(@"UIWindowSceneGeometry.coordinateSpace.bounds", @"public", [vpGL stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpG.coordinateSpace, @selector(bounds))), nil);
+ for (NSString *vpK in @[@"interfaceOrientation", @"isInteractivelyResizing", @"isInterfaceOrientationLocked", @"resizingRestrictions", @"systemFrame"])
+ vpGet([@"UIWindowSceneGeometry." stringByAppendingString:vpK], ([vpK isEqualToString:@"systemFrame"]) ? @"private" : @"public", vpGL, vpG, vpK);
+ for (NSString *vpK in @[@"sizeRestrictions", @"isFullScreen", @"keyWindow", @"windowingBehaviors", @"focusSystem"])
+ vpGet([@"UIWindowScene." stringByAppendingString:vpK], @"public", vpL, vpWS, vpK);
+ for (NSString *vpK in @[@"_interfaceOrientation", @"_referenceBounds", @"_peripheryInsets", @"_safeAreaCornerInsets", @"_systemMinimumMargin", @"_currentlySupportedInterfaceOrientations", @"_supportedInterfaceOrientationsFromDelegate", @"_enhancedWindowingEnabled", @"_isKeyWindowScene", @"_isInLiveResize", @"_screenRequestedDisplayNativePixelSize", @"_resolvedOverscanCompensation", @"_usesSceneSettingBasedSafeAreaInsets", @"_usesMinimumSafeAreaInsets", @"_hasOrientationDependentSafeAreaEdgeInsets", @"_hasOrientationDependentSafeAreaCornerInsets", @"_hasStatusBarAxisDependentSafeAreas", @"_shouldRotateSafeAreaInsetsToInterfaceOrientation", @"_windowsIgnoreSceneClientOrientation", @"_canReceiveDeviceOrientationEvents", @"_systemUserInterfaceStyle", @"_orientationDebugDescription", @"interfaceElementCategory", @"sb_supportsResizing", @"avkit_screenType", @"sbh_screenType", @"sbf_displayProxyIdentifier", @"pui_fbsDisplayIdentity"])
+ vpGet([@"UIWindowScene." stringByAppendingString:vpK], @"private", vpL, vpWS, vpK);
+ UIStatusBarManager *vpSB = vpWS.statusBarManager;
+ NSString *vpSBL = [vpL stringByAppendingString:@".statusBarManager"];
+ for (NSString *vpK in @[@"statusBarFrame", @"isStatusBarHidden", @"statusBarStyle"]) vpGet([@"UIStatusBarManager." stringByAppendingString:vpK], @"public", vpSBL, vpSB, vpK);
+ for (NSString *vpK in @[@"statusBarHeight", @"defaultStatusBarHeight", @"statusBarAxis", @"_statusBarFrameIgnoringVisibility", @"statusBarAlpha"]) vpGet([@"UIStatusBarManager." stringByAppendingString:vpK], @"private", vpSBL, vpSB, vpK);
+ // trait collection
+ UITraitCollection *vpTC = vpWS.traitCollection;
+ NSString *vpTL = [vpL stringByAppendingString:@".traitCollection"];
+ for (NSString *vpK in @[@"horizontalSizeClass", @"verticalSizeClass", @"userInterfaceIdiom", @"displayScale", @"displayGamut", @"layoutDirection", @"forceTouchCapability", @"activeAppearance", @"userInterfaceStyle", @"userInterfaceLevel", @"preferredContentSizeCategory", @"accessibilityContrast", @"legibilityWeight", @"imageDynamicRange", @"sceneCaptureState", @"toolbarItemPresentationSize", @"listEnvironment", @"typesettingLanguage", @"splitViewControllerLayoutEnvironment", @"tabAccessoryEnvironment", @"hdrHeadroomUsageLimit", @"resolvesNaturalAlignmentWithBaseWritingDirection", @"systemPrefersReducedResourceUsage"])
+ vpGet([@"UITraitCollection." stringByAppendingString:vpK], @"public", vpTL, vpTC, vpK);
+ for (NSString *vpK in @[@"_displayCornerRadius", @"displayCornerRadius", @"primaryInteractionModel", @"interactionModel", @"touchLevel", @"artworkSubtype", @"glassUserInterfaceStyle", @"verticalBarEdge", @"_verticalBarEdge", @"_verticalBarEdgeInternal", @"_verticalBarAllowed", @"_verticalBarHorizontalEdge", @"_systemVerticalBarHorizontalEdge", @"_isInVerticalBar", @"_sceneBarPosition", @"_systemDisplayIdentifier", @"_sceneUserResizability", @"_windowSceneInterfaceOrientationBehavior", @"_splitViewControllerContext", @"_presentationSemanticContext", @"_userInterfaceRenderingMode", @"_viewControllerContentMarginStyle", @"_activationInteractionPolicy", @"_interfaceProtectionState", @"deviceDeterminedConfiguration", @"isSmallScreenDevice", @"_traitsDescription"])
+ vpGet([@"UITraitCollection." stringByAppendingString:vpK], @"private", vpTL, vpTC, vpK);
+ // FBSScene the client sees
+ NSObject *vpFBS = vpObj(vpWS, @"_FBSScene");
+ NSString *vpFL = [vpL stringByAppendingString:@"._FBSScene"];
+ for (NSString *vpK in @[@"identifier", @"ssk_surfaceType", @"ui_hingeState"]) vpGet([@"FBSScene." stringByAppendingString:vpK], @"private", vpFL, vpFBS, vpK);
+ vpGet(@"SBSUISurfaceTypeClientComponent.sbsui_surfaceType", @"private", [vpFL stringByAppendingString:@".sbsui_surfaceTypeClient"], vpObj(vpFBS, @"sbsui_surfaceTypeClient"), @"sbsui_surfaceType");
+ NSObject *vpHC = vpObj(vpFBS, @"ui_hingeStateClientComponent");
+ vpGet(@"_UISceneHingeStateClientComponent.hingeState", @"private", [vpFL stringByAppendingString:@".ui_hingeStateClientComponent"], vpHC, @"hingeState");
+ vpGet(@"_UISceneHingeStateClientComponent.sceneHingeState", @"private", [vpFL stringByAppendingString:@".ui_hingeStateClientComponent"], vpHC, @"sceneHingeState");
+ NSObject *vpSet = vpObj(vpFBS, @"settings");
+ NSString *vpSL = [vpFL stringByAppendingString:@".settings"];
+ vpAdd(@"FBSSceneSettings.class", @"private", [vpSL stringByAppendingString:@".class"], vpSet ? @(class_getName([vpSet class])) : nil, vpSet ? nil : @"nil");
+ for (NSString *vpK in @[@"frame", @"bounds", @"displayConfiguration", @"displayIdentity", @"interfaceOrientation", @"deviceOrientation", @"level", @"isForeground", @"isOccluded", @"isBackgrounded", @"interfaceOrientationMode", @"interfaceOrientationMapResolver", @"interfaceOrientationLockState", @"safeAreaInsetsPortrait", @"safeAreaInsetsPortraitUpsideDown", @"safeAreaInsetsLandscapeLeft", @"safeAreaInsetsLandscapeRight", @"safeAreaEdgeInsets", @"safeAreaCornerInsets", @"peripheryInsets", @"cornerRadiusConfiguration", @"statusBarHeight", @"statusBarParts", @"statusBarAvoidanceFrame", @"statusBarDisabled", @"homeAffordanceOverlayAllowance", @"homeAffordanceSceneReferenceFrame", @"systemMinimumMargin", @"screenReferenceDisplayModeStatus", @"screenBoundsIgnoresSceneOrientation", @"angleFromHostReferenceUprightDirection", @"hostReferenceAngleMode", @"enhancedWindowingEnabled", @"inLiveResize", @"_userResizability", @"activeAppearance", @"systemDisplayIdentifier", @"horizontalSizeClassResolver", @"verticalSizeClassResolver", @"sceneRegions", @"ssk_surfaceType", @"systemShellHostingSpaceIdentifier", @"sceneHingeState", @"hingeAngle", @"hingeStatus", @"nextHingeStatus", @"nextHingeStatusProgress", @"magicPose", @"sceneFrameInKeyboardReferenceSpace", @"preferredKeyboardNamespaceIdentifier", @"barPositionResolver", @"barAlignmentResolver", @"barSizeClassResolver", @"systemProvidesVerticalBars", @"userInterfaceStyle", @"persistenceIdentifier", @"traitCollection", @"isCapturingContentForAdditionalRenderingDestination", @"deactivationReasons", @"underLock", @"canShowAlerts"])
+ vpGet([@"FBSSceneSettings." stringByAppendingString:vpK], @"private", vpSL, vpSet, vpK);
+ NSObject *vpDC = vpObj(vpSet, @"displayConfiguration");
+ NSString *vpDL = [vpSL stringByAppendingString:@".displayConfiguration"];
+ for (NSString *vpK in @[@"name", @"identity", @"deviceName", @"hardwareIdentifier", @"uniqueIdentifier", @"bounds", @"_nativeBounds", @"pixelSize", @"scale", @"pointScale", @"nativeOrientation", @"_nativeRotation", @"isMainDisplay", @"isMainRootDisplay", @"isExternal", @"type", @"tags", @"refreshRate", @"colorGamut", @"currentMode"])
+ vpGet([@"FBSDisplayConfiguration." stringByAppendingString:vpK], @"private", vpDL, vpDC, vpK);
+ NSObject *vpCS = vpObj(vpFBS, @"clientSettings");
+ NSString *vpCL = [vpFL stringByAppendingString:@".clientSettings"];
+ for (NSString *vpK in @[@"interfaceOrientation", @"supportedInterfaceOrientations", @"preferredInterfaceOrientation", @"interfaceOrientationLockPreference", @"primaryWindowOverlayInsets", @"statusBarHidden", @"statusBarAxis", @"compatibilityMode", @"wantsSceneHingeState", @"deviceOrientationEventsEnabled", @"preferredContentSize", @"preferredMinimumWidth", @"preferredMinimumHeight", @"preferredMaximumWidth", @"preferredMaximumHeight", @"pairedSceneDisplayConfiguration", @"pairedSceneInterfaceOrientation", @"requestedDisplayMode", @"displayConfigurationRequest"])
+ vpGet([@"FBSSceneClientSettings." stringByAppendingString:vpK], @"private", vpCL, vpCS, vpK);
+ vpAdd(@"FBSSceneSettings.description", @"private", [vpSL stringByAppendingString:@".description"], [vpSet description], vpSet ? nil : @"nil");
+ vpAdd(@"FBSSceneClientSettings.description", @"private", [vpCL stringByAppendingString:@".description"], [vpCS description], vpCS ? nil : @"nil");
+ // windows
+ NSUInteger vpWi = 0;
+ for (UIWindow *vpW in vpWS.windows) {
+ NSString *vpWL = [NSString stringWithFormat:@"%@.windows[%lu]<%s>", vpL, (unsigned long)vpWi++, class_getName([vpW class])];
+ vpAdd(@"UIWindow.class", @"public", [vpWL stringByAppendingString:@".class"], @(class_getName([vpW class])), nil);
+ vpAdd(@"UIWindow.frame", @"public", [vpWL stringByAppendingString:@".frame"], vpRect(vpW.frame), nil);
+ vpAdd(@"UIWindow.bounds", @"public", [vpWL stringByAppendingString:@".bounds"], vpRect(vpW.bounds), nil);
+ vpAdd(@"UIWindow.safeAreaInsets", @"public", [vpWL stringByAppendingString:@".safeAreaInsets"], vpInsets(vpW.safeAreaInsets), nil);
+ vpAdd(@"UIWindow.layoutMargins", @"public", [vpWL stringByAppendingString:@".layoutMargins"], vpInsets(vpW.layoutMargins), nil);
+ NSDirectionalEdgeInsets vpDM = vpW.directionalLayoutMargins;
+ vpAdd(@"UIWindow.directionalLayoutMargins", @"public", [vpWL stringByAppendingString:@".directionalLayoutMargins"], @{@"top": @(vpDM.top), @"leading": @(vpDM.leading), @"bottom": @(vpDM.bottom), @"trailing": @(vpDM.trailing)}, nil);
+ vpAdd(@"UIWindow.screen", @"public", [vpWL stringByAppendingString:@".screen"], vpScreenName(vpW.screen), nil);
+ vpAdd(@"UIWindow.isKeyWindow", @"public", [vpWL stringByAppendingString:@".isKeyWindow"], @(vpW.isKeyWindow), nil);
+ vpAdd(@"UIWindow.isHidden", @"public", [vpWL stringByAppendingString:@".isHidden"], @(vpW.isHidden), nil);
+ vpAdd(@"UIWindow.windowLevel", @"public", [vpWL stringByAppendingString:@".windowLevel"], @(vpW.windowLevel), nil);
+ vpAdd(@"UIWindow.traitCollection.sizeClasses", @"public", [vpWL stringByAppendingString:@".traitCollection.{horizontal,vertical}SizeClass"], @{@"horizontal": @(vpW.traitCollection.horizontalSizeClass), @"vertical": @(vpW.traitCollection.verticalSizeClass)}, nil);
+ vpAdd(@"UIApplication.supportedInterfaceOrientationsForWindow", @"public", [NSString stringWithFormat:@"[UIApplication supportedInterfaceOrientationsForWindow:%@]", vpWL], @([vpApp supportedInterfaceOrientationsForWindow:vpW]), nil);
+ for (NSString *vpK in @[@"_sceneReferenceBounds", @"_sceneBounds", @"_sceneBoundsInWindowOrientation", @"_usableSceneBounds", @"interfaceOrientation", @"_windowInterfaceOrientation", @"_sceneOrientation", @"_sceneClientOrientation", @"_orientationInSceneSpace", @"_normalizedSafeAreaInsets", @"_safeAreaCornerInsets", @"_statusBarAxisForSafeAreaInsets", @"_isSceneSized", @"_supportedInterfaceOrientationsForRootViewController", @"_preferredInterfaceOrientationForRootViewController", @"_orientationDebugDescription"])
+ vpGet([@"UIWindow." stringByAppendingString:vpK], @"private", vpWL, vpW, vpK);
+ UIViewController *vpRVC = vpW.rootViewController;
+ vpAdd(@"UIWindow.rootViewController.class", @"public", [vpWL stringByAppendingString:@".rootViewController.class"], vpRVC ? @(class_getName([vpRVC class])) : nil, vpRVC ? nil : @"returned nil");
+ if (!vpRVC) continue;
+ vpAdd(@"UIViewController.view.bounds", @"public", [vpWL stringByAppendingString:@".rootViewController.view.bounds"], vpRect(vpRVC.view.bounds), nil);
+ vpAdd(@"UIViewController.view.safeAreaInsets", @"public", [vpWL stringByAppendingString:@".rootViewController.view.safeAreaInsets"], vpInsets(vpRVC.view.safeAreaInsets), nil);
+ vpAdd(@"UIViewController.view.layoutMargins", @"public", [vpWL stringByAppendingString:@".rootViewController.view.layoutMargins"], vpInsets(vpRVC.view.layoutMargins), nil);
+ vpAdd(@"UIViewController.additionalSafeAreaInsets", @"public", [vpWL stringByAppendingString:@".rootViewController.additionalSafeAreaInsets"], vpInsets(vpRVC.additionalSafeAreaInsets), nil);
+ vpAdd(@"UIViewController.supportedInterfaceOrientations", @"public", [vpWL stringByAppendingString:@".rootViewController.supportedInterfaceOrientations"], @([vpRVC supportedInterfaceOrientations]), nil);
+ vpAdd(@"UIViewController.traitCollection.sizeClasses", @"public", [vpWL stringByAppendingString:@".rootViewController.traitCollection.{horizontal,vertical}SizeClass"], @{@"horizontal": @(vpRVC.traitCollection.horizontalSizeClass), @"vertical": @(vpRVC.traitCollection.verticalSizeClass)}, nil);
+ // view controller tree, split views
+ NSMutableArray *vpTree = [NSMutableArray array];
+ NSMutableArray *vpStack = [NSMutableArray arrayWithObject:@[vpRVC, @0]];
+ while (vpStack.count && vpTree.count < 60) {
+ NSArray *vpTop = vpStack.lastObject; [vpStack removeLastObject];
+ UIViewController *vpVC = vpTop[0]; long vpDepth = [(NSNumber *)vpTop[1] longValue];
+ NSMutableString *vpLine = [NSMutableString stringWithFormat:@"%@%s view=%@", [@"" stringByPaddingToLength:vpDepth * 2 withString:@" " startingAtIndex:0], class_getName([vpVC class]), NSStringFromCGRect(vpVC.isViewLoaded ? vpVC.view.frame : CGRectZero)];
+ if ([vpVC isKindOfClass:[UISplitViewController class]]) {
+ UISplitViewController *vpSplit = (UISplitViewController *)vpVC;
+ [vpLine appendFormat:@" split{collapsed=%d displayMode=%ld style=%ld splitBehavior=%ld primaryColumnWidth=%.1f supplementaryColumnWidth=%.1f viewControllers=%lu}", vpSplit.isCollapsed, (long)vpSplit.displayMode, (long)vpSplit.style, (long)vpSplit.splitBehavior, vpSplit.primaryColumnWidth, vpSplit.supplementaryColumnWidth, (unsigned long)vpSplit.viewControllers.count];
+ vpAdd(@"UISplitViewController.state", @"public", [NSString stringWithFormat:@"%@ split VC %s {isCollapsed, displayMode, style, splitBehavior, primaryColumnWidth, viewControllers.count}", vpWL, class_getName([vpVC class])],
+ @{@"isCollapsed": @(vpSplit.isCollapsed), @"displayMode": @(vpSplit.displayMode), @"style": @(vpSplit.style), @"splitBehavior": @(vpSplit.splitBehavior), @"primaryColumnWidth": @(vpSplit.primaryColumnWidth), @"supplementaryColumnWidth": @(vpSplit.supplementaryColumnWidth), @"viewControllers": @(vpSplit.viewControllers.count), @"traitHorizontalSizeClass": @(vpSplit.traitCollection.horizontalSizeClass)}, nil);
+ }
+ [vpTree addObject:vpLine];
+ NSArray *vpKids = vpVC.childViewControllers;
+ for (NSInteger vk = (NSInteger)vpKids.count - 1; vk >= 0; vk--) [vpStack addObject:@[vpKids[vk], @(vpDepth + 1)]];
+ if (vpVC.presentedViewController && vpVC.presentedViewController.presentingViewController == vpVC) [vpStack addObject:@[vpVC.presentedViewController, @(vpDepth + 1)]];
+ }
+ vpAdd(@"UIViewController.hierarchy", @"public", [vpWL stringByAppendingString:@".rootViewController childViewControllers tree (class, view.frame, split state)"], [vpTree componentsJoinedByString:@"\n"], nil);
+ }
+}
+[[[NSThread currentThread] threadDictionary] removeObjectForKey:@"vpAppkitLast"];
+NSDictionary *vpOut = @{@"orientation": @(vpTagOrientation), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpOut options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-autolock-state.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-autolock-state.lldb
new file mode 100644
index 00000000..cf5d1055
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-autolock-state.lldb
@@ -0,0 +1,6 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSObject *vpIdle = [(NSObject *)[UIApplication sharedApplication] valueForKey:@"_idleTimerGlobalCoordinator"];
+NSObject *vpL = (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance));
+[NSString stringWithFormat:@"idleDisabled=%d timer=%@ assertions=%@ locked=%d", ((BOOL (*)(id, SEL))vpMsg)(vpIdle, @selector(isIdleTimerDisabled)), [(NSObject *)((id (*)(id, SEL))vpMsg)(vpIdle, @selector(idleTimer)) description], [(NSObject *)[vpIdle valueForKey:@"_idleTimerDisableAssertions"] description], ((BOOL (*)(id, SEL))vpMsg)(vpL, @selector(isUILocked))]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-keys.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-keys.zsh
new file mode 100755
index 00000000..c14de851
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-keys.zsh
@@ -0,0 +1,22 @@
+#!/bin/zsh
+# vm-chrome-keys.zsh <records.jsonl | chrome.json posture-label>
+# The BASELINE "System chrome" values, per display: status bar provider class, statusBarFrame,
+# root icon list frame + spacing, floating dock view frame, wallpaper window frame, quick
+# action button frame/hidden, notification platter width, clock frame (the last three only
+# exist in a lock-screen run).
+set -euo pipefail
+jq=/opt/homebrew/bin/jq
+if [[ $1 == *.jsonl ]]; then src=($jq -s -c '[.[] | select(.probe | test("^chrome"))]' $1); else src=($jq -c --arg l "$2" '[.records[] | select(.posture == $l)]' $1); fi
+"${src[@]}" | $jq -c '
+ def fr: if type == "object" and has("x") then . elif type == "object" then (.frameInWindow // .frame) else . end | if type == "object" then [.x, .y, .width, .height] | map(. * 100 | round / 100) else . end;
+ group_by(.display)[] | . as $r | ($r[0].display) as $d | {display: $d,
+ io: ([$r[] | select(.api == "UIWindowScene.interfaceOrientation") | .value] | first),
+ provider: ([$r[] | select(.api == "STUIStatusBar.visualProvider") | .value | tostring | capture("VisualProvider_(?<c>[A-Za-z0-9]+)").c] | first),
+ statusBarFrame: ([$r[] | select(.api == "SBWindowSceneStatusBarManager.statusBarFrame") | .value | fr] | first),
+ rootList: ([$r[] | select(.api == "SBIconListView[SBIconListView/SBIconLocationRoot#0].view") | .value | fr] | first),
+ rootSpacing: ([$r[] | select(.api == "SBIconListView[SBIconListView/SBIconLocationRoot#0].effectiveIconSpacing") | .value | [.width, .height] | map(. * 100 | round / 100)] | first),
+ dock: ([$r[] | select(.api == "SBFloatingDockView.view") | .value | fr] | first),
+ wallpaperWindow: ([$r[] | select(.api | test("WallpaperSecureWindow.*view$|^_SBWallpaperSecureWindow.view$")) | .value | fr] | first),
+ quickAction: ([$r[] | select(.api | test("^CSQuickActionsButton#0.view$")) | .value | {f: fr, hidden: .hidden}] | first),
+ platterWidth: ([$r[] | select(.api | test("NCNotificationShortLookView.*view$")) | .value | .bounds.width] | first),
+ clock: ([$r[] | select(.api | test("^CSProminentTimeView.view$")) | .value | fr] | first)}'
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-lock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-lock.lldb
new file mode 100644
index 00000000..a7ebd120
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-lock.lldb
@@ -0,0 +1,301 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+int (^vpStrncmp)(const char *, const char *, size_t) = ^int(const char *a, const char *b, size_t n) { for (size_t i = 0; i < n; i++) { if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; if (!a[i]) return 0; } return 0; };
+int (^vpStrcmp)(const char *, const char *) = ^int(const char *a, const char *b) { return vpStrncmp(a, b, (size_t)-1); };
+NSMutableArray *vpRecs = [NSMutableArray array];
+__block NSString *vpCurDisp = @"-"; __block NSString *vpCurScene = @"-"; __block long vpCurOrient = 0;
+id (^vpNum)(double) = ^id(double vaX) { if (vaX != vaX) return (id)@"nan"; if (vaX > 1e300) return (id)@"inf"; if (vaX < -1e300) return (id)@"-inf"; return (id)@(vaX); };
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null], @"display": vpCurDisp, @"scene": vpCurScene, @"sceneOrientation": @(vpCurOrient)}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": vpNum(vaR.origin.x), @"y": vpNum(vaR.origin.y), @"width": vpNum(vaR.size.width), @"height": vpNum(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": vpNum(vaS.width), @"height": vpNum(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": vpNum(vaI.top), @"left": vpNum(vaI.left), @"bottom": vpNum(vaI.bottom), @"right": vpNum(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": vpNum(vaT.a), @"b": vpNum(vaT.b), @"c": vpNum(vaT.c), @"d": vpNum(vaT.d), @"tx": vpNum(vaT.tx), @"ty": vpNum(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return vpNum(vaD); return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!vpStrcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!vpStrcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!vpStrcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": vpNum(vaP.x), @"y": vpNum(vaP.y)}; }
+ if (!vpStrcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!vpStrcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": vpNum(vaI.top), @"leading": vpNum(vaI.leading), @"bottom": vpNum(vaI.bottom), @"trailing": vpNum(vaI.trailing)}; }
+ if (!vpStrcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? vpNum(vaBuf[vaJ]) : (id)@(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 400) vaS = [[vaS substringToIndex:400] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController", @"liftToWakeController", @"_preferredIntelligentAssistantVisibility", @"_preferredIntelligentAssistantConfiguration", @"SBSUI_preferredSystemRootLayerTransform", @"iconImageAlignment", @"maximumNumberOfPages"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vpSkip containsObject:vaGetter] || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGettersRx)(NSObject *, Class, NSRegularExpression *) = ^NSDictionary *(NSObject *vaO, Class vaStop, NSRegularExpression *vaAllowRx) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vaAllowRx firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) { return vpGettersRx(vaO, vaStop, vpAllow); };
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSSet *vpDataKeys = [NSSet setWithArray:@[@"currentAggregatedData", @"currentData", @"dataAggregator", @"displayItemStates", @"items", @"dependentDataEntryKeys", @"overlayData", @"animationContextId"]];
+void (^vpObj)(NSString *, NSString *, NSObject *) = ^(NSString *vaRole, NSString *vaCall, NSObject *vaO) {
+ if (!vaO) { vpAdd([vaRole stringByAppendingString:@".class"], @"private", vaCall, nil, @"nil"); return; }
+ vpAdd([vaRole stringByAppendingString:@".class"], @"private", [vaCall stringByAppendingString:@".class"], vpChain(vaO), nil);
+ NSMutableDictionary *vaAll = [NSMutableDictionary dictionaryWithDictionary:vpGetters(vaO, nil)];
+ [vaAll addEntriesFromDictionary:vpProps(vaO, nil)];
+ for (NSString *vaK in [[vaAll allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ if ([vpDataKeys containsObject:vaK]) continue;
+ vpAdd([NSString stringWithFormat:@"%@.%@", vaRole, vaK], @"private", [NSString stringWithFormat:@"%@.%@", vaCall, vaK], vaAll[vaK], nil);
+ }
+};
+void (^vpViewRec)(NSString *, NSString *, UIView *) = ^(NSString *vaRole, NSString *vaCall, UIView *vaV) {
+ if (!vaV) { vpAdd([vaRole stringByAppendingString:@".view"], @"public", vaCall, nil, @"nil (view not found)"); return; }
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionaryWithDictionary:vpView(vaV)];
+ if ([vaV isKindOfClass:[UILabel class]]) { vaD[@"text"] = [(UILabel *)vaV text] ?: (id)[NSNull null]; vaD[@"fontPointSize"] = @([(UILabel *)vaV font].pointSize); vaD[@"font"] = [[(UILabel *)vaV font] description] ?: @""; }
+ if ([vaV isKindOfClass:[UIImageView class]]) { UIImage *vaI = [(UIImageView *)vaV image]; vaD[@"imageSize"] = vaI ? vpSize(vaI.size) : (id)[NSNull null]; vaD[@"imageScale"] = vaI ? @(vaI.scale) : (id)[NSNull null]; vaD[@"contentMode"] = @(vaV.contentMode); }
+ CATransform3D vaT = vaV.layer.transform;
+ if (!CATransform3DIsIdentity(vaT)) vaD[@"layerTransform"] = @[vpNum(vaT.m11), vpNum(vaT.m12), vpNum(vaT.m21), vpNum(vaT.m22), vpNum(vaT.m41), vpNum(vaT.m42), vpNum(vaT.m43)];
+ vaD[@"layerBounds"] = vpRect(vaV.layer.bounds);
+ if (vaV.window) vaD[@"safeAreaInsets"] = vpInsets(vaV.safeAreaInsets);
+ vpAdd([vaRole stringByAppendingString:@".view"], @"public", [vaCall stringByAppendingString:@" frame/bounds/transform (frameInWindow = convertRect:bounds toView:window)"], vaD, nil);
+};
+void (^vpViewsOf)(NSString *, UIView *, NSArray *) = ^(NSString *vaPrefix, UIView *vaRoot, NSArray *vaClasses) {
+ NSMutableDictionary *vaSeen = [NSMutableDictionary dictionary];
+ NSMutableArray *vaQ = [NSMutableArray array]; if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) {
+ UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0];
+ NSString *vaCls = NSStringFromClass([vaV class]);
+ BOOL vaHit = (vaClasses == nil && vaV != vaRoot); for (NSString *vaC in vaClasses) if ([vaCls rangeOfString:vaC].location != NSNotFound) vaHit = YES;
+ if (vaHit) { NSInteger vaN = [(NSNumber *)vaSeen[vaCls] integerValue]; vaSeen[vaCls] = @(vaN + 1); vpViewRec([NSString stringWithFormat:@"%@.%@#%ld", vaPrefix, vaCls, (long)vaN], [NSString stringWithFormat:@"BFS(%@) %@ #%ld", vaPrefix, vaCls, (long)vaN], vaV); }
+ [vaQ addObjectsFromArray:vaV.subviews];
+ }
+};
+NSString *(^vpDispOf)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return [vaWS.session.persistentIdentifier isEqualToString:@"SB-main"] ? @"cover" : ([vaWS.session.persistentIdentifier isEqualToString:@"com.apple.springboard.bringup"] ? @"inner" : vaWS.session.persistentIdentifier); };
+NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"];
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [vpC stringByAppendingString:@".interfaceOrientation"], @(vpWS.interfaceOrientation), nil);
+ vpAdd(@"UIWindowScene.screen.bounds", @"public", [vpC stringByAppendingString:@".screen.bounds"], vpRect(vpWS.screen.bounds), nil);
+ vpAdd(@"UIWindowScene.coordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpWS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIWindowScene.effectiveGeometry", @"public", [vpC stringByAppendingString:@".effectiveGeometry"], [(NSObject *)vpWS.effectiveGeometry description], nil);
+ vpAdd(@"SBWindowScene.isPrimaryWindowScene", @"private", @"vpWS == [SBDisplayContentModeCoordinator primaryWindowScene]", @(vpWS == vpPrimary), nil);
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<%@>]", vpCurScene], @(((long (*)(id, SEL, id))vpMsg)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS)), nil);
+ for (NSString *vpK in @[@"_interfaceOrientation", @"sb_displayContentMode", @"pbui_hostInformedOrientation", @"sbui_systemArbitratedInterfaceOrientation", @"_safeAreaCornerInsets", @"_hasOrientationDependentSafeAreaCornerInsets", @"_hasOrientationDependentSafeAreaEdgeInsets", @"_shouldRotateSafeAreaInsetsToInterfaceOrientation", @"_windowsIgnoreSceneClientOrientation", @"_peripheryInsets", @"_systemMinimumMargin", @"_referenceBounds"]) {
+ if ([vpWS respondsToSelector:NSSelectorFromString(vpK)]) vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], vpVal([vpWS valueForKey:vpK]), nil);
+ else vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], nil, @"does not respond");
+ }
+ NSObject *vpSBM = [vpWS valueForKey:@"statusBarManager"];
+ if ([vpSBM isKindOfClass:[UIStatusBarManager class]]) {
+ UIStatusBarManager *vpPub = (UIStatusBarManager *)vpSBM;
+ vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarFrame"], vpRect(vpPub.statusBarFrame), nil);
+ vpAdd(@"UIStatusBarManager.statusBarHidden", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarHidden"], @(vpPub.statusBarHidden), nil);
+ vpAdd(@"UIStatusBarManager.statusBarStyle", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarStyle"], @(vpPub.statusBarStyle), nil);
+ } else vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager"], vpChain(vpSBM), @"statusBarManager is not a UIStatusBarManager");
+ vpObj(@"SBWindowSceneStatusBarManager", [vpC stringByAppendingString:@".statusBarManager"], vpSBM);
+ vpObj(@"SBHIDUISensorModeController", [vpC stringByAppendingString:@".HIDUISensorModeController"], [vpWS valueForKey:@"HIDUISensorModeController"]);
+ vpObj(@"SBContinuousFoldController", [vpC stringByAppendingString:@".continuousFoldController"], [vpWS valueForKey:@"continuousFoldController"]);
+ NSRegularExpression *vpScrRx = [NSRegularExpression regularExpressionWithPattern:@"(xclusion|ensor|eriphery|utout|sland|otch|ornerRadius|Shape|afeArea|Aperture|Bezel|Corner|Hinge|Fold)" options:0 error:nil];
+ NSDictionary *vpScrG = vpGettersRx(vpWS.screen, nil, vpScrRx);
+ for (NSString *vpK in [[vpScrG allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"UIScreen." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@.screen.%@", vpC, vpK], vpScrG[vpK], nil);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ UIWindow *vpSBW = vpWin(vpWS, @"SBStatusBarWindow");
+ vpViewRec(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ vpObj(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ UIView *vpWrap = vpFind(vpSBW, @"STUIStatusBar_Wrapper");
+ UIView *vpSB = vpFind(vpSBW, @"STUIStatusBar");
+ vpViewRec(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpObj(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpViewRec(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ vpObj(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ if (!vpSB) continue;
+ vpObj(@"STUIStatusBarStyleAttributes", [vpC stringByAppendingString:@" STUIStatusBar.styleAttributes"], [vpSB valueForKey:@"styleAttributes"]);
+ vpObj(@"SBWindowSceneStatusBarAssertionManager", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper.manager"], [vpWrap respondsToSelector:NSSelectorFromString(@"manager")] ? [vpWrap valueForKey:@"manager"] : nil);
+ NSObject *vpVP = [vpSB valueForKey:@"visualProvider"];
+ vpAdd(@"STUIStatusBar.visualProviderClass", @"private", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider.class"], NSStringFromClass([vpVP class]), nil);
+ vpObj(@"STUIStatusBarVisualProvider", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider"], vpVP);
+ NSDictionary *vpCls = vpGetters((NSObject *)[vpVP class], nil);
+ for (NSString *vpK in [[vpCls allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"STUIStatusBarVisualProvider+" stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"+[%@ %@]", NSStringFromClass([vpVP class]), vpK], vpCls[vpK], nil);
+ unsigned int vpPN = 0;
+ for (Class vpK = [vpVP class]; vpK && vpK != [NSObject class]; vpK = class_getSuperclass(vpK)) {
+ objc_property_t *vpPs = class_copyPropertyList(vpK, &vpPN);
+ for (unsigned int vpI = 0; vpI < vpPN; vpI++) {
+ NSString *vpName = [NSString stringWithUTF8String:property_getName(vpPs[vpI])];
+ char *vpTy = property_copyAttributeValue(vpPs[vpI], "T");
+ BOOL vpIsGuide = vpTy && [[NSString stringWithUTF8String:vpTy] containsString:@"UILayoutGuide"];
+ if (vpTy) free(vpTy);
+ if (!vpIsGuide) continue;
+ UILayoutGuide *vpG = [vpVP valueForKey:vpName];
+ if (!vpG) { vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", vpName, nil, @"nil"); continue; }
+ CGRect vpLF = vpG.layoutFrame; UIView *vpOV = vpG.owningView;
+ vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", [NSString stringWithFormat:@"%@ visualProvider.%@.layoutFrame (owningView coords) + converted to window", vpC, vpName],
+ @{@"identifier": vpG.identifier ?: @"", @"layoutFrame": vpRect(vpLF), @"owningView": vpOV ? NSStringFromClass([vpOV class]) : (id)[NSNull null], @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpLF toView:vpOV.window]) : (id)[NSNull null]}, nil);
+ }
+ if (vpPs) free(vpPs);
+ }
+ NSDictionary *vpRegions = [vpSB valueForKey:@"regions"];
+ for (NSString *vpRK in [[vpRegions allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vpR = vpRegions[vpRK];
+ vpObj([NSString stringWithFormat:@"STUIStatusBarRegion[%@]", vpRK], [NSString stringWithFormat:@"%@ STUIStatusBar.regions[%@]", vpC, vpRK], vpR);
+ for (NSString *vpItemKey in @[@"layoutItem", @"contentView", @"containerView", @"containerItem"]) {
+ if (![vpR respondsToSelector:NSSelectorFromString(vpItemKey)]) continue;
+ NSObject *vpItem = [vpR valueForKey:vpItemKey];
+ if ([vpItem isKindOfClass:[UIView class]]) vpViewRec([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@", vpRK, vpItemKey], [NSString stringWithFormat:@"%@ regions[%@].%@", vpC, vpRK, vpItemKey], (UIView *)vpItem);
+ else if ([vpItem isKindOfClass:[UILayoutGuide class]]) { UILayoutGuide *vpG = (UILayoutGuide *)vpItem; UIView *vpOV = vpG.owningView; vpAdd([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@.layoutFrame", vpRK, vpItemKey], @"private", [NSString stringWithFormat:@"%@ regions[%@].%@.layoutFrame", vpC, vpRK, vpItemKey], @{@"layoutFrame": vpRect(vpG.layoutFrame), @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpG.layoutFrame toView:vpOV.window]) : (id)[NSNull null]}, nil); }
+ }
+ }
+ UIView *vpFG = [vpSB valueForKey:@"foregroundView"];
+ vpViewRec(@"STUIStatusBarForegroundView", [vpC stringByAppendingString:@" STUIStatusBar.foregroundView"], vpFG);
+ vpViewsOf(@"STUIStatusBarForegroundView", vpFG, nil);
+}
+UIViewController *(^vpVCOf)(UIView *) = ^UIViewController *(UIView *vaV) { UIResponder *vaR = vaV; while (vaR && ![vaR isKindOfClass:[UIViewController class]]) vaR = [vaR nextResponder]; return (UIViewController *)vaR; };
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ NSObject *vpLSM = [vpWS valueForKey:@"lockScreenManager"];
+ vpAdd(@"SBLockScreenManager.isUILocked", @"private", [vpC stringByAppendingString:@".lockScreenManager.isUILocked"], [vpLSM respondsToSelector:NSSelectorFromString(@"isUILocked")] ? [vpLSM valueForKey:@"isUILocked"] : nil, [vpLSM respondsToSelector:NSSelectorFromString(@"isUILocked")] ? nil : @"does not respond");
+ vpAdd(@"SBLockScreenManager.isLockScreenVisible", @"private", [vpC stringByAppendingString:@".lockScreenManager.isLockScreenVisible"], [vpLSM respondsToSelector:NSSelectorFromString(@"isLockScreenVisible")] ? [vpLSM valueForKey:@"isLockScreenVisible"] : nil, nil);
+ UIWindow *vpCW = vpWin(vpWS, @"SBCoverSheetWindow");
+ vpViewRec(@"SBCoverSheetWindow", [vpC stringByAppendingString:@" SBCoverSheetWindow"], vpCW);
+ if (!vpCW) continue;
+ UIView *vpCSV = vpFind(vpCW, @"CSCoverSheetView");
+ vpViewRec(@"CSCoverSheetView", [vpC stringByAppendingString:@" SBCoverSheetWindow/CSCoverSheetView"], vpCSV);
+ vpObj(@"CSCoverSheetViewController", [vpC stringByAppendingString:@" CSCoverSheetView.(next responder VC)"], vpVCOf(vpCSV));
+ UIView *vpQAV = vpFind(vpCW, @"CSQuickActionsView");
+ vpViewRec(@"CSQuickActionsView", [vpC stringByAppendingString:@" CSQuickActionsView"], vpQAV);
+ vpObj(@"CSQuickActionsView", [vpC stringByAppendingString:@" CSQuickActionsView"], vpQAV);
+ vpObj(@"CSQuickActionsViewController", [vpC stringByAppendingString:@" CSQuickActionsView.(next responder VC)"], vpQAV ? vpVCOf(vpQAV) : nil);
+ UIView *vpPBV = vpFind(vpCW, @"CSProminentButtonsView");
+ vpViewRec(@"CSProminentButtonsView", [vpC stringByAppendingString:@" CSProminentButtonsView"], vpPBV);
+ vpObj(@"CSProminentButtonsView", [vpC stringByAppendingString:@" CSProminentButtonsView"], vpPBV);
+ NSArray *vpBtns = vpFindAll(vpCW, @"CSQuickActionsButton");
+ vpAdd(@"CSQuickActionsButton.count", @"private", [vpC stringByAppendingString:@" BFS count CSQuickActionsButton"], @(vpBtns.count), nil);
+ for (NSUInteger vpBI = 0; vpBI < vpBtns.count; vpBI++) {
+ UIView *vpB = vpBtns[vpBI];
+ NSString *vpRole = [NSString stringWithFormat:@"CSQuickActionsButton#%lu", (unsigned long)vpBI];
+ NSString *vpCall = [NSString stringWithFormat:@"%@ CSQuickActionsButton #%lu", vpC, (unsigned long)vpBI];
+ vpViewRec(vpRole, vpCall, vpB);
+ vpObj(vpRole, vpCall, vpB);
+ vpViewsOf(vpRole, vpB, nil);
+ NSArray *vpGlyphs = vpFindAll(vpB, @"CSQuickActionImageGlyphView");
+ for (NSUInteger vpGI = 0; vpGI < vpGlyphs.count; vpGI++) {
+ UIView *vpG = vpGlyphs[vpGI];
+ NSString *vpGRole = [NSString stringWithFormat:@"%@.CSQuickActionImageGlyphView#%lu", vpRole, (unsigned long)vpGI];
+ vpObj(vpGRole, [vpCall stringByAppendingFormat:@" CSQuickActionImageGlyphView #%lu", (unsigned long)vpGI], vpG);
+ CGRect vpBB = vpB.bounds; CGRect vpGF = [vpG convertRect:vpG.bounds toView:vpB];
+ NSMutableArray *vpImgs = [NSMutableArray array];
+ for (UIView *vpIV in vpFindAll(vpG, @"UIImageView")) { CGRect vpIF = [vpIV convertRect:vpIV.bounds toView:vpB]; [vpImgs addObject:@{@"class": NSStringFromClass([vpIV class]), @"frameInButton": vpRect(vpIF), @"imageSize": [(UIImageView *)vpIV image] ? vpSize([(UIImageView *)vpIV image].size) : (id)[NSNull null], @"widthOverButtonWidth": vpNum(vpIF.size.width / vpBB.size.width), @"heightOverButtonHeight": vpNum(vpIF.size.height / vpBB.size.height), @"hidden": @(vpIV.hidden)}]; }
+ vpAdd([vpGRole stringByAppendingString:@".ratioToButton"], @"private", [vpCall stringByAppendingString:@" glyph frame (convertRect:bounds toView:button) / button bounds; layer transform a/d"],
+ @{@"buttonBounds": vpRect(vpBB), @"glyphFrameInButton": vpRect(vpGF), @"glyphBounds": vpRect(vpG.bounds), @"glyphTransform": vpXf(vpG.transform), @"glyphWidthOverButtonWidth": vpNum(vpGF.size.width / vpBB.size.width), @"glyphHeightOverButtonHeight": vpNum(vpGF.size.height / vpBB.size.height), @"glyphBoundsWidthOverButtonWidth": vpNum(vpG.bounds.size.width / vpBB.size.width), @"imageViews": vpImgs}, nil);
+ }
+ if (!vpGlyphs.count) vpAdd([vpRole stringByAppendingString:@".CSQuickActionImageGlyphView#0.ratioToButton"], @"private", vpCall, nil, @"no CSQuickActionImageGlyphView under button");
+ }
+ UIView *vpDate = vpFind(vpCW, @"SBFLockScreenDateView");
+ vpViewRec(@"SBFLockScreenDateView", [vpC stringByAppendingString:@" SBFLockScreenDateView"], vpDate);
+ vpObj(@"SBFLockScreenDateView", [vpC stringByAppendingString:@" SBFLockScreenDateView"], vpDate);
+ UIView *vpPTV = vpFind(vpCW, @"CSProminentTimeView");
+ vpObj(@"CSProminentTimeView", [vpC stringByAppendingString:@" CSProminentTimeView"], vpPTV);
+ UIView *vpPDV = vpFind(vpCW, @"CSProminentDisplayView");
+ vpObj(@"CSProminentDisplayView", [vpC stringByAppendingString:@" CSProminentDisplayView"], vpPDV);
+ vpObj(@"CSProminentDisplayViewController", [vpC stringByAppendingString:@" CSProminentDisplayView.(next responder VC)"], vpPDV ? vpVCOf(vpPDV) : nil);
+ vpViewsOf(@"SBCoverSheetWindow", vpCW, @[@"CSProminent", @"SBFLockScreenDateView", @"TitleLabelView", @"_UIAnimatingLabel", @"CSCombinedListView", @"NCNotificationStructuredListView", @"NCNotificationModernListView", @"NCNotificationListView", @"NCNotificationListCell", @"NCPlatterView", @"NCNotificationShortLookView", @"PLPlatterView", @"NCNotificationSeamless", @"NCNotificationListCountIndicatorView", @"NCNotificationListSectionRevealHintView", @"CSMainPageView", @"CSScrollView", @"CSFixedFooterView", @"CSStatusTextView", @"CSHomeAffordanceView", @"CSTeachableMomentsContainerView", @"SBUILegibilityLabel", @"CSQuickActions", @"NCGlassGroupView"]);
+ UIView *vpCLV = vpFind(vpCW, @"CSCombinedListView");
+ vpObj(@"CSCombinedListViewController", [vpC stringByAppendingString:@" CSCombinedListView.(next responder VC)"], vpCLV ? vpVCOf(vpCLV) : nil);
+ vpObj(@"CSCombinedListView", [vpC stringByAppendingString:@" CSCombinedListView"], vpCLV);
+ UIView *vpSLV = vpFind(vpCW, @"NCNotificationStructuredListView");
+ vpObj(@"NCNotificationStructuredListViewController", [vpC stringByAppendingString:@" NCNotificationStructuredListView.(next responder VC)"], vpSLV ? vpVCOf(vpSLV) : nil);
+ vpObj(@"NCNotificationStructuredListView", [vpC stringByAppendingString:@" NCNotificationStructuredListView"], vpSLV);
+ vpObj(@"NCNotificationListView#0", [vpC stringByAppendingString:@" first NCNotificationListView"], vpFind(vpCW, @"NCNotificationListView"));
+ NSArray *vpShort = vpFindAll(vpCW, @"NCNotificationShortLookView");
+ vpAdd(@"NCNotificationShortLookView.count", @"private", [vpC stringByAppendingString:@" BFS count NCNotificationShortLookView"], @(vpShort.count), nil);
+ if (vpShort.count) vpObj(@"NCNotificationShortLookView#0", [vpC stringByAppendingString:@" first NCNotificationShortLookView"], vpShort[0]);
+}
+NSDictionary *vpOutD = @{@"primaryScene": vpPrimary ? vpSceneId(vpPrimary) : @"", @"primaryOrientation": @(vpPrimary.interfaceOrientation), @"records": vpRecs};
+NSError *vpJErr = nil;
+NSData *vpJD = [NSJSONSerialization isValidJSONObject:vpOutD] ? [NSJSONSerialization dataWithJSONObject:vpOutD options:0 error:&vpJErr] : nil;
+vpJD ? [[NSString alloc] initWithData:vpJD encoding:NSUTF8StringEncoding] : [NSString stringWithFormat:@"INVALID JSON %@", vpJErr]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-state.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-state.lldb
new file mode 100644
index 00000000..86dd8f7d
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-chrome-state.lldb
@@ -0,0 +1,348 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+int (^vpStrncmp)(const char *, const char *, size_t) = ^int(const char *a, const char *b, size_t n) { for (size_t i = 0; i < n; i++) { if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; if (!a[i]) return 0; } return 0; };
+int (^vpStrcmp)(const char *, const char *) = ^int(const char *a, const char *b) { return vpStrncmp(a, b, (size_t)-1); };
+NSMutableArray *vpRecs = [NSMutableArray array];
+__block NSString *vpCurDisp = @"-"; __block NSString *vpCurScene = @"-"; __block long vpCurOrient = 0;
+id (^vpNum)(double) = ^id(double vaX) { if (vaX != vaX) return (id)@"nan"; if (vaX > 1e300) return (id)@"inf"; if (vaX < -1e300) return (id)@"-inf"; return (id)@(vaX); };
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *vaApi, NSString *vaKind, NSString *vaCall, id vaValue, NSString *vaError) {
+ [vpRecs addObject:@{@"api": vaApi, @"kind": vaKind, @"call": vaCall, @"value": vaValue ?: [NSNull null], @"error": vaError ?: [NSNull null], @"display": vpCurDisp, @"scene": vpCurScene, @"sceneOrientation": @(vpCurOrient)}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect vaR) {
+ return @{@"x": vpNum(vaR.origin.x), @"y": vpNum(vaR.origin.y), @"width": vpNum(vaR.size.width), @"height": vpNum(vaR.size.height)};
+};
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize vaS) { return @{@"width": vpNum(vaS.width), @"height": vpNum(vaS.height)}; };
+NSDictionary *(^vpInsets)(UIEdgeInsets) = ^NSDictionary *(UIEdgeInsets vaI) { return @{@"top": vpNum(vaI.top), @"left": vpNum(vaI.left), @"bottom": vpNum(vaI.bottom), @"right": vpNum(vaI.right)}; };
+NSDictionary *(^vpXf)(CGAffineTransform) = ^NSDictionary *(CGAffineTransform vaT) { return @{@"a": vpNum(vaT.a), @"b": vpNum(vaT.b), @"c": vpNum(vaT.c), @"d": vpNum(vaT.d), @"tx": vpNum(vaT.tx), @"ty": vpNum(vaT.ty)}; };
+id (^vpVal)(NSObject *) = ^id(NSObject *vaV) {
+ if (!vaV) return (id)[NSNull null];
+ if ([vaV isKindOfClass:[NSString class]]) return (id)vaV;
+ if ([vaV isKindOfClass:[NSNumber class]]) { double vaD = [(NSNumber *)vaV doubleValue]; if (vaD != vaD || vaD > 1e300 || vaD < -1e300) return vpNum(vaD); return (id)vaV; }
+ if ([vaV isKindOfClass:[NSValue class]]) {
+ const char *vaT = [(NSValue *)vaV objCType];
+ if (!vpStrcmp(vaT, @encode(CGRect))) return (id)vpRect([(NSValue *)vaV CGRectValue]);
+ if (!vpStrcmp(vaT, @encode(CGSize))) return (id)vpSize([(NSValue *)vaV CGSizeValue]);
+ if (!vpStrcmp(vaT, @encode(CGPoint))) { CGPoint vaP = [(NSValue *)vaV CGPointValue]; return (id)@{@"x": vpNum(vaP.x), @"y": vpNum(vaP.y)}; }
+ if (!vpStrcmp(vaT, @encode(UIEdgeInsets))) return (id)vpInsets([(NSValue *)vaV UIEdgeInsetsValue]);
+ if (!vpStrcmp(vaT, @encode(NSDirectionalEdgeInsets))) { NSDirectionalEdgeInsets vaI = [(NSValue *)vaV directionalEdgeInsetsValue]; return (id)@{@"top": vpNum(vaI.top), @"leading": vpNum(vaI.leading), @"bottom": vpNum(vaI.bottom), @"trailing": vpNum(vaI.trailing)}; }
+ if (!vpStrcmp(vaT, @encode(CGAffineTransform))) return (id)vpXf([(NSValue *)vaV CGAffineTransformValue]);
+ NSString *vaTs = [NSString stringWithUTF8String:vaT]; NSString *vaFlat = [[vaTs componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSRegularExpression *vaRx = [NSRegularExpression regularExpressionWithPattern:@"[A-Za-z_][A-Za-z0-9_]*=" options:0 error:nil];
+ NSString *vaFields = [vaRx stringByReplacingMatchesInString:vaTs options:0 range:NSMakeRange(0, vaTs.length) withTemplate:@""]; vaFields = [[vaFields componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"{}"]] componentsJoinedByString:@""];
+ NSUInteger vaSz = 0; NSGetSizeAndAlignment(vaT, &vaSz, NULL);
+ if (vaFields.length > 0 && vaFields.length * 8 == vaSz && [[vaFields stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"dqQ"]] length] == 0) {
+ double vaBuf[64]; long long *vaQb = (long long *)vaBuf; [(NSValue *)vaV getValue:vaBuf size:vaSz]; NSMutableArray *vaArr = [NSMutableArray array];
+ for (NSUInteger vaJ = 0; vaJ < vaFields.length && vaJ < 64; vaJ++) { unichar vaCh = [vaFields characterAtIndex:vaJ]; [vaArr addObject:vaCh == (unichar)100 ? vpNum(vaBuf[vaJ]) : (id)@(vaQb[vaJ])]; }
+ return (id)@{@"objCType": vaTs, @"fields": vaArr};
+ }
+ }
+ NSString *vaS = [vaV description];
+ if (vaS.length > 400) vaS = [[vaS substringToIndex:400] stringByAppendingString:@"…"];
+ return (id)(vaS ?: @"");
+};
+NSSet *vpSkip = [NSSet setWithArray:@[@"hash", @"superclass", @"description", @"debugDescription", @"layer", @"window", @"superview", @"subviews", @"nextResponder", @"undoManager", @"traitCollection", @"inputView", @"inputAccessoryView", @"inputViewController", @"inputAccessoryViewController", @"textInputContextIdentifier", @"textInputMode", @"keyCommands", @"userActivity", @"activityItemsConfiguration", @"_ui_viewController", @"view", @"viewIfLoaded", @"childViewControllers", @"parentViewController", @"liftToWakeController", @"_preferredIntelligentAssistantVisibility", @"_preferredIntelligentAssistantConfiguration", @"SBSUI_preferredSystemRootLayerTransform", @"iconImageAlignment", @"maximumNumberOfPages"]];
+NSRegularExpression *vpDeny = [NSRegularExpression regularExpressionWithPattern:@"^_?(update|set|layout|reload|remove|add|invalidate|reset|perform|begin|end|start|stop|dealloc|release|retain|autorelease|init|copy|mutableCopy|prepare|apply|animate|tear|show|hide|dismiss|present|activate|deactivate|flush|cancel|clear|did|will|register|unregister|handle|make|create|load|save|toggle|cleanup|clean|configure|install|uninstall|request|send|post|notify|fire|run|refresh|rebuild|recompute|recalc|resign|become|enter|exit|push|pop|reveal|scroll|snap|commit|discard|evaluate|force|lock|unlock|play|pause|resume|purge|teardown|destroy|close|open|attach|detach|enable|disable|sizeToFit|tick|step|track|cache|regenerate|restore|transition|swap|move|insert|delete|select|deselect|replace|dump|log|print|test|emit|schedule|reconfigure|setup|setUp|nuke|kill|wake|sleep|suspend|reapply|reevaluate|reorder|rotate|relayout|recreate|capture|snapshot|render|draw|display|focus|unfocus|zoom|tap|press|click|drag|drop|new|alloc|generate|compute|calculate|fetch|query|refetch|reset|noteThat|note|mark|unmark|flash|bounce|pulse|wiggle|jiggle|shake)([A-Z_]|$)" options:0 error:nil];
+NSRegularExpression *vpAllow = [NSRegularExpression regularExpressionWithPattern:@"(Size|Height|Width|Frame|Inset|Insets|Rect|Spacing|Count|Scale|Layout|Style|Mode|Orientation|Font|Rows|Columns|Margin|Margins|Padding|Region|Regions|Bounds|Offset|Alignment|Provider|Identifier|Position|Radius|Length|Gap|Center|Origin|Edge|Metrics|Configuration|Class|Type|Kind|Progress|Factor|Alpha|Transform|Placement|Location|Axis|Side|Display|Interface|Visible|Hidden|Enabled|Grid|Max|Min|Lines|Area|Extent|Dimension|Point|Points|Rotation|Angle|Variant|Idiom|Spec|Specification|Mask|Appearance|Leading|Trailing|Top|Bottom|Left|Right|Items|Item|Views|Attributes|Data|Level)$|^(rows|columns|mode|style|layout|orientation|font|scale|alpha|frame|bounds|transform|metrics|insets|margins|region|regions|visualProvider|layoutProvider|configuration|spacing|is[A-Z]|has[A-Z]|should[A-Z]|uses[A-Z]|wants[A-Z]|supports[A-Z]|allows[A-Z])" options:0 error:nil];
+BOOL (^vpStopAt)(Class, Class) = ^BOOL(Class vaK, Class vaStop) { if (!vaK || vaK == vaStop) return YES; if (vaStop && class_isMetaClass(vaK) && vaK == object_getClass(vaStop)) return YES; return [@[@"NSObject", @"UIView", @"UIResponder", @"UIViewController", @"UIWindow", @"UIScrollView", @"UILabel", @"UIImageView", @"UIControl", @"UIButton"] containsObject:NSStringFromClass(vaK)]; };
+NSArray *(^vpChain)(NSObject *) = ^NSArray *(NSObject *vaO) {
+ NSMutableArray *vaA = [NSMutableArray array];
+ for (Class vaK = vaO ? object_getClass(vaO) : nil; vaK; vaK = class_getSuperclass(vaK)) [vaA addObject:NSStringFromClass(vaK)];
+ return (NSArray *)vaA;
+};
+BOOL (^vpTypeOK)(const char *) = ^BOOL(const char *vaTy) {
+ if (!vaTy) return NO;
+ NSString *vaTs = [NSString stringWithUTF8String:vaTy];
+ if ([vaTs hasPrefix:@"@"]) return ![vaTs hasPrefix:@"@?"];
+ if (vaTs.length == 1) return [@"cislqCISLQfdB" containsString:vaTs];
+ return [vaTs hasPrefix:@"{"] && ![vaTs containsString:@"^"] && ![vaTs containsString:@"("] && ![vaTs containsString:@"?"] && ![vaTs containsString:@"@"];
+};
+NSDictionary *(^vpProps)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; objc_property_t *vaPs = class_copyPropertyList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ NSString *vaName = [NSString stringWithUTF8String:property_getName(vaPs[vaI])];
+ if ([vpSkip containsObject:vaName] || vaD[vaName]) continue;
+ char *vaTy = property_copyAttributeValue(vaPs[vaI], "T");
+ char *vaGt = property_copyAttributeValue(vaPs[vaI], "G");
+ NSString *vaGetter = vaGt ? [NSString stringWithUTF8String:vaGt] : vaName;
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (vaGt) free(vaGt);
+ if (!vaOk || [vpSkip containsObject:vaGetter] || [vaGetter containsString:@":"] || ![vaO respondsToSelector:NSSelectorFromString(vaGetter)]) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaGetter]);
+ }
+ if (vaPs) free(vaPs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGettersRx)(NSObject *, Class, NSRegularExpression *) = ^NSDictionary *(NSObject *vaO, Class vaStop, NSRegularExpression *vaAllowRx) {
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionary];
+ if (!vaO) return (NSDictionary *)vaD;
+ for (Class vaK = object_getClass(vaO); !vpStopAt(vaK, vaStop); vaK = class_getSuperclass(vaK)) {
+ unsigned int vaN = 0; Method *vaMs = class_copyMethodList(vaK, &vaN);
+ for (unsigned int vaI = 0; vaI < vaN; vaI++) {
+ if (method_getNumberOfArguments(vaMs[vaI]) != 2) continue;
+ NSString *vaName = NSStringFromSelector(method_getName(vaMs[vaI]));
+ if (vaD[vaName] || [vpSkip containsObject:vaName] || [vaName hasPrefix:@"."]) continue;
+ NSRange vaR = NSMakeRange(0, vaName.length);
+ if ([vpDeny firstMatchInString:vaName options:0 range:vaR] || ![vaAllowRx firstMatchInString:vaName options:0 range:vaR]) continue;
+ char *vaTy = method_copyReturnType(vaMs[vaI]);
+ BOOL vaOk = vpTypeOK(vaTy);
+ if (vaTy) free(vaTy);
+ if (!vaOk) continue;
+ vaD[vaName] = vpVal([vaO valueForKey:vaName]);
+ }
+ if (vaMs) free(vaMs);
+ }
+ return (NSDictionary *)vaD;
+};
+NSDictionary *(^vpGetters)(NSObject *, Class) = ^NSDictionary *(NSObject *vaO, Class vaStop) { return vpGettersRx(vaO, vaStop, vpAllow); };
+NSArray *(^vpFindAll)(UIView *, NSString *) = ^NSArray *(UIView *vaRoot, NSString *vaCls) {
+ NSMutableArray *vaQ = [NSMutableArray array]; NSMutableArray *vaRes = [NSMutableArray array];
+ Class vaC = NSClassFromString(vaCls);
+ if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) { UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0]; if (vaC && [vaV isKindOfClass:vaC]) [vaRes addObject:vaV]; [vaQ addObjectsFromArray:vaV.subviews]; }
+ return (NSArray *)vaRes;
+};
+UIView *(^vpFind)(UIView *, NSString *) = ^UIView *(UIView *vaRoot, NSString *vaCls) { NSArray *vaA = vpFindAll(vaRoot, vaCls); return (UIView *)(vaA.count ? vaA[0] : nil); };
+NSDictionary *(^vpView)(UIView *) = ^NSDictionary *(UIView *vaV) {
+ if (!vaV) return (NSDictionary *)nil;
+ UIWindow *vaW = vaV.window;
+ return (NSDictionary *)@{@"class": NSStringFromClass([vaV class]), @"frameInWindow": vaW ? vpRect([vaV convertRect:vaV.bounds toView:vaW]) : (id)[NSNull null], @"frame": vpRect(vaV.frame), @"bounds": vpRect(vaV.bounds), @"transform": vpXf(vaV.transform), @"hidden": @(vaV.hidden), @"alpha": @(vaV.alpha), @"window": vaW ? NSStringFromClass([vaW class]) : (id)[NSNull null], @"effectivelyVisible": @(vaW && !vaV.hidden && vaV.alpha > 0)};
+};
+NSString *(^vpSceneId)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return vaWS.session.persistentIdentifier ?: @"?"; };
+NSMutableArray *vpSBScenes = [NSMutableArray array];
+for (UIScene *vpSc0 in [[UIApplication sharedApplication] connectedScenes]) if ([NSStringFromClass([vpSc0 class]) isEqualToString:@"SBWindowScene"]) [vpSBScenes addObject:vpSc0];
+[vpSBScenes sortUsingComparator:^NSComparisonResult(UIScene *vaX, UIScene *vaY) { return [vaX.session.persistentIdentifier compare:vaY.session.persistentIdentifier]; }];
+UIWindow *(^vpWin)(UIWindowScene *, NSString *) = ^UIWindow *(UIWindowScene *vaWS, NSString *vaCls) { for (UIWindow *vaW in vaWS.windows) if ([NSStringFromClass([vaW class]) isEqualToString:vaCls]) return vaW; return (UIWindow *)nil; };
+NSSet *vpDataKeys = [NSSet setWithArray:@[@"currentAggregatedData", @"currentData", @"dataAggregator", @"displayItemStates", @"items", @"dependentDataEntryKeys", @"overlayData", @"animationContextId"]];
+void (^vpObj)(NSString *, NSString *, NSObject *) = ^(NSString *vaRole, NSString *vaCall, NSObject *vaO) {
+ if (!vaO) { vpAdd([vaRole stringByAppendingString:@".class"], @"private", vaCall, nil, @"nil"); return; }
+ vpAdd([vaRole stringByAppendingString:@".class"], @"private", [vaCall stringByAppendingString:@".class"], vpChain(vaO), nil);
+ NSMutableDictionary *vaAll = [NSMutableDictionary dictionaryWithDictionary:vpGetters(vaO, nil)];
+ [vaAll addEntriesFromDictionary:vpProps(vaO, nil)];
+ for (NSString *vaK in [[vaAll allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ if ([vpDataKeys containsObject:vaK]) continue;
+ vpAdd([NSString stringWithFormat:@"%@.%@", vaRole, vaK], @"private", [NSString stringWithFormat:@"%@.%@", vaCall, vaK], vaAll[vaK], nil);
+ }
+};
+void (^vpViewRec)(NSString *, NSString *, UIView *) = ^(NSString *vaRole, NSString *vaCall, UIView *vaV) {
+ if (!vaV) { vpAdd([vaRole stringByAppendingString:@".view"], @"public", vaCall, nil, @"nil (view not found)"); return; }
+ NSMutableDictionary *vaD = [NSMutableDictionary dictionaryWithDictionary:vpView(vaV)];
+ if ([vaV isKindOfClass:[UILabel class]]) { vaD[@"text"] = [(UILabel *)vaV text] ?: (id)[NSNull null]; vaD[@"fontPointSize"] = @([(UILabel *)vaV font].pointSize); vaD[@"font"] = [[(UILabel *)vaV font] description] ?: @""; }
+ if ([vaV isKindOfClass:[UIImageView class]]) { UIImage *vaI = [(UIImageView *)vaV image]; vaD[@"imageSize"] = vaI ? vpSize(vaI.size) : (id)[NSNull null]; vaD[@"imageScale"] = vaI ? @(vaI.scale) : (id)[NSNull null]; vaD[@"contentMode"] = @(vaV.contentMode); }
+ CATransform3D vaT = vaV.layer.transform;
+ if (!CATransform3DIsIdentity(vaT)) vaD[@"layerTransform"] = @[vpNum(vaT.m11), vpNum(vaT.m12), vpNum(vaT.m21), vpNum(vaT.m22), vpNum(vaT.m41), vpNum(vaT.m42), vpNum(vaT.m43)];
+ vaD[@"layerBounds"] = vpRect(vaV.layer.bounds);
+ if (vaV.window) vaD[@"safeAreaInsets"] = vpInsets(vaV.safeAreaInsets);
+ vpAdd([vaRole stringByAppendingString:@".view"], @"public", [vaCall stringByAppendingString:@" frame/bounds/transform (frameInWindow = convertRect:bounds toView:window)"], vaD, nil);
+};
+void (^vpViewsOf)(NSString *, UIView *, NSArray *) = ^(NSString *vaPrefix, UIView *vaRoot, NSArray *vaClasses) {
+ NSMutableDictionary *vaSeen = [NSMutableDictionary dictionary];
+ NSMutableArray *vaQ = [NSMutableArray array]; if (vaRoot) [vaQ addObject:vaRoot];
+ while (vaQ.count) {
+ UIView *vaV = vaQ[0]; [vaQ removeObjectAtIndex:0];
+ NSString *vaCls = NSStringFromClass([vaV class]);
+ BOOL vaHit = (vaClasses == nil && vaV != vaRoot); for (NSString *vaC in vaClasses) if ([vaCls rangeOfString:vaC].location != NSNotFound) vaHit = YES;
+ if (vaHit) { NSInteger vaN = [(NSNumber *)vaSeen[vaCls] integerValue]; vaSeen[vaCls] = @(vaN + 1); vpViewRec([NSString stringWithFormat:@"%@.%@#%ld", vaPrefix, vaCls, (long)vaN], [NSString stringWithFormat:@"BFS(%@) %@ #%ld", vaPrefix, vaCls, (long)vaN], vaV); }
+ [vaQ addObjectsFromArray:vaV.subviews];
+ }
+};
+NSString *(^vpDispOf)(UIWindowScene *) = ^NSString *(UIWindowScene *vaWS) { return [vaWS.session.persistentIdentifier isEqualToString:@"SB-main"] ? @"cover" : ([vaWS.session.persistentIdentifier isEqualToString:@"com.apple.springboard.bringup"] ? @"inner" : vaWS.session.persistentIdentifier); };
+NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"];
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [vpC stringByAppendingString:@".interfaceOrientation"], @(vpWS.interfaceOrientation), nil);
+ vpAdd(@"UIWindowScene.screen.bounds", @"public", [vpC stringByAppendingString:@".screen.bounds"], vpRect(vpWS.screen.bounds), nil);
+ vpAdd(@"UIWindowScene.coordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpWS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIWindowScene.effectiveGeometry", @"public", [vpC stringByAppendingString:@".effectiveGeometry"], [(NSObject *)vpWS.effectiveGeometry description], nil);
+ vpAdd(@"SBWindowScene.isPrimaryWindowScene", @"private", @"vpWS == [SBDisplayContentModeCoordinator primaryWindowScene]", @(vpWS == vpPrimary), nil);
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<%@>]", vpCurScene], @(((long (*)(id, SEL, id))vpMsg)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS)), nil);
+ for (NSString *vpK in @[@"_interfaceOrientation", @"sb_displayContentMode", @"pbui_hostInformedOrientation", @"sbui_systemArbitratedInterfaceOrientation", @"_safeAreaCornerInsets", @"_hasOrientationDependentSafeAreaCornerInsets", @"_hasOrientationDependentSafeAreaEdgeInsets", @"_shouldRotateSafeAreaInsetsToInterfaceOrientation", @"_windowsIgnoreSceneClientOrientation", @"_peripheryInsets", @"_systemMinimumMargin", @"_referenceBounds"]) {
+ if ([vpWS respondsToSelector:NSSelectorFromString(vpK)]) vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], vpVal([vpWS valueForKey:vpK]), nil);
+ else vpAdd([@"SBWindowScene." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpC, vpK], nil, @"does not respond");
+ }
+ NSObject *vpSBM = [vpWS valueForKey:@"statusBarManager"];
+ if ([vpSBM isKindOfClass:[UIStatusBarManager class]]) {
+ UIStatusBarManager *vpPub = (UIStatusBarManager *)vpSBM;
+ vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarFrame"], vpRect(vpPub.statusBarFrame), nil);
+ vpAdd(@"UIStatusBarManager.statusBarHidden", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarHidden"], @(vpPub.statusBarHidden), nil);
+ vpAdd(@"UIStatusBarManager.statusBarStyle", @"public", [vpC stringByAppendingString:@".statusBarManager.statusBarStyle"], @(vpPub.statusBarStyle), nil);
+ } else vpAdd(@"UIStatusBarManager.statusBarFrame", @"public", [vpC stringByAppendingString:@".statusBarManager"], vpChain(vpSBM), @"statusBarManager is not a UIStatusBarManager");
+ vpObj(@"SBWindowSceneStatusBarManager", [vpC stringByAppendingString:@".statusBarManager"], vpSBM);
+ vpObj(@"SBHIDUISensorModeController", [vpC stringByAppendingString:@".HIDUISensorModeController"], [vpWS valueForKey:@"HIDUISensorModeController"]);
+ vpObj(@"SBContinuousFoldController", [vpC stringByAppendingString:@".continuousFoldController"], [vpWS valueForKey:@"continuousFoldController"]);
+ NSRegularExpression *vpScrRx = [NSRegularExpression regularExpressionWithPattern:@"(xclusion|ensor|eriphery|utout|sland|otch|ornerRadius|Shape|afeArea|Aperture|Bezel|Corner|Hinge|Fold)" options:0 error:nil];
+ NSDictionary *vpScrG = vpGettersRx(vpWS.screen, nil, vpScrRx);
+ for (NSString *vpK in [[vpScrG allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"UIScreen." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@.screen.%@", vpC, vpK], vpScrG[vpK], nil);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ UIWindow *vpSBW = vpWin(vpWS, @"SBStatusBarWindow");
+ vpViewRec(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ vpObj(@"SBStatusBarWindow", [vpC stringByAppendingString:@" SBStatusBarWindow"], vpSBW);
+ UIView *vpWrap = vpFind(vpSBW, @"STUIStatusBar_Wrapper");
+ UIView *vpSB = vpFind(vpSBW, @"STUIStatusBar");
+ vpViewRec(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpObj(@"STUIStatusBar_Wrapper", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper"], vpWrap);
+ vpViewRec(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ vpObj(@"STUIStatusBar", [vpC stringByAppendingString:@" STUIStatusBar"], vpSB);
+ if (!vpSB) continue;
+ vpObj(@"STUIStatusBarStyleAttributes", [vpC stringByAppendingString:@" STUIStatusBar.styleAttributes"], [vpSB valueForKey:@"styleAttributes"]);
+ vpObj(@"SBWindowSceneStatusBarAssertionManager", [vpC stringByAppendingString:@" STUIStatusBar_Wrapper.manager"], [vpWrap respondsToSelector:NSSelectorFromString(@"manager")] ? [vpWrap valueForKey:@"manager"] : nil);
+ NSObject *vpVP = [vpSB valueForKey:@"visualProvider"];
+ vpAdd(@"STUIStatusBar.visualProviderClass", @"private", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider.class"], NSStringFromClass([vpVP class]), nil);
+ vpObj(@"STUIStatusBarVisualProvider", [vpC stringByAppendingString:@" STUIStatusBar.visualProvider"], vpVP);
+ NSDictionary *vpCls = vpGetters((NSObject *)[vpVP class], nil);
+ for (NSString *vpK in [[vpCls allKeys] sortedArrayUsingSelector:@selector(compare:)]) vpAdd([@"STUIStatusBarVisualProvider+" stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"+[%@ %@]", NSStringFromClass([vpVP class]), vpK], vpCls[vpK], nil);
+ unsigned int vpPN = 0;
+ for (Class vpK = [vpVP class]; vpK && vpK != [NSObject class]; vpK = class_getSuperclass(vpK)) {
+ objc_property_t *vpPs = class_copyPropertyList(vpK, &vpPN);
+ for (unsigned int vpI = 0; vpI < vpPN; vpI++) {
+ NSString *vpName = [NSString stringWithUTF8String:property_getName(vpPs[vpI])];
+ char *vpTy = property_copyAttributeValue(vpPs[vpI], "T");
+ BOOL vpIsGuide = vpTy && [[NSString stringWithUTF8String:vpTy] containsString:@"UILayoutGuide"];
+ if (vpTy) free(vpTy);
+ if (!vpIsGuide) continue;
+ UILayoutGuide *vpG = [vpVP valueForKey:vpName];
+ if (!vpG) { vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", vpName, nil, @"nil"); continue; }
+ CGRect vpLF = vpG.layoutFrame; UIView *vpOV = vpG.owningView;
+ vpAdd([NSString stringWithFormat:@"STUIStatusBarVisualProvider.%@.layoutFrame", vpName], @"private", [NSString stringWithFormat:@"%@ visualProvider.%@.layoutFrame (owningView coords) + converted to window", vpC, vpName],
+ @{@"identifier": vpG.identifier ?: @"", @"layoutFrame": vpRect(vpLF), @"owningView": vpOV ? NSStringFromClass([vpOV class]) : (id)[NSNull null], @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpLF toView:vpOV.window]) : (id)[NSNull null]}, nil);
+ }
+ if (vpPs) free(vpPs);
+ }
+ NSDictionary *vpRegions = [vpSB valueForKey:@"regions"];
+ for (NSString *vpRK in [[vpRegions allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vpR = vpRegions[vpRK];
+ vpObj([NSString stringWithFormat:@"STUIStatusBarRegion[%@]", vpRK], [NSString stringWithFormat:@"%@ STUIStatusBar.regions[%@]", vpC, vpRK], vpR);
+ for (NSString *vpItemKey in @[@"layoutItem", @"contentView", @"containerView", @"containerItem"]) {
+ if (![vpR respondsToSelector:NSSelectorFromString(vpItemKey)]) continue;
+ NSObject *vpItem = [vpR valueForKey:vpItemKey];
+ if ([vpItem isKindOfClass:[UIView class]]) vpViewRec([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@", vpRK, vpItemKey], [NSString stringWithFormat:@"%@ regions[%@].%@", vpC, vpRK, vpItemKey], (UIView *)vpItem);
+ else if ([vpItem isKindOfClass:[UILayoutGuide class]]) { UILayoutGuide *vpG = (UILayoutGuide *)vpItem; UIView *vpOV = vpG.owningView; vpAdd([NSString stringWithFormat:@"STUIStatusBarRegion[%@].%@.layoutFrame", vpRK, vpItemKey], @"private", [NSString stringWithFormat:@"%@ regions[%@].%@.layoutFrame", vpC, vpRK, vpItemKey], @{@"layoutFrame": vpRect(vpG.layoutFrame), @"layoutFrameInWindow": (vpOV && vpOV.window) ? vpRect([vpOV convertRect:vpG.layoutFrame toView:vpOV.window]) : (id)[NSNull null]}, nil); }
+ }
+ }
+ UIView *vpFG = [vpSB valueForKey:@"foregroundView"];
+ vpViewRec(@"STUIStatusBarForegroundView", [vpC stringByAppendingString:@" STUIStatusBar.foregroundView"], vpFG);
+ vpViewsOf(@"STUIStatusBarForegroundView", vpFG, nil);
+}
+NSArray *vpLocNames = @[@"SBIconLocationRoot", @"SBIconLocationRootWithWidgets", @"SBIconLocationRootWithWidgetsOnly", @"SBIconLocationDock", @"SBIconLocationFloatingDock", @"SBIconLocationFloatingDockSuggestions", @"SBIconLocationFolder", @"SBIconLocationAppLibrary", @"SBIconLocationAppLibraryCategoryPod", @"SBIconLocationAppLibraryCategoryPodExpanded", @"SBIconLocationAppLibrarySearch", @"SBIconLocationAppLibraryOverlay", @"SBIconLocationTodayView", @"SBIconLocationStackConfiguration", @"SBIconLocationAddWidgetSheet"];
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ UIWindow *vpHW = vpWin(vpWS, @"SBHomeScreenWindow");
+ vpViewRec(@"SBHomeScreenWindow", [vpC stringByAppendingString:@" SBHomeScreenWindow"], vpHW);
+ vpViewRec(@"SBIconContentView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBIconContentView"], vpFind(vpHW, @"SBIconContentView"));
+ vpViewRec(@"SBStatusBarLegibilityGradientView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBStatusBarLegibilityGradientView"], vpFind(vpHW, @"SBStatusBarLegibilityGradientView"));
+ NSObject *vpHSC = [vpWS valueForKey:@"homeScreenController"];
+ vpObj(@"SBHomeScreenController", [vpC stringByAppendingString:@".homeScreenController"], vpHSC);
+ NSObject *vpIM = [vpHSC respondsToSelector:NSSelectorFromString(@"iconManager")] ? [vpHSC valueForKey:@"iconManager"] : nil;
+ vpObj(@"SBHIconManager", [vpC stringByAppendingString:@".homeScreenController.iconManager"], vpIM);
+ NSObject *vpRFC = [vpIM respondsToSelector:NSSelectorFromString(@"rootFolderController")] ? [vpIM valueForKey:@"rootFolderController"] : nil;
+ vpObj(@"SBRootFolderController", [vpC stringByAppendingString:@".homeScreenController.iconManager.rootFolderController"], vpRFC);
+ UIView *vpRFV = vpFind(vpHW, @"SBRootFolderView");
+ vpViewRec(@"SBRootFolderView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBRootFolderView"], vpRFV);
+ vpObj(@"SBRootFolderView", [vpC stringByAppendingString:@" SBHomeScreenWindow/SBRootFolderView"], vpRFV);
+ NSObject *vpLLP = [vpIM respondsToSelector:NSSelectorFromString(@"listLayoutProvider")] ? [vpIM valueForKey:@"listLayoutProvider"] : nil;
+ vpObj(@"SBHIconListLayoutProvider", [vpC stringByAppendingString:@".homeScreenController.iconManager.listLayoutProvider"], vpLLP);
+ for (NSString *vpLN in vpLocNames) {
+ NSString **vpLP = (NSString **)dlsym(RTLD_DEFAULT, [vpLN UTF8String]);
+ NSString *vpLoc = vpLP ? *vpLP : vpLN;
+ NSString *vpRole = [NSString stringWithFormat:@"SBHIconListLayoutProvider.layoutForIconLocation[%@]", vpLN];
+ NSString *vpCall = [NSString stringWithFormat:@"%@ listLayoutProvider layoutForIconLocation:%@%@", vpC, vpLoc, vpLP ? @"" : @" (constant not found via dlsym; literal used)"];
+ if (![vpLLP respondsToSelector:@selector(layoutForIconLocation:)]) { vpAdd([vpRole stringByAppendingString:@".class"], @"private", vpCall, nil, @"listLayoutProvider missing or does not respond"); continue; }
+ NSObject *vpLay = ((id (*)(id, SEL, id))vpMsg)(vpLLP, @selector(layoutForIconLocation:), vpLoc);
+ vpAdd([vpRole stringByAppendingString:@".class"], @"private", vpCall, vpLay ? vpChain(vpLay) : nil, vpLay ? nil : @"nil");
+ NSObject *vpCfg = [vpLay respondsToSelector:NSSelectorFromString(@"layoutConfiguration")] ? [vpLay valueForKey:@"layoutConfiguration"] : nil;
+ if (vpCfg) vpObj([vpRole stringByAppendingString:@".layoutConfiguration"], [vpCall stringByAppendingString:@".layoutConfiguration"], vpCfg);
+ }
+ NSMutableArray *vpLists = [NSMutableArray array];
+ [vpLists addObjectsFromArray:vpFindAll(vpHW, @"SBIconListView")];
+ UIWindow *vpDW = vpWin(vpWS, @"SBFloatingDockWindow");
+ [vpLists addObjectsFromArray:vpFindAll(vpDW, @"SBIconListView")];
+ NSMutableDictionary *vpLocSeen = [NSMutableDictionary dictionary];
+ for (UIView *vpL in vpLists) {
+ NSString *vpLoc = [vpL respondsToSelector:NSSelectorFromString(@"iconLocation")] ? [(NSObject *)[vpL valueForKey:@"iconLocation"] description] : @"?";
+ NSString *vpKey = [NSString stringWithFormat:@"%@/%@", NSStringFromClass([vpL class]), vpLoc];
+ NSInteger vpN = [(NSNumber *)vpLocSeen[vpKey] integerValue]; vpLocSeen[vpKey] = @(vpN + 1);
+ NSString *vpRole = [NSString stringWithFormat:@"SBIconListView[%@#%ld]", vpKey, (long)vpN];
+ NSString *vpCall = [NSString stringWithFormat:@"%@ %@ <%@> #%ld", vpC, vpL.window ? NSStringFromClass([vpL.window class]) : @"(no window)", vpKey, (long)vpN];
+ vpViewRec(vpRole, vpCall, vpL);
+ BOOL vpMainList = [vpLoc isEqualToString:@"SBIconLocationRoot"] || [vpLoc isEqualToString:@"SBIconLocationFloatingDock"];
+ if (vpMainList) vpObj(vpRole, vpCall, vpL);
+ NSObject *vpLay = [vpL respondsToSelector:NSSelectorFromString(@"layout")] ? [vpL valueForKey:@"layout"] : nil;
+ vpObj([vpRole stringByAppendingString:@".layout"], [vpCall stringByAppendingString:@".layout"], vpLay);
+ NSObject *vpCfg = [vpLay respondsToSelector:NSSelectorFromString(@"layoutConfiguration")] ? [vpLay valueForKey:@"layoutConfiguration"] : nil;
+ vpObj([vpRole stringByAppendingString:@".layout.layoutConfiguration"], [vpCall stringByAppendingString:@".layout.layoutConfiguration"], vpCfg);
+ if (vpCfg && vpMainList) {
+ unsigned int vpPN = 0; objc_property_t *vpPs = class_copyPropertyList([vpCfg class], &vpPN);
+ for (unsigned int vpI = 0; vpI < vpPN; vpI++) {
+ NSString *vpPName = [NSString stringWithUTF8String:property_getName(vpPs[vpI])];
+ if (![vpPName hasSuffix:@"VisualConfiguration"]) continue;
+ vpObj([NSString stringWithFormat:@"%@.layout.layoutConfiguration.%@", vpRole, vpPName], [NSString stringWithFormat:@"%@.layout.layoutConfiguration.%@", vpCall, vpPName], [vpCfg valueForKey:vpPName]);
+ }
+ if (vpPs) free(vpPs);
+ }
+ UIView *vpIV = vpFind(vpL, @"SBIconView");
+ if (vpIV) {
+ vpViewRec([vpRole stringByAppendingString:@".firstIconView"], [vpCall stringByAppendingString:@" first SBIconView"], vpIV);
+ if (vpMainList) { vpObj([vpRole stringByAppendingString:@".firstIconView"], [vpCall stringByAppendingString:@" first SBIconView"], vpIV);
+ vpViewsOf([vpRole stringByAppendingString:@".firstIconView"], vpIV, nil); }
+ } else vpAdd([vpRole stringByAppendingString:@".firstIconView.view"], @"public", [vpCall stringByAppendingString:@" first SBIconView"], nil, @"no SBIconView in list");
+ }
+ vpViewsOf(@"SBHomeScreenWindow", vpHW, @[@"PageControl", @"SBHSearch", @"Library", @"Today", @"Widget", @"Sidebar", @"SBFolderScrollAccessoryView", @"SBIconScrollView"]);
+ UIView *vpPC = vpFind(vpHW, @"SBIconListPageControl");
+ if (vpPC) vpObj(@"SBIconListPageControl", [vpC stringByAppendingString:@" SBIconListPageControl"], vpPC);
+ vpViewRec(@"SBFloatingDockWindow", [vpC stringByAppendingString:@" SBFloatingDockWindow"], vpDW);
+ vpObj(@"SBFloatingDockController", [vpC stringByAppendingString:@".floatingDockController"], [vpWS valueForKey:@"floatingDockController"]);
+ vpObj(@"SBFloatingDockRootViewController", [vpC stringByAppendingString:@" SBFloatingDockWindow.rootViewController"], vpDW.rootViewController);
+ NSObject *vpFDVC = [vpDW.rootViewController respondsToSelector:NSSelectorFromString(@"floatingDockViewController")] ? [vpDW.rootViewController valueForKey:@"floatingDockViewController"] : nil;
+ vpObj(@"SBFloatingDockViewController", [vpC stringByAppendingString:@" SBFloatingDockRootViewController.floatingDockViewController"], vpFDVC);
+ UIView *vpFDV = vpFind(vpDW, @"SBFloatingDockView");
+ vpViewRec(@"SBFloatingDockView", [vpC stringByAppendingString:@" SBFloatingDockWindow/SBFloatingDockView"], vpFDV);
+ vpObj(@"SBFloatingDockView", [vpC stringByAppendingString:@" SBFloatingDockWindow/SBFloatingDockView"], vpFDV);
+ vpViewsOf(@"SBFloatingDockWindow", vpDW, @[@"SBFloatingDockPlatterView", @"SBHSearchButton", @"SeparatorView"]);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ NSObject *vpWC = [vpWS valueForKey:@"wallpaperController"];
+ vpObj(@"SBWallpaperController", [vpC stringByAppendingString:@".wallpaperController"], vpWC);
+ UIWindow *vpWW = vpWin(vpWS, @"_SBWallpaperSecureWindow");
+ vpViewRec(@"_SBWallpaperSecureWindow", [vpC stringByAppendingString:@" _SBWallpaperSecureWindow"], vpWW);
+ vpObj(@"_SBWallpaperSecureWindow", [vpC stringByAppendingString:@" _SBWallpaperSecureWindow"], vpWW);
+ vpObj(@"_SBWallpaperWindowRootViewController", [vpC stringByAppendingString:@" _SBWallpaperSecureWindow.rootViewController"], vpWW.rootViewController);
+ vpViewsOf(@"_SBWallpaperSecureWindow", vpWW, @[@"PBUI", @"BSUIOrientation", @"Wallpaper", @"Poster", @"_UIScenePresentationView"]);
+}
+for (UIWindowScene *vpWS in vpSBScenes) {
+ vpCurDisp = vpDispOf(vpWS); vpCurScene = vpSceneId(vpWS); vpCurOrient = (long)vpWS.interfaceOrientation;
+ NSString *vpC = [NSString stringWithFormat:@"[SBWindowScene <%@>]", vpCurScene];
+ NSObject *vpWC = [vpWS valueForKey:@"wallpaperController"];
+ NSObject *vpHPC = [vpWC respondsToSelector:NSSelectorFromString(@"hingeProgressController")] ? [vpWC valueForKey:@"hingeProgressController"] : nil;
+ vpObj(@"SBWallpaperHingeProgressController", [vpC stringByAppendingString:@".wallpaperController.hingeProgressController"], vpHPC);
+ unsigned int vpIN = 0; Ivar *vpIvs = vpHPC ? class_copyIvarList([vpHPC class], &vpIN) : NULL;
+ for (unsigned int vpI = 0; vpI < vpIN; vpI++) {
+ NSString *vpName = [NSString stringWithUTF8String:ivar_getName(vpIvs[vpI])];
+ const char *vpT = ivar_getTypeEncoding(vpIvs[vpI]);
+ NSString *vpTs = vpT ? [NSString stringWithUTF8String:vpT] : @"";
+ id vpVv = nil;
+ if ([vpTs isEqualToString:@"d"]) vpVv = vpNum(*(double *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs isEqualToString:@"q"]) vpVv = @(*(long long *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs isEqualToString:@"B"]) vpVv = @(*(BOOL *)((char *)(__bridge void *)vpHPC + ivar_getOffset(vpIvs[vpI])));
+ else if ([vpTs hasPrefix:@"@"]) vpVv = vpVal(object_getIvar(vpHPC, vpIvs[vpI]));
+ else vpVv = [@"type " stringByAppendingString:vpTs];
+ vpAdd([@"SBWallpaperHingeProgressController.ivar." stringByAppendingString:vpName], @"private", [NSString stringWithFormat:@"%@ hingeProgressController ivar %@ (%@)", vpC, vpName, vpTs], vpVv, nil);
+ }
+ if (vpIvs) free(vpIvs);
+}
+NSDictionary *vpOutD = @{@"primaryScene": vpPrimary ? vpSceneId(vpPrimary) : @"", @"primaryOrientation": @(vpPrimary.interfaceOrientation), @"records": vpRecs};
+NSError *vpJErr = nil;
+NSData *vpJD = [NSJSONSerialization isValidJSONObject:vpOutD] ? [NSJSONSerialization dataWithJSONObject:vpOutD options:0 error:&vpJErr] : nil;
+vpJD ? [[NSString alloc] initWithData:vpJD encoding:NSUTF8StringEncoding] : [NSString stringWithFormat:@"INVALID JSON %@", vpJErr]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-compare.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-compare.zsh
new file mode 100755
index 00000000..73ae549c
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-compare.zsh
@@ -0,0 +1,22 @@
+#!/bin/zsh
+# vm-compare.zsh <sim domain.json> <sim posture label> <vm records.jsonl> [api regex]
+# Print every (api, call) whose value differs between one simulator posture and one VM step,
+# as tab-separated: api, call, sim value, vm value. Addresses are normalised to 0x* on both
+# VM call strings are joined with the inner display renamed to the sim names (VPhone Duo Inner -> LCD-1,
+# Unknown[7] -> Unknown.main[3]).
+# sides; values longer than 300 characters are cut.
+set -euo pipefail
+jq=/opt/homebrew/bin/jq
+sim=$1 label=$2 vm=$3 re=${4:-.}
+$jq -n -r --arg label "$label" --arg re "$re" --slurpfile sim <($jq -c --arg label "$label" '[.records[] | select(.posture == $label)]' $sim) --slurpfile vm <($jq -s -c . $vm) '
+ def norm: if type == "string" then gsub("0x[0-9a-fA-F]{6,}"; "0x*") else . end
+ | walk(if type == "string" then gsub("0x[0-9a-fA-F]{6,}"; "0x*") else . end);
+ def key: .api + "\u0001" + (.call | gsub("VPhone Duo Inner"; "LCD-1") | gsub("Unknown\\[7\\]"; "Unknown.main[3]") | gsub("\\[SBWindowScene <SB-main>\\]"; "[cover]") | gsub("\\[SBWindowScene <com.apple.springboard.bringup>\\]"; "[inner]"));
+ ($sim[0] | map({key: key, value: {v: (.value | norm), e: .error}}) | from_entries) as $s
+ | ($vm[0] | map({key: key, value: {v: (.value | norm), e: .error}}) | from_entries) as $v
+ | ([$s, $v] | map(keys) | add | unique)[] as $k
+ | select(($k | split("\u0001")[0]) | test($re))
+ | select($s[$k] != $v[$k])
+ | [($k | split("\u0001")[0]), ($k | split("\u0001")[1]),
+ (($s[$k] // {v: "<absent>"}) | if .e then "ERR " + (.e|tostring) else .v | tojson end | .[0:300]),
+ (($v[$k] // {v: "<absent>"}) | if .e then "ERR " + (.e|tostring) else .v | tojson end | .[0:300])] | @tsv'
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-convert.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-convert.zsh
new file mode 100755
index 00000000..2891090a
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-convert.zsh
@@ -0,0 +1,39 @@
+#!/bin/zsh
+# vm-convert.zsh <sim-probe.lldb>... : write probes/vm-<name>.lldb beside each one.
+#
+# Two guest-JIT problems on the VM (arm64e.x1), both in vm-notes.md:
+# 1. lldb signs only one cast-call site of objc_msgSend per expression; the others go through
+# the unsigned GOT entry and fault with EXC_GUARD (code 261, blraaz). Fix: declare
+# `void *vpMsg = (void *)objc_msgSend;` first and cast vpMsg instead.
+# 2. strcmp / strncmp called from an expression return garbage (lldb binds them to the wrong
+# address; strlen is fine). Fix: blocks vpStrcmp / vpStrncmp declared first.
+# 3. The sim probes trace the getter being called into a host file (vpTrace); on the VM that
+# file is /var/tmp/vptrace.txt in the guest (read it with files.read).
+set -euo pipefail
+for src in "$@"; do
+ dst=${src:h}/vm-${src:t}
+ awk '
+ function flush() {
+ if (n) {
+ if (casts) print "void *vpMsg = (void *)objc_msgSend;";
+ if (scmp) print "int (^vpStrncmp)(const char *, const char *, size_t) = ^int(const char *a, const char *b, size_t n) { for (size_t i = 0; i < n; i++) { if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; if (!a[i]) return 0; } return 0; };";
+ if (scmp) print "int (^vpStrcmp)(const char *, const char *) = ^int(const char *a, const char *b) { return vpStrncmp(a, b, (size_t)-1); };";
+ for (i = 1; i <= n; i++) print buf[i];
+ }
+ n = 0; casts = 0; scmp = 0
+ }
+ /^expr .*--$/ { flush(); print; inexpr = 1; next }
+ inexpr && /^$/ { flush(); print; inexpr = 0; next }
+ inexpr {
+ line = $0
+ casts += gsub(/\)objc_msgSend\)\(/, ")vpMsg)(", line)
+ scmp += gsub(/(^|[^A-Za-z_])strncmp\(/, "&", line)
+ scmp += gsub(/(^|[^A-Za-z_])strcmp\(/, "&", line)
+ gsub(/strncmp\(/, "vpStrncmp(", line); gsub(/strcmp\(/, "vpStrcmp(", line)
+ buf[++n] = line; next
+ }
+ { print }
+ END { flush() }
+ ' $src | sed "s#/private/tmp/[^\"]*/vptrace.txt#/var/tmp/vptrace.txt#" > $dst
+ print "$dst: $(grep -c 'vpMsg)(' $dst) msgSend casts, $(grep -oE 'vpStrn?cmp\(' $dst | wc -l | tr -d ' ') str*cmp calls rewritten"
+done
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-backboardd.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-backboardd.lldb
new file mode 100644
index 00000000..b32e2ab0
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-backboardd.lldb
@@ -0,0 +1,262 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+int (^vpStrncmp)(const char *, const char *, size_t) = ^int(const char *a, const char *b, size_t n) { for (size_t i = 0; i < n; i++) { if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; if (!a[i]) return 0; } return 0; };
+int (^vpStrcmp)(const char *, const char *) = ^int(const char *a, const char *b) { return vpStrncmp(a, b, (size_t)-1); };
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpTrace)(NSString *) = ^(NSString *s) { [s writeToFile:@"/var/tmp/vptrace.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil]; };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) { return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)}; };
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize s) { return @{@"width": @(s.width), @"height": @(s.height)}; };
+NSDictionary *(^vpPoint)(CGPoint) = ^NSDictionary *(CGPoint p) { return @{@"x": @(p.x), @"y": @(p.y)}; };
+__block id (^vpJSON)(id);
+vpJSON = ^id(id vIn) { NSObject *v = (NSObject *)vIn;
+ if (!v) return [NSNull null];
+ if ([v isKindOfClass:[NSString class]]) return v;
+ if ([v isKindOfClass:[NSNumber class]]) {
+ double vd = [(NSNumber *)v doubleValue];
+ if (vd != vd || vd == INFINITY || vd == -INFINITY) return [(NSObject *)v description];
+ return v;
+ }
+ if ([v isKindOfClass:[NSValue class]]) {
+ const char *vt = [(NSValue *)v objCType];
+ if (vpStrncmp(vt, "{CGRect=", 8) == 0) { CGRect r; [(NSValue *)v getValue:&r]; return vpRect(r); }
+ if (vpStrncmp(vt, "{CGSize=", 8) == 0) { CGSize s; [(NSValue *)v getValue:&s]; return vpSize(s); }
+ if (vpStrncmp(vt, "{CGPoint=", 9) == 0) { CGPoint p; [(NSValue *)v getValue:&p]; return vpPoint(p); }
+ return [(NSObject *)v description];
+ }
+ if ([v isKindOfClass:[NSArray class]] || [v isKindOfClass:[NSSet class]] || [v isKindOfClass:[NSOrderedSet class]]) {
+ NSMutableArray *va = [NSMutableArray array];
+ for (id vx in (NSArray *)v) [va addObject:vpJSON(vx)];
+ return va;
+ }
+ if ([v isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *vm = [NSMutableDictionary dictionary];
+ for (id vk in (NSDictionary *)v) vm[[(NSObject *)vk description]] = vpJSON([(NSDictionary *)v objectForKey:vk]);
+ return vm;
+ }
+ if ([v isKindOfClass:[NSUUID class]]) return [(NSUUID *)v UUIDString];
+ return [(NSObject *)v description];
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ? vpJSON(value) : [NSNull null], @"error": error ?: (value ? (id)[NSNull null] : (id)@"nil")}];
+};
+NSArray *vpDenyExact = @[@"dealloc", @"invalidate", @"update", @"updateDisplays", @"_finalize", @"_invalidate", @"init", @"_init", @".cxx_destruct", @".cxx_construct", @"copy", @"mutableCopy", @"immutableCopy", @"freeze", @"acquireFrozenSurface", @"activateReplay", @"rebuildModeList", @"removeAllClones", @"resetConfiguration", @"disableDICOM", @"willUnblank", @"commitPreset", @"unregisterNotificationBlocks", @"unregisterSyncNotificationBlocks", @"clearUpdateMask", @"initializeClientPort", @"acquireWirelessDisplayStateControl", @"_detectDisplays", @"_detectSimDisplays", @"removeAllDisplays", @"enableOutOfProcessDisplayObservation", @"updateBandWidthInfoForAllDisplays", @"stopServer", @"new", @"alloc", @"class", @"self", @"retain", @"release", @"autorelease", @"retainCount", @"zone", @"hash", @"superclass", @"debugDescription", @"description", @"succinctDescription", @"succinctDescriptionBuilder", @"descriptionBuilder", @"_availableModesInternal", @"copyForSecureRendering", @"cancelTouchesOnMainDisplay", @"cancelTouchesOnAllDisplays", @"prepareForRestart", @"updateTransformsWithCompletion", @"_postInitialBookendObserverConnections", @"_cleanup", @"_freeze", @"_startAnimating", @"_stopAnimating", @"copyPrivateRepresentation", @"initForProtobufDecoding", @"_queue_resetTouchAuthenticationInitialSampleEvent", @"layoutIfNeeded", @"setNeedsLayout", @"_copyDebugProperties", @"_dragManager", @"_focusSystem", @"_interactiveHighlightEnvironment", @"focusItemContainer", @"focusedItem", @"focusedView", @"parentFocusEnvironment", @"preferredFocusEnvironments", @"preferredFocusedView", @"_preferredFocusedWindow", @"_preferredFocusedWindowScene", @"_boundingPathUtilities", @"_carSession", @"supportsFocus", @"_SwiftUITesting_currentScreenScale", @"_SwiftUITesting_wantsWideContentMargins", @"__ck_isFullscreen", @"pu_workImageSize", @"px_currentEDRHeadroom", @"px_potentialEDRHeadroom", @"ck_screenSizeCategory", @"_mapkit_display", @"postBookendConnections", @"bookendObserver", @"observers"];
+NSArray *vpDenyPrefix = @[@"set", @"_set", @"remove", @"_remove", @"add", @"cancel", @"invalidate", @"_lock_", @"_workQueue_", @"_queue_", @"_post", @"_present", @"_dismiss", @"_update", @"_wrap", @"reevaluate", @"_begin", @"_end", @"begin", @"end", @"_prepare", @"_reset", @"reset", @"_flush", @"flush", @"_notify", @"_handle", @"_init", @"init", @"_copy", @"copy", @"_create", @"create", @"_install", @"_uninstall", @"_register", @"_unregister", @"register", @"unregister", @"_perform", @"perform", @"_apply", @"apply", @"_enable", @"_disable", @"_invalidate", @"_teardown", @"_start", @"_stop", @"start", @"stop", @"_send", @"send", @"_snapshot", @"snapshot", @"_dump", @"dump", @"_run", @"_schedule", @"_will", @"_did", @"_reload", @"reload", @"_force", @"_clear", @"clear", @"_release", @"_acquire", @"acquire", @"_take", @"_capture", @"_trigger", @"_request", @"request", @"_animate", @"_show", @"_hide", @"_attach", @"_detach", @"_connect", @"_disconnect", @"_present", @"_activate", @"_deactivate", @"_destroy", @"_purge", @"_close", @"_open", @"_save", @"_load", @"_make", @"make", @"_print", @"_log", @"_toggle", @"_test", @"_simulate", @"_fake", @"_debug"];
+NSArray *vpThrowSels = @[@"secureIndicatorsEnabled"];
+BOOL (^vpAllowed)(NSString *) = ^BOOL(NSString *sel) {
+ if ([vpThrowSels containsObject:sel]) return NO;
+ if ([sel rangeOfString:@":"].location != NSNotFound) return NO;
+ if ([vpDenyExact containsObject:sel]) return NO;
+ for (NSString *vp in vpDenyPrefix) if ([sel hasPrefix:vp]) return NO;
+ return YES;
+};
+id (^vpCall)(id, NSString *, NSString **) = ^id(id obj, NSString *sel, NSString **err) {
+ SEL vs = NSSelectorFromString(sel);
+ if (![(NSObject *)obj respondsToSelector:vs]) { *err = @"does not respond"; return (id)nil; }
+ Method vm = class_getInstanceMethod(object_getClass(obj), vs);
+ if (!vm) { *err = @"no method"; return (id)nil; }
+ if (method_getNumberOfArguments(vm) != 2) { *err = @"takes arguments"; return (id)nil; }
+ char vt[256]; method_getReturnType(vm, vt, sizeof(vt));
+ const char *vr = vt; while (*vr == 'r' || *vr == 'n' || *vr == 'N' || *vr == 'o' || *vr == 'O' || *vr == 'R' || *vr == 'V') vr++;
+ switch (vr[0]) {
+ case '@': if (vr[1] == '?') { *err = @"block"; return (id)nil; }
+ { id vo = ((id (*)(id, SEL))vpMsg)(obj, vs); if (!vo) *err = @"nil"; return vo; }
+ case '#': { Class vc = ((Class (*)(id, SEL))vpMsg)(obj, vs); return vc ? NSStringFromClass(vc) : (id)nil; }
+ case 'B': return @(((BOOL (*)(id, SEL))vpMsg)(obj, vs) ? YES : NO);
+ case 'c': return @(((signed char (*)(id, SEL))vpMsg)(obj, vs));
+ case 'C': return @(((unsigned char (*)(id, SEL))vpMsg)(obj, vs));
+ case 's': return @(((short (*)(id, SEL))vpMsg)(obj, vs));
+ case 'S': return @(((unsigned short (*)(id, SEL))vpMsg)(obj, vs));
+ case 'i': return @(((int (*)(id, SEL))vpMsg)(obj, vs));
+ case 'I': return @(((unsigned int (*)(id, SEL))vpMsg)(obj, vs));
+ case 'l': return @(((long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'L': return @(((unsigned long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'q': return @(((long long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'Q': return @(((unsigned long long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'f': return @(((float (*)(id, SEL))vpMsg)(obj, vs));
+ case 'd': return @(((double (*)(id, SEL))vpMsg)(obj, vs));
+ case '{':
+ if (vpStrncmp(vr, "{CGRect=", 8) == 0) return vpRect(((CGRect (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{CGSize=", 8) == 0) return vpSize(((CGSize (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{CGPoint=", 9) == 0) return vpPoint(((CGPoint (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{UIEdgeInsets=", 14) == 0 || vpStrncmp(vr, "{NSDirectionalEdgeInsets=", 25) == 0) { struct VPInsets { double a, b, c, d; } vi4 = ((struct VPInsets (*)(id, SEL))vpMsg)(obj, vs); return @{@"top": @(vi4.a), @"left": @(vi4.b), @"bottom": @(vi4.c), @"right": @(vi4.d)}; }
+ if (vpStrncmp(vr, "{CGAffineTransform=", 19) == 0) { CGAffineTransform vx = ((CGAffineTransform (*)(id, SEL))vpMsg)(obj, vs); return @[@(vx.a), @(vx.b), @(vx.c), @(vx.d), @(vx.tx), @(vx.ty)]; }
+ if (vpStrcmp(vr, "{?=ff}") == 0) { struct VPff { float a, b; } vf = ((struct VPff (*)(id, SEL))vpMsg)(obj, vs); return @[@(vf.a), @(vf.b)]; }
+ if (vpStrcmp(vr, "{?={?=ff}{?=ff}{?=ff}{?=ff}}") == 0) { struct VPf8 { float a[8]; } vf8 = ((struct VPf8 (*)(id, SEL))vpMsg)(obj, vs); return @[@(vf8.a[0]), @(vf8.a[1]), @(vf8.a[2]), @(vf8.a[3]), @(vf8.a[4]), @(vf8.a[5]), @(vf8.a[6]), @(vf8.a[7])]; }
+ if (vpStrncmp(vr, "{CAFrameRateRange=", 18) == 0) { struct VPfff { float a, b, c; } vf3 = ((struct VPfff (*)(id, SEL))vpMsg)(obj, vs); return @{@"minimum": @(vf3.a), @"maximum": @(vf3.b), @"preferred": @(vf3.c)}; }
+ *err = [NSString stringWithFormat:@"unsupported struct return %.60s", vr]; return (id)nil;
+ default: *err = [NSString stringWithFormat:@"unsupported return type %.60s", vr]; return (id)nil;
+ }
+};
+NSArray *(^vpGetters)(Class, Class) = ^NSArray *(Class cls, Class stop) {
+ char vrt[8];
+ NSMutableOrderedSet *vs = [NSMutableOrderedSet orderedSet];
+ for (Class vc = cls; vc && vc != stop && vc != [NSObject class]; vc = class_getSuperclass(vc)) {
+ unsigned int vn = 0;
+ objc_property_t *vp = class_copyPropertyList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ char *vg = property_copyAttributeValue(vp[vi], "G");
+ NSString *vgs = vg ? [NSString stringWithUTF8String:vg] : [NSString stringWithUTF8String:property_getName(vp[vi])];
+ if (vg) free(vg);
+ if (vpAllowed(vgs)) [vs addObject:vgs];
+ }
+ free(vp);
+ Method *vm = class_copyMethodList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vsel = NSStringFromSelector(method_getName(vm[vi]));
+ method_getReturnType(vm[vi], vrt, sizeof(vrt)); if (vrt[0] == 'v') continue;
+ if (method_getNumberOfArguments(vm[vi]) == 2 && vpAllowed(vsel)) [vs addObject:vsel];
+ }
+ free(vm);
+ }
+ return [[vs array] sortedArrayUsingSelector:@selector(compare:)];
+};
+void (^vpDump)(id, NSString *, NSString *, NSString *, Class) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, Class stop) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ vpAdd([apiClass stringByAppendingString:@".description"], kind, [callPrefix stringByAppendingString:@".description"], [(NSObject *)obj description], nil);
+ vpAdd([apiClass stringByAppendingString:@".class"], kind, [callPrefix stringByAppendingString:@".class"], NSStringFromClass([(NSObject *)obj class]), nil);
+ for (NSString *vsel in vpGetters([(NSObject *)obj class], stop)) {
+ vpTrace([NSString stringWithFormat:@"%@ %@", callPrefix, vsel]);
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+ for (NSString *vsel in vpThrowSels) if ([(NSObject *)obj respondsToSelector:NSSelectorFromString(vsel)]) vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], nil, @"raises an Objective-C exception in this process (not called)");
+};
+NSDictionary *(^vpObjDict)(id) = ^NSDictionary *(id objIn) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ if (!objIn) return vd;
+ for (NSString *vsel in vpGetters([(NSObject *)objIn class], nil)) { vpTrace([NSString stringWithFormat:@"objdict %@ %@", NSStringFromClass([(NSObject *)objIn class]), vsel]); NSString *verr = nil; id vv = vpCall(objIn, vsel, &verr); vd[vsel] = vv ? vpJSON(vv) : [NSString stringWithFormat:@"<error: %@>", verr]; }
+ return vd;
+};
+void (^vpDumpSel)(id, NSString *, NSString *, NSString *, NSArray *) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, NSArray *sels) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ for (NSString *vsel in sels) {
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+};
+id vpOrientation = nil;
+Class vpCADisplay = NSClassFromString(@"CADisplay");
+Class vpCADisplayMode = NSClassFromString(@"CADisplayMode");
+NSString *(^vpCStr)(char *) = ^NSString *(char *s) { if (!s) return (NSString *)nil; NSString *vs = [NSString stringWithUTF8String:s]; free(s); return vs; };
+NSArray *vpDisplays = ((id (*)(id, SEL))vpMsg)(vpCADisplay, @selector(displays));
+NSObject *vpMain = ((id (*)(id, SEL))vpMsg)(vpCADisplay, @selector(mainDisplay));
+vpAdd(@"CADisplay.displays", @"private", @"[CADisplay displays].count", @(vpDisplays.count), nil);
+vpAdd(@"CADisplay.displays.names", @"private", @"[[CADisplay displays] valueForKey:@\"name\"]", [vpDisplays valueForKey:@"name"], nil);
+vpAdd(@"CADisplay.mainDisplay.indexInDisplays", @"private", @"[[CADisplay displays] indexOfObjectIdenticalTo:[CADisplay mainDisplay]]", @((long)[vpDisplays indexOfObjectIdenticalTo:vpMain]), nil);
+NSObject *vpTV = ((id (*)(id, SEL))vpMsg)(vpCADisplay, NSSelectorFromString(@"TVOutDisplay"));
+vpAdd(@"CADisplay.TVOutDisplay", @"private", @"[CADisplay TVOutDisplay]", vpTV ? [(NSObject *)vpTV description] : nil, vpTV ? nil : @"nil");
+NSMutableArray *vpDispList = [NSMutableArray arrayWithArray:vpDisplays];
+NSMutableArray *vpDispCalls = [NSMutableArray array];
+for (NSUInteger vi = 0; vi < vpDisplays.count; vi++) [vpDispCalls addObject:[NSString stringWithFormat:@"[CADisplay displays][%lu]<%@>", (unsigned long)vi, [(NSObject *)vpDisplays[vi] valueForKey:@"name"]]];
+if (vpMain) { [vpDispList addObject:vpMain]; [vpDispCalls addObject:[NSString stringWithFormat:@"[CADisplay mainDisplay]<%@>", [vpMain valueForKey:@"name"]]]; }
+for (NSUInteger vi = 0; vi < vpDispList.count; vi++) {
+ NSObject *vpD = vpDispList[vi];
+ NSString *vpC = vpDispCalls[vi];
+ vpDump(vpD, @"CADisplay", @"private", vpC, nil);
+ NSObject *vpCur = [vpD valueForKey:@"currentMode"];
+ vpAdd(@"CADisplay.currentMode.getters", @"private", [vpC stringByAppendingString:@".currentMode.*"], vpCur ? vpObjDict(vpCur) : nil, vpCur ? nil : @"nil");
+ NSObject *vpPref = [vpD valueForKey:@"preferredMode"];
+ vpAdd(@"CADisplay.preferredMode.getters", @"private", [vpC stringByAppendingString:@".preferredMode.*"], vpPref ? vpObjDict(vpPref) : nil, vpPref ? nil : @"nil");
+ NSMutableArray *vpModes = [NSMutableArray array];
+ for (id vpM in (NSArray *)[vpD valueForKey:@"availableModes"]) [vpModes addObject:vpObjDict(vpM)];
+ vpAdd(@"CADisplay.availableModes.getters", @"private", [vpC stringByAppendingString:@".availableModes[*].*"], vpModes, nil);
+ NSObject *vpPrefs = [vpD valueForKey:@"preferences"];
+ vpAdd(@"CADisplay.preferences.getters", @"private", [vpC stringByAppendingString:@".preferences.*"], vpPrefs ? vpObjDict(vpPrefs) : nil, vpPrefs ? nil : @"nil");
+ NSObject *vpExt = [vpD valueForKey:@"externalDisplayAttributes"];
+ vpAdd(@"CADisplay.externalDisplayAttributes.getters", @"private", [vpC stringByAppendingString:@".externalDisplayAttributes.*"], vpExt ? vpObjDict(vpExt) : nil, vpExt ? nil : @"nil");
+ NSObject *vpSC = [vpD valueForKey:@"stateControl"];
+ vpDump(vpSC, @"CADisplayStateControl", @"private", [vpC stringByAppendingString:@".stateControl"], nil);
+ if (vpSC) {
+ vpAdd(@"CADisplayStateControl._copyStateInfo", @"private", [vpC stringByAppendingString:@".stateControl._copyStateInfo"], vpCStr(((char *(*)(id, SEL))vpMsg)(vpSC, NSSelectorFromString(@"_copyStateInfo"))), nil);
+ vpAdd(@"CADisplayStateControl._copyAllPowerAssertionInfo", @"private", [vpC stringByAppendingString:@".stateControl._copyAllPowerAssertionInfo"], vpCStr(((char *(*)(id, SEL))vpMsg)(vpSC, NSSelectorFromString(@"_copyAllPowerAssertionInfo"))), nil);
+ vpAdd(@"CADisplayStateControl._copyAllFrameRateAssertionInfo", @"private", [vpC stringByAppendingString:@".stateControl._copyAllFrameRateAssertionInfo"], vpCStr(((char *(*)(id, SEL))vpMsg)(vpSC, NSSelectorFromString(@"_copyAllFrameRateAssertionInfo"))), nil);
+ }
+ CFDictionaryRef vpDbg = NULL; /* VM: -[CADisplay _copyDebugProperties] aborts backboardd (SIGABRT) when the display has no stateControl; not called */
+ vpAdd(@"CADisplay._copyDebugProperties", @"private", [vpC stringByAppendingString:@"._copyDebugProperties"], vpDbg ? (__bridge id)vpDbg : nil, vpDbg ? nil : @"NULL");
+}
+NSObject *vpWS = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"CAWindowServer"), NSSelectorFromString(@"serverIfRunning"));
+vpDump(vpWS, @"CAWindowServer", @"private", @"[CAWindowServer serverIfRunning]", nil);
+NSArray *vpWSD = vpWS ? [vpWS valueForKey:@"displays"] : @[];
+NSMutableDictionary *vpUUIDs = [NSMutableDictionary dictionary];
+for (NSUInteger vi = 0; vi < vpWSD.count; vi++) {
+ NSObject *vpD = vpWSD[vi];
+ NSString *vpC = [NSString stringWithFormat:@"[CAWindowServer serverIfRunning].displays[%lu]<%@>", (unsigned long)vi, [vpD valueForKey:@"name"]];
+ vpDump(vpD, @"CAWindowServerDisplay", @"private", vpC, nil);
+ CGRect vpB = ((CGRect (*)(id, SEL))vpMsg)(vpD, @selector(bounds));
+ unsigned int vpCtx = ((unsigned int (*)(id, SEL, CGPoint))vpMsg)(vpD, NSSelectorFromString(@"contextIdAtPosition:"), CGPointMake(CGRectGetMidX(vpB), CGRectGetMidY(vpB)));
+ vpAdd(@"CAWindowServerDisplay.contextIdAtPosition:center", @"private", [vpC stringByAppendingString:@" contextIdAtPosition:(center of bounds)"], @(vpCtx), nil);
+ NSString *vpU = [(NSObject *)[vpD valueForKey:@"uniqueId"] description];
+ NSObject *vpUU = [vpD valueForKey:@"uuid"];
+ vpUUIDs[[vpD valueForKey:@"name"]] = @{@"uniqueId": vpU ?: [NSNull null], @"uuid": vpUU ? [(NSUUID *)vpUU UUIDString] : [NSNull null]};
+}
+vpAdd(@"CAWindowServerDisplay.nameToIds", @"private", @"{name: {uniqueId, uuid}} over [CAWindowServer serverIfRunning].displays", vpUUIDs, nil);
+NSObject *vpOrientCtl = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKDisplayOrientationController"), @selector(sharedInstance));
+NSDictionary *vpOBU = [vpOrientCtl valueForKey:@"_orientationByDisplayUUID"];
+vpAdd(@"BKDisplayOrientationController._orientationByDisplayUUID", @"private", @"[[BKDisplayOrientationController sharedInstance] valueForKey:@\"_orientationByDisplayUUID\"]", vpOBU, nil);
+NSMutableOrderedSet *vpAllUUIDs = [NSMutableOrderedSet orderedSetWithArray:[vpOBU allKeys]];
+for (NSObject *vpD in vpDisplays) { NSObject *vu = [vpD valueForKey:@"uniqueId"]; if (vu) [vpAllUUIDs addObject:vu]; NSObject *vuu = [vpD valueForKey:@"UUID"]; if (vuu) [vpAllUUIDs addObject:[(NSUUID *)vuu UUIDString]]; }
+vpAdd(@"backboardd.displayUUIDsProbed", @"private", @"union of _orientationByDisplayUUID keys, CADisplay.uniqueId, CADisplay.UUID", [vpAllUUIDs array], nil);
+NSObject *vpDC = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKDisplayController"), @selector(sharedInstance));
+struct VPGeom { CGSize size; double scale; unsigned char orientation; CGRect rect; };
+for (NSString *vpU in vpAllUUIDs) {
+ long long vpIO = ((long long (*)(id, SEL, id))vpMsg)(vpOrientCtl, NSSelectorFromString(@"interfaceOrientationForDisplayUUID:"), vpU);
+ vpAdd(@"BKDisplayOrientationController.interfaceOrientationForDisplayUUID:", @"private", [NSString stringWithFormat:@"[[BKDisplayOrientationController sharedInstance] interfaceOrientationForDisplayUUID:@\"%@\"]", vpU], @(vpIO), nil);
+ NSObject *vpDD = ((id (*)(id, SEL, id))vpMsg)(vpDC, NSSelectorFromString(@"displayForUUID:"), vpU);
+ vpAdd(@"BKDisplayController.displayForUUID:", @"private", [NSString stringWithFormat:@"[[BKDisplayController sharedInstance] displayForUUID:@\"%@\"]", vpU], vpDD ? [(NSObject *)vpDD description] : nil, vpDD ? nil : @"nil");
+ struct VPGeom vpG = ((struct VPGeom (*)(id, SEL, id))vpMsg)(vpDC, NSSelectorFromString(@"geometryForDisplayUUID:"), vpU);
+ vpAdd(@"BKDisplayController.geometryForDisplayUUID:", @"private", [NSString stringWithFormat:@"[[BKDisplayController sharedInstance] geometryForDisplayUUID:@\"%@\"] as {CGSize; double; uchar; CGRect}", vpU], @{@"size": vpSize(vpG.size), @"double": @(vpG.scale), @"uchar": @(vpG.orientation), @"rect": vpRect(vpG.rect)}, nil);
+ BOOL vpBl = ((BOOL (*)(id, SEL, id))vpMsg)(vpDC, NSSelectorFromString(@"displayIsBlanked:"), vpU);
+ vpAdd(@"BKDisplayController.displayIsBlanked:", @"private", [NSString stringWithFormat:@"[[BKDisplayController sharedInstance] displayIsBlanked:@\"%@\"]", vpU], @(vpBl), nil);
+}
+NSObject *vpProv = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKSharedCADisplayProvider"), @selector(sharedInstance));
+vpAdd(@"BKSharedCADisplayProvider.displays", @"private", @"[[BKSharedCADisplayProvider sharedInstance] displays]", [vpProv valueForKey:@"displays"], nil);
+vpAdd(@"BKSharedCADisplayProvider.mainDisplay", @"private", @"[[BKSharedCADisplayProvider sharedInstance] mainDisplay]", [(NSObject *)[vpProv valueForKey:@"mainDisplay"] description], nil);
+NSObject *vpOM = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKOrientationManager"), @selector(sharedInstance));
+vpDump(vpOM, @"BKOrientationManager", @"private", @"[BKOrientationManager sharedInstance]", nil);
+NSObject *vpBC = nil; /* VM: +[BKDisplayBrightnessController sharedInstance] faults (EXC_BAD_INSTRUCTION 0xdac1a7fe, PACIBSPPC); not called */
+vpDump(vpBC, @"BKDisplayBrightnessController", @"private", @"[BKDisplayBrightnessController sharedInstance]", nil);
+NSObject *vpOvM = nil; /* VM: faults like BKDisplayBrightnessController; not called */
+vpDump(vpOvM, @"BKDisplayRenderOverlayManager", @"private", @"[BKDisplayRenderOverlayManager sharedInstance]", nil);
+vpAdd(@"BKDisplayRenderOverlayManager._frozenDisplayIDs", @"private", @"[[BKDisplayRenderOverlayManager sharedInstance] valueForKey:@\"_frozenDisplayIDs\"]", [(NSObject *)[vpOvM valueForKey:@"_frozenDisplayIDs"] description], nil);
+NSArray *vpOverlays = [[(NSSet *)[vpOvM valueForKey:@"activeOverlays"] allObjects] copy];
+for (NSUInteger vi = 0; vi < vpOverlays.count; vi++) vpDump(vpOverlays[vi], @"BKDisplayRenderOverlay", @"private", [NSString stringWithFormat:@"[[BKDisplayRenderOverlayManager sharedInstance] activeOverlays][%lu]", (unsigned long)vi], nil);
+NSObject *vpReg = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKHIDEventProcessorRegistry"), @selector(sharedInstance));
+NSDictionary *vpProcs = [vpReg valueForKey:@"_eventProcessorsByClassName"];
+vpAdd(@"BKHIDEventProcessorRegistry._eventProcessorsByClassName.keys", @"private", @"[[[BKHIDEventProcessorRegistry sharedInstance] valueForKey:@\"_eventProcessorsByClassName\"] allKeys]", [[vpProcs allKeys] sortedArrayUsingSelector:@selector(compare:)], nil);
+NSObject *vpDT = vpProcs[@"BKHIDDirectTouchEventProcessor"];
+NSString *vpDTC = @"[[BKHIDEventProcessorRegistry sharedInstance] valueForKey:@\"_eventProcessorsByClassName\"][@\"BKHIDDirectTouchEventProcessor\"]";
+vpAdd(@"BKHIDDirectTouchEventProcessor.description", @"private", [vpDTC stringByAppendingString:@".description"], vpDT ? [(NSObject *)vpDT description] : nil, vpDT ? nil : @"nil");
+if (vpDT) {
+ for (NSString *vpK in @[@"mainDisplayDigitizerService", @"mainDisplayAOPDigitizerService", @"mainDisplayPencilDigitizerService", @"chamoisDisplayUUID", @"shouldIgnoreTouchesWhileObjectInProximity", @"_queue_interfaceOrientation", @"_queue_chamoisDisplayUUID", @"_queue_serviceSenderIDToChamoisDisplayUUID", @"_queue_accessoryTouchscreenServices"]) {
+ id vv = [vpDT valueForKey:vpK];
+ vpAdd([@"BKHIDDirectTouchEventProcessor." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"%@ valueForKey:@\"%@\"", vpDTC, vpK], vv, vv ? nil : @"nil");
+ }
+ NSDictionary *vpPDI = [vpDT valueForKey:@"_queue_perDisplayInfo"];
+ vpAdd(@"BKHIDDirectTouchEventProcessor._queue_perDisplayInfo.keys", @"private", [vpDTC stringByAppendingString:@" valueForKey:@\"_queue_perDisplayInfo\"].allKeys"], [vpPDI allKeys], nil);
+ for (id vpKey in vpPDI) {
+ NSObject *vpInfo = vpPDI[vpKey];
+ NSString *vpIC = [NSString stringWithFormat:@"%@._queue_perDisplayInfo[%@]", vpDTC, vpKey];
+ vpAdd(@"BKDirectTouchPerDisplayInfo.description", @"private", [vpIC stringByAppendingString:@".description"], [(NSObject *)vpInfo description], nil);
+ vpAdd(@"BKDirectTouchPerDisplayInfo._display", @"private", [vpIC stringByAppendingString:@"._display"], [(NSObject *)[vpInfo valueForKey:@"_display"] description], nil);
+ vpAdd(@"BKDirectTouchPerDisplayInfo._touchStreams", @"private", [vpIC stringByAppendingString:@"._touchStreams"], [(NSObject *)[vpInfo valueForKey:@"_touchStreams"] description], nil);
+ vpAdd(@"BKDirectTouchPerDisplayInfo._hitTestRegions", @"private", [vpIC stringByAppendingString:@"._hitTestRegions"], [vpInfo valueForKey:@"_hitTestRegions"], nil);
+ NSDictionary *vpS2D = [vpInfo valueForKey:@"_serviceToDigitizer"];
+ for (NSObject *vpSvc in vpS2D) {
+ NSObject *vpState = vpS2D[vpSvc];
+ NSString *vpSC = [NSString stringWithFormat:@"%@._serviceToDigitizer[%@]", vpIC, [vpSvc valueForKey:@"senderID"]];
+ NSObject *vpMapped = ((id (*)(id, SEL, id))vpMsg)(vpDT, NSSelectorFromString(@"_queue_displayUUIDForDigitizerService:"), vpSvc);
+ vpAdd(@"BKHIDDirectTouchEventProcessor._queue_displayUUIDForDigitizerService:", @"private", [NSString stringWithFormat:@"[%@ _queue_displayUUIDForDigitizerService:<service senderID %@>]", vpDTC, [vpSvc valueForKey:@"senderID"]], vpMapped, vpMapped ? nil : @"nil");
+ vpAdd(@"BKIOHIDService.getters", @"private", [vpSC stringByAppendingString:@".(service).*"], vpObjDict(vpSvc), nil);
+ vpAdd(@"BKDirectTouchState.description", @"private", [vpSC stringByAppendingString:@".description"], [(NSObject *)vpState description], nil);
+ NSMutableDictionary *vpSt = [NSMutableDictionary dictionary];
+ for (NSString *vpK in @[@"_displayUUID", @"_interfaceOrientation", @"_maximumPositionZ", @"_maxForce", @"_determinedMaxForce", @"_supportsPreciseLocations", @"_displayIntegrated", @"_builtIn", @"_hoverDisabled", @"_waitingForAllTouchesUp", @"_hitTestRegions"]) { id vv = [vpState valueForKey:vpK]; vpSt[vpK] = vv ? vpJSON(vv) : [NSNull null]; }
+ vpAdd(@"BKDirectTouchState.ivars", @"private", [vpSC stringByAppendingString:@" valueForKey:<ivar>"], vpSt, nil);
+ }
+ }
+}
+NSError *vpJErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:@{@"orientation": vpOrientation ?: [NSNull null], @"records": vpRecs} options:0 error:&vpJErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpJErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-safari.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-safari.lldb
new file mode 100644
index 00000000..205ec87c
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-safari.lldb
@@ -0,0 +1,155 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+int (^vpStrncmp)(const char *, const char *, size_t) = ^int(const char *a, const char *b, size_t n) { for (size_t i = 0; i < n; i++) { if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; if (!a[i]) return 0; } return 0; };
+int (^vpStrcmp)(const char *, const char *) = ^int(const char *a, const char *b) { return vpStrncmp(a, b, (size_t)-1); };
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpTrace)(NSString *) = ^(NSString *s) { [s writeToFile:@"/var/tmp/vptrace.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil]; };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) { return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)}; };
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize s) { return @{@"width": @(s.width), @"height": @(s.height)}; };
+NSDictionary *(^vpPoint)(CGPoint) = ^NSDictionary *(CGPoint p) { return @{@"x": @(p.x), @"y": @(p.y)}; };
+__block id (^vpJSON)(id);
+vpJSON = ^id(id vIn) { NSObject *v = (NSObject *)vIn;
+ if (!v) return [NSNull null];
+ if ([v isKindOfClass:[NSString class]]) return v;
+ if ([v isKindOfClass:[NSNumber class]]) {
+ double vd = [(NSNumber *)v doubleValue];
+ if (vd != vd || vd == INFINITY || vd == -INFINITY) return [(NSObject *)v description];
+ return v;
+ }
+ if ([v isKindOfClass:[NSValue class]]) {
+ const char *vt = [(NSValue *)v objCType];
+ if (vpStrncmp(vt, "{CGRect=", 8) == 0) { CGRect r; [(NSValue *)v getValue:&r]; return vpRect(r); }
+ if (vpStrncmp(vt, "{CGSize=", 8) == 0) { CGSize s; [(NSValue *)v getValue:&s]; return vpSize(s); }
+ if (vpStrncmp(vt, "{CGPoint=", 9) == 0) { CGPoint p; [(NSValue *)v getValue:&p]; return vpPoint(p); }
+ return [(NSObject *)v description];
+ }
+ if ([v isKindOfClass:[NSArray class]] || [v isKindOfClass:[NSSet class]] || [v isKindOfClass:[NSOrderedSet class]]) {
+ NSMutableArray *va = [NSMutableArray array];
+ for (id vx in (NSArray *)v) [va addObject:vpJSON(vx)];
+ return va;
+ }
+ if ([v isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *vm = [NSMutableDictionary dictionary];
+ for (id vk in (NSDictionary *)v) vm[[(NSObject *)vk description]] = vpJSON([(NSDictionary *)v objectForKey:vk]);
+ return vm;
+ }
+ if ([v isKindOfClass:[NSUUID class]]) return [(NSUUID *)v UUIDString];
+ return [(NSObject *)v description];
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ? vpJSON(value) : [NSNull null], @"error": error ?: (value ? (id)[NSNull null] : (id)@"nil")}];
+};
+NSArray *vpDenyExact = @[@"dealloc", @"invalidate", @"update", @"updateDisplays", @"_finalize", @"_invalidate", @"init", @"_init", @".cxx_destruct", @".cxx_construct", @"copy", @"mutableCopy", @"immutableCopy", @"freeze", @"acquireFrozenSurface", @"activateReplay", @"rebuildModeList", @"removeAllClones", @"resetConfiguration", @"disableDICOM", @"willUnblank", @"commitPreset", @"unregisterNotificationBlocks", @"unregisterSyncNotificationBlocks", @"clearUpdateMask", @"initializeClientPort", @"acquireWirelessDisplayStateControl", @"_detectDisplays", @"_detectSimDisplays", @"removeAllDisplays", @"enableOutOfProcessDisplayObservation", @"updateBandWidthInfoForAllDisplays", @"stopServer", @"new", @"alloc", @"class", @"self", @"retain", @"release", @"autorelease", @"retainCount", @"zone", @"hash", @"superclass", @"debugDescription", @"description", @"succinctDescription", @"succinctDescriptionBuilder", @"descriptionBuilder", @"_availableModesInternal", @"copyForSecureRendering", @"cancelTouchesOnMainDisplay", @"cancelTouchesOnAllDisplays", @"prepareForRestart", @"updateTransformsWithCompletion", @"_postInitialBookendObserverConnections", @"_cleanup", @"_freeze", @"_startAnimating", @"_stopAnimating", @"copyPrivateRepresentation", @"initForProtobufDecoding", @"_queue_resetTouchAuthenticationInitialSampleEvent", @"layoutIfNeeded", @"setNeedsLayout", @"_copyDebugProperties", @"_dragManager", @"_focusSystem", @"_interactiveHighlightEnvironment", @"focusItemContainer", @"focusedItem", @"focusedView", @"parentFocusEnvironment", @"preferredFocusEnvironments", @"preferredFocusedView", @"_preferredFocusedWindow", @"_preferredFocusedWindowScene", @"_boundingPathUtilities", @"_carSession", @"supportsFocus", @"_SwiftUITesting_currentScreenScale", @"_SwiftUITesting_wantsWideContentMargins", @"__ck_isFullscreen", @"pu_workImageSize", @"px_currentEDRHeadroom", @"px_potentialEDRHeadroom", @"ck_screenSizeCategory", @"_mapkit_display", @"postBookendConnections", @"bookendObserver", @"observers"];
+NSArray *vpDenyPrefix = @[@"set", @"_set", @"remove", @"_remove", @"add", @"cancel", @"invalidate", @"_lock_", @"_workQueue_", @"_queue_", @"_post", @"_present", @"_dismiss", @"_update", @"_wrap", @"reevaluate", @"_begin", @"_end", @"begin", @"end", @"_prepare", @"_reset", @"reset", @"_flush", @"flush", @"_notify", @"_handle", @"_init", @"init", @"_copy", @"copy", @"_create", @"create", @"_install", @"_uninstall", @"_register", @"_unregister", @"register", @"unregister", @"_perform", @"perform", @"_apply", @"apply", @"_enable", @"_disable", @"_invalidate", @"_teardown", @"_start", @"_stop", @"start", @"stop", @"_send", @"send", @"_snapshot", @"snapshot", @"_dump", @"dump", @"_run", @"_schedule", @"_will", @"_did", @"_reload", @"reload", @"_force", @"_clear", @"clear", @"_release", @"_acquire", @"acquire", @"_take", @"_capture", @"_trigger", @"_request", @"request", @"_animate", @"_show", @"_hide", @"_attach", @"_detach", @"_connect", @"_disconnect", @"_present", @"_activate", @"_deactivate", @"_destroy", @"_purge", @"_close", @"_open", @"_save", @"_load", @"_make", @"make", @"_print", @"_log", @"_toggle", @"_test", @"_simulate", @"_fake", @"_debug"];
+NSArray *vpThrowSels = @[@"secureIndicatorsEnabled"];
+BOOL (^vpAllowed)(NSString *) = ^BOOL(NSString *sel) {
+ if ([vpThrowSels containsObject:sel]) return NO;
+ if ([sel rangeOfString:@":"].location != NSNotFound) return NO;
+ if ([vpDenyExact containsObject:sel]) return NO;
+ for (NSString *vp in vpDenyPrefix) if ([sel hasPrefix:vp]) return NO;
+ return YES;
+};
+id (^vpCall)(id, NSString *, NSString **) = ^id(id obj, NSString *sel, NSString **err) {
+ SEL vs = NSSelectorFromString(sel);
+ if (![(NSObject *)obj respondsToSelector:vs]) { *err = @"does not respond"; return (id)nil; }
+ Method vm = class_getInstanceMethod(object_getClass(obj), vs);
+ if (!vm) { *err = @"no method"; return (id)nil; }
+ if (method_getNumberOfArguments(vm) != 2) { *err = @"takes arguments"; return (id)nil; }
+ char vt[256]; method_getReturnType(vm, vt, sizeof(vt));
+ const char *vr = vt; while (*vr == 'r' || *vr == 'n' || *vr == 'N' || *vr == 'o' || *vr == 'O' || *vr == 'R' || *vr == 'V') vr++;
+ switch (vr[0]) {
+ case '@': if (vr[1] == '?') { *err = @"block"; return (id)nil; }
+ { id vo = ((id (*)(id, SEL))vpMsg)(obj, vs); if (!vo) *err = @"nil"; return vo; }
+ case '#': { Class vc = ((Class (*)(id, SEL))vpMsg)(obj, vs); return vc ? NSStringFromClass(vc) : (id)nil; }
+ case 'B': return @(((BOOL (*)(id, SEL))vpMsg)(obj, vs) ? YES : NO);
+ case 'c': return @(((signed char (*)(id, SEL))vpMsg)(obj, vs));
+ case 'C': return @(((unsigned char (*)(id, SEL))vpMsg)(obj, vs));
+ case 's': return @(((short (*)(id, SEL))vpMsg)(obj, vs));
+ case 'S': return @(((unsigned short (*)(id, SEL))vpMsg)(obj, vs));
+ case 'i': return @(((int (*)(id, SEL))vpMsg)(obj, vs));
+ case 'I': return @(((unsigned int (*)(id, SEL))vpMsg)(obj, vs));
+ case 'l': return @(((long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'L': return @(((unsigned long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'q': return @(((long long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'Q': return @(((unsigned long long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'f': return @(((float (*)(id, SEL))vpMsg)(obj, vs));
+ case 'd': return @(((double (*)(id, SEL))vpMsg)(obj, vs));
+ case '{':
+ if (vpStrncmp(vr, "{CGRect=", 8) == 0) return vpRect(((CGRect (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{CGSize=", 8) == 0) return vpSize(((CGSize (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{CGPoint=", 9) == 0) return vpPoint(((CGPoint (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{UIEdgeInsets=", 14) == 0 || vpStrncmp(vr, "{NSDirectionalEdgeInsets=", 25) == 0) { struct VPInsets { double a, b, c, d; } vi4 = ((struct VPInsets (*)(id, SEL))vpMsg)(obj, vs); return @{@"top": @(vi4.a), @"left": @(vi4.b), @"bottom": @(vi4.c), @"right": @(vi4.d)}; }
+ if (vpStrncmp(vr, "{CGAffineTransform=", 19) == 0) { CGAffineTransform vx = ((CGAffineTransform (*)(id, SEL))vpMsg)(obj, vs); return @[@(vx.a), @(vx.b), @(vx.c), @(vx.d), @(vx.tx), @(vx.ty)]; }
+ if (vpStrcmp(vr, "{?=ff}") == 0) { struct VPff { float a, b; } vf = ((struct VPff (*)(id, SEL))vpMsg)(obj, vs); return @[@(vf.a), @(vf.b)]; }
+ if (vpStrcmp(vr, "{?={?=ff}{?=ff}{?=ff}{?=ff}}") == 0) { struct VPf8 { float a[8]; } vf8 = ((struct VPf8 (*)(id, SEL))vpMsg)(obj, vs); return @[@(vf8.a[0]), @(vf8.a[1]), @(vf8.a[2]), @(vf8.a[3]), @(vf8.a[4]), @(vf8.a[5]), @(vf8.a[6]), @(vf8.a[7])]; }
+ if (vpStrncmp(vr, "{CAFrameRateRange=", 18) == 0) { struct VPfff { float a, b, c; } vf3 = ((struct VPfff (*)(id, SEL))vpMsg)(obj, vs); return @{@"minimum": @(vf3.a), @"maximum": @(vf3.b), @"preferred": @(vf3.c)}; }
+ *err = [NSString stringWithFormat:@"unsupported struct return %.60s", vr]; return (id)nil;
+ default: *err = [NSString stringWithFormat:@"unsupported return type %.60s", vr]; return (id)nil;
+ }
+};
+NSArray *(^vpGetters)(Class, Class) = ^NSArray *(Class cls, Class stop) {
+ char vrt[8];
+ NSMutableOrderedSet *vs = [NSMutableOrderedSet orderedSet];
+ for (Class vc = cls; vc && vc != stop && vc != [NSObject class]; vc = class_getSuperclass(vc)) {
+ unsigned int vn = 0;
+ objc_property_t *vp = class_copyPropertyList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ char *vg = property_copyAttributeValue(vp[vi], "G");
+ NSString *vgs = vg ? [NSString stringWithUTF8String:vg] : [NSString stringWithUTF8String:property_getName(vp[vi])];
+ if (vg) free(vg);
+ if (vpAllowed(vgs)) [vs addObject:vgs];
+ }
+ free(vp);
+ Method *vm = class_copyMethodList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vsel = NSStringFromSelector(method_getName(vm[vi]));
+ method_getReturnType(vm[vi], vrt, sizeof(vrt)); if (vrt[0] == 'v') continue;
+ if (method_getNumberOfArguments(vm[vi]) == 2 && vpAllowed(vsel)) [vs addObject:vsel];
+ }
+ free(vm);
+ }
+ return [[vs array] sortedArrayUsingSelector:@selector(compare:)];
+};
+void (^vpDump)(id, NSString *, NSString *, NSString *, Class) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, Class stop) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ vpAdd([apiClass stringByAppendingString:@".description"], kind, [callPrefix stringByAppendingString:@".description"], [(NSObject *)obj description], nil);
+ vpAdd([apiClass stringByAppendingString:@".class"], kind, [callPrefix stringByAppendingString:@".class"], NSStringFromClass([(NSObject *)obj class]), nil);
+ for (NSString *vsel in vpGetters([(NSObject *)obj class], stop)) {
+ vpTrace([NSString stringWithFormat:@"%@ %@", callPrefix, vsel]);
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+ for (NSString *vsel in vpThrowSels) if ([(NSObject *)obj respondsToSelector:NSSelectorFromString(vsel)]) vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], nil, @"raises an Objective-C exception in this process (not called)");
+};
+NSDictionary *(^vpObjDict)(id) = ^NSDictionary *(id objIn) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ if (!objIn) return vd;
+ for (NSString *vsel in vpGetters([(NSObject *)objIn class], nil)) { vpTrace([NSString stringWithFormat:@"objdict %@ %@", NSStringFromClass([(NSObject *)objIn class]), vsel]); NSString *verr = nil; id vv = vpCall(objIn, vsel, &verr); vd[vsel] = vv ? vpJSON(vv) : [NSString stringWithFormat:@"<error: %@>", verr]; }
+ return vd;
+};
+void (^vpDumpSel)(id, NSString *, NSString *, NSString *, NSArray *) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, NSArray *sels) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ for (NSString *vsel in sels) {
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+};
+id vpOrientation = nil;
+vpAdd(@"UIDevice.orientation", @"public", @"[[UIDevice currentDevice] orientation]", @((long)[[UIDevice currentDevice] orientation]), nil);
+NSMutableArray *vpSceneList = [NSMutableArray array];
+for (UIScene *vpSc in [[UIApplication sharedApplication] connectedScenes]) {
+ UIWindowScene *vpW = (UIWindowScene *)vpSc;
+ vpOrientation = @((long)vpW.interfaceOrientation);
+ [vpSceneList addObject:@{@"class": NSStringFromClass([vpSc class]), @"interfaceOrientation": @((long)vpW.interfaceOrientation), @"screenName": [(NSObject *)[vpW.screen valueForKey:@"_name"] description] ?: @"", @"displayIdentity": [(NSObject *)[vpW.screen valueForKey:@"displayIdentity"] description] ?: @"", @"coordinateSpaceBounds": vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpW.coordinateSpace, @selector(bounds))), @"screenBounds": vpRect(vpW.screen.bounds), @"screenNativeBounds": vpRect(vpW.screen.nativeBounds)}];
+}
+vpAdd(@"UIApplication.connectedScenes.summary", @"private", @"MobileSafari [[UIApplication sharedApplication] connectedScenes] -> {class, interfaceOrientation, screen._name, displayIdentity, coordinateSpace.bounds, screen.bounds, screen.nativeBounds}", vpSceneList, nil);
+NSArray *vpScreens = [UIScreen screens];
+NSMutableArray *vpSL = [NSMutableArray array];
+for (UIScreen *vpS in vpScreens) [vpSL addObject:@{@"name": [(NSObject *)[vpS valueForKey:@"_name"] description] ?: @"", @"bounds": vpRect(vpS.bounds), @"nativeBounds": vpRect(vpS.nativeBounds), @"scale": @(vpS.scale), @"displayIdentity": [(NSObject *)[vpS valueForKey:@"displayIdentity"] description] ?: @"", @"_interfaceOrientation": [vpS valueForKey:@"_interfaceOrientation"]}];
+vpAdd(@"UIScreen.screens.summary", @"public", @"MobileSafari [UIScreen screens] -> {_name, bounds, nativeBounds, scale, displayIdentity, _interfaceOrientation}", vpSL, nil);
+NSError *vpJErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:@{@"orientation": vpOrientation ?: [NSNull null], @"records": vpRecs} options:0 error:&vpJErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpJErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-springboard.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-springboard.lldb
new file mode 100644
index 00000000..96bd1cd6
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-display-springboard.lldb
@@ -0,0 +1,252 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+int (^vpStrncmp)(const char *, const char *, size_t) = ^int(const char *a, const char *b, size_t n) { for (size_t i = 0; i < n; i++) { if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; if (!a[i]) return 0; } return 0; };
+int (^vpStrcmp)(const char *, const char *) = ^int(const char *a, const char *b) { return vpStrncmp(a, b, (size_t)-1); };
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpTrace)(NSString *) = ^(NSString *s) { [s writeToFile:@"/var/tmp/vptrace.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil]; };
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) { return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)}; };
+NSDictionary *(^vpSize)(CGSize) = ^NSDictionary *(CGSize s) { return @{@"width": @(s.width), @"height": @(s.height)}; };
+NSDictionary *(^vpPoint)(CGPoint) = ^NSDictionary *(CGPoint p) { return @{@"x": @(p.x), @"y": @(p.y)}; };
+__block id (^vpJSON)(id);
+vpJSON = ^id(id vIn) { NSObject *v = (NSObject *)vIn;
+ if (!v) return [NSNull null];
+ if ([v isKindOfClass:[NSString class]]) return v;
+ if ([v isKindOfClass:[NSNumber class]]) {
+ double vd = [(NSNumber *)v doubleValue];
+ if (vd != vd || vd == INFINITY || vd == -INFINITY) return [(NSObject *)v description];
+ return v;
+ }
+ if ([v isKindOfClass:[NSValue class]]) {
+ const char *vt = [(NSValue *)v objCType];
+ if (vpStrncmp(vt, "{CGRect=", 8) == 0) { CGRect r; [(NSValue *)v getValue:&r]; return vpRect(r); }
+ if (vpStrncmp(vt, "{CGSize=", 8) == 0) { CGSize s; [(NSValue *)v getValue:&s]; return vpSize(s); }
+ if (vpStrncmp(vt, "{CGPoint=", 9) == 0) { CGPoint p; [(NSValue *)v getValue:&p]; return vpPoint(p); }
+ return [(NSObject *)v description];
+ }
+ if ([v isKindOfClass:[NSArray class]] || [v isKindOfClass:[NSSet class]] || [v isKindOfClass:[NSOrderedSet class]]) {
+ NSMutableArray *va = [NSMutableArray array];
+ for (id vx in (NSArray *)v) [va addObject:vpJSON(vx)];
+ return va;
+ }
+ if ([v isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *vm = [NSMutableDictionary dictionary];
+ for (id vk in (NSDictionary *)v) vm[[(NSObject *)vk description]] = vpJSON([(NSDictionary *)v objectForKey:vk]);
+ return vm;
+ }
+ if ([v isKindOfClass:[NSUUID class]]) return [(NSUUID *)v UUIDString];
+ return [(NSObject *)v description];
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ? vpJSON(value) : [NSNull null], @"error": error ?: (value ? (id)[NSNull null] : (id)@"nil")}];
+};
+NSArray *vpDenyExact = @[@"dealloc", @"invalidate", @"update", @"updateDisplays", @"_finalize", @"_invalidate", @"init", @"_init", @".cxx_destruct", @".cxx_construct", @"copy", @"mutableCopy", @"immutableCopy", @"freeze", @"acquireFrozenSurface", @"activateReplay", @"rebuildModeList", @"removeAllClones", @"resetConfiguration", @"disableDICOM", @"willUnblank", @"commitPreset", @"unregisterNotificationBlocks", @"unregisterSyncNotificationBlocks", @"clearUpdateMask", @"initializeClientPort", @"acquireWirelessDisplayStateControl", @"_detectDisplays", @"_detectSimDisplays", @"removeAllDisplays", @"enableOutOfProcessDisplayObservation", @"updateBandWidthInfoForAllDisplays", @"stopServer", @"new", @"alloc", @"class", @"self", @"retain", @"release", @"autorelease", @"retainCount", @"zone", @"hash", @"superclass", @"debugDescription", @"description", @"succinctDescription", @"succinctDescriptionBuilder", @"descriptionBuilder", @"_availableModesInternal", @"copyForSecureRendering", @"cancelTouchesOnMainDisplay", @"cancelTouchesOnAllDisplays", @"prepareForRestart", @"updateTransformsWithCompletion", @"_postInitialBookendObserverConnections", @"_cleanup", @"_freeze", @"_startAnimating", @"_stopAnimating", @"copyPrivateRepresentation", @"initForProtobufDecoding", @"_queue_resetTouchAuthenticationInitialSampleEvent", @"layoutIfNeeded", @"setNeedsLayout", @"_copyDebugProperties", @"_dragManager", @"_focusSystem", @"_interactiveHighlightEnvironment", @"focusItemContainer", @"focusedItem", @"focusedView", @"parentFocusEnvironment", @"preferredFocusEnvironments", @"preferredFocusedView", @"_preferredFocusedWindow", @"_preferredFocusedWindowScene", @"_boundingPathUtilities", @"_carSession", @"supportsFocus", @"_SwiftUITesting_currentScreenScale", @"_SwiftUITesting_wantsWideContentMargins", @"__ck_isFullscreen", @"pu_workImageSize", @"px_currentEDRHeadroom", @"px_potentialEDRHeadroom", @"ck_screenSizeCategory", @"_mapkit_display", @"postBookendConnections", @"bookendObserver", @"observers"];
+NSArray *vpDenyPrefix = @[@"set", @"_set", @"remove", @"_remove", @"add", @"cancel", @"invalidate", @"_lock_", @"_workQueue_", @"_queue_", @"_post", @"_present", @"_dismiss", @"_update", @"_wrap", @"reevaluate", @"_begin", @"_end", @"begin", @"end", @"_prepare", @"_reset", @"reset", @"_flush", @"flush", @"_notify", @"_handle", @"_init", @"init", @"_copy", @"copy", @"_create", @"create", @"_install", @"_uninstall", @"_register", @"_unregister", @"register", @"unregister", @"_perform", @"perform", @"_apply", @"apply", @"_enable", @"_disable", @"_invalidate", @"_teardown", @"_start", @"_stop", @"start", @"stop", @"_send", @"send", @"_snapshot", @"snapshot", @"_dump", @"dump", @"_run", @"_schedule", @"_will", @"_did", @"_reload", @"reload", @"_force", @"_clear", @"clear", @"_release", @"_acquire", @"acquire", @"_take", @"_capture", @"_trigger", @"_request", @"request", @"_animate", @"_show", @"_hide", @"_attach", @"_detach", @"_connect", @"_disconnect", @"_present", @"_activate", @"_deactivate", @"_destroy", @"_purge", @"_close", @"_open", @"_save", @"_load", @"_make", @"make", @"_print", @"_log", @"_toggle", @"_test", @"_simulate", @"_fake", @"_debug"];
+NSArray *vpThrowSels = @[@"secureIndicatorsEnabled"];
+BOOL (^vpAllowed)(NSString *) = ^BOOL(NSString *sel) {
+ if ([vpThrowSels containsObject:sel]) return NO;
+ if ([sel rangeOfString:@":"].location != NSNotFound) return NO;
+ if ([vpDenyExact containsObject:sel]) return NO;
+ for (NSString *vp in vpDenyPrefix) if ([sel hasPrefix:vp]) return NO;
+ return YES;
+};
+id (^vpCall)(id, NSString *, NSString **) = ^id(id obj, NSString *sel, NSString **err) {
+ SEL vs = NSSelectorFromString(sel);
+ if (![(NSObject *)obj respondsToSelector:vs]) { *err = @"does not respond"; return (id)nil; }
+ Method vm = class_getInstanceMethod(object_getClass(obj), vs);
+ if (!vm) { *err = @"no method"; return (id)nil; }
+ if (method_getNumberOfArguments(vm) != 2) { *err = @"takes arguments"; return (id)nil; }
+ char vt[256]; method_getReturnType(vm, vt, sizeof(vt));
+ const char *vr = vt; while (*vr == 'r' || *vr == 'n' || *vr == 'N' || *vr == 'o' || *vr == 'O' || *vr == 'R' || *vr == 'V') vr++;
+ switch (vr[0]) {
+ case '@': if (vr[1] == '?') { *err = @"block"; return (id)nil; }
+ { id vo = ((id (*)(id, SEL))vpMsg)(obj, vs); if (!vo) *err = @"nil"; return vo; }
+ case '#': { Class vc = ((Class (*)(id, SEL))vpMsg)(obj, vs); return vc ? NSStringFromClass(vc) : (id)nil; }
+ case 'B': return @(((BOOL (*)(id, SEL))vpMsg)(obj, vs) ? YES : NO);
+ case 'c': return @(((signed char (*)(id, SEL))vpMsg)(obj, vs));
+ case 'C': return @(((unsigned char (*)(id, SEL))vpMsg)(obj, vs));
+ case 's': return @(((short (*)(id, SEL))vpMsg)(obj, vs));
+ case 'S': return @(((unsigned short (*)(id, SEL))vpMsg)(obj, vs));
+ case 'i': return @(((int (*)(id, SEL))vpMsg)(obj, vs));
+ case 'I': return @(((unsigned int (*)(id, SEL))vpMsg)(obj, vs));
+ case 'l': return @(((long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'L': return @(((unsigned long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'q': return @(((long long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'Q': return @(((unsigned long long (*)(id, SEL))vpMsg)(obj, vs));
+ case 'f': return @(((float (*)(id, SEL))vpMsg)(obj, vs));
+ case 'd': return @(((double (*)(id, SEL))vpMsg)(obj, vs));
+ case '{':
+ if (vpStrncmp(vr, "{CGRect=", 8) == 0) return vpRect(((CGRect (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{CGSize=", 8) == 0) return vpSize(((CGSize (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{CGPoint=", 9) == 0) return vpPoint(((CGPoint (*)(id, SEL))vpMsg)(obj, vs));
+ if (vpStrncmp(vr, "{UIEdgeInsets=", 14) == 0 || vpStrncmp(vr, "{NSDirectionalEdgeInsets=", 25) == 0) { struct VPInsets { double a, b, c, d; } vi4 = ((struct VPInsets (*)(id, SEL))vpMsg)(obj, vs); return @{@"top": @(vi4.a), @"left": @(vi4.b), @"bottom": @(vi4.c), @"right": @(vi4.d)}; }
+ if (vpStrncmp(vr, "{CGAffineTransform=", 19) == 0) { CGAffineTransform vx = ((CGAffineTransform (*)(id, SEL))vpMsg)(obj, vs); return @[@(vx.a), @(vx.b), @(vx.c), @(vx.d), @(vx.tx), @(vx.ty)]; }
+ if (vpStrcmp(vr, "{?=ff}") == 0) { struct VPff { float a, b; } vf = ((struct VPff (*)(id, SEL))vpMsg)(obj, vs); return @[@(vf.a), @(vf.b)]; }
+ if (vpStrcmp(vr, "{?={?=ff}{?=ff}{?=ff}{?=ff}}") == 0) { struct VPf8 { float a[8]; } vf8 = ((struct VPf8 (*)(id, SEL))vpMsg)(obj, vs); return @[@(vf8.a[0]), @(vf8.a[1]), @(vf8.a[2]), @(vf8.a[3]), @(vf8.a[4]), @(vf8.a[5]), @(vf8.a[6]), @(vf8.a[7])]; }
+ if (vpStrncmp(vr, "{CAFrameRateRange=", 18) == 0) { struct VPfff { float a, b, c; } vf3 = ((struct VPfff (*)(id, SEL))vpMsg)(obj, vs); return @{@"minimum": @(vf3.a), @"maximum": @(vf3.b), @"preferred": @(vf3.c)}; }
+ *err = [NSString stringWithFormat:@"unsupported struct return %.60s", vr]; return (id)nil;
+ default: *err = [NSString stringWithFormat:@"unsupported return type %.60s", vr]; return (id)nil;
+ }
+};
+NSArray *(^vpGetters)(Class, Class) = ^NSArray *(Class cls, Class stop) {
+ char vrt[8];
+ NSMutableOrderedSet *vs = [NSMutableOrderedSet orderedSet];
+ for (Class vc = cls; vc && vc != stop && vc != [NSObject class]; vc = class_getSuperclass(vc)) {
+ unsigned int vn = 0;
+ objc_property_t *vp = class_copyPropertyList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ char *vg = property_copyAttributeValue(vp[vi], "G");
+ NSString *vgs = vg ? [NSString stringWithUTF8String:vg] : [NSString stringWithUTF8String:property_getName(vp[vi])];
+ if (vg) free(vg);
+ if (vpAllowed(vgs)) [vs addObject:vgs];
+ }
+ free(vp);
+ Method *vm = class_copyMethodList(vc, &vn);
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vsel = NSStringFromSelector(method_getName(vm[vi]));
+ method_getReturnType(vm[vi], vrt, sizeof(vrt)); if (vrt[0] == 'v') continue;
+ if (method_getNumberOfArguments(vm[vi]) == 2 && vpAllowed(vsel)) [vs addObject:vsel];
+ }
+ free(vm);
+ }
+ return [[vs array] sortedArrayUsingSelector:@selector(compare:)];
+};
+void (^vpDump)(id, NSString *, NSString *, NSString *, Class) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, Class stop) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ vpAdd([apiClass stringByAppendingString:@".description"], kind, [callPrefix stringByAppendingString:@".description"], [(NSObject *)obj description], nil);
+ vpAdd([apiClass stringByAppendingString:@".class"], kind, [callPrefix stringByAppendingString:@".class"], NSStringFromClass([(NSObject *)obj class]), nil);
+ for (NSString *vsel in vpGetters([(NSObject *)obj class], stop)) {
+ vpTrace([NSString stringWithFormat:@"%@ %@", callPrefix, vsel]);
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+ for (NSString *vsel in vpThrowSels) if ([(NSObject *)obj respondsToSelector:NSSelectorFromString(vsel)]) vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], nil, @"raises an Objective-C exception in this process (not called)");
+};
+NSDictionary *(^vpObjDict)(id) = ^NSDictionary *(id objIn) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ if (!objIn) return vd;
+ for (NSString *vsel in vpGetters([(NSObject *)objIn class], nil)) { vpTrace([NSString stringWithFormat:@"objdict %@ %@", NSStringFromClass([(NSObject *)objIn class]), vsel]); NSString *verr = nil; id vv = vpCall(objIn, vsel, &verr); vd[vsel] = vv ? vpJSON(vv) : [NSString stringWithFormat:@"<error: %@>", verr]; }
+ return vd;
+};
+void (^vpDumpSel)(id, NSString *, NSString *, NSString *, NSArray *) = ^(id obj, NSString *apiClass, NSString *kind, NSString *callPrefix, NSArray *sels) {
+ if (!obj) { vpAdd([apiClass stringByAppendingString:@".(object)"], kind, callPrefix, nil, @"object is nil"); return; }
+ for (NSString *vsel in sels) {
+ NSString *verr = nil;
+ id vv = vpCall(obj, vsel, &verr);
+ vpAdd([NSString stringWithFormat:@"%@.%@", apiClass, vsel], kind, [NSString stringWithFormat:@"%@.%@", callPrefix, vsel], vv, vv ? nil : verr);
+ }
+};
+NSObject *vpSvc = [[UIApplication sharedApplication] valueForKey:@"_displayToolService"];
+NSObject *vpDCM = [vpSvc valueForKey:@"_displayContentModeCoordinator"];
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+id vpOrientation = vpPrimary ? @(vpPrimary.interfaceOrientation) : nil;
+for (UIWindowScene *vpWS in (NSArray *)[vpDCM valueForKey:@"_connectedWindowScenes"]) {
+ long vpMode = ((long (*)(id, SEL, id))vpMsg)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS);
+ vpAdd(@"UIWindowScene.displaySummary", @"private", [NSString stringWithFormat:@"<scene %@>: interfaceOrientation, screen._name, displayIdentity, contentMode, isPrimary", vpWS.session.persistentIdentifier],
+ @{@"persistentIdentifier": vpWS.session.persistentIdentifier ?: @"", @"interfaceOrientation": @(vpWS.interfaceOrientation), @"screenName": [(NSObject *)[vpWS.screen valueForKey:@"_name"] description] ?: @"", @"displayIdentity": [(NSObject *)[vpWS.screen valueForKey:@"displayIdentity"] description] ?: @"", @"displayContentMode": @(vpMode), @"isPrimaryWindowScene": @(vpWS == vpPrimary), @"coordinateSpaceBounds": vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpWS.coordinateSpace, @selector(bounds))), @"effectiveGeometryInterfaceOrientation": @(vpWS.effectiveGeometry.interfaceOrientation)}, nil);
+}
+Class vpUIS = [UIScreen class];
+NSArray *vpScreens = [UIScreen screens];
+vpAdd(@"UIScreen.screens", @"public", @"[UIScreen screens].count", @(vpScreens.count), nil);
+vpAdd(@"UIScreen.screens.names", @"private", @"[[UIScreen screens] valueForKey:@\"_name\"]", [vpScreens valueForKey:@"_name"], nil);
+vpAdd(@"UIScreen.mainScreen.indexInScreens", @"public", @"[[UIScreen screens] indexOfObjectIdenticalTo:[UIScreen mainScreen]]", @((long)[vpScreens indexOfObjectIdenticalTo:[UIScreen mainScreen]]), nil);
+for (NSString *vpCS in @[@"_embeddedScreen", @"_carScreen", @"allActiveScreens", @"_shortScreensDescription", @"maxScreenScale", @"_screenHeightSizeClassForCurrentDevice", @"_isProbablyBeingRecorded", @"_shouldDisableJail", @"__displayConfigurationsForViewService", @"_mainScreenThreadSafeTraitCollection"]) {
+ NSString *verr = nil;
+ id vv = vpCall(vpUIS, vpCS, &verr);
+ vpAdd([@"UIScreen+" stringByAppendingString:vpCS], @"private", [NSString stringWithFormat:@"[UIScreen %@]", vpCS], vv, vv ? nil : verr);
+}
+NSArray *vpTraitSels = @[@"displayScale", @"displayGamut", @"userInterfaceIdiom", @"horizontalSizeClass", @"verticalSizeClass", @"displayCornerRadius", @"layoutDirection", @"forceTouchCapability", @"userInterfaceStyle", @"userInterfaceLevel", @"artworkSubtype", @"touchLevel", @"_backlightLuminance", @"sceneCaptureState", @"imageDynamicRange", @"primaryInteractionModel", @"interactionModel", @"_windowSceneInterfaceOrientationBehavior", @"verticalBarEdge", @"accessibilityContrast", @"legibilityWeight", @"preferredContentSizeCategory", @"activeAppearance", @"hdrHeadroomUsageLimit", @"_headroomUsage", @"isSmallScreenDevice", @"_systemDisplayIdentifier", @"widthDesignation", @"heightDesignation", @"_userInterfaceRenderingMode", @"_vibrancy", @"_traitsDescription"];
+NSMutableArray *vpScrList = [NSMutableArray arrayWithArray:vpScreens];
+NSMutableArray *vpScrCalls = [NSMutableArray array];
+for (NSUInteger vi = 0; vi < vpScreens.count; vi++) [vpScrCalls addObject:[NSString stringWithFormat:@"[UIScreen screens][%lu]<%@>", (unsigned long)vi, [(NSObject *)vpScreens[vi] valueForKey:@"_name"]]];
+[vpScrList addObject:[UIScreen mainScreen]];
+[vpScrCalls addObject:[NSString stringWithFormat:@"[UIScreen mainScreen]<%@>", [[UIScreen mainScreen] valueForKey:@"_name"]]];
+NSMutableArray *vpConfigs = [NSMutableArray array];
+NSMutableArray *vpConfigCalls = [NSMutableArray array];
+for (NSUInteger vi = 0; vi < vpScrList.count; vi++) {
+ UIScreen *vpS = vpScrList[vi];
+ NSString *vpC = vpScrCalls[vi];
+ vpDump(vpS, @"UIScreen", @"private", vpC, nil);
+ vpAdd(@"UIScreen.coordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".coordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpS.coordinateSpace, @selector(bounds))), nil);
+ vpAdd(@"UIScreen.fixedCoordinateSpace.bounds", @"public", [vpC stringByAppendingString:@".fixedCoordinateSpace.bounds"], vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpS.fixedCoordinateSpace, @selector(bounds))), nil);
+ CGRect vpFix = ((CGRect (*)(id, SEL, CGRect, id))vpMsg)((id)vpS.coordinateSpace, @selector(convertRect:toCoordinateSpace:), ((CGRect (*)(id, SEL))vpMsg)((id)vpS.coordinateSpace, @selector(bounds)), (id)vpS.fixedCoordinateSpace);
+ vpAdd(@"UIScreen.coordinateSpace->fixedCoordinateSpace", @"public", [vpC stringByAppendingString:@" [coordinateSpace convertRect:coordinateSpace.bounds toCoordinateSpace:fixedCoordinateSpace]"], vpRect(vpFix), nil);
+ vpDumpSel(vpS.traitCollection, @"UITraitCollection", @"public", [vpC stringByAppendingString:@".traitCollection"], vpTraitSels);
+ NSObject *vpEx = [vpS valueForKey:@"_exclusionArea"];
+ vpAdd(@"UIScreen._exclusionArea.rect", @"private", [vpC stringByAppendingString:@"._exclusionArea.rect"], vpEx && [vpEx respondsToSelector:@selector(rect)] ? vpRect(((CGRect (*)(id, SEL))vpMsg)(vpEx, @selector(rect))) : nil, vpEx ? ([vpEx respondsToSelector:@selector(rect)] ? nil : [NSString stringWithFormat:@"%@ has no -rect", NSStringFromClass([vpEx class])]) : @"nil");
+ NSObject *vpDIP = [vpS valueForKey:@"_displayInfoProvider"];
+ vpAdd(@"UIScreen._displayInfoProvider.getters", @"private", [vpC stringByAppendingString:@"._displayInfoProvider.*"], vpDIP ? vpObjDict(vpDIP) : nil, vpDIP ? nil : @"nil");
+ NSObject *vpIDC = [vpS valueForKey:@"_initialDisplayContext"];
+ vpAdd(@"UIScreen._initialDisplayContext.getters", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_initialDisplayContext\" .*"], vpIDC ? vpObjDict(vpIDC) : nil, vpIDC ? nil : @"nil");
+ NSObject *vpIDCEdge = vpIDC ? [vpIDC valueForKey:@"displayEdgeInfo"] : nil;
+ vpAdd(@"UIScreen._initialDisplayContext.displayEdgeInfo.getters", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_initialDisplayContext\" .displayEdgeInfo.*"], vpIDCEdge ? vpObjDict(vpIDCEdge) : nil, vpIDCEdge ? nil : @"nil");
+ vpAdd(@"UIScreen.__eventDisplay", @"private", [vpC stringByAppendingString:@" valueForKey:@\"__eventDisplay\""], [vpS valueForKey:@"__eventDisplay"], nil);
+ vpAdd(@"UIScreen._sceneProvidedCornerRadius", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_sceneProvidedCornerRadius\""], [vpS valueForKey:@"_sceneProvidedCornerRadius"], nil);
+ vpAdd(@"UIScreen._previousHardwareIdentifier", @"private", [vpC stringByAppendingString:@" valueForKey:@\"_previousHardwareIdentifier\""], [vpS valueForKey:@"_previousHardwareIdentifier"], nil);
+ NSMutableArray *vpUM = [NSMutableArray array];
+ for (UIScreenMode *vpM in vpS.availableModes) [vpUM addObject:@{@"size": vpSize(vpM.size), @"pixelAspectRatio": @(vpM.pixelAspectRatio)}];
+ vpAdd(@"UIScreen.availableModes.sizes", @"public", [vpC stringByAppendingString:@".availableModes[*].{size,pixelAspectRatio}"], vpUM, nil);
+ vpAdd(@"UIScreen.currentMode.size", @"public", [vpC stringByAppendingString:@".currentMode.size"], vpS.currentMode ? vpSize(vpS.currentMode.size) : nil, vpS.currentMode ? nil : @"nil");
+ vpAdd(@"UIScreen.preferredMode.size", @"public", [vpC stringByAppendingString:@".preferredMode.size"], vpS.preferredMode ? vpSize(vpS.preferredMode.size) : nil, vpS.preferredMode ? nil : @"nil");
+ if (vi < vpScreens.count) {
+ NSObject *vpDC = [vpS valueForKey:@"displayConfiguration"];
+ if (vpDC) { [vpConfigs addObject:vpDC]; [vpConfigCalls addObject:[vpC stringByAppendingString:@".displayConfiguration"]]; }
+ }
+}
+NSObject *vpFBDM = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"FBDisplayManager"), @selector(sharedInstance));
+vpDump(vpFBDM, @"FBDisplayManager", @"private", @"[FBDisplayManager sharedInstance]", nil);
+for (NSString *vpCS in @[@"mainConfiguration", @"mainIdentity", @"alwaysConnectedIdentities"]) {
+ NSString *verr = nil; id vv = vpCall(NSClassFromString(@"FBDisplayManager"), vpCS, &verr);
+ vpAdd([@"FBDisplayManager+" stringByAppendingString:vpCS], @"private", [NSString stringWithFormat:@"[FBDisplayManager %@]", vpCS], vv, vv ? nil : verr);
+}
+NSArray *vpConn = [[(NSSet *)[vpFBDM valueForKey:@"connectedIdentities"] allObjects] sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"displayID" ascending:YES]]];
+vpAdd(@"FBSDisplayMonitor.connectedIdentities.count", @"private", @"[[FBDisplayManager sharedInstance] connectedIdentities].count", @(vpConn.count), nil);
+for (NSObject *vpId in vpConn) {
+ NSObject *vpCfg = ((id (*)(id, SEL, id))vpMsg)(vpFBDM, NSSelectorFromString(@"configurationForIdentity:"), vpId);
+ if (vpCfg) { [vpConfigs addObject:vpCfg]; [vpConfigCalls addObject:[NSString stringWithFormat:@"[[FBDisplayManager sharedInstance] configurationForIdentity:<%@>]", vpId]]; }
+ else vpAdd(@"FBSDisplayMonitor.configurationForIdentity:", @"private", [NSString stringWithFormat:@"[[FBDisplayManager sharedInstance] configurationForIdentity:<%@>]", vpId], nil, @"nil");
+}
+NSObject *vpUISDC = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"UISDisplayContext"), @selector(defaultContext));
+if (vpUISDC) { [vpConfigs addObject:[vpUISDC valueForKey:@"displayConfiguration"]]; [vpConfigCalls addObject:@"[UISDisplayContext defaultContext].displayConfiguration"]; }
+NSMutableOrderedSet *vpHWIDs = [NSMutableOrderedSet orderedSet];
+for (NSUInteger vi = 0; vi < vpConfigs.count; vi++) {
+ NSObject *vpCfg = vpConfigs[vi];
+ NSString *vpC = vpConfigCalls[vi];
+ vpDump(vpCfg, @"FBSDisplayConfiguration", @"private", vpC, nil);
+ vpAdd(@"FBSDisplayConfiguration.currentMode.getters", @"private", [vpC stringByAppendingString:@".currentMode.*"], vpObjDict([vpCfg valueForKey:@"currentMode"]), nil);
+ vpAdd(@"FBSDisplayConfiguration.preferredMode.getters", @"private", [vpC stringByAppendingString:@".preferredMode.*"], vpObjDict([vpCfg valueForKey:@"preferredMode"]), nil);
+ NSMutableArray *vpMs = [NSMutableArray array];
+ for (id vpM in (NSSet *)[vpCfg valueForKey:@"availableModes"]) [vpMs addObject:vpObjDict(vpM)];
+ vpAdd(@"FBSDisplayConfiguration.availableModes.getters", @"private", [vpC stringByAppendingString:@".availableModes[*].*"], vpMs, nil);
+ vpAdd(@"FBSDisplayConfiguration.pixelDensity.getters", @"private", [vpC stringByAppendingString:@".pixelDensity.*"], vpObjDict([vpCfg valueForKey:@"pixelDensity"]), nil);
+ NSObject *vpIdn = [vpCfg valueForKey:@"identity"];
+ vpDump(vpIdn, @"FBSDisplayIdentity", @"private", [vpC stringByAppendingString:@".identity"], nil);
+ NSObject *vpRoot = [vpIdn valueForKey:@"rootIdentity"];
+ vpAdd(@"FBSDisplayIdentity.rootIdentity.getters", @"private", [vpC stringByAppendingString:@".identity.rootIdentity.*"], vpRoot ? vpObjDict(vpRoot) : nil, vpRoot ? nil : @"nil");
+ id vpHW = [vpCfg valueForKey:@"hardwareIdentifier"];
+ if (vpHW) [vpHWIDs addObject:vpHW];
+}
+vpDump(vpUISDC, @"UISDisplayContext", @"private", @"[UISDisplayContext defaultContext]", nil);
+NSObject *vpEdge = vpUISDC ? [vpUISDC valueForKey:@"displayEdgeInfo"] : nil;
+vpAdd(@"UISDisplayContext.displayEdgeInfo.getters", @"private", @"[UISDisplayContext defaultContext].displayEdgeInfo.*", vpEdge ? vpObjDict(vpEdge) : nil, vpEdge ? nil : @"nil");
+NSObject *vpEA = vpUISDC ? [vpUISDC valueForKey:@"exclusionArea"] : nil;
+vpAdd(@"UISDisplayContext.exclusionArea.rect", @"private", @"[UISDisplayContext defaultContext].exclusionArea.rect", vpEA && [vpEA respondsToSelector:@selector(rect)] ? vpRect(((CGRect (*)(id, SEL))vpMsg)(vpEA, @selector(rect))) : nil, vpEA ? nil : @"nil");
+NSObject *vpBKS = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKSDisplayService"), @selector(sharedInstance));
+for (NSString *vpHW in vpHWIDs) {
+ NSObject *vpT = ((id (*)(id, SEL, id))vpMsg)(vpBKS, NSSelectorFromString(@"traitsForDisplayUUID:"), vpHW);
+ vpAdd(@"BKSDisplayService.traitsForDisplayUUID:", @"private", [NSString stringWithFormat:@"[[BKSDisplayService sharedInstance] traitsForDisplayUUID:@\"%@\"]", vpHW], vpT ? @{@"description": [vpT description], @"surfaceType": @(((int (*)(id, SEL))vpMsg)(vpT, NSSelectorFromString(@"surfaceType")))} : nil, vpT ? nil : @"nil");
+}
+vpAdd(@"UIDevice.orientation", @"public", @"[[UIDevice currentDevice] orientation]", @((long)[[UIDevice currentDevice] orientation]), nil);
+vpAdd(@"UIApplication.activeInterfaceOrientation", @"private", @"[[UIApplication sharedApplication] activeInterfaceOrientation]", @((long)[(UIApplication *)[UIApplication sharedApplication] activeInterfaceOrientation]), nil);
+NSMutableArray *vpSceneList = [NSMutableArray array];
+for (UIScene *vpSc in [[UIApplication sharedApplication] connectedScenes]) {
+ UIWindowScene *vpW = (UIWindowScene *)vpSc;
+ [vpSceneList addObject:@{@"persistentIdentifier": vpSc.session.persistentIdentifier ?: @"", @"class": NSStringFromClass([vpSc class]), @"interfaceOrientation": @((long)vpW.interfaceOrientation), @"screenName": [(NSObject *)[vpW.screen valueForKey:@"_name"] description] ?: @"", @"coordinateSpaceBounds": vpRect(((CGRect (*)(id, SEL))vpMsg)((id)vpW.coordinateSpace, @selector(bounds)))}];
+}
+vpAdd(@"UIApplication.connectedScenes.summary", @"private", @"[[UIApplication sharedApplication] connectedScenes] -> {persistentIdentifier, class, interfaceOrientation, screen._name, coordinateSpace.bounds}", [vpSceneList sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"persistentIdentifier" ascending:YES]]], nil);
+NSObject *vpFG = [[UIApplication sharedApplication] respondsToSelector:NSSelectorFromString(@"_accessibilityFrontMostApplication")] ? [[UIApplication sharedApplication] valueForKey:@"_accessibilityFrontMostApplication"] : nil;
+vpAdd(@"SpringBoard._accessibilityFrontMostApplication", @"private", @"[[UIApplication sharedApplication] _accessibilityFrontMostApplication].bundleIdentifier", vpFG ? [vpFG valueForKey:@"bundleIdentifier"] : nil, vpFG ? nil : @"nil (home screen or not available)");
+NSError *vpJErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:@{@"orientation": vpOrientation ?: [NSNull null], @"records": vpRecs} options:0 error:&vpJErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpJErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-lock-press.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-lock-press.lldb
new file mode 100644
index 00000000..fca0c3e8
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-lock-press.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- ((void (*)(id, SEL))objc_msgSend)((id)[UIApplication sharedApplication], NSSelectorFromString(@"_simulateLockButtonPress")); @"lock button press simulated"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-lock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-lock.lldb
new file mode 100644
index 00000000..d19c4506
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-lock.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- NSObject *vpLSM = nil; NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"]; UIScene *vpP = (UIScene *)[vpDCM valueForKey:@"primaryWindowScene"]; vpLSM = [vpP valueForKey:@"lockScreenManager"]; ((void (*)(id, SEL, int, id))objc_msgSend)(vpLSM, @selector(lockUIFromSource:withOptions:), 1, nil); [NSString stringWithFormat:@"locked via %@ isUILocked=%@", vpP.session.persistentIdentifier, [vpLSM valueForKey:@"isUILocked"]]
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-merge.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-merge.zsh
new file mode 100755
index 00000000..ea37cba8
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-merge.zsh
@@ -0,0 +1,40 @@
+#!/bin/zsh
+# vm-merge.zsh: build vm-<domain>.json (README record format) from raw/vm/steps/*/records.jsonl.
+# Domain = probe prefix: springboard-*, display-*, sensors-*, chrome-*, appkit-*. Steps are
+# taken in the order of raw/vm/steps/ORDER (one step label per line); each step's rpc.json
+# (display.pose, orientation, screenshot size and lit/dark, SpringBoard pid) goes to
+# meta.steps. Addresses (0x + 6 or more hex digits) in string values become 0x*, as in the
+# simulator files; raw transcripts keep them.
+set -euo pipefail
+here=${0:a:h}; root=${here:h}
+jq=/opt/homebrew/bin/jq
+steps=$root/raw/vm/steps
+bundle=${VM_BUNDLE:-2.14.0-local.21dc0c06}
+# Rebuild every step's records.jsonl from its transcripts first (keeps all probe fields).
+$here/vm-retag.zsh $(sed "s#^#$steps/#" $steps/ORDER | while read -r d; do [[ -e $d/rpc.json ]] && print $d; done) >/dev/null
+for domain in springboard display sensors chrome appkit; do
+ out=$root/vm-$domain.json
+ recs=$(mktemp -t vmmerge); meta=$(mktemp -t vmmeta)
+ : > $recs; : > $meta
+ while read -r step; do
+ [[ -n $step && -e $steps/$step/records.jsonl ]] || continue
+ $jq -c --arg d "$domain" --arg step "$step" 'select(.probe | startswith($d + "-")) | . + {step: $step}
+ | walk(if type == "string" then gsub("0x[0-9a-fA-F]{6,}"; "0x*") else . end)' $steps/$step/records.jsonl >> $recs
+ if $jq -e --arg d "$domain" 'select(.probe | startswith($d + "-"))' $steps/$step/records.jsonl >/dev/null 2>&1 \
+ && [[ -n $($jq -c --arg d "$domain" 'select(.probe | startswith($d + "-")) | .probe' $steps/$step/records.jsonl | head -1) ]]; then
+ $jq -c --arg step "$step" '{step: $step} + . ' $steps/$step/rpc.json >> $meta
+ fi
+ done < $steps/ORDER
+ $jq -n --arg domain $domain --arg bundle $bundle --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
+ --slurpfile recs $recs --slurpfile steps $meta '{
+ meta: {domain: $domain,
+ vm: {name: "duobase-01", bundle: $bundle, bundle_source: "upstream main 82afdb9a, two-display Duo path",
+ device: "iPhone19,4", os: "iOS 27.1 24A94425", host_tool: "tools/vm-probe.zsh (guest debugserver, host lldb)"},
+ posture_mechanism: "vphoned display.posture / display.rotation (SpringBoard pose override + virtual hinge HID), not the sim swap tool",
+ probes: "probes/vm-*.lldb where present (vm-convert.zsh output plus VM-only fixes, see vm-notes.md), else the simulator probe unchanged",
+ normalisation: "0x[0-9a-f]{6,} replaced by 0x* in string values; raw values in raw/vm/steps/<step>/*.raw.txt",
+ date: $date, steps: $steps},
+ records: $recs}' > $out
+ print "$out: $($jq '.records | length' $out) records, $($jq '.meta.steps | length' $out) steps"
+ rm -f $recs $meta
+done
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-retag.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-retag.zsh
new file mode 100755
index 00000000..87724b6b
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-retag.zsh
@@ -0,0 +1,22 @@
+#!/bin/zsh
+# vm-retag.zsh <step-dir>...: rebuild <step-dir>/records.jsonl from the probe transcripts,
+# keeping every field a probe emits (chrome-state's scene/display/sceneOrientation, appkit's
+# extra fields) and adding process, posture (from rpc.json), orientation and probe.
+# vm-run.zsh's own tagging kept only the README fields; this supersedes it.
+set -euo pipefail
+jq=/opt/homebrew/bin/jq
+for dir in "$@"; do
+ plabel=$($jq -r .posture $dir/rpc.json)
+ : > $dir/records.jsonl.new
+ for f in $dir/*-*.txt; do
+ [[ $f == *.raw.txt || $f == */probe-stderr.txt ]] && continue
+ base=${f:t:r}; proc=${base%%-*}; probe=${base#*-}
+ grep -E '^\{"(records|orientation|group|primaryOrientation|primaryScene)"' $f | $jq -c --arg proc $proc --arg probe $probe --arg posture "$plabel" '
+ def orient: {"0": "unknown", "1": "portrait", "2": "portraitUpsideDown", "3": "landscapeLeft", "4": "landscapeRight"}[tostring] // "unknown";
+ . as $g | .records[] | . + {process: $proc, posture: $posture,
+ orientation: (($g.orientation // $g.primaryOrientation // 0) | orient), probe: $probe}
+ + (if $g.group then {group: $g.group} else {} end)' >> $dir/records.jsonl.new 2>/dev/null || true
+ done
+ mv $dir/records.jsonl.new $dir/records.jsonl
+ print "$dir: $(wc -l < $dir/records.jsonl | tr -d ' ') records"
+done
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-run.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-run.zsh
new file mode 100755
index 00000000..3b41a60e
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-run.zsh
@@ -0,0 +1,67 @@
+#!/bin/zsh
+# vm-run.zsh posture <label> '<display.posture json>' drive the pose, save the reply
+# vm-run.zsh rpc <label> <method> '<json>' any guest RPC, reply saved
+# vm-run.zsh snap <label> <posture-label> [proc:probe ...]
+#
+# One step of the vphone-duo run on duobase-01. `snap` unlocks the guest, records an RPC
+# snapshot (display.pose, display.orientation, device.screen, screenshot size and lit/dark,
+# SpringBoard pid), then runs each probe (probes/<probe>.lldb, the vm-* variants where they
+# exist) in <proc> through tools/vm-probe.zsh. Everything lands in raw/vm/steps/<label>/:
+# rpc.json, shot.jpg, <proc>-<probe>.txt (+ .raw.txt), records.jsonl (tagged records).
+# The SpringBoard pid is checked after every probe; a change is printed and stored in rpc.json.
+# VM_NO_UNLOCK=1 skips the screen.unlock (auto-lock and lock-screen steps).
+set -euo pipefail
+here=${0:a:h}
+root=${here:h}
+jq=/opt/homebrew/bin/jq
+vm=duobase-01
+R() { vphone-launchpad-cli guest rpc $vm "$@" }
+sbpid() { R processes.list '{"filter":"SpringBoard"}' | $jq -r '[.result.processes[] | select(.name == "SpringBoard") | .pid] | first // empty' }
+
+cmd=${1:?verb}; label=${2:?label}; shift 2
+dir=$root/raw/vm/steps/$label
+mkdir -p $dir
+case $cmd in
+ posture)
+ R display.posture "$1" > $dir/posture.json || true
+ $jq -c '.result // .' $dir/posture.json ;;
+ rpc)
+ R $1 "${2:-{\}}" > $dir/rpc-$1.json || true
+ $jq -c '.result // .' $dir/rpc-$1.json | cut -c1-400 ;;
+ snap)
+ plabel=${1:?posture-label}; shift
+ if [[ -z ${VM_NO_UNLOCK:-} ]]; then R screen.unlock '{}' > $dir/unlock.json 2>&1 || true; else print "VM_NO_UNLOCK: left as is" > $dir/unlock.json; fi
+ sleep 1
+ R screen.screenshot '{}' > $dir/shot.rpc.json || true
+ $jq -r '.result.data' $dir/shot.rpc.json | base64 -d > $dir/shot.jpg 2>/dev/null || true
+ lit=$($root/tools/sim.zsh lit $dir/shot.jpg 2>/dev/null || print unknown)
+ $jq -n --arg posture "$plabel" --arg lit "$lit" --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
+ --argjson pose "$(R display.pose '{}' | $jq -c '.result // .')" \
+ --argjson orient "$(R display.orientation '{}' | $jq -c '.result // .')" \
+ --argjson screen "$(R device.screen '{}' | $jq -c '.result // .')" \
+ --argjson shot "$($jq -c '.result | {width, height, coordinate_scale}' $dir/shot.rpc.json)" \
+ --argjson sb "$(sbpid)" \
+ '{posture: $posture, date: $date, display_pose: $pose, display_orientation: $orient, device_screen: $screen, screenshot: ($shot + {lit: $lit}), springboard_pid: $sb}' > $dir/rpc.json
+ rm -f $dir/shot.rpc.json
+ $jq -c '{pose: .display_pose, deg: .display_orientation.degrees, shot: .screenshot, sb: .springboard_pid}' $dir/rpc.json
+ : > $dir/records.jsonl
+ for pp in "$@"; do
+ proc=${pp%%:*}; probe=${pp#*:}
+ file=$here/vm-$probe.lldb; [[ -e $file ]] || file=$here/$probe.lldb
+ before=$(sbpid)
+ PROBE_TIMEOUT=${PROBE_TIMEOUT:-240} $root/tools/vm-probe.zsh $vm $proc $file $dir/$proc-$probe.txt 2>>$dir/probe-stderr.txt || print -u2 "vm-run: $label $proc $probe rc $?"
+ after=$(sbpid)
+ if [[ $before != $after ]]; then
+ print -u2 "vm-run: $label: SpringBoard pid changed $before -> $after during $proc:$probe"
+ print "$proc:$probe $before -> $after" >> $dir/springboard-restarts.txt
+ fi
+ grep -E '^\{"(records|orientation|group)"' $dir/$proc-$probe.txt | $jq -c --arg proc $proc --arg probe $probe --arg posture "$plabel" '
+ def orient: {"0": "unknown", "1": "portrait", "2": "portraitUpsideDown", "3": "landscapeLeft", "4": "landscapeRight"}[tostring] // "unknown";
+ . as $g | .records[] | {api, kind, process: $proc, posture: $posture,
+ orientation: (($g.orientation // 0) | orient), call, value, error, probe: $probe}
+ + (if $g.group then {group: $g.group} else {} end)' >> $dir/records.jsonl 2>/dev/null \
+ || print -u2 "vm-run: $label: no JSON from $proc:$probe ($(grep -m3 -E 'error|EXC_' $dir/$proc-$probe.txt | tr '\n' ' ' | cut -c1-300))"
+ print -u2 "vm-run: $label $proc:$probe -> $(grep -c "\"probe\":\"$probe\"" $dir/records.jsonl) records"
+ done ;;
+ *) sed -n '2,11p' ${0:a} | sed 's/^# \{0,1\}//'; exit 2 ;;
+esac
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-backboardd.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-backboardd.lldb
new file mode 100644
index 00000000..5da5ec32
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-backboardd.lldb
@@ -0,0 +1,64 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSObject *vpSys = (NSObject *)((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKHIDSystem"), @selector(sharedInstance));
+vpAdd(@"BKHIDSystem.sharedInstance", @"private", @"+[BKHIDSystem sharedInstance] class", vpSys ? NSStringFromClass(object_getClass(vpSys)) : nil, vpSys ? nil : @"nil");
+NSArray *vpSvcs = vpSys ? (NSArray *)((id (*)(id, SEL, id))vpMsg)(vpSys, @selector(IOHIDServicesMatching:), nil) : nil;
+vpAdd(@"BKHIDSystem.IOHIDServicesMatching:.count", @"private", @"[[BKHIDSystem sharedInstance] IOHIDServicesMatching:nil].count", vpSvcs ? @(vpSvcs.count) : nil, vpSvcs ? nil : @"nil");
+id (*vpCopyProp)(void *, CFStringRef) = (id (*)(void *, CFStringRef))dlsym(RTLD_DEFAULT, "IOHIDServiceCopyProperty");
+uint64_t (*vpRegID)(void *) = (uint64_t (*)(void *))dlsym(RTLD_DEFAULT, "IOHIDServiceGetRegistryID");
+void *(*vpCopyEvent)(void *, int, void *, int) = NULL; /* VM: not called, see vm-notes.md */
+NSArray *vpKeys = @[@"PrimaryUsagePage", @"PrimaryUsage", @"DeviceUsagePairs", @"Product", @"Manufacturer", @"Transport", @"Built-In", @"VendorID", @"ProductID", @"LocationID", @"IOClass", @"HIDServiceSupport", @"SimulatorHIDServiceIdentifier", @"SimulatorDisplayUID", @"DisplayIntegrated", @"SensorPropertySupported", @"ReportInterval", @"BatchInterval", @"SerialNumber", @"Hidden", @"HIDVirtualDevice", @"VirtualDevice", @"CreatorPID", @"DeviceOpenedByEventSystem", @"HIDEventServiceProperties", @"SensorProperties", @"CountryCode", @"VersionNumber", @"DeviceTypeHint"];
+NSMutableArray *vpList = [NSMutableArray array];
+NSMutableArray *vpHinge = [NSMutableArray array];
+for (id vpS in vpSvcs) {
+ void *vpRef = (__bridge void *)vpS;
+ NSMutableDictionary *vpD = [NSMutableDictionary dictionary];
+ vpD[@"registryID"] = vpRegID ? @(vpRegID(vpRef)) : [NSNull null];
+ vpD[@"class"] = NSStringFromClass(object_getClass(vpS));
+ for (NSString *vpK in vpKeys) { id vpV = vpCopyProp ? vpCopyProp(vpRef, (__bridge CFStringRef)vpK) : nil; if (vpV) vpD[vpK] = vpV; }
+ [vpList addObject:vpD];
+ long long vpUP = [(NSNumber *)vpD[@"PrimaryUsagePage"] longLongValue], vpU = [(NSNumber *)vpD[@"PrimaryUsage"] longLongValue];
+ BOOL vpIsHinge = (vpUP == 0xff0c && vpU == 0x21) || [[(NSObject *)vpD[@"Product"] description].lowercaseString containsString:@"hinge"];
+ for (NSDictionary *vpP in (NSArray *)vpD[@"DeviceUsagePairs"]) if ([(NSNumber *)vpP[@"DeviceUsagePage"] longLongValue] == 0xff0c && [(NSNumber *)vpP[@"DeviceUsage"] longLongValue] == 0x21) vpIsHinge = YES;
+ void *vpEv = vpCopyEvent ? vpCopyEvent(vpRef, 0x2c, NULL, 0) : NULL;
+ void *vpEv1 = (vpCopyEvent && vpUP == 0xff0c) ? vpCopyEvent(vpRef, 1, NULL, 0) : NULL;
+ if (vpIsHinge || vpEv || vpUP == 0xff0c) [vpHinge addObject:@{@"service": vpD, @"isHingeUsage": @(vpIsHinge), @"copyEvent0x2c": vpEv ? [(__bridge NSObject *)vpEv description] : [NSNull null], @"copyEvent0x01": vpEv1 ? [(__bridge NSObject *)vpEv1 description] : [NSNull null]}];
+ if (vpEv) CFRelease(vpEv);
+ if (vpEv1) CFRelease(vpEv1);
+}
+[vpList sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"registryID" ascending:YES]]];
+vpAdd(@"IOHIDService.properties", @"private", @"for each [[BKHIDSystem sharedInstance] IOHIDServicesMatching:nil]: IOHIDServiceGetRegistryID + IOHIDServiceCopyProperty(<keys>)", vpList, nil);
+vpAdd(@"IOHIDService.hingeAngle", @"private", @"services with PrimaryUsagePage 0xff0c / PrimaryUsage 0x21 (CoreMotion CLAngleNotifier's hinge usage, as the VM's Hinge dylib publishes), a 'hinge' product name, or a non-nil IOHIDServiceCopyEvent(svc, kIOHIDEventTypeHingeAngle 0x2c)", vpHinge, nil);
+NSArray *vpHM = vpSys ? (NSArray *)((id (*)(id, SEL, id))vpMsg)(vpSys, @selector(IOHIDServicesMatching:), @{@"PrimaryUsagePage": @0xff0c, @"PrimaryUsage": @0x21}) : nil;
+vpAdd(@"BKHIDSystem.IOHIDServicesMatching:hinge", @"private", @"[[BKHIDSystem sharedInstance] IOHIDServicesMatching:@{PrimaryUsagePage: 0xff0c, PrimaryUsage: 0x21}].count", vpHM ? @(vpHM.count) : nil, vpHM ? nil : @"nil");
+void *vpSysEv = vpSys ? ((void *(*)(id, SEL, unsigned int, void *, unsigned int))vpMsg)(vpSys, @selector(systemEventOfType:matchingEvent:options:), 0x2c, NULL, 0) : NULL;
+vpAdd(@"BKHIDSystem.systemEventOfType:0x2c", @"private", @"[[BKHIDSystem sharedInstance] systemEventOfType:kIOHIDEventTypeHingeAngle(0x2c) matchingEvent:NULL options:0]", vpSysEv ? [(__bridge NSObject *)vpSysEv description] : nil, vpSysEv ? nil : @"NULL");
+NSObject *vpReg = (NSObject *)((id (*)(id, SEL))vpMsg)(NSClassFromString(@"BKHIDEventProcessorRegistry"), @selector(sharedInstance));
+NSDictionary *vpProcs = vpReg ? (NSDictionary *)[vpReg valueForKey:@"_eventProcessorsByClassName"] : nil;
+vpAdd(@"BKHIDEventProcessorRegistry.eventProcessors", @"private", @"[[BKHIDEventProcessorRegistry sharedInstance] valueForKey:@\"_eventProcessorsByClassName\"] allKeys (sorted)", vpProcs ? [[vpProcs allKeys] sortedArrayUsingSelector:@selector(compare:)] : nil, vpProcs ? nil : @"nil");
+NSMutableArray *vpHC = [NSMutableArray array];
+/* VM: objc_copyClassList realizes every class and faults (EXC_BAD_INSTRUCTION, PACIBSPPC) in backboardd; check named candidates instead. The sim list was empty. */
+for (NSString *vpN in @[@"BKHingeAngleEventProcessor", @"BKHIDHingeAngleEventProcessor", @"BKHingeEventProcessor", @"SimHinge", @"HIDHingeService"]) { if (NSClassFromString(vpN)) [vpHC addObject:vpN]; }
+vpAdd(@"backboardd.hingeClasses", @"private", @"objc_copyClassList filtered to BK*/Sim*/HID* names containing 'hinge'", vpHC, nil);
+Class vpVES = NSClassFromString(@"HIDVirtualEventService");
+vpAdd(@"HIDVirtualEventService.class", @"private", @"NSClassFromString(@\"HIDVirtualEventService\")", vpVES ? @"present" : nil, vpVES ? nil : @"class missing");
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSDictionary *vpOut = @{@"group": @"hid", @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-cmtables.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-cmtables.lldb
new file mode 100644
index 00000000..afeff9c8
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-cmtables.lldb
@@ -0,0 +1,63 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+Class vpDSE = NSClassFromString(@"CMDeviceStateEvent");
+Class vpMPE = NSClassFromString(@"CMMagicPoseEvent");
+Class vpMPM = NSClassFromString(@"CMMagicPoseManager");
+NSString *(^vpStr)(Class, SEL, long long) = ^NSString *(Class c, SEL s, long long n) { NSObject *vpV = ((id (*)(id, SEL, long long))vpMsg)(c, s, n); return vpV ? [(NSObject *)vpV description] : @"(nil)"; };
+NSArray *vpStrSels = @[@"stringForDeviceStatePropertyAType:", @"stringForDeviceStatePropertyBType:", @"stringForDeviceStatePropertyCType:", @"stringForDeviceStatePropertyDType:"];
+for (NSString *vpSel in vpStrSels) {
+ NSMutableDictionary *vpT = [NSMutableDictionary dictionary];
+ for (long long vn = -1; vn <= 12; vn++) vpT[[NSString stringWithFormat:@"%lld", vn]] = vpStr(vpDSE, NSSelectorFromString(vpSel), vn);
+ vpAdd([@"CMDeviceStateEvent." stringByAppendingString:vpSel], @"private", [NSString stringWithFormat:@"+[CMDeviceStateEvent %@-1..12]", vpSel], vpT, nil);
+}
+for (NSString *vpSel in @[@"stringForDeviceOrientation:", @"stringForHingeState:", @"stringForTabletopPose:", @"stringForStableOrientationState:"]) {
+ NSMutableDictionary *vpT = [NSMutableDictionary dictionary];
+ for (long long vn = -1; vn <= 12; vn++) vpT[[NSString stringWithFormat:@"%lld", vn]] = vpStr(vpMPE, NSSelectorFromString(vpSel), vn);
+ vpAdd([@"CMMagicPoseEvent." stringByAppendingString:vpSel], @"private", [NSString stringWithFormat:@"+[CMMagicPoseEvent %@-1..12]", vpSel], vpT, nil);
+}
+NSMutableArray *vpPA = [NSMutableArray array];
+for (long long vc = 0; vc <= 4; vc++) for (long long va = 0; va <= 7; va++) for (long long vb = 0; vb <= 6; vb++) for (long long vt = 0; vt <= 11; vt++) {
+ long long vr = ((long long (*)(id, SEL, long long, long long, long long, long long))vpMsg)(vpDSE, @selector(propertyAForConfigType:propertyA:propertyB:propertyC:), vc, va, vb, vt);
+ [vpPA addObject:@[@(vc), @(va), @(vb), @(vt), @(vr)]];
+}
+vpAdd(@"CMDeviceStateEvent.propertyAForConfigType:propertyA:propertyB:propertyC:", @"private", @"+[CMDeviceStateEvent propertyAForConfigType:c propertyA:a propertyB:b propertyC:t] for c 0..4, a 0..7, b 0..6, t 0..11; rows [c, a, b, t, result]", vpPA, nil);
+NSObject *vpShared = ((id (*)(id, SEL))vpMsg)(vpMPM, @selector(sharedManager));
+NSMutableArray *vpOM = [NSMutableArray array];
+NSMutableArray *vpMap = [NSMutableArray array];
+for (long long vo = 0; vo <= 7; vo++) for (long long vh = 0; vh <= 6; vh++) for (long long vt = 0; vt <= 11; vt++) {
+ NSObject *vpE = ((id (*)(id, SEL, long long, long long, long long, double, double))vpMsg)(((id (*)(id, SEL))vpMsg)(vpMPE, @selector(alloc)), @selector(initWithDeviceOrientation:hingeState:tabletopPose:timestamp:continuousTimestamp:), vo, vh, vt, 0.0, 0.0);
+ for (long long vs = 0; vs <= 3; vs++) {
+ long long vr = ((long long (*)(id, SEL, id, long long))vpMsg)(vpMPM, @selector(orientationForMagicPose:deviceSurface:), vpE, vs);
+ [vpOM addObject:@[@(vo), @(vh), @(vt), @(vs), @(vr)]];
+ }
+ if (vpShared) {
+ NSObject *vpDS = ((id (*)(id, SEL, id))vpMsg)(vpShared, @selector(createDeviceStateEventFromMagicPoseEvent:), vpE);
+ [vpMap addObject:@[@(vo), @(vh), @(vt),
+ vpDS ? @(((long long (*)(id, SEL))vpMsg)(vpDS, @selector(propertyA))) : [NSNull null],
+ vpDS ? @(((long long (*)(id, SEL))vpMsg)(vpDS, @selector(propertyB))) : [NSNull null],
+ vpDS ? @(((long long (*)(id, SEL))vpMsg)(vpDS, @selector(propertyC))) : [NSNull null],
+ @(((long long (*)(id, SEL))vpMsg)(vpE, @selector(deviceOrientation))), @(((long long (*)(id, SEL))vpMsg)(vpE, @selector(hingeState))), @(((long long (*)(id, SEL))vpMsg)(vpE, @selector(tabletopPose)))]];
+ }
+}
+vpAdd(@"CMMagicPoseManager.orientationForMagicPose:deviceSurface:", @"private", @"+[CMMagicPoseManager orientationForMagicPose:[[CMMagicPoseEvent alloc] initWithDeviceOrientation:o hingeState:h tabletopPose:t timestamp:0 continuousTimestamp:0] deviceSurface:s] for o 0..7, h 0..6, t 0..11, s 0..3; rows [o, h, t, s, result]", vpOM, nil);
+vpAdd(@"CMMagicPoseManager.createDeviceStateEventFromMagicPoseEvent:", @"private", @"-[[CMMagicPoseManager sharedManager] createDeviceStateEventFromMagicPoseEvent:<o,h,t>] for o 0..7, h 0..6, t 0..11; rows [o, h, t, event.propertyA, event.propertyB, event.propertyC, pose.deviceOrientation, pose.hingeState, pose.tabletopPose]", vpShared ? vpMap : nil, vpShared ? nil : @"sharedManager nil");
+NSDictionary *vpOut = @{@"group": @"cmtables", @"records": vpRecs};
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-coremotion.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-coremotion.lldb
new file mode 100644
index 00000000..fb4609db
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-coremotion.lldb
@@ -0,0 +1,120 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSObject *vpApp = ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"UIApplication"), @selector(sharedApplication));
+long vpOrient = 0;
+if ([vpApp respondsToSelector:NSSelectorFromString(@"devicePoseProvider")]) {
+ vpOrient = ((long (*)(id, SEL))vpMsg)([(NSObject *)[(NSObject *)[vpApp valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"] valueForKey:@"primaryWindowScene"], @selector(interfaceOrientation));
+} else if (vpApp) {
+ for (NSObject *vpS in (NSSet *)[vpApp valueForKey:@"connectedScenes"]) if ([vpS respondsToSelector:@selector(interfaceOrientation)]) { vpOrient = ((long (*)(id, SEL))vpMsg)(vpS, @selector(interfaceOrientation)); break; }
+}
+NSObject *(^vpIv)(NSObject *, NSString *) = ^NSObject *(NSObject *o, NSString *name) {
+ if (!o) return (NSObject *)nil;
+ Ivar vpX = class_getInstanceVariable(object_getClass(o), name.UTF8String);
+ if (!vpX) return (NSObject *)@"<no such ivar>";
+ const char *vpT = ivar_getTypeEncoding(vpX);
+ char *vpB = (char *)(__bridge void *)o + ivar_getOffset(vpX);
+ switch (vpT[0]) {
+ case 'q': return (NSObject *)@(*(long long *)vpB);
+ case 'd': return (NSObject *)@(*(double *)vpB);
+ case 'f': return (NSObject *)@(*(float *)vpB);
+ case 'B': return (NSObject *)@(*(BOOL *)vpB);
+ case 'i': return (NSObject *)@(*(int *)vpB);
+ case '@': if (vpT[1] == '?') return (NSObject *)@(*(void **)vpB != NULL); return (NSObject *)object_getIvar(o, vpX);
+ default: return (NSObject *)[NSString stringWithFormat:@"<unsupported ivar type %s>", vpT];
+ }
+};
+NSDictionary *(^vpEvt)(NSObject *) = ^NSDictionary *(NSObject *e) {
+ if (!e) return (NSDictionary *)nil;
+ return @{@"class": NSStringFromClass(object_getClass(e)),
+ @"propertyA": @(((long long (*)(id, SEL))vpMsg)(e, @selector(propertyA))), @"propertyA0": @(((long long (*)(id, SEL))vpMsg)(e, @selector(propertyA0))),
+ @"propertyA1": @(((long long (*)(id, SEL))vpMsg)(e, @selector(propertyA1))), @"propertyB": @(((long long (*)(id, SEL))vpMsg)(e, @selector(propertyB))),
+ @"propertyC": @(((long long (*)(id, SEL))vpMsg)(e, @selector(propertyC))), @"propertyD": @(((long long (*)(id, SEL))vpMsg)(e, @selector(propertyD))),
+ @"progressValid": @(((BOOL (*)(id, SEL))vpMsg)(e, @selector(progressValid))), @"fromPropertyB": @(((long long (*)(id, SEL))vpMsg)(e, @selector(fromPropertyB))),
+ @"toPropertyB": @(((long long (*)(id, SEL))vpMsg)(e, @selector(toPropertyB))), @"progressValue": @(((double (*)(id, SEL))vpMsg)(e, @selector(progressValue))),
+ @"timestamp": @(((double (*)(id, SEL))vpMsg)(e, @selector(timestamp))), @"description": [(NSObject *)e description] ?: @""};
+};
+NSDictionary *(^vpDSM)(NSObject *) = ^NSDictionary *(NSObject *m) {
+ if (!m) return (NSDictionary *)nil;
+ NSObject *vpI = vpIv(m, @"_internal");
+ if (!vpI) return @{@"class": NSStringFromClass(object_getClass(m)), @"_internal": [NSNull null]};
+ NSMutableDictionary *vpR = [NSMutableDictionary dictionaryWithDictionary:@{@"class": NSStringFromClass(object_getClass(m)), @"internalClass": NSStringFromClass(object_getClass(vpI))}];
+ for (NSString *vpK in @[@"fPropertyA", @"fPropertyA0", @"fPropertyA1", @"fPropertyB", @"fPropertyC", @"fPropertyD", @"fContinuousTimestamp", @"fAPArrivalTimestampSecs", @"fTimestamp", @"fNotifyAllClients", @"fRegisteredForNotifications", @"fClientID"]) {
+ NSObject *vpV = vpIv(vpI, vpK);
+ vpR[vpK] = vpV ?: [NSNull null];
+ }
+ vpR[@"fEventHandlerSet"] = vpIv(vpI, @"fEventHandler");
+ return vpR;
+};
+Class vpMPM = NSClassFromString(@"CMMagicPoseManager");
+Class vpDSMC = NSClassFromString(@"CMDeviceStateManager");
+Class vpAMC = NSClassFromString(@"CMAngleManager");
+vpAdd(@"CMMagicPoseManager.isAvailable", @"private", @"+[CMMagicPoseManager isAvailable]", vpMPM ? @(((BOOL (*)(id, SEL))vpMsg)(vpMPM, @selector(isAvailable))) : nil, vpMPM ? nil : @"class missing");
+NSObject *vpShared = vpMPM ? ((id (*)(id, SEL))vpMsg)(vpMPM, @selector(sharedManager)) : nil;
+vpAdd(@"CMMagicPoseManager.sharedManager", @"private", @"+[CMMagicPoseManager sharedManager] class", vpShared ? NSStringFromClass(object_getClass(vpShared)) : nil, vpShared ? nil : @"nil");
+if (vpShared) {
+ vpAdd(@"CMMagicPoseManager.sharedManager._manager", @"private", @"[[CMMagicPoseManager sharedManager] valueForKey:@\"_manager\"] (CMDeviceStateManager and its _internal ivars)", vpDSM(vpIv(vpShared, @"_manager")), nil);
+ vpAdd(@"CMMagicPoseManager.sharedManager.handlers", @"private", @"[[CMMagicPoseManager sharedManager] valueForKey:@\"fClientHandler\"/@\"fInternalHandler\"] != nil",
+ @{@"fClientHandlerSet": vpIv(vpShared, @"fClientHandler") ?: [NSNull null], @"fInternalHandlerSet": vpIv(vpShared, @"fInternalHandler") ?: [NSNull null]}, nil);
+}
+if ([vpApp respondsToSelector:NSSelectorFromString(@"devicePoseProvider")]) {
+ NSObject *vpProv = [vpApp valueForKey:@"_devicePoseProvider"];
+ NSObject *vpPM = [vpProv valueForKey:@"_cmMagicPoseManager"];
+ vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager._manager", @"private", @"[[provider valueForKey:@\"_cmMagicPoseManager\"] valueForKey:@\"_manager\"] (CMDeviceStateManager and its _internal ivars)", vpDSM(vpIv(vpPM, @"_manager")), nil);
+ vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager.handlers", @"private", @"[provider._cmMagicPoseManager valueForKey:@\"fClientHandler\"/@\"fInternalHandler\"] != nil",
+ @{@"fClientHandlerSet": vpIv(vpPM, @"fClientHandler") ?: [NSNull null], @"fInternalHandlerSet": vpIv(vpPM, @"fInternalHandler") ?: [NSNull null]}, nil);
+ NSObject *vpAM = [vpProv valueForKey:@"_cmAngleManager"];
+ vpAdd(@"SBFDevicePoseProvider._cmAngleManager.isAngleActive", @"private", @"[provider._cmAngleManager isAngleActive]", @(((BOOL (*)(id, SEL))vpMsg)(vpAM, @selector(isAngleActive))), nil);
+ vpAdd(@"SBFDevicePoseProvider._cmAngleManager.angleUpdateInterval", @"private", @"[provider._cmAngleManager angleUpdateInterval]", @(((double (*)(id, SEL))vpMsg)(vpAM, @selector(angleUpdateInterval))), nil);
+ NSObject *vpAI = vpIv(vpAM, @"_internal");
+ vpAdd(@"SBFDevicePoseProvider._cmAngleManager._internal", @"private", @"[provider._cmAngleManager valueForKey:@\"_internal\"] (_angleUpdateInterval, fHandler set)",
+ vpAI ? @{@"class": NSStringFromClass(object_getClass(vpAI)), @"_angleUpdateInterval": vpIv(vpAI, @"_angleUpdateInterval") ?: [NSNull null]} : nil, vpAI ? nil : @"nil");
+}
+vpAdd(@"CMDeviceStateManager.isAvailable", @"private", @"+[CMDeviceStateManager isAvailable]", vpDSMC ? @(((BOOL (*)(id, SEL))vpMsg)(vpDSMC, @selector(isAvailable))) : nil, vpDSMC ? nil : @"class missing");
+NSObject *vpDSShared = vpDSMC ? ((id (*)(id, SEL))vpMsg)(vpDSMC, @selector(sharedManager)) : nil;
+vpAdd(@"CMDeviceStateManager.sharedManager", @"private", @"+[CMDeviceStateManager sharedManager] (and its _internal ivars)", vpDSM(vpDSShared), vpDSShared ? nil : @"nil");
+if (vpDSShared) {
+ NSObject *vpCur = ((id (*)(id, SEL))vpMsg)(vpDSShared, @selector(currentDeviceState));
+ vpAdd(@"CMDeviceStateManager.currentDeviceState", @"private", @"-[[CMDeviceStateManager sharedManager] currentDeviceState]", vpEvt(vpCur), vpCur ? nil : @"nil");
+ if (vpCur) {
+ NSMutableDictionary *vpPA = [NSMutableDictionary dictionary];
+ for (long long vc = 0; vc <= 4; vc++) vpPA[[NSString stringWithFormat:@"%lld", vc]] = @(((long long (*)(id, SEL, id, long long))vpMsg)(vpDSMC, @selector(propertyAForDeviceState:configType:), vpCur, vc));
+ vpAdd(@"CMDeviceStateManager.propertyAForDeviceState:configType:", @"private", @"+[CMDeviceStateManager propertyAForDeviceState:<currentDeviceState> configType:0..4]", vpPA, nil);
+ }
+}
+vpAdd(@"CMAngleManager.isAvailable", @"private", @"+[CMAngleManager isAvailable]", vpAMC ? @(((BOOL (*)(id, SEL))vpMsg)(vpAMC, @selector(isAvailable))) : nil, vpAMC ? nil : @"class missing");
+if (vpAMC) {
+ vpAdd(@"CMAngleManager.minAngleDegrees", @"private", @"+[CMAngleManager minAngleDegrees]", @(((float (*)(id, SEL))vpMsg)(vpAMC, @selector(minAngleDegrees))), nil);
+ vpAdd(@"CMAngleManager.maxAngleDegrees", @"private", @"+[CMAngleManager maxAngleDegrees]", @(((float (*)(id, SEL))vpMsg)(vpAMC, @selector(maxAngleDegrees))), nil);
+ vpAdd(@"CMAngleManager.shouldEmitWakeLatencySignpostsOnStateChangeForTesting", @"private", @"+[CMAngleManager shouldEmitWakeLatencySignpostsOnStateChangeForTesting]", nil, @"VM: EXC_BAD_ACCESS at 0x4c in SpringBoard; not called");
+ NSObject *vpAMNew = nil; /* VM: a fresh CMAngleManager blocked SpringBoard until lldb stopped the expression (SIGSTOP); not created */
+ vpAdd(@"CMAngleManager.isAngleActive", @"private", @"[[CMAngleManager alloc] init].isAngleActive (fresh instance, no updates started)", @(((BOOL (*)(id, SEL))vpMsg)(vpAMNew, @selector(isAngleActive))), nil);
+ vpAdd(@"CMAngleManager.angleUpdateInterval", @"private", @"[[CMAngleManager alloc] init].angleUpdateInterval (fresh instance)", @(((double (*)(id, SEL))vpMsg)(vpAMNew, @selector(angleUpdateInterval))), nil);
+}
+Class vpFAM = NSClassFromString(@"CMFactoryAngleManager");
+vpAdd(@"CMFactoryAngleManager.isAvailable", @"private", @"+[CMFactoryAngleManager isAvailable]", nil, vpFAM ? @"not called: raised SIGABRT in SpringBoard when probed (raw/sensors/test/bisect.txt)" : @"class missing");
+Class vpMMC = NSClassFromString(@"CMMotionManager");
+NSObject *vpMM = vpMMC ? ((id (*)(id, SEL))vpMsg)(((id (*)(id, SEL))vpMsg)(vpMMC, @selector(alloc)), @selector(init)) : nil;
+for (NSString *vpK in @[@"isAccelerometerAvailable", @"isGyroAvailable", @"isMagnetometerAvailable", @"isDeviceMotionAvailable"]) {
+ vpAdd([@"CMMotionManager." stringByAppendingString:vpK], @"public", [NSString stringWithFormat:@"[[CMMotionManager alloc] init].%@", vpK], vpMM ? @(((BOOL (*)(id, SEL))vpMsg)(vpMM, NSSelectorFromString(vpK))) : nil, vpMM ? nil : @"nil");
+}
+vpAdd(@"CMMotionManager.availableAttitudeReferenceFrames", @"public", @"+[CMMotionManager availableAttitudeReferenceFrames]", vpMMC ? @(((unsigned long (*)(id, SEL))vpMsg)(vpMMC, @selector(availableAttitudeReferenceFrames))) : nil, nil);
+NSDictionary *vpOut = @{@"group": @"coremotion", @"orientation": @(vpOrient), @"records": vpRecs};
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-springboard.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-springboard.lldb
new file mode 100644
index 00000000..ca0648b2
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-springboard.lldb
@@ -0,0 +1,137 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSString *(^vpD)(id) = ^NSString *(id o) { return o ? [(NSObject *)o description] : (NSString *)nil; };
+NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"];
+long vpOrient = ((UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"]).interfaceOrientation;
+struct VPRegion { double start; double end; BOOL isActive; BOOL canBecomeActive; };
+struct VPHinge { BOOL isAvailable; double position; long long state; struct VPRegion fullyClosed, closed, partiallyOpen, openFlat, foldAvoidance, toOpen, toClosed; BOOL isTransitioning; double transitionProgress, progressToSwap, progressFromSwap, continuousFoldPosition, velocity, acceleration; };
+struct VPUIHinge { BOOL isAvailable; long long status; long long magicPose; double hingeAngle; long long nextStatus; double progress; double timestamp; };
+struct VPCMAngle { float minAngleDegrees, maxAngleDegrees, angleDegrees, velocityDegreesPerSeconds; BOOL isAvailable; double timestamp; };
+struct VPCMMagic { long long deviceOrientation, deviceOrientationForCover, deviceOrientationForInner, tabletopPose, hingeState; BOOL progressValid; long long fromHingeState, toHingeState; double progressValue; BOOL isAvailable; double timestamp; };
+struct VPFlip { BOOL isAvailable, showYoinkingAffordance; };
+struct VPSettings { BOOL showDebugHUD, showDisplaySupport3Required, usesStrictCoreMotion, invertHingeAngles, continuousFoldEnabled; double closedToPartiallyOpenBoundary, partiallyOpenToOpenFlatBoundary, openTransitionBeginBoundary, closeTransitionBeginBoundary, transitionAutoCompleteDuration, velocitySmoothingFactor, enterFoldAvoidancePredictionWindow, sustainFoldAvoidancePredictionWindow; };
+struct VPInternal { BOOL isInitialized, forceStrictCoreMotion, invertHingeAngles, isOnVM, isDisplaySupport3Set, hingeRegionsAreDefault, needsTransitionAutocompletion; double transitionAutocompletionProgress, autocompleteStartTime, timestampOfLastTransitionProgressChange, transitionProgressWhenAutocompletionBegan, transitionSwapProgressWhenAutocompletionBegan, hingePositionWhenAutocompletionBegan; };
+struct VPDisplayTool { long long state; double duration; long long deviceOrientation, profileOverride; BOOL waitForCompletion; long long targetMode; double targetHingePosition, lockedForTestingUntil; };
+struct VPPose { long long orientation, coverOrientation, innerOrientation; struct VPHinge hinge; struct VPUIHinge uiHingeStatus; struct VPCMAngle cmAngle; struct VPCMMagic cmMagicPose; struct VPFlip flipState; struct VPSettings settings; struct VPInternal internal; struct VPDisplayTool displayTool; };
+struct VPBox { struct VPPose devicePose; double mechanicalAngleDegrees, autocompletionMinDelay, autocompletionMaxDelay, likelyToOpenVelocityDegreesPerSecond, swapDegreesForContinuousLiveStyle, swapDegreesForContinuousSnapshotStyleWhenOpening, swapDegreesForContinuousSnapshotStyleWhenClosing, swapDegreesForFadeInFadeOutStyle; long long transitionStyle; double autocompletionDelay, continuousFoldEffectProgress, continuousFoldEffectSettlingTarget; BOOL continuousFoldEffectIsSettling; };
+NSDictionary *(^vpRegion)(struct VPRegion) = ^NSDictionary *(struct VPRegion r) { return @{@"start": @(r.start), @"end": @(r.end), @"isActive": @(r.isActive), @"canBecomeActive": @(r.canBecomeActive)}; };
+NSDictionary *(^vpPoseDict)(struct VPPose) = ^NSDictionary *(struct VPPose p) {
+ return @{
+ @"orientation": @(p.orientation), @"coverOrientation": @(p.coverOrientation), @"innerOrientation": @(p.innerOrientation),
+ @"hinge": @{@"isAvailable": @(p.hinge.isAvailable), @"position": @(p.hinge.position), @"state": @(p.hinge.state),
+ @"fullyClosedRegion": vpRegion(p.hinge.fullyClosed), @"closedRegion": vpRegion(p.hinge.closed), @"partiallyOpenRegion": vpRegion(p.hinge.partiallyOpen),
+ @"openFlatRegion": vpRegion(p.hinge.openFlat), @"activateFoldAvoidanceRegion": vpRegion(p.hinge.foldAvoidance),
+ @"transitionToOpenRegion": vpRegion(p.hinge.toOpen), @"transitionToClosedRegion": vpRegion(p.hinge.toClosed),
+ @"isTransitioning": @(p.hinge.isTransitioning), @"transitionProgress": @(p.hinge.transitionProgress), @"progressToSwap": @(p.hinge.progressToSwap),
+ @"progressFromSwap": @(p.hinge.progressFromSwap), @"continuousFoldPosition": @(p.hinge.continuousFoldPosition), @"velocity": @(p.hinge.velocity), @"acceleration": @(p.hinge.acceleration)},
+ @"uiHingeStatus": @{@"isAvailable": @(p.uiHingeStatus.isAvailable), @"status": @(p.uiHingeStatus.status), @"magicPose": @(p.uiHingeStatus.magicPose), @"hingeAngle": @(p.uiHingeStatus.hingeAngle),
+ @"nextStatus": @(p.uiHingeStatus.nextStatus), @"progress": @(p.uiHingeStatus.progress), @"timestamp": @(p.uiHingeStatus.timestamp)},
+ @"cmAngle": @{@"minAngleDegrees": @(p.cmAngle.minAngleDegrees), @"maxAngleDegrees": @(p.cmAngle.maxAngleDegrees), @"angleDegrees": @(p.cmAngle.angleDegrees),
+ @"velocityDegreesPerSeconds": @(p.cmAngle.velocityDegreesPerSeconds), @"isAvailable": @(p.cmAngle.isAvailable), @"timestamp": @(p.cmAngle.timestamp)},
+ @"cmMagicPose": @{@"deviceOrientation": @(p.cmMagicPose.deviceOrientation), @"deviceOrientationForCover": @(p.cmMagicPose.deviceOrientationForCover),
+ @"deviceOrientationForInner": @(p.cmMagicPose.deviceOrientationForInner), @"tabletopPose": @(p.cmMagicPose.tabletopPose), @"hingeState": @(p.cmMagicPose.hingeState),
+ @"progressValid": @(p.cmMagicPose.progressValid), @"fromHingeState": @(p.cmMagicPose.fromHingeState), @"toHingeState": @(p.cmMagicPose.toHingeState),
+ @"progressValue": @(p.cmMagicPose.progressValue), @"isAvailable": @(p.cmMagicPose.isAvailable), @"timestamp": @(p.cmMagicPose.timestamp)},
+ @"flipState": @{@"isAvailable": @(p.flipState.isAvailable), @"showYoinkingAffordance": @(p.flipState.showYoinkingAffordance)},
+ @"settings": @{@"showDebugHUD": @(p.settings.showDebugHUD), @"showDisplaySupport3Required": @(p.settings.showDisplaySupport3Required), @"usesStrictCoreMotion": @(p.settings.usesStrictCoreMotion),
+ @"invertHingeAngles": @(p.settings.invertHingeAngles), @"continuousFoldEnabled": @(p.settings.continuousFoldEnabled),
+ @"closedToPartiallyOpenBoundary": @(p.settings.closedToPartiallyOpenBoundary), @"partiallyOpenToOpenFlatBoundary": @(p.settings.partiallyOpenToOpenFlatBoundary),
+ @"openTransitionBeginBoundary": @(p.settings.openTransitionBeginBoundary), @"closeTransitionBeginBoundary": @(p.settings.closeTransitionBeginBoundary),
+ @"transitionAutoCompleteDuration": @(p.settings.transitionAutoCompleteDuration), @"velocitySmoothingFactor": @(p.settings.velocitySmoothingFactor),
+ @"enterFoldAvoidancePredictionWindow": @(p.settings.enterFoldAvoidancePredictionWindow), @"sustainFoldAvoidancePredictionWindow": @(p.settings.sustainFoldAvoidancePredictionWindow)},
+ @"internal": @{@"isInitialized": @(p.internal.isInitialized), @"forceStrictCoreMotion": @(p.internal.forceStrictCoreMotion), @"invertHingeAngles": @(p.internal.invertHingeAngles),
+ @"isOnVM": @(p.internal.isOnVM), @"isDisplaySupport3Set": @(p.internal.isDisplaySupport3Set), @"hingeRegionsAreDefault": @(p.internal.hingeRegionsAreDefault),
+ @"needsTransitionAutocompletion": @(p.internal.needsTransitionAutocompletion), @"transitionAutocompletionProgress": @(p.internal.transitionAutocompletionProgress),
+ @"autocompleteStartTime": @(p.internal.autocompleteStartTime), @"timestampOfLastTransitionProgressChange": @(p.internal.timestampOfLastTransitionProgressChange),
+ @"transitionProgressWhenAutocompletionBegan": @(p.internal.transitionProgressWhenAutocompletionBegan),
+ @"transitionSwapProgressWhenAutocompletionBegan": @(p.internal.transitionSwapProgressWhenAutocompletionBegan), @"hingePositionWhenAutocompletionBegan": @(p.internal.hingePositionWhenAutocompletionBegan)},
+ @"displayTool": @{@"state": @(p.displayTool.state), @"duration": @(p.displayTool.duration), @"deviceOrientation": @(p.displayTool.deviceOrientation), @"profileOverride": @(p.displayTool.profileOverride),
+ @"waitForCompletion": @(p.displayTool.waitForCompletion), @"targetMode": @(p.displayTool.targetMode), @"targetHingePosition": @(p.displayTool.targetHingePosition),
+ @"lockedForTestingUntil": @(p.displayTool.lockedForTestingUntil)}
+ };
+};
+NSObject *vpProv = [[UIApplication sharedApplication] valueForKey:@"_devicePoseProvider"];
+vpAdd(@"SpringBoard.devicePoseProvider", @"private", @"[[UIApplication sharedApplication] devicePoseProvider] class", NSStringFromClass(object_getClass(vpProv)), nil);
+Method vpPoseM = class_getInstanceMethod(object_getClass(vpProv), @selector(currentPose));
+char *vpRet = method_copyReturnType(vpPoseM); NSUInteger vpSize = 0, vpAlign = 0; NSGetSizeAndAlignment(vpRet, &vpSize, &vpAlign); free(vpRet);
+Method vpBoxM = class_getInstanceMethod(object_getClass(vpProv), @selector(currentBox));
+char *vpRet2 = method_copyReturnType(vpBoxM); NSUInteger vpSize2 = 0; NSGetSizeAndAlignment(vpRet2, &vpSize2, &vpAlign); free(vpRet2);
+if (vpSize == sizeof(struct VPPose)) {
+ struct VPPose vpPose = ((struct VPPose (*)(id, SEL))vpMsg)(vpProv, @selector(currentPose));
+ vpAdd(@"SBFDevicePoseProvider.currentPose", @"private", @"-[SBFDevicePoseProvider currentPose] (struct decoded field by field)", vpPoseDict(vpPose), nil);
+} else {
+ vpAdd(@"SBFDevicePoseProvider.currentPose", @"private", @"-[SBFDevicePoseProvider currentPose]", nil, [NSString stringWithFormat:@"struct size mismatch: runtime %lu, probe %lu", (unsigned long)vpSize, sizeof(struct VPPose)]);
+}
+if (vpSize2 == sizeof(struct VPBox)) {
+ struct VPBox vpBox = ((struct VPBox (*)(id, SEL))vpMsg)(vpProv, @selector(currentBox));
+ vpAdd(@"SBFDevicePoseProvider.currentBox", @"private", @"-[SBFDevicePoseProvider currentBox] (fields beyond devicePose)",
+ @{@"mechanicalAngleDegrees": @(vpBox.mechanicalAngleDegrees), @"autocompletionMinDelay": @(vpBox.autocompletionMinDelay), @"autocompletionMaxDelay": @(vpBox.autocompletionMaxDelay),
+ @"likelyToOpenVelocityDegreesPerSecond": @(vpBox.likelyToOpenVelocityDegreesPerSecond), @"swapDegreesForContinuousLiveStyle": @(vpBox.swapDegreesForContinuousLiveStyle),
+ @"swapDegreesForContinuousSnapshotStyleWhenOpening": @(vpBox.swapDegreesForContinuousSnapshotStyleWhenOpening),
+ @"swapDegreesForContinuousSnapshotStyleWhenClosing": @(vpBox.swapDegreesForContinuousSnapshotStyleWhenClosing),
+ @"swapDegreesForFadeInFadeOutStyle": @(vpBox.swapDegreesForFadeInFadeOutStyle), @"transitionStyle": @(vpBox.transitionStyle), @"autocompletionDelay": @(vpBox.autocompletionDelay),
+ @"continuousFoldEffectProgress": @(vpBox.continuousFoldEffectProgress), @"continuousFoldEffectSettlingTarget": @(vpBox.continuousFoldEffectSettlingTarget),
+ @"continuousFoldEffectIsSettling": @(vpBox.continuousFoldEffectIsSettling)}, nil);
+} else {
+ vpAdd(@"SBFDevicePoseProvider.currentBox", @"private", @"-[SBFDevicePoseProvider currentBox]", nil, [NSString stringWithFormat:@"struct size mismatch: runtime %lu, probe %lu", (unsigned long)vpSize2, sizeof(struct VPBox)]);
+}
+vpAdd(@"SBFDevicePoseProvider.description", @"private", @"[(NSObject *)provider description]", vpD(vpProv), nil);
+vpAdd(@"SBFDevicePoseProvider.isContinuousFoldEnabled", @"private", @"-[SBFDevicePoseProvider isContinuousFoldEnabled]", @(((BOOL (*)(id, SEL))vpMsg)(vpProv, @selector(isContinuousFoldEnabled))), nil);
+vpAdd(@"SBFDevicePoseProvider.continuousFoldEffectProgress", @"private", @"-[SBFDevicePoseProvider continuousFoldEffectProgress]", @(((double (*)(id, SEL))vpMsg)(vpProv, @selector(continuousFoldEffectProgress))), nil);
+vpAdd(@"SBFDevicePoseProvider._lastNotificationTimestamp", @"private", @"[provider valueForKey:@\"_lastNotificationTimestamp\"]", [vpProv valueForKey:@"_lastNotificationTimestamp"], nil);
+vpAdd(@"SBFDevicePoseProvider._cmAngleManager", @"private", @"[provider valueForKey:@\"_cmAngleManager\"] class", NSStringFromClass(object_getClass([vpProv valueForKey:@"_cmAngleManager"])), nil);
+vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager", @"private", @"[provider valueForKey:@\"_cmMagicPoseManager\"] class", NSStringFromClass(object_getClass([vpProv valueForKey:@"_cmMagicPoseManager"])), nil);
+vpAdd(@"SBFDevicePoseProvider._cmMagicPoseManager.isSharedManager", @"private", @"[provider valueForKey:@\"_cmMagicPoseManager\"] == [CMMagicPoseManager sharedManager]",
+ @([vpProv valueForKey:@"_cmMagicPoseManager"] == ((id (*)(id, SEL))vpMsg)(NSClassFromString(@"CMMagicPoseManager"), @selector(sharedManager))), nil);
+NSObject *vpAccel = [vpProv valueForKey:@"_accelerometer"];
+vpAdd(@"SBFDevicePoseProvider._accelerometer", @"private", @"[provider valueForKey:@\"_accelerometer\"] class", vpAccel ? NSStringFromClass(object_getClass(vpAccel)) : nil, vpAccel ? nil : @"nil");
+if (vpAccel) {
+ vpAdd(@"BKSAccelerometer.currentDeviceOrientation", @"private", @"[provider._accelerometer currentDeviceOrientation]", @(((long long (*)(id, SEL))vpMsg)(vpAccel, @selector(currentDeviceOrientation))), nil);
+ vpAdd(@"BKSAccelerometer.orientationEventsEnabled", @"private", @"[provider._accelerometer orientationEventsEnabled]", @(((BOOL (*)(id, SEL))vpMsg)(vpAccel, @selector(orientationEventsEnabled))), nil);
+ vpAdd(@"BKSAccelerometer.passiveOrientationEvents", @"private", @"[provider._accelerometer passiveOrientationEvents]", @(((BOOL (*)(id, SEL))vpMsg)(vpAccel, @selector(passiveOrientationEvents))), nil);
+ vpAdd(@"BKSAccelerometer.accelerometerEventsEnabled", @"private", @"[provider._accelerometer accelerometerEventsEnabled]", @(((BOOL (*)(id, SEL))vpMsg)(vpAccel, @selector(accelerometerEventsEnabled))), nil);
+ vpAdd(@"BKSAccelerometer.updateInterval", @"private", @"[provider._accelerometer updateInterval]", @(((double (*)(id, SEL))vpMsg)(vpAccel, @selector(updateInterval))), nil);
+}
+NSObject *vpPT = [vpProv valueForKey:@"_settings"];
+NSMutableDictionary *vpPTD = [NSMutableDictionary dictionary];
+for (NSString *vpK in @[@"continuousFoldTransitionEnabled", @"partiallyOpenToOpenFlatBoundary", @"openTransitionBeginBoundary", @"closeTransitionBeginBoundary", @"transitionAutoCompleteDuration", @"swapDegreesForContinuousLiveStyle", @"swapDegreesForContinuousSnapshotStyleWhenOpening", @"swapDegreesForContinuousSnapshotStyleWhenClosing", @"swapDegreesForFadeInFadeOutStyle", @"autocompleteMinDelay", @"autocompleteMaxDelay", @"displayPrewarmDuration", @"velocitySmoothingFactor", @"likelyToOpenVelocityDegreesPerSecond", @"enterFoldAvoidancePredictionWindow", @"sustainFoldAvoidancePredictionWindow"]) {
+ vpPTD[vpK] = [vpPT valueForKey:vpK] ?: [NSNull null];
+}
+vpAdd(@"SBFDevicePosePTSettings", @"private", @"[provider valueForKey:@\"_settings\"] valueForKey:<each property>", vpPTD, nil);
+Class vpDefC = NSClassFromString(@"SBFDevicePoseDefaults");
+NSObject *vpDef = vpDefC ? ((id (*)(id, SEL))vpMsg)(((id (*)(id, SEL))vpMsg)(vpDefC, @selector(alloc)), @selector(init)) : nil;
+vpAdd(@"SBFDevicePoseDefaults.lastKnownCMAngleDictionary", @"private", @"[[SBFDevicePoseDefaults alloc] init].lastKnownCMAngleDictionary", [vpDef valueForKey:@"lastKnownCMAngleDictionary"], vpDef ? nil : @"SBFDevicePoseDefaults missing");
+vpAdd(@"SBFDevicePoseDefaults.lastKnownCMMagicPoseDictionary", @"private", @"[[SBFDevicePoseDefaults alloc] init].lastKnownCMMagicPoseDictionary", [vpDef valueForKey:@"lastKnownCMMagicPoseDictionary"], vpDef ? nil : @"SBFDevicePoseDefaults missing");
+NSMutableArray *vpObs = [NSMutableArray array];
+for (id vpO in [(NSHashTable *)[vpProv valueForKey:@"_observers"] allObjects]) [vpObs addObject:NSStringFromClass(object_getClass(vpO))];
+[vpObs sortUsingSelector:@selector(compare:)];
+vpAdd(@"SBFDevicePoseProvider._observers", @"private", @"[[provider valueForKey:@\"_observers\"] allObjects] (class names, sorted)", vpObs, nil);
+vpAdd(@"SBFDevicePoseProvider.likelyTransitionDelegate", @"private", @"[provider likelyTransitionDelegate] class", NSStringFromClass(object_getClass([vpProv valueForKey:@"_likelyTransitionDelegate"])), nil);
+UIWindowScene *vpHB = (UIWindowScene *)[vpProv valueForKey:@"_heartbeatSource"];
+vpAdd(@"SBFDevicePoseProvider._heartbeatSource", @"private", @"[provider valueForKey:@\"_heartbeatSource\"].session.persistentIdentifier", vpHB ? vpHB.session.persistentIdentifier : nil, vpHB ? nil : @"nil");
+NSObject *vpCoord = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_swapCoordinator"];
+vpAdd(@"SBDisplayToolServiceCoordinator._devicePoseProvider.isSpringBoardProvider", @"private", @"[coordinator valueForKey:@\"_devicePoseProvider\"] == [SpringBoard devicePoseProvider]", @([vpCoord valueForKey:@"_devicePoseProvider"] == vpProv), nil);
+struct VPHPS { char a; char b; char c; char d; };
+struct VPHPS vpHPS = ((struct VPHPS (*)(id, SEL))vpMsg)([UIApplication sharedApplication], @selector(currentHingePoseStateForTesting));
+vpAdd(@"UIApplication.currentHingePoseStateForTesting", @"private", @"-[UIApplication currentHingePoseStateForTesting] {orientation, magicPoseDeviceOrientation, magicPoseHingeState, magicPoseTabletopPose}",
+ @{@"orientation": @(vpHPS.a), @"magicPoseDeviceOrientation": @(vpHPS.b), @"magicPoseHingeState": @(vpHPS.c), @"magicPoseTabletopPose": @(vpHPS.d)}, nil);
+NSDictionary *vpOut = @{@"group": @"pose", @"orientation": @(vpOrient), @"records": vpRecs};
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-uikit.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-uikit.lldb
new file mode 100644
index 00000000..3af98508
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-sensors-uikit.lldb
@@ -0,0 +1,118 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSObject *vpApp = (NSObject *)[UIApplication sharedApplication];
+long vpOrient = 0;
+BOOL vpIsSB = [vpApp respondsToSelector:NSSelectorFromString(@"devicePoseProvider")];
+if (vpIsSB) vpOrient = ((long (*)(id, SEL))vpMsg)([(NSObject *)[(NSObject *)[vpApp valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"] valueForKey:@"primaryWindowScene"], @selector(interfaceOrientation));
+else for (UIScene *vpS in [UIApplication sharedApplication].connectedScenes) if ([vpS isKindOfClass:[UIWindowScene class]]) { vpOrient = ((UIWindowScene *)vpS).interfaceOrientation; break; }
+NSDictionary *(^vpCall)(NSObject *, SEL) = ^NSDictionary *(NSObject *o, SEL s) {
+ Method vpM = class_getInstanceMethod(object_getClass(o), s);
+ if (!vpM || ![o respondsToSelector:s]) return @{@"error": [NSString stringWithFormat:@"does not respond to %@", NSStringFromSelector(s)]};
+ char vpR[64]; method_getReturnType(vpM, vpR, sizeof(vpR));
+ if (method_getNumberOfArguments(vpM) != 2) return @{@"error": @"takes arguments"};
+ switch (vpR[0]) {
+ case 'q': case 'l': return @{@"value": @(((long long (*)(id, SEL))vpMsg)(o, s))};
+ case 'Q': case 'L': return @{@"value": @(((unsigned long long (*)(id, SEL))vpMsg)(o, s))};
+ case 'i': return @{@"value": @(((int (*)(id, SEL))vpMsg)(o, s))};
+ case 'I': return @{@"value": @(((unsigned int (*)(id, SEL))vpMsg)(o, s))};
+ case 'B': return @{@"value": @(((BOOL (*)(id, SEL))vpMsg)(o, s))};
+ case 'c': case 'C': return @{@"value": @(((char (*)(id, SEL))vpMsg)(o, s))};
+ case 'd': return @{@"value": @(((double (*)(id, SEL))vpMsg)(o, s))};
+ case 'f': return @{@"value": @(((float (*)(id, SEL))vpMsg)(o, s))};
+ case '#': { Class vpC = ((Class (*)(id, SEL))vpMsg)(o, s); return vpC ? @{@"value": NSStringFromClass(vpC)} : @{@"error": @"nil"}; }
+ case '@': { id vpV = ((id (*)(id, SEL))vpMsg)(o, s); return vpV ? @{@"value": vpV} : @{@"error": @"nil"}; }
+ default: return @{@"error": [NSString stringWithFormat:@"unsupported return type %s", vpR]};
+ }
+};
+NSSet *vpDeny = [NSSet setWithArray:@[@"init", @"dealloc", @".cxx_destruct", @"currentDevice", @"sf_serialNumberQRImage", @"sf_serialNumber", @"sf_colorCodedSerialNumber", @"sf_udidString", @"identifierForVendor", @"new", @"alloc", @"class", @"copy", @"mutableCopy", @"_tapticEngine"]];
+UIDevice *vpDev = [UIDevice currentDevice];
+for (int vk = 0; vk < 2; vk++) {
+ Class vpT = vk ? object_getClass([UIDevice class]) : [UIDevice class];
+ NSObject *vpRecv = vk ? (NSObject *)[UIDevice class] : (NSObject *)vpDev;
+ unsigned int vpCount = 0; Method *vpM = class_copyMethodList(vpT, &vpCount);
+ NSMutableArray *vpSels = [NSMutableArray array];
+ for (unsigned int vj = 0; vj < vpCount; vj++) if (method_getNumberOfArguments(vpM[vj]) == 2) [vpSels addObject:NSStringFromSelector(method_getName(vpM[vj]))];
+ free(vpM);
+ [vpSels sortUsingSelector:@selector(compare:)];
+ for (NSString *vpS in vpSels) {
+ if ([vpDeny containsObject:vpS]) { vpAdd([NSString stringWithFormat:@"UIDevice.%@%@", vk ? @"+" : @"", vpS], @"private", [NSString stringWithFormat:@"%@[UIDevice %@%@]", vk ? @"+" : @"-", vk ? @"" : @"currentDevice] ", vpS], nil, @"skipped: serial/identifier, allocator or side effect"); continue; }
+ char vpR[64]; method_getReturnType(class_getInstanceMethod(vpT, NSSelectorFromString(vpS)), vpR, sizeof(vpR));
+ if (vpR[0] == 'v') continue;
+ NSDictionary *vpRes = vpCall(vpRecv, NSSelectorFromString(vpS));
+ BOOL vpPublic = [@[@"name", @"model", @"localizedModel", @"systemName", @"systemVersion", @"orientation", @"userInterfaceIdiom", @"isMultitaskingSupported", @"batteryLevel", @"batteryState", @"isBatteryMonitoringEnabled", @"isProximityMonitoringEnabled", @"proximityState", @"isGeneratingDeviceOrientationNotifications"] containsObject:vpS] && !vk;
+ vpAdd([NSString stringWithFormat:@"UIDevice.%@%@", vk ? @"+" : @"", vpS], vpPublic ? @"public" : @"private", vk ? [NSString stringWithFormat:@"+[UIDevice %@]", vpS] : [NSString stringWithFormat:@"[[UIDevice currentDevice] %@]", vpS], vpRes[@"value"], vpRes[@"error"]);
+ }
+}
+for (NSString *vpS in @[@"hingeState", @"tabletopPose", @"_userInterfaceIdiom", @"_hingeState", @"hingeAngle", @"isFoldable", @"_isFoldable", @"foldState", @"posture", @"_deviceOrientation"]) {
+ NSDictionary *vpRes = vpCall(vpDev, NSSelectorFromString(vpS));
+ vpAdd([@"UIDevice." stringByAppendingString:vpS], @"private", [NSString stringWithFormat:@"[[UIDevice currentDevice] %@] (requested name; checked with respondsToSelector:)", vpS], vpRes[@"value"], vpRes[@"error"]);
+}
+vpAdd(@"UIDevice.currentDeviceOrientationAllowingAmbiguous:", @"private", @"+[UIDevice currentDeviceOrientationAllowingAmbiguous:YES]", @(((long long (*)(id, SEL, BOOL))vpMsg)([UIDevice class], @selector(currentDeviceOrientationAllowingAmbiguous:), YES)), nil);
+struct VPHPS { char a; char b; char c; char d; };
+struct VPHPS vpHPS = ((struct VPHPS (*)(id, SEL))vpMsg)(vpApp, @selector(currentHingePoseStateForTesting));
+vpAdd(@"UIApplication.currentHingePoseStateForTesting", @"private", @"-[UIApplication currentHingePoseStateForTesting] {orientation, magicPoseDeviceOrientation, magicPoseHingeState, magicPoseTabletopPose}",
+ @{@"orientation": @(vpHPS.a), @"magicPoseDeviceOrientation": @(vpHPS.b), @"magicPoseHingeState": @(vpHPS.c), @"magicPoseTabletopPose": @(vpHPS.d)}, nil);
+NSDictionary *(^vpHS)(NSObject *) = ^NSDictionary *(NSObject *h) {
+ if (!h) return (NSDictionary *)nil;
+ NSMutableDictionary *vpR = [NSMutableDictionary dictionaryWithDictionary:@{@"class": NSStringFromClass(object_getClass(h)), @"description": [h description] ?: @""}];
+ for (NSString *vpK in @[@"status", @"magicPose", @"hingeAngle", @"angleDegrees", @"nextStatus", @"progress", @"identifier", @"sceneRegionIdentifier"]) { NSDictionary *vpRes = vpCall(h, NSSelectorFromString(vpK)); if (vpRes[@"value"]) vpR[vpK] = vpRes[@"value"]; }
+ return vpR;
+};
+NSMutableArray *vpScenes = [[[UIApplication sharedApplication].connectedScenes allObjects] mutableCopy];
+for (UIScene *vpS in vpScenes) {
+ NSString *vpPid = vpS.session.persistentIdentifier ?: @"?";
+ NSObject *vpF = ((id (*)(id, SEL))vpMsg)(vpS, @selector(_FBSScene));
+ NSObject *vpSet = vpF ? ((id (*)(id, SEL))vpMsg)(vpF, @selector(settings)) : nil;
+ NSString *vpDisp = vpSet ? ([(NSObject *)vpCall(vpSet, @selector(displayIdentity))[@"value"] description] ?: @"?") : @"?";
+ NSMutableDictionary *vpSD = [NSMutableDictionary dictionary];
+ for (NSString *vpK in @[@"hingeAngle", @"hingeStatus", @"nextHingeStatus", @"nextHingeStatusProgress", @"magicPose", @"interfaceOrientation", @"deviceOrientation", @"ssk_surfaceType", @"pui_deviceOrientation"]) { NSDictionary *vpRes = vpSet ? vpCall(vpSet, NSSelectorFromString(vpK)) : @{@"error": @"no settings"}; vpSD[vpK] = vpRes[@"value"] ?: [@"error: " stringByAppendingString:vpRes[@"error"]]; }
+ NSObject *vpSHS = vpSet ? (NSObject *)vpCall(vpSet, @selector(sceneHingeState))[@"value"] : nil;
+ vpSD[@"sceneHingeState"] = vpHS(vpSHS) ?: (id)[NSNull null];
+ vpSD[@"displayIdentity"] = vpSet ? [(NSObject *)vpCall(vpSet, @selector(displayIdentity))[@"value"] description] ?: @"" : @"";
+ vpAdd(@"FBSSceneSettings.hinge", @"private", [NSString stringWithFormat:@"[<scene %@ on %@>._FBSScene.settings hingeAngle/hingeStatus/nextHingeStatus/nextHingeStatusProgress/magicPose/interfaceOrientation/deviceOrientation/sceneHingeState]", vpPid, vpDisp], vpSD, vpSet ? nil : @"no FBSScene settings");
+ NSObject *vpUH = vpF ? (NSObject *)vpCall(vpF, @selector(ui_hingeState))[@"value"] : nil;
+ vpAdd(@"FBSScene.ui_hingeState", @"private", [NSString stringWithFormat:@"[<scene %@ on %@>._FBSScene ui_hingeState]", vpPid, vpDisp], vpHS(vpUH), vpUH ? nil : @"nil");
+ NSObject *vpComp = vpF ? (NSObject *)vpCall(vpF, @selector(ui_hingeStateClientComponent))[@"value"] : nil;
+ NSObject *vpCHS = vpComp ? (NSObject *)vpCall(vpComp, @selector(hingeState))[@"value"] : nil;
+ NSObject *vpCSHS = vpComp ? (NSObject *)vpCall(vpComp, @selector(sceneHingeState))[@"value"] : nil;
+ vpAdd(@"_UISceneHingeStateClientComponent.hingeState", @"private", [NSString stringWithFormat:@"[[<scene %@ on %@>._FBSScene ui_hingeStateClientComponent] hingeState]", vpPid, vpDisp], vpComp ? (vpHS(vpCHS) ?: (id)[NSNull null]) : nil, vpComp ? (vpCHS ? nil : @"nil") : @"no client component");
+ vpAdd(@"_UISceneHingeStateClientComponent.sceneHingeState", @"private", [NSString stringWithFormat:@"[[<scene %@ on %@>._FBSScene ui_hingeStateClientComponent] sceneHingeState]", vpPid, vpDisp], vpComp ? (vpHS(vpCSHS) ?: (id)[NSNull null]) : nil, vpComp ? (vpCSHS ? nil : @"nil") : @"no client component");
+ if ([vpS isKindOfClass:[UIWindowScene class]]) {
+ UIWindowScene *vpWS = (UIWindowScene *)vpS;
+ vpAdd(@"UIWindowScene.interfaceOrientation", @"public", [NSString stringWithFormat:@"[<scene %@ on %@> interfaceOrientation]", vpPid, vpDisp], @(vpWS.interfaceOrientation), nil);
+ vpAdd(@"UIWindowScene.traitCollection.horizontalSizeClass", @"public", [NSString stringWithFormat:@"[<scene %@ on %@> traitCollection].horizontalSizeClass/verticalSizeClass/userInterfaceIdiom", vpPid, vpDisp], @{@"horizontalSizeClass": @(vpWS.traitCollection.horizontalSizeClass), @"verticalSizeClass": @(vpWS.traitCollection.verticalSizeClass), @"userInterfaceIdiom": @(vpWS.traitCollection.userInterfaceIdiom)}, nil);
+ }
+}
+if (vpIsSB) {
+ NSObject *vpW = [(NSObject *)((id (*)(id, SEL))vpMsg)(NSClassFromString(@"FBSceneManager"), @selector(sharedInstance)) valueForKey:@"_workspace"];
+ NSMutableArray *vpAll = [NSMutableArray array];
+ for (NSObject *vpF in (NSArray *)[[(NSObject *)((id (*)(id, SEL))vpMsg)(vpW, @selector(allScenes)) valueForKey:@"self"] allObjects]) {
+ NSObject *vpSet = ((id (*)(id, SEL))vpMsg)(vpF, @selector(settings));
+ NSMutableDictionary *vpSD = [NSMutableDictionary dictionaryWithDictionary:@{@"identifier": [(NSObject *)[vpF valueForKey:@"identifier"] description] ?: @""}];
+ for (NSString *vpK in @[@"hingeAngle", @"hingeStatus", @"nextHingeStatus", @"nextHingeStatusProgress", @"magicPose", @"interfaceOrientation", @"deviceOrientation"]) { NSDictionary *vpRes = vpCall(vpSet, NSSelectorFromString(vpK)); vpSD[vpK] = vpRes[@"value"] ?: [@"error: " stringByAppendingString:vpRes[@"error"]]; }
+ vpSD[@"displayIdentity"] = [(NSObject *)vpCall(vpSet, @selector(displayIdentity))[@"value"] description] ?: @"";
+ [vpAll addObject:vpSD];
+ }
+ [vpAll sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"identifier" ascending:YES]]];
+ vpAdd(@"FBSceneWorkspace.allScenes.settings.hinge", @"private", @"[[FBSceneManager sharedInstance]._workspace allScenes] -> each FBScene.settings hinge fields (host side, what SpringBoard sends to clients)", vpAll, nil);
+}
+__block id (^vpSan)(id) = nil;
+vpSan = ^id(id o) {
+ if (!o) return [NSNull null];
+ if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
+ if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
+ if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
+ if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
+ if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
+ if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
+ return [(NSObject *)o description] ?: @"";
+};
+NSDictionary *vpOut = @{@"group": @"uikit", @"orientation": @(vpOrient), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-smoke-springboard.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-smoke-springboard.lldb
new file mode 100644
index 00000000..32c9a6c5
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-smoke-springboard.lldb
@@ -0,0 +1,52 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) {
+ return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)};
+};
+NSArray *vpScreens = [UIScreen screens];
+vpAdd(@"UIScreen.screens", @"public", @"[UIScreen screens].count", @(vpScreens.count), nil);
+for (NSUInteger vi = 0; vi < vpScreens.count; vi++) {
+ UIScreen *vpS = vpScreens[vi];
+ NSString *vpCall = [NSString stringWithFormat:@"[UIScreen screens][%lu]", (unsigned long)vi];
+ vpAdd(@"UIScreen.bounds", @"public", [vpCall stringByAppendingString:@".bounds"], vpRect(vpS.bounds), nil);
+ vpAdd(@"UIScreen.nativeBounds", @"public", [vpCall stringByAppendingString:@".nativeBounds"], vpRect(vpS.nativeBounds), nil);
+ vpAdd(@"UIScreen.scale", @"public", [vpCall stringByAppendingString:@".scale"], @(vpS.scale), nil);
+ vpAdd(@"UIScreen.nativeScale", @"public", [vpCall stringByAppendingString:@".nativeScale"], @(vpS.nativeScale), nil);
+ vpAdd(@"UIScreen.isMainScreen", @"public", [vpCall stringByAppendingString:@" == [UIScreen mainScreen]"], @(vpS == [UIScreen mainScreen]), nil);
+ vpAdd(@"UIScreen.displayIdentity", @"private", [vpCall stringByAppendingString:@" valueForKey:@\"displayIdentity\""], [(NSObject *)[vpS valueForKey:@"displayIdentity"] description], nil);
+ if ([vpS respondsToSelector:@selector(_name)]) {
+ vpAdd(@"UIScreen._name", @"private", [vpCall stringByAppendingString:@"._name"], [(NSObject *)[vpS performSelector:@selector(_name)] description], nil);
+ } else {
+ vpAdd(@"UIScreen._name", @"private", [vpCall stringByAppendingString:@"._name"], nil, @"does not respond to _name");
+ }
+}
+NSObject *vpSvc = [[UIApplication sharedApplication] valueForKey:@"_displayToolService"];
+NSObject *vpDCM = [vpSvc valueForKey:@"_displayContentModeCoordinator"];
+NSDictionary *(^vpScene)(UIWindowScene *) = ^NSDictionary *(UIWindowScene *ws) {
+ if (!ws) return (NSDictionary *)nil;
+ return @{@"persistentIdentifier": ws.session.persistentIdentifier ?: @"",
+ @"displayIdentity": [(NSObject *)[ws.screen valueForKey:@"displayIdentity"] description] ?: @"",
+ @"screenBounds": vpRect(ws.screen.bounds),
+ @"interfaceOrientation": @(ws.interfaceOrientation)};
+};
+UIWindowScene *vpPrimary = (UIWindowScene *)[vpDCM valueForKey:@"primaryWindowScene"];
+UIWindowScene *vpActive = (UIWindowScene *)[vpDCM valueForKey:@"activeWindowScene"];
+vpAdd(@"SBDisplayContentModeCoordinator.primaryWindowScene", @"private", @"[SBDisplayContentModeCoordinator primaryWindowScene]", vpScene(vpPrimary), nil);
+vpAdd(@"SBDisplayContentModeCoordinator.activeWindowScene", @"private", @"[SBDisplayContentModeCoordinator activeWindowScene]", vpScene(vpActive), nil);
+for (UIWindowScene *vpWS in (NSArray *)[vpDCM valueForKey:@"_connectedWindowScenes"]) {
+ long vpMode = ((long (*)(id, SEL, id))vpMsg)(vpDCM, @selector(displayContentModeForWindowScene:), vpWS);
+ BOOL vpUser = ((BOOL (*)(id, SEL, id))vpMsg)(vpDCM, @selector(isAppliedDisplayContentModeUserInitiatedForWindowScene:), vpWS);
+ NSString *vpCall = [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<%@>]", vpWS.session.persistentIdentifier];
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", vpCall,
+ @{@"scene": vpScene(vpWS), @"displayContentMode": @(vpMode), @"userInitiated": @(vpUser)}, nil);
+}
+vpAdd(@"SBFDisplayContentModeResolver.description", @"private", @"[[SBDisplayContentModeCoordinator valueForKey:@\"_resolver\"] description]", [(NSObject *)[vpDCM valueForKey:@"_resolver"] description], nil);
+NSDictionary *vpOut = @{@"orientation": @(vpPrimary.interfaceOrientation), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpOut options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-disable-autolock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-disable-autolock.lldb
new file mode 100644
index 00000000..74b00ffd
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-disable-autolock.lldb
@@ -0,0 +1,6 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSObject *vpIdle = [(NSObject *)[UIApplication sharedApplication] valueForKey:@"_idleTimerGlobalCoordinator"];
+NSObject *vpA = (NSObject *)((id (*)(id, SEL, id))vpMsg)(vpIdle, @selector(acquireIdleTimerDisableAssertionForReason:), @"vphone baseline: auto-lock off again");
+[NSString stringWithFormat:@"assertion=%@ disabled=%d timer=%@ dict=%@", [vpA description], ((BOOL (*)(id, SEL))vpMsg)(vpIdle, @selector(isIdleTimerDisabled)), [(NSObject *)((id (*)(id, SEL))vpMsg)(vpIdle, @selector(idleTimer)) description], [(NSObject *)[vpIdle valueForKey:@"_idleTimerDisableAssertions"] description]]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-enable-autolock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-enable-autolock.lldb
new file mode 100644
index 00000000..62448096
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-enable-autolock.lldb
@@ -0,0 +1,11 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSObject *vpIdle = [(NSObject *)[UIApplication sharedApplication] valueForKey:@"_idleTimerGlobalCoordinator"];
+NSDictionary *vpAs = (NSDictionary *)[vpIdle valueForKey:@"_idleTimerDisableAssertions"];
+NSMutableString *vpOut = [NSMutableString stringWithFormat:@"before: disabled=%d timer=%@ assertions=%@\n", ((BOOL (*)(id, SEL))vpMsg)(vpIdle, @selector(isIdleTimerDisabled)), [(NSObject *)((id (*)(id, SEL))vpMsg)(vpIdle, @selector(idleTimer)) description], [vpAs description]];
+for (NSString *vpK in [vpAs allKeys]) { NSObject *vpA = (NSObject *)vpAs[vpK];
+((void (*)(id, SEL))vpMsg)(vpA, @selector(invalidate)); }
+((void (*)(id, SEL, id))vpMsg)(vpIdle, @selector(resetIdleTimerForReason:), @"vphone baseline: auto-lock test");
+[vpOut appendFormat:@"after: disabled=%d timer=%@ assertions=%@", ((BOOL (*)(id, SEL))vpMsg)(vpIdle, @selector(isIdleTimerDisabled)), [(NSObject *)((id (*)(id, SEL))vpMsg)(vpIdle, @selector(idleTimer)) description], [(NSObject *)[vpIdle valueForKey:@"_idleTimerDisableAssertions"] description]];
+vpOut
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-state.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-state.lldb
new file mode 100644
index 00000000..752ea5d3
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-springboard-state.lldb
@@ -0,0 +1,374 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSMutableArray *vpRecs = [NSMutableArray array];
+NSArray *vpSkip = @[@"SBWindowScene.liftToWakeController"];
+NSString *(^vpLabel)(NSObject *) = ^NSString *(NSObject *vs) {
+ if (!vs || ![vs isKindOfClass:NSClassFromString(@"SBWindowScene")]) return (NSString *)nil;
+ long long vst = ((long long (*)(id, SEL))vpMsg)(vs, @selector(surfaceType));
+ NSString *vsid = [[(UIScene *)vs session] persistentIdentifier] ?: @"?";
+ NSString *vsurf = vst == 1 ? @"cover" : (vst == 2 ? @"inner" : [NSString stringWithFormat:@"surface%lld", vst]);
+ return [NSString stringWithFormat:@"%@:%@", vsurf, vsid];
+};
+NSDictionary *(^vpRect)(CGRect) = ^NSDictionary *(CGRect r) {
+ return @{@"x": @(r.origin.x), @"y": @(r.origin.y), @"width": @(r.size.width), @"height": @(r.size.height)};
+};
+id (^vpJ)(NSObject *) = ^id(NSObject *vo) {
+ if (!vo) return (id)[NSNull null];
+ if ([vo isKindOfClass:[NSString class]] || [vo isKindOfClass:[NSNumber class]] || [vo isKindOfClass:[NSNull class]]) return (id)vo;
+ if ([vo isKindOfClass:NSClassFromString(@"SBWindowScene")]) return (id)vpLabel(vo);
+ if ([vo isKindOfClass:[NSValue class]]) {
+ NSString *vt = [NSString stringWithUTF8String:[(NSValue *)vo objCType]];
+ if ([vt hasPrefix:@"{CGRect="]) return (id)vpRect([(NSValue *)vo CGRectValue]);
+ if ([vt hasPrefix:@"{CGSize="]) { CGSize vz = [(NSValue *)vo CGSizeValue]; return (id)@{@"width": @(vz.width), @"height": @(vz.height)}; }
+ if ([vt hasPrefix:@"{CGPoint="]) { CGPoint vp = [(NSValue *)vo CGPointValue]; return (id)@{@"x": @(vp.x), @"y": @(vp.y)}; }
+ }
+ return (id)[vo description];
+};
+id (^vpBox)(NSString *, void *) = ^id(NSString *vt, void *vb) {
+ while (vt.length && [@"rnNoORVA" containsString:[vt substringToIndex:1]]) vt = [vt substringFromIndex:1];
+ unichar vc = vt.length ? [vt characterAtIndex:0] : 'v';
+ switch (vc) {
+ case 'B': return (id)(*(BOOL *)vb ? @YES : @NO);
+ case 'c': return (id)@(*(signed char *)vb);
+ case 'C': return (id)@(*(unsigned char *)vb);
+ case 's': return (id)@(*(short *)vb);
+ case 'S': return (id)@(*(unsigned short *)vb);
+ case 'i': return (id)@(*(int *)vb);
+ case 'I': return (id)@(*(unsigned int *)vb);
+ case 'l': case 'q': return (id)@(*(long long *)vb);
+ case 'L': case 'Q': return (id)@(*(unsigned long long *)vb);
+ case 'f': return (id)@(*(float *)vb);
+ case 'd': return (id)@(*(double *)vb);
+ case '#': return (id)NSStringFromClass(*(Class *)vb);
+ case '{': return vpJ([NSValue valueWithBytes:vb objCType:vt.UTF8String]);
+ default: return (id)[NSString stringWithFormat:@"<unboxed type %@>", vt];
+ }
+};
+NSDictionary *(^vpCall)(NSObject *, NSString *) = ^NSDictionary *(NSObject *vo, NSString *vsn) {
+ if (!vo) return (NSDictionary *)@{@"e": @"receiver is nil"};
+ SEL vs = NSSelectorFromString(vsn);
+ if (![vo respondsToSelector:vs]) return (NSDictionary *)@{@"e": [NSString stringWithFormat:@"%s does not respond to %@", class_getName(object_getClass(vo)), vsn]};
+ NSMethodSignature *vsig = [vo methodSignatureForSelector:vs];
+ if (vsig.numberOfArguments != 2) return (NSDictionary *)@{@"e": @"takes arguments"};
+ NSInvocation *vinv = [NSInvocation invocationWithMethodSignature:vsig];
+ [vinv setTarget:vo]; [vinv setSelector:vs]; [vinv invoke];
+ NSString *vt = [NSString stringWithUTF8String:vsig.methodReturnType];
+ while (vt.length && [@"rnNoORVA" containsString:[vt substringToIndex:1]]) vt = [vt substringFromIndex:1];
+ if ([vt hasPrefix:@"v"]) return (NSDictionary *)@{@"v": [NSNull null]};
+ if ([vt hasPrefix:@"@"]) { void *vp = NULL; [vinv getReturnValue:&vp]; return (NSDictionary *)@{@"v": vpJ((__bridge NSObject *)vp)}; }
+ NSUInteger vlen = vsig.methodReturnLength;
+ void *vbuf = calloc(1, vlen < 16 ? 16 : vlen);
+ [vinv getReturnValue:vbuf];
+ id vr = vpBox(vt, vbuf);
+ free(vbuf);
+ return (NSDictionary *)@{@"v": vr ?: [NSNull null]};
+};
+NSObject *(^vpObj)(NSObject *, NSString *) = ^NSObject *(NSObject *vo, NSString *vsn) {
+ if (!vo || ![vo respondsToSelector:NSSelectorFromString(vsn)]) return (NSObject *)nil;
+ return (NSObject *)((id (*)(id, SEL))vpMsg)(vo, NSSelectorFromString(vsn));
+};
+NSObject *(^vpIvObj)(NSObject *, NSString *) = ^NSObject *(NSObject *vo, NSString *vn) {
+ if (!vo) return (NSObject *)nil;
+ Ivar viv = class_getInstanceVariable(object_getClass(vo), vn.UTF8String);
+ if (!viv) return (NSObject *)nil;
+ return (NSObject *)object_getIvar(vo, viv);
+};
+NSDictionary *(^vpIvar)(NSObject *, NSString *) = ^NSDictionary *(NSObject *vo, NSString *vn) {
+ if (!vo) return (NSDictionary *)@{@"e": @"receiver is nil"};
+ Ivar viv = class_getInstanceVariable(object_getClass(vo), vn.UTF8String);
+ if (!viv) return (NSDictionary *)@{@"e": [NSString stringWithFormat:@"%s has no ivar %@", class_getName(object_getClass(vo)), vn]};
+ NSString *vt = [NSString stringWithUTF8String:ivar_getTypeEncoding(viv) ?: ""];
+ if ([vt hasPrefix:@"@?"]) return (NSDictionary *)@{@"v": object_getIvar(vo, viv) ? @"<block>" : [NSNull null]};
+ if ([vt hasPrefix:@"@"]) return (NSDictionary *)@{@"v": vpJ((NSObject *)object_getIvar(vo, viv))};
+ if ([vt hasPrefix:@"{"]) return (NSDictionary *)@{@"e": [NSString stringWithFormat:@"struct ivar %@ not boxed", vn]};
+ return (NSDictionary *)@{@"v": vpBox(vt, (char *)(__bridge void *)vo + ivar_getOffset(viv)) ?: [NSNull null]};
+};
+void (^vpAdd)(NSString *, NSString *, NSString *, NSDictionary *) = ^(NSString *api, NSString *kind, NSString *call, NSDictionary *res) {
+ [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": res[@"v"] ?: [NSNull null], @"error": res[@"e"] ?: [NSNull null]}];
+};
+NSDictionary *(^vpV)(id) = ^NSDictionary *(id vx) { return (NSDictionary *)@{@"v": vx ?: [NSNull null]}; };
+void (^vpGetters)(NSObject *, NSString *, NSString *, NSArray *) = ^(NSObject *vo, NSString *vapi, NSString *vrecv, NSArray *vsels) {
+ for (NSString *vsn in vsels) vpAdd([NSString stringWithFormat:@"%@.%@", vapi, vsn], @"private", [NSString stringWithFormat:@"[%@ %@]", vrecv, vsn], vpCall(vo, vsn));
+};
+void (^vpIvars)(NSObject *, NSString *, NSString *, NSArray *) = ^(NSObject *vo, NSString *vapi, NSString *vrecv, NSArray *vnames) {
+ for (NSString *vn in vnames) vpAdd([NSString stringWithFormat:@"%@.%@", vapi, vn], @"private", [NSString stringWithFormat:@"%@->%@", vrecv, vn], vpIvar(vo, vn));
+};
+void (^vpProps)(NSObject *, NSString *, NSString *, Class) = ^(NSObject *vo, NSString *vapi, NSString *vrecv, Class vcls) {
+ unsigned int vn = 0;
+ objc_property_t *vps = class_copyPropertyList(vcls, &vn);
+ NSMutableArray *vnames = [NSMutableArray array];
+ for (unsigned int vi = 0; vi < vn; vi++) {
+ NSString *vpn = [NSString stringWithUTF8String:property_getName(vps[vi])];
+ if ([@[@"hash", @"superclass", @"description", @"debugDescription"] containsObject:vpn]) continue;
+ if ([vpSkip containsObject:[NSString stringWithFormat:@"%s.%@", class_getName(vcls), vpn]]) { [vpRecs addObject:@{@"api": [NSString stringWithFormat:@"%@.%@", vapi, vpn], @"kind": @"private", @"call": [NSString stringWithFormat:@"[%@ %@]", vrecv, vpn], @"value": [NSNull null], @"error": @"not called: getter crashed SpringBoard's probe expression (EXC_BAD_ACCESS on the stack) in this sim"}]; continue; }
+ NSString *vattr = [NSString stringWithUTF8String:property_getAttributes(vps[vi])];
+ NSString *vget = vpn;
+ for (NSString *va in [vattr componentsSeparatedByString:@","]) if ([va hasPrefix:@"G"]) vget = [va substringFromIndex:1];
+ [vnames addObject:@[vpn, vget, vattr]];
+ }
+ free(vps);
+ [vnames sortUsingComparator:^NSComparisonResult(NSArray *a, NSArray *b) { return [(NSString *)a[0] compare:(NSString *)b[0]]; }];
+ for (NSArray *ve in vnames) { NSString *ve0 = (NSString *)ve[0]; NSString *ve1 = (NSString *)ve[1]; NSString *ve2 = (NSString *)ve[2];
+ NSDictionary *vres = vpCall(vo, ve1);
+ if ([ve2 hasPrefix:@"T@"] && ![ve2 hasPrefix:@"T@\"NSString\""] && ![ve2 hasPrefix:@"T@\"NSNumber\""] && vres[@"v"] && ![(NSObject *)vres[@"v"] isKindOfClass:[NSNull class]]) {
+ NSObject *vobj = vpObj(vo, ve1);
+ if ([vobj isKindOfClass:NSClassFromString(@"PTSettings")] || [vobj isKindOfClass:NSClassFromString(@"SBWindowScene")]) { }
+ else if (vobj) vres = @{@"v": [NSString stringWithFormat:@"<%s>", class_getName(object_getClass(vobj))]};
+ }
+ vpAdd([NSString stringWithFormat:@"%@.%@", vapi, ve0], @"private", [NSString stringWithFormat:@"[%@ %@]", vrecv, ve1], vres);
+ }
+};
+NSObject *vpApp = (NSObject *)[UIApplication sharedApplication];
+NSObject *vpSvc = vpIvObj(vpApp, @"_displayToolService");
+NSObject *vpDCM = vpIvObj(vpSvc, @"_displayContentModeCoordinator");
+NSObject *vpWSM = vpIvObj(vpSvc, @"_windowSceneManager");
+NSObject *vpPose = vpIvObj(vpSvc, @"_devicePoseProvider");
+NSObject *vpSwap = vpIvObj(vpSvc, @"_swapCoordinator");
+NSObject *vpRes = vpIvObj(vpDCM, @"_resolver");
+NSArray *vpScenes = [[(NSSet *)vpObj(vpWSM, @"connectedWindowScenes") allObjects] sortedArrayUsingComparator:^NSComparisonResult(NSObject *a, NSObject *b) { return [vpLabel(a) compare:vpLabel(b)]; }];
+NSObject *vpPrimary = vpObj(vpDCM, @"primaryWindowScene");
+// ---- SBWindowSceneManager
+vpAdd(@"SBWindowSceneManager.connectedWindowScenes", @"private", @"[SBWindowSceneManager connectedWindowScenes]", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vs in vpScenes) [vl addObject:vpLabel(vs) ?: [(NSObject *)vs description]]; vl; })));
+vpGetters(vpWSM, @"SBWindowSceneManager", @"SBWindowSceneManager", @[@"activeDisplayWindowScene", @"embeddedDisplayWindowScene", @"_embeddedDisplayWindowScene", @"_bringupDisplayWindowScene", @"_continuityDisplayWindowScene", @"_extendedDisplayWindowScene", @"windowSceneForAlertItems", @"windowSceneForKeyboardFocus", @"windowSceneForDisplayConfigurationForClassicApps", @"lastInteractedScene", @"restartSnapshotDisplays", @"activeRestartSnapshotDisplay"]);
+// ---- SBDisplayContentModeCoordinator
+vpGetters(vpDCM, @"SBDisplayContentModeCoordinator", @"SBDisplayContentModeCoordinator", @[@"primaryWindowScene", @"activeWindowScene", @"currentTransitionContext", @"updateLinkProvider"]);
+vpAdd(@"SBDisplayContentModeCoordinator.preferredTransitionStyleForDisplayContentModeResolver", @"private", @"[SBDisplayContentModeCoordinator preferredTransitionStyleForDisplayContentModeResolver:_resolver]", vpV(@(((long long (*)(id, SEL, id))vpMsg)(vpDCM, @selector(preferredTransitionStyleForDisplayContentModeResolver:), vpRes))));
+vpIvars(vpDCM, @"SBDisplayContentModeCoordinator", @"SBDisplayContentModeCoordinator", @[@"_lastHingeMotionIdleTimerResetTime", @"_lastInteractiveProgressIdleTimerResetTime", @"_prewarmStartTime", @"_prewarmAssertionsBySurfaceType", @"_prewarmAttemptsBySurfaceType"]);
+vpAdd(@"SBDisplayContentModeCoordinator._connectedWindowScenes", @"private", @"SBDisplayContentModeCoordinator->_connectedWindowScenes", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vs in (NSArray *)vpIvObj(vpDCM, @"_connectedWindowScenes")) [vl addObject:vpLabel(vs) ?: [vs description]]; vl; })));
+vpAdd(@"SBDisplayContentModeCoordinator._preventBacklightActivationAssertions.count", @"private", @"SBDisplayContentModeCoordinator->_preventBacklightActivationAssertions.count", vpV(@([(NSArray *)vpIvObj(vpDCM, @"_preventBacklightActivationAssertions") count])));
+vpAdd(@"SBDisplayContentModeCoordinator._windowScenesToContexts.count", @"private", @"SBDisplayContentModeCoordinator->_windowScenesToContexts.count", vpV(@([(NSMapTable *)vpIvObj(vpDCM, @"_windowScenesToContexts") count])));
+NSMapTable *vpObsMap = (NSMapTable *)vpIvObj(vpDCM, @"_observersToProxies");
+NSMutableArray *vpObsNames = [NSMutableArray array];
+NSObject *vpLSPolicy = nil;
+for (NSObject *vk in [[vpObsMap keyEnumerator] allObjects]) {
+ NSObject *vprox = [vpObsMap objectForKey:vk];
+ NSHashTable *vint = (NSHashTable *)vpIvObj(vprox, @"_windowScenesOfInterest");
+ NSMutableArray *vil = [NSMutableArray array];
+ for (NSObject *vs in [vint allObjects]) [vil addObject:vpLabel(vs) ?: @"?"];
+ [vil sortUsingSelector:@selector(compare:)];
+ BOOL vall = ((BOOL (*)(id, SEL))vpMsg)(vprox, @selector(wantsAllTransitions));
+ [vpObsNames addObject:[NSString stringWithFormat:@"%s all=%d scenes=%@", class_getName(object_getClass(vk)), vall, [vil componentsJoinedByString:@"|"]]];
+ if ([vk isKindOfClass:NSClassFromString(@"SBDisplayContentModeLockScreenActiveDisplayPolicy")]) vpLSPolicy = vk;
+}
+[vpObsNames sortUsingSelector:@selector(compare:)];
+vpAdd(@"SBDisplayContentModeCoordinator.observers.count", @"private", @"[SBDisplayContentModeCoordinator->_observersToProxies count]", vpV(@(vpObsMap.count)));
+vpAdd(@"SBDisplayContentModeCoordinator.observers", @"private", @"SBDisplayContentModeCoordinator->_observersToProxies keys (class, wantsAllTransitions, windowScenesOfInterest)", vpV(vpObsNames));
+for (long long vm = 0; vm <= 3; vm++) {
+ NSMutableArray *vl = [NSMutableArray array];
+ for (NSObject *vs in (NSArray *)((id (*)(id, SEL, long long))vpMsg)(vpDCM, @selector(windowScenesWithDisplayContentMode:), vm)) [vl addObject:vpLabel(vs) ?: [vs description]];
+ vpAdd(@"SBDisplayContentModeCoordinator.windowScenesWithDisplayContentMode", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator windowScenesWithDisplayContentMode:%lld]", vm], vpV(vl));
+}
+// ---- resolver
+vpAdd(@"SBFDisplayContentModeResolver.description", @"private", @"[SBDisplayContentModeCoordinator->_resolver description]", vpV([vpRes description]));
+vpGetters(vpRes, @"SBFDisplayContentModeResolver", @"_resolver", @[@"succinctDescription", @"delegate", @"currentTransitionContext", @"_continuousFoldEffectProgress", @"_mechanicalHingeAngleDegrees"]);
+vpIvars(vpRes, @"SBFDisplayContentModeResolver", @"_resolver", @[@"_isReadyToResolve", @"_isInvalidated", @"_delegateCalloutDepth", @"_preferredTransitionStyle", @"_currentTransitionCoordinator"]);
+NSObject *vpResolution = vpIvObj(vpRes, @"_resolution");
+vpAdd(@"SBFResolvedDisplayContentMode.description", @"private", @"_resolver->_resolution", vpV([vpResolution description]));
+vpAdd(@"SBFResolvedDisplayContentMode.prevailingPolicy", @"private", @"[_resolver->_resolution prevailingPolicy].name", vpCall(vpObj(vpResolution, @"prevailingPolicy"), @"name"));
+vpIvars(vpResolution, @"SBFResolvedDisplayContentMode", @"_resolver->_resolution", @[@"_targetModesByIdentifier", @"_resolvedModesByIdentifier", @"_swapsContentModeByIdentifier"]);
+NSMutableArray *vpPolicies = [NSMutableArray arrayWithArray:(NSArray *)vpIvObj(vpRes, @"_policies") ?: @[]];
+if (vpIvObj(vpRes, @"_yoinkPolicy")) [vpPolicies addObject:vpIvObj(vpRes, @"_yoinkPolicy")];
+if (vpIvObj(vpRes, @"_forceCoverDisplayOnlyPolicy")) [vpPolicies addObject:vpIvObj(vpRes, @"_forceCoverDisplayOnlyPolicy")];
+NSMutableArray *vpPolList = [NSMutableArray array];
+for (NSObject *vpol in vpPolicies) {
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ vd[@"class"] = NSStringFromClass(object_getClass(vpol));
+ vd[@"name"] = vpCall(vpol, @"name")[@"v"];
+ vd[@"swapsContentMode"] = vpCall(vpol, @"swapsContentMode")[@"v"];
+ vd[@"isUserInitiated"] = vpCall(vpol, @"isUserInitiated")[@"v"];
+ if ([vpol respondsToSelector:@selector(preferredSurfaceType)]) vd[@"preferredSurfaceType"] = vpCall(vpol, @"preferredSurfaceType")[@"v"];
+ if ([vpol respondsToSelector:NSSelectorFromString(@"assertionSummary")]) vd[@"assertionSummary"] = vpCall(vpol, @"assertionSummary")[@"v"];
+ if (vpIvObj(vpol, @"_activationAssertions")) vd[@"activationAssertions.count"] = @([(NSSet *)vpIvObj(vpol, @"_activationAssertions") count]);
+ [vpPolList addObject:vd];
+}
+vpAdd(@"SBFDisplayContentModeResolver.policies", @"private", @"_resolver->_policies + _yoinkPolicy + _forceCoverDisplayOnlyPolicy: class/name/swapsContentMode/isUserInitiated", vpV(vpPolList));
+NSDictionary *vpProxies = (NSDictionary *)vpIvObj(vpRes, @"_displayProxies");
+for (NSString *vk in [[vpProxies allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vpx = vpProxies[vk];
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ for (NSString *vsn in @[@"identifier", @"surfaceType", @"isExternal", @"appliedContentMode", @"targetContentMode"]) vd[vsn] = vpCall(vpx, vsn)[@"v"];
+ vd[@"resolver._resolvedModeForDisplay"] = @(((long long (*)(id, SEL, id))vpMsg)(vpRes, NSSelectorFromString(@"_resolvedModeForDisplay:"), vpx));
+ vd[@"resolver._targetModeForDisplay"] = @(((long long (*)(id, SEL, id))vpMsg)(vpRes, NSSelectorFromString(@"_targetModeForDisplay:"), vpx));
+ long long vpxs = ((long long (*)(id, SEL))vpMsg)(vpx, @selector(surfaceType)); vpAdd([NSString stringWithFormat:@"SBFDisplayProxy[%@]", vpxs == 1 ? @"cover" : (vpxs == 2 ? @"inner" : [NSString stringWithFormat:@"surface%lld", vpxs])], @"private", [NSString stringWithFormat:@"_resolver->_displayProxies[@\"%@\"] identifier/surfaceType/isExternal/appliedContentMode/targetContentMode", vk], vpV(vd));
+}
+// ---- window scenes
+for (NSObject *vws in vpScenes) {
+ NSString *vl = vpLabel(vws);
+ NSString *vsurf = [vl componentsSeparatedByString:@":"][0];
+ NSString *vapi = [NSString stringWithFormat:@"SBWindowScene[%@]", vsurf];
+ NSString *vrecv = [NSString stringWithFormat:@"<SBWindowScene %@>", vl];
+ UIWindowScene *vu = (UIWindowScene *)vws;
+ vpAdd([vapi stringByAppendingString:@".label"], @"private", [vrecv stringByAppendingString:@" surfaceType + session.persistentIdentifier"], vpV(vl));
+ vpAdd([vapi stringByAppendingString:@".interfaceOrientation"], @"public", [vrecv stringByAppendingString:@".interfaceOrientation"], vpV(@(vu.interfaceOrientation)));
+ vpAdd([vapi stringByAppendingString:@".coordinateSpace.bounds"], @"public", [vrecv stringByAppendingString:@".coordinateSpace.bounds"], vpV(vpRect(((CGRect (*)(id, SEL))vpMsg)(vu.coordinateSpace, @selector(bounds)))));
+ vpAdd([vapi stringByAppendingString:@".screen.bounds"], @"public", [vrecv stringByAppendingString:@".screen.bounds"], vpV(vpRect(vu.screen.bounds)));
+ vpAdd([vapi stringByAppendingString:@".screen.isMainScreen"], @"public", [vrecv stringByAppendingString:@".screen == [UIScreen mainScreen]"], vpV(@(vu.screen == [UIScreen mainScreen])));
+ vpAdd([vapi stringByAppendingString:@".screen.displayIdentity"], @"private", [vrecv stringByAppendingString:@".screen.displayIdentity"], vpCall(vu.screen, @"displayIdentity"));
+ vpAdd([vapi stringByAppendingString:@".activationState"], @"public", [vrecv stringByAppendingString:@".activationState"], vpV(@(vu.activationState)));
+ vpAdd([vapi stringByAppendingString:@".effectiveGeometry.interfaceOrientation"], @"public", [vrecv stringByAppendingString:@".effectiveGeometry.interfaceOrientation"], vpV(@(vu.effectiveGeometry.interfaceOrientation)));
+ vpAdd([vapi stringByAppendingString:@".effectiveGeometry.coordinateSpace.bounds"], @"public", [vrecv stringByAppendingString:@".effectiveGeometry.coordinateSpace.bounds"], vpV(vpRect(((CGRect (*)(id, SEL))vpMsg)(vu.effectiveGeometry.coordinateSpace, @selector(bounds)))));
+ vpAdd([vapi stringByAppendingString:@".traitCollection"], @"public", [vrecv stringByAppendingString:@".traitCollection h/v sizeClass, displayScale, userInterfaceIdiom"], vpV((@{@"horizontalSizeClass": @(vu.traitCollection.horizontalSizeClass), @"verticalSizeClass": @(vu.traitCollection.verticalSizeClass), @"displayScale": @(vu.traitCollection.displayScale), @"userInterfaceIdiom": @(vu.traitCollection.userInterfaceIdiom)})));
+ vpGetters(vws, vapi, vrecv, @[@"_sceneIdentifier", @"displayIdentity", @"isMainDisplayWindowScene", @"isExternalDisplayWindowScene", @"isIntegratedDisplayWindowScene", @"isContinuityDisplayWindowScene", @"isExtendedDisplayWindowScene", @"isResizableAppHostingWindowScene", @"isLegacyMainEmbeddedScene", @"isEmbeddedScene", @"isContinuityScene", @"isExternalDisplayScene", @"supportsMultitasking", @"supportsAdvancedMultitasking", @"supportsSplitPIP", @"sbhScreenType", @"surfaceType", @"keyboardFocusCoalitionAffinity", @"sbui_systemArbitratedInterfaceOrientation", @"_displayWindowingMode", @"_hasTollFreeDeviceAndInterfaceOrientationConversion", @"_windowsIgnoreSceneClientOrientation", @"isInvalidated", @"isInvalidating", @"lastInteractedScene"]);
+ for (long long vo = 1; vo <= 4; vo++) {
+ vpAdd([vapi stringByAppendingString:@".systemSpaceOrientationForDeviceOrientation"], @"private", [NSString stringWithFormat:@"[%@ systemSpaceOrientationForDeviceOrientation:%lld]", vrecv, vo], vpV(@(((long long (*)(id, SEL, long long))vpMsg)(vws, @selector(systemSpaceOrientationForDeviceOrientation:), vo))));
+ vpAdd([vapi stringByAppendingString:@".deviceOrientationForSystemSpaceOrientation"], @"private", [NSString stringWithFormat:@"[%@ deviceOrientationForSystemSpaceOrientation:%lld]", vrecv, vo], vpV(@(((long long (*)(id, SEL, long long))vpMsg)(vws, @selector(deviceOrientationForSystemSpaceOrientation:), vo))));
+ }
+ vpProps(vws, vapi, vrecv, NSClassFromString(@"SBWindowScene"));
+ long long vmode = ((long long (*)(id, SEL, id))vpMsg)(vpDCM, @selector(displayContentModeForWindowScene:), vws);
+ vpAdd(@"SBDisplayContentModeCoordinator.displayContentModeForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator displayContentModeForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(vmode)})));
+ vpAdd(@"SBDisplayContentModeCoordinator.isAppliedDisplayContentModeUserInitiatedForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator isAppliedDisplayContentModeUserInitiatedForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((BOOL (*)(id, SEL, id))vpMsg)(vpDCM, @selector(isAppliedDisplayContentModeUserInitiatedForWindowScene:), vws) ? YES : NO)})));
+ vpAdd(@"SBDisplayContentModeCoordinator.isContinuousFoldCloakInstalledForWindowScene", @"private", [NSString stringWithFormat:@"[SBDisplayContentModeCoordinator isContinuousFoldCloakInstalledForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((BOOL (*)(id, SEL, id))vpMsg)(vpDCM, @selector(isContinuousFoldCloakInstalledForWindowScene:), vws) ? YES : NO)})));
+ vpAdd(@"SBFDisplayContentModeResolver.appliedContentModeOfDisplayForWindowScene", @"private", [NSString stringWithFormat:@"[_resolver appliedContentModeOfDisplayForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((long long (*)(id, SEL, id))vpMsg)(vpRes, @selector(appliedContentModeOfDisplayForWindowScene:), vws))})));
+ vpAdd(@"SBFDisplayContentModeResolver._surfaceTypeForWindowScene", @"private", [NSString stringWithFormat:@"[_resolver _surfaceTypeForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": @(((long long (*)(id, SEL, id))vpMsg)(vpRes, NSSelectorFromString(@"_surfaceTypeForWindowScene:"), vws))})));
+ vpAdd(@"SBFDisplayContentModeResolver._identifierForWindowScene", @"private", [NSString stringWithFormat:@"[_resolver _identifierForWindowScene:%@]", vrecv], vpV((@{@"scene": vl, @"value": vpJ((NSObject *)((id (*)(id, SEL, id))vpMsg)(vpRes, NSSelectorFromString(@"_identifierForWindowScene:"), vws))})));
+ NSObject *vctx = vpObj(vws, @"displayContentModeContext");
+ vpGetters(vctx, [vapi stringByAppendingString:@".displayContentModeContext"], [vrecv stringByAppendingString:@".displayContentModeContext"], @[@"currentContentMode", @"isAppliedDisplayContentModeUserInitiated", @"isTransitioning", @"isInvolvedInTransition", @"phase", @"swapTarget", @"isInteractive", @"interactiveProgress", @"progressToSwap", @"progressFromSwap", @"continuousFoldPosition", @"continuousFoldVelocity", @"_currentContext"]);
+ NSObject *vlock = vpObj(vws, @"orientationLockManager");
+ vpGetters(vlock, [vapi stringByAppendingString:@".orientationLockManager"], [vrecv stringByAppendingString:@".orientationLockManager"], @[@"isUserLocked", @"lockedDeviceOrientation", @"lockedInterfaceOrientation", @"isLandscapeOverrideEnabled", @"_isPerDisplayLockEnabled", @"_surfaceType", @"description"]);
+ NSObject *vtpm = vpObj(vws, @"traitsPipelineManager");
+ NSString *vtapi = [vapi stringByAppendingString:@".traitsPipelineManager"];
+ NSString *vtrecv = [vrecv stringByAppendingString:@".traitsPipelineManager"];
+ vpAdd([vtapi stringByAppendingString:@".class"], @"private", [vtrecv stringByAppendingString:@" class"], vpV(vtpm ? NSStringFromClass(object_getClass(vtpm)) : nil));
+ vpGetters(vtpm, vtapi, vtrecv, @[@"systemArbitratedDeviceOrientation", @"systemArbitratedInterfaceOrientation", @"lastNonFlatDeviceOrientation", @"supportsLiveDeviceRotation", @"continuousFoldPinnedInterfaceOrientation", @"_continuousFoldPinNeedsPoseSettleWindow", @"_isBacklightOn", @"_bootOrientation", @"_orientationStateDescription", @"inputs", @"orientationStageRoles"]);
+ vpIvars(vtpm, vtapi, vtrecv, @[@"_surfaceType", @"_lastNonFlatOrientation", @"_isDevicePoseOverridingOrientationLock", @"_isSceneAccessoryIgnoringOrientationLock", @"_continuousFoldPinnedDeviceOrientation", @"_continuousFoldHolderCount", @"_isContinuousFoldSettleWindowActive", @"_isCoversheetPresented", @"_suppressingOrientationUpdateAnimation", @"_backlightOffDeferralHeldInAlwaysOn", @"_arbiterRunningUpdatesCount", @"_settingUpPipeline", @"_continuousFoldLockValidator", @"_continuousFoldDeviceOrientationDeferralAssertion", @"_orientationLockInputsValidator", @"_lastNonFlatOverrideInputsValidator", @"_activeOrientationParticipant", @"_deviceOrientationUpdateDeferralAssertionsByReason"]);
+ NSObject *varb = vpObj(vws, @"traitsArbiter");
+ vpIvars(varb, [vapi stringByAppendingString:@".traitsArbiter"], [vrecv stringByAppendingString:@".traitsArbiter"], @[@"_lastRawInputs", @"_lastValidatedInputs"]);
+ NSDictionary *vparts = (NSDictionary *)vpIvObj(varb, @"_acquiredParticipantsByUniqueIdentifier");
+ vpAdd([vapi stringByAppendingString:@".traitsArbiter.participants.count"], @"private", [vrecv stringByAppendingString:@".traitsArbiter->_acquiredParticipantsByUniqueIdentifier.count"], vpV(@(vparts.count)));
+ for (NSString *vk in [[vparts allKeys] sortedArrayUsingSelector:@selector(compare:)]) {
+ NSObject *vp = vparts[vk];
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ for (NSString *vsn in @[@"role", @"uniqueIdentifier", @"currentOrientation", @"previousOrientation", @"currentDeviceOrientation", @"previousDeviceOrientation", @"currentZOrderLevel", @"_debugLastOrientationValidationFailureReason", @"orientationResolutionPolicyInfo"]) vd[vsn] = vpCall(vp, vsn)[@"v"];
+ NSObject *vpref = vpObj(vp, @"orientationPreferences");
+ if (vpref) vd[@"orientationPreferences"] = @{@"supportedOrientations": vpCall(vpref, @"supportedOrientations")[@"v"], @"preferredOrientation": vpCall(vpref, @"preferredOrientation")[@"v"], @"canDetermineActiveOrientation": vpCall(vpref, @"canDetermineActiveOrientation")[@"v"]};
+ else vd[@"orientationPreferences"] = [NSNull null];
+ NSObject *vdel = vpObj(vp, @"delegate");
+ vd[@"delegate"] = vdel ? NSStringFromClass(object_getClass(vdel)) : [NSNull null];
+ if ([vdel isKindOfClass:NSClassFromString(@"SBTraitsSceneParticipantDelegate")]) {
+ vd[@"scene"] = [(NSObject *)vpCall(vpObj(vdel, @"scene"), @"identifier")[@"v"] description] ?: [NSNull null];
+ for (NSString *vsn in @[@"sceneCurrentOrientation", @"_supportedOrientations", @"scenePrefersOrientationLocked", @"orientationModeOverride", @"supportedOrientationsOverride", @"orientationResolutionWindowScene", @"canDetermineActiveOrientation", @"isOrientationActuationEnabled"]) vd[[@"delegate." stringByAppendingString:vsn]] = vpCall(vdel, vsn)[@"v"];
+ }
+ vpAdd([vapi stringByAppendingString:@".traitsArbiter.participant"], @"private", [NSString stringWithFormat:@"%@.traitsArbiter->_acquiredParticipantsByUniqueIdentifier[@\"%@\"]", vrecv, vk], vpV(vd));
+ }
+ NSObject *vsbm = vpObj(vws, @"statusBarManager");
+ NSString *vsapi = [vapi stringByAppendingString:@".statusBarManager"];
+ NSString *vsrecv = [vrecv stringByAppendingString:@".statusBarManager"];
+ vpAdd([vsapi stringByAppendingString:@".class"], @"public", [vsrecv stringByAppendingString:@" class"], vpV(vsbm ? NSStringFromClass(object_getClass(vsbm)) : nil));
+ vpGetters(vsbm, vsapi, vsrecv, @[@"statusBarOrientation", @"statusBarFrame", @"defaultStatusBarFrame", @"isStatusBarHidden", @"isStatusBarEffectivelyHidden", @"statusBarWindowFrame", @"_isEmbeddedDisplay", @"statusBarStyle"]);
+ NSObject *vsbw = vpObj(vsbm, @"statusBarWindow");
+ vpAdd([vsapi stringByAppendingString:@".statusBarWindow.windowScene"], @"private", [vsrecv stringByAppendingString:@".statusBarWindow.windowScene"], vpCall(vsbw, @"windowScene"));
+ vpAdd([vsapi stringByAppendingString:@".statusBarWindow.isHidden"], @"private", [vsrecv stringByAppendingString:@".statusBarWindow.isHidden"], vpCall(vsbw, @"isHidden"));
+ NSObject *vbl = vpObj(vws, @"backlightController");
+ NSString *vbapi = [vapi stringByAppendingString:@".backlightController"];
+ NSString *vbrecv = [vrecv stringByAppendingString:@".backlightController"];
+ vpGetters(vbl, vbapi, vbrecv, @[@"windowScene", @"screenIsOn", @"screenIsDim", @"backlightState", @"lastBacklightChangeSource", @"isDigitizerDisabled", @"isTapToWakeEnabled", @"tapToWakeRequiresHitTestSuppression", @"isPrewarmingDisplayContentMode", @"blsDisplay"]);
+ vpAdd([vbapi stringByAppendingString:@".isSharedInstanceForMainDisplay"], @"private", [vbrecv stringByAppendingString:@" == [SBBacklightController sharedInstanceForMainDisplay]"], vpV(@(vbl && vbl == (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBBacklightController"), NSSelectorFromString(@"sharedInstanceForMainDisplayIfExists")))));
+ NSObject *vblsb = vpObj(vbl, @"blsBacklight");
+ vpAdd([vbapi stringByAppendingString:@".blsBacklight.class"], @"private", [vbrecv stringByAppendingString:@".blsBacklight class"], vpV(vblsb ? NSStringFromClass(object_getClass(vblsb)) : nil));
+ vpGetters(vblsb, [vbapi stringByAppendingString:@".blsBacklight"], [vbrecv stringByAppendingString:@".blsBacklight"], @[@"backlightState", @"isTransitioning", @"isAlwaysOnEnabled", @"display"]);
+ NSObject *vcfc = vpObj(vws, @"continuousFoldController");
+ vpGetters(vcfc, [vapi stringByAppendingString:@".continuousFoldController"], [vrecv stringByAppendingString:@".continuousFoldController"], @[@"isEnabled", @"isSuppressed"]);
+ vpIvars(vcfc, [vapi stringByAppendingString:@".continuousFoldController"], [vrecv stringByAppendingString:@".continuousFoldController"], @[@"_lastContinuousFoldPosition", @"_lastHingeAngleDegrees", @"_lastEffectMode", @"_awaitingCloakReveal", @"_settleOrientationLock", @"_window", @"_effectViewController"]);
+ NSObject *vaux = vpObj(vws, @"auxiliaryContentController");
+ vpGetters(vaux, [vapi stringByAppendingString:@".auxiliaryContentController"], [vrecv stringByAppendingString:@".auxiliaryContentController"], @[@"isAvailable", @"isYoinkingSliderVisible", @"isHostingCompanionScene", @"_auxiliaryContentType", @"disabledSystemGestureTypes", @"continuousFoldSuppressionAssertion", @"systemGestureDisabledAssertion"]);
+ vpIvars(vaux, [vapi stringByAppendingString:@".auxiliaryContentController"], [vrecv stringByAppendingString:@".auxiliaryContentController"], @[@"_windowVisible", @"_lastActivationPolicyForParticipantsBelow"]);
+ NSObject *vyc = vpObj(vaux, @"displayYoinkingController");
+ vpGetters(vyc, [vapi stringByAppendingString:@".displayYoinkingController"], [vrecv stringByAppendingString:@".auxiliaryContentController.displayYoinkingController"], @[@"canRevealYoinkingSlider", @"shouldRevealYoinkingSlider", @"isYoinkingSliderVisible", @"isYoinkingSliderInteractionInProgress", @"isEligible", @"isVisibleOnScreen", @"_canYoinkToThisDisplay", @"currentDisplayIdentity"]);
+ NSObject *vlsm = vpObj(vws, @"lockScreenManager");
+ vpGetters(vlsm, [vapi stringByAppendingString:@".lockScreenManager"], [vrecv stringByAppendingString:@".lockScreenManager"], @[@"isUILocked", @"isLockScreenActive", @"isLockScreenVisible", @"hasUIEverBeenLocked", @"isScreenOn", @"isWaitingToLockUI", @"hasWakeToContentForInactiveDisplay", @"shouldTapToWake"]);
+ vpAdd([vapi stringByAppendingString:@".lockScreenManager.isSharedInstance"], @"private", [vrecv stringByAppendingString:@".lockScreenManager == [SBLockScreenManager sharedInstance]"], vpV(@(vlsm && vlsm == (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance)))));
+ vpAdd([vapi stringByAppendingString:@".lockScreenManager.isActiveDisplayLockScreenManager"], @"private", [vrecv stringByAppendingString:@".lockScreenManager == [SBDisplayContentModeLockScreenActiveDisplayPolicy activeDisplayLockScreenManager]"], vpV(@(vlsm && vpLSPolicy && vlsm == vpObj(vpLSPolicy, @"activeDisplayLockScreenManager"))));
+ NSObject *vcs = vpObj(vws, @"coverSheetViewController");
+ NSObject *vcsp = vpObj(vws, @"coverSheetPresentationManager");
+ NSObject *vcsw = vpObj(vcsp, @"coverSheetWindowIfLoaded");
+ vpAdd([vapi stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.windowScene"], @"private", [vrecv stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.windowScene"], vcsw ? vpCall(vcsw, @"windowScene") : vpV(@"<no coverSheetWindow loaded>"));
+ vpAdd([vapi stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.isHidden"], @"private", [vrecv stringByAppendingString:@".coverSheetPresentationManager.coverSheetWindowIfLoaded.isHidden"], vcsw ? vpCall(vcsw, @"isHidden") : vpV(@"<no coverSheetWindow loaded>"));
+ vpGetters(vcsp, [vapi stringByAppendingString:@".coverSheetPresentationManager"], [vrecv stringByAppendingString:@".coverSheetPresentationManager"], @[@"windowScene", @"isActiveInterfaceOrientationLocked", @"idleTimerDuration", @"idleTimerMode", @"idleWarnMode", @"isCoverSheetHostingUnlockedEnvironmentWindows"]);
+ NSObject *vic = vpObj(vws, @"iconController");
+ vpAdd([vapi stringByAppendingString:@".iconController.isSharedInstance"], @"private", [vrecv stringByAppendingString:@".iconController == [SBIconController sharedInstance]"], vpV(@(vic && vic == (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBIconController"), @selector(sharedInstance)))));
+ NSObject *vhsc = vpObj(vws, @"homeScreenController");
+ vpAdd([vapi stringByAppendingString:@".homeScreenController.windowScene"], @"private", [vrecv stringByAppendingString:@".homeScreenController.windowScene"], vpCall(vhsc, @"windowScene"));
+ vpAdd([vapi stringByAppendingString:@".homeScreenController.iconManager.rootFolderController.view.window.windowScene"], @"private", [vrecv stringByAppendingString:@".homeScreenController.iconManager.rootFolderController.view.window.windowScene"], vpCall(vpObj(vpObj(vpObj(vpObj(vhsc, @"iconManager"), @"rootFolderController"), @"viewIfLoaded"), @"window"), @"windowScene"));
+ NSObject *vswc = vpObj(vws, @"switcherController");
+ vpAdd([vapi stringByAppendingString:@".switcherController.windowScene"], @"private", [vrecv stringByAppendingString:@".switcherController.windowScene"], vpCall(vswc, @"windowScene"));
+ NSObject *vwpc = vpObj(vws, @"wallpaperController");
+ NSObject *vhpc = vpIvObj(vwpc, @"_hingeProgressController");
+ vpAdd([vapi stringByAppendingString:@".wallpaperController._hingeProgressController.class"], @"private", [vrecv stringByAppendingString:@".wallpaperController->_hingeProgressController class"], vpV(vhpc ? NSStringFromClass(object_getClass(vhpc)) : nil));
+ vpGetters(vhpc, @"SBWallpaperHingeProgressController", [vrecv stringByAppendingString:@".wallpaperController->_hingeProgressController"], @[@"isHomeScreenWallpaperVisible"]);
+ vpIvars(vhpc, @"SBWallpaperHingeProgressController", [vrecv stringByAppendingString:@".wallpaperController->_hingeProgressController"], @[@"_backlightOn", @"_lockScreenIsTopElement", @"_enabled"]);
+}
+// ---- lock screen active display policy, transition style, yoinking, fold coordinator, display tool
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy.class", @"private", @"DCM observer of class SBDisplayContentModeLockScreenActiveDisplayPolicy", vpV(vpLSPolicy ? NSStringFromClass(object_getClass(vpLSPolicy)) : nil));
+NSObject *vpActiveLSM = vpObj(vpLSPolicy, @"activeDisplayLockScreenManager");
+NSString *vpActiveLSMScene = nil;
+for (NSObject *vws in vpScenes) if (vpActiveLSM && vpObj(vws, @"lockScreenManager") == vpActiveLSM) vpActiveLSMScene = vpLabel(vws);
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy.activeDisplayLockScreenManager", @"private", @"[policy activeDisplayLockScreenManager] -> owning SBWindowScene.lockScreenManager", vpLSPolicy ? vpV(vpActiveLSMScene ?: (vpActiveLSM ? [vpActiveLSM description] : nil)) : @{@"e": @"no SBDisplayContentModeLockScreenActiveDisplayPolicy among DCM observers"});
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy.overrideActiveLockScreenManager", @"private", @"[policy overrideActiveLockScreenManager]", vpCall(vpLSPolicy, @"overrideActiveLockScreenManager"));
+vpAdd(@"SBDisplayContentModeLockScreenActiveDisplayPolicy._lock_lockScreenManagers.count", @"private", @"policy->_lock_lockScreenManagers.count", vpLSPolicy ? vpV(@([(NSHashTable *)vpIvObj(vpLSPolicy, @"_lock_lockScreenManagers") count])) : @{@"e": @"no policy"});
+NSObject *vpTSC = vpIvObj(vpApp, @"_displayContentModeTransitionStyleCoordinator");
+vpIvars(vpTSC, @"SBDisplayContentModeTransitionStyleCoordinator", @"SpringBoard->_displayContentModeTransitionStyleCoordinator", @[@"_continuousFoldTransitionEnabled", @"_continuousFoldTransitionDisablingAssertions"]);
+vpAdd(@"SBDisplayContentModeTransitionStyleCoordinator._windowScenes", @"private", @"SpringBoard->_displayContentModeTransitionStyleCoordinator->_windowScenes", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vs in [(NSHashTable *)vpIvObj(vpTSC, @"_windowScenes") allObjects]) [vl addObject:vpLabel(vs) ?: @"?"]; [vl sortUsingSelector:@selector(compare:)]; vl; })));
+NSObject *vpYC = vpIvObj(vpApp, @"_displayYoinkingCoordinator");
+vpGetters(vpYC, @"SBDisplayYoinkingCoordinator", @"SpringBoard->_displayYoinkingCoordinator", @[@"isDisplayToolFlipOverridden", @"_anyCameraSessionCurrentlyActive"]);
+vpIvars(vpYC, @"SBDisplayYoinkingCoordinator", @"SpringBoard->_displayYoinkingCoordinator", @[@"_cameraSessionActive", @"_listeningToFlip", @"_flipActive", @"_persistentFlipOverride"]);
+NSObject *vpCFC = vpIvObj(vpApp, @"_continuousFoldCoordinator");
+vpAdd(@"SBContinuousFoldCoordinator._activeControllerAssertions.count", @"private", @"SpringBoard->_continuousFoldCoordinator->_activeControllerAssertions.count", vpV(vpCFC ? @([(NSMapTable *)vpIvObj(vpCFC, @"_activeControllerAssertions") count]) : nil));
+vpAdd(@"SBContinuousFoldCoordinator._foldControllers.count", @"private", @"SpringBoard->_continuousFoldCoordinator->_foldControllers.count", vpV(vpCFC ? @([(NSHashTable *)vpIvObj(vpCFC, @"_foldControllers") count]) : nil));
+vpIvars(vpCFC, @"SBContinuousFoldCoordinator", @"SpringBoard->_continuousFoldCoordinator", @[@"_suppressionAssertion"]);
+Ivar vpSwIv = class_getInstanceVariable(object_getClass(vpSwap), "_currentSettings");
+long long *vpSwP = (long long *)((char *)(__bridge void *)vpSwap + ivar_getOffset(vpSwIv));
+vpAdd(@"SBDisplayToolServiceCoordinator._currentSettings.state", @"private", @"SBDisplayToolServiceCoordinator->_currentSettings.state", vpV(@(vpSwP[0])));
+vpIvars(vpSwap, @"SBDisplayToolServiceCoordinator", @"SBDisplayToolServiceCoordinator", @[@"_currentDirection", @"_replayIsRunning", @"_instantSwapIsRunning", @"_testLockExpiryTimer"]);
+// ---- device pose provider
+vpAdd(@"SBFDevicePoseProvider.description", @"private", @"[SBFDevicePoseProvider description]", vpV([vpPose description]));
+vpGetters(vpPose, @"SBFDevicePoseProvider", @"SBFDevicePoseProvider", @[@"isContinuousFoldEnabled", @"continuousFoldEffectProgress", @"likelyTransitionDelegate"]);
+for (NSString *vbox in @[@"_lock_currentDevicePoseBox", @"_lock_devicePoseBox"]) {
+ Ivar vbiv = class_getInstanceVariable(object_getClass(vpPose), vbox.UTF8String);
+ char *vbp = (char *)(__bridge void *)vpPose + ivar_getOffset(vbiv);
+ vpAdd([NSString stringWithFormat:@"SBFDevicePoseProvider.%@", vbox], @"private", [NSString stringWithFormat:@"SBFDevicePoseProvider->%@.devicePose {orientation@0, coverOrientation@8, innerOrientation@16, hinge.isAvailable@24, hinge.position@32, hinge.state@40}", vbox], vpV((@{@"orientation": @(*(long long *)vbp), @"coverOrientation": @(*(long long *)(vbp + 8)), @"innerOrientation": @(*(long long *)(vbp + 16)), @"hinge.isAvailable": (*(BOOL *)(vbp + 24) ? @YES : @NO), @"hinge.position": @(*(double *)(vbp + 32)), @"hinge.state": @(*(long long *)(vbp + 40))})));
+}
+NSObject *vpAccel = vpIvObj(vpPose, @"_accelerometer");
+vpGetters(vpAccel, @"BKSAccelerometer", @"SBFDevicePoseProvider->_accelerometer", @[@"currentDeviceOrientation", @"orientationEventsEnabled", @"passiveOrientationEvents"]);
+vpAdd(@"UIDevice.orientation", @"public", @"[[UIDevice currentDevice] orientation]", vpV(@([[UIDevice currentDevice] orientation])));
+vpAdd(@"UIApplication.activeInterfaceOrientation", @"private", @"[[UIApplication sharedApplication] activeInterfaceOrientation]", vpCall(vpApp, @"activeInterfaceOrientation"));
+// ---- settings domains
+vpProps(vpIvObj(vpPose, @"_settings"), @"SBFDevicePosePTSettings", @"SBFDevicePoseProvider->_settings", NSClassFromString(@"SBFDevicePosePTSettings"));
+NSObject *vpCFS = (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBDeviceContinuousFoldInteractionDomain"), @selector(rootSettings));
+vpAdd(@"SBDeviceContinuousFoldInteractionDomain.rootSettings.isDCMInstance", @"private", @"[SBDeviceContinuousFoldInteractionDomain rootSettings] == SBDisplayContentModeCoordinator->_continuousFoldSettings", vpV(@(vpCFS == vpIvObj(vpDCM, @"_continuousFoldSettings"))));
+vpProps(vpCFS, @"SBDeviceContinuousFoldInteractionSettings", @"[SBDeviceContinuousFoldInteractionDomain rootSettings]", NSClassFromString(@"SBDeviceContinuousFoldInteractionSettings"));
+NSObject *vpHMon = vpIvObj(vpApp, @"_hingeMotionUnintendedInteractionMonitor");
+vpProps(vpIvObj(vpHMon, @"_detectionSettings"), @"SBHingeMotionDetectionSettings", @"SpringBoard->_hingeMotionUnintendedInteractionMonitor->_detectionSettings", NSClassFromString(@"SBHingeMotionDetectionSettings"));
+vpIvars(vpHMon, @"SBHingeMotionUnintendedInteractionMonitor", @"SpringBoard->_hingeMotionUnintendedInteractionMonitor", @[@"_hingeMotionPastThreshold", @"_interactionSuppressionAssertion", @"_strictTouchCoverageAssertion", @"_detectionWindowBeganTimestamp", @"_motionBeganTimestamp", @"_motionEndedTimestamp"]);
+if (vpHMon) {
+ Ivar vriv = class_getInstanceVariable(object_getClass(vpHMon), "_referenceAngle");
+ char *vrp = (char *)(__bridge void *)vpHMon + ivar_getOffset(vriv);
+ vpAdd(@"SBHingeMotionUnintendedInteractionMonitor._referenceAngle", @"private", @"SpringBoard->_hingeMotionUnintendedInteractionMonitor->_referenceAngle {f min, f max, f angle, f velocity, B isAvailable, d timestamp}", vpV((@{@"minAngleDegrees": @(*(float *)vrp), @"maxAngleDegrees": @(*(float *)(vrp + 4)), @"angleDegrees": @(*(float *)(vrp + 8)), @"velocityDegreesPerSeconds": @(*(float *)(vrp + 12)), @"isAvailable": (*(BOOL *)(vrp + 16) ? @YES : @NO), @"timestamp": @(*(double *)(vrp + 24))})));
+}
+NSObject *vpYS = (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBDisplayYoinkingPTSettingsDomain"), @selector(rootSettings));
+vpProps(vpYS, @"SBDisplayYoinkingPTSettings", @"[SBDisplayYoinkingPTSettingsDomain rootSettings]", NSClassFromString(@"SBDisplayYoinkingPTSettings"));
+// ---- backlight
+NSObject *vpBLC = vpIvObj(vpApp, @"_backlightCoordinator");
+vpGetters(vpBLC, @"SBBacklightCoordinator", @"SpringBoard->_backlightCoordinator", @[@"aggregateBacklightState", @"pendingAggregateBacklightState", @"isAnyBacklightOn", @"aggregateBacklightStateExcludingPrewarms", @"pendingAggregateBacklightStateExcludingPrewarms", @"lastBacklightChangeSource", @"idleSleepPreventionInterval", @"_mostActiveBacklightState", @"_mostActivePendingBacklightState"]);
+vpAdd(@"SBBacklightCoordinator.backlightControllers", @"private", @"SpringBoard->_backlightCoordinator->_backlightControllers: windowScene/backlightState/screenIsOn", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vc in [(NSHashTable *)vpIvObj(vpBLC, @"_backlightControllers") allObjects]) [vl addObject:[NSString stringWithFormat:@"%@ state=%@ on=%@", vpLabel(vpObj(vc, @"windowScene")) ?: @"nil", vpCall(vc, @"backlightState")[@"v"], vpCall(vc, @"screenIsOn")[@"v"]]]; [vl sortUsingSelector:@selector(compare:)]; vl; })));
+vpAdd(@"SBBacklightCoordinator.targetBacklightControllersForActiveDim", @"private", @"[SpringBoard->_backlightCoordinator targetBacklightControllersForActiveDim]", vpV(({ NSMutableArray *vl = [NSMutableArray array]; for (NSObject *vc in (NSArray *)vpObj(vpBLC, @"targetBacklightControllersForActiveDim")) [vl addObject:vpLabel(vpObj(vc, @"windowScene")) ?: @"nil"]; [vl sortUsingSelector:@selector(compare:)]; vl; })));
+NSObject *vpBLHost = (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"BLSHBacklightHost"), NSSelectorFromString(@"sharedBacklightHost"));
+vpAdd(@"BLSHBacklightHost.sharedBacklightHost.class", @"private", @"[BLSHBacklightHost sharedBacklightHost] class", vpV(vpBLHost ? NSStringFromClass(object_getClass(vpBLHost)) : nil));
+vpGetters(vpBLHost, @"BLSHBacklightHost.sharedBacklightHost", @"[BLSHBacklightHost sharedBacklightHost]", @[@"backlightState", @"settledBacklightState", @"backlightDisplayMode", @"targetBacklightDisplayMode", @"flipbookState", @"isTransitioning", @"isAlwaysOnEnabled", @"deviceSupportsAlwaysOn", @"backlightStateDescription", @"display"]);
+NSArray *vpHosts = (NSArray *)vpIvObj(vpBLHost, @"_backlightHosts");
+for (NSUInteger vi = 0; vi < vpHosts.count; vi++) {
+ NSObject *vh = vpHosts[vi];
+ NSMutableDictionary *vd = [NSMutableDictionary dictionary];
+ vd[@"class"] = NSStringFromClass(object_getClass(vh));
+ for (NSString *vsn in @[@"backlightState", @"settledBacklightState", @"backlightDisplayMode", @"targetBacklightDisplayMode", @"isTransitioning", @"isAlwaysOnEnabled", @"display"]) vd[vsn] = vpCall(vh, vsn)[@"v"] ?: [NSNull null];
+ vpAdd(@"BLSHBacklightHost.sharedBacklightHost._backlightHosts", @"private", [NSString stringWithFormat:@"[BLSHBacklightHost sharedBacklightHost]->_backlightHosts[%lu]", (unsigned long)vi], vpV(vd));
+}
+NSObject *vpIdle = vpIvObj(vpApp, @"_idleTimerGlobalCoordinator");
+vpGetters(vpIdle, @"SBIdleTimerGlobalCoordinator", @"SpringBoard->_idleTimerGlobalCoordinator", @[@"isIdleTimerDisabled", @"idleTimer"]);
+vpIvars(vpIdle, @"SBIdleTimerGlobalCoordinator", @"SpringBoard->_idleTimerGlobalCoordinator", @[@"_enabledIdleTimerDescriptor", @"_idleTimerSourceEnabled", @"_currentDisablingClientBundleIdentifier"]);
+NSObject *vpLSM = (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance));
+vpGetters(vpLSM, @"SBLockScreenManager.sharedInstance", @"[SBLockScreenManager sharedInstance]", @[@"isUILocked", @"isLockScreenActive", @"isLockScreenVisible", @"isScreenOn", @"isWaitingToLockUI"]);
+NSDictionary *vpOut = @{@"orientation": @(((UIWindowScene *)vpPrimary).interfaceOrientation), @"records": vpRecs};
+NSError *vpErr = nil;
+NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpOut options:0 error:&vpErr];
+vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-summary.zsh b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-summary.zsh
new file mode 100755
index 00000000..11a0fd56
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-summary.zsh
@@ -0,0 +1,28 @@
+#!/bin/zsh
+# vm-summary.zsh <records.jsonl | domain.json posture-label>
+# The posture-table values from springboard-state / display-springboard records: prevailing
+# policy, hinge state, primary scene, content modes, backlight states, scene and screen
+# orientation/bounds, transition style. Works on a VM step's records.jsonl or on one posture
+# of a simulator domain file.
+set -euo pipefail
+jq=/opt/homebrew/bin/jq
+if [[ $1 == *.jsonl ]]; then src=($jq -s -c . $1); else src=($jq -c --arg l "$2" '[.records[] | select(.posture == $l)]' $1); fi
+"${src[@]}" | $jq -r '
+ def v($a): [.[] | select(.api == $a) | .value] | first;
+ def vc($a; $c): [.[] | select(.api == $a and (.call | test($c))) | .value] | first;
+ (v("SBFDisplayContentModeResolver.description") // "" | tostring) as $res
+ | {
+ policy: v("SBFResolvedDisplayContentMode.prevailingPolicy"),
+ hinge: ($res | capture("SBFHingeState: (?<s>\\.[A-Za-z]+)\\n\\s+Position: (?<p>[0-9.]+ \\([0-9.]+°\\))")? // null),
+ transitionStyle: v("SBFDisplayContentModeResolver._preferredTransitionStyle"),
+ primary: (v("SBDisplayContentModeCoordinator.primaryWindowScene") | if type == "object" then .persistentIdentifier // . else . end),
+ contentModes: ([.[] | select(.api == "SBDisplayContentModeCoordinator.displayContentModeForWindowScene") | .value | select(type == "object") | {(.scene | tostring): .value}] | add),
+ backlight_cover: v("SBWindowScene[cover].backlightController.backlightState"),
+ backlight_inner: v("SBWindowScene[inner].backlightController.backlightState"),
+ screenIsOn: [v("SBWindowScene[cover].backlightController.screenIsOn"), v("SBWindowScene[inner].backlightController.screenIsOn")],
+ io_cover: v("SBWindowScene[cover].interfaceOrientation"),
+ io_inner: v("SBWindowScene[inner].interfaceOrientation"),
+ screen_cover: v("SBWindowScene[cover].screen.bounds"),
+ screen_inner: v("SBWindowScene[inner].screen.bounds"),
+ uiLocked: v("SBLockScreenManager.sharedInstance.isUILocked")
+ }'
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-unlock-ui.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-unlock-ui.lldb
new file mode 100644
index 00000000..c945c854
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-unlock-ui.lldb
@@ -0,0 +1 @@
+expr -l objc -O -- NSObject *vpLSM = nil; NSObject *vpDCM = [[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"]; UIScene *vpP = (UIScene *)[vpDCM valueForKey:@"primaryWindowScene"]; vpLSM = [vpP valueForKey:@"lockScreenManager"]; ((void (*)(id, SEL, int, id))objc_msgSend)(vpLSM, @selector(_finishUIUnlockFromSource:withOptions:), 14, nil); @"unlock requested"
diff --git a/Research/Guest/Evidence/duo-sim-baseline/probes/vm-unlock.lldb b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-unlock.lldb
new file mode 100644
index 00000000..8af6f3cc
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/probes/vm-unlock.lldb
@@ -0,0 +1,6 @@
+expr -l objc -O --
+void *vpMsg = (void *)objc_msgSend;
+NSObject *vpL = (NSObject *)((id (*)(id, SEL))vpMsg)((id)NSClassFromString(@"SBLockScreenManager"), @selector(sharedInstance));
+((void (*)(id, SEL, id, BOOL, id))vpMsg)(vpL, @selector(attemptUnlockWithPasscode:finishUIUnlock:completion:), nil, YES, nil);
+@"attemptUnlockWithPasscode:nil finishUIUnlock:YES"
+
diff --git a/Research/Guest/Evidence/duo-sim-baseline/sensors.md b/Research/Guest/Evidence/duo-sim-baseline/sensors.md
new file mode 100644
index 00000000..2fbae66e
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/sensors.md
@@ -0,0 +1,328 @@
+# Sensors baseline: hinge, pose, motion and device identity
+
+Domain `sensors` of the iPhone Duo simulator baseline (iPhone19,4, iOS 27.1
+24A94425, Xcode 27.1). Simulator `duo-baseline-sensors`
+(`C0EF5D72-68AE-4F00-8594-10039EADA1AC`, a clone of `duo-baseline-harness`).
+Records: `sensors.json` (README "Record format", plus two extra fields per
+record: `group`, the probe expression it came from, and `sim_note`, set when
+the value is synthetic or sim-only). Raw transcripts: `raw/sensors/snap/`.
+
+## Files
+
+| Path | What |
+| --- | --- |
+| `sensors.json` | every record, `meta.postures` holds each `posture.zsh` result in snapshot order |
+| `probes/sensors-springboard.lldb` | group `pose`: `SBFDevicePoseProvider` (struct decoded field by field), its settings, observers, source chain, `UIApplication currentHingePoseStateForTesting` |
+| `probes/sensors-coremotion.lldb` | group `coremotion`: `CMMagicPoseManager`, `CMDeviceStateManager`, `CMAngleManager`, `CMMotionManager` availability; SpringBoard's own CM managers |
+| `probes/sensors-cmtables.lldb` | group `cmtables`: the string tables, `propertyAForConfigType:…`, `orientationForMagicPose:deviceSurface:`, magic pose → device state mapping |
+| `probes/sensors-cmquery.lldb` | group `cmquery`: `-[CMDeviceStateManager queryDeviceStateBlocking]` |
+| `probes/sensors-uikit.lldb` | group `uikit`: every zero-argument `UIDevice` getter (enumerated with `class_copyMethodList`), requested hinge getters, per-scene hinge state (client component, `FBSSceneSettings`), SpringBoard's `FBSceneWorkspace` scenes |
+| `probes/sensors-identity.lldb` | group `identity`: `MGCopyAnswer` for 527 keys, `MGGetLogicalDeviceDisplayCount`, `MGCopyAnswerForDisplayAtIndex`, `sysctl`, `uname`, simulator environment |
+| `probes/sensors-backboardd.lldb` | group `hid`: backboardd's HID services, the hinge-angle service and its last events, event processors |
+| `probes/sensors-app-hinge-register.lldb` | not a record source: registers a no-op hinge observer in Preferences (see "App side") |
+| `probes/sensors-discover-*.lldb` | discovery dumps (method/ivar/property lists, class scans) → `raw/sensors/discovery/` |
+| `raw/sensors/run-sensors.zsh` | runner: `posture`, `snapshot`, `assemble` |
+| `raw/sensors/sim-notes.jq` | the rules that set `sim_note` |
+| `raw/sensors/identity/` | the device type's `capabilities.plist` / `profile.plist` as JSON (the source of many MobileGestalt answers), and the MG key list |
+| `raw/sensors/snap/<nn>-<posture>/` | per snapshot: transcripts (`<process>-<probe>.txt` and `.raw.txt`), `records.jsonl`, `posture.json` |
+| `raw/sensors/posture/` | `posture.zsh` artifacts (screenshots, readbacks) for this simulator |
+| `raw/sensors/test/` | probe development runs, including the SIGABRT bisect |
+
+## Snapshot order (history matters)
+
+| # | posture label | how | mode |
+| --- | --- | --- | --- |
+| 00 | `boot` | fresh boot, no swap yet (cover lit, CoreMotion's own values) | full |
+| 01 | `book(after-closed)` | `posture.zsh book` (anchors closed, sweeps to 100°) | full |
+| 02 | `open(after-book)` | `open` | full |
+| 03 | `closed(after-open)` | `closed` (fold from open) | full |
+| 04 | `open(after-closed)` | `open` (unfold from closed) | light |
+| 05 | `book(after-open)` | `POSTURE_ANCHOR=none book` | light |
+| 06 | `closed(after-book)` | `closed` | light |
+| 07/08 | `closed(landscapeLeft/Right)` | `closed -deviceOrientation=…` | light |
+| 09/10 | `book(landscape…,after-closed)` | `book -deviceOrientation=…` | light |
+| 11/12 | `open(landscape…)` | `open -deviceOrientation=…` | light |
+| 13/14 | `open(portrait,…)`, `closed(portrait,…)` | back to portrait | light |
+| 15 | `closed(after-open,final)` | no swap; full rerun with the extended CoreMotion tables (tabletop 0..11) | full |
+
+`full` = SpringBoard (pose, coremotion, uikit, cmtables, identity, cmquery),
+backboardd (hid), Preferences (coremotion, uikit, cmtables, identity, cmquery).
+`light` drops cmtables, identity and cmquery (posture-independent; checked
+identical in 00–03). Every posture.zsh run verified (exit 0).
+
+`orientation` in each record is the scene's interface orientation, as the
+README defines it (SpringBoard: the primary window scene; Preferences: its
+own window scene; backboardd and the posture-independent groups take
+SpringBoard's). The device orientation passed to the display tool is in the
+posture label. They differ on the inner panel, which is mounted a quarter
+turn from the cover: Preferences on the inner reports interface orientation
+4 (landscapeRight) for a portrait device, 1 for device landscapeLeft and 2
+for device landscapeRight; on the cover it stays 1 (Preferences and the home
+screen do not rotate on the cover). SpringBoard's primary scene is `SB-main`
+(1) when closed and `com.apple.springboard.bringup` when open. The bringup
+scene's interface orientation depends on history: it stayed 1 through the
+portrait book/open/closed runs (00–09, including book landscapeLeft), became
+2 with a landscapeRight device (10, 12), and after the landscape runs it was
+**4** for open portrait (13) and stayed 4 on the dark inner panel after
+closing (14). So `open` portrait reads SpringBoard orientation 1 in
+`open(after-book)` but 4 in `open(portrait,after-open)`; compare against the
+VM with the same history.
+
+## What is synthetic (do not align the VM to these)
+
+The simulator has no hinge, accelerometer, gyro or magnetometer. Three
+different sources answer, and only one of them follows the posture driver:
+
+1. **SpringBoard's display tool (follows the posture).**
+ `posture.zsh` runs `SBDisplayToolServiceCoordinator`, which pushes
+ `SBFSyntheticCMAngle` / `SBFSyntheticMagicPoseEvent` through
+ `SBFDevicePoseProvider`. Everything downstream of the provider follows the
+ posture: `currentPose` (hinge state/position/regions, `cmAngle`,
+ `cmMagicPose`, `uiHingeStatus`, cover/inner orientation), the
+ `FBSSceneSettings` hinge fields SpringBoard sends to scenes, the scene
+ hinge client components, Preferences' `_UIHingeState`, `UIDevice
+ orientation`, and SpringBoard's `currentHingePoseStateForTesting`. These
+ are the values the VM is meant to reproduce, but their CoreMotion-shaped
+ fields are synthetic: `cmMagicPose.hingeState` is 3 (OpenFlat) after
+ *every* swap, closed included, and `cmAngle.timestamp` only becomes
+ non-zero once the tool has run. `sim_note` says "synthetic: written by
+ SpringBoard's display tool sweep".
+2. **CoreMotion / locationd (frozen at the boot value).** In the sim,
+ locationd's `CMDeviceStateRelayManager` publishes two virtual HID services
+ into backboardd: `CoreMotion_DeviceStateRelay_Crane` (usage page 0xFF0C,
+ usage 0x21, the hinge angle; `ReportInterval` 10000, event mask bit 0x2C)
+ and `CoreMotion_DeviceStateRelay_DeviceState` (0xFF0C / 0x22, vendor
+ defined). Their last events, the device state CoreMotion hands out
+ (`propertyA` 1 portrait, `propertyB` 1 closed, timestamp 319060.797), and
+ the device state SpringBoard's own `CMMagicPoseManager` received are the
+ same in every snapshot: closed, 0°, portrait, timestamps unchanged. Nothing
+ the posture driver does reaches CoreMotion or HID. `sim_note` says "sim
+ has no hardware backing".
+3. **Host / CoreSimulator (sim-only).** `sysctl hw.model` `Mac17,9`,
+ `hw.target` `J714sAP`, `kern.*` (host macOS 27.0.1), the `SIMULATOR_*`
+ environment, `UIDevice name` (the sim's name), and MobileGestalt answers
+ that come from the host (`ProductTypeDesc*` `Mac17,9`, `HWModelDescription*`
+ `J714sAP`, `HardwarePlatform` `t6050`, `DeviceMemorySize` 64 GB, `CPU*`,
+ `IsSimulator` true, `device-name` "iPhone Simulator") or from the device
+ type's `capabilities.plist` (screen, artwork, DeviceSupports* entries it
+ lists). These do not exist in this form on the VM.
+
+## SpringBoard's pose path (source chain)
+
+- `-[SpringBoard devicePoseProvider]` is one `SBFDevicePoseProvider`; the same
+ instance sits in `SBDisplayToolService`, `SBDisplayToolServiceCoordinator`,
+ `SBDisplayContentModeCoordinator` (also its `likelyTransitionDelegate`),
+ `SBHingeMotionUnintendedInteractionMonitor` and
+ `SBAmbientPresentationCoordinator` (`raw/sensors/discovery/springboard-selectors.txt`).
+- Its inputs: `_cmAngleManager` (a `CMAngleManager`, `isAngleActive` YES,
+ interval 0.01 s), `_cmMagicPoseManager` (its own `CMMagicPoseManager`, not
+ `+sharedManager`; its `CMDeviceStateManager` is registered for
+ notifications and holds the boot device state), `_accelerometer` **nil**,
+ and the display tool, which overwrites the pose. Its heartbeat source is
+ the `SB-main` scene.
+- Observers (record `SBFDevicePoseProvider._observers`): scene region
+ updaters, `SBDisplayContentModeCoordinator`, `SBFDisplayContentModeResolver`,
+ `SBHomeScreenController`, two `SBTraitsEmbeddedDisplayPipelineManager`,
+ `SBBiometricOcclusionMonitor` ×2, `AMAmbientPresentationTriggerManager`,
+ the UI scene controllers, and SpringBoard itself.
+- `currentPose.internal.isOnVM` is **NO** in the sim (worth comparing: the
+ provider has a VM flag), `isDisplaySupport3Set` NO, `hingeRegionsAreDefault`
+ YES, `usesStrictCoreMotion` NO, `invertHingeAngles` NO,
+ `flipState.isAvailable` NO, `continuousFoldEnabled` YES, transition style 2.
+- Boundaries (`SBFDevicePosePTSettings`): opens at 5°, closes at 175°, flat
+ at 175°; swap degrees 85 (continuous live), 20/85 (snapshot open/close),
+ 85 (fade). `settings.closedToPartiallyOpenBoundary` moves with history: 85
+ at boot, 20 after a sweep that ended open.
+- Hinge regions move with history (provider description): at boot `closed`
+ is 0.00→0.47; after book 0.00→0.28 (partiallyOpen 0.28→0.97, toClosed
+ 0.56→0.03); after a fold from open or book 0.00→0.11. Open is the same from
+ either path.
+
+| snapshot | hinge state @ position | uiHingeStatus {status, magicPose, angle} | pose orientation / cover / inner | cmMagicPose {orient, cover, inner, hinge} |
+| --- | --- | --- | --- | --- |
+| boot | 1 closed @ 0 | 1, 0, 0 | 1 / 1 / 1 | 1, 1, **0**, **1** (CoreMotion's own) |
+| book(after-closed) | 2 partiallyOpen @ 0.556 | 2, 3, 100 | 1 / 1 / 1 | 1, 1, 1, 3 |
+| open(after-book) | 3 openFlat @ 1 | 3, 0, 180 | 1 / 1 / 1 | 1, 1, 1, 3 |
+| closed(after-open) | 1 @ 0 | 1, 0, 0 | 1 / 1 / 1 | 1, 1, 1, 3 |
+| open(after-closed), book(after-open), closed(after-book) | same as the rows above for that posture | | | |
+| closed(landscapeLeft) | 1 @ 0 | 1, 0, 0 | 3 / 4 / 3 | 3, 4, 3, 3 |
+| closed(landscapeRight) | 1 @ 0 | 1, 0, 0 | 4 / 3 / 4 | 4, 3, 4, 3 |
+| book(landscapeLeft) | 2 @ 0.556 | 2, 5, 100 | 3 / 4 / 3 | 3, 4, 3, 3 |
+| book(landscapeRight) | 2 @ 0.556 | 2, 6, 100 | 4 / 3 / 4 | 4, 3, 4, 3 |
+| open(landscapeLeft) | 3 @ 1 | 3, 0, 180 | 3 / 4 / 3 | 3, 4, 3, 3 |
+| open(landscapeRight) | 3 @ 1 | 3, 0, 180 | 4 / 3 / 4 | 4, 3, 4, 3 |
+| open(portrait), closed(portrait) after landscape | as open / closed portrait | | 1 / 1 / 1 | 1, 1, 1, 3 |
+
+`uiHingeStatus.magicPose` uses the tabletop pose numbering (3
+PartiallyOpenPortrait, 5 PartiallyOpenLandscapeLeft), not CoreMotion's hinge
+state. `UIDevice orientation` (SpringBoard and Preferences alike) is the lit
+panel's device orientation: closed landscapeLeft → 4 (the cover's), book
+landscapeLeft → 3 (the inner's).
+
+## App side (Preferences)
+
+- `_UISceneHingeStateClientComponent` exists on every scene but holds no
+ state until something observes it (`wantsSceneHingeState: NO`,
+ `hingeState` nil). `probes/sensors-app-hinge-register.lldb` registers one
+ no-op observer per scene, the way `UIHingeInteraction` does: a runtime class
+ `VPSensorsHingeObserver` whose callback IMP is `-[NSObject self]`, kept alive
+ by an associated object on `UIApplication` (no block escapes). After that
+ the component reports, per posture: closed `status` 1 / angle 0, book
+ `status` 3 / `magicPose` 3 / angle 100, open `status` 4 / angle 180. Note
+ the numbering differs from SpringBoard's `uiHingeStatus.status` (1/2/3).
+- Preferences' `FBSSceneSettings` hinge fields (`hingeAngle`, `hingeStatus`,
+ `magicPose`, …) stay 0 in every posture; the state arrives in
+ `sceneHingeState` instead.
+- `UIApplication currentHingePoseStateForTesting` is {0,0,0,0} in
+ Preferences in every posture (it is SpringBoard's testing state; in
+ SpringBoard it follows the pose, e.g. {3,3,3,0} for closed landscapeLeft).
+- CoreMotion in the app: same frozen device state as SpringBoard;
+ `queryDeviceStateBlocking` returns nil at once in both processes.
+
+## HID (backboardd)
+
+- `[[BKHIDSystem sharedInstance] IOHIDServicesMatching:nil]` lists 15
+ services (an empty dictionary matches none; `IOHIDEventSystemCopyServices`
+ on its `_HIDEventSystem` gives the same 15). Two are CoreMotion's virtual
+ relays (`Transport` Virtual, `VendorID`/`ProductID` 0xFF00):
+ - `CoreMotion_DeviceStateRelay_Crane`, `PrimaryUsagePage` 0xFF0C,
+ `PrimaryUsage` 0x21 — the same usage pair the VM's Hinge dylib publishes.
+ `IOHIDServiceCopyEvent(svc, 0x2C)` returns a hinge-angle event:
+ `AngleDegrees` 0, `MechanicalAngleDegrees` 0, velocity NaN, `State`
+ Closed, phase Changed, with a vendor-defined child (usage 0x80, 21 bytes).
+ - `CoreMotion_DeviceStateRelay_DeviceState`, 0xFF0C / 0x22: last event is
+ vendor defined, data `02 01 01 00 01 00 00 01`.
+- Both events carry the same timestamps (mach 7657459129569 / …269) in every
+ snapshot: **the posture driver produces no HID hinge event**; it bypasses
+ HID and CoreMotion entirely and writes SpringBoard's pose provider. On the
+ VM, which injects `IOHIDEventCreateHingeAngleEvent` into a 0xFF0C/0x21
+ virtual service, the event path is real; in the sim it only carries the
+ boot value.
+- No `BK*`/`Sim*`/`HID*` class with "hinge" in its name is loaded in
+ backboardd; `BKHIDEventProcessorRegistry` has no hinge processor (list in
+ `BKHIDEventProcessorRegistry.eventProcessors`). `HIDVirtualEventService`
+ exists. `-[BKHIDSystem systemEventOfType:0x2C …]` returns the DeviceState
+ relay's vendor event, not a hinge event.
+- The rest are the simulator's HID services (SimulatorHID: digitizers 0x0D/0x04
+ for each display, keyboard, buttons, game controller, Indigo `0xacefade…`
+ services); full properties in `IOHIDService.properties`.
+
+## UIDevice
+
+Every zero-argument getter of `UIDevice` (instance and class, from
+`class_copyMethodList`) is recorded; serial/UDID/vendor-identifier getters,
+allocators and `_tapticEngine` are recorded as skipped. Highlights:
+`model`/`localizedModel` "iPhone", `systemName` "iOS", `systemVersion` "27.1",
+`userInterfaceIdiom` 0, `sf_productType` "iPhone19,4", `_hasTouchPad` YES,
+`_supportsForceTouch` NO, `_nativeScreenGamut` 1, `_feedbackSupportLevel` 0,
+`batteryLevel` -1, `+_hasHomeButton` NO. There is **no** hinge, tabletop,
+posture or fold getter on `UIDevice` in iOS 27.1: `hingeState`,
+`tabletopPose`, `_hingeState`, `hingeAngle`, `isFoldable`, `_isFoldable`,
+`foldState`, `posture`, `_userInterfaceIdiom` and `_deviceOrientation` all
+fail `respondsToSelector:` (recorded with that error).
+`+[UIDevice currentDeviceOrientationAllowingAmbiguous:YES]` is 0 in SpringBoard
+in every posture, while in Preferences it follows the lit panel's device
+orientation like `-orientation` (1 portrait, 3/4 for book landscape).
+
+## CoreMotion mapping tables (posture-independent)
+
+Identical in every full snapshot, in SpringBoard and Preferences.
+`+[CMMagicPoseManager orientationForMagicPose:deviceSurface:]` equals
+`+[CMDeviceStateEvent propertyAForConfigType:surface propertyA:orientation
+propertyB:hinge propertyC:tabletop]` for every input (checked row by row;
+`createDeviceStateEventFromMagicPoseEvent:` copies orientation, hinge state
+and tabletop pose unchanged). In the sim `sharedManager` exists, unlike the
+VM. Rows: result for device orientation A = 0..7 (0 Ambiguous, 1 Portrait,
+2 UpsideDown, 3 LandscapeLeft, 4 LandscapeRight, 5 FaceUp, 6 FaceDown, 7
+invalid). All rows not listed are 0 (ambiguous).
+
+| surface / configType | hinge B | tabletop C | A = 0..7 → |
+| --- | --- | --- | --- |
+| 0 and 1 (cover) | 1 Closed | any 0..11 | 0,1,2,3,4,5,6,7 (identity) |
+| 0 and 1 | 2 PartiallyOpen, 3 OpenFlat | 0 or 11 | 0,1,2,**4,3,6,5**,0 (L/R and face up/down swapped) |
+| 0 and 1 | 2, 3 | 1/2/3/4/5/6/7/8/9/10 | constant 3/4/1/2/6/3/4/5/6/1 |
+| 2 (inner) | 1 Closed | any | 0 (ambiguous) |
+| 2 | 2, 3 | 0 or 11 | 0,1,2,3,4,5,6,0 (identity) |
+| 2 | 2, 3 | 1, 2 | 0 |
+| 2 | 2, 3 | 3/4/5/6/7/8/9/10 | constant 1/2/3/4/6/6/5/1 |
+| any | 0, 4 OpenAmbiguous, 5 OpenTransitioning, 6 | any | 0 |
+| 3, 4 | any | any | 0 (CoreMotion logs "Invalid configType: 3") |
+
+Against FoldDisplay's hard-coded mapping (VM, commit bb690532): B 1 → cover
+takes A, inner ambiguous: **matches**. B 2/3 → inner takes A, cover takes A
+with L/R and face up/down swapped: **matches for tabletop 0** (and 11). B 4
+and others → ambiguous: **matches**. Not covered by the VM's mapping: a
+non-zero tabletop pose with B 2/3 replaces A with a constant (table above),
+and orientation 7 maps to 0 when open. Surface 0 behaves like surface 1.
+
+String tables (`stringFor…` records): magic pose hinge state 0 Ambiguous, 1
+Closed, 2 PartiallyOpen, 3 OpenFlat, 4 OpenAmbiguous, 5 OpenTransitioning;
+tabletop 1 ClosedLandscapeLeft, 2 ClosedLandscapeRight, 3
+PartiallyOpenPortrait, 4 …PortraitUpsideDown, 5 …LandscapeLeft, 6
+…LandscapeRight, 7 PartiallyOpenFaceDown, 8 OpenFlatFaceDown, 9
+OpenFlatFaceUp, 10 OpenFlatPortrait; device state properties are named
+ParameterA… (B: 9 = Max, C: 11 = Max).
+
+## Identity (MobileGestalt, sysctl, environment)
+
+527 `MGCopyAnswer` keys (list: `raw/sensors/identity/mg-keys-queried.txt`,
+taken from the strings of the sim's `libMobileGestalt.dylib` filtered to
+screen/fold/device-class/layout/identity names, plus every key in the device
+type's `capabilities.plist`, plus a few guessed fold keys that come back nil).
+Values are identical in SpringBoard and Preferences and in every posture.
+Selected answers: `ProductType`/`HWModelStr`/`SubProductType`/
+`ThinningProductType` iPhone19,4; `DeviceClass` iPhone, `DeviceClassNumber` 1;
+`ModelNumber`/`RegulatoryModelNumber` A3447; `DeviceVariant` A;
+`marketing-name` "iPhone Duo"; `HomeButtonType` 2; `DeviceCornerRadius` 59;
+`HasThinBezel`, `IsLargeFormatPhone`, `DeviceSupportsDynamicIsland`,
+`DeviceSupportsAlwaysOnDisplay`(+Flipbook, AlwaysOnTime) true;
+`DeviceSupportsEnhancedMultitasking` and `…SingleDisplayEnhancedMultitasking`
+false; `main-screen-width/height/scale/pitch` 1398/2034/3/460 (the cover);
+`ScreenCaptureWidth/Height` 1398/2034; `ArtworkTraits` phone, subtype 2034,
+scale 3, P3, "iPhone Duo", APPLE11; `DisplayExtendedProperties` two entries:
+cover (`DeviceSurfaceType` 1, rotation 0, corners 8,8,59,59) and inner
+(`DeviceSurfaceType` 2, rotation 270, corners 55×4);
+`MGGetLogicalDeviceDisplayCount` 2. Nil in the sim: `DeviceSurfaceType`,
+`main-screen-class`, `main-screen-orientation`, `MainScreenClass`,
+`MainScreenScale`, `MainDisplayRotation`, `DisplayBootRotation`,
+`MainScreenCanvasSizes`, `ScreenDimensions(Capability)`, `idiom`, `subtype`,
+`HasPartiallyOccludedDisplay`, `OLEDDisplay`, `DisplayMaxNits`, and every
+fold/hinge-named key tried. `MGCopyAnswerForDisplayAtIndex` returns nil for
+all ten `kMGDisplayIndexedQuery*` keys at indices 0..2 (the keys are
+self-pointers; both call forms tried, `raw/sensors/discovery/mg-display-index.txt`).
+
+## Missing, nil or errored
+
+- `UIDevice` has no `hingeState`, `tabletopPose`, `_hingeState`, `hingeAngle`,
+ `isFoldable`, `_isFoldable`, `foldState`, `posture`, `_userInterfaceIdiom`,
+ `_deviceOrientation`.
+- `SBFDevicePoseProvider._accelerometer` nil.
+- `+[CMFactoryAngleManager isAvailable]` raises SIGABRT in SpringBoard
+ (`raw/sensors/test/bisect.txt`); recorded as not called.
+- `-[CMDeviceStateManager queryDeviceStateBlocking]` nil in both processes.
+- `SBFDevicePoseDefaults lastKnownCMAngleDictionary` /
+ `lastKnownCMMagicPoseDictionary` nil.
+- `CMMotionManager` accelerometer/gyro/magnetometer/deviceMotion unavailable,
+ `availableAttitudeReferenceFrames` 0 (yet MG `accelerometer`,
+ `magnetometer` true from capabilities.plist).
+- Scene hinge client components on SpringBoard's system-aperture scenes: nil
+ state; on the app scene: nil until an observer registers.
+- MobileGestalt: see the nil list above; 249 of 527 keys are nil.
+
+## Harness notes and workarounds
+
+- lldb expressions here reject messages to `id` and `@try`; locals are typed
+ `NSObject *`, chained KVC is cast at each step, scalar ivars are read
+ through `class_getInstanceVariable` + offset (KVC on CoreMotion internals
+ aborted), `strrchr`/`strstr`/`isnan`/`isinf` do not link (use NSString and
+ comparisons). A sanitizer turns NaN/Inf into strings before
+ `NSJSONSerialization` (the hinge HID event's velocity is NaN).
+- `IOHIDServicesMatching:@{}` matches nothing; pass nil.
+- `posture.zsh` defaults `POSTURE_OUT` to the shared `raw/posture`; the runner
+ sets `raw/sensors/posture`.
+- `SpringBoard` responds to `devicePoseProvider` but not to
+ `_displayToolService` (that is only an ivar), so `respondsToSelector:` must
+ test the former to detect SpringBoard.
+- App scene persistent identifiers are UUIDs (Preferences' was
+ `20901331-…` for the whole run); join app-scene records on the display
+ identity in the `call` (`on Main` / `on Unknown.main[3]`), not the UUID.
diff --git a/Research/Guest/Evidence/duo-sim-baseline/smoke.json b/Research/Guest/Evidence/duo-sim-baseline/smoke.json
new file mode 100644
index 00000000..fb9fc1db
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/smoke.json
@@ -0,0 +1,941 @@
+{
+ "meta": {
+ "domain": "smoke",
+ "runtime": {
+ "identifier": "com.apple.CoreSimulator.SimRuntime.iOS-27-1",
+ "version": "27.1",
+ "buildversion": "24A94425"
+ },
+ "device": {
+ "name": "duo-baseline-harness",
+ "udid": "D13582ED-1932-4E12-800F-A44CFE16EA8E",
+ "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-Duo"
+ },
+ "xcode": "Xcode 27.1 Build version 27A9275",
+ "host": "27.0.1 Apple M5 Pro",
+ "date": "2026-10-29T05:45:22Z",
+ "posture_mechanism": "SBDisplayToolServiceCoordinator performDisplaySwapWithSettings: (tools/posture.zsh)",
+ "postures": [
+ {
+ "udid": "D13582ED-1932-4E12-800F-A44CFE16EA8E",
+ "posture": "closed",
+ "label": "closed",
+ "anchor": "none",
+ "requested_position": "closed",
+ "swap_options": "",
+ "swap_result": "parsed=1 started=1 targetMode=1 targetHingePosition=0.000000 duration=-1.000 profileOverride=0 deviceOrientation=0 error=(null)",
+ "settled": true,
+ "springboard": {
+ "hinge_state": "closed",
+ "position": "0.000 (0.000°)",
+ "prevailing_policy": "FullyClosed",
+ "primary_on": "cover",
+ "displays": [
+ {
+ "identifier": "38BD3D83-F64C-44DD-B9C3-5280CBD05F98",
+ "surface": "inner",
+ "applied": "disabled",
+ "target": "disabled"
+ },
+ {
+ "identifier": "5303539D-9680-4714-B2B1-C9E576109B16",
+ "surface": "cover",
+ "applied": "primaryContent",
+ "target": "primaryContent"
+ }
+ ]
+ },
+ "screenshots": {
+ "display1_cover": "lit",
+ "display3_inner": "dark",
+ "lit_panel": "cover"
+ },
+ "expected_lit_panel": "cover",
+ "ok": true,
+ "artifacts": "raw/smoke/20261029-134407-closed"
+ },
+ {
+ "udid": "D13582ED-1932-4E12-800F-A44CFE16EA8E",
+ "posture": "book",
+ "label": "book",
+ "anchor": "closed",
+ "requested_position": "book",
+ "swap_options": "",
+ "swap_result": "parsed=1 started=1 targetMode=1 targetHingePosition=0.555556 duration=-1.000 profileOverride=0 deviceOrientation=0 error=(null)",
+ "settled": true,
+ "springboard": {
+ "hinge_state": "partiallyOpen",
+ "position": "0.556 (100.000°)",
+ "prevailing_policy": "FoldingDual",
+ "primary_on": "inner",
+ "displays": [
+ {
+ "identifier": "38BD3D83-F64C-44DD-B9C3-5280CBD05F98",
+ "surface": "inner",
+ "applied": "primaryContent",
+ "target": "primaryContent"
+ },
+ {
+ "identifier": "5303539D-9680-4714-B2B1-C9E576109B16",
+ "surface": "cover",
+ "applied": "auxiliaryContent",
+ "target": "auxiliaryContent"
+ }
+ ]
+ },
+ "screenshots": {
+ "display1_cover": "dark",
+ "display3_inner": "lit",
+ "lit_panel": "inner"
+ },
+ "expected_lit_panel": "inner",
+ "ok": true,
+ "artifacts": "raw/smoke/20261029-134427-book"
+ },
+ {
+ "udid": "D13582ED-1932-4E12-800F-A44CFE16EA8E",
+ "posture": "open",
+ "label": "open",
+ "anchor": "none",
+ "requested_position": "open",
+ "swap_options": "",
+ "swap_result": "parsed=1 started=1 targetMode=1 targetHingePosition=1.000000 duration=-1.000 profileOverride=0 deviceOrientation=0 error=(null)",
+ "settled": true,
+ "springboard": {
+ "hinge_state": "openFlat",
+ "position": "1.000 (180.000°)",
+ "prevailing_policy": "FoldingDual",
+ "primary_on": "inner",
+ "displays": [
+ {
+ "identifier": "38BD3D83-F64C-44DD-B9C3-5280CBD05F98",
+ "surface": "inner",
+ "applied": "primaryContent",
+ "target": "primaryContent"
+ },
+ {
+ "identifier": "5303539D-9680-4714-B2B1-C9E576109B16",
+ "surface": "cover",
+ "applied": "auxiliaryContent",
+ "target": "auxiliaryContent"
+ }
+ ]
+ },
+ "screenshots": {
+ "display1_cover": "dark",
+ "display3_inner": "lit",
+ "lit_panel": "inner"
+ },
+ "expected_lit_panel": "inner",
+ "ok": true,
+ "artifacts": "raw/smoke/20261029-134502-open"
+ }
+ ]
+ },
+ "records": [
+ {
+ "api": "UIScreen.screens",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens].count",
+ "value": 2,
+ "error": null
+ },
+ {
+ "api": "UIScreen.bounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].bounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeBounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].nativeBounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 1398,
+ "height": 2034
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.scale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].scale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeScale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].nativeScale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.isMainScreen",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0] == [UIScreen mainScreen]",
+ "value": true,
+ "error": null
+ },
+ {
+ "api": "UIScreen.displayIdentity",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0] valueForKey:@\"displayIdentity\"",
+ "value": "Main",
+ "error": null
+ },
+ {
+ "api": "UIScreen._name",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0]._name",
+ "value": "LCD",
+ "error": null
+ },
+ {
+ "api": "UIScreen.bounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].bounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeBounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].nativeBounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 2007,
+ "height": 2853
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.scale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].scale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeScale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].nativeScale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.isMainScreen",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1] == [UIScreen mainScreen]",
+ "value": false,
+ "error": null
+ },
+ {
+ "api": "UIScreen.displayIdentity",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1] valueForKey:@\"displayIdentity\"",
+ "value": "Unknown.main[3]",
+ "error": null
+ },
+ {
+ "api": "UIScreen._name",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1]._name",
+ "value": "LCD-1",
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.primaryWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator primaryWindowScene]",
+ "value": {
+ "displayIdentity": "Main",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "SB-main"
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.activeWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator activeWindowScene]",
+ "value": {
+ "displayIdentity": "Main",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "SB-main"
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.displayContentModeForWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<SB-main>]",
+ "value": {
+ "scene": {
+ "displayIdentity": "Main",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "SB-main"
+ },
+ "userInitiated": false,
+ "displayContentMode": 2
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.displayContentModeForWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<com.apple.springboard.bringup>]",
+ "value": {
+ "scene": {
+ "displayIdentity": "Unknown.main[3]",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "com.apple.springboard.bringup"
+ },
+ "userInitiated": false,
+ "displayContentMode": 1
+ },
+ "error": null
+ },
+ {
+ "api": "SBFDisplayContentModeResolver.description",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "closed",
+ "orientation": "portrait",
+ "call": "[[SBDisplayContentModeCoordinator valueForKey:@\"_resolver\"] description]",
+ "value": "<SBFDisplayContentModeResolver: 0x10f16df80> {\n Prevailing Policy: FullyClosed;\n Preferred Transition Style: .continuousSnapshot;\n Ready To Resolve: YES;\n Policies: {\n Single: —;\n FoldingDual: —, primary on .cover;\n Yoink(none): —, primary on .default, 0 persistent, 0 transient;\n Tent: —, primary on .cover;\n FullyClosed: prevailing, primary on .cover;\n ForceCoverDisplayEnabledOnly: —, primary on .cover;\n };\n Device Pose Provider: <SBFDevicePoseProvider 0x10caa9500>\nContinuous Fold Position: 0.000\n\nSBFHingeState: .closed\n Position: 0.000 (0.000°)\n Progress: 1.000\n To Swap: 1.000\n From Swap: 1.000\n\n fullyClosed: 0.00→0.03 Active\n closed: 0.00→0.11 Active\npartiallyOpen: 0.11→0.97 Possible\n openFlat: 0.97→1.00 Disabled\nfoldAvoidance: 0.11→0.97 Disabled\n toOpen: 0.03→0.97 Possible\n toClosed: 0.97→0.03 Disabled\n\n Opens at: 5.0° or below\n Closes at: 175.0° or above\n Flat at: 175.0° or above\n\n Device: portrait (1);\n Displays: [\n <SBFDisplayProxy: 0x128a444b0; identifier: 38BD3D83-F64C-44DD-B9C3-5280CBD05F98> {\n surfaceType: .inner;\n applied: .disabled;\n target: .disabled;\n },\n <SBFDisplayProxy: 0x1267c5560; identifier: 5303539D-9680-4714-B2B1-C9E576109B16> {\n surfaceType: .cover;\n applied: .primaryContent;\n target: .primaryContent;\n }\n ];\n}",
+ "error": null
+ },
+ {
+ "api": "UIScreen.screens",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens].count",
+ "value": 2,
+ "error": null
+ },
+ {
+ "api": "UIScreen.bounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].bounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeBounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].nativeBounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 1398,
+ "height": 2034
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.scale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].scale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeScale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].nativeScale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.isMainScreen",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0] == [UIScreen mainScreen]",
+ "value": true,
+ "error": null
+ },
+ {
+ "api": "UIScreen.displayIdentity",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0] valueForKey:@\"displayIdentity\"",
+ "value": "Main",
+ "error": null
+ },
+ {
+ "api": "UIScreen._name",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0]._name",
+ "value": "LCD",
+ "error": null
+ },
+ {
+ "api": "UIScreen.bounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].bounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeBounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].nativeBounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 2007,
+ "height": 2853
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.scale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].scale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeScale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].nativeScale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.isMainScreen",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1] == [UIScreen mainScreen]",
+ "value": false,
+ "error": null
+ },
+ {
+ "api": "UIScreen.displayIdentity",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1] valueForKey:@\"displayIdentity\"",
+ "value": "Unknown.main[3]",
+ "error": null
+ },
+ {
+ "api": "UIScreen._name",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1]._name",
+ "value": "LCD-1",
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.primaryWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator primaryWindowScene]",
+ "value": {
+ "displayIdentity": "Unknown.main[3]",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "com.apple.springboard.bringup"
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.activeWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator activeWindowScene]",
+ "value": {
+ "displayIdentity": "Unknown.main[3]",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "com.apple.springboard.bringup"
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.displayContentModeForWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<SB-main>]",
+ "value": {
+ "scene": {
+ "displayIdentity": "Main",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "SB-main"
+ },
+ "userInitiated": false,
+ "displayContentMode": 3
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.displayContentModeForWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<com.apple.springboard.bringup>]",
+ "value": {
+ "scene": {
+ "displayIdentity": "Unknown.main[3]",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "com.apple.springboard.bringup"
+ },
+ "userInitiated": false,
+ "displayContentMode": 2
+ },
+ "error": null
+ },
+ {
+ "api": "SBFDisplayContentModeResolver.description",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "book",
+ "orientation": "portrait",
+ "call": "[[SBDisplayContentModeCoordinator valueForKey:@\"_resolver\"] description]",
+ "value": "<SBFDisplayContentModeResolver: 0x10f16df80> {\n Prevailing Policy: FoldingDual;\n Preferred Transition Style: .continuousSnapshot;\n Ready To Resolve: YES;\n Policies: {\n Single: —;\n FoldingDual: prevailing, primary on .inner;\n Yoink(none): —, primary on .default, 0 persistent, 0 transient;\n Tent: —, primary on .cover;\n FullyClosed: —, primary on .cover;\n ForceCoverDisplayEnabledOnly: —, primary on .cover;\n };\n Device Pose Provider: <SBFDevicePoseProvider 0x10caa9500>\nContinuous Fold Position: 1.000\n\nSBFHingeState: .partiallyOpen\n Position: 0.556 (100.000°)\n Progress: 1.000\n To Swap: 1.000\n From Swap: 1.000\n\n fullyClosed: 0.00→0.03 Disabled\n closed: 0.00→0.28 Possible\npartiallyOpen: 0.28→0.97 Active\n openFlat: 0.97→1.00 Possible\nfoldAvoidance: 0.28→0.97 Active\n toOpen: 0.03→0.56 Disabled\n toClosed: 0.56→0.03 Possible\n\n Opens at: 5.0° or below\n Closes at: 175.0° or above\n Flat at: 175.0° or above\n\n Device: portrait (1);\n Displays: [\n <SBFDisplayProxy: 0x128a444b0; identifier: 38BD3D83-F64C-44DD-B9C3-5280CBD05F98> {\n surfaceType: .inner;\n applied: .primaryContent;\n target: .primaryContent;\n },\n <SBFDisplayProxy: 0x1267c5560; identifier: 5303539D-9680-4714-B2B1-C9E576109B16> {\n surfaceType: .cover;\n applied: .auxiliaryContent;\n target: .auxiliaryContent;\n }\n ];\n}",
+ "error": null
+ },
+ {
+ "api": "UIScreen.screens",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens].count",
+ "value": 2,
+ "error": null
+ },
+ {
+ "api": "UIScreen.bounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].bounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeBounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].nativeBounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 1398,
+ "height": 2034
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.scale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].scale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeScale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0].nativeScale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.isMainScreen",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0] == [UIScreen mainScreen]",
+ "value": true,
+ "error": null
+ },
+ {
+ "api": "UIScreen.displayIdentity",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0] valueForKey:@\"displayIdentity\"",
+ "value": "Main",
+ "error": null
+ },
+ {
+ "api": "UIScreen._name",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][0]._name",
+ "value": "LCD",
+ "error": null
+ },
+ {
+ "api": "UIScreen.bounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].bounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeBounds",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].nativeBounds",
+ "value": {
+ "y": 0,
+ "x": 0,
+ "width": 2007,
+ "height": 2853
+ },
+ "error": null
+ },
+ {
+ "api": "UIScreen.scale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].scale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.nativeScale",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1].nativeScale",
+ "value": 3,
+ "error": null
+ },
+ {
+ "api": "UIScreen.isMainScreen",
+ "kind": "public",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1] == [UIScreen mainScreen]",
+ "value": false,
+ "error": null
+ },
+ {
+ "api": "UIScreen.displayIdentity",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1] valueForKey:@\"displayIdentity\"",
+ "value": "Unknown.main[3]",
+ "error": null
+ },
+ {
+ "api": "UIScreen._name",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[UIScreen screens][1]._name",
+ "value": "LCD-1",
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.primaryWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator primaryWindowScene]",
+ "value": {
+ "displayIdentity": "Unknown.main[3]",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "com.apple.springboard.bringup"
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.activeWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator activeWindowScene]",
+ "value": {
+ "displayIdentity": "Unknown.main[3]",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "com.apple.springboard.bringup"
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.displayContentModeForWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<SB-main>]",
+ "value": {
+ "scene": {
+ "displayIdentity": "Main",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 466,
+ "height": 678
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "SB-main"
+ },
+ "userInitiated": false,
+ "displayContentMode": 3
+ },
+ "error": null
+ },
+ {
+ "api": "SBDisplayContentModeCoordinator.displayContentModeForWindowScene",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[SBDisplayContentModeCoordinator displayContentModeForWindowScene:<com.apple.springboard.bringup>]",
+ "value": {
+ "scene": {
+ "displayIdentity": "Unknown.main[3]",
+ "screenBounds": {
+ "y": 0,
+ "x": 0,
+ "width": 951,
+ "height": 669
+ },
+ "interfaceOrientation": 1,
+ "persistentIdentifier": "com.apple.springboard.bringup"
+ },
+ "userInitiated": false,
+ "displayContentMode": 2
+ },
+ "error": null
+ },
+ {
+ "api": "SBFDisplayContentModeResolver.description",
+ "kind": "private",
+ "process": "SpringBoard",
+ "posture": "open",
+ "orientation": "portrait",
+ "call": "[[SBDisplayContentModeCoordinator valueForKey:@\"_resolver\"] description]",
+ "value": "<SBFDisplayContentModeResolver: 0x10f16df80> {\n Prevailing Policy: FoldingDual;\n Preferred Transition Style: .continuousSnapshot;\n Ready To Resolve: YES;\n Policies: {\n Single: —;\n FoldingDual: prevailing, primary on .inner;\n Yoink(none): —, primary on .default, 0 persistent, 0 transient;\n Tent: —, primary on .cover;\n FullyClosed: —, primary on .cover;\n ForceCoverDisplayEnabledOnly: —, primary on .cover;\n };\n Device Pose Provider: <SBFDevicePoseProvider 0x10caa9500>\nContinuous Fold Position: 1.000\n\nSBFHingeState: .openFlat\n Position: 1.000 (180.000°)\n Progress: 1.000\n To Swap: 1.000\n From Swap: 1.000\n\n fullyClosed: 0.00→0.03 Disabled\n closed: 0.00→0.47 Disabled\npartiallyOpen: 0.47→0.97 Possible\n openFlat: 0.97→1.00 Active\nfoldAvoidance: 0.47→0.97 Disabled\n toOpen: 0.03→0.97 Disabled\n toClosed: 0.97→0.03 Possible\n\n Opens at: 5.0° or below\n Closes at: 175.0° or above\n Flat at: 175.0° or above\n\n Device: portrait (1);\n Displays: [\n <SBFDisplayProxy: 0x128a444b0; identifier: 38BD3D83-F64C-44DD-B9C3-5280CBD05F98> {\n surfaceType: .inner;\n applied: .primaryContent;\n target: .primaryContent;\n },\n <SBFDisplayProxy: 0x1267c5560; identifier: 5303539D-9680-4714-B2B1-C9E576109B16> {\n surfaceType: .cover;\n applied: .auxiliaryContent;\n target: .auxiliaryContent;\n }\n ];\n}",
+ "error": null
+ }
+ ]
+}
diff --git a/Research/Guest/Evidence/duo-sim-baseline/springboard.md b/Research/Guest/Evidence/duo-sim-baseline/springboard.md
new file mode 100644
index 00000000..3409f0e8
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/springboard.md
@@ -0,0 +1,162 @@
+# SpringBoard domain: fold policy, window scenes, rotation, power
+
+Simulator `duo-baseline-springboard` (048B820B-86E8-43F9-9DF1-F76802AD6DB8), iPhone19,4,
+iOS 27.1 24A94425. Data: `springboard.json` (37408 records from 45 steps, 734 distinct
+`api` keys). Raw transcripts are in `raw/springboard/steps/`, posture artifacts and screenshots
+in `raw/springboard/posture/`, and class dumps in `raw/springboard/classdump*.txt`.
+
+## How it was recorded
+
+- `probes/springboard-state.lldb` is one expression that walks from `-[SpringBoard
+ _displayToolService]` to the content-mode coordinator, resolver, window-scene manager, pose
+ provider and swap coordinator, and from there to each `SBWindowScene` and its controllers. It
+ records every getter it lists, and every declared property of `SBWindowScene` and of the
+ settings classes (enumerated with `class_copyPropertyList`). Getters run through
+ `NSInvocation` after a `respondsToSelector:` check, because lldb expressions cannot catch
+ exceptions (`@try` is rejected). Ivars are read by their type encoding.
+- `probes/springboard-run.zsh <step> <posture args|status>` runs `tools/posture.zsh` (with
+ `POSTURE_OUT=raw/springboard/posture`) and then the state probe.
+ `probes/springboard-merge.zsh` builds `springboard.json`; its step table is the run order,
+ except that the two `*-initial`/`*-unfold` Safari steps were captured again after the lock
+ tests. The first captures were overwritten.
+- API naming: `SBWindowScene[cover]` means surfaceType 1 (`SB-main`, display `Main`).
+ `SBWindowScene[inner]` means surfaceType 2 (`com.apple.springboard.bringup`,
+ `Unknown.main[3]`). `SBFDisplayProxy[cover|inner]` follows the same rule. Object-valued
+ `SBWindowScene` properties are recorded as `<ClassName>` (presence and class), not as their
+ description. Addresses are normalised to `0x*` in the JSON.
+- `orientation` is the primary scene's `UIWindowScene.interfaceOrientation`, as in smoke.json. The
+ requested device orientation and any foreground app are in the `posture` label, for example
+ `closed[device:landscapeLeft,app:MobileSafari]`.
+- Enum values: content mode 1 = disabled, 2 = primaryContent, 3 = auxiliaryContent. Resolver
+ `_preferredTransitionStyle` 1 = `.fade`, 2 = `.continuousLive`, 3 = `.continuousSnapshot`.
+ `SBBacklightController.backlightState` 1 = on, 3 = always-on (AOD; `screenIsOn` NO,
+ lock screen visible and dimmed), 4 = off.
+
+## Results
+
+| posture | prevailing policy | primary scene | cover / inner content mode | backlight cover / inner |
+| --- | --- | --- | --- | --- |
+| closed (every history) | FullyClosed | cover `SB-main` | 2 / 1 | 1 / 4 |
+| book (every history) | FoldingDual | inner `bringup` | 3 / 2 | 4 / 1 |
+| open (every history) | FoldingDual | inner `bringup` | 3 / 2 | 4 / 1 |
+
+These rows hold for every orientation and app tried. `activeWindowScene`, the active
+lock-screen manager (`SBDisplayContentModeLockScreenActiveDisplayPolicy`), alert items and
+keyboard focus all follow the primary scene. `[SBLockScreenManager sharedInstance]`,
+`[SBIconController sharedInstance]` and `+[SBBacklightController
+sharedInstanceForMainDisplay]` always belong to the **cover** scene. Each scene has its own
+home-screen controller, cover sheet window and status-bar window, and each of them sits in
+its own scene.
+
+### Rotation
+
+The swap tool's `-deviceOrientation=` reaches the pose. `SBFDevicePoseProvider` stores the
+device orientation together with a per-panel orientation: device landscapeLeft (3) gives cover
+4 and inner 3, landscapeRight (4) gives cover 3 and inner 4, and portraitUpsideDown (2) gives
+2 for both. `UIDevice.orientation` in SpringBoard follows the cover orientation.
+`SBFDevicePoseProvider->_accelerometer` is nil in the sim.
+
+- **Cover: home screen refuses landscape; a landscape-capable app gets it.**
+ - Home screen: the cover's `SBTraitsParticipantRoleHomeScreen` supports only portrait
+ (mask 2). The cover's `systemArbitratedDeviceOrientation` becomes 4, 3 or 2, but
+ `systemArbitratedInterfaceOrientation` stays 1.
+ - MobileSafari in front: its participant (`SwitcherLiveOverlay`, mask 26) rotates. Device
+ landscapeLeft gives cover interface 4 and landscapeRight gives 3.
+ `[UIScreen mainScreen].bounds` becomes 678×466. The display 1 capture is 2034×1398 and
+ shows Safari laid out in landscape (`raw/springboard/posture/20261029-143539-closed-d1.png`).
+ - SpringBoard's own `SBWindowScene[cover].interfaceOrientation` and the cover status bar stay
+ 1 throughout.
+ - So "cover refuses landscape" matches stock behaviour only while the home screen (or another
+ portrait-only participant) is in front. It is not a rule for the panel.
+- **Inner: accepts all four orientations, home screen and apps alike** (HomeScreen mask 30).
+ - The mapping is rotated by 90°: device portrait gives interface 4, landscapeLeft gives 1,
+ landscapeRight gives 2 and portraitUpsideDown gives 3.
+ - Inner `UIScreen` bounds follow the arbitrated orientation: 951×669 for interface 3 or 4,
+ 669×951 for 1 or 2.
+ - `coordinateSpace.bounds` of the inner `SBWindowScene` stays 669×951.
+- Orientation lock: the cover's `SBWindowSceneOrientationLockManager` delegates to the global
+ `SBOrientationLockManager` (`_isPerDisplayLockEnabled` NO). The inner has a per-display lock
+ (`_isPerDisplayLockEnabled` YES). Neither was locked during the run.
+- While a panel is dark, its pipeline holds a "Backlight off" device-orientation deferral, so
+ that panel's `systemArbitratedDeviceOrientation` goes stale. An example is the cover reading
+ 2 while the inner is open in portrait.
+- `SBTraitsContinuousFoldDeviceOrientationLockAssertion` was never held at rest:
+ `_continuousFoldLockValidator`, `_continuousFoldDeviceOrientationDeferralAssertion` and
+ `_settleOrientationLock` were nil and `_continuousFoldHolderCount` was 0 in every step. It
+ exists only during a sweep, and no probe ran mid-sweep.
+
+### History-dependent values
+
+- **Inner `SBWindowScene.interfaceOrientation` (and `effectiveGeometry`) is 1 from boot until the
+ first rotation that reaches the inner panel**, even though SpringBoard arbitrates 4 for it and
+ inner `UIScreen` bounds are already 951×669 after the first unfold. After any inner rotation
+ it tracks the arbitrated value (4 in portrait). This was confirmed on a second boot
+ (`open-boot2` gives 1; `open-boot2-landscapeLeft` then `open-boot2-portrait` gives 4). It is
+ not a SpringBoard-relaunch effect.
+- Inner `UIScreen.bounds` is 669×951 at boot, before the inner has been lit. After that it
+ follows the inner's arbitrated interface orientation (see above). The README's "951×669 after
+ the first unfold" is the portrait case of this.
+- Resolver `_preferredTransitionStyle` is 1 (`.fade`) at boot until the first swap, then 2
+ (`.continuousLive`). It is 3 (`.continuousSnapshot`) while MobileSafari is in front.
+- `SBDisplayToolServiceCoordinator._currentDirection`, `continuousFoldController._lastHingeAngleDegrees`
+ and `_lastContinuousFoldPosition`, and the resolution's stored `devicePose` (for example
+ "pose: 100.0°" while open) keep the values of the last sweep. Compare them by path, not by
+ posture.
+- `coverSheetWindowIfLoaded` is nil on both scenes until the first swap, and loaded and hidden
+ afterwards.
+- The traits-arbiter participant count varies with history: 25–29 per scene. Duplicate
+ `CoverSheetGrabber` participants accumulate over book sweeps.
+
+### Power and lock
+
+- In the sim, auto-lock is off: `SBIdleTimerGlobalCoordinator` holds the disable assertion
+ "SBDisableAutoDim user default.", `idleTimer` is `SBDisabledIdleTimer`, and the enabled
+ descriptor is Auto, warn 40 s, total 60 s. `probes/springboard-enable-autolock.lldb`
+ invalidates the assertion, which arms the real idle timer.
+ `probes/springboard-disable-autolock.lldb` takes the assertion again.
+- When auto-lock fires in open or book, the inner goes to AOD (state 3) and stays primary. The
+ cover stays off.
+- **Folding to closed while auto-locked lights the cover, not the inner.**
+ - The policy becomes FullyClosed, the cover is primary in AOD (state 3, lock screen
+ dimmed) and the inner is off (state 4, display 3 captures black).
+ - This holds both from open and from book.
+ - The VM's "closing after auto-lock lights the folded inner display" does not happen in the
+ sim.
+- Folding shortly after a lock-button press from open (rather than auto-lock) turned the cover
+ fully on (state 1, lock screen).
+- `_simulateHomeButtonPressWithCompletion:` does nothing on this device. `_simulateLockButtonPress`
+ wakes it. `attemptUnlockWithPasscode:nil finishUIUnlock:YES` unlocks it only while the idle
+ timer is not expired.
+
+## Missing, nil, errors
+
+- `SBWindowScene.liftToWakeController` crashes the probe expression (EXC_BAD_ACCESS on the
+ stack) and is recorded as an error, not called.
+- `SBFDevicePoseProvider->_accelerometer` (BKSAccelerometer) is nil.
+- Nil in every step:
+ - Transition state: `currentTransitionContext` (coordinator and resolver), resolver
+ `_currentTransitionCoordinator`, `displayContentModeContext.swapTarget` and `_currentContext`.
+ - Unused orientation and lock state: `overrideActiveLockScreenManager`, the continuous-fold
+ lock state listed above, and the `SBContinuousFoldCoordinator` and hinge-monitor assertions.
+ - `SBWindowSceneManager._continuityDisplayWindowScene` and `_extendedDisplayWindowScene`.
+ - `SBWindowScene` properties: `commandTabController`, `hardwareButtonBezelEffectsCoordinator`,
+ `interactiveScreenshotGestureManager`, `manualActivationShieldWindow`,
+ `medusaHostedKeyboardWindowController`, `menuBarManager`, `modalLibraryController`,
+ `phoneRLController` and `reachabilityController`.
+
+## Incidents and tool notes
+
+- **SpringBoard crashed once** (pid 50307, `raw/springboard/crash/`). It hit SIGSEGV in
+ `-[_SBSystemApertureContainerViewRotatingContentView setTransform:]`, about 18 s into an inner
+ landscapeLeft → landscapeRight rotation. `posture.zsh`'s readback probe had stopped
+ SpringBoard during the rotation animation. That step was discarded
+ (`raw/springboard/failed-steps/`). Repeating the same rotation with `POSTURE_SETTLE=25` (no
+ probe during the animation) did not crash, so later orientation steps used
+ `POSTURE_SETTLE=15–25`. Steps after the crash are labelled "after SpringBoard relaunch".
+- The `posture.zsh` default `POSTURE_SETTLE=3` lets the readback probe stop SpringBoard
+ mid-animation. This is harmless for posture swaps but caused the crash above during a 180°
+ inner rotation.
+- One stray `posture.zsh status` run of mine wrote to the shared `raw/posture/`. It was moved to
+ `raw/springboard/posture/misplaced/`.
+- `closed` after `book` stopped at 3.6° in the resolution's stored pose, while the pose provider
+ read 0.
diff --git a/Research/Guest/Evidence/duo-sim-baseline/tools/posture.zsh b/Research/Guest/Evidence/duo-sim-baseline/tools/posture.zsh
new file mode 100755
index 00000000..8eda4f57
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/tools/posture.zsh
@@ -0,0 +1,153 @@
+#!/bin/zsh
+# posture.zsh <udid|name> closed|book|open [swap options]
+# posture.zsh <udid|name> angle <degrees> [swap options]
+# posture.zsh <udid|name> status
+# posture.zsh <udid|name> unlock
+#
+# Drives the iPhone Duo simulator's fold through SpringBoard's own display tool — the
+# path Apple's internal `suiatool` swap command takes — then verifies it:
+#
+# 1. In SpringBoard (over lldb), SBFDisplayToolSwapSettingsFromArguments() parses
+# "-position=<closed|book|open|0.0-1.0>" plus any swap options given here, and
+# -[SBDisplayToolServiceCoordinator performDisplaySwapWithSettings:completion:] runs
+# the synthetic hinge sweep. The sweep is pushed through SBFDevicePoseProvider, so
+# SBDisplayContentModeCoordinator / SBFDisplayContentModeResolver resolve the displays
+# exactly as for a real fold. (The XPC front door, SBSDisplayToolService, needs the
+# com.apple.springboard.sbdisplay.service entitlement, which no simulator binary has.)
+# 2. After the sweep settles: one SpringBoard readback (the resolver description: hinge
+# state, angle, prevailing policy, per-display applied/target content mode) and
+# screenshots of display 1 (cover) and display 3 (inner), each classified lit/dark.
+#
+# Swap options are passed to SBFDisplayToolSwapSettingsFromArguments verbatim:
+# -duration=<s> (0 = instant "yoinking" swap) -deviceOrientation=<portrait|...>
+# -fade | -continuous (-wait is accepted but irrelevant: this script polls)
+# positions: closed = 0.0 (0°), book = 0.5556 (100°), open = 1.0 (180°), angle = deg/180.
+#
+# The hinge regions have hysteresis: where a sweep stops moves the closed/partiallyOpen
+# boundary (at rest at 0° it is 0.47 ≈ 85°; after stopping at 60° it is 0.63 ≈ 113°, so a
+# later "book" sweep from 60° does not reach it and stays on the cover). So `book` first
+# anchors at closed with an instant swap and then sweeps open to 100° — the "book from
+# closed swaps cover to inner" case of the tool's own help. POSTURE_ANCHOR overrides this:
+# POSTURE_ANCHOR=closed|open instant swap there first (any posture)
+# POSTURE_ANCHOR=none sweep from wherever the hinge is now
+# Defaults: book → closed; closed, open, angle → none.
+#
+# Output: one JSON object on stdout; artifacts in $POSTURE_OUT (default ../raw/posture):
+# <stamp>-<label>-swap.txt, -readback.txt (+ .raw.txt), -d1.png, -d3.png, .json
+# Exit status: 0 when the lit panel matches the posture (closed → cover, book/open →
+# inner; angle and status are not judged), 3 on a mismatch, 1 on errors.
+set -euo pipefail
+here=${0:a:h}
+jq=/opt/homebrew/bin/jq
+
+(( $# >= 2 )) || { sed -n '2,38p' ${0:a} | sed 's/^# \{0,1\}//'; exit 2 }
+udid=$($here/sim.zsh udid $1); shift
+verb=$1; shift
+out=${POSTURE_OUT:-${here:h}/raw/posture}
+mkdir -p $out
+stamp=$(date +%Y%m%d-%H%M%S)
+
+case $verb in
+ closed|book|open) position=$verb label=$verb ;;
+ angle)
+ deg=${1:?angle needs degrees}; shift
+ position=$(awk -v d=$deg 'BEGIN { p = d / 180; if (p < 0) p = 0; if (p > 1) p = 1; printf "%.6f", p }')
+ label="angle${deg}" ;;
+ status|unlock) position="" label=$verb ;;
+ *) print -u2 "posture.zsh: unknown posture '$verb'"; exit 2 ;;
+esac
+extra=("$@")
+base=$out/$stamp-$label
+
+# Shared lldb fragments. Locals carry a vp prefix: short names collide with symbols in the
+# shared cache ("names", "m", ...), and lldb persistent $variables are unreliable here.
+coord='NSObject *vpSvc = [[UIApplication sharedApplication] valueForKey:@"_displayToolService"]; NSObject *vpCoord = [vpSvc valueForKey:@"_swapCoordinator"];'
+
+if [[ $verb == unlock ]]; then
+ $here/probe.zsh $udid SpringBoard - $base-unlock.txt <<EOF
+expr -l objc -O -- $coord ((void(*)(id,SEL))objc_msgSend)(vpCoord, @selector(unlockForTesting)); @"unlocked"
+EOF
+ cat $base-unlock.txt; exit 0
+fi
+
+anchor=${POSTURE_ANCHOR:-$( [[ $verb == book ]] && print closed || print none )}
+if [[ -n $position && $anchor != none ]]; then
+ [[ $anchor == closed || $anchor == open ]] || { print -u2 "posture.zsh: bad POSTURE_ANCHOR=$anchor"; exit 2 }
+ POSTURE_ANCHOR=none POSTURE_OUT=$out/anchor $0 $udid $anchor -duration=0 > /dev/null || true
+fi
+
+if [[ -n $position ]]; then
+ objc_args="@\"-position=$position\""
+ for a in "${extra[@]}"; do objc_args+=", @\"$a\""; done
+ started=0
+ for attempt in 1 2 3; do
+ $here/probe.zsh $udid SpringBoard - $base-swap.txt <<EOF
+expr -l objc -O -- struct VPSwapSettings { long long state; double duration; long long deviceOrientation; long long profileOverride; BOOL waitForCompletion; long long targetMode; double targetHingePosition; double lockedForTestingUntil; }; $coord struct VPSwapSettings vpS; memset(&vpS, 0, sizeof(vpS)); NSError *vpErr = nil; BOOL vpParsed = ((BOOL(*)(id, struct VPSwapSettings *, NSError **))dlsym(RTLD_DEFAULT, "SBFDisplayToolSwapSettingsFromArguments"))(@[$objc_args], &vpS, &vpErr); BOOL vpStarted = vpParsed ? ((BOOL(*)(id, SEL, struct VPSwapSettings, id))objc_msgSend)(vpCoord, @selector(performDisplaySwapWithSettings:completion:), vpS, nil) : NO; [NSString stringWithFormat:@"parsed=%d started=%d targetMode=%lld targetHingePosition=%.6f duration=%.3f profileOverride=%lld deviceOrientation=%lld error=%@", vpParsed, vpStarted, vpS.targetMode, vpS.targetHingePosition, vpS.duration, vpS.profileOverride, vpS.deviceOrientation, vpErr]
+EOF
+ if grep -q 'started=1' $base-swap.txt; then started=1; break; fi
+ grep -q 'parsed=0' $base-swap.txt && { cat $base-swap.txt >&2; exit 1 }
+ sleep 3 # "a display swap is already in flight"
+ done
+ (( started )) || { print -u2 "posture.zsh: swap did not start"; cat $base-swap.txt >&2; exit 1 }
+ sleep ${POSTURE_SETTLE:-3}
+fi
+
+# Readback; repeat while the coordinator is still sweeping (state != 0).
+for attempt in 1 2 3 4 5 6; do
+ $here/probe.zsh $udid SpringBoard - $base-readback.txt <<EOF
+expr -l objc -O -- $coord Ivar vpIv = class_getInstanceVariable([vpCoord class], "_currentSettings"); long long *vpP = (long long *)((char *)(__bridge void *)vpCoord + ivar_getOffset(vpIv)); [NSString stringWithFormat:@"coordinator state=%lld instantSwapIsRunning=%@ replayIsRunning=%@", vpP[0], [vpCoord valueForKey:@"_instantSwapIsRunning"], [vpCoord valueForKey:@"_replayIsRunning"]]
+expr -l objc -O -- [[[[UIApplication sharedApplication] valueForKey:@"_displayToolService"] valueForKey:@"_displayContentModeCoordinator"] valueForKey:@"_resolver"]
+EOF
+ grep -q 'coordinator state=0 instantSwapIsRunning=0 replayIsRunning=0' $base-readback.txt && break
+ sleep 2
+done
+
+shots=$($here/sim.zsh shot $udid $out $stamp-$label)
+d1=$(print -- $shots | awk 'NR == 1 { print $2 }')
+d3=$(print -- $shots | awk 'NR == 2 { print $2 }')
+
+rb=$base-readback.txt
+field() { awk -v pat="$1" 'index($0, pat) { sub(".*" pat, ""); print; exit }' $rb }
+hinge=$(field 'SBFHingeState: .')
+pos_line=$(awk '/^ +Position: / { sub(/^ +Position: /, ""); print; exit }' $rb)
+policy=$(field 'Prevailing Policy: ' | tr -d ';')
+primary=$(awk '/prevailing, primary on/ { sub(".*primary on \\.", ""); sub(";.*", ""); print; exit }' $rb)
+displays=$(awk '
+ /<SBFDisplayProxy:/ { id = $0; sub(".*identifier: ", "", id); sub(">.*", "", id) }
+ /surfaceType: \./ { s = $2; sub("^\\.", "", s); sub(";", "", s) }
+ /applied: \./ { a = $2; sub("^\\.", "", a); sub(";", "", a) }
+ /target: \./ { t = $2; sub("^\\.", "", t); sub(";", "", t); printf "%s %s %s %s\n", id, s, a, t }
+' $rb)
+settled=$(grep -q 'coordinator state=0 instantSwapIsRunning=0 replayIsRunning=0' $rb && print true || print false)
+
+expect=""
+case $verb in closed) expect=cover ;; book|open) expect=inner ;; esac
+lit_panel=none
+[[ $d1 == lit && $d3 != lit ]] && lit_panel=cover
+[[ $d3 == lit && $d1 != lit ]] && lit_panel=inner
+[[ $d1 == lit && $d3 == lit ]] && lit_panel=both
+
+$jq -n \
+ --arg udid $udid --arg posture $verb --arg label $label --arg position "$position" \
+ --arg extra "${extra[*]}" --arg hinge "$hinge" --arg pos "$pos_line" --arg policy "$policy" \
+ --arg primary "$primary" --arg displays "$displays" --arg d1 $d1 --arg d3 $d3 \
+ --arg lit $lit_panel --arg expect "$expect" --argjson settled $settled \
+ --arg swap "$( [[ -e $base-swap.txt ]] && grep -E '^parsed=' $base-swap.txt || true )" \
+ --arg base "$base" --arg anchor "$( [[ -n $position ]] && print $anchor || print none )" '
+ {
+ udid: $udid, posture: $posture, label: $label, anchor: $anchor,
+ requested_position: (if $position == "" then null else $position end),
+ swap_options: $extra, swap_result: (if $swap == "" then null else $swap end),
+ settled: $settled,
+ springboard: {
+ hinge_state: $hinge, position: $pos, prevailing_policy: $policy, primary_on: $primary,
+ displays: ($displays | split("\n") | map(select(length > 0) | split(" ") |
+ {identifier: .[0], surface: .[1], applied: .[2], target: .[3]}))
+ },
+ screenshots: {display1_cover: $d1, display3_inner: $d3, lit_panel: $lit},
+ expected_lit_panel: (if $expect == "" then null else $expect end),
+ ok: (if $expect == "" then null else ($expect == $lit) end),
+ artifacts: $base
+ }' | tee $base.json
+
+if [[ -n $expect && $expect != $lit_panel ]]; then exit 3; fi
diff --git a/Research/Guest/Evidence/duo-sim-baseline/tools/prelude.lldb b/Research/Guest/Evidence/duo-sim-baseline/tools/prelude.lldb
new file mode 100644
index 00000000..ebea679a
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/tools/prelude.lldb
@@ -0,0 +1,5 @@
+thread select 1
+expr -l objc -- @import Foundation
+expr -l objc -- @import UIKit
+expr -l objc -- @import ObjectiveC
+expr -l objc -- @import Darwin
diff --git a/Research/Guest/Evidence/duo-sim-baseline/tools/probe.zsh b/Research/Guest/Evidence/duo-sim-baseline/tools/probe.zsh
new file mode 100755
index 00000000..77677b22
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/tools/probe.zsh
@@ -0,0 +1,85 @@
+#!/bin/zsh
+# probe.zsh <udid|name> <process|pid> <cmdfile|-> [out.txt]
+#
+# Attach lldb to one process inside one simulator, source prelude.lldb (thread 1 + module
+# imports) and then <cmdfile> (or stdin for "-"), detach, and quit. Commands keep running
+# after an error. The cleaned transcript goes to out.txt (or stdout); the untouched lldb
+# output goes next to it as out.raw.txt.
+#
+# Environment:
+# PROBE_TIMEOUT=120 seconds before the watchdog interrupts lldb (SIGINT, twice, then SIGTERM)
+# PROBE_FULL_SYMBOLS=1 load every symbol table up front (≈16 s per attach instead of ≈3 s)
+# PROBE_NO_PRELUDE=1 skip prelude.lldb
+#
+# Exit status: lldb's status, or 124 if the watchdog fired. The target is checked after
+# lldb exits: a process left stopped (state T) is sent SIGCONT and a warning is printed.
+set -euo pipefail
+here=${0:a:h}
+
+(( $# >= 3 )) || { sed -n '2,17p' ${0:a} | sed 's/^# \{0,1\}//'; exit 2 }
+udid=$($here/sim.zsh udid $1)
+proc=$2 cmd=$3 out=${4:-}
+if [[ $proc == <-> ]]; then pid=$proc; else pid=$($here/sim.zsh pid $udid $proc); fi
+
+work=$(mktemp -d -t probe)
+trap 'rm -rf "$work"' EXIT
+if [[ $cmd == - ]]; then cat > $work/cmd.lldb; cmd=$work/cmd.lldb; fi
+[[ -r $cmd ]] || { print -u2 "probe.zsh: cannot read $cmd"; exit 2 }
+cmd=${cmd:a}
+raw=$work/raw.txt
+
+args=(--batch --no-lldbinit)
+[[ ${PROBE_FULL_SYMBOLS:-0} == 1 ]] || args+=(-O "settings set symbols.load-on-demand true")
+args+=(-O "settings set auto-confirm true" -p $pid)
+[[ ${PROBE_NO_PRELUDE:-0} == 1 ]] || args+=(-o "command source -e false -s 0 $here/prelude.lldb")
+args+=(-o "command source -e false -s 0 $cmd" -o "process detach" -o "quit")
+
+lldb "${args[@]}" > $raw 2>&1 &
+lpid=$!
+timeout=${PROBE_TIMEOUT:-120}
+(
+ sleep $timeout; print -- "probe.zsh: timeout after ${timeout}s, interrupting lldb" > $work/timedout
+ kill -INT $lpid 2>/dev/null; sleep 10
+ kill -INT $lpid 2>/dev/null; sleep 10
+ kill -TERM $lpid 2>/dev/null
+) &
+wpid=$!
+rc=0
+wait $lpid || rc=$?
+pkill -P $wpid 2>/dev/null || true
+kill $wpid 2>/dev/null || true
+wait $wpid 2>/dev/null || true
+if [[ -e $work/timedout ]]; then rc=124; cat $work/timedout >> $raw; print -u2 -- "$(cat $work/timedout)"; fi
+
+# The target must be running again.
+state=$(ps -o stat= -p $pid 2>/dev/null || true)
+if [[ -z $state ]]; then
+ print -u2 "probe.zsh: WARNING: pid $pid ($proc) is gone after the probe"
+elif [[ $state == *T* ]]; then
+ print -u2 "probe.zsh: WARNING: pid $pid was left stopped; sending SIGCONT"
+ kill -CONT $pid 2>/dev/null || true
+fi
+
+# Keep only what the command file produced: from its "command source" echo onward, minus
+# lldb's own chatter.
+clean() {
+ awk -v marker="command source -e false -s 0 $cmd" '
+ !on { if (index($0, marker)) on = 1; next }
+ /^Executing commands in / { next }
+ /^Enter expressions, then terminate with an empty line to evaluate:/ { next }
+ /^note: Expression evaluation in pure Objective-C not supported/ { next }
+ /^warning: warning: got name from symbols:/ { next }
+ /^\(lldb\) process detach$/ || /^Process [0-9]+ detached$/ || /^\(lldb\) quit$/ { next }
+ { print }
+ ' $raw
+}
+
+if [[ -n $out ]]; then
+ mkdir -p ${out:h}
+ cp $raw ${out:r}.raw.txt
+ clean > $out
+ print -u2 "probe.zsh: pid $pid rc $rc -> $out"
+else
+ clean
+fi
+exit $rc
diff --git a/Research/Guest/Evidence/duo-sim-baseline/tools/sim.zsh b/Research/Guest/Evidence/duo-sim-baseline/tools/sim.zsh
new file mode 100755
index 00000000..6cbd6718
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/tools/sim.zsh
@@ -0,0 +1,121 @@
+#!/bin/zsh
+# Simulator helpers for the iPhone Duo baseline harness.
+#
+# sim.zsh create [name] create an iPhone Duo / iOS 27.1 sim, print its UDID
+# sim.zsh clone <src> <new-name> clone a (shut down) sim, print the new UDID
+# sim.zsh boot <name|udid> boot and wait for boot to finish
+# sim.zsh shutdown <name|udid> shut down
+# sim.zsh udid <name|udid> resolve a device name to its UDID
+# sim.zsh pid <name|udid> <process> pid of a process inside that sim (SpringBoard,
+# backboardd, MobileSafari, Preferences, ...)
+# sim.zsh ps <name|udid> list the sim's processes (pid name)
+# sim.zsh runtime-root the mounted iOS 27.1 RuntimeRoot (needs a booted 27.1 sim)
+# sim.zsh shared-cache the sim dyld shared cache path
+# sim.zsh shot <name|udid> <out-dir> <tag>
+# screenshot display 1 (cover) and 3 (inner) to
+# <out-dir>/<tag>-d1.png and <tag>-d3.png
+# sim.zsh lit <png> print "lit <mean>" or "dark <mean>" for a screenshot
+#
+# The two pre-existing "iPhone Duo" devices are protected: boot, shutdown, erase and delete
+# refuse them. Nothing here deletes a device.
+set -euo pipefail
+
+SIM_DEVICE_TYPE="com.apple.CoreSimulator.SimDeviceType.iPhone-Duo"
+SIM_RUNTIME="com.apple.CoreSimulator.SimRuntime.iOS-27-1"
+SIM_PROTECTED=(B738069B-DF72-4050-A9D8-333E16B0D664 4D48BBE9-DFC0-41C4-AC6A-86B60A88E629)
+
+sim_die() { print -u2 -- "sim.zsh: $*"; exit 1 }
+
+sim_udid() {
+ local arg=$1
+ if [[ $arg =~ '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$' ]]; then
+ print -- ${arg:u}; return
+ fi
+ local matches
+ matches=$(xcrun simctl list devices -j | /opt/homebrew/bin/jq -r --arg n "$arg" \
+ '.devices[] | .[] | select(.name == $n) | .udid')
+ [[ -n $matches ]] || sim_die "no simulator named '$arg'"
+ (( $(print -- $matches | wc -l) == 1 )) || sim_die "more than one simulator named '$arg': $matches"
+ print -- $matches
+}
+
+sim_guard() {
+ local udid=$1
+ (( ${SIM_PROTECTED[(Ie)$udid]} == 0 )) || sim_die "refusing to touch protected device $udid"
+}
+
+# launchd_sim of a booted device is started with its device data path on the command line.
+sim_launchd_pid() {
+ local udid=$1
+ ps -A -o pid=,command= | awk -v u="Devices/$udid/data/var/run/launchd_bootstrap.plist" \
+ 'index($0, "launchd_sim") && index($0, u) && !p { p = $1 } END { if (p) print p }'
+}
+
+sim_ps() {
+ local udid=$1 lpid
+ lpid=$(sim_launchd_pid $udid)
+ [[ -n $lpid ]] || sim_die "$udid is not booted (no launchd_sim)"
+ # Every sim process is a child of that launchd_sim. comm is the full executable path.
+ ps -A -o pid=,ppid=,comm= | awk -v p=$lpid '$2 == p { n = $3; for (i = 4; i <= NF; i++) n = n " " $i; sub(".*/", "", n); print $1, n }'
+}
+
+sim_pid() {
+ local udid=$1 name=$2 pid
+ pid=$(sim_ps $udid | awk -v n="$name" '$2 == n { print $1 }' | tail -1)
+ [[ -n $pid ]] || sim_die "no process '$name' in $udid"
+ print -- $pid
+}
+
+sim_runtime_root() {
+ local root
+ root=( /private/var/run/com.apple.security.cryptexd/mnt/com.apple.iPhoneOS.SimulatorRuntime-v24.1.94425.0.*/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 27.1.simruntime/Contents/Resources/RuntimeRoot(N/) )
+ (( ${#root} > 0 )) || sim_die "iOS 27.1 runtime is not mounted; boot a 27.1 simulator first"
+ print -- ${root[1]}
+}
+
+# A panel that is not driven captures as pure black (every channel 0). Downscale to 32x32,
+# then take the mean and the max of R,G,B. Lit means some pixel rises clearly above black:
+# a freshly booted cover with its wallpaper not yet drawn still shows icons (max > 24).
+sim_lit() {
+ local png=$1 dir tmp off stats
+ dir=$(mktemp -d -t simlit); tmp=$dir/x.bmp
+ sips -z 32 32 -s format bmp "$png" --out "$tmp" >/dev/null
+ off=$(od -An -tu4 -j 10 -N 4 "$tmp" | tr -d ' ')
+ stats=$(od -An -v -tu1 -j $off "$tmp" | awk '{ for (i = 1; i <= NF; i++) { c++; if (c % 4 != 0) { s += $i; n++; if ($i > m) m = $i } } } END { printf "mean=%.2f max=%d", (n ? s / n : 0), m }')
+ rm -rf "$dir"
+ if (( ${${stats##*max=}%% *} > 24 )); then print -- "lit $stats"; else print -- "dark $stats"; fi
+}
+
+cmd=${1:-}; shift || true
+case $cmd in
+ create)
+ name=${1:-duo-baseline-harness}
+ xcrun simctl create "$name" $SIM_DEVICE_TYPE $SIM_RUNTIME ;;
+ clone)
+ (( $# == 2 )) || sim_die "usage: clone <src> <new-name>"
+ src=$(sim_udid $1); xcrun simctl clone $src "$2" ;;
+ boot)
+ udid=$(sim_udid ${1:?device}); sim_guard $udid
+ xcrun simctl boot $udid 2>/dev/null || true
+ xcrun simctl bootstatus $udid -b >/dev/null
+ print -- $udid ;;
+ shutdown)
+ udid=$(sim_udid ${1:?device}); sim_guard $udid
+ xcrun simctl shutdown $udid ;;
+ erase|delete)
+ sim_die "$cmd is deliberately not provided" ;;
+ udid) sim_udid ${1:?device} ;;
+ ps) sim_ps $(sim_udid ${1:?device}) ;;
+ pid) sim_pid $(sim_udid ${1:?device}) ${2:?process} ;;
+ runtime-root) sim_runtime_root ;;
+ shared-cache) print -- "$(sim_runtime_root)/System/Library/Caches/com.apple.dyld/dyld_sim_shared_cache_arm64" ;;
+ shot)
+ (( $# == 3 )) || sim_die "usage: shot <device> <out-dir> <tag>"
+ udid=$(sim_udid $1); mkdir -p "$2"
+ xcrun simctl io $udid screenshot --display=1 "$2/$3-d1.png" >/dev/null 2>&1
+ xcrun simctl io $udid screenshot --display=3 "$2/$3-d3.png" >/dev/null 2>&1
+ print -- "$2/$3-d1.png $(sim_lit "$2/$3-d1.png")"
+ print -- "$2/$3-d3.png $(sim_lit "$2/$3-d3.png")" ;;
+ lit) sim_lit ${1:?png} ;;
+ *) sed -n '2,22p' ${0:a} | sed 's/^# \{0,1\}//'; exit 2 ;;
+esac
diff --git a/Research/Guest/Evidence/duo-sim-baseline/tools/smoke.zsh b/Research/Guest/Evidence/duo-sim-baseline/tools/smoke.zsh
new file mode 100755
index 00000000..2f3531c0
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/tools/smoke.zsh
@@ -0,0 +1,48 @@
+#!/bin/zsh
+# smoke.zsh <udid|name> [out.json]
+#
+# End-to-end check of sim.zsh / probe.zsh / posture.zsh: for closed, book and open, drive
+# the posture, then run probes/smoke-springboard.lldb in SpringBoard ([UIScreen screens]
+# and SBDisplayContentModeCoordinator state) and collect everything into one JSON file in
+# the README's record format (default ../smoke.json). Transcripts go to ../raw/smoke/.
+set -euo pipefail
+here=${0:a:h}
+root=${here:h}
+jq=/opt/homebrew/bin/jq
+
+udid=$($here/sim.zsh udid ${1:?udid or name})
+out=${2:-$root/smoke.json}
+rawdir=$root/raw/smoke
+mkdir -p $rawdir
+work=$(mktemp -d -t smoke); trap 'rm -rf "$work"' EXIT
+
+runtime=$(xcrun simctl list runtimes -j | $jq -c '.runtimes[] | select(.identifier == "com.apple.CoreSimulator.SimRuntime.iOS-27-1") | {identifier, version, buildversion}')
+device=$(xcrun simctl list devices -j | $jq -c --arg u $udid '.devices[] | .[] | select(.udid == $u) | {name, udid, deviceTypeIdentifier}')
+xcode=$(xcodebuild -version | tr '\n' ' ' | sed 's/ *$//')
+
+for posture in closed book open; do
+ POSTURE_OUT=$rawdir $here/posture.zsh $udid $posture > $work/$posture-posture.json || {
+ print -u2 "smoke.zsh: posture $posture did not verify"; cat $work/$posture-posture.json >&2 }
+ $here/probe.zsh $udid SpringBoard $root/probes/smoke-springboard.lldb $rawdir/$posture-springboard.txt
+ grep -E '^\{"(records|orientation)"' $rawdir/$posture-springboard.txt > $work/$posture-records.json || {
+ print -u2 "smoke.zsh: no JSON in $rawdir/$posture-springboard.txt"; exit 1 }
+done
+
+$jq -n \
+ --argjson runtime "$runtime" --argjson device "$device" --arg xcode "$xcode" \
+ --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg host "$(sw_vers -productVersion) $(sysctl -n machdep.cpu.brand_string)" \
+ --slurpfile pc $work/closed-posture.json --slurpfile pb $work/book-posture.json --slurpfile po $work/open-posture.json \
+ --slurpfile rc $work/closed-records.json --slurpfile rb $work/book-records.json --slurpfile ro $work/open-records.json '
+ def orient: {"1": "portrait", "2": "portraitUpsideDown", "3": "landscapeLeft", "4": "landscapeRight"}[tostring] // "unknown";
+ def tag($posture; $r): $r.records | map({api, kind, process: "SpringBoard", posture: $posture,
+ orientation: ($r.orientation | orient), call, value, error});
+ {
+ meta: {
+ domain: "smoke", runtime: $runtime, device: $device, xcode: $xcode, host: $host, date: $date,
+ posture_mechanism: "SBDisplayToolServiceCoordinator performDisplaySwapWithSettings: (tools/posture.zsh)",
+ postures: [$pc[0], $pb[0], $po[0]]
+ },
+ records: (tag("closed"; $rc[0]) + tag("book"; $rb[0]) + tag("open"; $ro[0]))
+ }' > $out
+print -- "smoke.zsh: $($jq '.records | length' $out) records -> $out"
+$jq -r '.meta.postures[] | "\(.posture): lit=\(.screenshots.lit_panel) expected=\(.expected_lit_panel) ok=\(.ok) hinge=\(.springboard.hinge_state) \(.springboard.position) policy=\(.springboard.prevailing_policy) primary=\(.springboard.primary_on)"' $out
diff --git a/Research/Guest/Evidence/duo-sim-baseline/tools/vm-probe.zsh b/Research/Guest/Evidence/duo-sim-baseline/tools/vm-probe.zsh
new file mode 100755
index 00000000..75d8051d
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/tools/vm-probe.zsh
@@ -0,0 +1,114 @@
+#!/bin/zsh
+# vm-probe.zsh <vm> <process|pid> <cmdfile|-> [out.txt]
+#
+# The vphone counterpart of probe.zsh: run the same lldb command files against a process
+# in a vphone guest. A one-shot launchd job starts the guest's /usr/libexec/debugserver
+# (CFW gives it task_for_pid-allow) attached to the target; host lldb connects to it over
+# the VM's network, sources prelude.lldb and <cmdfile>, detaches and quits. The job is
+# unloaded afterwards. Symbols come from ~/Library/Developer/Xcode/iOS DeviceSupport.
+#
+# Environment:
+# PROBE_TIMEOUT=180 seconds before the watchdog interrupts lldb
+# PROBE_NO_PRELUDE=1 skip prelude.lldb
+# VM_PROBE_HOST=<ip> guest address, instead of asking device.network
+# VM_PROBE_PORT=<port> debugserver port (default: random 24000-24999)
+#
+# Exit status: lldb's status, 124 if the watchdog fired, 3 if debugserver never listened.
+set -euo pipefail
+here=${0:a:h}
+
+(( $# >= 3 )) || { sed -n '2,16p' ${0:a} | sed 's/^# \{0,1\}//'; exit 2 }
+vm=$1 proc=$2 cmd=$3 out=${4:-}
+
+rpc() { vphone-launchpad-cli guest rpc $vm $1 ${2:-'{}'} }
+
+if [[ $proc == <-> ]]; then
+ pid=$proc
+else
+ pid=$(rpc processes.list "{\"filter\":\"$proc\"}" | jq -r --arg n $proc '
+ [(.result.processes // .result // .processes // [])[]
+ | select((.name // .command // "") as $c | $c == $n or ($c | endswith("/" + $n)))
+ | .pid] | first // empty')
+ [[ -n $pid ]] || { print -u2 "vm-probe.zsh: no process named $proc in $vm"; exit 2 }
+fi
+
+host=${VM_PROBE_HOST:-}
+if [[ -z $host ]]; then
+ host=$(rpc device.network | jq -r '
+ [.result.addresses[]? | capture("^en0 (?<ip>[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)$")? | .ip] | first // empty')
+ [[ -n $host ]] || { print -u2 "vm-probe.zsh: could not find the guest address; set VM_PROBE_HOST"; exit 2 }
+fi
+port=${VM_PROBE_PORT:-$(( 24000 + RANDOM % 1000 ))}
+label=com.vphone.baseline.debugserver.$port
+plist=/var/tmp/$label.plist
+
+work=$(mktemp -d -t vmprobe)
+cleanup() {
+ rpc services.unload "{\"paths\":[\"$plist\"],\"force\":true}" >/dev/null 2>&1 || true
+ rpc files.remove "{\"path\":\"$plist\"}" >/dev/null 2>&1 || true
+ rm -rf "$work"
+}
+trap cleanup EXIT
+
+if [[ $cmd == - ]]; then cat > $work/cmd.lldb; cmd=$work/cmd.lldb; fi
+[[ -r $cmd ]] || { print -u2 "vm-probe.zsh: cannot read $cmd"; exit 2 }
+cmd=${cmd:a}
+raw=$work/raw.txt
+
+# One line of JSON: files.write takes a single line.
+content="<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\"><dict><key>Label</key><string>$label</string><key>ProgramArguments</key><array><string>/usr/libexec/debugserver</string><string>0.0.0.0:$port</string><string>--attach=$pid</string></array><key>RunAtLoad</key><true/><key>KeepAlive</key><false/></dict></plist>"
+rpc files.write "$(jq -cn --arg p $plist --arg c $content '{path: $p, content: $c}')" >/dev/null
+rpc services.load "{\"paths\":[\"$plist\"]}" >/dev/null
+
+# debugserver accepts exactly one connection, so a port check would use it up: wait for the
+# process instead, then give it a moment to attach and listen.
+for i in {1..40}; do
+ rpc processes.list '{"filter":"debugserver"}' | jq -e '.result.count > 0' >/dev/null 2>&1 && break
+ (( i == 40 )) && { print -u2 "vm-probe.zsh: debugserver did not start"; exit 3 }
+ sleep 0.5
+done
+sleep 1.5
+
+args=(--batch --no-lldbinit -O "settings set symbols.load-on-demand true" -O "settings set auto-confirm true"
+ -o "platform select remote-ios" -o "process connect connect://$host:$port")
+[[ ${PROBE_NO_PRELUDE:-0} == 1 ]] || args+=(-o "command source -e false -s 0 $here/prelude.lldb")
+args+=(-o "command source -e false -s 0 $cmd" -o "process detach" -o "quit")
+
+lldb "${args[@]}" > $raw 2>&1 &
+lpid=$!
+timeout=${PROBE_TIMEOUT:-180}
+(
+ sleep $timeout; print -- "vm-probe.zsh: timeout after ${timeout}s, interrupting lldb" > $work/timedout
+ kill -INT $lpid 2>/dev/null; sleep 10
+ kill -INT $lpid 2>/dev/null; sleep 10
+ kill -TERM $lpid 2>/dev/null
+) &
+wpid=$!
+rc=0
+wait $lpid || rc=$?
+pkill -P $wpid 2>/dev/null || true
+kill $wpid 2>/dev/null || true
+wait $wpid 2>/dev/null || true
+if [[ -e $work/timedout ]]; then rc=124; cat $work/timedout >> $raw; print -u2 -- "$(cat $work/timedout)"; fi
+
+clean() {
+ awk -v marker="command source -e false -s 0 $cmd" '
+ !on { if (index($0, marker)) on = 1; next }
+ /^Executing commands in / { next }
+ /^Enter expressions, then terminate with an empty line to evaluate:/ { next }
+ /^note: Expression evaluation in pure Objective-C not supported/ { next }
+ /^warning: warning: got name from symbols:/ { next }
+ /^\(lldb\) process detach$/ || /^Process [0-9]+ detached$/ || /^\(lldb\) quit$/ { next }
+ { print }
+ ' $raw
+}
+
+if [[ -n $out ]]; then
+ mkdir -p ${out:h}
+ cp $raw ${out:r}.raw.txt
+ clean > $out
+ print -u2 "vm-probe.zsh: $vm pid $pid rc $rc -> $out"
+else
+ clean
+fi
+exit $rc
diff --git a/Research/Guest/Evidence/duo-sim-baseline/vm-notes.md b/Research/Guest/Evidence/duo-sim-baseline/vm-notes.md
new file mode 100644
index 00000000..11989db6
--- /dev/null
+++ b/Research/Guest/Evidence/duo-sim-baseline/vm-notes.md
@@ -0,0 +1,306 @@
+# vphone-duo (duobase-01) against the simulator baseline: notes
+
+VM `duobase-01`, bundle 2.14.0-local.21dc0c06 (upstream main 82afdb9a, two-display Duo path),
+iPhone19,4, iOS 27.1 24A94425. Probes run through `tools/vm-probe.zsh` (guest debugserver,
+host lldb over NAT). Raw transcripts under `raw/vm/`.
+
+## EXC_GUARD (code 261, subcode 0xd63f091f) in lldb expressions: isolated
+
+Evidence: `raw/vm/guard/` (diag1, b1, b2, b2-compile, b2-unwind, t1, t23, t4, tv, tfix; JIT
+objects saved with `target.save-jit-objects-dir` in `jit*/`).
+
+- lldb sees guest processes as `arm64e.x1-apple-ios27.1.0` and JITs arm64e code (PAC calls),
+ and the guest enforces the IA key. code 261 = 0x105 = `EXC_ARM_PAC_FAIL`; subcode
+ 0xd63f091f is the instruction `blraaz x8`.
+- Bisecting `smoke-springboard.lldb`: the `[UIScreen screens]` half with all its blocks runs
+ (b1). Adding the coordinator half (b2) faults every time.
+- `expr -u false` left SpringBoard at the fault (b2-unwind): `blraaz x8` with
+ `x8 = 0x0000000188000800 libobjcMsgSend.dylib`objc_msgSend` — an **unsigned** pointer.
+- The JIT objects show why. A cast call `((T (*)(…))objc_msgSend)(…)` becomes a ptrauth
+ constant (IA, discriminator 0). lldb signs such constants in the target, in the module
+ initializer `lldb.arm64.sign_pointers` (`mov x16,#0; pacia1716`), into a private slot
+ (`l___unnamed_N`). But only **one** call site uses that slot. Every other cast-call site of
+ `objc_msgSend` in the same expression loads the plain GOT entry `_objc_msgSend` (the one
+ ordinary message sends use with `blr`), which lldb fills with the raw address and never
+ signs, and calls it with `blraaz` (tv: v1–v4, any return types, with or without loops).
+- Confirmed by execution in Preferences (tfix): two cast `objc_msgSend` calls in one
+ expression → EXC_GUARD, process killed. One cast call (t1), one cast call inside a `for … in`
+ loop (t23, t4), blocks, nested blocks: all fine.
+
+**Trigger: two or more cast `objc_msgSend` call sites in one expression.** Size, blocks and
+loops are irrelevant. smoke-springboard.lldb has two (`displayContentModeForWindowScene:` and
+`isAppliedDisplayContentModeUserInitiatedForWindowScene:`). The simulator never hits it
+because simulator processes are arm64 (no PAC). The same probably holds for any other C
+function referenced both directly and through a cast in one expression; not tested.
+
+**Fix used by every `probes/vm-*.lldb`:** take the pointer once and cast the variable:
+`void *vpMsg = (void *)objc_msgSend;` then `((long (*)(id, SEL, id))vpMsg)(…)`. One reference
+→ one signed slot (tfix "fix ok", two types, inside a `for … in`). A simulator probe with at
+most one cast `objc_msgSend` runs unchanged; one with more needs this one-line substitution
+(`sed 's/))objc_msgSend)/))vpMsg)/'` plus the declaration).
+
+SpringBoard restarts caused while isolating it: 522 → 647 (b2), 647 → 706 (b2-unwind).
+Preferences was killed once on purpose (tfix).
+
+## Two more JIT traps on the VM, and one guest-code trap
+
+- **`strcmp` / `strncmp` return garbage in expressions** (`raw/vm/guard/strncmp.txt`:
+ `strncmp("{CGRect=x", "{CGRect=", 8)` = -1944147536, `strcmp("ab","ab")` ≠ 0; `strlen` is
+ right). lldb finds libsystem_c's `strncmp` with no address and binds something else. Every
+ sim probe that dispatches on a type encoding (`display-*`, `chrome-state`) silently took
+ the "unsupported struct return" path, and skip lists keyed on `strcmp` stopped skipping.
+ `probes/vm-convert.zsh` now also declares block versions `vpStrncmp` / `vpStrcmp` first in
+ each expression and rewrites the calls.
+- **EXC_BAD_INSTRUCTION, subcode 0xdac1a7fe** = `PACIBSPPC` (FEAT_PAuth_LR, the "x1" part of
+ `arm64e.x1`). The VM's CPU does not implement PAuth_LR, which is why the dyld cache is
+ X1-lowered; code that is not lowered faults on its first instruction. Found in backboardd:
+ `objc_copyClassList` realizes every class, and one of them runs unlowered code
+ (`raw/vm/guard/bbd*.txt`; markers written to `/var/tmp/vpprog.txt` in the guest located it).
+ `IOHIDServiceCopyProperty` / `IOHIDServiceGetRegistryID` through `dlsym` pointers are fine.
+ `probes/vm-sensors-backboardd.lldb` checks named classes instead (the sim list was empty
+ anyway). Avoid `objc_copyClassList` in guest probes. Each of these faults was returned to
+ the pre-expression state by lldb; backboardd (pid 61) survived all of them.
+- `display.auto_lock.set` did not change the effective Auto-Lock here: requests for 0 and
+ 2147483647 (Never) both read back 60 s, also 10 s later. It was set back to 60 s at once.
+ For measurements the probes take SpringBoard's own idle-timer disable assertion instead
+ (`probes/vm-springboard-disable-autolock.lldb`, as in the sim), which a SpringBoard restart
+ drops.
+- `probes/vm-sensors-coremotion.lldb`: three more VM-only changes. `?: [NSNull null]` on the
+ handler dictionaries (the VM's `_cmMagicPoseManager` is nil, so the sim's literal threw);
+ `+[CMAngleManager shouldEmitWakeLatencySignpostsOnStateChangeForTesting]` not called
+ (EXC_BAD_ACCESS at 0x4c); no fresh `[[CMAngleManager alloc] init]` (it blocked SpringBoard's
+ main thread until lldb gave up with SIGSTOP). **SpringBoard restart 706 → 1440** followed
+ those two runs (start time 20:20:03, seconds after the SIGSTOP run detached).
+- `probes/vm-display-backboardd.lldb`, VM-only changes beyond vm-convert:
+ `-[CADisplay _copyDebugProperties]` not called (SIGABRT in backboardd; the VM's CADisplays
+ have no `stateControl`), `+[BKDisplayBrightnessController sharedInstance]` and
+ `+[BKDisplayRenderOverlayManager sharedInstance]` not called (both EXC_BAD_INSTRUCTION
+ 0xdac1a7fe, the same unlowered PAuth_LR code). Found with
+ `raw/vm/display/iterate-vm.zsh` (the VM version of `raw/display/iterate.zsh`: reads the
+ guest's `/var/tmp/vptrace.txt`) and, because the last traced getter is not always the
+ culprit (it walks backwards through the getter list when the fault comes later), a debug
+ copy that traces every record add (`raw/vm/display/dbg.lldb`). backboardd survived every
+ interrupted expression (pid 61 throughout).
+
+## How the VM column was measured
+
+- Posture: vphoned `display.posture` (`{"hinge":"closed","position":"closed"}`,
+ `{"hinge":"partially-open","position":"book"}`, `{"hinge":"open-flat","position":"open"}`),
+ which sets SpringBoard's test-automation pose override and sweeps the virtual hinge HID. The
+ sim used SpringBoard's own display-swap coordinator instead; values from
+ `SBFDevicePoseProvider` onward compare.
+- Rotation: `display.rotation {orientation: degrees}` (lit-panel interface orientation; inner
+ 0 landscape-left, 90 portrait, 180 landscape-right, 270 upside-down; cover 0 portrait,
+ 90 landscape-right, 270 landscape-left).
+- Each step: `probes/vm-run.zsh snap` (screen.unlock, display.pose, display.orientation,
+ device.screen, a screen.screenshot with its size and lit/dark, the SpringBoard pid, then the
+ probes), driven by `raw/vm/run-plan.zsh` (phases postures, rotations, safari, preferences),
+ `raw/vm/run-autolock.zsh` and `raw/vm/run-lockchrome.zsh`. Step order: `raw/vm/steps/ORDER`.
+ `probes/vm-retag.zsh` rebuilds each step's `records.jsonl` from the transcripts;
+ `probes/vm-merge.zsh` writes `vm-<domain>.json`. Helpers used to read the results:
+ `probes/vm-summary.zsh` (posture table), `vm-chrome-keys.zsh`, `vm-app-keys.zsh`,
+ `vm-compare.zsh` (sim vs VM by api+call, inner display names mapped).
+- SpringBoard's idle timer was held off with its own disable assertion
+ (`vm-springboard-disable-autolock.lldb`, re-taken after a SpringBoard restart), as the sim's
+ `SBDisableAutoDim` default does; the guest's Auto-Lock setting stayed 60 s.
+- The VM shows one composited panel (the cover `LCD`, the only AppleParavirtDisplay,
+ 1398×2034). `screen.screenshot` captures it: 1398×2034 portrait when closed, 2034×1398 when
+ book/open (the inner content scaled onto the landscape panel). "Which panel is lit" therefore
+ comes from SpringBoard (content mode, backlight state) and backboardd (window-server
+ enabled/blanked), with the screenshot size as a cross-check.
+- `display.rotation` reads `orientation` only as a JSON **string** (`{"orientation":"90"}`);
+ a number is silently ignored and the call just reads back. The first rotation phase used
+ numbers; those steps are in `raw/vm/steps/discarded/*-numeric-orientation-ignored` and
+ were all re-run (`run-plan.zsh rot2`).
+- `-[SBLockScreenManager lockUIFromSource:withOptions:]` on the primary scene worked in open
+ but hit EXC_BREAKPOINT in closed (`raw/vm/steps/closed-lockscreen-pose/lockcmd.txt`, lldb
+ returned SpringBoard to its prior state). Step `closed-lockscreen` is therefore *not*
+ locked; the cover lock screen was measured with a simulated lock-button press instead
+ (`closed-lockscreen-button`).
+
+## Data
+
+| file | records | steps |
+| --- | --- | --- |
+| `vm-springboard.json` | 26716 | 32 |
+| `vm-display.json` | 30521 | 23 |
+| `vm-chrome.json` | 69408 | 10 |
+| `vm-appkit.json` | 5542 | 15 |
+| `vm-sensors.json` | 1266 | 16 |
+
+Steps, in order (`raw/vm/steps/ORDER`; the posture label is in each record):
+open-sbstart, closed-after-open, book-after-closed, open-after-book, book-after-open,
+closed-after-book, open-after-closed, Safari (closed, unfold to open, book, fold),
+Preferences (closed, book, open, fold), rotations (closed Preferences 90, closed Safari 90 /
+270 / 0, closed home 90, open 0 / 180 / 270 / 90), history (Preferences launched on the
+inner then folded, Safari with the cover landscape then unfolded), lock screen (open,
+closed), auto-lock (open auto-locked, folded, 20 s later, fold after a lock-button press),
+closed lock screen via lock button. `raw/vm/rpc/` holds the boot-state `display.modes` and
+`device.displays`. Not run: VPAppKitProbe (callback sequence, public `UIHingeInteraction`),
+notification pushes (platter widths), CMQuery/blocking probes.
+
+## Results worth reading before the table
+
+- Posture policy, primary scene, content modes and SpringBoard backlight states match the
+ sim in every posture and history path. Book is the only posture with a value off: the
+ override derives 90° from hinge state 2 (`display.posture`'s reply says `angle 100` and
+ the HID gets 100°, but `SBFDevicePoseProvider` and `uiHingeStatus` read 90°).
+- Display stack: the VM keeps one real panel (`LCD`, 1398×2034 @3, 120 Hz) and adds the
+ inner as a second CADisplay `VPhone Duo Inner` (displayId 7, native 2853×2007 landscape,
+ pointScale 1, sRGB, no physical size). No CADisplay has a `stateControl`. FBS/UIKit see
+ identity `Unknown[7]` (apps: `Unknown.main[7]`), not UIKitMainLike, not embedded. FBS
+ bounds, sbh screen types, exclusion area, BKS surface type, window-server orientations
+ and the inner rot90 all match.
+- Everything an app sees matches: screens count, main screen, bounds, size classes,
+ orientation, safe areas, corners, surface type, scene regions with `innerCover` active
+ only in book, the Preferences split widths, hinge-state delivery, and both history
+ effects on client orientation.
+- Rotation matches in open (4/1/2/3, per-panel pose orientations). Closed, the cover's
+ pose orientation equals the device orientation (sim: the opposite landscape). The cover
+ home screen stays portrait (mask 2) and vphoned reports the rotation as not applied; a
+ landscape app (Safari) does turn the cover landscape. The earlier "VM refuses cover
+ landscape outright" was the home-screen case.
+- CoreMotion: no magic-pose, device-state or angle manager (all `isAvailable` NO); the
+ class-method tables (`orientationForMagicPose:deviceSurface:`, `propertyAForConfigType:…`)
+ are CoreMotion's own and equal the sim's everywhere, tabletop and A=7 included.
+- No AOD on the VM, so auto-lock turns the panels off instead of dimming them; folding
+ while auto-locked moves primary to the cover lock screen with the cover off. Nothing lit
+ the folded inner.
+- `SBFDevicePoseProvider`: `internal.isOnVM` YES (sim NO), `_accelerometer` is a
+ BKSAccelerometer (sim nil), `SBHingeMotionUnintendedInteractionMonitor` nil.
+- After `screen.unlock` in open, the cover scene's lock-screen manager stays locked and
+ visible while the inner is unlocked (sim: both unlocked). It clears after a fold.
+
+## SpringBoard restarts during this work
+
+| pid | cause |
+| --- | --- |
+| 522 → 647 | b2: the smoke-probe bisect (EXC_GUARD, two cast `objc_msgSend`) |
+| 647 → 706 | b2-unwind: the same expression run with `-u false` to capture the PC |
+| 706 → 1440 | sensors-coremotion debugging: a fresh `CMAngleManager` blocked the main thread until lldb stopped it (SIGSTOP); SpringBoard was replaced seconds after detach |
+| 1440 → 2384 | rot2 `closed-home-rot90`: before the probe attached; lldb could not connect to the guest debugserver (which had been started with `--attach`), so SpringBoard most likely stayed stopped and was killed. No crash report. Redone on 2384 |
+
+backboardd (pid 61) never restarted. Preferences was killed once on purpose (tfix).
+
+## Final guest state
+
+duobase-01 running, SpringBoard pid 2384, open (`display.pose` hinge 3), device portrait
+(inner interface orientation 4), unlocked, Safari and Preferences terminated, Auto-Lock
+setting 60 s (unchanged; `display.auto_lock.set` was set back to 60). SpringBoard holds the
+probe's idle-timer disable assertion ("vphone baseline: auto-lock off again") so the guest
+stays unlocked; it goes away with the next SpringBoard restart.
+
+## 2026-10-30: second pass after the duo-sim-align fix
+
+Bundle **2.14.0-local.9064efca** (branch duo-sim-align, worktree HEAD aa274dcc at
+measurement time): V68 `product-id`, `/product/display0` + `display1` panel nodes,
+`MGGetLogicalDeviceDisplayCount` 2, CoreMotion's device-state relay fed by libvphonehinge's
+`VPhone Host Controls` (0xFF61/0x5B). Same VM, same iOS. Only the rows the fix can affect
+were measured; BASELINE.md marks them "2026-10-30" and keeps the first-pass value as
+"(was: …)".
+
+### Method
+
+- Driver `raw/vm/run-fix.zsh` (phases respring, postures, postures2, statusbar, coremotion,
+ safari, lock, final), same probes as before. Every lldb attach waits until 45 s have passed
+ since the previous one ended, postures settle 20 s and rotations 25 s before any attach,
+ and the SpringBoard pid is read before and after each attach. Steps are
+ `raw/vm/steps/fx-<label>/`, in order in `raw/vm/steps/ORDER.fix-9064efca`; logs
+ `raw/vm/plan-fix-*.log`. `raw/vm/merge-fix.zsh` appends them to `vm-*.json` with
+ `"bundle": "2.14.0-local.9064efca"` and `step` `fx-<label>` (meta: `meta.fix`, and the
+ step snapshots in `meta.steps` carry the bundle). Re-running it replaces the fx records.
+- `display.pose` reads SpringBoard's test-automation snapshot, which this bundle no longer
+ writes; `rpc.json` keeps it as `display_pose_stale`. The pose comes from
+ `SBFDevicePoseProvider` (`sensors-springboard`), and `display.posture` replies
+ `source: coremotion`.
+- HID service names come from vphoned's `device.input_devices` (step `fx-hid-rpc`, record
+ `vphoned.device.input_devices` in `vm-sensors.json`), not from lldb (next section).
+- CoreMotion managers: `sensors-coremotion` ran in MobileSafari first as a canary (now that
+ `+isAvailable` is YES, `+sharedManager` creates objects), then in SpringBoard. Neither hung.
+ No fresh `CMAngleManager` was created.
+- Lock screen: two `input.button {"name":"power"}` presses in closed (lock, then wake to the
+ lock screen), then `chrome-lock` without unlocking (`fx-closed-lockscreen`, lit screenshot).
+
+### Incident 1: the backboardd HID probe wedged CoreMotion
+
+`probes/vm-sensors-backboardd.lldb` in backboardd (step `fx-open-after-book`, 01:29) was
+interrupted with SIGSTOP about 9 s after it started, without output; lldb returned backboardd
+to its prior state. From then on SpringBoard's pose stayed at open/180° through closed, open,
+book and closed requests (`raw/vm/steps/discarded/fx-*-locationd-wedged`), although
+libvphonehinge kept sweeping and dispatching host-control events (its status counters kept
+rising). vphoned's `device.input_devices`, which copies properties of every HID service, then
+hung for 120 s and the guest agent dropped its connection once (`raw/vm/steps/fx-diag/`).
+
+The probe calls `IOHIDServiceCopyProperty` for every service from backboardd's main thread.
+On this bundle that includes the two `CoreMotion_DeviceStateRelay_*` services, which
+locationd owns; on the first-pass bundle they did not exist and the same probe ran cleanly
+(step `open-sbstart`). Which side was left blocked is not settled. Recovery: SIGTERM to locationd
+(`processes.kill` with `force`, pid 66). launchd restarted it (1060), and **backboardd
+(516 → 1061) and SpringBoard (518 → 1064) restarted with it**, start times within 0.3 s. After
+that `device.input_devices` answered at once and CoreMotion followed the fold again.
+
+Do not run `vm-sensors-backboardd.lldb` (or any lldb `IOHIDServiceCopyProperty` walk in
+backboardd) on a guest with the relay; use `device.input_devices`. `systemEventOfType:0x2c`
+was therefore not re-read in this pass.
+
+### Incident 2: SpringBoard 1064 had no idle-timer assertion
+
+The restart in incident 1 dropped the probe's idle-timer assertion. In the next run the
+guest auto-locked in closed; the unfold woke it to the lock screen, `isUILocked` read YES,
+the resolver's prevailing policy read `Yoink(inner)` in open and the following book, and one
+unfold made while the screen was dark was never published (SpringBoard stayed on the cover,
+`device.screen` 466×678, while the hinge provider was at 180°). `display.rotation` was refused
+while locked. Those steps are in `raw/vm/steps/discarded/fx-*-sb1064-autolock-on` and
+`fx-sb-open-aborted` / `fx-open-rot0-aborted`. The assertion was taken again
+(`raw/vm/autolock/fix-disable-pid1064.txt`), the fold resynced with the screen lit (closed,
+then open), and the posture paths re-run. `run-fix.zsh` now stops a step when SpringBoard
+does not hold the assertion (`keep`).
+
+### Results
+
+- Posture table: FullyClosed / FoldingDual, primary scene, content modes 2/1 and 3/2,
+ backlight 1/4 and 4/1 match in closed, book and open on both history orders. Book reads
+ 99.444° (position 0.552; mechanical 100); closed region 0→0.2747 and toClosed 0.5525→0.03
+ in book, 0→0.47 otherwise.
+- CoreMotion: all three managers available, SpringBoard's provider holds CoreMotion's
+ managers (handlers registered, angle updates at 0.01 s), `sharedManager` exists and is a
+ separate instance, `_accelerometer` nil: the sim's structure, with live values.
+- HID: `CoreMotion_DeviceStateRelay_Crane` 0xFF0C/0x21 and `_DeviceState` 0xFF0C/0x22
+ (Virtual), plus `VPhone Host Controls` 0xFF61/0x5B.
+- Display identity: `extendedProperties` and MobileGestalt `DisplayExtendedProperties` equal
+ the sim's except the cover corner radii ([5,5,59,59] against [8,8,59,59]); display count 2;
+ inner 460 ppi, physical size 6.2022×4.3630 in; inner mode 669×951@3x at 120 Hz, sRGB,
+ with the extra 951×669@3x mode. Names and FBS identity unchanged.
+- Transition style 2 straight after the forced respring (closed), 2 after every swap, 3 with
+ Safari in front.
+- Inner portrait-shaped status bar (interface orientation 1): {592,0,77,951} in both
+ captures. At orientation 1 straight after a SpringBoard start, before any rotation:
+ 0-rect, as in the sim.
+- Closed with Safari on the cover: device 4 → cover 4, device 3 → cover 3, from CoreMotion's
+ `cmMagicPose`. CoreMotion's table maps a closed hinge to the cover unchanged, so the sim's
+ opposite landscape is its swap tool's.
+- What Safari sees in closed / book / open matches the sim (screens, bounds, size classes,
+ orientation, safe areas, corners, surface type, regions, hinge state 0 / 99.4 / 180).
+- Lock-screen clock: the VM's active lock-screen poster is
+ `com.apple.MercuryPoster:configuration:v68.colorB`, a photo poster with an adaptive
+ (stretched) time: `adaptiveTimeTextHeight` 213.01, font weight `wght3200000`, 128.77 pt,
+ clock 372×240.28. The sim's is `celosia.timeOfDay`: adaptive height 105, `wght2800000`,
+ 110.03 pt, clock 372×132.26. The layout limits (104.74 / 303.68) and styles are the same,
+ so the height difference is the poster's personalization, not layout.
+
+### SpringBoard restarts in this pass
+
+| pid | cause |
+| --- | --- |
+| 37 → 518 | the allowed forced `system.respring`, in closed, for the transition-style row; backboardd also restarted (61 → 516) |
+| 518 → 1064 | SIGTERM to the wedged locationd (incident 1); backboardd 516 → 1061 restarted with it |
+
+No attach changed the SpringBoard pid.
+
+### Final guest state (2026-10-30)
+
+duobase-01 running bundle 2.14.0-local.9064efca, SpringBoard 1064, backboardd 1061,
+locationd 1060. Open (`SBFDevicePoseProvider` `.openFlat`, 180°), device portrait, inner
+landscape-shaped home screen, unlocked, Safari terminated. SpringBoard 1064 holds the
+probe's idle-timer assertion ("vphone baseline: auto-lock off again") until its next
+restart; the Auto-Lock setting is still 60 s.