- JavaScript 86.2%
- CSS 4.5%
- HTML 3%
- WebAssembly 2.5%
- Kotlin 2.2%
- Other 1.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .codex/skills/tubebreaker | ||
| app | ||
| artwork | ||
| docs | ||
| fastlane/metadata/android | ||
| fdroid | ||
| gradle | ||
| scripts | ||
| .gitattributes | ||
| .gitignore | ||
| AGENTS.md | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| keystore.properties.example | ||
| LICENSE | ||
| LICENSES.md | ||
| README.md | ||
| RELEASE_NOTES.md | ||
| settings.gradle.kts | ||
Tubebreak
A minimal native Kotlin Android app that opens mobile YouTube in GeckoView.
Features
- One main Activity with a full screen interface and no address bar or browser navigation controls.
- Loads
https://m.youtube.com/automatically; does not use Android WebView. - A persistent Gecko profile for cookies and website storage.
- Bundled uBlock Origin and a YouTube background playback extension.
- Android media notifications and play, pause and stop controls.
- Android package:
com.statisfaction.tubebreak.
Tubebreak's own code, documentation and artwork are licensed under GPL-3.0-or-later. Preserve the third-party notices.
Build requirements
- JDK 17 compatible with the configured Android Gradle Plugin.
- Android SDK, including platform 37.2 and the required build tools.
ANDROID_HOMEorANDROID_SDK_ROOTpointing to the SDK.- Android Platform Tools in
PATHfor device installation. - Access to the configured Google, Maven Central and Mozilla repositories to build the app.
Build and dependency versions are centralized in gradle/libs.versions.toml.
| Component | Version |
|---|---|
| Gradle wrapper | 9.9.0 |
| Android Gradle Plugin | 9.5.1 |
| Kotlin | 2.4.21 |
| Mozilla GeckoView | 160.0.20261104181552 |
Android Kotlin compilation uses AGP's built-in support. The Kotlin plugin version also determines compatibility with GeckoView's Kotlin metadata.
Build and install
From the repository root:
./gradlew testDebugUnitTest lintDebug assembleDebug
adb devices
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n com.statisfaction.tubebreak/.MainActivity
The debug APK is written to app/build/outputs/apk/debug/app-debug.apk.
If ADB reports unauthorized, unlock the device and approve USB debugging.
All app builds use Mozilla's published GeckoView artifact. F-Droid submission is paused. The F-Droid packaging notes describe the previous source-build experiment.
Fedora
sudo dnf install java-17-openjdk-devel unzip curl
java -version
export ANDROID_HOME="$HOME/Android/Sdk"
export PATH="$ANDROID_HOME/platform-tools:$PATH"
adb devices
Install Android SDK Platform Tools through Android Studio if ADB is missing.
Keep Gradle's cache on a volume with sufficient space by setting
GRADLE_USER_HOME before building.
Windows
Use Android Studio or the Android SDK, a compatible JDK, Git for Windows and
PowerShell 5.1 or later. A typical SDK location is
$env:LOCALAPPDATA\Android\Sdk.
java -version
.\gradlew.bat --version
.\gradlew.bat testDebugUnitTest lintDebug assembleDebug
adb devices
adb install -r app\build\outputs\apk\debug\app-debug.apk
adb logcat | Select-String "Tubebreak"
If ADB is outside PATH, use its full SDK path:
& "$env:LOCALAPPDATA\Android\Sdk\platform-tools\adb.exe" devices
Convenience scripts are available as both PowerShell and .bat wrappers:
.\scripts\install_debug.ps1
.\scripts\logcat.ps1
.\scripts\clear_app_data.ps1
The last script clears Tubebreak's local data, including its Google session. If PowerShell blocks a trusted local script, a per-process invocation is:
powershell -ExecutionPolicy Bypass -File .\scripts\install_debug.ps1
Architecture
The main Kotlin code is under app/src/main/java/com/statisfaction/tubebreak/.
MainActivitymanages the Android lifecycle, loading overlay, full screen mode and back navigation.GeckoEngineManagerowns the runtime and session, persistent profile, delegates, navigation and view attachment.PlaybackServicesupplies the media foreground service, notification and AndroidMediaSession.ExtensionManagerinstalls the bundled extensions and bridges media commands and video titles.CyberpunkSplashBackgrounddraws the native loading background.
The Gecko view is detached when the Activity stops while the session remains active for background playback, then reattached when the Activity resumes. This prevents surface destruction from overriding the requested session state.
Profile and authentication
The non-private Gecko profile is stored in filesDir/gecko-profile, configured
with -profile <filesDir>/gecko-profile when the runtime starts. Cookies, local
storage and other normal website data remain until Android app data is cleared.
Google and YouTube can independently expire a session.
Google credentials are entered in Google's pages rendered by GeckoView.
Tubebreak does not read or manually store credentials or inject its YouTube
extension into Google sign-in pages. The profile stays in Android's private
app directory. Logs tagged Tubebreak redact URL paths and parameters and must
not contain passwords, tokens, cookies, form contents or session data.
To deliberately reset the profile:
adb shell pm clear com.statisfaction.tubebreak
Navigation and playback
The native interface supports portrait and landscape, shows the app version while loading, and offers a retry action after a critical loading error. A long press reloads the fixed mobile YouTube URL.
Navigation inside GeckoView is restricted to the domains needed by YouTube and Google authentication. Other supported links are opened through Android intents rather than turning the app into a general browser.
The media foreground service exposes Android and lock screen controls. Its commands are restricted to play, pause and stop and are sent only to the current Gecko session. The background extension controls the main YouTube video and publishes its title for the media notification.
The extension matches only https://m.youtube.com/* and
https://www.youtube.com/*. It hides selected page-visibility signals and tries
to resume playback that YouTube pauses during a background transition. It does
not read Google sign-in forms or change uBlock Origin. Playback remains subject
to changes in YouTube, GeckoView and Android.
Bundled extensions
Extension switches are defined in AppConfig:
ENABLE_UBLOCK_ORIGIN: bundled uBlock Origin.ENABLE_BACKGROUND_PLAYBACK_EXTENSION: the native media bridge and background behavior.ENABLE_TEST_EXTENSION: a diagnostic extension, disabled by default.
Assets live under app/src/main/assets/extensions/ and are installed using
GeckoView's resource://android/assets/extensions/.../ URIs. The diagnostic
extension only logs a message on matching YouTube pages.
uBlock Origin 1.71.0 is bundled with its notices. To replace the assets using a
local official Firefox .xpi or .zip archive:
scripts/prepare_ublock_origin.sh /path/to/ublock_origin.xpi
.\scripts\prepare_ublock_origin.ps1 C:\Users\<user>\Downloads\ublock_origin.xpi
These scripts replace the uBO asset directory, check manifest.json and report
the extension ID and version. They do not download an archive or bypass its
signature. Keep all upstream license notices when redistributing uBlock Origin.
Inspect installation and media logs with:
adb logcat -s Tubebreak:D
Expected messages include Built-in WebExtension installed (uBlock Origin),
Built-in WebExtension installed (background playback) and
Background playback native port connected. If installation fails, check the
asset manifest, extension compatibility and the relevant AppConfig switch.
Release signing
Developer signing uses an ignored keystore.properties file; an example is
provided in keystore.properties.example. Never commit signing keys, passwords
or their backup archive.
./gradlew assembleRelease
./gradlew assembleRelease -PunsignedRelease=true
With signing configured, the first command produces app-release.apk. The
second skips even reading developer credentials and produces
app/build/outputs/apk/release/app-release-unsigned.apk. Without a signing
configuration, the release is also unsigned.
Verify a signed APK with the SDK's apksigner verify --verbose --print-certs.
Android only preserves an existing installation with a compatible signing
certificate. Uninstalling to change certificates removes the private profile.
F-Droid will sign catalogue APKs itself; local developer signatures are for
phone testing and do not establish F-Droid acceptance.
Manual validation
After changes affecting runtime behavior or dependencies, install the matching APK and check:
| Test | Expected result |
|---|---|
| Cold launch | Loading overlay followed by mobile YouTube; no application crash. |
| Google sign-in | Authentication works inside the intended shell and survives a relaunch when the server session remains valid. |
| Full screen and back | System bars stay hidden where Android allows; back navigates Gecko history when available. |
| Extensions | uBO and background extension installation appear in logs. |
| Background playback | A running video continues when leaving the Activity; media controls remain responsive. |
| Screen off and return | Check actual audio and return to the existing page, rather than relying only on notification state. |
| External links | Unapproved domains are blocked internally or opened through a supported external intent. |
Documentation and release notes are maintained in English. The app and storefront may still provide localized text.