yashsingh1/xdaforums huggingface dataset:
[Fire TV General] kayiman74:
when I go setting I have no access to submenu on my fire tv 4k, all submenu are blank.

I also can not install any apk, the install just stuck on "installing forever

however I can access all files in the box by using ES Eplorere.

which file can I modify to factory reset the box?

also which file can I modify to enable adb in the box?

Please Help

Thank you
[Fire TV General] fourlans:
I didn't revert it. I was rooted on 5.0.3.1 and it updated via OTA to 5.0.4
[Fire TV General] zeroepoch:
My only guess why this works is because the chucks it modifies might still match. It doesn't look likely from reading the update script but it doesn't hash the whole partition so I guess it's possible. I'd recommend dd'ing the rooted 5.0.4 image when it's done to make sure it's not some Frankenstein system partition.
[Fire TV General] the_sim:
I took my rooted 5.0.3.1 and enabled OTA, rebooted and it detected the 5.0.4 update. I let it update and rebooted it and all was fine, a non-rooted 5.0.4.

I did a reset to factory to go back to a blank 5.0.4 and it started the process, rebooted and now it won't come back on. Only get a flashing white light. No USB connect sound neither.

Should I contact Amazon and tell them that my device updated to 5.0.4 and I did a reset to factory and now it won't come back on?

Edit: After rebooting 4-5 times I decided to unplug the USB cable from my PC and reboot one more time. It came up with the setup as a new device. It appears to be good now.
[Fire TV General] Patrick_445:
After rooting your box on 5.0.3.1, did you install any apps that might have changed the system partition? (which apps did you install that required root access to work)?
[Fire TV General] rbox:
I haven't really looked in to how much it actually verifies, but it might be just spot checking some things, including the superblock. If the partition was mounted read-write to be able to modify it, the supeblock would have been changed. But because we are just changing the bytes in the partition without changing the superblock, that might be why. Either way, it seems pretty dangerous and if it does work, I would definitely agree that the full rooted image should be written. afterwards

And this is probably a result of having a funky /system. Although it does seem a little odd. You said you factory reset and "it started the process". Do you mean it booted into recovery, wiped /data and then rebooted? Either way, it most likely needs the entire /system written. Depending on how corrupt /system is, they might be able to see it was rooted. They might just reflash it and be done with it. Well nevermind, you said it's working.
[Fire TV General] the_sim:
I now have a non rooted 5.0.4 that was reset to factory.

I connect it to my machine and run root_aftv2.py, restart the FireTV. It connects and then it scrolls through all the lines very quickly and it says that it is done (see below) but it is not rooted. What can I do to get it rooted again?

Patching patch_4edff000.img...

Addr: 0x4edff000

...Already done

Patching patch_4ee01200.img...

Addr: 0x4ee01200

...Already done

Patching patch_5055f000.img...

Addr: 0x5055f000

...Already done

Patching patch_5055f400.img...

Addr: 0x5055f400

...Already done

Patching patch_5055fc00.img...

Addr: 0x5055fc00

...Already done

Patching patch_50dc5400.img...

Addr: 0x50dc5400

...Already done

Addr: 0x50dc5600

...Already done

Congrats, rooting complete!
[Fire TV General] roligov:
Clean out the folder containing root_aftv2.py and extract the downloaded zip again. I had that issue when I tried to root my second device after rooting the first.
[Fire TV General] ImCoKeMaN:
I haven't tested this on fire tv, but looking around for adb info and some google foo there was this thread: http://android.stackexchange.com/qu...ndroid-if-forgotten-pattern-for-screen-unlock

Here's the part I'd look at: For Lollipop 5.0:

JB 4.2.1 users can also follow this method if the previous one didn't work for them.

1.Boot into Recovery and mount Data partition.

2.Repeat step 2 and 3 used in JB 4.2.1 method.

3.We need to tweak some parameters in settings.db

...
[Fire TV General] Xedos9er:
just got the update- yeeeeey !
[Fire TV General] the_sim:
That did it. I had tried copying the folder again from a USB drive but I was getting some permissions issues.

Thanks!
[Fire TV General] kayiman74:
Thank you for your reply. I fixed it by editing the platform.xml
[Fire TV General] er1000:
Thank you. I was able to recover my amazon fire tv by re-rooting it.
[Fire TV General] FatKris:
I'm on a mac, I'm getting stuck at stage 4, I open a second terminal and I copy and paste what's listed. I just keep getting the "no such file or directory" it never gives me a modem number after I adb reboot. Can someone help me out?
[Fire TV General] ImCoKeMaN:
Are you on El Capitan? I'd say look at my last post of instructions (http://xdaforums.com/showpost.php?p=64430095&postcount=631) and download those files, and follow the new process, they are improved from the original method.
[Fire TV General] zeroepoch:
There is a file lastaddr.txt that is used for resuming if you have an unstable USB connection. It remembers that last address that was successful. As you can imagine with a second device it will just think you already finished on the first device. A shortcut to removing the entire directory and unzipping again would be to remove lastaddr.txt.
[Fire TV General] FatKris:
I'm not on El Capitan, and when I try the new method it just hangs on "waiting for preloader" am I missing something? Thanks for your help.
[Fire TV General] Patrick_445:
Try power cycling (unplug, wait a few seconds, then plug in) your FireTV without disconnecting it from USB. The preloader may be detected while the FireTV comes on (within first 5 seconds)
[Fire TV General] stangri:
Thanks, for the Mac OS X-specific instructions. BTW the page at https://gitlab.com/zeroepoch/aftv2-tools/wikis/macosx still only contains the script for 5.0.3.1, there're no 5.0.4 instructions there.
[Fire TV General] fourlans:
After a day's use there appears to be no problems using my AFTV2, all apps from prior to the update and rooting are still present and are working correctly, and It's been rebooted several times since but I'm concerned about your 'Frankenstein system partition' so I'm going to take your advice and 'dd' the rooted image. Are these the correct steps ?

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

Copy system.root.img to an SDcard

Check that the file hashes of the file on the sdcard matches that downloaded

With ADB

shell

su

dd if=/storage/sdcard1/system.root.img of=/dev/block/platform/mtk-msdc.0/by-name/system bs=1m

sync

reboot

I don't know if I'm asking a silly question but if this procedure is correct then why won't it work in place of the OTA update/root process ?

Finally, what's a 'chuck' ?
[Fire TV General] Pat1981:
it's better to do a complete restore (enable updates, restore original image, update via OTA and root again) because

a) amazon only deploys with aftv2 small patches, not complete images (smaller size, faster) and you can be sure, its 1:1 original

b) mmcblk0boot0 and mmcblk1-14 - some files are patched through updates, and if you dd only system, the mmcblk0,.. will not be updatet
[Fire TV General] ImCoKeMaN:
I disagree that an ota would be safer I think that's what would have caused the frankenstien, a dd will do the full system not just "chunks" or certain blocks. other partitions can be checked with their md5, but don't be concerned just because an md5 doesn't match on a rooted system partition since su seems to make some mod like a timestamp perhaps that changes the md5.
[Fire TV General] zeroepoch:
I think [MENTION=4291167]fourlans[/MENTION] is saying to restore back to stock first and then take the OTA not patch the rooted system in an unknown state. The is the ideal upgrade path right now.

The reason why dd'ing stock as opposed to root of a new version is safer is because there are less changes and the commands still function to sync and reboot properly. It's still not safe but just relatively safer. I guess you could say the preloader trick we are using is unsafe as well though since it can break stuff.
[Fire TV General] zeroepoch:
Sorry just haven't had time yet to get that all updated. I've now tested the new method rooting from stock personally on Windows 10, Fedora 22, and Mac OS X 10.11. I had zero problems on each platform although I guess I knew what to expect since I wrote the scripts. I used physical desktops in all cases.
[Fire TV General] ImCoKeMaN:
ok after re-reading I get it, but yes the dd of orig instead of root to start to a known state is better than just taking another OTA from the unknown state.
[Fire TV General] roligov:
Ahh ok yeah that makes sense. Explains why cleaning out the directory works. Thanks again!
[Fire TV General] ians325:
curl -O https://gitlab.com/zeroepoch/aftv2-tools/repository/archive.zip

unzip archive.zip

cd aftv2-tools-master-*

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

curl -O http://download.zeroepoch.com/aftv2/5.0.4/system.diff.gz

gunzip system.root.img.gz

gunzip system.diff.gz

./handshake.py

# restart the fire tv to trigger the preloader

./patch_mmc.sh 0x00000000058e0000 system.root.img system.diff
[Fire TV General] er1000:
Does anyone know the commands to go back to stock on 5.0.4 like there was for 5.0.3 in case we want to go back?
[Fire TV General] Pat1981:
1st post

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

gunzip system.orig.img.gz

adb push system.orig.img /data/local/tmp

adb shell

su

pm enable com.amazon.device.software.ota

dd if=/data/local/tmp/system.orig.img of=/dev/block/platform/mtk-msdc.0/by-name/system bs=1m

sync

reboot
[Fire TV General] er1000:
ok, thanks for the help.
[Fire TV General] bula1ca:
Same commands but make sure you use correct stock image.
[Fire TV General] FatKris:
I tried that and still nothing.
[Fire TV General] ImCoKeMaN:
when it fully boots can you connect to the device with adb over your usb cable? Is the USB a-a cable just that, or does it have a box or some "intelligence" as well?
[Fire TV General] fourlans:
[MENTION=3411776]zeroepoch[/MENTION]

Your earlier suggestion was to dd the rooted image but your second suggestion is to dd the original image and then OTA. Is the second suggestion the better way ?
[Fire TV General] kayiman74:
if you already have 5.0.31 rooted, first add terminal on the box then enable ota by using terminal, right after that factory reset the box. check for update and get ota 5.04 then root 5.04. the command to enable ota is on the first page.

Note : you have to find terminal apk from google store on your phone or tablet then copy apk to fire tv box. or look for the apk on the internet.

that was the way I upgrade and root.
[Fire TV General] ImCoKeMaN:
Factory reset will not unroot your device so it's still not clean to do an OTA from a rooted box even after a factory reset. It has appeared to work for some people, but I wouldn't personally recommend that way. If your device is working fine and rooted in either firmware I'd actually recommend waiting to see if [MENTION=3991724]rbox[/MENTION] gets the recovery working as that would be the safest way.
[Fire TV General] kayiman74:
the method I describe above work for me.

My fire tv 4k 5.04 is rooted.

Thank you for your help
[Fire TV General] D-an-W:
Evening folks, finally got the updated to 5.0.4 and completed the root process on my Pi 2, can I just confirm the final address has changed to 0x50dc5600?

Patching patch_50dc5400.img...
1024+0 records in
1024+0 records out
1024 bytes (1.0 kB) copied, 0.0219589 s, 46.6 kB/s
Addr: 0x50dc5400
Addr: 0x50dc5600

EDIT: It would also appear that disabling software updates does not remain active following a reset to defaults (Root does of course), I seem to remember with 5.0.3.1 the updates remained disabled?
[Fire TV General] Bubbypop666:
Hi can someone tell me how to root my firetv2 on 5.0.4 ive rooted other devices on android before but this is my first amazon device.thanks
[Fire TV General] rbox:
No. It always get reenabled after a factory reset. The disabled state is stored in /data, and factory reset formats /data.
[Fire TV General] zeroepoch:
I need to add a page to the wiki about restoring for the new stuff just haven't added that yet. Other than some additional notes it will be exactly this procedure.
[Fire TV General] zeroepoch:
Yes the second method is better. The first is if you tried the dirty OTA upgrade approach. DD the rooted image to clean up.
[Fire TV General] D-an-W:
Seasons Greetings everyone from me and my rooted AFTV2 :angel:
[Fire TV General] Patrick_445:
If you read the last 10-15 pages or so of this thread, you will find the info you need.

The Opening Post gives you instructions for rooting firmware 5.0.3.1. Rooting 5.0.4 is pretty much the same thing except that commands that include 5.0.3.1 should be replaced with the same commands with 5.0.4 instead. For instance

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

should be replaced with

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

If after reviewing the thread, you don't feel confident in risking bricking your device while trying to root it, I suggest you wait until one easy plug-and-play method is published on aftvnews.com
[Fire TV General] deanr1977:
So if I'm correct if I use the vm on windows 10 like I did to gane root, I need to enter this command in the terminal window inside vm to go back to stock-

wget http://download.zeroepoch.com/aftv2/5.0.3.1/system.orig.img.gz

gunzip system.orig.img.gz

adb push system.orig.img /data/local/tmp

adb shell

su

pm enable com.amazon.device.software.ota

dd if=/data/local/tmp/system.orig.img of=/dev/block/platform/mtk-msdc.0/by-name/system bs=1m

sync

reboot

Then unblock updates? Except new OTA? Then root new firmware?

A Few questions what do I download & where does it need to be located please?

Thanks in advance
[Fire TV General] Patrick_445:
The commands assume that:

1) you have firmware 5.0.3.1 rooted and your FireTV has adb debugging enabled

2) You are connected to your FireTV 2 via adb (https://developer.amazon.com/public/solutions/devices/fire-tv/docs/connecting-adb-over-network)

the commands:

wget http://download.zeroepoch.com/aftv2/5.0.3.1/system.orig.img.gz
gunzip system.orig.img.gz

download the compressed stock image to your current directory and then decompress it. If you are on firmware 5.0.4, replace "5.0.3.1" with "5.0.4" in the url of the first command. If these commands do not work, you can manually download the compress image by entering the url in your browser, and decompress it with 7zip software (free). Place the decompressed image in the same directory that has adb.exe. Once you have the uncompressed image where the adb.exe can see it, proceed with the 3rd command.

The command

pm enable com.amazon.device.software.ota

enables OTA updates, so you do not need to do that separately. Once the last command is executed, your machine should be back to stock.
[Fire TV General] deanr1977:
I'm running 5.0.3 rooted with ADB running, wanting stock to update after to 5.0.4
[Fire TV General] nozebleed:
you guys are the best....py script worked like a charm on osx capitan. had to use the remote and restart from settings on aftv for it to "recognize" the power cycle unplugging power cord didnt do anything.

for those on el capitan that are having problems with adb and fastboot installs - i stumbled across something on the web - el capitan has "Rootless" enabled, to disable it reboot into recovery (reboot, hold command+R) then use terminal in the utilities dropdown to disable it with the command

csrutil disable

reboot again, then install adb and fastboot as usual
[Fire TV General] Patrick_445:
The instructions I gave are for 5.0.3.1 rooted. If you're on 5.0.3 rooted, I don't know how you'd get back to stock

[MENTION=3411776]zeroepoch[/MENTION], I noticed that you've made the 5.0.4 branch of the git the master branch. As a result, I think that the instructions on https://gitlab.com/zeroepoch/aftv2-tools/snippets/11117 will no longer work since line 18 will download the master branch files, but lines 20 through 23 will download the 5.0.3.1 images.

You may need to update lines 20 and 21.
[Fire TV General] deanr1977:
Sorry mate I ment 5.0.3.1 (my bad)
[Fire TV General] zeroepoch:
That script is kind of outdated now since we have the new method and new thread. I need to do some further updates to this thread and some other places when I get time. I'll update it for people who might still come across it but I think more importantly I need to put a link to the be thread at the top when I get time. Thanks for reminding me about that.
[Fire TV General] sandog12:
Hello all.

I had a couple questions On the firetv 2 what are you gaining by rooting this bad boy? Also is there any reason to keep the first firetv over the firetv 2. Also I noticed llama doesn't work anymore with keeping the kodi launch on the main screen. Is there a fix or firestarter is the way to go now. Thanks
[Fire TV General] Xedos9er:
I see absolutely no reason for buying a FTV2. I´ve done this mistake, now DTS and HD Sound not working, even as PCM (Channels mixed wrong). DD is ok, but most of my movies are DTS :(

So i have an AV-Receiver wich i can use only in stereo mode.

And I don´t think that Amazon will fix this via firmware, since this problem known from day 1 and kodi is a 3rd party app.
[Fire TV General] sandog12:
Are thos same problems on the first ? TV?
[Fire TV General] Patrick_445:
The FTV2 will be a step up if you use your FTV1 for gaming (FTV2 has stronger performance, but if you want good gaming in a streaming box, the NVidia Shield TV is it). The FTV2's other significant advantage is that it supports VPN apps by default (FTV1 required root or a connection to another device that ran the VPN client). Outside of these use cases, I really don't know what big advantage the FTV2 has. The Alexa service, if you even care, will be available on the FTV1 in 2016.

The biggest reason I had for rooting my FTV1 was to use a VPN. I rooted my FTV2 because I like the future flexibility that having root gives me (meaning I don't yet know the ways in which it may be useful but I want the options). The only usefulness that root has brought so far is the AdAway app, which edit the hosts file to prevent apps from connecting to ad servers. In short, I am no happier now than I was with my FTV1.

I use FireStarter and set Kodi to launch on boot.
[Fire TV General] lbthomsen:
Bricked?

Hi Everybody,

Just received an Amazon Fire TV today and after playing with it for a few hours I went ahead and tried this method for rooting. I followed the steps in the first post - including checking the version and everything appeared to have worked OK.

However, after restart, the device quickly comes up with a black screen saying "Amazon" in the center - and there it stays.

The device shows up in adb:

lth@nb5:~/src/aftv2-tools$ adb devices

List of devices attached

G070GV0154040PS0 device

I can do an "adb reboot" but if I try "adb shell":

lth@nb5:~/src/aftv2-tools$ adb shell

- exec '/system/bin/sh' failed: No such file or directory (2) -

using port=5555

The adb installation is OK - using it regularly on various mobile phones

I can run the patch again - result:

Patching patch_058e0400.img...

Addr: 0x58e0400

...Already done

Patching patch_058e1000.img...

Addr: 0x58e1000

...Already done

Patching patch_05932000.img...

Addr: 0x5932000

...Already done

Patching patch_05933000.img...

Addr: 0x5933000

...Already done

----------------- lot of lines removed

Patching patch_50569400.img...

Addr: 0x50569400

...Already done

Patching patch_50569c00.img...

Addr: 0x50569c00

...Already done

Patching patch_50dce400.img...

Addr: 0x50dce400

...Already done

Addr: 0x50dce600

...Already done

After reboot it again just hangs at the amazon logo.

I was at 5.0.3 when I started this

Any ideas?
[Fire TV General] deanr1977:
Did you upgrade to official 5.0.4 before rooting the 5.0.4 root?
[Fire TV General] lbthomsen:
No, and I did mean 5.0.3.1 was the initial version.

I reckon the best bet is that there was a mismash between the version the device was running and the image I used. As mentioned, I followed the steps in first post to the letter - so the one I downloaded with wget was definitely 5.0.3.1.

Question is what I do now?
[Fire TV General] deanr1977:
The process goes from 5.0.3.1 official, upgrade to latest official via the update from amazon the follow the 5.0.4 guide for root after your rooted then Block ota updates.
[Fire TV General] lbthomsen:
Well, I noticed the check_version.img file and it contains the following:

ro.build.version.fireos=5.0.4

So, I guess yes - the device was updated to 5.0.4 and I ran the 5.0.3.1 patch on that.

So - acknowledging that I am an idiot - question is - can the patch be reversed? Can the new patch potentially be applied?
[Fire TV General] deanr1977:
I'd ask [MENTION=3411776]zeroepoch[/MENTION] if I was you there more experienced with this
[Fire TV General] deanr1977:
Well what's done Is done & hopefully you haven't bricked it? I'd wait for advice from the other Devs or you could try to do the correct patch? You may have just soft bricked it which should be ok to get it back from the amazon bootlogo? I would wait & read up before going any ferther or if I couldn't wait I'd flash The correct one. One rule I learnt on XDA while flashing Roms/bootimages & or mods is read read read & read somemore & also sometimes It's better to be ready than jump in feet first. Fingers crossed you've not fully bricked your device
[Fire TV General] Patrick_445:
Since USB debugging still works you can probably recover your machine. Just as you wrote the patch to /system as part of the rooting process, you can write the original full image to /system to reverse things. My guess is that you could probably write either 5.0.3.1 or 5.0.4. Either should work since you would not be patching but writing the full /system. The downside to this method is that it takes a couple of weeks of constant writing to complete given how slow writing speed of this method. You may prefer to order an exchange if you bought from a seller who allows for easy returns/exchanges such as Amazon.

As for the specific process, go through each page on this thread and search for the string "2 weeks". You will find different posts that discuss how it can be done. I would start searching from the beginning because the 2 week discussion occurred early on for the most part, when people were bricking devices while the kinks were being worked out of the rooting process.

The original (unrooted) full images are:

5.0.3.1 (MD5: 8e1e2258373e679d8e2d5b3348bf62f3)

5.0.4 (MD5: 3225e6eb05ed6202d92979dfb44ac7c9)

Best of luck.

EDIT: Now that I think about it, if you'll spend the 2 weeks to do this procedure, you might as well write the full rooted image directly (if you still intend to root) instead of writing the original image and later going through the rooting process. Here is the link to the full 5.0.4 rooted image (MD5: 57bad37f08489b228ae71fc1246adb53)
[Fire TV General] Fruchttiger00x0:
Yes, i write this damn partitions for about 6 days :p

Guess I have to pay a lot of dues for being a little retarded that day ;)

The point which makes me a little nervous is that I see strange Errors during some flash brakes

Does that messages from attachment mean I have to flash the cache img also?

(write_mmc.py 0x00000000512a4000 cache.img)
[Fire TV General] rbox:
If you are to the point where it's totally hosed and are going to flash the entire /system image, you might want to hold off. In theory, once I get recovery working, I should be able to make a very small /system image that would be 10's of KB that should allow you to boot to custom recovery. From there, you could flash a prerooted image. I'm pretty close to having something ready, but don't have a hard ETA on it.
[Fire TV General] Fruchttiger00x0:
These were my thoughts, too. Sound really good.

Thanks for your effort :o