Commit Graph

64 Commits

Author SHA1 Message Date
Sagar Dagdu
98fd924a7f
fix: prefer structured typedstream prefix decoding
Fix typedstream attributedBody recovery for 32-126 byte messages whose length byte is printable ASCII, and keep the regression covered across the parser edge cases.\n\nCo-authored-by: Sagar Dagdu <shags032@gmail.com>
2026-05-08 02:49:55 +01:00
Peter Steinberger
e833e0c898
feat: add linux read-only build (#106)
Some checks are pending
CI / macos (push) Waiting to run
CI / linux-read-core (push) Waiting to run
pages / Deploy docs (push) Waiting to run
2026-05-07 01:29:26 +01:00
Omar Shahine
243226951f
fix(security): clamp IPC dirs to 0700 and reject symlinked paths (#105)
* fix(security): clamp IPC dirs to 0700 and reject symlinked paths

Threat model: a same-UID attacker (another user process, a sandboxed peer
that can reach the home dir) can drop a file or symlink into the RPC
inbox, or supply an attachment path that points at a sensitive file via
a parent-directory symlink, and have Messages.app exfiltrate it as an
attachment to an attacker-controlled handle.

Mitigations applied at every IPC boundary:

- Mode 0700 on .imsg-rpc/, .imsg-rpc/in/, .imsg-rpc/out/ creation.
  Final chmod handles dirs that already existed 0755 from prior
  unsandboxed runs.
- Refuse any RPC queue path or attachment path where any component
  (final or parent) is a symbolic link. Walking each component with
  lstat() — done by SecurePath.hasSymlinkComponent in IMsgCore and the
  pathHasSymlinkComponent twin in the dylib — catches parent-directory
  links that realpath()-vs-lexical comparison misses (macOS rewrites
  /tmp -> /private/tmp, breaking that approach for legitimate paths).
- Strict throws for queue dir creation and cleanup in MessagesLauncher
  (was `try?` swallowing errors), and for ensureDirectory in
  IMsgBridgeClient. Bridge refuses to start instead of operating on an
  insecure path.

Tests cover both final-component and parent-component symlink detection
in SecurePath. Toolchain on this machine lacks swift-testing; tests
build clean and ship to be run by Xcode on the maintainer's box.

* fix: allow trusted system path aliases

---------

Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-06 22:13:31 +01:00
Sagar Dagdu
e0a2e972b8
fix: decode long attributedBody typedstream payloads
Decode typedstream attributedBody segments that use 0x81/0x82 length prefixes so long fallback message text is preserved in history/watch output.

Also records the fix in the 0.7.0 changelog.

Co-authored-by: Sagar Dagdu <shags032@gmail.com>
2026-05-06 06:54:45 +01:00
Omar Shahine
c56c24d488
feat: port BlueBubbles private-API bridge
Port the BlueBubbles-inspired IMCore bridge surface into imsg with rich sends, message mutation, chat management, account/nickname introspection, live bridge events, and v2 UUID-keyed IPC.

Fixes #60.

Co-authored-by: Omar Shahine <omarshahine@users.noreply.github.com>
2026-05-06 06:28:00 +01:00
Peter Steinberger
6a05484ae6
refactor: split message store query layers 2026-05-05 05:31:04 +01:00
Peter Steinberger
63b55b04d6
refactor: centralize message store schema 2026-05-05 03:38:10 +01:00
Peter Steinberger
e982084640
refactor: share message row selection 2026-05-05 03:28:22 +01:00
Peter Steinberger
edad072a41
refactor: decode sqlite rows by name 2026-05-05 02:24:59 +01:00
Peter Steinberger
327829a819
feat: expose chat routing hints 2026-05-05 02:00:56 +01:00
Peter Steinberger
df2d928ff0
fix: reject unsupported custom emoji reactions 2026-05-05 01:22:07 +01:00
Peter Steinberger
715a75fb4e
fix: clarify Tahoe typing failures 2026-05-05 00:34:45 +01:00
Peter Steinberger
8dcb9d087b
feat: convert unsupported attachment metadata
Co-authored-by: Mark Zeidan <6324940+mfzeidan@users.noreply.github.com>
2026-05-04 09:41:04 +01:00
Peter Steinberger
5203f7461c
feat: resolve contact names
Co-authored-by: Joshua Sindy <josh@root.bz>
Co-authored-by: Dan Wager <danielwager@gmail.com>
2026-05-04 09:16:44 +01:00
Peter Steinberger
f8f0c5d712
fix: normalize typing chat lookup 2026-05-04 08:51:46 +01:00
Peter Steinberger
abddb40268
fix: detect Tahoe group send ghost rows 2026-05-04 07:48:10 +01:00
Peter Steinberger
19c4cd3083
fix: keep watch streams alive after missed events 2026-05-04 07:37:20 +01:00
Peter Steinberger
af6fd822c1
fix: return RPC send message identifiers 2026-05-04 07:25:33 +01:00
Peter Steinberger
9d92837726
fix: batch JSON history metadata 2026-05-04 06:51:31 +01:00
Peter Steinberger
90b7d84cb9
docs: improve Full Disk Access troubleshooting 2026-05-04 06:46:17 +01:00
Peter Steinberger
79224803ac
fix: speed up chat listing 2026-05-04 06:43:31 +01:00
Peter Steinberger
fb7b847531
fix: decode UTF-16LE attributed bodies 2026-05-04 05:55:51 +01:00
Peter Steinberger
bf2d02e5e7
feat: add advanced message controls 2026-04-27 02:11:23 +01:00
Peter Steinberger
c9fa1c2003 fix: harden URL balloon dedupe in watch stream (#64) (thanks @lesaai) 2026-03-02 03:06:50 +00:00
Lēsa AI
a2c16b3cac fix: deduplicate URL balloon messages in watch stream
iMessage writes multiple rows to chat.db for the same URL when the rich
link preview resolves. Both rows have balloon_bundle_id set to
'com.apple.messages.URLBalloonProvider' with identical text and sender
but different ROWIDs and timestamps.

This causes downstream consumers (like OpenClaw) to process the same
URL message twice, burning tokens and producing duplicate responses.

Fix: in messagesAfter(), track seen (sender, text) pairs for URL balloon
messages and skip duplicates within the same batch.
2026-03-02 03:06:34 +00:00
Peter Steinberger
5591b2e99e fix: remove broken typing surface 2026-03-02 01:40:42 +00:00
Peter Steinberger
38fa96a3ee feat: ship typing/rpc updates and prep 0.5.0 2026-02-16 07:14:15 +01:00
Peter Steinberger
7fa01f182b fix: harden typing command and rpc validation 2026-02-16 06:30:58 +01:00
Koho Zheng
69499d891f feat: add typing indicator support via IMCore private framework
Implements typing indicators for outgoing messages using runtime
dynamic loading of Apple's IMCore private framework. This is the
only way to programmatically send typing indicators — AppleScript
has no equivalent capability.

Closes #22

Changes:
- IMsgCore: Add TypingIndicator struct with start/stop/duration APIs
- CLI: Add 'imsg typing' command with --to, --duration, --stop flags
- RPC: Add typing.start and typing.stop methods
- Errors: Add typingIndicatorFailed error case

Usage:
  imsg typing --to +14155551212
  imsg typing --to +14155551212 --duration 5s
  imsg typing --to +14155551212 --stop true
  imsg typing --chat-identifier "iMessage;-;+14155551212"
2026-02-16 06:30:58 +01:00
Peter Steinberger
5a9f5441b9 refactor: unify message decode and RPC payload mapping 2026-02-16 05:54:16 +01:00
Alex
ba9a1ff079 feat: expose destination_caller_id in message output
This field helps distinguish between messages actually sent by the local
user vs messages received on a secondary phone number registered with
the same Apple ID.

When is_from_me is true but destination_caller_id differs from the
user's own numbers, the message was actually received from another
device/person messaging that secondary number.

This enables tools like Clawdbot to properly detect inbound messages
on secondary iMessage phone numbers.
2026-02-16 05:33:29 +01:00
Peter Steinberger
b78027b251 chore: merge origin/main into pr-31 2026-02-16 04:04:01 +01:00
Peter Steinberger
5b5c8bcc50 refactor: consolidate schema detection 2026-02-15 14:31:14 +01:00
Peter Steinberger
f9258472c8 fix: detect thread_originator_guid column (#39) (thanks @ruthmade) 2026-02-15 14:15:01 +01:00
Ru
057b7c5a91 feat: add thread_originator_guid to message output
Adds thread_originator_guid field to JSON output for history, watch, and RPC.
This field contains the GUID of the message being replied to when users
use iMessage's inline reply feature.

This is the correct field for reply detection - it matches the UI's reply
target, unlike reply_to_guid which can point to different messages.

Closes #30

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-15 14:15:01 +01:00
pangu25
a03e81c8b4 feat: reaction events in watch + react command
- Add --reactions flag to watch command to include tapback events (#26)
- Reaction events include metadata: is_reaction, reaction_type, reaction_emoji,
  is_reaction_add, reacted_to_guid
- Add 'imsg react' command to send tapback reactions via UI automation (#24)
- Supports standard tapbacks (love, like, dislike, laugh, emphasis, question)
  and custom emoji reactions (iOS 17+/macOS 14+)

Closes #24, Closes #26
2026-01-30 23:37:54 -06:00
Tom Juszczyk
72c42d5b34 fix: apply history filters before limit
Apply --start/--end/--participants in SQL so LIMIT applies after filtering (CLI history + RPC messages.history). Add regressions proving filtered windows work with small limits.
2026-01-16 21:18:57 +00:00
Peter Steinberger
f93bfe1b8f fix: prefer handle send for direct chats 2026-01-15 07:58:56 +00:00
Peter Steinberger
8e9f27859a chore: merge origin/main into feature/audio-messages 2026-01-07 10:34:45 +01:00
Peter Steinberger
d7f9d3d6cf refactor: split message store message queries 2026-01-07 10:34:08 +01:00
Peter Steinberger
34b51d6401 chore: merge origin/main into fix/attachments 2026-01-07 10:27:01 +01:00
Peter Steinberger
39211802de fix: avoid writing to user attachments dir in tests 2026-01-07 10:25:06 +01:00
Peter Steinberger
99d03c84f1 fix: prefer chat guid for chat_id sends\n\nCo-authored-by: Michael Shuffett <1070545+mshuffett@users.noreply.github.com> 2026-01-07 10:16:08 +01:00
Anton Sotkov
d1467d6e66 fix: attachments upload error
Messages seems to expect the attachments to be in the Attachments directory, otherwise upload fails with error 25. Set up `~/Library/Messages/Attachments/imsg/<UUID>/<filename>` for imsg.
2026-01-07 07:13:54 +02:00
Anton Sotkov
75de4f4a0d feat: extract audio message transcriptions from attachment user_info 2026-01-06 19:02:45 +02:00
Peter Steinberger
c1ac567e20 chore: prepare 0.3.0 2026-01-03 05:04:13 +01:00
Peter Steinberger
28d1319bbc test: split message store fixtures 2026-01-02 23:34:20 +01:00
Peter Steinberger
05c97e514c chore: drop private api send mode 2026-01-02 23:11:53 +01:00
Peter Steinberger
285a508618 fix: harden imcore connection and sender fallback 2026-01-02 22:50:47 +01:00
Peter Steinberger
bdcc5d8538 feat: add imcore reaction send 2026-01-02 22:13:09 +01:00