- Swift 45.9%
- C 42.2%
- Objective-C 4.6%
- Assembly 2.9%
- C++ 2.3%
- Other 1.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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. |
||
| .github | ||
| .vscode | ||
| .xcodebuildmcp | ||
| build-system | ||
| buildbox | ||
| docs | ||
| scripts | ||
| submodules | ||
| Swiftgram | ||
| Telegram | ||
| Tests | ||
| third-party | ||
| tools | ||
| .bazelrc | ||
| .cursorignore | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .gitmodules | ||
| AGENTS.md | ||
| BUILD.bazel | ||
| build_number_offset | ||
| CLAUDE.md | ||
| crowdin.yml | ||
| LICENSE | ||
| MODULE.bazel | ||
| MODULE.bazel.lock | ||
| Random.txt | ||
| README.md | ||
| versions.json | ||
| WORKSPACE | ||
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 (seeTelegram/BUILD), so changing it silently drops notification filtering and breaks push. Leavebundle_iduntouched 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
- Telegram-iOS by Telegram Messenger LLP.
- Swiftgram, the upstream fork this project is built on.