$ show yuliskov/SmartTube
SmartTube is a free, open-source Android TV YouTube client that replaces the official YouTube app with enhanced features like SponsorBlock integration, adjustable playback speed, 8K/HDR support, live chat, and no dependency on Google Services. The architecture is a modular Android application built on a heavily customized fork of ExoPlayer (v2.10.6, Amazon variant) for media playback, and AndroidX Leanback (v1.0.0) for the TV-optimized user interface. The codebase follows a presenter-view pattern with clear separation of concerns, using singleton presenters and view interfaces. Key entry points include SplashActivity, BrowseActivity, PlaybackActivity, and various settings dialogs. Data flows primarily from YouTube's unofficial API (via SABR streaming protocol) through custom ExoPlayer extensions, with additional integrations for SponsorBlock, DeArrow, remote control, and Google Drive backup. External dependencies include ExoPlayer (forked), Leanback (vendored), Glide, RxJava, WorkManager, and a few third-party UI libraries (chatkit, slidableactivity, filepicker).
The LLM identified 5 files worth highlighting for reuse:
Implements a volume booster using Android's LoudnessEnhancer with a periodic reset workaround to prevent audio drift on certain devices. Demonstrates deep understanding of Android audio framework internals and provides a self-contained utility that can be extracted for any app needing audio gain beyond system limits.
Provides folder zipping with pattern-based file filtering and explicit zip-slip protection. The implementation is clean, parameterized, and handles edge cases like empty directories. Can be reused in any Android project requiring secure backup/restore functionality.
A custom Android view that detects double-tap gestures on a video player and provides seek-forward/seek-backward actions with visual feedback. The implementation is self-contained, uses Kotlin coroutines for debouncing, and includes a YouTube-style overlay. Easily extractable for any video player app needing double-tap seek.
Manages subtitle display by wrapping ExoPlayer's SubtitleView, applying system caption styles, and normalizing VTT/TTML cue text to avoid duplicate lines. Handles API level differences and provides a clean interface for subtitle styling. Reusable in any ExoPlayer-based app needing advanced subtitle control.
Persists UI state (header index, video position) across app crashes using SharedPreferences. Implements a simple but effective crash recovery mechanism that restores the last browsing position. The pattern is generic and can be adapted for any Android app needing crash-resilient navigation state.