Git Product home page Git Product logo

tvapprepo's Introduction

TvAppRepo

An app repository of Android TV apps

In Android TV's stock launcher, all apps that appear must have the LEANBACK_LAUNCHER attribute and have a TV banner. While this helps guarantee the app works on TVs, it can make it difficult for other apps to be launched. While it's not impossible, it's not as convenient as having an icon on the homescreen.

Using a python script, tiny shortcut apps are generated and can be installed. They simply contain the face of a Leanback app. However, once they're opened they simply redirect users to the intended app. It's a simple workaround.

This workaround has a few advantages. By not modifying the APK directly, it allows updates to continue through the Google Play Store. In fact, the actual app isn't touched at all. These shortcuts could point to anything: a website, a specific shortcut in an app, or basically any Intent.

The python script cannot be run in the app. The app contains several sideloading tools, including supporting #SIDELOADTAG, showing all your downloaded apps, and browsing apps that have generated shortcuts. The app should also be able to notify users when it needs to be updated.

Python Script

The script takes the /python/Shortcut sample project and clones it to /python/temp_apk. Then it replaces strings.xml with new info, along with modifying build.gradle and AndroidManifest.xml to use a new package name. The banner is swapped out. Finally, the shortcut APK is generated and ready to be downloaded and installed.

It can be called in several ways.

python leanbackshortcut.py --firebase --windows

  • --firebase indicates that the Firebase database will be queried for results
  • --windows indicates that you're using a Windows command prompt. This changes some of the commands.

Before you get started, you'll need to add some additional files.

config.txt

This config file uses a KEY=VALUE pair for particular settings related to your personal configuration. Currently there are two properties needed: SHORTCUT_APP_DIRECTORY and ANDROID_SDK_LOCATION.

SHORTCUT_APK_DIRECTORY=c:/Users/me/TvAppRepo/python/Shortcut
ANDROID_SDK_LOCATION=c:/Users/me/AppData/Local/Android/sdk

keys.txt

The shortcuts are still apps that need to be signed. This can be done by putting the values into a file called keys.txt.

storeFile file("C:\\Users\\me\\keys\\thiskey.jks")
storePassword "P@55word"
keyAlias "@ndroid"
keyPassword "Purple"

Additional Notes

  • On Windows, the task Java Binary needs to be killed at the end of every run in order for the next to start.
  • Bulk APK generations from Firebase do not work
  • Banners must be in the PNG file format. While not exactly enforced in the script, it causes compiler problems.

Download

You can check out the Releases tab to download the latest version. Alternatively one can use the #SIDELOADTAG TVAPPREPO102 to get version 1.0.2 (which should then be able to update to the newest version).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.