[Fire TV General] aboshi:
This guide assumes you are already rooted on 5.0.3.1 (this will work for future updates as well if [MENTION=3411776]zeroepoch[/MENTION] push out new rooted images) I will just need to update the hash check accordingly

Now before I go any further **this can brick your device** so you assume all risk associated with this method.

I have tested this on 2 of my AFTV2 devices no less than 50 times so it was safe for me. There are factors that cant be accounted for such as bad blocks on the nand. I have put in a lot of checks into this script to go off without a hitch. If something doesn't match up the script will tell you and drop you back to terminal. The safest method to date is using [MENTION=3411776]zeroepoch[/MENTION] diff and waiting 2 hours.

Or wait until someone like [MENTION=3991724]rbox[/MENTION] comes up with a custom recovery solution.

This method came down to necessity for me as I wasn't getting the 5.0.4 update (waited a week on each of my devices)

Plus I cant stand waiting around for 2 hours. [MENTION=1822143]xenoglyph[/MENTION] started this off by being the first to use the dd method and after seeing his success I figured I would automate the process because some users bricked their device because of a simple mistake (failing to unpack the .gz for the images).

I have only tested this over USB (use over network at your own risk but if you happen to please report back if it works)

How to:

All-in-One package - https://mega.nz/#!1YJXDbJa!jzy1g78qIUdsRwY4Pzw2yLLyH9pB2uo9imDaskbotY0

Mega decryption key - !jzy1g78qIUdsRwY4Pzw2yLLyH9pB2uo9imDaskbotY0

Script only package is below (you will need to download and decompress all images)

MicroSD Method:

1. Extract the .zip to a microSD card and place the card in the AFTV

2. Plug in your USB A to A cable

3. Turn on USB Debugging

4. Make sure your system sees the AFTV (adb devices) (or over wifi/wired adb connect 192.168.1.xxx -=tested see post #7 & #28=-)

5. Open adb shell (adb shell)

6. Enter the commands one at a time below

su
cd /storage/sdcard1
chmod 775 root.sh
sh ./root.sh

The device will reboot when finished (if for some reason it doesn't reboot on its own and drops you the terminal after the 60 second message, you can just pull the plug)

Internal Storage Method:

1. Extract 5.3.0.1-5.0.4-local-script.zip and adb push it to /data/local/tmp (this is the script, busybox, and verify.md5 only) you have to push images (see below)

2. Plug in your USB A to A cable

3. Turn on USB Debugging

4. Make sure your system sees the AFTV (adb devices) (or over wifi/wired adb connect 192.168.1.xxx -=tested see post #7 & #28=-)

5. Open adb shell (adb shell)

6. Enter the commands one at a time below

su
cd /data/local/tmp
chmod 775 root.sh
sh ./root.sh

The device will reboot when finished (At the moment reboot and busybox reboot aren't working. The script will give you a message when to reboot at the end)

After the device reboots disable OTA again just to be on the safe side:

adb shell
su
pm disable com.amazon.device.software.ota

I have a class 10 microSD and the process takes exactly 3 mins from the second you run root.sh

If you have a slower card expect it to take up to 5 mins.

If the script is tampered with it will error on the hash check

Here are the hashes for each file:

MicroSD Method md5:

c230711c59ec66a67229449afbf84291 verify.md5
e7c105e97a797f451c1e6ca7a1d950d6 root.sh
dedf4203ca67fa067dc658c8a1325b4f busybox

Local Storage Method md5:

ef110ab79458f3263fbdba4492125f48 verify.md5
e40dafa35b7d694f8c13b95446b84a3a root.sh
dedf4203ca67fa067dc658c8a1325b4f busybox

5.0.4 Image md5:

4cc42c5a4ded1eb4d9529b2aede1dfb7 boot.img
f0b05f68cbcecb96722a4637eb06a8a0 lk.img
53649663ee0fa2f7c434b5acdbfddcda preloader.img
3aa70baba1bbb8b29f7d2fa7428e4e1e recovery.img
57bad37f08489b228ae71fc1246adb53 system.root.img

Images for script only download:

http://download.zeroepoch.com/aftv2/5.0.4/boot.img.gz

http://download.zeroepoch.com/aftv2/5.0.4/lk.img.gz

http://download.zeroepoch.com/aftv2/5.0.4/preloader.img.gz

http://download.zeroepoch.com/aftv2/5.0.4/recovery.img.gz

http://download.zeroepoch.com/aftv2/5.0.4/system.root.img.gz

I will maintain the script until a custom recovery arrives.

Special thanks to [MENTION=3411776]zeroepoch[/MENTION] for rooting the AFTV2 and maintaining a git/wiki

Also thanks to everyone else working on the AFTV(2)

[MENTION=3991724]rbox[/MENTION], [MENTION=394912]ImCoKeMaN[/MENTION], [MENTION=1822143]xenoglyph[/MENTION]