Skip to content
Back to skills

Exteragram Plugin

ASecurity

Write, fix, review, speed up, port, package and publish exteraGram (Android Telegram client) Python plugins, both single-file .plugin files and multi-file Elyx (.elyx/.eaf) archives. Covers the plugin SDK (base_plugin, client_utils, android_utils, hook_utils, ui.settings, ui.alert, ui.bulletin, file_utils, intents, log_utils, extera_utils.classes, elyx), Telegram request/update/send-message hooks, Xposed method hooks, partial hooks, MVEL hook filters, Java class proxies, settings screens, men...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentspythonrustgojavagitapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add expl01t-search/exteragram-plugin-skill --skill exteragram-plugin --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Exteragram Plugin?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Exteragram Plugin
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/expl01t-search-exteragram-plugin/badge)](https://www.skillsdirectory.com/skills/expl01t-search-exteragram-plugin)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: exteragram-plugin
description: Write, fix, review, speed up, port, package and publish exteraGram (Android Telegram client) Python plugins, both single-file .plugin files and multi-file Elyx (.elyx/.eaf) archives. Covers the plugin SDK (base_plugin, client_utils, android_utils, hook_utils, ui.settings, ui.alert, ui.bulletin, file_utils, intents, log_utils, extera_utils.classes, elyx), Telegram request/update/send-message hooks, Xposed method hooks, partial hooks, MVEL hook filters, Java class proxies, settings screens, menu items, multi-account, dev server/ADB live reload and plugin repositories. Use whenever the user mentions exteraGram / Extera plugins, .plugin or .elyx files, BasePlugin, "плагин для экстераграма", Telegram client plugin hooks, or asks to write, port, fix, improve or review such a plugin.
license: MIT
metadata:
  version: "1.3.0"
---

# exteraGram plugin development

exteraGram plugins are Python 3.11 code that runs inside the Android app on
exteraGram's fork of Chaquopy, with Xposed-style hooking. Plugin code talks
directly to Telegram's Java classes (`org.telegram.*`) and Android (`android.*`).

Official docs: https://plugins.exteragram.app/docs
SDK builds and `.pyi` stubs: https://github.com/exteraSquad/plugins-pysdk-builds/releases

## SDK / app baseline (late 2026)

| Thing | Value |
|---|---|
| Python on device | 3.11 (bytecode must be built with 3.11) |
| Current SDK | `1.4.6.5` (beta, Nov 2026); `1.4.6.4` stable |
| Practical min app | exteraGram `12.5.1+` (older → SDK safe mode, plugins refuse to load) |
| `account=` params, `self.client()` | SDK `>=1.4.5.0` |
| Partial hooks (`hook_call_site` …) | SDK `>=1.4.6.4` + app with exteraHook 1.0 |
| `IntentsManager` | app `12.6.4` (versionCode 66999)+ |
| Proxy `custom_name=` | app versionCode `>=66690` |

Always declare the oldest `__app_version__` / `__sdk_version__` you actually
tested the used APIs on. Never invent API names: if unsure, check
`references/sdk-api.md` (from the official 1.4.6.5 stubs) or tell the user it
needs verification on device. What to rely on, in which order, and what not to
borrow from (Telethon, Pyrogram, Bot API, other clients): `references/sources.md`.

## Start from the task

| Request | Workflow in `references/workflows.md` |
|---|---|
| New plugin from an idea | Write a new plugin |
| Error, crash, "does nothing" | Fix a broken plugin (triage table first) |
| "Make it better / faster", code review | Improve or review a plugin |
| Old code, `self.log`, `__min_version__` | Port to the current SDK |
| Needs assets, translations, several modules | Convert a single file to Elyx |
| Catalog, channel, GitHub | Publish |

## What a plugin must have

* Static metadata: `__id__`, `__name__`, `__version__`, `__description__`,
  `__author__`, `__app_version__`, `__sdk_version__`, `__category__`
  (or the same keys in Elyx `metainfo.yml`).
* Exactly one `BasePlugin` subclass (the Elyx entry module holds it).
* Registration of every hook and menu item in `on_plugin_load`.
* A `HookResult` on every path of every event hook.
* `create_settings()` with a default for every key the code reads, when the
  plugin has options.
* Cleanup in `on_plugin_unload` for anything the host does not remove.

## What a plugin must not have

Computed metadata, unregistered hooks, blocking calls on the UI thread or in
hooks, view changes off the UI thread, replies without `account`, unfiltered
hooks on per-frame Java methods, unsigned colour literals passed to Java,
work at import time, secrets, obfuscation, `print`, Telethon/Pyrogram/asyncio
code. Each one with the fix: `references/anti-patterns.md`.

## Step 1: pick the format

* Single file (`<id>.plugin`, plain Python source): small plugins, no
  resources. Metadata = top-level `__dunder__` constants parsed with `ast`.
* Elyx archive (`.elyx` / `.eaf`, a ZIP with `refmap.yml` at the root):
  several modules, assets (SVG/PNG/Lottie/JSON), translations, bundled wheels.
  Metadata lives in `metainfo.yml`; the code has no `__id__` constants.

Start from the templates:
* `templates/single_file/hello_world.plugin`
* `templates/elyx/` (refmap, metainfo, src, strings, assets)

Details: `references/metadata-and-packaging.md`, `references/elyx.md`.

## Step 2: write the plugin

Minimal single-file plugin:

```python
from base_plugin import BasePlugin, HookResult, HookStrategy

__id__ = "hello_world"
__name__ = "Hello World"
__description__ = "Rewrites .hello commands"
__author__ = "@you"
__version__ = "1.0.0"
__icon__ = "exteraPlugins/1"
__app_version__ = ">=12.5.1"
__sdk_version__ = ">=1.4.5.0"
__category__ = "tools"


class HelloWorldPlugin(BasePlugin):
    def on_plugin_load(self):
        self.add_on_send_message_hook()

    def on_send_message_hook(self, account, params) -> HookResult:
        text = getattr(params, "message", None)
        if not isinstance(text, str) or not text.startswith(".hello"):
            return HookResult()
        params.message = "Hello from plugin!"
        return HookResult(strategy=HookStrategy.MODIFY, params=params)
```

Which reference to open for the task:

| Task | Read |
|---|---|
| Lifecycle, app events, TL request/update/send hooks, `HookResult`, menu items | `references/plugin-class.md` |
| Settings screen (`Switch`, `Selector`, `Input`, `Custom`, sub-pages) | `references/settings-ui.md` |
| Sending messages, TL requests, queues, controllers, multi-account | `references/client-utils.md` |
| Dialogs, bulletins, UI thread, clipboard, logging, text formatting | `references/ui-and-logging.md` |
| Hooking Java methods (`hook_method`, filters, MVEL, partial hooks), reflection | `references/java-hooks.md` |
| Subclassing Java classes from Python (`extera_utils.classes`), Chaquopy `JA`/`JS` modifiers | `references/class-proxy.md` |
| Files, custom file-open handlers, deeplink/intent handlers, PIP deps | `references/files-intents-deps.md` |
| Elyx: refmap, metainfo, assets, strings, settings, imports, wheels | `references/elyx.md` |
| Dev server, ADB live reload, debugger, ElyxBuilder, publishing to a repository | `references/dev-workflow.md` |
| Exact signatures from the official stubs | `references/sdk-api.md` |
| Real-world traps (int overflow, R8, hot hooks, analyzer…) | `references/pitfalls.md` (read it before writing any Java hook or UI code) |
| Exact fields/methods of Telegram classes to hook (`ChatActivity`, `MessageObject`, `ActionBar`, `TLRPC`, …) | `references/classes.md` (index of per-class files; search them, don't read whole) |
| Java code compiled to DEX and loaded by a Python plugin | `references/dex-plugins.md` |
| Mistakes to avoid, with fixes | `references/anti-patterns.md` |
| Which docs and sources to trust, docs page map | `references/sources.md` |

## Hard rules (violations = broken plugins)

1. **Metadata is static.** Plain literal top-level constants (single-file) or
   `metainfo.yml` (Elyx). `id`: 2 to 32 chars, never changes between versions.
   Single-file: starts with a letter, then letters/digits/`_`/`-`. Elyx:
   letters/digits/`_` only, no `-`. Use a letter first and no `-` so the id is valid
   in both formats. Bump `version` every release.
2. **Event hooks must be registered** in `on_plugin_load`:
   `self.add_hook("TL_messages_setTyping")`, `self.add_on_send_message_hook()`.
   Implementing `pre_request_hook` alone does nothing.
3. **Return a `HookResult` from every hook path.** `HookResult()` = untouched;
   `MODIFY` + the right field (`request` / `response` / `update` / `updates` /
   `params`); `CANCEL` stops it; `MODIFY_FINAL` stops other plugins.
4. **Use the hook's `account`.** Inside hooks call `self.client(account)` or pass
   `account=` to `client_utils` helpers. Otherwise you act on whatever account
   is on screen.
5. **UI only on the UI thread** (`run_on_ui_thread`), **blocking work only off it**
   (`run_on_queue`, network, file I/O, `time.sleep`). Never block inside hooks.
6. **Clean up in `on_plugin_unload`.** Hooks, menu items, logger handlers are
   removed by the host; your threads, timers, observers
   (`NotificationCenter.addObserver`), receivers, `FilesController` handlers
   registered directly, and UI you mutated are yours to remove. Use generation counters
   or `self.stop_event` / `self.register_cleanup(fn)` so delayed callbacks become
   no-ops after unload.
7. **Reflection may fail.** `get_method` / `get_field` / `find_class` return
   `None` on a different app build. Check the result, fall back to doing less,
   and log the failure once.
8. **Java ints are signed 32-bit.** ARGB colours like `0xFF2196F3` must be
   converted (`c - (1 << 32) if c >= 1 << 31 else c`) before passing to Java
   `int` parameters.
9. **Keep Python out of hot paths** (`onDraw`, `onMeasure`, per-frame setters,
   `getItemCount`…). Use `HookFilter`s / `HookFilter.Condition` (MVEL, evaluated
   in Java before Python is entered) or `jMVELoverride` / `jgetmethod`.
10. **Logging:** `self.logger.debug("x=%s", x)` (lazy args), `self.logger.exception`
    in `except`. Tag in logcat: `plugin.<id>`. `self.log()` is legacy.
11. **Don't ship secrets** or native code, and don't obfuscate to hide from the
    built-in security analyzer; users see its findings at install. Load DEX only
    when Python cannot do the job, only from the plugin's own files, as in
    `references/dex-plugins.md`.

## Step 3: verify before handing over

* Python 3.11 syntax: `python scripts/check_plugin.py <file.plugin|elyx dir>`
  (static checks: metadata, id rules, BasePlugin subclass, unregistered hooks,
  hook paths that end without `HookResult`, f-strings in logger calls, blocking
  calls in hooks and in the helpers a hook calls directly, >0x7FFFFFFF int
  literals near Java calls, Telethon/Pyrogram/asyncio imports, factories inside
  `create_settings`, code the install-time analyzer reports (`exec`/`eval`,
  `getattr` with a computed name, DEX/native loading), Elyx refmap/metainfo/strings).
  It is static: it can't follow calls into other modules or deferred callbacks.
* Build Elyx: `python scripts/build_elyx.py <project_dir> <out.elyx>` (puts
  `refmap.yml` at the archive root, skips caches, validates YAML/paths/syntax).
* You cannot run the plugin off-device. Tell the user exactly what to test on
  the phone (enable plugin → action → expected result) and how to collect logs:
  `adb logcat -s plugin.<id>`; ask for the traceback from the plugin page if it
  fails to load.

## Answer style for users

* Give complete files, not fragments, unless the user asks for a diff.
* State SDK/app version assumptions and which APIs need on-device confirmation.
* When porting Telegram Java source knowledge, name the class/method you rely on
  (e.g. `org.telegram.ui.Cells.ChatMessageCell.measureTime`) and guard for its
  absence: release APKs are R8-optimised and can differ from GitHub sources.
  Look the member up in `references/classes/` first instead of guessing its
  name or parameters.

Files in this skill

  • SKILL.md10.2 KB
  • agents/openai.yaml239 B
  • references/anti-patterns.md6.7 KB
  • references/class-proxy.md6 KB
  • references/client-utils.md5.5 KB
  • references/dev-workflow.md4.8 KB
  • references/elyx.md5.2 KB
  • references/files-intents-deps.md4 KB
  • references/java-hooks.md7.2 KB
  • references/metadata-and-packaging.md4.7 KB
  • references/pitfalls.md5.8 KB
  • references/plugin-class.md5.9 KB
  • references/sdk-api.md10.8 KB
  • references/settings-ui.md4.6 KB
  • references/sources.md3.9 KB
  • references/ui-and-logging.md6.3 KB
  • references/workflows.md4.8 KB
  • scripts/build_elyx.py3.3 KB
  • scripts/build_index.py5.7 KB
  • scripts/check_plugin.py25.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.