Introducing a new way to review your PRs.

Read the announcement

ayugram / ayugram4a

Just an exteraGram based client with ToS breaking features in mind.

View on GitHub

13 documents · Updated Nov 19, 2026

overview

Knowledge Base updated: 2026-11-19

Knowledge Base Index

1. Orientation

This repository is Ayugram for Android, a Telegram Android client fork built around TMessagesProj. The highest-level flow is: Android starts the app shell, users authenticate, tgnet exchanges Telegram API updates/requests, controllers update SQLite-backed state, and UI screens render chats, settings, media, notifications, and calls.

Main parts:

  • TMessagesProj Android app: Gradle app module, manifest, resources, Java/Kotlin-era Android code, and native JNI code.
  • org/telegram/messenger: core runtime controllers for accounts, messages, storage coordination, media, notifications, configuration, and Android services/receivers.
  • org/telegram/tgnet plus TMessagesProj/jni/tgnet: Telegram network protocol, TL serialization, request dispatch, and native networking bridge.
  • org/telegram/ui: screens, fragments, navigation, theme system, reusable cells/components, chat UI, auth/settings UI, VoIP UI.
  • com/radolyn/ayugram and com/exteragram/messenger: fork-specific Ayugram and Exteragram features, configuration, preferences, resources, and integrations.
  • org/webrtc and TMessagesProj/jni/voip: voice/video call bindings and native call/media support.

Critical state lives in:

  • SQLite via org/telegram/SQLite, MessagesStorage, schemas, and native sqlite wrappers: messages, dialogs, users, metadata, and persistent app data.
  • Android shared preferences/config classes such as UserConfig, SharedConfig, Ayugram/Exteragram configs: account and feature settings.
  • File/media cache and path metadata through FileLoader, ImageLoader, MediaController, and FilePathDatabase.
  • Android resources under TMessagesProj/src/main/res*: strings, themes, XML components, raw call/animation assets, and fork-specific resource overlays.

2. Architecture diagrams

flowchart TD
  subgraph AndroidApp["TMessagesProj Android app"]
    Build["Gradle + Manifest"]
    Startup["ApplicationLoader / LaunchActivity"]
    UI["org/telegram/ui screens"]
    Controllers["org/telegram/messenger controllers"]
    Storage["MessagesStorage + SQLite"]
    Media["File / Image / Media pipeline"]
    Notify["Push / Notifications / Widgets"]
    Calls["VoIP + WebRTC"]
    Forks["Ayugram + Exteragram"]
  end

  subgraph Native["JNI / native"]
    TgNetNative["jni/tgnet"]
    SQLiteNative["jni/sqlite"]
    MediaNative["ffmpeg / opus / rlottie / image"]
    VoipNative["jni/voip"]
  end

  ExternalTelegram["Telegram API"]
  AndroidOS["Android OS services"]
  FCM["Firebase / push"]

  Build --> Startup
  Startup --> UI
  UI --> Controllers
  Forks --> UI
  Forks --> Controllers
  Controllers --> TgNetNative
  TgNetNative --> ExternalTelegram
  Controllers --> Storage
  Storage --> SQLiteNative
  UI --> Media
  Controllers --> Media
  Media --> MediaNative
  FCM --> Notify
  AndroidOS --> Notify
  Notify --> Controllers
  UI --> Calls
  Calls --> VoipNative
sequenceDiagram
  participant User
  participant UI as ChatActivity / DialogsActivity
  participant Controllers as MessagesController / SendMessagesHelper
  participant Net as org.telegram.tgnet
  participant API as Telegram API
  participant DB as MessagesStorage / SQLite
  participant Media as FileLoader / MediaController

  User->>UI: opens dialog or sends message
  UI->>Controllers: request dialog state or send action
  Controllers->>DB: read cached messages/dialogs
  Controllers->>Net: send TL request or message update
  Net->>API: Telegram protocol exchange
  API-->>Net: response / updates
  Net-->>Controllers: parsed TLRPC objects
  Controllers->>DB: persist messages and metadata
  Controllers->>Media: schedule media/file work when needed
  Controllers-->>UI: NotificationCenter/controller updates
  UI-->>User: render updated chat state
flowchart LR
  FCM["Push / FCM"] --> PushSvc["GcmPushListenerService"]
  AndroidReceivers["Android receivers/actions"] --> NotifyCtrl["NotificationsController"]
  PushSvc --> PushCtrl["PushListenerController"]
  PushCtrl --> NotifyCtrl
  NotifyCtrl --> MsgCtrl["MessagesController"]
  MsgCtrl --> Storage["MessagesStorage"]
  NotifyCtrl --> AndroidNotif["Android notifications"]
  AndroidNotif --> Reply["reply/open/dismiss receivers"]
  Widgets["Chats/Contacts/Feed widgets"] --> MsgCtrl
  Reply --> MsgCtrl
flowchart TD
  CallUI["VoIPFragment / GroupCallActivity"] --> VoIPService["VoIPService"]
  VoIPService --> VoIPController["VoIPController / NativeInstance"]
  VoIPController --> WebRTC["org/webrtc bindings"]
  WebRTC --> NativeVoIP["jni/voip"]
  NativeVoIP --> Network["call media/network transport"]
  VoIPService --> Notifications["call notifications + audio routing"]
  VoIPService --> Tgnet["tgnet signaling"]

3. Glossary

  • Ayugram: fork-specific feature layer under com/radolyn/ayugram with custom config, handlers, sync, database, and UI integrations.
  • Exteragram: customization layer under com/exteragram/messenger for resources, preferences, icons, boost/camera/components, and utilities.
  • TMessagesProj: the main Android application module in this repository.
  • tgnet: Telegram network/protocol layer spanning org/telegram/tgnet and native TMessagesProj/jni/tgnet code.
  • TLRPC: generated/maintained Telegram TL API object model used by network requests, controllers, and storage.

4. Codebase-wide invariants

  • The repository is organized around a single Android app module rooted at TMessagesProj/, with top-level Gradle files settings.gradle, build.gradle, and TMessagesProj/build.gradle providing the build shell.
  • Java source is rooted under TMessagesProj/src/main/java/, with major namespaces visible as org/telegram/**, org/webrtc/**, com/radolyn/ayugram/**, and com/exteragram/messenger/**.
  • Native C/C++ support is centralized under TMessagesProj/jni/**, including protocol, sqlite, media, and VoIP native subtrees such as jni/tgnet/**, jni/sqlite/**, jni/ffmpeg/**, and jni/voip/**.
  • Android resources are split between the default resource tree and fork/device overlays: TMessagesProj/src/main/res/**, TMessagesProj/src/main/res-solar/**, and TMessagesProj/src/main/res-tabs/**.
  • Fork-specific user-facing strings/resources are identifiable through resource overlays such as TMessagesProj/…/ayu.xml and TMessagesProj/…/extera.xml.

5. Routing table