yashsingh1/xdaforums huggingface dataset:
[Fire TV General] zeroepoch:
I'm hoping now that we have root we can hook the home button in a nicer way for FireStarter. It's not something I unfortunately have much experience with. You'd have to contact the developer of FireStarter. I actually never owned an AFTV1 so I'm rather new to the modding community for the Fire TV. It would also be nice if there was just a way to reduce the number of menu items on the main launcher.
[Fire TV General] rbox:
Yes, and seeing as there is no recovery yet. You can't do that.
[Fire TV General] BBLT78:
Could I not use flash Gordon?
[Fire TV General] arunningpir8:
Grr so I was stupidly using a live usb distro of ubuntu to do this as I was too lazy to swap hard drives in my laptop. I got about 5 mins in to patching when it froze. I then swapped my hard drive in with my main distro and I have yet to restart my fire tv for fear of further damage. However when I try to start patching now I get stuck on the first record:

Patching patch_00000400.img...

512+0 records in

512+0 records out

512 bytes (512 B) copied, 0.0014643 s, 350 kB/s

It hangs here seeming forever now. If I restart the fire tv can I continue patching or is everything just farked now?

EDIT:

Ok, so I rebooted the firetv and ran the handshake again and got it to start running however it seems to have crashed at the same point again :(

Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 475, in read

raise SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')

serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "./write_mmc.py", line 363, in <module>

msdc_pio_write(block_data)

File "./write_mmc.py", line 258, in msdc_pio_write

msdc_fifo_write32(words.pop(0))

File "./write_mmc.py", line 139, in msdc_fifo_write32

sdr_write32(MSDC_TXDATA, word)

File "./write_mmc.py", line 107, in sdr_write32

check(dev.read(1), b'\xd4') # echo cmd

File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 480, in read

if e[0] != errno.EAGAIN:

TypeError: 'SerialException' object does not support indexing

Any ideas?
[Fire TV General] reiteravi:
can u hash check the image ?

or just clear all file and wget again
[Fire TV General] arunningpir8:
The image should be fine as gunzip would have not been able to extract it otherwise right? I am wondering if it is my usb cable. It seems to fail at different areas each time I try. Either that or my laptop just doesn't play well :/

Do you know if now that it has failed once, is it bricked, or will it just need a successful patch to boot up?
[Fire TV General] zeroepoch:
I had this happen to me a few times during development when I kept repeating operations without rebooting. I tweaked the baud rate a bit to read/write faster and that seemed to make it more reliable for me. As you said it's either a USB cable issue or could be a driver issue. That's why I recommend to power off the device, reboot the computer, and try handshaking again to clear the host driver state. Try a different USB port or cable if you can. You can also try changing the baud rate at the top of handshake.py and write_mmc.py. Maybe try 19200 or 921600 to go up or down. That speed has nothing to do with speeding up or slowing down the transfer, but more about sampling the reponse quicker or less often best I can tell.
[Fire TV General] zeroepoch:
You just need one successful patch however many times it takes. If you are still unsuccessful it might still boot if you are lucky but it may not be stable. One thing you might also try is a different distro. I found that RHEL 6.5 stumbled less often than Fedora 22, but could be random chance since I use Fedora more often.
[Fire TV General] arunningpir8:
Moved from a 2.0 to a 3.0 port and so far almost 30 minutes :) fingers crossed it boots up when I'm done :P
[Fire TV General] zeroepoch:
You need to use a text editor on the files handshake.py and write_mmc.py. Very close to the top you will see a line "PORT = /dev/ttyACM0". That will become "PORT = /dev/cu.usbmodemXXXX". If you run that while loop you will see it change from no device or whatever to something matching that pattern and then disappear. Make sure you use the same USB port when you unplug it and plug it back in.
[Fire TV General] binkers:
I had the same issues, a reboot of computer and firetv fixed it also
[Fire TV General] rbox:
You could write the update zip to /cache and the recovery command file and reboot into recovery and it should work. [MENTION=5957312]AFTVnews.com[/MENTION] used to have instructions for creating the recovery command file i believe. This is assuming you are still rooted.

Yes, I am working on recovery. Having some issues with it crashing for no good reason. For now, either 5.0.3.1 or 5.0.4 should be fine.
[Fire TV General] zeroepoch:
[MENTION=6169935]bula1ca[/MENTION], did you root using Windows? I'm guessing since you rooted before you reverted back to stock and then rooted again after updating? Just trying to get some additional confirmation of success. Same method as before and run it myself on Linux but checking how others are fairing.
[Fire TV General] zeroepoch:
Deleted due to double post, timeout during posting.
[Fire TV General] Pat1981:
Ive rooted 503 via VMware Ubuntu and 504 via Windows .. But created the diff via debian/ raspberry. I've used the old files from 504 github which I've downloaded Saturday at 2 pm (before you uploaded the diff and the zip file) also I've disabled as written the driver signing check in Windows 10 home x64
[Fire TV General] D-an-W:
To root 5.0.4 do I just need to edit the Version.txt file so the checkver.py script passes ok or do I need to switch to the 5.0.4 branch fully (Not really sure how to do that if so!)?
[Fire TV General] capsterx:
Maybe this was meuntied somewhere, but I did not see it. I had trouble with my windows machine halting after so many Addr updates and I kept having to restart the whole process. I suspected my box just couldn't keep up with the usb communication and ended up getting stuck.

I changed patch_mmc.bat line that says

write_mmc.py %PHYS_ADDR% %TMP_FILE%

to

start /high /b /wait write_mmc.py %PHYS_ADDR% %TMP_FILE%

to force the process to start in high priority. This seemed to work better.

Edit1: I also changed patch_mmc.py to do the same when running write_mmc.py

Edit2: while this helped, i still had to halt/unplug firetv/start handshake/plug in firetv/restart patch more than i would of liked, so maybe it didnt actually help after, hard for me to know now.
[Fire TV General] Xedos9er:
Ok, so i rooted again, enabled OTA and got back to stock.

Is there a difference between german AFTV´s and US in software? I mean, is the sys orig img file provided by zeroepoch the same for all AFTV´s ? Maybe i´m blocking my update because the server thinks now it´s an US FTV and I try to get update from germany?!?
[Fire TV General] Patrick_445:
[MENTION=1164016]Xedos9er[/MENTION] if there were a meaningful difference between US and other devices in /system, then the same rooting method (for 5.0.3.1) would not have worked across devices right? Given that we root by patching at specific addresses, I think the fact that the same patching process works across geographies means that the devices are essentially the same where it matters. Is that false?

Your device may just be a slave to Amazon's rollout schedule.

PS: would you give instructions on how you got back to stock please?
[Fire TV General] Pat1981:
I've got the update after unroot 503 - german firetv

p.s. to go back to stock - take a look at 1st post of this thread
[Fire TV General] Xedos9er:
read carefully, I already activated OTA and got back to stock. Also I´ve done a factory reset again.

[MENTION=5910180]Patrick_445[/MENTION]

read 1st post. I downloaded the IMG file to a SD card and ran the command prompt like described (modified the file path since it´s on sd card).
[Fire TV General] D-an-W:
Back to 5.0.3.1 stock now.

Just need an updated to 5.0.4 now!
[Fire TV General] bula1ca:
Hi,

correct, reverted back to 5.0.3.1, took the update to 5.0.4 and re-rooted using windows 10 (64). Worked flawless.

Thank you.

---------- Post added at 02:26 PM ---------- Previous post was at 02:13 PM ----------

Once you are on 5.0.4 just run the bat file....I run exe file and all worked well
[Fire TV General] bula1ca:
deleted - double posted
[Fire TV General] D-an-W:
I am using a Pi 2 to do the work.
[Fire TV General] roligov:
Enabled OTA, installed 5.0.4 and then re-rooted and disabled OTA updates. Thanks zeroepoch!
[Fire TV General] fsi09:
Is the fire TV stick also rootable :) ?
[Fire TV General] Pat1981:
5031:

http://xdaforums.com/showpost.php?p=64376506&postcount=526

504

http://xdaforums.com/showpost.php?p=64395452&postcount=569
[Fire TV General] zeroepoch:
Sweet!

Also thanks everyone for the reports of success. I think it helps others to feel more confident that they can do it.
[Fire TV General] wadisnake:
Just rooted my first unit using Windows 10 64. Was pretty easy if you follow readme (even easier than the gen1 since there are less steps..)

Had some trouble in the beginning and needed to edit the bat file to use correct Python version but I guess it's related to my environment!

Thanks zeroepoch !
[Fire TV General] nEUTRon666:
Could this, by chance, a way to also root the 1st gen ftv ?
[Fire TV General] Ludacrisvp:
Nope.

Nope. At least not like this, you can solder a eMMC reader into the stick and modify the filesystem manually.

So what exactly is the benefit of 5.0.4? The only thing I've been able to find out about this update is that it adds support for Dolby digital over HDMI as a separate option from Dolby digital plus over hdmi.
[Fire TV General] roligov:
Elias talks about it in the latest AFTV Newscast 20: https://www.youtube.com/watch?v=-lJMx0nZO5M
[Fire TV General] :
I'm using my laptop, trying to open install_pyserial.bat and getting this error:

'python' is not recognized as an internal or external command, operable program or batch file.
[Fire TV General] wadisnake:
you probably just need to add python location to path
[Fire TV General] :
There was an updated post on 13 Dec, stating Window Users don't need to install Python anymore.

So, now I'm running the root_aftv2.bat and it's telling me to plug in my AFTV2, but it's still stating that it's waiting for my preloader.

Looking in the device manager, it's showing triangle icon for MediaTek DA USB VCOM Port (COM7)

Could it be because I already powered up my AFTV2 a couple days ago, installed Kodi and FireStarter?

Edit: Just started pressing the Play/Pause button multiple times and it ended up connecting.
[Fire TV General] retyre:
That and the sideloaded apps showing up in the apps list on the home screen. I'd use FireStarter anyway, and I read some reports of DD not being picked up by KODI and other apps. There will likely be a 5.0.5 in a month or so.
[Fire TV General] Patrick_445:
Did you have to restore to stock (unroot) after enabling OTA? Or did the update to 5.0.4 succeed directly from a 5.0.3.1 rooted box once you enabled OTA?
[Fire TV General] :
I thought 5.0.4 isn't rootable?
[Fire TV General] Patrick_445:
It is. Read up the last 5 pages or so of this thread.
[Fire TV General] :
Crap, I'm rooting 5.0.3.1 right now.
[Fire TV General] stangri:
While it seems there's enough information on 5.0.4 rooting already, would be great if one of those brave ones who have already rooted their 5.0.4 devices could post step-by-step guide specifically for 5.0.4 while we're waiting for OP to update the first post with his nice all-in-one script.
[Fire TV General] xenoglyph:
if you're feeling brave you can try my method for a quick upgrade from 5.0.3.1 rooted to 5.0.4 rooted:

http://xdaforums.com/fire-tv/general/howto-rooted-5-0-3-1-to-rooted-5-0-4-t3275353

not entirely sure how sane it is, the experts on here might add a step or two, but it worked great for me
[Fire TV General] ImCoKeMaN:
I just updated the wiki on the Git site to some of the new instructions and listed links for both 5.0.3.1 and 5.0.4 with the newer process. Only ~7mb download. Hope it helps!

https://gitlab.com/zeroepoch/aftv2-tools/wikis/windows
[Fire TV General] :
I just did and now my aftv won't turn on.

I completed all the steps, unplugged the power, plugged in back in. No loading light or anything.
[Fire TV General] roligov:
The OTA for 5.0.4 restored my device from a rooted 5.0.3 to a unrooted 5.0.4 with my other apps still installed.
[Fire TV General] zeroepoch:
I have some confidence that you need to update preloader (mmcblk0boot0), lk, boot, recovery, and system for a dd based upgrade. I need to dig a bit more when I get time to see if maybe something else is related. Looking at the upgrade script I don't see anything else.

EDIT:

I see [MENTION=1822143]xenoglyph[/MENTION] already tried this (probably figured out the partition list based on the posted hashes) and had some success. It's quite risky though and I believe it might work if you wait long enough after running the dd commands for it to flush the written data or take some additional steps to insure "sync" will run and completes. The safer way is to go back to stock, take the OTA for 5.0.4 and wait 2 hours to root again. I know this general procedure will not work if the preloader is blocked in the future, so [MENTION=3991724]rbox[/MENTION] is trying to get recovery working so we can create our own OTA of sorts.
[Fire TV General] the_sim:
I attempted to revert back to stock but had some issue at the dd command. In an attempt to rectify this I rebooted the Fire TV. Now I only get the screen saying "amazon FireTV" . Is this device bricked? Is it doing an update right now since the image file was in the temp folder? What should I do?
[Fire TV General] zeroepoch:
If the dd was not successful then it's likely semi bricked. The only other ways to restore if you made no other changes after rooting it repeat the old method using the original image instead of rooted image it if that doesn't work the full 2 week flash.
[Fire TV General] :
What is this 2 week flash? Because I most likely need it, the light doesn't even turn on my AFTV and when plugged into my computer it keeps connecting/disconnect but adb shell doesn't see it.
[Fire TV General] er1000:
I accidentally soft bricked my amazon fire tv by trying to go back to stock. It only loads to the booting screen that says Amazon Fire TV. Can I unbrick it by rooting my amazon fire tv again, or what can I do to save it?
[Fire TV General] the_sim:
I restarted the process before reading your reply but I started it using the rooted image file: ./patch_mmc.sh 0x00000000058e0000 system.root.img system.diff

Will that be an issue?
[Fire TV General] the_sim:
I was able to run the original script to get my box back to a rooted version 5.0.3.1. I have since gone back to stock and i am awaiting the update to 5.0.4. From what I have read there is no way to speed up that process. Is this correct?
[Fire TV General] Xedos9er:
Yes, no "safe" way to speed up. I'm waiting now for a couple of days. Nothing...
[Fire TV General] the_sim:
I restored 3 Fire TVs and 1 of them got the update to 5.0.4 right away. I downloaded the zip file from post #568 but I am not quite sure what to do with it yet. Do I replace all the files in the aftv2-tools folder with the content of the zip? I noticed that there is no system.root.img or system.diff files in the zip file. Any basic guides to root 5.0.4 out there?
[Fire TV General] bula1ca:
Do you have the driver installed already?

Are you using windows? If so: unzip folder, connect your firetv to your computer via USB cable, run bat file and power your firetv on.
[Fire TV General] zeroepoch:
There is a good chance that might work since it will overwrite all the differences and fix up a partial write if that's what happened. Make sure you run "sync" after dd'ing back to stock.
[Fire TV General] zeroepoch:
No that should be fine.
[Fire TV General] stangri:
Weird, my AFTV2 updated to 5.0.4 back on 11th or 12th, I'm surprised it hasn't reach everyone by now.
[Fire TV General] the_sim:
I used the pre configured Ubuntu image to root. This zip will only work with Windows?
[Fire TV General] kayiman74:
how can I run the system.orig.img without adb,

My sub menu on my fire tv 4k empty, so I can't turn adb on.

I still have access to all folder on ES explorer
[Fire TV General] ImCoKeMaN:
The zip works with any OS, but if you are running a VM of Ubuntu that was created previously and you want it to work with 5.0.4 you will need to download the new zip and run root_aftv2.py

Here is a basic generic set of instructions for the smaller zip files:

Make sure your device is in a stock, unrooted state

Confirm your OS version and select the appropriate root package:

For Stock 5.0.3.1:

•http://download.zeroepoch.com/aftv2/5.0.3.1/root-aftv2-5.0.3.1.zip

For Stock 5.0.4:

•http://download.zeroepoch.com/aftv2/5.0.4/root-aftv2-5.0.4.zip

Pre steps per OS:

Windows:

Install the driver in the drivers folder using these instructions:

•http://thebroodle.com/microsoft/windows/how-to-install-mtk65xx-preloader-usb-vcom-drivers-in-windows

Mac and Linux:

confirm you have python 3 and pyserial (further details on wiki https://gitlab.com/zeroepoch/aftv2-tools/wikis/home)

(This prerequisite should already be done if you used a VM preconfigured for a previous rooting procedure)

Next perform the following steps:

1. Run root_aftv2.bat (windows) or root_aftv2.py (Mac/Linux)

2. Restart the Fire TV

3. The process will now start patching (~2 hours)

---------- Post added at 10:06 PM ---------- Previous post was at 10:02 PM ----------

I'm not sure I understand why you can't get to adb on your rooted device, were you performing any other steps? If your device is working fine in 5.0.3.1 and rooted for now I'd keep it that way. There may be a better process to update in the future to go from rooted 5.0.3.1 to 5.0.4. Also, there may be a way to enable adb manually but that should probably be in a different thread as it's not directly related to this rooting process.
[Fire TV General] tipzjames:
I'm running the batch file for my AFTV2 5.0.4 on my Windows 7 laptop.

Anyone know if this is normal... The script has been sitting at the address block 0xd8df200 for about 20 minutes, all other blocks that have gone through in seconds.

Starting the AFTV2 rooting process
1. Connect your PC to the AFTV2 with an A-male to A-male USB cable
2. Power on / power cycle the AFTV2 to initiate the preloader

Waiting for preloader...
Found port = COM7
Handshake complete!
Extracting build.prop...
FireOS version ok, device is rootable!
Patching patch_058e0400.img...
Addr: 0x58e0400
Patching patch_058e1000.img...
Addr: 0x58e1000
Patching patch_05932000.img...
Addr: 0x5932000
Patching patch_05933000.img...
Addr: 0x5933000
Patching patch_05933a00.img...
Addr: 0x5933a00
Patching patch_05939c00.img...
Addr: 0x5939c00
Patching patch_0593a600.img...
Addr: 0x593a600
Addr: 0x593a800
Patching patch_0593ec00.img...
Addr: 0x593ec00
Patching patch_05946800.img...
Addr: 0x5946800
Patching patch_0597b200.img...
Addr: 0x597b200
Patching patch_059acc00.img...
Addr: 0x59acc00
Patching patch_059ad400.img...
Addr: 0x59ad400
Addr: 0x59ad600
Addr: 0x59ad800
Addr: 0x59ada00
Addr: 0x59adc00
Addr: 0x59ade00
Addr: 0x59ae000
Patching patch_0d8df000.img...
Addr: 0xd8df000
Addr: 0xd8df200

UPDATE: The particular issue I was running into was with my windows machine it seems. I tried 3 times and the script would stall. Tried uninstalling Antivirus, didn't help. Now it's been running for about an hour on my Windows 10 laptop. Side note: I had to start Win10 with Driver signing enforcement disabled, and had to quickly manually update the driver in devicemanager as soon as I rebooted the AFTV2.
[Fire TV General] kayiman74:
This a screenshot of my system menu

file:///home/duc/Desktop/20151221_235206.jpg
[Fire TV General] Patrick_445:
can 5.0.3 root take OTA?

This is really interesting; can anyone else confirm this? [MENTION=5035071]roligov[/MENTION] enabled OTA from a rooted 5.0.3.1, and the box was able to auto-update to 5.0.4 removing root in the process. He/she finally rooted 5.0.4. Maybe we don't have to go back to stock manually before updating.
[Fire TV General] Fruchttiger00x0:
As I finaly sot-brick my device after flashing to 5-0-4 i would like to ask about a full image restore. You know, the 2 weeks thing. Is it complicate to create whole package or is there any way I could assist?
[Fire TV General] roligov:
I did the the same for all 3 devices. Why would you need to revert to stock when the only difference between stock and the rooted OS is the super user apk. Just take the 5.0.4 OTA and re-root with the new files provided.
[Fire TV General] Patrick_445:
[MENTION=5035071]roligov[/MENTION] it's good news. The reasons I'm cautious are (1) Something [MENTION=3991724]rbox[/MENTION] wrote at some point led me to believe that with the FireTV 1, the box would check that /system had not been modified before applying an update. As a result, updates would be denied to rooted machines. (2) Since with the FireTV 2, the updates are just patches, the whole /system is not overwritten as before, so I'm worried that applying a patched update to a modified partition would have unexpected results.

I'm glad it works though. Just surprised I guess. I wonder whether having other apps that have made changes to /system after root would make a difference. For instance, I used AdAway to modify my hosts file, which is at /system/etc/hosts I think.
[Fire TV General] boudicca99:
revert to stock 5.0.3 and now what ?

Hi guys, successfully rooted with 5.0.3 disabled ota, the re-enabled ota, and went back to stock for the next 5.0.4 root all good so far, bar no ota update to 5.0.4. .A manual aftv2 update check has returned nothing to update after 36hrs. So that begs the question.....

I'm in the UK has anyone in the UK been updated to 5.0.4 ?

Cheers Boudy

edit: I have also reset to factory...no change
[Fire TV General] Xedos9er:
I'm in the same situation. Just wait...
[Fire TV General] fourlans:
I'm in the UK & got the update within minutes of enabling the OTA last night.

Rooting 5.0.4 via the zip file at the moment.

---------- Post added at 12:24 PM ---------- Previous post was at 11:53 AM ----------

Succesfully rooted 5.04 using zeroepoch's zip/batch file.

Previously, my 5.0.3.1 box was rooted and the OTA disabled.

Once I enabled the OTA, the system updated from rooted 5.0.3.1 to un-rooted 5.04. I then ran the 5.0.4 zip file and after the usual wait, my box is rooted again.:D

More thanks to zeroepoch & ImCoKeMaN for their efforts.
[Fire TV General] santamanga:
[MENTION=4291167]fourlans[/MENTION]

So there is no need to go from rooted 5.0.3.1 to stock again? Because earlier in this thread it is said, the update will most likely fail if applied on a rooted box, because the system partition has been altered. Did you factory reset after enabling OTA again?
[Fire TV General] fourlans:
No factory reset. Enabled the OTA via ADB, went to the system menu on the FTV2 and the update was already downloading. I rebooted when instructed and voila, 5.04 was installed. I'd read , earlier in this thread, that this would be OK and so I gave it a go. Worked without a hitch then I rooted it.
[Fire TV General] aboshi:
Well it has been a few days for me reverting to stock/unrooted and updating isn't happening (NY Est.)

Steps taken:

Enabled OTA Updating

Flashed Orig. Image

Rebooted

Factory Reset

Manually Update button pressed hundreds of times

Reboot about another 20 times

It is not finding the update or its being blocked by amazon.

By now there is no way they would be rolling out the update randomly, so now I'm wondering if some of our units have been flagged.

I think later today I will root 5.0.3.1 again and than move to the fast method of updating to 5.0.4 (hopefully not brick without a recovery solution other than waiting 2 weeks)
[Fire TV General] bula1ca:
Updates will fail if unit is rooted however if you revert it back to original software it will update.