# arslan4k1390/cherrygram architecture

> Architecture diagram of the GitHub repository arslan4k1390/cherrygram, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arslan4k1390/cherrygram
- Repository: https://github.com/arslan4k1390/cherrygram

## Overview

Cherrygram is an unofficial Android Telegram client. The central user journey is using the app to communicate through Telegram; the README identifies the client and Telegram API/MTProto, but the main conversation UI and request-handling code are not present in the supplied tree, so their internal wiring is not inferred. The sampled sources show distinct supporting capabilities for stories persistence, group-call messages, web search, and theme preview, plus JNI/native networking and SQLite boundaries. The graph uses those concrete paths and leaves unsampled runtime links out.

Main entry points: [`TMessagesProj/src/main/java/org/telegram`](https://github.com/arslan4k1390/cherrygram/tree/main/TMessagesProj/src/main/java/org/telegram) (Telegram client), [`TMessagesProj/jni/TgNetWrapper.cpp`](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/TgNetWrapper.cpp) (Native networking), [`TMessagesProj/src/main/java/org/telegram/ui/web/SearchEngine.java`](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/ui/web/SearchEngine.java) (Web search), [`TMessagesProj/src/main/java/org/telegram/messenger/AuthenticatorService.java`](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/messenger/AuthenticatorService.java) (Account authenticator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Android client"]
  node_client_app["Telegram client"]
  node_auth["Account authenticator"]
end

subgraph group_features["Client features"]
  node_group_call["Group-call messages"]
  node_stories[("Stories storage")]
  node_theme["Theme preview"]
  node_search["Web search<br/>[SearchEngine.java]"]
end

subgraph group_native["Native services"]
  node_native_net["Native networking<br/>[TgNetWrapper.cpp]"]
  node_sqlite["SQLite bridge<br/>[SqliteWrapper.cpp]"]
  node_buffers["Network buffers<br/>[BuffersStorage.cpp]"]
  node_voip_video["WebRTC video"]
end

subgraph group_crypto["Cryptography"]
  node_boringssl["BoringSSL"]
end

node_user(("App user"))
node_telegram(("Telegram services"))
node_android(("Android account manager"))

node_android -->|"binds authenticator"| node_auth
node_user -->|"uses client"| node_client_app
node_client_app -->|"provides call messaging"| node_group_call
node_client_app -->|"stores stories"| node_stories
node_client_app -->|"previews themes"| node_theme
node_client_app -->|"selects search"| node_search
node_search -.->|"search URL"| node_telegram
node_client_app -->|"native boundary"| node_native_net
node_native_net -->|"Telegram protocol"| node_telegram
node_native_net -->|"uses buffers"| node_buffers
node_client_app -->|"native database boundary"| node_sqlite
node_client_app -->|"cryptographic support"| node_boringssl
node_client_app -.->|"VoIP video support"| node_voip_video

click node_client_app "https://github.com/arslan4k1390/cherrygram/tree/main/TMessagesProj/src/main/java/org/telegram"
click node_group_call "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/messenger/voip/GroupCallMessagesController.java"
click node_stories "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesStorage.java"
click node_theme "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/ui/ThemePreviewActivity.java"
click node_search "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/ui/web/SearchEngine.java"
click node_auth "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/messenger/AuthenticatorService.java"
click node_native_net "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/TgNetWrapper.cpp"
click node_sqlite "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/SqliteWrapper.cpp"
click node_buffers "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/tgnet/BuffersStorage.cpp"
click node_boringssl "https://github.com/arslan4k1390/cherrygram/tree/main/TMessagesProj/jni/boringssl"
click node_voip_video "https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/voip/webrtc/media/engine/webrtc_video_engine.cc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_app,node_auth,node_user toneBlue
class node_group_call,node_stories,node_theme,node_search toneAmber
class node_native_net,node_sqlite,node_buffers,node_voip_video toneMint
class node_boringssl toneRose
class node_telegram,node_android toneIndigo
```

## Components

### Android client

- [Telegram client](https://github.com/arslan4k1390/cherrygram/tree/main/TMessagesProj/src/main/java/org/telegram): `TMessagesProj/src/main/java/org/telegram`
- [Account authenticator](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/messenger/AuthenticatorService.java): `TMessagesProj/src/main/java/org/telegram/messenger/AuthenticatorService.java`

### Client features

- [Group-call messages](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/messenger/voip/GroupCallMessagesController.java): `TMessagesProj/src/main/java/org/telegram/messenger/voip/GroupCallMessagesController.java`
- [Stories storage](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesStorage.java): `TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesStorage.java`
- [Theme preview](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/ui/ThemePreviewActivity.java): `TMessagesProj/src/main/java/org/telegram/ui/ThemePreviewActivity.java`
- [Web search](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/src/main/java/org/telegram/ui/web/SearchEngine.java): `TMessagesProj/src/main/java/org/telegram/ui/web/SearchEngine.java`

### Native services

- [Native networking](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/TgNetWrapper.cpp): `TMessagesProj/jni/TgNetWrapper.cpp`
- [SQLite bridge](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/SqliteWrapper.cpp): `TMessagesProj/jni/SqliteWrapper.cpp`
- [Network buffers](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/tgnet/BuffersStorage.cpp): `TMessagesProj/jni/tgnet/BuffersStorage.cpp`
- [WebRTC video](https://github.com/arslan4k1390/cherrygram/blob/main/TMessagesProj/jni/voip/webrtc/media/engine/webrtc_video_engine.cc): `TMessagesProj/jni/voip/webrtc/media/engine/webrtc_video_engine.cc`

### Cryptography

- [BoringSSL](https://github.com/arslan4k1390/cherrygram/tree/main/TMessagesProj/jni/boringssl): `TMessagesProj/jni/boringssl`

### Other components

- **App user**
- **Telegram services**
- **Android account manager**

## Connections

- Android account manager → Account authenticator: binds authenticator
- App user → Telegram client: uses client
- Telegram client → Group-call messages: provides call messaging
- Telegram client → Stories storage: stores stories
- Telegram client → Theme preview: previews themes
- Telegram client → Web search: selects search
- Web search → Telegram services: search URL
- Telegram client → Native networking: native boundary
- Native networking → Telegram services: Telegram protocol
- Native networking → Network buffers: uses buffers
- Telegram client → SQLite bridge: native database boundary
- Telegram client → BoringSSL: cryptographic support
- Telegram client → WebRTC video: VoIP video support
