FORUMS

[ROOT Update] 5.3.0.1 to 5.0.4 (3 min method)

64 posts
Thanks Meter: 20
 
By aboshi, Member on 24th December 2015, 04:34 PM
Post Reply Email Thread
This guide assumes you are already rooted on 5.0.3.1 (this will work for future updates as well if @zeroepoch 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 @zeroepoch diff and waiting 2 hours.
Or wait until someone like @rbox 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. @xenoglyph 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!jzy1g78qI...uo9imDaskbotY0
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
Code:
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
Code:
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:
Code:
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:
Code:
c230711c59ec66a67229449afbf84291 verify.md5
e7c105e97a797f451c1e6ca7a1d950d6  root.sh
dedf4203ca67fa067dc658c8a1325b4f  busybox
Local Storage Method md5:
Code:
ef110ab79458f3263fbdba4492125f48 verify.md5
e40dafa35b7d694f8c13b95446b84a3a  root.sh
dedf4203ca67fa067dc658c8a1325b4f  busybox
5.0.4 Image md5:
Code:
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/...eloader.img.gz
http://download.zeroepoch.com/aftv2/...ecovery.img.gz
http://download.zeroepoch.com/aftv2/...em.root.img.gz

I will maintain the script until a custom recovery arrives.

Special thanks to @zeroepoch for rooting the AFTV2 and maintaining a git/wiki
Also thanks to everyone else working on the AFTV(2)
@rbox, @ImCoKeMaN, @xenoglyph
Attached Files
File Type: zip 5.3.0.1-5.0.4-script.zip - [Click for QR Code] (1.03 MB, 218 views)
File Type: zip 5.3.0.1-5.0.4-local-script.zip - [Click for QR Code] (1.03 MB, 90 views)
The Following 9 Users Say Thank You to aboshi For This Useful Post: [ View ] Gift aboshi Ad-Free
24th December 2015, 06:02 PM |#2  
Senior Member
Thanks Meter: 25
 
More
Nice, thanks for this guide and script!
I just manually updated and did the 2 hr method last night or I would have done this. It's nice to have a way to do the updates as they happen, thanks for sharing your work
24th December 2015, 06:18 PM |#3  
Member
Thanks Meter: 12
 
More
thanks for doin it proper man, been super busy
24th December 2015, 07:22 PM |#4  
OP Member
Flag NY
Thanks Meter: 20
 
Donate to Me
More
Quote:
Originally Posted by xenoglyph

thanks for doin it proper man, been super busy

No problem
Thanks for being the first one to risk bricking with this method!
The Following User Says Thank You to aboshi For This Useful Post: [ View ] Gift aboshi Ad-Free
25th December 2015, 01:45 PM |#5  
Member
Thanks Meter: 24
 
More
Thanks @aboshi and @xenoglyph!
Quote:
Originally Posted by aboshi

This guide assumes you are already rooted on 5.0.3.1

1) Does this script assume anything besides firmware 5.0.3.1 rooted? (see EDIT below)
2) Does it matter that apps may have altered /system after the 5.0.3.1 root? (for instance I have AdAway which edits /system/etc/hosts)
3) You said this takes only 3 minutes to run. Does that mean you can successfully run sync after dd?
4) The Mega link asks for a decryption key to download. Are you making this available only to a select group of people?

EDIT: Noticed that busybox is part of this rooting package. If I already have busybox on the box, should I uninstall that before running this script?
25th December 2015, 02:02 PM |#6  
OP Member
Flag NY
Thanks Meter: 20
 
Donate to Me
More
@Patrick_445

The script doesn't need to assume firmware version currently, it will only verify the script, .md5, busybox, and images being used.
Im sure I can put in a verify build prop but I have not done that yet. The only reason that would be needed is if someone downgraded when new FW comes out and that might brick their system and I believe it amazon burns fuses now so you cant downgrade.

I posted the decryption key for Mega. I don't know why it was asking you for one because the whole link includes the key.
It doesn't matter that apps alter anything in /system because its getting overwritten/upgraded anyway.
Yes it runs sync at the very end. As for time running it's really only 2 mins. I added a 60 sec sleep at the end right before the reboot just to be safe.
You do not need to delete busybox if you installed it already. busybox is included to run everything statically from the same dir and it must be present or the script will exit as soon as it does the hash check. I have done it this way because I felt it was safer than just linking.
The Following 2 Users Say Thank You to aboshi For This Useful Post: [ View ] Gift aboshi Ad-Free
26th December 2015, 06:58 AM |#7  
Member
Thanks Meter: 15
 
More
adb over network
Hi aboshi,

first of all I want to thank you for your script. It makes updating the AFTV2 quite painless.

Otherwise I'd like to report that I did the update using adb over the network (wired) which thankfully worked, but not completely perfect.

When I ran your script in the networked adb shell it did everything as expected up to writing
"Copying system.root.img"
to the screen. Then nothing further seemed to happen. I expected that step to run a little longer, since system.root.img is by far the largest file to be written. But after some minutes, I started to get nervous. I tried to ping my AFTV2, but it wasn't reachable over the network anymore. When I looked at the TV, which is connected to my AFTV2 (different room), I could see, that the AFTV2 had rebooted and it was stuck at the colored amazon logo. I waited for about 20 further minutes, but nothing changed.

Reading about all the brick-stories here, I feared my AFTV2 was dead now. So I gave it a last chance and powercycled my AFTV2. At that second boot, the AFTV made it and after some minutes of "optimizing apps aso." it really came up. I checked the os version and I had 5.04.

So I can only guess what had happened. While writing the system image obviously the network connection got lost and thus the adb shell session terminated. The script probably continued to run, because it managed to write enough of the system image to create a working system. Probably it even ran until the end, since my AFTV2 rebooted by itself. BUT, I can't be sure about it, because I never saw the correspondig lines in my adb shell and the first reboot didn't really work out.

So my conclusion: I wouldn't recommend using the script over the network unless you are a very adventurous person or you have no other possibility. In my case I was to lazy to carry my laptop over to the AFTV2 and to install the USB drivers and adb on it. Also I just hoped the update would work. In the end I did carry my laptop over and repeated the update over USB, just to be sure. This time it worked perfect.

Greets,
Christian
The Following User Says Thank You to skyball2 For This Useful Post: [ View ] Gift skyball2 Ad-Free
26th December 2015, 02:25 PM |#8  
OP Member
Flag NY
Thanks Meter: 20
 
Donate to Me
More
@skyball2

Thank you for testing over network. I knew more than likely something like that would happen and thats why it should be done over USB.
It is due to all system files being overwritten and linking. You might have also noticed when it upgraded from 5.0.3.1 to 5.0.4 that the system black screens in the middle of the copy (but not when overwriting 5.0.4 to 5.0.4). Thankfully the script finished its job and you have a working system.
Im sure it can be done over network for others as a last resort, but I wouldn't do it personally because we have no recovery options at the moment. If anyone else wants to do this over network I HIGHLY suggest that you wait at least 10 mins before you reboot after you lose network connection, and after the reboot I would wait another 10 mins before power cycling again if stuck at the amazon logo. (so in other words UPDATE OVER USB!)
26th December 2015, 08:08 PM |#9  
Senior Member
Thanks Meter: 49
 
More
Quote:
Originally Posted by aboshi

This guide assumes you are already rooted on 5.0.3.1 (this will work for future updates as well if @zeroepoch 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 @zeroepoch diff and waiting 2 hours.
Or wait until someone like @rbox 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. @xenoglyph 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/#!5JhhWJjJ!7ziTq93zh...xQG5zD8Ezn0ldY
Mega decryption key - !7ziTq93zhvlyPYnZtH1H4xXQBl1yWxQG5zD8Ezn0ldY
Script only package is below (you will need to download and decompress all images)

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=-)
5. Open adb shell (adb shell)
6. Enter the commands one at a time below

Code:
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 reboot manually just type reboot or pull the plug)

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:
Code:
c230711c59ec66a67229449afbf84291 verify.md5
e7c105e97a797f451c1e6ca7a1d950d6  root.sh
dedf4203ca67fa067dc658c8a1325b4f  busybox
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/...eloader.img.gz
http://download.zeroepoch.com/aftv2/...ecovery.img.gz
http://download.zeroepoch.com/aftv2/...em.root.img.gz

I can modify the the script to use /data/local/tmp
So if you want to push all files to the AFTV over adb because you don't have a microSD card let me know.
I believe @zeroepoch will host this on the git as well. I will maintain the script until a custom recovery arrives.

Special thanks to @zeroepoch for rooting the AFTV2 and maintaining a git/wiki
Also thanks to everyone else working on the AFTV(2)
@rbox, @ImCoKeMaN, @xenoglyph

Hello,
when I enter the command: chmod 775 root.sh I get the following error: Unable to open root.sh No such file or directory
any ideas why? I checked that fire tv is connected using adb devices. Also entered adb shell with no problems as well as su, and
cd /storage/sdcard1
thanks
Edit: btw I'm on Windows 7 64 bit. Fire TV 2 shows up in Device Manager as Portable Device
26th December 2015, 08:41 PM |#10  
OP Member
Flag NY
Thanks Meter: 20
 
Donate to Me
More
Don't know why you're having an issue with chmod but just do this:

Code:
su
mount -o rw,remount /storage/sdcard1
cd /storage/sdcard1
chmod 775 root.sh
sh ./root.sh
26th December 2015, 09:07 PM |#11  
Senior Member
Thanks Meter: 49
 
More
Quote:
Originally Posted by aboshi

Don't know why you're having an issue with chmod but just do this:

Code:
su
mount -o rw,remount /storage/sdcard1
cd /storage/sdcard1
chmod 775 root.sh
sh ./root.sh

thanks for the reply. Still same error after chmod.... no error when mount -o rw,remount /storage/sdcard1 though just at the chmod command.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes