[Fire TV General] SimLynks:
Blacklist Configuration:

There are many ways in which you can disable the parts of the Stock AmazonTV system you do not want to have running, but I believe my new method is far superior as it uses Amazon's own blacklist technology against itself (which I just find incredibly funny) AND by disabling the components in this manner, every single time you reboot the system, the components will automatically get re-disabled if you happened to enable some function for whatever reason.

Amazon has the potential to use two different systems to "blacklist" certain things. These are "com.amazon.tv.nimh" (Not in my House) and the "com.amazon.tv.settings.tv.AppDisableService" which is currently being used to explictly block (and "soft-disable") the following applications: FiredTV-Launcher, FireStarter, and OnbootKodi. Both blacklisters are explained in depth over at AFTVNews (http://www.aftvnews.com/tag/blacklist/).

If you have followed my entire guide to this point the first blacklist I mentioned "com.amazon.tv.nimh" (Not in my House) has already been totally deleted from your system partition during the OpenGApps TV-Stock installation. I explicitly call this library out in my custom gapps-config.txt file and instruct the TV-Stock installer to delete all it's files. I do this because A) no one knows exactly what this component is capable of once Amazon decides to enable it's functions, and B) It currently has zero negative effect on a running FireTV system, so I fully remove it to prevent any future issues it may cause once Amazon decides to enable it's unknown functions.

The next blacklist included with Stock FireTV systems is the "com.amazon.tv.settings.tv.AppDisableService" which quite simply is a text database listing certain packages Amazon has decided it does not like, and these packages are forcibly "frozen" (aka "soft-disabled") upon boot of the system. Over at AFTVNews they already have great instructions on how to totally disable this functionality and re-enable the blocked apps, but I am going to show you how to use Amazon's AppDisableService to disable Amazon system components instead of the Apps Amazon does not like. This way instead of totally stopping AppDisableService, we remove the Amazon specified apps, and add in Amazon System components that will then automatically be frozen upon boot of the system.

To do this you need to launch the Amazon Settings On-Screen Menu I have included in my Xposed Edge configuration. To access this 1) Hold the Home Button until the On-Screen Menu Appears, 2) Navigate one space to the right, and then one space down in the On-Screen Grid, this will be a box with a bunch of Amazon System apps in it. Once you select the AmazonApps square, navigate to the bottom right most square, and this will launch the Internal Amazon Settings Debug Menu. 3) You want the select the option that is a orange square with the "Amazon Fire" text in white.

[IMG="On-Screen Menu"]https://i.imgur.com/QOFjh9v.jpg[/IMG]

Once you have selected the appropriate "Amazon Fire" Settings app from within my preconfigured On-Screen Menu, you will be presented with a Black Screen with a list of options. Scroll down to "com.amazon.tv.settings" and select this option. On the next black screen you will see a two columns, one labeled "

Key

" and another labeled "

value

". The only "Key" is

DisableApps

, while the

value

is the package names of FiredTV-Launcher, Firestarter, and OnbootKodi. Move your selector to the "Edit" button and go ahead and remove all three packages Amazon has included, and then add in whatever parts of the Amazon System you want disabled (i.e. anything you previously used pm disable on)

I strongly suggest you use this Auto-PackageDisable feature to "soft-disable" the default AmazonFireTV Launcher "KFTV" so that the system will automatically boot into the Leanback Launcher. You can also disable any other Amazon System package, in my following example I also disable the blacklist technologies, KFTV Launcher, and Vizzini (Amazon's Voice Interface so that the Google Voice Interface can take over). My own "blacklist" includes the following, but you do not need to include everything I do, and can add additional packages I do not. My blacklist kills the Amazon OTA service, Amazon "Sale Service" which blocks the Leanback Launcher recommendations, and Amazon Voice Search among others.

My personal blacklist includes:

"com.amazon.device.software.ota,com.amazon.device.software.ota.override,com.amazon.device.sale.service,com.amazon.tv.launcher,com.amazon.tv.nimh,com.amazon.vizzini"

[IMG="Default Amazon Blacklist"]https://i.imgur.com/V5tnMZ3.png[/IMG]

[IMG="Edited Amazon Blacklist"]https://i.imgur.com/5Q65hbr.png[/IMG]

Manual Installation Instructions

: If you want to fully understand what this MOD is actually doing to your system the manual instructions give a much clearer picture of what is being modified and why to achieve a successful Leanback install on the FireTV. These instructions are obsolete as of v4_LazyLeanback but are being retained in the thread as extra information for any other hackers who may want to take this further

Manual Installation - (Part One): Modifying Build.Prop

NOTE: The beginning of the commands is actually an important indicator of "where" your supposed to be inputting the commands.

~$ = the shell or command prompt on YOUR computer. With FireTV Utility you may need to type "exit" to get back to a "computer shell"

shell@firetv:/ $ = the shell on the FireTV device. The "firetv" part will change depending on your device name

root@firetv:/ # = Notice how the last part in red changed from $ --> # this is the difference between a normal user shell and a "root shell"

EDIT: [MENTION=2226076]stangri[/MENTION] has provided some terminal commands that expertly accomplish the necessary build.prop modifications without needing to follow my old instructions to pull the file off the device, edit it and then push it back to the filesystem. Thanks to this contribution we can now edit build.prop with the following commands,

BUT YOU MUST HAVE BUSYBOX INSTALLED FOR THESE COMMANDS TO WORK

. First off make sure your device is powered on and connected to your network and has ADB debugging enabled.

EDIT: This is the OLD BUILD.PROP METHOD. You can use this but it will be much easier to use the "sed" commands above.

There are a few different ways this step can be done so do whatever is easier for you. As my FireTV-v1 has a built-in Ethernet port + USB port I find it convenient to connect via ethernet, use the USB keyboard to enter recovery and then ADB into recovery and edit the build prop with the command-line text editor "vi". However only the FireTV-v1 makes doing it that way easy, and anyone who knows how to use vi can probably figure this part out on their own without any further instructions.

For the rest of you on FireTV-v2 or FireTV-Sticks here's probably the easiest way for you to complete this step. First make sure your device is powered on and connected to your wifi network with ADB Debugging enabled.

~$ adb connect "YOUR IP"
~$ adb shell
shell@firetv:/ $ exit

~$ adb connect "YOUR IP"
~$ adb pull /system/build.prop ~/

If you get to a terminal prompt great, now type "exit". Now type "adb pull /system/build.prop/ ~/" this command should grab a copy of your build.prop and place it in your user's home directory. Now you need to edit the file using a good text editor (NOT Microsoft Word / WordPad / Any other "fancy" program that will add additional formatting, and wind up destroying the file). If on Windows I recommend NotePad++, if on any other operating system, you should be fine with the default text editor.

NOTE

: The first two lines are towards the top of of your build.prop file, while the last two lines should be the VERY BOTTOM. Also the first two lines already exist in the file and need to be modified, while the last two lines DO NOT already exist in your build.prop, you need to add them as the very last two lines.

ro.build.version.number=573210520 --> ro.build.version.number=987654321
ro.build.characteristics=default --> ro.build.characteristics=tv

^ TOP

BOTTOM ٧

ro.com.google.clientidbase=android-xiaomi-tv
ro.com.google.gmsversion=5.1_r1_TV

Once you have completed the required build.prop modifications, we need to push the edited file back into the FireTV's filesystem

~$ adb connect "YOUR IP"
~$ adb push ~/build.prop /sdcard/build.prop
shell@firetv:/ $ su
root@firetv:/ # cp /sdcard/build.prop /system/build.prop && chmod 644 /system/build.prop && chown root:root /system/build.prop

Unfortunately each device's build.prop contains completely different information, and this can even change within the same device between different software versions, so I cannot post an example for this one, as it would be useless and dangerous if someone tried to use it on the wrong device / software version. But this modification is necessary, the "top" edits give the TV-Stock installer the correct information to know this is a TV Device (otherwise it will detect the FireTV as a "Phone" and skip installing some necessary libraries, while the bottom two lines allow the device to register correctly with the Play Store and prevents the issue a lot of us were having with updates to Google Play breaking things.

~$ adb connect "YOUR IP"
~$ adb shell
shell@firetv:/ $ exit

If you get to the "FireTV" terminal prompt great, now type "exit" and proceed to the next set of commands. If you dont get to the "FireTV" terminal you need to double check you have ADB debugging enabled and your device is in fact connected to the appropriate network.

~$ adb shell
shell@firetv:/ $ cp /system/build.prop /sdcard/default.prop
shell@firetv:/ $ su
root@firetv:/ # mount -o rw,remount /system
root@firetv:/ # sed -i 's|ro.build.version.number=.*|ro.build.version.number=987654321|' /system/build.prop
root@firetv:/ # sed -i 's|ro.build.characteristics=.*|ro.build.characteristics=tv|' /system/build.prop
root@firetv:/ # ! grep -q "ro.com.google.clientidbase=android-xiaomi-tv" /system/build.prop && echo "ro.com.google.clientidbase=android-xiaomi-tv" >> /system/build.prop
root@firetv:/ # ! grep -q "ro.com.google.gmsversion=5.1_r1_TV" /system/build.prop && echo "ro.com.google.gmsversion=5.1_r1_TV" >> /system/build.prop

Manual Installation - (Part Two): Putting it all together - You should now have XposedInstaller.apk, XposedFramework.zip, HDXPosed-1.3.apk, SuperSU.zip, PlayFire.tar.gz, Busybox.apk or Busybox.zip TV-Stock.zip and TV-Stock.zip.md5 and a modified build.prop ready to go. Next you need to move all these files onto your device, and I am going to use the root of /sdcard/ and the /sdcard/PlayFire/ directory as defaults. You can use something else, but you will need to modify the following commands.

Get your device up and running and load all the files you have downloaded into the root of your /sdcard/ partition. Once everything is on the root of your /sdcard/ run the following commands, and

note that everything on a single line should be copy/pasted as one command

.

If running these commands from TWRP recovery, everything will already work as TWRP comes with busybox. If running this connected to adb on a running FireTV system you must install busybox prior to running these commands. Install the ZIP through TWRP then boot into the system or use the APK to install busybox into your /system partition.

~$ adb connect "YOUR IP"
~$ adb shell
shell@firetv:/ $ pm install /sdcard/XposedInstaller_3.1.1.apk
shell@firetv:/ $ pm install /sdcard/HDXPosed-1.3.apk
shell@firetv:/ $ tar -xzvf /sdcard/PlayFire_v2.tar.gz
shell@firetv:/ $ su
root@firetv:/ # mount -o rw,remount /system

root@firetv:/ # cp /sdcard/PlayFire/tv_core_hardware.xml /system/etc/permissions/tv_core_hardware.xml && chmod 644
/system/etc/permissions/tv_core_hardware.xml && chown root:root /system/etc/permissions/tv_core_hardware.xml

root@firetv:/ # cp /sdcard/PlayFire/whitelist.json /system/etc/whitelist.json && chmod 644 /system/etc/whitelist.json && chown root:root /system/etc/whitelist.json

root@firetv:/ # tar -xzvpf /sdcard/PlayFire/XposedEdge-DataConfig.tar.gz -C / && (chown -R system:system /data/app/com.jozein.xedge-1 && chown -R root:root /data/data/com.jozein.xedge)

root@firetv:/ # mkdir /system/priv-app/TvSettings && chmod 755 /system/priv-app/TvSettings && cp /sdcard/PlayFire/PlayFire-TvSettings.apk /system/priv-app/TvSettings/TvSettings.apk && chmod 644 /system/priv-app/TvSettings/TvSettings.apk && chown root:root /system/priv-app/TvSettings/TvSettings.apk

root@firetv:/ # mkdir /system/app/NoTouchAuthDelegate && chmod 755 /system/app/NoTouchAuthDelegate && cp /sdcard/PlayFire/TV-NoTouchGsf.apk /system/app/NoTouchAuthDelegate/NoTouchAuthDelegate.apk && chmod 644 /system/app/NoTouchAuthDelegate/NoTouchAuthDelegate.apk && chown root:root /system/app/NoTouchAuthDelegate/NoTouchAuthDelegate.apk

root@firetv:/ # mv /sdcard/PlayFire/gapps-config.txt /sdcard/gapps-config.txt

The next command is OPTIONAL, but it disables the Wifi-Direct broadcast "Fire-DIRECT-####" which I found useless and very annoying

root@firetv:/ # cp /sdcard/PlayFire/android.hardware.wifi.direct.xml /system/etc/permissions/android.hardware.wifi.direct.xml && chmod 644 /system/etc/permissions/android.hardware.wifi.direct.xml && chown root:root /system/etc/permissions/android.hardware.wifi.direct.xml

Manual Installation - (Step Three): The Final Piece of the Puzzle - So the MAIN things that had been messing up installing TV-Stock GApps on FireTV or anything else for that matter is A) No one was editing the /system/etc/permissions files appropriately and B) that the OpenGApps TV-Stock installer includes a broken copy of NoTouchAuth which wont allow you to register with Google Play Services. In one of the above commands we installed a copy of NoTouchAuth I pulled from a Official AndroidTV box (so it actually works) and once you have completed the next steps and reboot, you will be able to log into Google Play without issue. Also at this point we have replaced the stock system build.prop with the modified one to allow a proper TV-Stock installation, and allow for proper authentication with Google Play Services, installed the modified copy of peleg's TvSettings.apk (ATV Settings Widget/Menu) which now does not require signature spoofing due to my removal of the "com.android.shared.uid" value from the Android Manifest, disabled Wifi-Direct broadcasting, and installed XposedInstaller.apk + HDXPosed.apk, along with the ESSENTIAL Xposed Module "Xposed Edge" which is what will allow us to remap Buttons / Keycodes & provides the Running App List + Task Switcher + an unbelievable amount of other useful features and ability to customize just about anything.

So now that all that has been done the last step is to reboot into TWRP recovery (however that is done on your device) and

install the final ZIP files of updated SuperSU v2.82, Xposed Framework v87, and finally OpenGApps TV-Stock itself

.

EDIT: Due to issues with OpenGApps TV-Stock overwriting NoTouchAuth during installation, you must run the following

AFTER

finishing the TV-Stock installation to avoid the "spinning circle of doom" issue, which will prevent Google Play login. After running the commands below

REBOOT

and you should be able to login to Google Play without further problems.

shell@firetv:/ $ su
root@firetv:/ # mount -o rw,remount /system
root@firetv:/ # rm /system/app/NoTouchAuthDelegate/NoTouchAuthDelegate.apk
root@firetv:/ # cp /sdcard/PlayFire/TV-NoTouchGsf.apk /system/app/NoTouchAuthDelegate/NoTouchAuthDelegate.apk
root@firetv:/ # chmod 644 /system/app/NoTouchAuthDelegate/NoTouchAuthDelegate.apk && chown root:root /system/app/NoTouchAuthDelegate/NoTouchAuthDelegate.apk

Work-in-Progress

Updater Script

: Completed-as-of v4_LazyLeanback

I am currently in the process of investigating whether it may be possible to write an "Updater Script" that functions as the OpenGApps Updater scripts do, which would allow users to seamlessly flash the latest rbox prerooted ROM releases while keeping all these MOD changes in tact through the upgrade process. I have just starting looking into this, so have no estimate for when or if It might be completed.

Update.zip Flashable Installer

: Completed-as-of v4_LazyLeanback

I MAY also attempt to investigate the possibility of creating an "all-in-one" Update.zip package which would be flashed through TWRP and preform as many of the steps of this MOD as possible. In any case DO NOT THINK THIS WILL BE A "FULL" CUSTOM ROM, It will only be exactly what is currently discussed in this thread, It will not at any time include the rbox ROM, OpenGApps installers or any other modules not currently already included within my "PlayFire.tar.gz" archive. I have not even started looking into the first steps of how this may or may not be possible, just something I have in the back of my mind as a possible continuation of this MOD and my learning process.

Do NOT ask me when this might be completed

, as I have not even begun the most basic of firsts steps, again just something I may consider trying to do at a later date. If you want this MOD installed anytime soon, your going to need to follow current procedure outlined in this guide for the time being.

Custom Compiled OpenGApps TV-Stock Installers

: Again, this is something I MAY attempt to do at a MUCH LATER DATE, and only AFTER I have created both the Updater Script and the Update.zip package. As there are numerous issues with the OpenGApps built TV-Stock I may try to build the installer from source myself and resolve as many issues as they relate to the FireTV as possible. Again, do NOT ask me when this will be ready, as I honestly have no clue, but again is something I am considering if there is enough interest shown and/or more serious problems with the current OpenGApps TV-Stock installers become apparent.