yashsingh1/xdaforums huggingface dataset:
[Fire TV General] D-an-W:
This is what I did to build ADB on the Pi 2 which someone might find useful if they are carrying out the root procedure on one, please feel free to add it to the Wiki if you think it's relevant.

Makefile:

SRCS+= adb.c
SRCS+= adb_client.c
SRCS+= commandline.c
SRCS+= console.c
SRCS+= file_sync_client.c
SRCS+= fdevent.c
SRCS+= get_my_path_linux.c
SRCS+= services.c
SRCS+= sockets.c
SRCS+= transport.c
SRCS+= transport_local.c
SRCS+= transport_usb.c
SRCS+= usb_linux.c
SRCS+= usb_vendors.c
SRCS+= adb_auth_host.c

VPATH+= ../libcutils
SRCS+= socket_inaddr_any_server.c
SRCS+= socket_local_client.c
SRCS+= socket_local_server.c
SRCS+= socket_loopback_client.c
SRCS+= socket_loopback_server.c
SRCS+= socket_network_client.c
SRCS+= load_file.c

VPATH+= ../libzipfile
SRCS+= centraldir.c
SRCS+= zipfile.c

VPATH+= ../../../external/zlib/src
SRCS+= adler32.c
SRCS+= compress.c
SRCS+= crc32.c
SRCS+= deflate.c
SRCS+= infback.c
SRCS+= inffast.c
SRCS+= inflate.c
SRCS+= inftrees.c
SRCS+= trees.c
SRCS+= uncompr.c
SRCS+= zutil.c

CPPFLAGS+= -DADB_HOST=1
CPPFLAGS+= -DHAVE_FORKEXEC=1
CPPFLAGS+= -DHAVE_SYMLINKS
CPPFLAGS+= -DHAVE_TERMIO_H
CPPFLAGS+= -DHAVE_OFF64_T
CPPFLAGS+= -D_GNU_SOURCE
CPPFLAGS+= -D_XOPEN_SOURCE
CPPFLAGS+= -DWORKAROUND_BUG6558362
CPPFLAGS+= -I.
CPPFLAGS+= -I../include
CPPFLAGS+= -I../../../external/zlib

CFLAGS+= -O2 -g -Wall -Wno-unused-parameter
#LDFLAGS= -static
LIBS= -lrt -lpthread -lcrypto -lssl

TOOLCHAIN=
CC= $(TOOLCHAIN)gcc
LD= $(TOOLCHAIN)gcc

OBJS= $(SRCS:.c=.o)

all: adb

adb: $(OBJS)
$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)

clean:
rm -rf $(OBJS)

Got the info from the two links below and tweaked it a little...

http://xdaforums.com/showpost.php?p=55619695&postcount=70

http://torifuku.blogspot.co.uk/2015/08/raspberry-piandroidadbandroid-debug.html
[Fire TV General] Antaril:
Thx for this guide! I have rooted my ftv2 ;) and block the otas!!

btw

i used the oldest USB A to A cable i found here ;) no problems....
[Fire TV General] zeroepoch:
I put the guide up on the wiki here, https://gitlab.com/zeroepoch/aftv2-tools/wikis/adbrpi2. Also linked from the home page.
[Fire TV General] zeroepoch:
Made some updates.

I have added an ADB setup page now with a link to the kindle ADB drivers and also a link to this minimal download page you mentioned which looks well done. I also added info about needing a USB a-a cable and a page with a link of working cables. Check it out when you get a chance and let me know what you think.
[Fire TV General] Patrick_445:
Looks good. The updates make the wiki more helpful.
[Fire TV General] chu2tw6:
After I root my fire TV, kodi got some problem to access my NAS.

Before root, it goes all right, kodi can find my PC and NAS in workgroup in SMB.

Now kodi cant find any device from SMB even no workgroup.

But ES file explorer can access to my NAS normally.

Did I do something wrong?

Ps:Now it's all right.

I just restart all my device then everything goes normal.:D
[Fire TV General] rp201:
raspberryPi with raspbian wheezy still working 45min in.

I unblocked ota updates and went from 5.0.3.1 to 5.04.

I had a usb A-A cable that I knew was good cause I used it before on aftv1stgen. I attempted 5.04 script using winxp from laptop. no success. after powercycle I could hear usb at preloader connecting and disconnecting. I tried a desktop with winxp. no luck. I used same laptop with ubuntu and it got further to protocol error on the the external ssd/usb port. I got even further to a handshake error on the regular usb port. I had a raspberry pi2 running raspbian wheezy. said why not. installed python3-serial and extracted 5.04 and ran script, shot right off after powercycle with no hitches. made my last hour of trial and error and different machines regrettable but worth it that i did not give up. I do agree it seems like an incompatibility with laptops. fingers still crossed but i've heard great success so far so I'm feeling pretty confident. I definitely recommend any type of debian install on a non laptop.

update: worked great like I thought it would. Thanks to all. just needed to "adb shell" and "su" and then installed busybox.
[Fire TV General] briansparrish:
I managed to root my fire tv 5.0.3.1 a few weeks ago. I also blocked otas via the commands. Recently I noticed that my fire tv updated to 5.0.4, so I guess I did not manage to block updates successfully. My fire tv seems to be working fine but obviously I do not have root access anymore. Would it be safe for me to try the 5.0.4 root method? Has anyone else accidentally updated while having root access? Any side affects? Thanks.
[Fire TV General] Patrick_445:
A few people have reported successfully completing OTA updates from a rooted 5.0.3.1 to 5.0.4 and losing root in the process. They were then able to root 5.0.4 (example).

In all cases I've read about, the user had to first disable the OTA block. My guess is that your block was either disabled or never properly enabled.
[Fire TV General] rp201:
sorry but I tried the Makefile from these links and got an error. I went back to the original post of the makefile posted in this thread and it worked fine. not sure if it was a bad cut and paste or difference in the files. in the end It all worked great. thanks to both of you for your support. greatly appreciated.
[Fire TV General] zeroepoch:
It's most likely because the tabs near the bottom (used after a make target) come out as space in the rendered page. Looking at the source page it does have a tab inserted since it was copy/pasted from the post here on XDA.
[Fire TV General] briansparrish:
Thanks for the reply. I managed to successfully root it again. I also blocked updates again. Hopefully it will stick this time. :D
[Fire TV General] mikey6283:
Error Missing Version Check file

Hi,

I am rooting my Amazon Fire TV@2 5.0.4 , i have followed the instruction and i have the following error :

ast login: Thu Jan 7 13:53:15 on console

Mikes-iMac:~ mike$ /users/mike/Desktop/root-aftv2-5.0.4/root_aftv2.py

Waiting for preloader...

Found port = /dev/cu.usbmodem1410

Handshake complete!

Extracting build.prop...

ERROR: Missing version check file 'version.txt'

Mikes-iMac:~ mike$

Can you advise what i am doing wrong or a solution , Thanks in advance.
[Fire TV General] zeroepoch:
You need to run it from the unzipped directory.
[Fire TV General] mikey6283:
Error Missing Version Check file

Dear Sir

I am still getting the error see Terminal script and screen shot showing the unzipped file is there something missing or i am doing incorrectly

"Last login: Thu Jan 7 19:21:53 on ttys000

Mikes-iMac:~ mike$ /users/Mike/Desktop/root-aftv2-5.0.4/root_aftv2.py

Waiting for preloader...

Found port = /dev/cu.usbmodem1410

Handshake complete!

Extracting build.prop...

ERROR: Missing version check file 'version.txt'

Mikes-iMac:~ mike$

I look forward to your comments. I could send you a screen shot if you wish
[Fire TV General] Patrick_445:
[MENTION=7192888]mikey6283[/MENTION] The version.txt file should be in the same directory as root_aftv2.py when you begin rooting. Is it?
[Fire TV General] zeroepoch:
More than just that, your working directory should be the directory containing root-aftv2.py.
[Fire TV General] CuBz90:
Doesn't work for me. It's stuck on Waiting for Preloader.

I have this USB cable (which I paid £5 for and has now strangely been reduced to £1.48.

Does anyone know a way around this? I have tried at least 15 times with no luck.

Edit: turns out the drivers hadn't installed, I thought they had but I had to disable signed driver enforcement. Now rooted.
[Fire TV General] GoonerHamish:
I am also having the same problem regarding ERROR: Missing version check file 'version.txt'.
[Fire TV General] ImCoKeMaN:
To clarify what [MENTION=3411776]zeroepoch[/MENTION] is saying you have to "cd root-aftv2-5.0.4" to enter the folder and execute ./root_aftv2.py (to run from current directory)

If you are in a different working folder the version.txt file will not be in the same path
[Fire TV General] Carthagenian12:
Hello, i am new here i want to thank everyone here for the help provided to others and for sharing the knowledge

I have bought a fire tv 2nd generation but i already used it i think it updated now to 5.0.4 and i blocked the updatesthru my router

So in order to root it do i have to reset the AFTV to factory setting or is it too late now

And by any chance would someone write down the whole tutorial step by step

So we can understand the whole manipulation
[Fire TV General] zeroepoch:
You should be fine to root even though you updated. 5.0.4 is also supported. You don't need to factory reset either in order to root. Just look at the wiki link on the first post. If something seems unclear or you get stuck just message back here so we can help you out.
[Fire TV General] CuBz90:
I have Windows 10. I managed to get mine past the the "waiting for preloader" screen. It turns out that when installing the drivers I thought they were installing because I didn't read it to see that it was unsuccessful because it is not signed. I then disabled Signed Driver Enforcement. (following steps below) and then installed the drivers. After that it worked perfectly. I'm now rooted :)

Click the Start Start menu and select Settings.

Click Update and Security.

Click on Recovery.

Click Restart now under Advanced Startup.

Click Troubleshoot.

Click Advanced options.

Click Startup Settings.

Click on Restart.

On the Startup Settings screen press 7 or F7 to disable driver signature enforcement.
[Fire TV General] Carthagenian12:
So if iunderstood well even if my firetv is used and have some sideloaded apps thats ok

Would u correct me if there is an error in this step by step tuto

1 download 5.0.4 zip for windows and usb vcom drivers

2 install Usb Vcom drivers

3 Unzip 5.0.4 folder

4 plug the Usb A to A cable in PC and the AFTV

5 Run the bat file

6 Power cycle the AFTV

7 Let the patch work for about 2 hours till the congrats message

8 Power cycle again AFTV

9 plug Hdmi and use Adb shell with su commande to accept the root

Hope it is correct
[Fire TV General] KLit75:
Just bought one. Hoping to save a bit of time and not sort through this long thread. My computer of choice is my mac but i have linux and my wife has a decent windows 10 laptop. I know there are directions but did anyone here achieve root with mac? Any issues? Tips? Thanks
[Fire TV General] deanr1977:
Add this at the end of your steps don't forget to block updates after gaining root.
[Fire TV General] KLit75:
Maybe a dumb question but could an accidental key press on aftv remote screw things up during the process? Im thinking it might be in recovery so it won't matter but not too familiar with what its doing exactly.
[Fire TV General] CuBz90:
.No it shouldn't affect the rooting process.

I accidentally put my laptop to sleep half way through the process. Luckily it continued when I realised it was asleep 30 minutes later. Now rooted
[Fire TV General] KLit75:
Thanks. Should be done rooting any minute, started at 1237. And fyi-the remote wont mess it up. Waiting around for root i thought id make some backups from my gen 1 aftv. Accidentally picked up the new remote and wondered briefly why it wasnt working:confused:

So Im smart enough to know i may do some dumb things:eek:
[Fire TV General] zeroepoch:
That all looks correct and as [MENTION=3971688]deanr1977[/MENTION] said you should also disable updates.
[Fire TV General] GoonerHamish:
Another successful root here.
[Fire TV General] CuBz90:
Worked with this USB cable. Also available on prime (though a little more expensive)
[Fire TV General] mikey6283:
error Missing Verison Check

Hi Zeropoch and your self state that i should ensure that the root_aftv2.py should be on the same directory. This is not clear as to what to do. I have tried different combination with out success . May Mac is reading ok as you can see in the terminal information below

Mikes-iMac:~ mike$ /users/Mike/Desktop/root-aftv2-5.0.4/root_aftv2.py

Waiting for preloader...

Found port = /dev/cu.usbmodem1410

Handshake complete!

Extracting build.prop...

ERROR: Missing version check file 'version.txt'

If the root is not correct why doe it state handshake complete and state that it is extracting build but cannot find version check to carry on . If some one can simply how i should write the command i would be appreciate it as i hate to be beaten by this . I have the same problem in window 7.

Thanks
[Fire TV General] GoonerHamish:
I am new to this but you need to use the cd command to change the active directory.

So type cd followed by the path of the folder where all the files are located. Then once you have done that you can run the .py file.
[Fire TV General] ImCoKeMaN:
change your first command to the following 2 commands:

cd /users/Mike/Desktop/root-aftv2-5.0.4

./root_aftv2.py

if you print your working directory (pwd) it needs to end with the root-aftv2-5.0.4 to show you are in the proper working directory.

Also, how did you run this on windows by clicking the .bat file? did it give the same version.txt error or something else?
[Fire TV General] mikey6283:
Error Missing Version Check file

Dear sirs tried your suggestion by placing cd before , however this as you can see does not work for me , so i am not sure what the problems is .

Mikes-iMac:~ mike$ /users/Mike/Desktop/root-aftv2-5.0.4/root_aftv2.py

Waiting for preloader...

Found port = /dev/cu.usbmodem1420

Handshake complete!

Extracting build.prop...

ERROR: Missing version check file 'version.txt'

Mikes-iMac:~ mike$ cd./root_aftv2.py

-bash: cd./root_aftv2.py: No such file or directory

Mikes-iMac:~ mike$ cd/users/Mike/Desktop/root-aftv2-5.0.4/root_aftv2.py

-bash: cd/users/Mike/Desktop/root-aftv2-5.0.4/root_aftv2.py: No such file or directory

Mikes-iMac:~ mike$
[Fire TV General] deanr1977:
Try these tips? -

1. Maybe you have the wrong male to male A cable (the charging cable Not the data one? You need the data cable), try a different male to male A cable (maybe a friends cable?).

2. Did you check the drivers installed correctly? (Some have said the driver didn't notify that it didn't install?), try installing the driver again.

3. If using a Pc see if turning off your anti virus makes any difference? (Some users reported after turning it off The process worked straight away), try turning your anti virus/maleware off.

4. If using a laptop try installing on a main computer (some users Have had trouble getting it to work on a laptop), try installing on a PC, Mac or different system (maybe on a friends computer).

5. If all else fails read through the first page again/the wiki & any comments relating to problems installing again & double check every single text incase you mis-spelt a command!

Hope this helps & if so press that thanks button.

Happy rooting & a happy new yr
[Fire TV General] Patrick_445:
In what you posted, your first command (in bold) is

/users/Mike/Desktop/root-aftv2-5.0.4/root_aftv2.py

This is wrong because it runs root_aftv2.py from the context of another directory. The script fails because the script expects its directory to be the current directory.

What we're trying to explain is that before executing root_aftv2.py, you should first change directories so that the script's directory becomes the current directory. This is the purpose of the cd command. So as [MENTION=394912]ImCoKeMaN[/MENTION] said, your first two commands should be

cd /users/Mike/Desktop/root-aftv2-5.0.4
./root_aftv2.py

These should replace the command that I put in bold in the quote above. Once you see "waiting for preloader...", it's already too late to use the cd command.

The text before $ at the command prompt show the current directory. In your log, this is "~ mike". For the rooting script to work, it should be the path to the directory that contains root_aftv2.py. Something like "/users/Mike/Desktop/root-aftv2-5.0.4/root_aftv2.py"
[Fire TV General] ks-man:
I'm having trouble installing the driver. I'm on Win10 and disabled the signatures. It installed the driver but said some error that I don't remember and something like Couldn't Open. Now the driver is in my Ports (COM & LPT) but has a Yellow Triangle. If I double click on it it says under status "This device cannot start. (Code 10) The specified request is not a valid operation for the target device."

I also confirmed it doesn't work properly by connecting my computer to the AFTV and it sits on Waiting for Preloader. Any ideas what I did wrong? Thanks.
[Fire TV General] andret2:
worked like charm

Hi,

rooting an aftv2 on 5.0.4 worked fine using the ./root_aftv2.py script on Ubuntu (on an Dell Latitude E6230 laptop). Thank you so much for the work (btw. I like the concept).

A few notes which may help others:

I got an protocol mismatch error (and serial device gone error too) at first until I stopped ModemManager (it is an process common to Linux desktops which probes new serial devices to check if they might be an modem). The background is that it sends various commands (like "ATI") to the serial port which is unexpected by the aftv2 and script.

I was wondering if I got the right USB cable (never had a use for an A to A cable so wasn't sure if the adapter I had sitting around was any good for this). I confirmed this by enabling debugging (ADB on USB via developer options) and seeing the aftv2 turning up as usb device.

While experimenting I noticed that removing power from the aftv2 did not stop it (screen went dark but plugging power back in turned the display back on with the aftv2 alive where it had left off). It looks like the aftv2 used the usb power (I used the combined usb/storage port of the laptop which provides more current than an std. usb2 port). Therefore I had to remove the USB connection too to power cycle the aftv2.

Thank you again for the good work.
[Fire TV General] joncy92:
Uninstall that driver from device manager.

1. Plug in FireTV with USB and wait for it to load under "Other Devices"

2. Open the device and click "update driver"

3. Click Browse my computer for driver software

4. Click Let me pick.........

5. Click Have Disk

6. Browse to the drivers folder in the package

7. Open mdmcpq.inf

8. Select MediaTek PreLoader USB VCOM Port

9. Install that driver.

10. Unplug power from FireTV (Leave USB in)

11. Run the batch

12. Power on FireTV.

Let me know how it goes.
[Fire TV General] mikey6283:
Error Version Check BIG Thank You rooted by Mac

Big Thank You to all the guys who have had the patience with me whilst rooting my AFTV2. I finally was able to root my AFTV2 successfully today. My problems was that i was NOT on correct directory. As a novice i did not grasp the problems.

Thanks to : Zeroepoch

Ultimate_spy_binns

Patrick_445

ImCokeMan

Happy Man.
[Fire TV General] ks-man:
Thanks for the help. When I connect the Fire TV I don't see it in "Other Devices" Do you mean that I should see it through This PC or the Device Manager? I think my usb cable is the correct kind b/c if I turn on ADB over USB it shows up in the Devices and Drives. I didn't see any way to manually update the driver in that mode. This is the USB cable I got:

USB 3.0 A to A Cable

Please let me know if you have any thoughts. Thanks.
[Fire TV General] joncy92:
You may have some driver on your system that auto installed to fireTv. Open device manager and find fire TV in there ... I have no idea where to find it because I don't know what driver your computer has installed.

When you find it click update driver and go from there
[Fire TV General] ks-man:
This is so strange. I couldn't find anything in the device manager. I then tried connecting it to a new computer and watched to make sure nothing installed on the first time connecting it. Nothing did but I still see absolutely nothing in the device manager. Really baffled on this one...

---------- Post added at 09:46 AM ---------- Previous post was at 09:18 AM ----------

Figured I'd try this all on my MacBook instead of Windows. When I run the root_aftv2.py I get Permission Denied. How would I get past that to try and work this? Thanks.
[Fire TV General] joncy92:
Don't know about using it on a Mac. Can you see the fire TV in this PC? (Where you see you hard drives)?
[Fire TV General] ks-man:
Ok, so here is my update.

When I connect the Fire TV to my PC via USB it did not show it with the hard drives. I actually did find something in the device manager under Software Devices called "My Name's 3rd Fire TV" and "My Name's 4th Fire TV". I tried updating the driver via the method you posted earlier and when I choose the driver (mdmcpq.inf) it says "The folder you specified doesn't contain a compatible software driver for your device. If your folder contains a driver, make sure it is designed to work with Windows for x64 based systems."

I did also try the usb2ser_win764 driver after trying mdmcpq just to see and got the same message.

If I go to About in the Fire TV itself it says that the device name is the 4th Fire TV.
[Fire TV General] joncy92:
Hm mine just came up as fireTv.

Can u screenshot your device manager and show these "my names firetv".
[Fire TV General] ks-man:
Here you go
[Fire TV General] joncy92:
Is that your name you have blanked out? Have you ordered multiple fire TVs from amazon? They are pre-registered to you when you buy them.

Do 4th and 3rd fireTV both disappear when you unplug the USB?
[Fire TV General] ks-man:
Yes that is my name that I have blanked out. This is my third Fire TV but my first second generation fire. I never connected either of the other two to this computer. When I disconnected the Fire TV from the computer they did not disappear from the device manager. I believe they did when I turned on USB debugging but came back when I turned it off.
[Fire TV General] CuBz90:
It's just listing the devices detected over your network.
[Fire TV General] mikey6283:
Rooted AFTV2 Now have issues USB not working

Hi

Recently rooted AFTV2 , however i have a few issues. Unable to use USB with either wired or wireless mouse.

It only works for a few seconds when i boot up AFTV.

Also having problems with side apps not recognising Binary config ( Busy box is installed) .

Would installing the rooting solve any of these issues.
[Fire TV General] deanr1977:
Have you unchecked USB Debugging in settings? Which will give you access to your Usb port again?
[Fire TV General] mikey6283:
Rooted AFTV2 Now have issues USB not working

Your a star, thanks , why i didn't think of that.

Thanks aagin
[Fire TV General] deanr1977:
No worries matey