there are many tga forks, but this one is mine
a very cool and dog-pilled fork (or rather, patchset, see below) of Telegram Android
this fork is primarily intended for long-term Telegram users who want a clean and robust exparience without all the bloat.
you can expect:
- removed annoyances
- a lot of qol features
- ui tweaks to make it look prettier and cleaner
- opinionated defaults
all that while still allowing users to disable our custom tweaks to (mostly) achieve the stock experience (but why?)
see FEATURES.md for a non-exhaustive list of what's added/tweaked/fixed (kept in sync as patches land).
i don't know. maybe you shouldn't.
inugram exists primarily for my own personal use, because i got tired of the bloat (and lack of transparency) that most forks are, and latest stock is borderline unusable. and apparently my vision for a good ui/ux client and declutter aligns well with many long-term telegram users who spend hours in the app daily, so here we are.
feel free to fork this repo and remove patches you don't like or add your own, or even "steal" the features you like to your own fork. i really don't care.
unlike most alternative clients based on Telegram Android, Inugram is a patchset. it is not a fork in the traditional sense, but rather a collection of patches applied to the stock codebase.
a few advantages of such approach:
- easier rebase, since the stock code vs fork code is clearly separated
- easier to audit the changes, since the modifications are all in one place
- easier for bugfixes to land upstream (although i dont think they really care)
the patchset is managed using stgit and a few supporting scripts in scripts/.
src/fork: our custom Kotlin codesrc/fork-app: ditto, for the bits that live in the app module instead of the library onesrc/core: InuCore, a plain jvm module (so it can be tested without a device)src/native: rust plugin engine (quickjs + jni bridge)src/test: on-device suite for the plugin bridge (kotlin/) and the files it needs (assets/)src/vendor: third-party code copied in as-issrc/res: our custom resourcessdk: the plugin sdk - the api typings (sdk/types) and the author-facing cli (sdk/cli)patches/: stock patchesseries: patch apply orderupstream-commit: pinned Telegram commitworktree/: local Telegram checkout, gitignoredworktree-pluginless/: separate checkout prepared bysetup --pluginless, gitignored. should not be used for development.
patches are grouped by their type:
| type | description |
|---|---|
bugfix |
fixes a bug in the upstream codebase |
feature |
adds a contained feature (one or more, if they're related) to the app (qol, ui tweaks, etc.) |
debloat |
hiding stock "features" behind a toggle. you could also call it "un-feature" |
hooks |
small hooks into the various parts of the app to jump into our custom kotlin code for easier maintenance |
misc |
everything else, stuff like build support and such |
each patch strives to be small and self-contained. as a rule of thumb, we should be able to remove a patch and still have the app build, although this is not always possible.
in stgit, patch names are delimited using double underscore, e.g. patches/misc/whatever.patch becomes misc__whatever in stgit.
contributions are welcome, but before implementing a new feature please ping me to discuss it
requirements: Node.js 20+, git, stg
pnpm install
pnpm run setupthis will clone the upstream into worktree/ and set up stgit in it, along with all the current patches.
you can then simply open (not import!) worktree/ in Android Studio and start hacking. it should build right away.
pnpm run setup -- --pluginless prepares worktree-pluginless/ instead, skipping
feature/plugins.patch, LSPlant and its nested submodules/local patches, and plugin API generation.
It also works with --ci and --no-submodules. Build it with pnpm run build-debug-pluginless.
The plain build excludes the plugin engine, native hooking libraries, plugin screens, and plugin test assets.
Other scripts continue to target worktree/.
Setup writes the checkout's build variant to the ignored inu-build.properties file.
Gradle exposes it as BuildConfig.INU_PLUGINLESS in both Android modules.
Fork Kotlin sources are linked under TMessagesProj/src/inu/kotlin and preprocessed by Gradle's
preprocessInuSources task into build/generated/inu/kotlin. Edit src/fork, not the generated files.
Use // #if PLUGINS, optional // #else, and // #endif around plugin-only imports and code.
Both variants are preprocessed; nested directives are supported, excluded lines remain blank to
preserve line numbers, and malformed directives fail the build.
stg new misc__my-patch -m 'my patch description' # to create a patch
# ...do whatever you need in worktree/...
stg refresh # to "commit" the worktree changes into the topmost patch
pnpm run export # to export stgit into patches/# option 1: edit the patch in-place via stg refresh
# ...do whatever you need in worktree/...
stg refresh -p misc__my-patch # --index to only append staged changes
pnpm run export
# *pretty much* same as above, but manually
# ...do whatever you need in worktree/...
stg new tmp-patch
stg refresh
stg rebase -i # move tmp1 below the patch you want to edit, and replace "edit" with "s"
pnpm run export
# option 2: push the patch to the top of the stack
stg float misc__my-patch
# ...do whatever you need in worktree/...
stg refresh
pnpm run exportas a rule of thumb: prefer the former, but if you get a lot of merge conflicts, try float-ing instead.
pnpm run lint-patches
pnpm run lint-patches -- --checkthe audit reports later patches that fully revert an earlier patch or delete lines last changed by one. --check exits non-zero when it finds either.
- the original Telegram Android - the basis for this fork
- a bunch of features were ported from Nekogram, NagramX, materialgram, Catogram
src/res/drawable/icplaceholder.jpgis a blurred version of this artwork by Chobles- Tabler icons by Tabler Team
- Solar icon pack by 480 Design
- VKUI icon pack by VK (MIT), ported from Catogram
- AdGuard URL Tracking filter by AdGuard
this project is llm-assisted: a bunch of the code and the patches were (and will be) written by claude. this doesn't mean it's "ai slop", i still review all the code myself, but im not an android dev by any means so it might not be perfect. ai-assisted contributions are welcome as long as you disclose that in the pr.
if you have an issue with that - go make your own fork.
abolish copyright law tbh, but let's just say the repo is licensed under MIT
0 comments
log in to comment.