feat: phase 2.5 — iPhone Mirroring auto-empty of Recently Deleted #1

Open
opened 2026-05-15 04:53:46 +00:00 by hartle-tech · 0 comments
hartle-tech commented 2026-05-15 04:53:46 +00:00 (Migrated from github.com)

S01E10 — The One-Touch Wring

iOS keeps deleted media in Recently Deleted for 30 days. AFC + PTP can't bypass it (empirically tested: PTP delete leaves bytes on disk, files just trashed). The only Apple-blessed automation path is iPhone Mirroring + CGEventPost: Apple substitutes Mac Touch ID for iPhone Face ID during mirroring, so we can drive the entire Photos.app → Recently Deleted → Select → Delete All flow from the Mac and let the user authorize with one Touch ID press.

Why

8 research agents (across 2 rounds) converged: no AFC, PTP, lockdownd, sideloaded helper, Shortcut, URL scheme, backup-restore, or jailbreak path will skip the 30-day purgatory on stock iOS 26.4.2. iPhone Mirroring is the only viable option.

Implementation outline

  • New macOS-only Go package wrapping CGEventPost (synthetic clicks → forwarded as touches to mirrored iPhone), CGWindowListCreateImage (screenshot the mirror window), and Apple's Vision.framework (OCR fallback to find buttons whose coordinates drift across iOS versions).
  • New CLI subcommand `dumpsock wipe-trash` and matching GUI button.
  • Hardcoded coordinate path for iPhone 16 Pro Max + default Mirroring window size; OCR fallback when coordinates miss.
  • User flow: open DumpSock → click "Wring it dry (1 Touch ID)" → DumpSock launches iPhone Mirroring.app, automates Photos → Albums → Recently Deleted → Select → Delete All → iPhone fires biometric prompt → Mac shows Touch ID prompt → user touches sensor → bytes really free.

Prior art to crib from

Caveats / risk

  • Requires macOS 15+ with iPhone Mirroring set up.
  • Fragile across iOS Photos.app UI revisions (mitigation: OCR fallback).
  • Apple has clamped CGEventPost into mirroring before (Sequoia beta history); could re-clamp.
  • App Store distribution is impossible (Accessibility entitlement + CGEventPost outside sandbox).
  • Estimated effort: 2–3 days for v0.

Acceptance

  • `dumpsock wipe-trash --device ` clears Recently Deleted with exactly one user touch (Touch ID).
  • GUI exposes the same flow as a single button in the done-banner after a delete-after pull.
  • Fallback if Mirroring not available: surface the AFC-already-shipped guidance with the `photos-navigation://album?name=recently-deleted` deep-link.
## S01E10 — *The One-Touch Wring* iOS keeps deleted media in **Recently Deleted** for 30 days. AFC + PTP can't bypass it (empirically tested: PTP delete leaves bytes on disk, files just trashed). The only Apple-blessed automation path is **iPhone Mirroring + CGEventPost**: Apple substitutes Mac Touch ID for iPhone Face ID during mirroring, so we can drive the entire Photos.app → Recently Deleted → Select → Delete All flow from the Mac and let the user authorize with one Touch ID press. ## Why 8 research agents (across 2 rounds) converged: no AFC, PTP, lockdownd, sideloaded helper, Shortcut, URL scheme, backup-restore, or jailbreak path will skip the 30-day purgatory on stock iOS 26.4.2. iPhone Mirroring is the only viable option. ## Implementation outline - New macOS-only Go package wrapping `CGEventPost` (synthetic clicks → forwarded as touches to mirrored iPhone), `CGWindowListCreateImage` (screenshot the mirror window), and Apple's Vision.framework (OCR fallback to find buttons whose coordinates drift across iOS versions). - New CLI subcommand \`dumpsock wipe-trash\` and matching GUI button. - Hardcoded coordinate path for iPhone 16 Pro Max + default Mirroring window size; OCR fallback when coordinates miss. - User flow: open DumpSock → click \"Wring it dry (1 Touch ID)\" → DumpSock launches iPhone Mirroring.app, automates Photos → Albums → Recently Deleted → Select → Delete All → iPhone fires biometric prompt → **Mac shows Touch ID prompt** → user touches sensor → bytes really free. ## Prior art to crib from - [\`midscene-ios\` (npm)](https://www.npmjs.com/package/midscene-ios) — screenshot+OCR+CGEventPost pipeline for generic iPhone Mirroring automation. - [iPhone Mirroir MCP server](https://mcpmarket.com/server/iphone-mirroir). - libgphoto2 is unrelated here but useful prior art for the device-side OCR ladder. ## Caveats / risk - Requires macOS 15+ with iPhone Mirroring set up. - Fragile across iOS Photos.app UI revisions (mitigation: OCR fallback). - Apple has clamped CGEventPost into mirroring before (Sequoia beta history); could re-clamp. - App Store distribution is impossible (Accessibility entitlement + CGEventPost outside sandbox). - Estimated effort: 2–3 days for v0. ## Acceptance - \`dumpsock wipe-trash --device <udid>\` clears Recently Deleted with exactly one user touch (Touch ID). - GUI exposes the same flow as a single button in the done-banner after a delete-after pull. - Fallback if Mirroring not available: surface the AFC-already-shipped guidance with the \`photos-navigation://album?name=recently-deleted\` deep-link.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hartle-tech/dumpsock#1
No description provided.