swiftgram.... with TOS BREAKING FEATURES!!!
  • Swift 45.9%
  • C 42.2%
  • Objective-C 4.6%
  • Assembly 2.9%
  • C++ 2.3%
  • Other 1.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
yxzero d0164ea03b Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license
Rebrand as Swiftgram Next. Add GPL-2.0 LICENSE (matching upstream) and a
rewritten README covering the features, sideloading, build, and config.
Track build-system/sg-local-configuration.json. Ignore bazel-swiftgram*
convenience symlinks.
2026-08-06 02:06:50 +08:00
.github Swiftgram Version 12.7 2026-06-09 23:22:11 +03:00
.vscode Swiftgram Version 12.7 2026-06-09 23:22:11 +03:00
.xcodebuildmcp Update xcodebuildmcp config 2026-05-20 00:34:25 +08:00
build-system Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license 2026-08-06 02:06:50 +08:00
buildbox Working state 2022-08-11 00:39:11 +04:00
docs Rich-message media in gallery/shared-media/preview pipelines via Message.effectiveMedia 2026-06-04 23:46:56 +02:00
scripts Temp 2026-03-13 09:00:55 +01:00
submodules Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license 2026-08-06 02:06:50 +08:00
Swiftgram Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license 2026-08-06 02:06:50 +08:00
Telegram Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license 2026-08-06 02:06:50 +08:00
Tests Refactoring 2026-04-07 11:31:22 +02:00
third-party Upate webrtc 2026-05-05 20:32:33 +02:00
tools Extract tgcalls helpers into tgcalls 2026-04-30 22:13:55 +02:00
.bazelrc feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
.cursorignore Build system 2025-05-05 17:58:19 +02:00
.gitattributes Various fixes 2021-02-11 22:51:56 +04:00
.gitignore Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license 2026-08-06 02:06:50 +08:00
.gitlab-ci.yml Update CI 2026-05-28 17:25:20 +02:00
.gitmodules Swiftgram Version 12.7 2026-06-09 23:22:11 +03:00
AGENTS.md Swiftgram Version 12.7 2026-06-09 23:22:11 +03:00
BUILD.bazel Temp 2026-03-13 09:00:55 +01:00
build_number_offset Fix chat title update 2026-02-10 10:52:53 +04:00
CLAUDE.md Rich-message media in gallery/shared-media/preview pipelines via Message.effectiveMedia 2026-06-04 23:46:56 +02:00
crowdin.yml Swiftgram Version 12.7 2026-06-09 23:22:11 +03:00
LICENSE Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license 2026-08-06 02:06:50 +08:00
MODULE.bazel Swiftgram Version 12.7 2026-06-09 23:22:11 +03:00
MODULE.bazel.lock Update instructions and fix build 2026-05-01 00:49:47 +02:00
Random.txt Force build 2026-06-05 01:05:54 +02:00
README.md Swiftgram Next: TOS-breaking features, sideload support, docs, GPL license 2026-08-06 02:06:50 +08:00
versions.json Bump version 2026-05-27 00:06:37 +02:00
WORKSPACE Cleanup 2025-05-17 02:34:15 +08:00

Swiftgram Next

Swiftgram with TOS-breaking features.

Backup mirror: git.yxz.is/yxzero/swiftgram-next

Swiftgram Next is a fork of Swiftgram (itself a fork of Telegram-iOS) that strips out the client-side restrictions the official app enforces on Telegram's behalf and adds local privacy features: keeping deleted messages, preserving edit history, defeating view-once/self-destruct, bypassing forwarding/copy/screenshot and content restrictions, removing the age gate, removing all ads and telemetry, unlocking Swiftgram Pro for free, and a local Telegram Premium toggle.


Features

Swiftgram Next removes the client-side restrictions the official app enforces on Telegram's behalf and adds local privacy features. The message-privacy features are opt-in (off by default) and configurable per-chat where noted; the removals below are baked into the build. The core implementations live in submodules/TelegramCore/Sources/Swiftgram/.

Message privacy

Anti-recall — keep deleted messages. When the server tells the client to delete an incoming message, Swiftgram Next keeps it instead of removing it. Preserved messages stay in place in the chat, tagged locally, so they render exactly where they were. Only incoming messages are preserved (your own deletions are respected), and media is detached from its now-dead cloud reference into a local copy so photos/videos/files survive even after the sender deletes them. Per-chat exclusions plus toggles for media and bot messages.

Anti-edit — full edit history. Every time the server edits an incoming message, the previous text version is stored as a co-located message attribute. You keep the complete revision history (text + timestamp) of edited messages, cleaned up automatically if the message is ever removed.

View-once / self-destruct preservation. View-once and self-destructing media are marked and preserved with a distinct local tag, so the flame UI still works while the content stays available after the server strips the TTL. Complete media bytes are detached on demand for forwarding.

Local last-seen. Records the last activity timestamp inferred for other users (from message/reaction timestamps seen while browsing), so a "last seen" can be surfaced even for users who have hidden it server-side. Inferred passively, stored locally, shown marked with ~.

Clear Message Database. A single action wipes everything the above preserved — deleted messages, edit-history attributes, the metadata archive, and the local last-seen store. Because everything is stored locally, these features cost device storage that grows over time; this is how you reclaim it.

Restriction & censorship bypass

Forwarding / copy-protection bypass. Ignores the server-side "restrict saving content" (noforwards) flag, so copy, forward, save-to-gallery, and share stay available even in copy-protected chats. The UI can still surface a read-only "copy-protected" indicator, but the actions are re-enabled.

Screenshot bypass. The screenshot-blocking secure layer (Telegram's FLAG_SECURE analogue) is neutralized to a no-op, so protected, secret-chat, and self-destruct media stays visible and screenshottable.

Content-restriction bypass. When enabled, messages, channels, and users are never reported as restricted, so the "this message can't be displayed" bubble never appears and restricted/sensitive content is shown anyway (the soft tap-to-reveal blur for sensitive media is kept).

Age-gate removal. The client no longer requires camera / face-scan / bot-based age verification. Sensitive content stays behind the local tap-to-reveal blur instead of a hard age gate.

De-monetization & privacy

All ads removed. Sponsored messages are disabled outright — the client never requests them, and any entries cached by an older build are purged from the local database so they can't be restored offline. Ad-related settings UI is removed too.

Telemetry removed. The app-log event sync and network-stats reporting that upload download/timing metrics back to Telegram are stripped out.

Unlocked client features

Swiftgram Pro removed — all features free. The SGProUI paywall module is deleted and its screens (app icon selector, message filters, session backup) are moved into the normal settings, so every former Pro feature is available with no subscription.

Local Telegram Premium. A "Local Premium" toggle forces the current account to read as Premium client-side, unlocking premium-gated UI and features in the app. Note this is local only — server-side limits still apply, so anything the server enforces (upload sizes, etc.) is unchanged.


Sideloading

This fork is modified to run when sideloaded — installed with your own signing certificate instead of through the App Store, using tools like AltStore, SideStore, or a direct ideviceinstaller/.ipa install. Sideloaded apps don't get App Store provisioning, so the stock build's entitlements and app-group setup don't apply as-is. The modifications here make the app build and launch cleanly under a self-signed / free-developer identity, so you can install it on your own device without a paid App Store distribution flow.

Build a device IPA (see below), sign it with your own certificate and provisioning profile, then install it with your sideloading tool of choice.


Building

Swiftgram Next builds exactly like the official Telegram-iOS / Swiftgram app, using Bazel via the Make.py wrapper. There is no per-module build — the only supported invocation builds the full Telegram/Telegram target.

1. Get the code

git clone --recursive -j8 https://github.com/yx-zero/swiftgram-next.git
cd swiftgram-next

If you already cloned without --recursive:

git submodule update --init --recursive

2. Install Xcode

Install the Xcode version pinned in versions.json (directly from https://developer.apple.com/download/applications or the App Store). The build scripts check the installed versions against versions.json; pass --overrideXcodeVersion to bypass the check.

3. Configure

build-system/sg-local-configuration.json is the build configuration (bundle id, api_id, api_hash, team_id, etc.). It ships with the official Swiftgram api_id/api_hash, so your builds identify to Telegram as Swiftgram itself — meaning you effectively can't get banned for using a custom client. Just set your own team_id for device codesigning. A simulator build works without codesigning (see below).

Keep the bundle id as app.swiftgram.ios (the default). Push notifications rely on it: the build gates Swiftgram's notification-service entitlement fragment on this exact bundle id (see Telegram/BUILD), so changing it silently drops notification filtering and breaks push. Leave bundle_id untouched unless you have your own push/APNs setup wired up to a different id.

4. Build

Simulator (no codesigning required):

python3 build-system/Make/Make.py --overrideXcodeVersion \
    --cacheDir="$HOME/telegram-bazel-cache" \
    build \
    --configurationPath=build-system/sg-local-configuration.json \
    --disableProvisioningProfiles \
    --buildNumber=1 --configuration=debug_sim_arm64

Device IPA (release):

python3 build-system/Make/Make.py --overrideXcodeVersion \
    --cacheDir="$HOME/telegram-bazel-cache" \
    build \
    --configurationPath=build-system/sg-local-configuration.json \
    --codesigningInformationPath=<your-provisioning-data> \
    --buildNumber=100001 --configuration=release_arm64

Generate an Xcode project

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath=build-system/sg-local-configuration.json \
    --xcodeManagedCodesigning

Project structure

  • submodules/TelegramCore/Sources/Swiftgram/ — the TOS-breaking feature implementations (anti-recall, anti-edit, view-once preservation, local last-seen, clear-database).
  • Swiftgram/ — Swiftgram's own UI modules (SGSettingsUI, SGItemListUI, SGDebugUI, …) where these features are exposed as toggles.
  • Telegram/ — app launch code and extensions (share, notifications, widgets, Siri, watch app).
  • submodules/ — the bulk of the app, organized as libraries.
  • third-party/ — vendored external code.

Troubleshooting

Xcode stuck at "build-request.json" not updated yet, waiting... — cancel the build and start a new one.

Telegram_xcodeproj: no such package (often after a restart) — re-run the project-generation step above.

License

Swiftgram Next is licensed under the GNU General Public License v2.0, the same license as upstream Telegram-iOS and Swiftgram. See LICENSE.

Per the license and Telegram's developer terms: use your own api_id/api_hash, do not ship this under the name or logo of Telegram, and publish your source when you distribute a build.

Acknowledgements