Expand description
Readers and narrow opt-in writers for selected official Linux profiles.
Offline readers use a private temporary copy, including its WAL, without changing source SHM. An owned daemon can instead reuse read-only connections while serializing profile operations. This crate neither launches WeChat nor connects to the network or acquires keys from a process. Checked write functions require explicit ownership and a durable caller intent.
§API guide
Start with ProfileReader for history, contacts, groups and local media.
ReadOptions requires a stopped writer or a consistent copy. The library
understands supported official file layouts; it supplies no account daemon,
network requests or alternative settled-state database.
Advanced writers use the following naming conventions. These are names for this adapter’s operations, not official-client API names.
| Prefix | Effect | Example |
|---|---|---|
stage_* | Prepare validated bytes in memory without changing files | stage_mmkv_values |
apply_* | Usually a logical update to supported profile records | apply_message_projection |
publish_* | Usually installation of prepared bytes at local paths | publish_mmkv_append, publish_cache_file |
Both apply_* and publish_* perform writes. Their names are descriptive,
not separate transaction levels: publish_saved_key_info can change both a
database and a file, and media apply operations can also install cache files.
New profile mutations use apply_*; existing publish_* names are retained
for compatibility. stage_* remains the convention for preparing a change
without writing to the profile.
“Prepared” means bytes already constructed and checked, such as the encrypted
data and CRC metadata returned by stage_mmkv_values. It does not mean an
additional profile or a network publication.
A SQLite transaction or an atomic file replacement does not make a change
across several databases/files atomic. The caller owns exclusive access and
recovery ordering. WriteOptions::durable_intent_id references a recovery
record the caller has already saved; the crate neither creates that record nor
proves its existence. Unrecognized layouts remain unsupported for writes.
Structs§
- Applied
Contact - Applied
Contact Pin - Applied
Hardlink - Applied
Hardlink Cache - Applied
Image Cache - Applied
Media Resource - Applied
Message - Applied
Text - Applied
Voice Cache - Avatar
Projection - Avatar hashes identify the native source URL, not the image-content digest. A caller supplies the observed URL hash explicitly; it is never inferred from the bytes. No contact/group field or remote avatar is modified.
- Business
Contact Projection - Cached
Bytes - Cached
Image - Column
Schema - Contact
- Contact
Projection - Full scalar/BLOB contact data with id/username allocated from the destination name map. Existing rows accept patches; new rows require every remaining field.
- Coverage
- DatLayout
- Database
Inventory - Database
Key - Decoded
Field - Group
- Group
Member - Group
Mention Permissions - Derived from the official room owner, administrator list and SQL membership. Missing profile evidence stays unknown; no separate permission state is saved.
- Group
Projection - Caller supplies the actual retained group fields; complete_roster is explicit. No absent member is deleted for an incomplete/delta roster.
- Hardlink
Projection - Native hardlink fields, excluding rowid/dir1/dir2. Directory numbers are
always allocated in the destination.
hardlink_md5_hashcomputes the native string hash; type/extra_buffer remain explicit in this low-level interface. - Image
DatKey - Incoming
Text - Index
Schema - Initialized
Layout - KeyFile
- List
Query - Media
Resource Projection - Exact native resource metadata. The destination allocates all local IDs and translates names. Detail type/status/data_index and opaque protobuf bytes are explicit build-adapter inputs rather than guessed media-wide defaults.
- Message
- Message
Projection - Exact stored columns supplied by a protocol/build adapter, excluding fields allocated/transformed by this destination (local_id, sender id, packed endpoints).
- Message
Query - Message
Reference - Membership for a history view, without reading or decoding message bodies.
- Message
Session Projection - Mmkv
Publication - Mmkv
Records - Decoded v4 records are secrets; Debug and serde intentionally unavailable.
- Native
Member Patch - Native
Roster Patch - Official
Home Bootstrap - Credentials and additional raw MMKV values are caller supplied; this type has no Debug/Serialize so a bootstrap request cannot enter ordinary logs.
- Official
Home Report - Owned
Reader Cache - Page
- Peer
Business Metadata - Peer
Metadata - Peer
Open ImApplication - Peer
Open ImMetadata - Peer
Open ImWording - Profile
Identity - Profile
Location - Profile
Reader - Profile
Saved Login - Authorized saved material only; it does not imply a currently valid session. Values are zeroized and intentionally do not implement Debug or Serialize.
- Read
Options - Read
Projection - Saved
KeyInfo Plan - Hash-only expected generations, suitable for embedding in a coordinator’s encrypted journal. No credential bytes are returned by this plan.
- Saved
KeyInfo Publication - Saved
Login Projection - One accepted credential generation. No Debug/serde implementation is provided. The caller binds this generation to bootstrap username/UIN/device first.
- Schema
Report - Secret
Bytes - Source
Message Id - Local IDs are scoped to a database and a table. Decimal strings avoid a lossy JSON floating-point conversion and are not native server checkpoints.
- Staged
Mmkv - Complete staged pair. Publication across these files requires caller recovery; this object alone never modifies any filesystem or native sync checkpoint.
- Table
Schema - Thread
- Thread
Exit Read Projection - Thread
Read Projection - Write
Options
Enums§
- Database
State - Decode
State - Hardlink
Kind - Image
Quality - KeyInfo
Source - Native
Group Edit - Effects established for ordinary Linux group controls. This writer never deletes chat history and never treats a membership delta as a full roster.
- Profile
Error - SqlValue
- Thread
Exit Read Outcome - Verified
Image Quality - Video
Quality
Constants§
Functions§
- account_
contact_ sync_ store_ path - The inspected contact drain stores its independent SyncKeyBuffer here.
It does not use
mmkv_key_byp_sync_keyfrom the login store. - account_
mmkv_ key - The inspected per-account v2 store derives its CFB key from the account name, independently of global format keys, database passwords and login credentials. This is a format derivation, not a means of authenticating an account.
- account_
sync_ store_ path - Select the observed account login store only after exact username/UIN binding.
- apply_
avatar_ projection - apply_
contact_ business_ patch - Apply a received business contact and its ordinary extra metadata in one transaction. This performs no refresh or other account operation.
- apply_
contact_ mute_ patch - Apply only a received direct-contact mute bit. Missing or incomplete contact identities cannot establish the other flag bits and are left untouched.
- apply_
contact_ patch - Sparse contact update. Existing rows preserve every omitted field. A new row starts with a zero deletion flag; other omitted nullable/no-default columns become SQL NULL. Explicit input values take precedence over these defaults.
- apply_
contact_ pin_ patch - Apply a received ordinary pin preference. The caller retains a stable transition timestamp and retries the same intent after a partial local write. Session and contact commits are separate; session-first publication lets a retry recognize an unfinished flag transition without rewinding newer activity.
- apply_
contact_ projection - apply_
group_ patch - Sparse group updates use the same explicit SQL NULL policy for a new row. Existing owner/opaque buffers are preserved unless specifically supplied.
- apply_
group_ projection - apply_
hardlink_ projection - apply_
incoming_ text - Supports only the verified existing direct-chat incoming text family. It does not allocate new chats/maps, infer sort collisions, update FTS or project unknown media/system commands. A partial error may follow a committed message transaction; recover by retrying the same durable input.
- apply_
media_ resource_ projection - apply_
media_ resource_ variants - Add one or more verified resource variants without erasing other qualities. Only a matching pending (status0,size0) detail can transition to downloaded.
- apply_
message_ projection - apply_
message_ session_ projection - Reconcile a committed message into a desktop session, preserving drafts, unrelated unread rows and preexisting counter/list discrepancies. It makes no server/phone read request and is retryable after a message-only commit.
- apply_
native_ group_ edit - apply_
native_ roster_ patch - Translate only the proved network member identity/display semantics into the local repeated-field1 representation. Caller proves roster completeness (for example, a separate complete member identity list in the server reply). Unknown root/member protobuf chunks, existing owner and unrelated contact fields are retained byte-for-byte. No network version is guessed into opaque fields.
- apply_
recall_ projection - Replace the live row while preserving its source/server identity and ordering. Media cache files and unknown official files have independent lifetimes.
- apply_
recall_ projection_ with_ notice - Preserve the server’s replacement text as XML text, never as markup.
- apply_
session_ projection - Explicit session fields. New sessions require a complete row; patches retain unrelated drafts/read metadata. Caller determines actual native values.
- cache_
file_ projection - Register an ordinary subtype6 attachment’s verified bytes, resource row, filename pair and native hardlink. A new collision-bounded local name is an explicit allocation policy; an existing resource filename is retained.
- cache_
hardlink_ media_ projection - Register verified ordinary file/video bytes in the observed month/hardlink namespace. This does not invent a MessageResourceDetail subtype or packed attachment record; adapters with that metadata can register it separately. A digest prefix makes the local filename deterministic and collision bounded.
- cache_
image_ projection - Cache one actual JPEG/PNG quality under a deterministic local basename. The observed DAT/resource/hardlink representation is retained; basename allocation and UTC month are local policies, not a claim about the native generator. No other variant is removed. Original bytes must match the message XML MD5.
- cache_
video_ projection - Cache one video representation using the resource basename plus its exact native suffix. Movie and JPEG thumbnail bytes are never interchanged, and adding one quality preserves every other resource detail and basename.
- cache_
voice_ projection - Preserve the original encoded voice, independently of any WAV derivative. The supported media shard is selected only when no other media ordinal exists. The message row must already exist and be type 34 in its own table namespace.
- choose_
message_ sort_ sequence - Choose the first unused millisecond slot in this message’s second, or retain the already stored slot for a replay. This is an independent collision policy within the observed native 1000-slots/second representation, not a recovered native rollover algorithm. Caller holds the lease through insertion.
- compressed_
profile_ field - WCDB compression state 4 observed on the supported fields. Compression is independent of media type; raw protocol bytes stay in the durable sidecar.
- create_
mmkv_ v4 - New nonexpiring v4 pair with explicit caller-generated key and IV. Fixed capacity is the total page-aligned data-file size, including its 4-byte reserved header. The metadata occupies one 4096-byte page, matching the inspected native files. Maximum data capacity is 4 MiB.
- decode_
dat_ v2 - Independent V2 framing decode. ECB/XOR is not authenticated encryption; callers must separately validate image format/dimensions before rendering.
- decode_
mmkv_ records - derive_
image_ dat_ key - encode_
dat_ v2 - ensure_
managed_ layout_ version - Repair only the omitted known v4 marker of this adapter’s receipt-bound managed bootstrap. The coordinator must establish that provenance first. No schema migration, UUID generation, stock-scan completion or foreign profile adoption is implied by this helper.
- file_
resource_ type - Resource categories from the supported Linux build’s extension registry. An unknown extension uses its observed generic category; these are file resource types, independently of the file hardlink table’s constant type 1. Supported Linux 4.1.13.26 AMD64: registry 0x7554e70, classifier 0x7558600, resource constructors 0x755c1ca/0x755d66f (category << 16 | 3).
- find_
projected_ message - Find one exact server identity in the sole supported ordinary shard. This never adopts a first match from an ambiguous or rotated shard family.
- hardlink_
md5_ hash - Native 32-bit SuperFastHash of the 32 ASCII hex characters, not decoded MD5. SQLite stores its unsigned result as a nonnegative 64-bit INTEGER.
- initialize_
official_ home - Minimal ordinary HOME and explicit identity, without saved credentials.
- initialize_
official_ home_ with_ login - Fresh official-format HOME with server-issued saved credentials. Known global records and native legacy key-info fallback are initialized, without guessing a key_md5 value. Same-build official startup acceptance remains a runtime check.
- initialize_
profile - Creates a NEW account root atomically. The caller supplies an existing/new 32-byte binary database password explicitly and stores returned keys separately. For an official home this is the accepted account AuthSect field 9 payload; generating another password cannot substitute for that server-issued value. This initializes ordinary native schemas; it does not claim a fully trusted login profile or manufacture custom-tokenizer indexes.
- keys_
from_ agent_ cache - Read only the matching authorized cached key records from a coherent copied agent database. This never calls the old database initializer/migrator or any key acquisition process. The agent token is an unlock passphrase, not an exported profile key or network credential.
- keys_
from_ password - Export only validated per-file keys from an explicitly supplied existing account password. No password discovery, fallback, account switch, or source mutation takes place; the password itself is not retained in the result.
- mark_
read_ messages - Project only the selected source-qualified incoming observations. This is desktop-local state: it neither acknowledges consumer events nor sends a read receipt to the phone. Counter/list discrepancies already present are retained by subtracting only removed rows rather than rebuilding from list cardinality.
- mark_
read_ thread - Clear this session through a frozen server timestamp, preserving later rows. Unlike an exact-ID projection, this reconciles an older counter/list mismatch when the entire known session is before the boundary. It performs no RPC.
- mark_
read_ thread_ exit - Project only the unread-clear component of a recognized session-exit control. Missing, hidden and excluded sessions remain unchanged. The caller must retain the full control as incomplete and journal every evaluated result.
- mmkv_
string_ value - Native string/Data encoding used inside each MMKV value record.
- official_
account_ directory - Observed directory naming in the inspected Linux profile. The suffix is the first four lowercase MD5 hex digits of decimal UIN, not a username hash. The complete fresh-home takeover still needs a same-build compatibility check.
- parse_
dat_ v2 - plan_
saved_ key_ info - Inspect only caller-confirmed stopped files, copying DB/WAL/SHM before SQLite. Existing databases must have the exact known unique-index/table shape.
- publish_
cache_ file - Create one content-verified cache file without replacing any existing path. The adapter supplies a native relative path, encoded bytes and expected SHA. Atomic publication is idempotent; SQL resource registration is a later step.
- publish_
legacy_ key_ info - Atomic legacy fallback publication with an expected old-generation SHA-256. None means a new file, never permission to overwrite unknown contents. The coordinator journals/retries this step under its exclusive profile lease.
- publish_
mmkv_ append - Publish a previously staged append while the caller holds exclusive profile ownership and its durable intent. Data is replaced first: the old metadata still validates the unchanged ciphertext prefix. Metadata publication exposes the new span. Replay accepts the intermediate new-data/old-metadata state. This is not atomic with database, credential or sidecar cursor transactions.
- publish_
mmkv_ append_ guarded - Recheck an external authorization fence before each independent data/metadata commit. If the fence closes between commits, the caller retains its sealed intent and the ordinary append replay rules accept the data-first state.
- publish_
mmkv_ create - Publish a journaled newly created pair without replacing any existing bytes. Replay accepts only exact staged files, including a data-only crash state. The caller must authorize the missing store (e.g. its managed bootstrap receipt) and create/own the canonical parent directory before calling this function.
- publish_
saved_ key_ info - Publish native-shaped key-info, retaining unrelated accounts/history. The inspected writer supplies key_md5=‘’ (not a digest of the new credential). Its known UNIQUE(user_name_md5,key_info_md5) tuple is replaced only when the older tuple contains identical bytes and the same native empty key_md5. If no DB exists, use the native raw legacy fallback without inventing a DB.
- publish_
saved_ key_ info_ guarded - The coordinator must recheck its authorization fence immediately before each independently durable publication. A false guard preserves the caller’s encrypted intent for replay; it cannot roll back an earlier committed file.
- read_
account_ sync_ key - Read the desktop cursor from a caller-confirmed stopped/coherent account. The binary cursor is independent of saved-login and business-session keys.
- read_
mmkv_ identity - CRC32 checks the captured ciphertext span; it is not authentication. Identity values must also match the independently authenticated native account.
- read_
profile_ key_ info - Restore only the existing account’s key-info for a new approval/QR exchange. This remains useful when saved AutoAuth trust is expired or unavailable; a fresh approval does not justify dropping the installation’s key-info.
- read_
profile_ saved_ login - Read identity and the exact native latest-row/legacy selection from a stopped full HOME. Database/WAL/SHM queries use an isolated working copy; encrypted profile DB keys and native login credentials are never substituted.
- remove_
recalled_ search - Remove only the supported ordinary index entries for this exact owned source. The caller retains its recall intent and retries local work after interruption.
- saved_
login_ policy - Preserve the existing desktop auto-login policy while reading a bound store.
- stage_
accepted_ saved_ login_ projection - Accepted-login-only variant. The caller must have installed the matching authenticated generation and cleared its own logout fence first. Generic staging retains the logout flag; only this explicit path may clear it.
- stage_
account_ contact_ sync_ key - stage_
account_ sync_ key - Stage the native account store’s cursor. A coordinator must first durably apply every relevant command and journal this sealed generation before publication.
- stage_
mmkv_ sync_ key - Stage the proved native SyncKey string field in an explicitly selected account store. This does not guess the path, write the legacy file, or advance a cursor.
- stage_
mmkv_ values - Append while preserving IV/sequence/flags and the complete old ciphertext prefix. A full data file grows to the next 4096-byte page, at most 4 MiB; records are never compacted or discarded. Identical values are byte-idempotent. Values are already MMKV-encoded; None is a tombstone. Unknown keys survive.
- stage_
saved_ login_ projection - Stage accepted saved credentials against an already bound identity store. No filesystem mutation occurs, so a coordinator can journal the complete sealed generation before publishing the MMKV pair and legacy key-info file.
- verify_
profile_ password - Confirm a server-issued account database password against every actual DB header and the already authorized page-key map. Only 4096-byte headers are read; SQLite never opens these files, and no key/password bytes are returned. The caller must hold exclusive profile ownership or supply a stopped copy. Missing coverage, a different salt generation or one mismatched key fails closed. This does not rekey, repair, replace or switch the attached profile.