This repository hosts prebuilt native tdjson artifacts used by Mithka.
The main Mithka app repository contains the Flutter app and its Dart TDLib adapter. This repository exists only to keep large platform-specific TDLib binaries and native packaging notes out of the user-facing app checkout.
Current app setup expects:
tdjson-android-arm64-v8a.ziptdjson-android-armeabi-v7a.ziptdjson-android-x86_64.ziptdjson-ios.xcframework.ziptdjson-linux-x64.ziptdjson-macos-universal.ziptdjson-windows-x64.ziptdjson-manifest.jsonSHA256SUMS
Each Android zip should contain its ABI directory at the root:
arm64-v8a/
libtdjson.so
The iOS zip should contain tdjson.xcframework at its root:
tdjson.xcframework/
Info.plist
ios-arm64/
ios-arm64-simulator/
Each desktop zip contains one runtime library at its root:
libtdjson.so
libtdjson.dylib
tdjson.dll
tdjson-manifest.json records the exact upstream commit, packaging-workflow
commit, patch-set digest, archive digests, and digest of every packaged file.
SHA256SUMS provides a standard checksum list for all release files.
When upstream additions conflict with mithka-installed-cloud-themes.patch,
Free-model TDLib patch repair can generate a bounded repair using the
repository's OPENROUTER_API_KEY secret. It uses openrouter/free with a zero
price ceiling and never falls back to paid inference. The model can only order
both complete additive conflict sides in the schema and ThemeManager.h;
deletions, changed nonempty lines, other paths, and semantic conflicts require
manual review. Session backup and transfer-boost patches are outside its scope.
The proposal job has the model key and read-only repository access. A separate
key-free job reapplies the complete series twice and generates/checks the schema
and all eight patched translation units. Only then may a separate publication
job create or update the single automation/tdlib-theme-patch PR. Model output
is source data, never shell commands. Failed/stale validation leaves the PR
unchanged.
Automatic PR writes are opt-in via repository variable
TDLIB_REPAIR_PR_WRITES=true and GitHub's repository setting allowing Actions
to create PRs. That GitHub setting also permits approving reviews, so enabling
it requires an explicit maintainer decision; this workflow never approves.
Without opt-in, generation and validation still retain the proposed patch and
provenance as a CI artifact.
With TDLIB_REPAIR_AUTO_MERGE=true, a separate trusted-master job automatically
merges that bot-authored, patch-only PR after its exact head passes read-only
preflight. It verifies the original generation artifact, zero-cost/additive
policy, patch hashes, pinned upstream, current master, and review state. Manual
commits, manual notes or feedback, unresolved threads, unrelated files, stale
validation, and changed master stop automatic merging. It never approves PRs
or merges unrelated submissions. Publication uses the exact checked tree and
a non-force master update, then explicitly starts the normal native-build
pipeline; native artifacts still require every existing platform build gate.
The explicitly dispatched preflight also avoids human approval of duplicate
bot-created PR runs. Only the matching zero-job, pending Sync PR check suite
is exempted; other pending checks and all actual failures still block merging.
To audit a successful canonical-branch preflight without any writes or model
calls, manually run the repair workflow with audit_merge_run=<run-id>.
PRs and manual Sync TDLib Artifacts runs with validate_only: true execute
only read-only preflight. Native artifact publication remains restricted to
canonical master after the existing build gates. The existing HarmonyOS PR is
independent of patch-drift repairs and must not be reused for unrelated fixes.
.github/workflows/sync-upstream.yml runs daily, after relevant packaging changes,
and on manual request. It resolves the current tdlib/td master commit, reads
the TDLib version from upstream, validates the ordered Mithka patch series, and
publishes an immutable release tagged
tdlib-<version>-<sha12>-mithka-<patch-sha12>-build-<build-sha12>-v<schema> only
when that exact source, patch set, build definition, and artifact schema do not
already have a complete release.
The release publishes all assets consumed by the Mithka app CI:
tdjson-android-arm64-v8a.zip
tdjson-android-armeabi-v7a.zip
tdjson-android-x86_64.zip
tdjson-ios.xcframework.zip
tdjson-linux-arm64.zip
tdjson-linux-x64.zip
tdjson-macos-universal.zip
tdjson-ohos-arm64.zip
tdjson-windows-arm64.zip
tdjson-windows-x64.zip
tdjson-manifest.json
SHA256SUMS
Mithka pins this exact release tag, so historical app builds keep using their
original TDLib binaries. Releases are never deleted by the sync workflow. A
manual force=true run publishes a separate -rebuild-<run-id>-<attempt>
release instead of replacing the original artifacts.
The sync workflow builds tdjson-ohos-arm64.zip with every other platform
in a digest-pinned OpenHarmony SDK container, so each complete tdlib-*
release carries it.
.github/workflows/build-ohos.yml remains a manual HarmonyOS-only build
for testing a specific TDLib ref. It publishes an immutable, non-latest
release tagged
tdjson-ohos-<version>-<sha12>-mithka-<patch-sha12>-build-<build-sha12>-v<schema>
only when that exact source, patch set, build definition, and artifact
schema do not already have a complete release, with these assets:
tdjson-ohos-arm64.zip
tdjson-manifest.json
SHA256SUMS
The zip contains the ABI directory at its root, matching the Android layout that the Mithka ohos consumer expects:
arm64-v8a/
libtdjson.so
tdjson-manifest.json follows the same schema-v2 contract as the sync
workflow (archive/member digests plus source, patch set, build
definition, and packaging provenance), covering the ohos arm64 asset so
the Mithka installer can pin and verify it. The workflow never deletes
or replaces a published release; a manual force=true run publishes a
separate -rebuild-<run-id>-<attempt> release instead.
.github/workflows/build-tgvoip-ios.yml builds the same TgVoipWebrtc Bazel
target used by the official Telegram iOS client. It publishes an immutable,
non-latest release tagged tgvoip-telegram-ios-<sha12> with this asset:
tgvoip-ios.xcframework.zip
The workflow is manual because the Mithka app pins the full release URL. Run it
with telegram_ref=master for the current official client commit, or provide an
exact Telegram iOS commit for a reproducible rebuild.
scripts/build-android-libs.sh arm64-v8aThe script writes dist/tdjson-android-<abi>.zip.
From the Mithka app checkout, after ios/tdjson/tdjson.xcframework exists:
scripts/package-ios-xcframework.sh /path/to/mithka/ios/tdjson/tdjson.xcframeworkThen upload dist/tdjson-ios.xcframework.zip to a GitHub Release.
The sync workflow builds these automatically. A local diagnostic build can use:
scripts/build-desktop-lib.sh linux dist/libtdjson.so
scripts/package-desktop-lib.sh \
dist/libtdjson.so tdjson-linux-x64.zip distTD_COMMIT defaults to upstream master; set it to a full TDLib commit for a
reproducible local build. Published releases always use the full commit resolved
by the workflow.
TDLib is developed by Telegram and distributed under its upstream license.
This repository only packages the native tdjson binary for Mithka builds.