yashsingh1/xdaforums huggingface dataset:
[Fire TV General] ImCoKeMaN:
I happen to be very happy that [MENTION=3411776]zeroepoch[/MENTION] has posted the root at this point and allowed it to be community developed. I've never been able to assist in the fireOS/android rooting process as much as this before and it's only because he allowed this development to be open. I understand wanting the process to be easier, and we are working on that, but the alternative to where it is now would be MANY less rooted devices, and the polished easy version may take so long that the hole is closed and if that was the case it would be useless. I didn't know python when I helped port the process to windows, I learned so I could help contribute to the community.

Perhaps, zeroepoch and I aren't the best and documenting the user process, but fortunately as part of this community you have seen others that have done this are willing to help. And the process will again be improved as we learn more. If you get rooted and there was a step we need to improve please share that info.
[Fire TV General] Don_Black:
Help

Please don't take what I am saying as disrespect, I am just a novice and I am trying to become better but it is hard when you are trying to figure out the in between prerequisites, that most developers know and some don't. If I offend [MENTION=3411776]zeroepoch[/MENTION], and [MENTION=394912]ImCoKeMaN[/MENTION], I appologize that was not my intent. I just wanted to shed light on the notion that there are end users that are novices like me and just want a little more detail. I am sorry if this had causesd a big catastrophe.
[Fire TV General] jzd5032:
I know it says not to use a Mac running El Capitan, but has anyone been able to successfully root their device using this OS version? I really don't want to downgrade and thought I'd check to see any other options. Thanks!
[Fire TV General] ImCoKeMaN:
You can put mavericks on USB to boot or use a VM.

I accept your apology and looking back I may have acted similarly as I was learning, but please realize that the community isn't just Zeroepoch and I. If we didn't meet your needs yet, give it time we are still working. Also, I'm sure there will be an AFTVNews guide that will make things as clear as possible when it's ready. If no one else has met those needs maybe there is something you could dig in and provide to the community to fill the gap. Everyone had to start somewhere.

I do hope you're able to root, when you don't see any activity on your PC, does the firevt light even start flashing when it's plugged in? I'm still not sure what the issue is, but we didn't intentionally leave out steps to confuse people.
[Fire TV General] zeroepoch:
[MENTION=5862170]Don_Black[/MENTION], we are not offended don't worry. We just took this as an opportunity to share a little more detail about it's current status, some things being worked on, and maybe help you understand that it's currently a development process. We do understand that right now for novice users this might be unreachable, but as we receive feedback from users less technical than ourselves such as yourself we try to improve the process as we find time to do it. I think right now there is more momentum behind the root than we can keep up with. Many people are excited to try it and we don't always have the time to provide feedback or make the scripts more robust.

To other users following this thread please be patient. We are trying to make it easier and once things are changing less often we'll provide shorter and clearer documentation. With the holidays and family things get busy in addition to normal work.
[Fire TV General] fcisco13:
This is very encouraging and also very good news, im a noob when it comes to all this but i enjoy reading through stuff like this, thanks for your hard work and hope you can come up with something a bit more noob friendly.
[Fire TV General] Don_Black:
adbfire using usb mode shows device not connected

I think there is a port issue I do not believe my Imac is communicating with the Amazon Fire TV 2 I was fiddling around with adb fire on my Imac using usb mode and I opened up adb shell.

I got this message

Last login: Tue Dec 1 19:52:30 on ttys001

UCIT-STUDIOS-IMAC-3:~ UCIT-STUDIOS$ /Applications/adbFire.app/Contents/MacOS/adbfiles/console.sh ; exit;

error: device not found

logout

I also notice in ians instructions he says install python in usr/bin well my python exec is installed in usr/local/bin does this make a difference
[Fire TV General] zeroepoch:
I think from the python side everything is working if you get to the waiting for preloader. You need both python (of course) and pyserial installed to even get that far. Otherwise you would already have had an error and the script would exit right away. What are you are doing is a good test for debugging. Just get adb to work while it's running and then you'll at least know the device is connected to the mac. You have to enable it first in the settings menu under system > developer options I think.
[Fire TV General] Zacharybinx34:
I have a USB crossover cable, is that any different than a USB Male to male?
[Fire TV General] ultimate_spy_binns:
tested on 17 devices now. :)

for everybody else having issues, I have made a video tutorial, what should hopefully help a lot of you out.

http://xdaforums.com/fire-tv/general/tutorial-how-to-root-amazon-fire-tv-gen-t3261716
[Fire TV General] Zacharybinx34:
Hopefully this get's written clearer. I have no clue how to do this atm.
[Fire TV General] jzd5032:
Thank you for this tutorial. Worked flawlessly. And thank you zeroepoch!
[Fire TV General] Zacharybinx34:
Hey everyone,

I have a Belkin USB Transfer Cable. Is this different than a USB Male to Male cable?
[Fire TV General] Calibaan:
This is a so called Host-to-Host cable with an internal logic which emulates a network between both USB hosts.

The here described USB cable should be without any logic just mechanical 1-to-1 wired.
[Fire TV General] pilotbob3:
Just a word of thanks to zeroepoch. Worked perfectly first time. Very happy to have a rooted Fire TV 2!
[Fire TV General] Zacharybinx34:
So a USB Male to Male Transfer cable won't work?
[Fire TV General] tonyt3rry:
Is the software version needed for root the latest update I'm about to buy one today and not sure go turn it on as I want root to get Google play
[Fire TV General] Calibaan:
No, since those do no work without driver (there are mostly based on a Prolific chipset). You need just a plain direct connection without any additional electronic between both connectors.
[Fire TV General] Zacharybinx34:
Ok thanks.

One more question, what's the advantage of rooting over not rooting?

Thanks!
[Fire TV General] Calibaan:
In short: you will have more control over the system similiar like an administrator. For regular use there is no need for rooting. But if you have some special apps which need more system rights like AdBlockers or if you need something special like VPN which can not be done with the regular FireOS rights in that case you must have root.
[Fire TV General] zeroepoch:
The cable should be just straight wiring.
[Fire TV General] zeroepoch:
As of right now the latest version is the one we are rooting. We don't know if the next released version will be rootable or not.
[Fire TV General] tonyt3rry:
So its safe to say if I turn on my firetv tonight update then use the OTA disable adb command and then follow the root tutorial from that , I'm trying to find shops with male to male usbs so I can root and leave it as it is
[Fire TV General] zeroepoch:
You can't use the OTA disable command until you root. I'd suggest once you update it to 5.0.3.1 disable wireless and leave the ethernet port unplugged. Then root when you get a chance then disable updates. Once rooted with updates disabled then you can setup wireless again or plugin the ethernet cable.
[Fire TV General] tonyt3rry:
im just gonna leave it connected for now my cable should be here in the next few days i dont mind if i lose root ability
[Fire TV General] ImCoKeMaN:
Here's amazon's site that shows the latest version:

https://www.amazon.com/gp/help/customer/display.html?nodeId=201497590

Still 5.0.3.1 so far =)
[Fire TV General] apcarr:
thanks

Just posting a big thank you for the root method,I was able to do it with virtual machine on an old laptop,it took quite a while but it worked great,thanks
[Fire TV General] tonyt3rry:
Thanks bud fingers crossed its still the same Monday or Tuesday when my USB comes double fingers crossed it comes Saturday

Sent from my Amazon Fire 2015
[Fire TV General] donpr:
Worked excellent on linux mint 17.2, fresh install .downloaded mentioned packages. Thanks gentlemen
[Fire TV General] Patrick_445:
Success with Ubuntu Live USB

1) I used the instructions on YouTube to install Ubuntu Desktop 14.04.3 to a USB (search YouTube for "How to install Ubuntu 14.04 LTS on a USB drive"). About 2:20 into the video, you get to set the storage size of the Live OS. Although the video uses 2gb, I would recommend 3gb so you won't run into space constraints while following the steps below.

2) I then booted into Ubuntu (you can figure out how to boot from a USB key by googling either how to change boot order or how to enter the BIOS for your computer),

3) In the FireTV 2's settings, I went to Developer Options and turned ON all three options: ADB Debugging, USB Debugging, Apps from Unknown Sources

4) I connected my laptop to the FireTV with a USB Male-to-Male cable and on the laptop, started Terminal (command-line interface)

5) I entered one at a time, the commands from gitlab.com/zeroepoch/aftv2-tools/snippets/11117 (sorry, can't post links)

6) After running the command "adb reboot ; sudo ./handshake.py", the Terminal just showed "Waiting for preloader" while the FireTV rebooted all the way to the Amazon start screen, so I knew the handshake script had not been successful.

7) I just unplugged the FireTV and plugged it back in (devices are still connected via USB). This time, within a few seconds, Terminal showed "handshake complete!"

8) I then continued with the next command from the script: "sudo ./patch_mmc.sh 0x00000000058e0000 system.root.img system.diff". This does the actual patching and took 2hrs.

9) Finally I skipped the next 3 lines "echo", "echo" and "read" lines and entered the last 3 commands in order to disable updates.

10) I then unplugged the USB, unplugged and replugged the FireTV, and that's it!

Thanks to zeroepoch for getting the ball rolling on opening up this device, and for sharing his work openly with the rest of us!
[Fire TV General] BagiMT:
I have been modifying some system files yesterday and while things worked fine at the beginning for some reason I can't get write access to the system partition anymore.

mount -o remount,rw /system

fails and I am not able to write to /system. Is this a known issue? Any suggestions on how to get write access to /system again? Worst case I assume I could use the instructions in Post #1 to revert back to stock and start over again.
[Fire TV General] xokol2lvox:
Careful messing with those system files. Mine fails to boot. Currently on day 12 of full flash. I will update when that finishes and can report it still works. Meanwhile see if $500 laptop not burned out after 2 weeks constant running to repair a $70 tv box. Almost snagged another on black Friday since I was so wreckless with my first one.
[Fire TV General] zeroepoch:
I'm very interested in hearing if that works. I never tried it myself during testing because it obviously takes too long. What address is it currently at? You might be able to save a bit of time towards the end (stop it early) since the filesystem doesn't fill the entire partition. You can also resume the process in case something happens by using dd to trim the full image down (skip X from the start) and adjusting the start address.
[Fire TV General] boudicca99:
simples

works a treat. rooted and booted. It does take about 2 hrs 15ish, so lots of patience and leave it to get on with it. You need to reboot afterwards to do the ADB Shell and SU test as it looses connection once the patching is done.
[Fire TV General] epicroot:
rooted using ubuntu.. thanks mate
[Fire TV General] xokol2lvox:
Well now I feel like I've been lead down a rabbit hole. Lol. Just kidding. Happy to be a guinea pig. Well I was having the occasional Linux or pc crashing after couple days. I edited write mmc.py to loop through blocks and write only where it left off. I'm hoping this would write in correct position now second guessing my rusty coding skills. Ofcourse this was after first two fails over 4 days. I am currently at 3addcd000 or so. I actually have tried to boot it every time it has stopped. Last attempt was about half way point. Was thinking that file had good chance to have been written on first few hundred mb. Also kinda wondering if attempting to boot it changes anything to trash. I'll see what happens then try the way you suggested next. Have several first gens just trying to do nzbget setup on beefier fire to see how well it does. That's how I got stuck trying to bypass PIE SECURITY ON android 5.0. Google search lead me to replace linker with hacked version. Not sure if bad file or permission issue but hung up at booting logo after that. Not an expert on android by far, but have been successful with some on first gen, although recovery is a life saver.
[Fire TV General] finndo:
At step 8 following what you did, second attempt... First one fubar'd my linux mint 15 laptop froze about 45 minutes in, I freaked. Took my work laptop and booted from a Kali linux 2.0 live dvd , only had to install python3-serial and the android SDK.

Thankfully when I started the copy it said "already complete" a whole bunch of times and picked up where it left off.

First attempt from the mint laptop I had to start it with the following command, as I was getting "no permissions" from adb devices...

for I in {0..1};do ./handshake.py;done

Then I used the fire remote to go to the settings menu and select restart. As the script would end on reboot with a bunch of garbage and a message about a lost connection or disconnect. I'll try and update the verbiage tomorrow. I copied the output to a file on the mint laptop and saved it, so I can get it up here later.

Everything is still running now. Thanks for the great work!

FYI for those reading, ordered mine on black Friday, shipped with the correct firmware installed for this root process, shows an installed date of 11/23.

I also purchased a 7 port USB3 Amazon basics hub I intend on using with this fire TV. Will see how that works out. I might end up putting that on my desktop though...

Edit... Before anyone takes the time to say something, I know the fire TV is USB 2, bought it for 3 reasons, future proofing, usefulness not connected to the fire TV, power output to the ports, for running a USB laptop HDD.
[Fire TV General] zeroepoch:
If it wrote the new file to the same inode (meaning same location) you could get that from the original image using filefrag and that would give you an idea where it's located in terms of addresses. Once you get it to boot enough you could dd the original and start over. When I originally added resume support to write_mmc.py (similar to how you did) I forgot to skip over the bytes in the original file so it kept writing the first block of the file to the next 512 chunk it resumed on. Since the diff addresses or blocks to write is constant I just started over again. Seems to be working properly now because I believe I've heard one or two roots that had to resume and has success.
[Fire TV General] Ludacrisvp:
Just reboot the firetv then you should be able to remount system.
[Fire TV General] Patrick_445:
My Fire TV 2 is rooted. Been trying to follow the instructions from vpntips.com/fire-tv-vpn-install/. It requires installing the OpenVPN Installer app and the OpenVPN Settings app. I have not been successful. When running the Installer, I get the error:

mountPoint /dev/block/platform/mtk-msdc.0/by-name/system /system type ext4 [data=ordered, seclabel, noatime, ro, commit=1]
/system is mounted read-only
trying to remount read-write
executing 'su -c moun -o remount,rw /dev/block/platform/mtk-msdc.0/by-name/system /system'
exit code 0
/system is still mounted read-only
Aborting!

I attempted to mount /system as read-write from adb shell:

adb connect 192.168...
adb shell
su
mount

At this point the /system line looks like:

/dev/block/platform/mtk-msdc.0/by-name/system /system ext4 ro,seclabel,noatime,commit=1,data=ordered 0 0

To mount as read-write, I then execute:

mount -o remount,rw /system
mount

Now the /system line looks like:

/dev/block/platform/mtk-msdc.0/by-name/system /system ext4 rw,seclabel,noatime,commit=1,data=ordered 0 0

So /system appears to be read-write (note the ro became rw). Even so, the OpenVPN installer fails with the same error message. No idea what to do.
[Fire TV General] Patrick_445:
Rooting not required for VPN

Actually I just noticed that with the Fire TV 2015, you no longer need to root and install the openvpn binaries in order to use VPN. I was able to connect to a VPN using the latest (1.1.16) official OpenVPN Connect app, which does not require root. https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en
[Fire TV General] kayiman74:
success with ubuntu vm. My amzn tv gen 2 rooted
[Fire TV General] santamanga:
thanks a ton, zeroepoch! for figuring out the root process and also for providing the super-simple guide!

Still one question: what are the differences between those two processes? On aftvnews they suggested to disable autoupdate with:

pm disable com.amazon.dcp

...instead of pm disable com.amazon.device.software.ota ?

And is there a shell command like "pm status" to double-check if sth is running?

Thanks!
[Fire TV General] zeroepoch:
I think disabling com.amazon.dcp is for the previous fire TV. It doesn't seem to block the update check while disabling com.amazon.device.software.ota does.
[Fire TV General] finndo:
just in case anyone has the same issue, I'm going to post the output of what I did (following the steps I referenced above about 5 posts from here)

I keep (still) getting this on my laptop which is setup to build Android Roms

user@Mint17 ~/firetv-gen2 $ adb devices

List of devices attached

G070GV0654521AVE	no permissions

I haven't been able to find the code to add for amazon to get ADB to work without giving the permissions error (but oddly enough you don't even need to set it up on a fresh linux install...) So I performed the root operation from a live CD of Kali Linux 2.0. You simply have to run the following to get it going

apt-get update ; apt-get install -y python3-serial android-tools-adb

Then you can follow the instructions previously linked for the Ubuntu guide starting with the download section. As previously mentioned, my system "disconnected" on the reboot and missed the handshake. So I had to perform the command listed below to get past that (it auto restarts the handshake.py 1 time after it exits from the intial run) Everything else went fine. (in case you are wondering, I used /tmp to download the files and put the git clone, on the Kali live CD it started up with 7.1GB free on /tmp and the git clone AND download, plus the extracted files were 1.4GB so it fit fine.) If I was going to do this several times, I'd probably use an 8GB USB stick to run a bootable Kali image with persistence stored on the USB stick as well. You can pick up 8GB sticks for $3-$5 if you look hard enough (online in the USA).

The only other info I wanted to pass on, I have a functioning XBox 360 WIRED controller working via an Amazon Basics 7 port USB3 (powered) hub, works pretty good, I played Naught2 with it today, no issues; however I have not detected a key that is mapped to the "menu" key. Additionally I have an HP wireless mouse with USB dongle working as well. The mouse is part of the wireless wave combo pack http://www.amazon.com/Logitech-Wireless-Combo-Mk550-Keyboard/dp/B003VAHYNC

I bought at a Circuit City closing event sale for $30 many years ago. I'll try the KB tomorrow and post back if it works well.

user@Mint17 ~/VM/firetv-gen2/root/aftv2-tools $ adb reboot ; sudo ./handshake.py
error: device '(null)' not found
Waiting for preloader...
^CTraceback (most recent call last):
File "./handshake.py", line 85, in <module>
time.sleep(0.25)
KeyboardInterrupt
user@Mint17 ~/VM/firetv-gen2/root/aftv2-tools $ for i in {0..1} ;do sudo ./handshake.py; done
Waiting for preloader...
Found port = /dev/ttyACM0
Handshake complete!
user@Mint17 ~/VM/firetv-gen2/root/aftv2-tools $ sudo ./patch_mmc.sh 0x00000000058e0000 system.root.img system.diff
Patching patch_00000400.img...
512+0 records in
512+0 records out
512 bytes (512 B) copied, 0.0283822 s, 18.0 kB/s
Addr: 0x58e0400

Patching patch_00001000.img...
512+0 records in
512+0 records out
512 bytes (512 B) copied, 0.00108823 s, 470 kB/s
Addr: 0x58e1000

and so on...
[Fire TV General] ImCoKeMaN:
menu on android and fire os is the ctrl-esc combo right click key usually near the right ctrl key on the keyboard.
[Fire TV General] z_thompsonpa:
Worked Great

Worked flawlessly on Debian Stretch. Thanks!!!
[Fire TV General] Patrick_445:
Congrats! Did the patch itself take you 2 hours to complete? How come it takes so long?
[Fire TV General] finndo:
Mine took a little closer to 3 hours than 2. I think I fell asleep for a bit during the process, but I was awake when it finished :) It was still going at 2hr 10 min and it was a good bit longer after that before it finished. It could have simply been the method I used was not optimal, as the OS I was running was booted off a DVD.

The speed concern was addressed previously, either in this thread or another, but is directly related to the performance of the connection (internal fire components would be the limiter), I have been told that the quality of the USB cable could make a difference (making it worse, not better) as well. I opted for a 1 meter USB2 male to male cable from amazon, shipping estimate was really long, but I got it within 4 days.

http://smile.amazon.com/gp/product/B000BSJFFC
[Fire TV General] donpr:
VPN installer

Im also getting the r/w,r/o errors.Same as patrick a few posts back. Seems the install apk. will not write binaries, do not know why. . .
[Fire TV General] Lol.:
Mid patch now with Ubuntu live DVD via a VM (4 cores/4gb RAM) - will edit post with results. Thanks Zeroepoch :good:

Edit:

-1 hour in and I'm at 0x25bc7000 (not sure I'll be awake for the finish - hopefully this gives you some indication of it's progress in my environment.)

-2 hours in - 0x25d81800

-3 hours in - 0x25fd0800 - bed time.

-Just after I posted that, VMware crashed, got as far as 0x25fdd200. Rebooted device manually while running the handshake, nothing happened. Used the full abd reboot/handshake command again, continued where I left off (after skipping what's already been patched - this only took around 15 seconds.) Back on track again.
[Fire TV General] LookAlive:
3 hours in running Ubuntu 14.04 in VMware 2core 4g ram under Windows 10 64 bit on mid 2012 MacBook Pro i5. No halts or messes yet so doing good. At 0x25ee9000.

Anyone care to inform about how far along this is?

Feeling like I should have taken the 5 minutes to move it over to my i7 desktop.
[Fire TV General] Don_Black:
Root on its way currently patching

I want to give thanks to my new buddy, [MENTION=7078058]ultimate_spy_binns[/MENTION], you gave me the motivation to keep going. Well I want to appologize to [MENTION=3411776]zeroepoch[/MENTION], and [MENTION=394912]ImCoKeMaN[/MENTION], my issue was not your script it works fantastic, the problem was best buy is selling warning: USB Male to Male cables that have preinstalled software that does not allow AFTV2 to connect. So I found a real usb cord and I started the process on a old PC running windows 7 and I used the video ultimate had provided. I Believe the Ubuntu method would have worked but the PC was very outdated just would not get past the handshake step. So I unplugged and connected to my Monster of a IMac late 2014 edition, which I had downgraded to Mavericks, it connected and handshake worked and now it is patching. I will provide update once rooted. Thank you all for your help!