yashsingh1/xdaforums huggingface dataset:
[Fire TV General] zeroepoch:
No. It's MediaTek specific. It may work on most MediaTek devices though.
[Fire TV General] reiteravi:
how can u tell handshake is ok and start patching ?
[Fire TV General] zeroepoch:
It will print "Handshake Complete". Also the serial device will remain present rather than disappear after a few seconds.
[Fire TV General] RavenII:
I'm wondering if the binaries needed were replaced by older versions?
[Fire TV General] ultimate_spy_binns:
Thank you

Thank you, it worked great for me.

Tested inside of Windows 10 using a virtual machine operating system/Ubuntu

it seems to take a lot longer running it in a virtual machine but patience is a virtue I guess, I might make a video, to help other people out, because I got a second device what needs to be rooted.
[Fire TV General] lightning413:
I had not trouble with Mint 17.2 and am in no way an advanced user.

Here are my steps.

$sudo apt-get install python3-pip
$sudo pip3 install pyserial
$git clone [url]https://gitlab.com/zeroepoch/aftv2-tools.git[/url]
$cd aftv2-tools
$wget [url]http://download.zeroepoch.com/aftv2/5.0.3.1/system.root.img.gz[/url]
$wget [url]http://download.zeroepoch.com/aftv2/5.0.3.1/system.diff.gz[/url]
$gunzip system.root.img.gz
$gunzip system.diff.gz
$sudo adb reboot ; sudo ./handshake.py
$./patch_mmc.sh 0x00000000058e0000 system.root.img system.diff
$adb shell
$su
root#

Thanks zeroepoch!
[Fire TV General] fleisch80:
thanks

wonder why my mint 14 was giving errors with python,

i even tried uninstalling the pre installed one, and upgrading

anyway, thank you all for the help,

since im not that good in terminal, i didnt even know python maybee was giving errors.

feels good to have root, now i can pair my older game controllers

peace
[Fire TV General] jocala:
I did the same thing:

busybox: ELF 64-bit LSB executable, ARM aarch64, version 1
(SYSV), statically linked, for GNU/Linux 3.7.0, stripped

No joy. I always get some form of "Invalid argument". I even tried directly remounting the partition:

mount: mounting /dev/block/mmcblk0p13 on /system failed: Invalid argument

mount -o remount,rw / works with any mount binary. mount -o remount,rw /system fails will all mount binaries, even when the path (/system/bin, etc) is specified.
[Fire TV General] ImCoKeMaN:
Made some changes, posted a pastebin (1 week expiration so it can get cleaned up as we go)

http://pastebin.com/ZXD65WNR

[MENTION=3411776]zeroepoch[/MENTION] can you do similar for your Linux output and get me a second eye? I can run on Linux as well if needed too, but would definitely like an eye.

yes some is hardcoded, and I have the write portion rem'd on purpose before it's validated, but I think we can get this working.

Thanks stackoverflow for the serial loop in the win handshake script and to dd for windows to prevent needing Cygwin, or sending all patch files hehe.
[Fire TV General] zeroepoch:
I won't be able to get you the identical dryrun output until Monday possibly but looking over the stuff you pasted it looks generally right. Once this is all hashed out and tested you should do a pull request so we can add the bat files and new python files to the repo. We can include the dd binary as well to make it easier for others.
[Fire TV General] ImCoKeMaN:
Thanks, I will do some Linux VM stuff to help confirm for myself too, just don't want to be the cause of bricking ppls aftv2 when the fix is 2 weeks to reflash the whole thing =) I want to double check dec to hex stuff and that the tmp files are the same.
[Fire TV General] playingmax:
you guys are good!!!!

cant wait.
[Fire TV General] ImCoKeMaN:
I did a quick check on the VM to make me more comfortable with the dd and write command outputs matching, but if anyone has their patch_*.img files they'd like to zip and share from a successful root I'd love to double check em.

Edit: I did spot check of the img files as well from Linux, feeling more comfortable, but don't have the time to finish checking, editing up the write mmc python and running a test tonight. more to come =)
[Fire TV General] zeroepoch:
Busybox AArch64

I finally got sometime to upload my build of busybox for AArch64, which I'm using on my AFTV2. It's the latest version 1.24.1. It's just the default build, except for I enabled the option to build a static binary and enabled taskset. I used the linaro compiler (2014.09) because the NDK compiler didn't work for some reason and I didn't bother to figure out why. Anyone interested can download the binary from here.
[Fire TV General] jocala:
I re-rooted and my ability to mount system r/w came back. However, when I ran adbFire's install system tools routine, it left again. I've got a long weekend ahead :)
[Fire TV General] zeroepoch:
The pastebin link below has the output from running the script on Linux with the write_mmc.py line echo'd instead of executed. I guess by now you already have this output. I also added MD5SUM output as well so that should help you to know if the patch files are not only all there but the correct length and content. http://pastebin.com/C2f5eiZp
[Fire TV General] ImCoKeMaN:
MD5s match so dd and bash porting steps so far are good, will probably try some read tests before the write one and start small, but it's looking good.
[Fire TV General] zeroepoch:
Try reading the first 512 bytes from the boot partition (see partinfo.txt). It should start with the magic from the boot.img file which is "ANDROID!".
[Fire TV General] ImCoKeMaN:
I just did a read_mmc of the orig files instead of root image did a run with the stock image you had posted, read first matched, then tested a write with root patch, and did another read, checked md5s - success, seemed like patch worked, now I'm going for it... should have a better idea in a few hours =)

I have the modified files, but they aren't cleaned up to be bulletproof as you saw. I have handshake find newest port (well I guess highest number the way the loop is really working) and then I hard coded the other py files with com20 cuz I started getting more eager for results, cleanup can follow.

Is there anyone else that wants to run this from windows, but would be a happy beta tester even with some manual steps, and provide feedback like how com ports acted etc?
[Fire TV General] playingmax:
I would love to but have no idea where to start
[Fire TV General] ImCoKeMaN:
See PM for some early instructions.

Also, it worked, I had to install the adb drivers after since I wanted to do the pm disable via USB, should be able to connect via network too though.
[Fire TV General] indianguyinny24:
This is exciting. I want to know if Fire tv rooted would be perfect for my requirement. I plan to use this as audiophile audio streamer. It already have the most imp thing i want . A Ethernet port to connect to network (cant use wifi) , and USB port (if possible to audio output from it). Things i am not sure is and reason for asking help here is following.

- Can the USB port can be used to output Audio that would be connected to a DAC.

- Also can we switch audio from USB to HDMI ( case when i want to use FTV2 for watching movies)

- IS there a remote app that is available so that i dont have to turn on the TV for selecting songs.

- Once rooted i should be able to install any app , specifically USB Audio Player PRO.

Thanks

V
[Fire TV General] bula1ca:
I would give it a try if you can give me same instructions.
[Fire TV General] ImCoKeMaN:
I'm really not sure about the usb DAC, but you can sideload apks without root. Actually I think there were some raspberry pi ideas that do about what you're looking for and those are cheaper devices, but different primary purpose - no Netflix, etc.

https://volumio.org/raspberry-pi-i2s-dac-sounds-so-good/
[Fire TV General] ImCoKeMaN:
attached are the slightly updated instructions, I'll send you the files too.

My insructions didn't include getting the files, so heres another pre step:

Get the images and save them to a working folder (aftv2-tools seems like a good name):

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

http://download.zeroepoch.com/aftv2/5.0.3.1/system.diff.gz

(I use 7zip to unzip the .gz files in windows: http://www.7-zip.org/ )

Also, if you want the full aftv2 tools from zeroepoch you can get them from windows too, that's what I used to do the porting:

to get the tools via windows machine:

https://gitlab.com/zeroepoch/aftv2-tools

click download, extract zip to folder aftv2-tools
[Fire TV General] indianguyinny24:
The problem with those is the USB share the same bus with the ethernet. So you are very limited to it. Also some people have done some testing and found android with USB audio power apk sounds much much better then the raspberry pi. i am more on audiophile side , so for me if i can get this device working that would solve most of what i am looking for.

Thanks

V
[Fire TV General] bula1ca:
Fallowed all steps in readme, installed Android_Gadget_CDC_driver.inf, rebooted and run handshake_win.py, script will only return [ ] and will not find a port . It may be a problem with my cable, I will try again tomorrow once I get a new cable.
[Fire TV General] wildchild22:
If you could send along the files I will give it a try as well.
[Fire TV General] andrew942:
success

Thanks zeroepoch!

Worked like a charm. Waited on a windows solution, but had to get it done as was taking my aftv2 to somewhere I don't have control of the update through the router, so figured, time to try.

Worked easily based on your instructions. Had a kodibuntu machine sitting around. Had to install some stuff (serial stuff), but was easy enough for a guy who uses ubuntu a couple times a year. I took way longer than 2 hours for the patch though. Mine took 3+ hours! May have been that my ftv wasn't pristine. I had all sorts of stuff installed and loads moved to the sdcard.

I suggest making your ftv pristine like in the instructions. Added loads extra time on mine I believe.

*high five*
[Fire TV General] ImCoKeMaN:
Ok, I made some changes to the files and instructions and to make steps a little more clear thanks [MENTION=6169935]bula1ca[/MENTION] for your testing so far.

The files are attached with the updated instructions in the readme. Please test, give feedback, ask questions etc.

It's still an early release and the obligatory "I'm not responsible for bricked devices" warning applies, but the tests I've done so far seem to be good at only failing in a very safe manner.

I even included a bat file that doesn't write to serial for those that want to take an extra validation step first - when it's done you should have the patch*.img files if everything was in the right folder.

=)

Edit: removed AFTV2rootwinTEST1.zip as it does not include the checkver.py step required once 5.0.4 rolls out.
[Fire TV General] ImCoKeMaN:
That post on the pi didn't use a USB DAC though it was a different process. Not saying that's what you need just sharing the info. I don't have a USB DAC to do the testing for the firetv, but someone else may, not really root related though so it might be good to post in the questions forum.

The /system partition would already have been pristine so there shouldn't be any need to do any changes to the firetv. It could have been something on the PC, or usb/serial IO, but at any rate, congrats to another rooted fireTV.

Hopefully we'll keep getting more and some devs will make awesome tools.
[Fire TV General] T0m93:
Hey, did any way try Stickmount with the Exfat Plug in?
[Fire TV General] wildchild22:
Thanks so much

The only issue I had is I use win10 64bit. I had to get the 64 bit driver from thebroodle and run the exe. As the one provided would not install on windows 10 64 bit.
[Fire TV General] jocala:
With adbFire 2.01, mounting a single powered drive works for formats: ext4,vfat,exFat and hpfs+ -- this was plugged directly into the usb port. The dock I've got handy (amazon basics 3.0, powered) isn't recognized.
[Fire TV General] T0m93:
Ok I have a 3TB Exfat drive with an external Powersuppy and it is not working. Ok is shows up (usbotg) but i only can see the lost.dir folder not any Data. Any Ideas?
[Fire TV General] jocala:
Post in the adbFire thread, if you don't mind.
[Fire TV General] imagica71:
Any information would be appreciated... :o
[Fire TV General] playingmax:
com port not showing up when running handshake_win.py

Ill get a new a-a usp cable tomorrow and run again.

also should my com port show up like this?

[IMG="com port"]http://img.photobucket.com/albums/v647/bonomax1itpics/comport_zpsdy5wbazb.jpg[/IMG]
[Fire TV General] bula1ca:
Try this:

Power aftv2 up go to settings\System\Developer Options and select all options to ON, unplug unit.

Connect Firetv to computer, power it up and let it be recognized by windows (windows will install its driver), check to see

if it shows up in My Computer\This PC if so power it off
[Fire TV General] playingmax:
I'm sorry but when u say power it on do u want me to give the fire tv power as it's plugged to pc?
[Fire TV General] ImCoKeMaN:
Yes USB first. Start handshake then power device. USB chimes in first 5 seconds of boot.
[Fire TV General] bula1ca:
Upadated Windows Rooting Readme

edited
[Fire TV General] ImCoKeMaN:
Actually we may both need to take down the zips after a little more tweaking. I updated the scripts some since the zip I posted, and worked with zeroepoch to have it included in the git repository.

I haven't updated the readme but here are the tweaks I made to the _win.py and bat scripts last night (available in zeroepoch's aftv2-tools now)

Improved com port detection - it now will find the new com port as the firetv boots even if it's not the highest numbered port listed.

Implemented a parameter file to save the com port information. You now don't have to edit write_mmc_win.py manually as the handshake_win.py file saves the port info for you.

Future improvement opportunities:

py2exe - if we make these exe files you won't need to install python

combine py scripts so that they are platform independent - my win com detection edit can easily be merged to a single file that will work on mac and Linux too, but I'll admit I wasn't focused on that for the first run =)

GUI? probably not me, but could be added to other tools perhaps
[Fire TV General] bula1ca:
I will take them down.
[Fire TV General] ImCoKeMaN:
if you still have the screenshots I'm sure most of it will still be helpful additions to the readme.
[Fire TV General] playingmax:
so I should not use the files you PM me? just use the ones from

http://xdaforums.com/showpost.php?p=63946739&postcount=202 ??
[Fire TV General] ImCoKeMaN:
Sorry for any confusion while this is in process... Nothing is dangerous, we're just making iterative improvements to the process. The pmed ones will work, the zip in the post 202 will also work (very similar, just a few tweaks) and the ones in the aftv2-tools folder will work too (so far need to get DD for win manually).

Basically if you want to do it right now by following step by step instructions use the zip. If you want to try a newer possibly simpler way, that has less details use the git. "soon" git will be the answer and you'll know when zeroepoch has windows listed in the OP the "final" method.
[Fire TV General] bula1ca:
I do. I will send them to you tomorrow morning.
[Fire TV General] playingmax:
Thank to all involved!! U guys r good!!!!!
[Fire TV General] AFTVnews.com:
[MENTION=5630334]ians325[/MENTION] and [MENTION=394912]ImCoKeMaN[/MENTION] , please enable your donation buttons through XDA's settings. I'll be writing Mac and Windows rooting guides based on your instructions very soon and I'd like to link directly to your PayPal donation pages from the guides.
[Fire TV General] ImCoKeMaN:
you didn't use my zip right? you'll need to manually copy dd for windows to the aftv2-tools folder then.

I didn't make that so I didn't add it to the git, but I'm thinking for ease of use we'll have to put it in there its GPL. Anyway, you can get it here and extract:

http://www.chrysocome.net/downloads/dd-0.6beta3.zip
[Fire TV General] zeroepoch:
[MENTION=394912]ImCoKeMaN[/MENTION] had mentioned a few Windows specific pieces which I think we'll put into a windows directory in the repo. I guess we'll then just need to make a minor adjustment to the batch file.
[Fire TV General] ImCoKeMaN:
oops, I just pushed dd to master, didn't know you were online. At any rate this issue should happen again, and next merge if it has a win folder will have an edited .bat file too.
[Fire TV General] playingmax:
Thanks!! looks like its patching. i had to leave fire tv plugged to power. I will report back in 2 or so hours

---------- Post added at 04:23 AM ---------- Previous post was at 04:19 AM ----------

this is what its doing so far.

[IMG="rooting"]http://img.photobucket.com/albums/v647/bonomax1itpics/firetv2_zpspnnkgilo.jpg[/IMG]
[Fire TV General] bula1ca:
That is correct , you should get a Done! Press any key to continue as soon as all patched.

Then follow these steps:

If you want to do the adb steps to disable updates using the a-a cable you can install the kindle drivers manually: http://xdaforums.com/showthread.php?t=2544410

Otherwise disconnect unit from power and usb cable and go to step below step:

Run adb via the network if you have that connected

1) connect unit to TV via HDMI and power unit on

2) connect to network

3) run ADB

Type adb shell

Enter

Type su

Enter

4) Now on Amazon Fire TV Screen Super User Notice will display and you need to accept it

5) run: pm disable com.amazon.device.software.ota

enter
[Fire TV General] playingmax:
after 8 hours still showing this

C:\Users\Morris\Desktop\aftv2-tools>
C:\Users\Morris\Desktop\aftv2-tools>handshake_win.py
[]
[]
[]
[]
[]
[]
[]
[]
[]
['COM19']
['COM19']
1: 0xa0
1: 0x52
1: 0xa0
1: 0x5f
1: 0xa
1: 0xf5
1: 0x50
1: 0xaf
1: 0x5
1: 0xfa
Handshake Complete! used port: COM19

C:\Users\Morris\Desktop\aftv2-tools>patch_mmc_win.bat
Patching patch_400.img...
rawwrite dd for windows version 0.6beta3.
Written by John Newbigin <jn@it.swin.edu.au>
This program is covered by terms of the GPL Version 2.

skip to 1024
512+0 records in
512+0 records out
Addr: 0x58e0400

Patching patch_1000.img...
rawwrite dd for windows version 0.6beta3.
Written by John Newbigin <jn@it.swin.edu.au>
This program is covered by terms of the GPL Version 2.

skip to 4096
512+0 records in
512+0 records out
Addr: 0x58e1000

Patching patch_52000.img...
rawwrite dd for windows version 0.6beta3.
Written by John Newbigin <jn@it.swin.edu.au>
This program is covered by terms of the GPL Version 2.

skip to 335872
512+0 records in
512+0 records out
Addr: 0x5932000
[Fire TV General] bula1ca:
You suppose to close handshake_win.py script once you determined what port was used. You are running two scripts at the same time and this slows down the whole process, close handshake_win.py window and let the other one run (post an image again please). The longest I heard it took was 3 hours ...for me was 2 hours tops, what you are doing now is trying to determine a post sending commends to it as well as sending commends to write to the mmc using the same port......
[Fire TV General] playingmax:
Thank you. I will try again later on 2day. And report back
[Fire TV General] ImCoKeMaN:
It looks odd that it would stop that far in, did you edit the write_mmc_win.py to com19?

It's looking like I might need to do some more validation of the git scripts changes if you continue to have issues. I'm thinking the port detection I tried to put in might not have merged correctly. It's safe to use the TEST1.zip though if you continue to have issues and just make that edit above for the com port.

EDIT: Just updated the git again, looks like I missed the com port change in the write script so your above log was probably trying com20. If you redownload it from git it should work now without having to modify the scripts. Thanks for showing the log
[Fire TV General] playingmax:
yes I edit write_mmc_win.py to com19. and saved. I will redownload ur file and try again once I get home from work. and will be reporting back. Thank you guys for all the help!!!!
[Fire TV General] ImCoKeMaN:
is the firetv still plugged in, and showing in device manager? it's looking like it can't find com19 anymore. Thanks for hanging in there on this, once we find the cause I'll be happy to update the scripts to catch whatever is going on.
[Fire TV General] playingmax:
i reset the firetv and now its writing.

[IMG="rooting"]http://img.photobucket.com/albums/v647/bonomax1itpics/2_zpsjrympcd4.jpg[/IMG]

will report in 2+ hours..

---------- Post added at 08:41 PM ---------- Previous post was at 08:28 PM ----------

after 30 mins its still at Addr: 0x1d520600 is that a sign?
[Fire TV General] ImCoKeMaN:
do you still see com19 in device manager? I'm wondering if something weird is going on with your serial connection/com port, drivers etc.

anything else going on with your PC? did you happen to reboot when you reset the firetv? try another usb port?
[Fire TV General] playingmax:
yes port 19 is still showing up on pc. did not reboot. should I.

and here is a screenshot

[IMG="screenshot"]http://img.photobucket.com/albums/v647/bonomax1itpics/erd_zps7hlxzcip.jpg[/IMG]
[Fire TV General] zeroepoch:
I'd try rebooting both your PC and the device and try again. Sometimes with repeated attempts or other experiments in between things get messed up with the serial port state.
[Fire TV General] ImCoKeMaN:
Ok, so here's a quick way to "continue"

copy changed.txt to changed_cont.txt

copy patch_mmc_win.bat to patch_mmc_win_cont.bat

Make the following edit in patch_mmc_win_cont.bat:

Change: for /f "tokens=1,2" %%A in (changed.txt) do call :subroutine %%A %%B

to: for /f "tokens=1,2" %%A in (changed_cont.txt) do call :subroutine %%A %%B

Now you'll have to edit changed_cont.txt to remove the img files you already wrote successfully. Using the above log, don't pick the last one, but the second to last was fully complete so we'll remove everything up to and including patch_17c88000.img which is the line:

0x17c88000 2048

Your changed_cont.txt should look like this:

0x17c89000 275456
0x17ccca00 2048
0x17ccd600 5120
0x17cd0000 30208
0x17cd8000 270336
0x17d1ac00 3584
0x17d1c000 18432
0x1dbe7a00 512
0x20000000 512
0x20001000 5120
0x201e6000 512
0x201e7000 512
0x201e8000 82944
0x201fc600 3072
0x20200000 2048
0x20201000 11264
0x20203e00 9728
0x20206600 21504
0x20219e00 12288
0x2021d800 182272
0x2024a400 273920
0x2028dc00 167424
0x202b7800 23040
0x202be000 339456
0x20319200 47104
0x20326e00 344576
0x2037b200 305664
0x203c6400 297472
0x2040f200 115712
0x2042c200 1536
0x2042f600 512
0x20430600 84480
0x20445200 3072
0x20448c00 59904
0x20457e00 2048
0x2045b400 100352
0x2047c800 1024
0x2047fa00 15872
0x20483e00 88064
0x2049a200 1024
0x2049d400 85504
0x204b2c00 3072
0x204b6600 220672
0x204ef200 512
0x204f0200 50688
0x204fcc00 29184
0x20504000 29184
0x2050b800 41472
0x2051ce00 45568
0x20528600 59904
0x20537400 2537472
0x48237000 512
0x48238000 512
0x48239400 512
0x4823a000 512
0x4823b000 512
0x4823c000 3072
0x4823d000 1024
0x4823e000 512
0x4823f000 512
0x48240000 512
0x48241000 4608
0x48242600 512
0x48242a00 2048
0x48244000 7680
0x48246000 8704
0x48249000 512
0x4824a000 512
0x4824b000 512
0x4824c000 512
0x4824d000 1024
0x4824e000 4608
0x48250000 512
0x48251000 512
0x48252000 1536
0x48253000 4608
0x48255000 7168
0x48257000 512
0x48258000 512
0x48259000 512
0x48259600 512
0x48259a00 2560
0x4825b000 512
0x4825c000 512
0x4825d000 1024
0x4825e000 512
0x4825f000 512
0x48260000 3072
0x48261000 6144
0x48263000 7680
0x48265400 512
0x48266000 4608
0x48268000 512
0x48268600 512
0x48268a00 6144
0x4826b000 512
0x4826c000 512
0x4826d000 512
0x4826e000 1024
0x4826f000 7168
0x48271000 512
0x48272000 512
0x48273000 3072
0x48274000 5120
0x48276000 512
0x48277000 512
0x48278000 8704
0x4827b000 512
0x4827c000 512
0x4827d000 512
0x4951f000 512
0x49521000 1024
0x4ac89000 512
0x4ac89400 512
0x4ac89c00 512
0x4b4ee400 1024

Looking at how much is done though it doesn't look like a very stable setup for this. Is it a laptop? could it be a power settings thing? disable sleep for a while?

still trying to figure out what it may be.