Clashgram is a highly optimized, privacy-focused hybrid web and native client for Telegram. Architected on top of the official Telegram Web A client, Clashgram introduces rigorous privacy controls, client-side message retention, multi-account routing, dynamic glassmorphism interface layers, and local machine learning audio transcription.
The application is structured to run as a highly performant static web application and is packaged within a custom native Android container optimized for modern display cutouts and responsive safe area constraints.
Unlike simple interface wraps, Clashgram introduces state modifications, network interception, and local storage overrides directly within the Web client runtime.
The privacy module operates at the boundary of the MTProto network client and local state selectors to restrict outbound data disclosure:
- Selective Read Acknowledgment: When a conversation is loaded, the client updates the local unread count to zero instantly for a clean user experience. However, outbound network packets for
messages.readHistoryare intercepted and discarded before serialization. - Typing State Suppression: Outgoing typing status updates, voice recording indicators, and document uploading states are intercepted at the action-handler level in
src/global/actions/api/messages.tsand returned immediately, ensuring no status indicators are broadcast to target chats. - Presence Heartbeat Filtering: The application blocks outgoing status heartbeats (
account.updateStatus). When the user's account configuration is set to public visibility for status tracking, Clashgram captures inbound presence streams for peer nodes while completely suppressing outgoing presence indicators. - Anonymized Story Consumption: Interactive story views are kept anonymous by suppressing the
stories.readStoriesnetwork calls, preventing the user's account identifier from registering in the author's viewed log.
Clashgram maintains structural integrity of incoming communication by overriding server-directed deletion and modification commands:
- Message Retention (Anti-Delete): Server-side message retraction triggers (
UpdateDeleteMessages) are intercepted insidesrc/global/reducers/messages.ts. Instead of purging target elements from the local state arrays, Clashgram flags the records withclashgramDeleted: true, halts active deletions, and persists the payload to an IndexedDB store via thesaveClashgramMessagehandler. Retained messages are rendered with an indicators to signify server retraction. - Revision History (Anti-Edit): Upon receiving message edit packets (
UpdateEditMessage), Clashgram retrieves the cached content payload from local storage, assigns the historical text to theclashgramOriginalTextfield, and flags the message state. The UI displays the original revision beneath the edited message. - Automated Pruning: A toggleable retention scheduler allows users to configure database pruning intervals (1, 3, or 7 days, or until session close) to maintain local database performance.
Channel and group protection flags (such as the no_forwards flag that limits copying, saving, and forwarding) are neutralized at the interface layer:
- The system strips the
user-select: noneCSS rules, overrides standard system right-click block actions in the document root, and forces media saving interfaces to remain active, enabling normal copying, selection, and forwarding.
Certain user configurations, premium features, and visual badges are unlocked via local state manipulation:
- Global state selectors (
selectIsCurrentUserPremiumand user info hooks) check theclashgramLocalPremiumruntime parameter. - When active, the selectors inject simulated account flags into the current session. This enables localized interface badges, double-limit allocations, custom emoji sets, and reaction animations without modifying database records on the centralized servers.
Voice and audio message transcription is handled entirely client-side without relying on third-party cloud engines:
- Uses local Whisper models compiled to ONNX Runtime and executed directly within the web sandbox via WebGPU and WebAssembly.
- Users can select between Tiny (optimized for speed and low memory profiles), Base (default performance threshold), and Small (highest accuracy).
- Supports native language transcription and direct translation to English completely offline.
The interface layer features a configurable depth theme:
- Renders translucent overlays using GPU-backed
backdrop-filter: blur()configurations across panels, menus, and sidebars. - Utilizes a dynamic HSL styling engine to customize color Hue (0 to 360 degrees) and Opacity (0 to 100 percent) in real time.
The mobile application is compiled into an Android wrapper using the Capacitor engine, featuring specialized configurations:
- Viewport Management: Binds layout parameters using standard CSS environment variables (
env(safe-area-inset-top),env(safe-area-inset-bottom)). This ensures system taskbars and display camera cutouts do not overlap interactable components, maintaining layout consistency across diverse device orientations. - Adaptive Asset Assets: Native launchers use custom adaptive icon assets, compiled and rendered across multiple mipmap density levels (mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi).
| Capability | Standard Web Client | Clashgram Client | Implementation Vector |
|---|---|---|---|
| Selective Read Receipts | No | Yes | Discards messages.readHistory MTProto calls |
| Typing State Hiding | No | Yes | Short-circuits outgoing typing action streams |
| Presence Suppressing | No | Yes | Discards outgoing presence updates |
| Local Message Deletion Bypass | No | Yes | Intercepts and caches UpdateDeleteMessages |
| Revision Auditing (Edits) | No | Yes | Tracks historical state via IndexedDB cache |
| Protected Chat Export | No | Yes | Neutralizes DOM-level user-select locks |
| Local Account Emulation | No | Yes | Injects simulated state properties into memory selectors |
| Local Machine Learning Audio Transcripts | No | Yes | WebAssembly/WebGPU based ONNX Whisper engine |
| HSL Glassmorphism Overlays | No | Yes | Hardware-accelerated dynamic backdrop CSS variables |
| Safe-Area Display Scaling | No | Yes | Capacitor container with CSS safe-area bindings |
- Clone the repository:
git clone https://github.com/ajisth69/clashgram.git cd clashgram - Create the environment configuration file:
cp .env.example .env
- Configure your Telegram API credentials in
.env(obtainable from my.telegram.org):CLASHGRAM_API_ID=1234567 CLASHGRAM_API_HASH=abcdef0123456789abcdef0123456789
- Install dependencies:
npm install
- Start the local development server:
npm run dev
# Compile optimized production web bundle
npm run build:production
# Synchronize static web assets with the native Android container
npx cap sync androidTo compile the APK binary from the command line interface without launching Android Studio:
# Windows Environments (PowerShell)
cd android
./gradlew assembleDebug
# Unix-like Environments (Linux / macOS)
cd android
./gradlew assembleDebugThe compiled, ready-to-run debug package is located at:
android/app/build/outputs/apk/debug/app-debug.apk
The application has isolated automated deployment pipelines:
The static web bundle utilizes the workflow defined in .github/workflows/deploy.yml.
- Triggers: Pushes to the
mainbranch. - Optimizations: Restricts execution to web-only assets using
paths-ignoreconfiguration on native folders, automation templates, and documentation trees. - Requirements: Store the
CLASHGRAM_API_IDandCLASHGRAM_API_HASHvalues as GitHub Repository Secrets.
The automation configuration .github/workflows/android-release.yml compiles and publishes native binaries.
- Triggers: Executed on version tag updates (matching
v*) or via manual trigger. - Outcome: Sets up a clean Java 17 container, compiles the Gradle assets, and updates the release artifacts on the GitHub Releases interface.
To host the web assets on Cloudflare Pages:
- Add the repository to Cloudflare Pages.
- Set the Build command to:
npm run build:production - Set the Build output directory to:
dist - Configure the Ignored builds parameter in the dashboard configuration to skip executions for native-only commits:
git diff --quiet HEAD^ HEAD -- . ':!android' ':!.github' ':!scratch' ':!docs' ':!README.md' ':!.gitignore'
A: The application operates strictly within standard browser sandbox specifications or standard system WebViews, connecting to official MTProto endpoints. It does not automate interactions or generate spam sequences, meaning it conforms to Telegram's normal API usage patterns and remains undetectable.
A: Open the main sidebar, select Settings, and choose Clashgram Settings. You can toggle the Native Glass Theme and tweak the Hue and Opacity slider parameters to alter the translucency of the interface.
A: On its initial execution, the local on-device transcription engine must download the target Whisper model weight configurations to the local IndexedDB system cache. Once downloaded, all future transcribing actions are processed locally and operate entirely offline.
A: Open Settings -> Clashgram Settings -> Passcode Lock. Configuring a passcode activates standard client-side state locks, restricting access to target chat folders and conversations until unlocked.
Clashgram is an independent modification based on the open-source Telegram Web A client. All original Telegram design assets, stylesheets, animations, and core algorithms are the properties of Telegram FZ-LLC. Modified and distributed under the GNU GPL v3 license agreements.