[Guide] [ROM] (mantis) Fire TV Stick 4K Prerooted Android TV Rom (6.2.7.6)

0815hoffi

Senior Member
Dec 22, 2019
378
113
53
Munich
github.com
Tested with Tank and Mantis ( no Problems ).

Try reflash Magisk maybe.

Code:
Mantis with 6.2.7.7

mantis:/ $ su
su
mantis:/ # mount -o rw,remount /system
mount -o rw,remount /system
mantis:/ # cd /system/priv-app
cd /system/priv-app
mantis:/system/priv-app # echo test > 1.txt
echo test > 1.txt
mantis:/system/priv-app # ls 1.txt
ls 1.txt
1.txt
mantis:/system/priv-app # rm 1.txt
rm 1.txt
mantis:/system/priv-app # exit
exit
mantis:/ $ exit
exit

Tank with 5.2.7.7

[email protected]:/ $ su
su
[email protected]:/ # mount -o rw,remount /system
mount -o rw,remount /system
[email protected]:/ # cd /system/priv-app
cd /system/priv-app
[email protected]:/system/priv-app # echo test > 1.txt
echo test > 1.txt
[email protected]:/system/priv-app # ls *.txt
ls *.txt
1.txt
[email protected]:/system/priv-app # rm 1.txt
rm 1.txt
[email protected]:/system/priv-app # exit
exit
[email protected]:/ $ exit
exit
 

Seattleweather

Senior Member
Oct 30, 2016
84
1
8
After so many trial and error, I've finally saved the latest version of my system with TWRP backup. I want to share this personal setup with you guys since it required a lot of work to debloat, install add-ons, apps, kernels and tweaks. This is a single package that contains many modifications from other threads made for simple, one-time installation. I tried to keep it close to Android TV (Nougat) exprience. However, I kept some of the Amazon software that I use like Alexa and Amazon Appstore.

Guides I found and used for this rom:
!!Please read these threads before you begin!!
!!All credit goes to those developers!!
!!Do at your own risk!!

Some Info:
Android Version: 7.1.2​
Fire OS Version: 6.2.7.6​
Working TWRP Version: 3.3.1-0​
Installed Magisk Version: 20.4​
Installed launcher: Google Leanback Launcher​
Available Internal Storage after installition: 3.15 GB​

Screenshots:

Contains:
==========================================================================================

Working:
  • Alexa
  • Voice Input of Amazon keyboard. (need to enable FireTV IME Keyboard from settings) (long press menu button for quick switch)
  • Amazon Settings
  • Fire TV Remote App (I highly suggest this app. Works perfect for navigation and keyboard input)
  • Amazon Appstore (You can install your previous paid apps from here. Search function in amazon appstore only works with alexa)
  • Google Play Store and Services
  • Magisk
  • Xposed
  • Recommendations on launcher
  • Widevine DRM (Netflix, PrimeVideo etc. works fine)
  • Kodi Audio Passthrough
Not working:
  • Google Assistant
  • Google Voice Search
==========================================================================================

Some useful apps that I installed (all can be uninstalled):
  • FX (file manager with root access)
  • Link2SD (app manager with root access. It lets you uninstall, freeze system apps or convert them to user apps and vice versa)
  • Xposed Edge (simple alternative to tasker or key mapper with root access. I've mapped long-press of back button to kill foreground app)
  • LeanKey Keyboard Pro (came with tsynik's magisk module and I loved it)
  • Smart Youtube TV (modded youtube app that enables dozens of options. I'm using it to increase the playback speed of videos)
  • MX and VLC Player (to play local or online streams)
  • Aerial Dream TV (really nice screensaver that uses Apple TV visuals)
  • Prime Video, Netflix, Spotify (not to make the launcher look empty)
Installed magisk modules:
  • Xposed Framework (rovo89)
  • Google TV Apps for FireOS 6 (tsynik)
  • FireTV4k Selinux Fix (Pretoriano80)
Installed xposed modules:
  • Xposed Edge
  • AFTV-XM (tsynik)
  • AFTV-GAPPS-XM (tsynik)
==========================================================================================

Requirements:
  • OTG Adapter
  • USB Keyboard/Mouse
  • USB Stick Formatted Fat32
  • TV or Monitor
  • Firestick 4K
How to install:
  1. Be aware that your warranty will be void.
  2. Backup your files.
  3. Unlock bootloader and install twrp using this guide.
  4. Download and extract Firestick 4K Android TV TWRP Backup.rar to TWRP backups path on USB stick; TWRP > BACKUPS > G070VM0984752N1Q
  5. Do a factory reset via TWRP (use otg adapter and keyboard/mouse to navigate)
  6. Restore from TWRP backup that you prepared.
  7. Reboot to system.
  8. Connect to wifi and log in to your amazon account. (still using keyboard or mouse to navigate)
  9. Go to Settings > Fire OS > Controllers and Bluetooth Devices and pair your Fire TV remote. (now you can ditch the keyboard)
  10. Enjoy.
Mirror:
Additional Notes:
  • Developer options and USB debugging enabled.
  • OTA updates disabled.
  • Disable "Stay Awake" option in developer settings if you want the screensaver to start.
  • Long-press to back button kills the foreground app. It makes quitting activities easier.
  • Long-press to menu button opens fast keyboard switching window. It helps to switch to amazon keyboard when I use voice input.
  • You can change the launcher to whatever you want. I'm happy with Leanback Launcher. I didn't try but there's this.
  • Important: Never install magisk updates from magisk. Use TWRP.
  • If you want to create TWRP backup, select "System Image" and "Vendor Image" insted of system and vendor.
  • Suggestion: FX Web Access makes it easier to tranfer files.
  • Suggestion: I think keyboard from FireTV remote app and alexa's speech to text input are the most efficient input methods if you don't have physical keyboard.
  • Important:
  • Installed Netflix and Spotify apps are compatible with alexa.
  • I couldn't make my dualshock 4 controller work with this device. Even with the stock system. Help would be appreciated.
Reddit Posts Of This Guide: Here and Here
==========================================================================================

Big thanks to:
  • @k4y0z and @xyz` for unlocking the bootloader.
  • @tsynik for building those life-saving magisk modules which is basicly the key of this build.
  • @Pretoriano80 for creating a kernel which supports SDCARDFS, exFAT, F2FS, Wireguard, Advanced TCP options, CIFS and NFS, Insecure ADB.
  • @bnevets27 for debloating script.
  • @Skel40 for build.prop tweaks to increase performance.
  • @Bertonumber1 for testing the rom.
Can I change the SN from your file? My remote stop working after restore from your file. AFT Settings-"Remote & accessories" not clickable from firetv app. How to pair my remote since i could not access Remote & accessories.

Thanks!
 
Last edited:

burcbuluklu

Member
Jun 6, 2018
31
17
23
Can I change the SN from your file? My remote stop working after restore from your file. AFT Settings-"Remote & accessories" not clickable from firetv app. How to pair my remote since i could not access Remote & accessories.

Thanks!
Requirements:
  • OTG Adapter
  • USB Keyboard/Mouse
You need keyboard or mouse to navigate the first setup to pair the remote.
 
Last edited:

Seattleweather

Senior Member
Oct 30, 2016
84
1
8
Please read the instructions that I wrote carefully. After restoring the backup, you need to navigate using keyboard or mouse until you pair your remote.
I was able to pair it using one app eventually. Thanks. Google app store was kind of working. I was able to sign in to my google account, but stuck into download pending. How to fix this?
 

Attachments

Last edited:

kenmac96

New member
Jan 18, 2021
4
9
13
It's possible to interact with this ROM on first boot without a keyboard. You must use adb shell over USB. The USB cable connected to your laptop, and the FireTV Stick plugged into HDMI on your monitor.

  1. First make sure the device is booted and you see the FireTV stick over USB with adb with adb devices.
  2. Open a new shell with adb shell. You should see a prompt showing mantis:/ $ (may differ if you're not using a 4K stick.)
  3. You have multiple options now to interact with the UI.
    • input keyevent <number> which allows you to send keypresses to the device as if you were working with a keyboard.
    • input mouse tap <x> <y> which allows you to click things on screen using a grid of coordinates. The top left of your screen is x=0 and y=0. The bottom right of your screen is x=1920 and y=1080. Figuring out the exact coordinate of where you want to click will take some trial and error. Don't be afraid to try. Add more x to make the mouse click something right. Add more y to make the mouse click something in the direction of the bottom of the screen.
  4. The easiest option is to use the keyevent input.
    • Use the following guide to map your keypresses to numbers: https://stackoverflow.com/a/8483797/6252246
    • Examples:
    • input keyevent 19 - Up arrow on keyboard
    • input keyevent 20 - Down arrow on keyboard
    • input keyevent 21 - Left arrow on keyboard
    • input keyevent 22 - Right arrow on keyboard
    • input keyevent 66 - ENTER key on keyboard
    • input keyevent 29 - 'A' key on keyboard
Your goal is to get the FireTV Stick on your home network by entering in the wifi password. Once it's on your network, you can then use the FireTV app on your phone to interact with the device. You can also navigate to the FireOS settings for Remotes and Controllers and unpair the non-existent remote ID which ships with this ROM. To do that start the pair process. When it asks you to press "select" on the 'old' remote (which you don't have) just press select (tap the pad) on your FireTV app and it will proceed with the pairing.

Hope this helps someone without a OTG or keyboard like me.
 
Last edited:

burcbuluklu

Member
Jun 6, 2018
31
17
23
It's possible to interact with this ROM on first boot without a keyboard. You must use adb shell over USB. The USB cable connected to your laptop, and the FireTV Stick plugged into HDMI on your monitor.

  1. First make sure the device is booted and you see the FireTV stick over USB with adb with adb devices.
  2. Open a new shell with adb shell. You should see a prompt showing mantis:/ $ (may differ if you're not using a 4K stick.)
  3. You have multiple options now to interact with the UI.
    • input keyevent <number> which allows you to send keypresses to the device as if you were working with a keyboard.
    • input mouse tap <x> <y> which allows you to click things on screen using a grid of coordinates. The top left of your screen is x=0 and y=0. The bottom right of your screen is x=1920 and y=1080. Figuring out the exact coordinate of where you want to click will take some trial and error. Don't be afraid to try. Add more x to make the mouse click something right. Add more y to make the mouse click something in the direction of the bottom of the screen.
  4. The easiest option is to use the keyevent input.
    • Use the following guide to map your keypresses to numbers: https://stackoverflow.com/a/8483797/6252246
    • Examples:
    • input keyevent 19 - Up arrow on keyboard
    • input keyevent 20 - Down arrow on keyboard
    • input keyevent 21 - Left arrow on keyboard
    • input keyevent 22 - Right arrow on keyboard
    • input keyevent 66 - ENTER key on keyboard
    • input keyevent 29 - 'A' key on keyboard
Your goal is to get the FireTV Stick on your home network by entering in the wifi password. Once it's on your network, you can then use the FireTV app on your phone to interact with the device. You can also navigate to the FireOS settings for Remotes and Controllers and unpair the non-existent remote ID which ships with this ROM. To do that start the pair process. When it asks you to press "select" on the 'old' remote (which you don't have) just press select (tap the pad) on your FireTV app and it will proceed with the pairing.

Hope this helps someone without a OTG or keyboard like me.
Does this method work for navigating in TWRP?
 

jellejans

New member
Aug 17, 2016
3
21
3
Thanks for the rom it's working great! still have an issue with Amazon Prime. It says I have an internet connectivity problem. All other apps are working. I googled the issue and it happens when there is an adblocker active. Is this implemented in the rom ?
 
Last edited:

carsti77

Member
May 13, 2019
23
4
3
Hi,

I also just tested your work. I highly commend you doing this kind of thing. It's just normal that there are a few rough edges. I hope you do a revision soon with all the little hitches sorted out.

The most annoying thing for me is:
1. sometimes it stays in the "firetv" boot screen. I didn't wait 30 min. but at least 5 min. before I pulled the plug to reboot. This always works.

2. there is an "Amazon Auth" fullscreen page directly after boot-up. It has your Email ([email protected]) as the login already pre-typed in. Password is missing.

3. I would have wished to have a "nano" version of the ROM, where EVERYTHING is removed (Amazon, Google, etc.). I know in theory I can remove it by hand but I am afraid I might break stuff. I guess some Amazon stuff is still needed, otherwise you cannot register the firetv remote? A shame.

Thanks! Keep up the great work!
 

carsti77

Member
May 13, 2019
23
4
3
i'm trying to install this mod but when i try to restore it on twrp i get "extracttarfork() process ended with error 255". Anyone can help me ?
I guess you made sure the .rar downloaded properly without errors. Extraction also went without errors?

Did you extract the .rar to an USB stick and used an USB dongle to have it available in TWRP?
 

carsti77

Member
May 13, 2019
23
4
3
Can it do netflix in 4k? Full play store? Dts hd passthrough in kodi? Usb hub + exfat? Custom resolutions?
If the normal stick ROM can do 4k netflix, this ROM can do it as well. USB hub works. ExFat no clue.

Full Play Store as far as I can see. I use Aptitude but installed one or two apps in the Play Store.
 

carsti77

Member
May 13, 2019
23
4
3
extraction was fine, i sent the file to the firestick through ftp in es filemanager
Don't you have an USB splitter, so you can attach something like a USB drive to the FireTV? Maybe that fixes your problem. I extracted the ROM to an USB drive. You can plug&play different USB drives even after TWRP started. That's also the destination for backing up the original ROM.
 

joyjohn

Member
Dec 14, 2020
5
0
11
It's possible to interact with this ROM on first boot without a keyboard. You must use adb shell over USB. The USB cable connected to your laptop, and the FireTV Stick plugged into HDMI on your monitor.

  1. First make sure the device is booted and you see the FireTV stick over USB with adb with adb devices.
  2. Open a new shell with adb shell. You should see a prompt showing mantis:/ $ (may differ if you're not using a 4K stick.)
  3. You have multiple options now to interact with the UI.
    • input keyevent <number> which allows you to send keypresses to the device as if you were working with a keyboard.
    • input mouse tap <x> <y> which allows you to click things on screen using a grid of coordinates. The top left of your screen is x=0 and y=0. The bottom right of your screen is x=1920 and y=1080. Figuring out the exact coordinate of where you want to click will take some trial and error. Don't be afraid to try. Add more x to make the mouse click something right. Add more y to make the mouse click something in the direction of the bottom of the screen.
  4. The easiest option is to use the keyevent input.
    • Use the following guide to map your keypresses to numbers: https://stackoverflow.com/a/8483797/6252246
    • Examples:
    • input keyevent 19 - Up arrow on keyboard
    • input keyevent 20 - Down arrow on keyboard
    • input keyevent 21 - Left arrow on keyboard
    • input keyevent 22 - Right arrow on keyboard
    • input keyevent 66 - ENTER key on keyboard
    • input keyevent 29 - 'A' key on keyboard
Your goal is to get the FireTV Stick on your home network by entering in the wifi password. Once it's on your network, you can then use the FireTV app on your phone to interact with the device. You can also navigate to the FireOS settings for Remotes and Controllers and unpair the non-existent remote ID which ships with this ROM. To do that start the pair process. When it asks you to press "select" on the 'old' remote (which you don't have) just press select (tap the pad) on your FireTV app and it will proceed with the pairing.

Hope this helps someone without a OTG or keyboard like me.
You can do this via adblink. It have keypad function.
 

marcge 63

Senior Member
Jul 26, 2013
61
9
28
Hello,
Sorry for the noob question, but I do not understand how you can restore from usb stick as I need the otg usb input to connect usb mouse/keyboard ?
Can someone explain how you do when you switch from keyboard /mouse to usb storage ?
Thanks 👍