Skip to content

feat: migrate the complete Dawa library from whatsappbridge + NuGet packaging - #2

Open
martiendejong wants to merge 2 commits into
mainfrom
feat/migrate-complete-dawa
Open

feat: migrate the complete Dawa library from whatsappbridge + NuGet packaging#2
martiendejong wants to merge 2 commits into
mainfrom
feat/migrate-complete-dawa

Conversation

@martiendejong

Copy link
Copy Markdown
Owner

Makes the standalone martiendejong/dawa repo the canonical, up-to-date, packageable Dawa.

What

The standalone repo held the original skeletal from-scratch Baileys port (~24 files, NoiseProcessor ~580 lines) that never fully connected. The private whatsappbridge repo carried a far more complete Dawa (NoiseProcessor ~4400 lines) with the real device-linking/pairing fixes, full Signal message decryption, LID support, history sync, media crypto, a self-updating WA version provider and DI extensions. This migrates that complete library into src/Dawa wholesale.

  • New: MediaCrypto, WaVersionProvider, HistorySyncProto, SyncProto, SignalProto + fuller Auth/Noise/Signal/Transport/WhatsAppClient.
  • csproj already NuGet-ready (PackageId=Dawa.WhatsApp, RepositoryUrl → this repo); added a <None Include> so the repo README ships as the package readme.

Verified

  • dotnet build src/Dawa clean; full solution (incl. samples) compiles against the new API.
  • dotnet packDawa.WhatsApp.0.1.0.nupkg produced.

Publish status

Publishing to nuget.org is blocked: the only NuGet key in the vault is scoped to Hazina and nuget.org 403s a brand-new Dawa.WhatsApp package; the gh token lacks write:packages for GitHub Packages. Needs a NuGet.org key with Push new packages + a glob covering Dawa.WhatsApp (or *), or a PAT with write:packages.

Next: point whatsappbridge at the published package.

🤖 Generated with Claude Code

martiendejong and others added 2 commits July 17, 2026 15:59
The standalone martiendejong/dawa repo held the original skeletal from-scratch
Baileys port (~24 files, NoiseProcessor ~580 lines) that never fully connected —
its crypto/framing bugs are exactly what the recent handshake work re-derived.
Meanwhile the private martiendejong/whatsappbridge repo carried a far more
complete, actively-maintained Dawa (NoiseProcessor ~4400 lines) with the real
device-linking/pairing fixes, full Signal message decryption, LID support,
history sync, media crypto, a self-updating WA version provider and DI
extensions.

This migrates that complete library wholesale into src/Dawa so the standalone
repo becomes the canonical, up-to-date, packageable Dawa:
- Adds MediaCrypto, WaVersionProvider, HistorySyncProto, SyncProto, SignalProto
  and the fuller Auth/Noise/Signal/Transport/WhatsAppClient implementations.
- The csproj was already NuGet-ready (PackageId Dawa.WhatsApp, points at this
  repo); added a <None Include> so the repo README ships as the package readme.

Builds clean; the full solution (samples included) compiles against the new API.
Packs to Dawa.WhatsApp.0.1.0.nupkg. (Publish to nuget.org is pending a correctly
scoped API key — the vault key is scoped to Hazina only.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Covers the deterministic layers a live handshake depends on, validating the
complete (live-verified) Dawa:
- XEdDSA sign+verify — Dawa's own Verify AND an independent BouncyCastle Ed25519
  verifier (reconstructing the Edwards key from the Montgomery key, sign bit 0),
  the exact check WhatsApp runs on the signed pre-key.
- AES-GCM counter transport / nonce-prefix / raw, with tamper + wrong-counter
  rejection.
- HKDF determinism + DeriveKeys split ordering.
- Curve25519 DH agreement; NoiseState.MixKey two-party transport agreement.
- AuthState.CreateNew's signed pre-key verifies (offline lock of what pairing
  proved live).
- Binary node encode->decode round-trips: raw strings+attrs, dictionary tokens,
  nested child nodes, JID attrs, >255B binary content; token-table shape.
- JID parsing (user/server, device, group, round-trip, empty).

The prior skeletal-era tests were removed — they asserted the old port's
behaviour (os=Macintosh, a specific WA version const, encoder flag byte) which
the complete version does differently and correctly (os=Ubuntu, self-updating
version, flag byte handled at the transport layer). 19/19 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant