Skip to content

Telegram integration + APK split#297

Merged
ProdigyV21 merged 9 commits into
ProdigyV21:mainfrom
silentbil:telegram
Jun 5, 2026
Merged

Telegram integration + APK split#297
ProdigyV21 merged 9 commits into
ProdigyV21:mainfrom
silentbil:telegram

Conversation

@silentbil
Copy link
Copy Markdown
Collaborator

Native Telegram Integration + ABI Split APKs

Telegram Integration

Adds a built-in Telegram source that searches the user's joined channels and groups for video files whenever a movie or episode is selected — appearing alongside regular addon sources in the stream selector. No third-party service or external addon required.

Authentication

  • QR code flow via TDLib (authorizationStateWaitQrCodeConfirmation) — scan with the Telegram phone app, no typing on TV
  • 2FA password support
  • Session persists across app restarts

Streaming

  • Local Ktor CIO HTTP server proxies TDLib file downloads to ExoPlayer with Range header support for seeking

Settings Screen

  • Shows connected account name or "Not connected"
  • Per-channel toggle to exclude channels from search
  • Disconnect button wipes session and TDLib database

Source Card

  • Quality parsed from filename (4K, 1080p, 720p, etc.) including OCR typos (1o8o, 216o)
  • File size displayed

Native Libraries

  • TDLib prebuilt binaries downloaded automatically on first build via downloadTdlibNatives Gradle task
  • Cached — re-download only on clean checkout

ABI Split APKs (Sideload)

assembleSideloadRelease now produces per-ABI APKs instead of one universal APK, so users download only the native library for their device architecture.

Output APKs

┌──────────────────────────────────────┬────────┬────────────────────────────────────────────────────┐
│ File │ Size │ Use │
├──────────────────────────────────────┼────────┼────────────────────────────────────────────────────┤
│ app-sideload-arm64-v8a-release.apk │ ~49 MB │ Modern 64-bit streamers (Shield, Fire TV 4K, etc.) │
├──────────────────────────────────────┼────────┼────────────────────────────────────────────────────┤
│ app-sideload-armeabi-v7a-release.apk │ ~42 MB │ Older 32-bit streamers │
├──────────────────────────────────────┼────────┼────────────────────────────────────────────────────┤
│ app-sideload-universal-release.apk │ ~70 MB │ All devices — use when ABI is unknown │
├──────────────────────────────────────┼────────┼────────────────────────────────────────────────────┤
│ app-sideload-x86-release.apk │ — │ Emulator only, do not distribute │
├──────────────────────────────────────┼────────┼────────────────────────────────────────────────────┤
│ app-sideload-x86_64-release.apk │ — │ Emulator only, do not distribute │
└──────────────────────────────────────┴────────┴────────────────────────────────────────────────────┘

@silentbil silentbil marked this pull request as draft June 3, 2026 06:56
@silentbil silentbil marked this pull request as ready for review June 3, 2026 07:31
@ProdigyV21
Copy link
Copy Markdown
Owner

I tested the PR against current main: it merges cleanly, git diff --check passes, and both :app:compilePlayDebugKotlin and :app:compileSideloadDebugKotlin compile.

Before merge, I think these 3 things need to be fixed/clarified:

  1. Telegram source should be sideload-only or disabled in Play builds.
    Right now it is in src/main, so it ships with the Play Store build too. Since it searches Telegram chats/channels for video files and streams them, this may be a Play Store policy risk. I don’t want to risk the Play version getting flagged.

  2. TDLib binaries need provenance/checksum clarity.
    The PR commits TDLib generated Java and native .so files, and also has a Gradle task downloading prebuilt binaries from a third-party GitHub release. Please add clear notes about where these binaries come from, their license/provenance, and ideally checksum verification for the download.

  3. ABI split should be limited to sideload if that is the goal.
    The PR says ABI split APKs are for sideload, but the Gradle config currently enables ABI splits for any APK build unless it is an app bundle. Please gate this to sideload variants only, so Play/debug APK behavior is not changed unexpectedly.

@silentbil
Copy link
Copy Markdown
Collaborator Author

@ProdigyV21 thanks for reviewing

this may be a Play Store policy risk.

Actual risk is low because:

  • TDLib is used by many legitimate apps on Play Store (it's the official Telegram client library)
  • You're not scraping, bypassing DRM, or accessing anything the user doesn't own — the user authenticates with their own account and searches their own channels
  • Google's automated scanning looks for known malware patterns, not "this app talks to Telegram"
  1. fixed
  2. fixed

@ProdigyV21 ProdigyV21 merged commit 0cb8558 into ProdigyV21:main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants