yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] chekamarue:
Hi guys ;

I hope u can help me

i tried to flash my phone thl w11 mtk 6589 using birda flashtool v1.7

the problem is when normally i should press download ! i pressed format whole flash sadly in the start of process the cable got disconnected from the pc :(

now the phone seem dead ! even when I connect the charger the red light doesn't even appear..! no boot nothing at all !

I tried to flash it again but no connection happen i can hear the connect sound with pc but nothing happen

also the the has a non-removable battery ...

please guys any one have idea how to fix it

ty
[General Questions and Answers] newgen2005:
I suspect my eMMC chip has failed as I have tried everything, it is stuck on download mode, and firmware update encountered a problem. Does anyone off a repair service for this type of thing?.
[Fire TV General] xenoglyph:
unzip the following files onto micro-sd card:

http://download.zeroepoch.com/aftv2/5.0.4/boot.img.gz

http://download.zeroepoch.com/aftv2/5.0.4/lk.img.gz

http://download.zeroepoch.com/aftv2/5.0.4/preloader.img.gz

http://download.zeroepoch.com/aftv2/5.0.4/recovery.img.gz

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

double check file hashes after transfer to micro-sd because micro-sd cards suck

open up an adb shell and run the following commands:

wait 10 minutes or so after last dd command to help ensure cached data is written, or better yet:

after you're all done with your 10 minute or so wait, or have run your backed up sync pull the power and restart your device.

this is only for brave people or experts right now.

1 reported brick so far, so I guess don't do this unless you're insane like me
[Fire TV General] Xedos9er:
Is this working via LAN ADB? Or better use USB ADB?

Can anybody confirm this process? Since my aftv is unrooted again, I have to root it first before I can try this.
[Fire TV General] xenoglyph:
i did it via ethernet. actually, part of the reason i attempted this method is because i left my usb a to a cable at a friend's house.

since you're not rooted though, i fail to see how this will be of any use to you....
[Fire TV General] santamanga:
Sounds like a funny wilde ride :)

What is the echo 0 and 1 for?
[Fire TV General] xenoglyph:
make the preloader writable, then set it back to read-only
[Fire TV General] Xedos9er:
My aftv is just in the rooting process ;)
[Fire TV General] rester555:
So this is using adb shell. Is this based on a Linux OS or Windows? I have rooted many android devices, but not the Amazon fire.
[Fire TV General] xenoglyph:
use whatever OS you like. use whatever adb connection you like. make the files available to your ftv2 however you like, but in that case make sure to modify the dd arguments appropriately. you can even use magic if you like. this is OS agnostic. if you can put files on a micro-sd card and open an adb shell to your rooted ftv2, you can do this.
[Fire TV General] :
I just did it on Windows 10 through cmd prompt. But, I currently have an issue to where after I unplugged the power, plugged it back in, it's not turning on.
[Fire TV General] xenoglyph:
did you let the last dd command finish? that's the big one and it takes a bit for it to write. i did it from win 10 as well, last command should look something like this:
[Fire TV General] :
Nope, the instructions didn't say "sync", "reboot" or "1s".

So now what? It's plugged in usb-usb on my laptop, I keep hearing it connect and disconnect every like 15 seconds.
[Fire TV General] xenoglyph:
"of=/dev/block/platform/mtk-msdc.0/by-name/system bs=1m" is the tail end of the last dd command, you can see the output that it should give you.

did you see that output?

if you're bricked you're probably looking at 2 weeks of writing a new system partition 512 bytes at a time. that's the only method i can think of right now :/

you would basically do the zeroepoch thing, but instead of patches you'd write the whole thing.
[Fire TV General] :
Yeah, I followed it. I entered that command, once it transferred, I unplugged the power and plugged it back in.

So, basically my 3 day old AFTV is bricked and might as well buy a new one?
[Fire TV General] xenoglyph:
edit: just read your description of the boot process

it might theoretically be a fairly quick fix if boot partition just needs repairing, for example. if you're interested i'll try putting together a diagnostic tool based on the existing python code being used for rooting right now. if you're willing to test and report back results let me know and i'll start working on it.
[Fire TV General] krawhitham:
Did you hash check the files after you copied them to the SD-card?
[Fire TV General] zeroepoch:
I added a sync after the dd to stock in my guide now so it has time to flush. Probably same applies here. BTW this exact procedure would be my best guess at how to do it using dd. I didn't even think about clearing dalvik but totally makes sense.
[Fire TV General] Xedos9er:
so is this method safe?? Atm I´m not sure if it´s worth it.

Don´t want to brick my device.
[Fire TV General] zeroepoch:
The theory behind it all makes sense and [MENTION=1822143]xenoglyph[/MENTION] has been able to do it himself successfully so there is some proof that it works. My best guess going from root to stock is that after dd finishes you need maybe 30sec to a minute if you run sync after for it to flush. Although that's between similar images. The sync command no longer works because it's been moved to a new location where with root to stock it's in the same location. You could try running sync first before starting the dd to maybe cache it but that's kind of risky as well. Better would be to copy the sync program to /data/local/tmp so you can run it after the dd is complete. That is likely my best guess why it's broken, it hasn't flushed yet. If that's true maybe using the full flash method would work better starting from the back going forward since the first part might be written already. Though I don't think I'll have time myself to add this option.

If you're willing to live fast and furious then in theory these commands should work and it changes all the necessary partitions. If you do, make sure you wait a few minutes after the system dd command finishes for it to flush to the device. Maybe even 10 minutes to be safe. A bit more explicit would be to backup the sync program to /data/local/tmp or run the busybox sync applet. I'd say if you don't understand what that means it's probably not for you. There is always the 2 week method to recover so the device is not a complete brick just very annoying to recover.
[Fire TV General] :
At this point I'll try anything to get the device working again. I can't even connect via adb she'll as it doesn't see the device anymore.

Yes

What is the 2 week method?
[Fire TV General] Liran Israel:
Help! i am not a linux expert!

Do i have to copy and paste all the commands in the Quote at once? (copy and paste of all block) or i have to copy and paste and run line after line (from the Quote) in my command terminal window?
[Fire TV General] :
It's one line at a time, you don't need Linux, it can be cmd prompt for Windows.

Just wait like 10mins after you complete the last line before unplugging the power from your device.
[Fire TV General] santamanga:
You have to run them one by one. But make sure a) you have the files in the right location and b)their md5sum is correct.

Also, if I understand right, you better first copy the sync bin from wherever it's located to a place on your sd card to be able to execute it after the last diskdump has finished. Better wait for updated instructions including that last step.

edit: I was a bit slow in answering...
[Fire TV General] Fruchttiger00x0:
I'm thinking about doing that Chuck Norris number here cause i might have a problem with my system partition: http://xdaforums.com/fire-tv/genera...cess-to-sd-t3274846/post64415830#post64415830

Do you think this would take the risk factor to a higher level or is the 'dd' just like the Texas Ranger. Should mean it would ignore the file system while dumping the stream.

Edit:

Forget my question, I just did it

After checking the hashes ... twice :)

I run all commands and pulled the plug after the last dump finished

So how long could it take to rebuild Caches?

I See the splash screen, led is busy and device was discovered at the network. But yes, already took about 20 minutes. Problem?
[Fire TV General] xenoglyph:
it actually has a screen w/ progress meter it'll show you when it's rebuilding cache, should take 10 minutes. if you've got network up tho that's a good sign.
[Fire TV General] Fruchttiger00x0:
iAfter 10 more minutes I refresh the routers client list. Of course I already knew that the ftv will magically disappear. Yes, you can raise the counter please, i'm number two:highfive:

But let's see what we can do, right?

I think I also figured out what goes wrong. I did not wait very long after the last dump as some of you already found out. So the system was not finished as I pulled the plug.

What are my options? Is there a chance to get a su shell for dumping the broken partition again or should I concentrate for the 2 weeks special?

edit:

I could established a connection to the preloader so i hope that someone could give me a hint for preparing a full image restore.
[Fire TV General] zeroepoch:
If you check the original root thread there is a post about it somewhere towards the beginning of the replies. The procedure is the same for both versions.
[Fire TV General] Patrick_445:
Where can we find the correct hashes to compare against?

Thanks for the suggestion [MENTION=3411776]zeroepoch[/MENTION]. Would someone with the know-how post instructions so that the OP can be improved? If [MENTION=1822143]xenoglyph[/MENTION]'s fast root can work reliably, it may become the preferred method for upgrading from one rooted version to the next until we have recovery.
[Fire TV General] Fruchttiger00x0:
[MENTION=3411776]zeroepoch[/MENTION]

Many THX

But is it the adb method ? Cause adb is not working at this point. Preloader is the responding service. It boots to recovery but this is the stock one and there it seems to be hanging. I see no single Option

Oh, think I found it right?

./write_mmc.py 0x00000000058e0000 system.orig.img
[Fire TV General] :
What is your AFTV2 doing? Mine doesn't even even show the white light on the device anymore, and I can hear it connect/disconnect every couple of seconds while plugged into my laptop.
[Fire TV General] Fruchttiger00x0:
I think the system partition at the end is the only one which is corupt since I shut down way to early after last step. So pre- and bootloader and also recovery seems to work. And that is what I just see. It boot up directly to stock recovery and there it hang. I also recognized that the USB Port shut down at recovery. Pretty strange

At which Point you screw up?
[Fire TV General] zeroepoch:
You can use write_mmc.py directly to flash the entire partition.

---------- Post added at 01:09 AM ---------- Previous post was at 01:04 AM ----------

https://gitlab.com/zeroepoch/aftv2-tools/blob/master/md5sums.txt
[Fire TV General] Fruchttiger00x0:
Great I'm glad to hear that :)

Last question, do I have to flash the stock image at the first place? I mean as I already could flash 4 of 5 partitions from 5.0.4 it maybe enough to write just the sys part.

And as I read you build in resume support. That's really cool thx. Did we have to set an Option or something?
[Fire TV General] :
Honestly I don't know. I entered the commands as shown, but had to add .gz to the file names. After the last command was completed I pulled the plug.

Now like I said the white light doesn't turn on the device and when plugged into the computer it connects and disconnects a couple of seconds later.

I don't think adb shell can even see it.
[Fire TV General] retyre:
The downloaded files are compressed. You should have gunzipped them and used the .img files to dd.
[Fire TV General] :
Could have sworn I did. I didn't know .gz is compression file extension.

Guess I'm screwed and out of an AFTV2.
[Fire TV General] aboshi:
Just call amazon and do an RMA, its still under warranty.
[Fire TV General] :
I can still return it since its in the 30 day window, but won't they test it and see I did something?
[Fire TV General] aboshi:
No they can care less...

They will take it back, plug it in and see it doesn't work. After that they will send it to texas more than likely and reflash it and give it to someone else as a refurb.
[Fire TV General] Patrick_445:
[MENTION=1822143]xenoglyph[/MENTION] would you put the hashes next to the file links in the OP or at least link to the page with all the hashes please?

A lot of people would make this mistake because the OP does not explain clearly that the files we download are not the same files that get put on the SD card. [MENTION=1822143]xenoglyph[/MENTION] consider explicitly stating that the files should be uncompressed (eg with 7zip or WinRAR 5+), and that it is the resulting uncompressed files that go on the SD card before the file hashes are checked.

PS. For Windows, some free hash checking utilities can be found at https://www.raymond.cc/blog/7-tools-verify-file-integrity-using-md5-sha1-hashes/. I've used #4 (MD5 & SHA-1 Checksum Utility) many times and it's easy and most importantly accurate
[Fire TV General] kayiman74:
is it possible to just extract the img file and drag them in their appropriate folder without using adb?

Thank you
[Fire TV General] Liran Israel:
i am using the Ubuntu on VMWARE on Windows - i used to root the 5.0.3 . before i start the update - how can i know it the path is correct?
[Fire TV General] zeroepoch:
If the preloader is corrupted there is no way to recover. During some initial testing I tried to modify various partitions to see which were protected. When I changed 1 bit in the preloader I couldn't recover. There is some sort of backup interface but I think the flash chip is maybe not setup or something because it didn't accept the commands. I had to just buy another one. I didn't try returning it because I had opened to the case so it was obvious something was done.

---------- Post added at 08:35 AM ---------- Previous post was at 08:31 AM ----------

I just thought of an idea to recover from a bad system flash that could be faster than 2 weeks. If you download both root images you can diff them and just flash those differences. I'm not sure how big that would be since I haven't tried it but it had to be less than the entire thing. If that doesn't make sense to you I'd recommend learning more how the process works before taking this upgrade risk or wait until improvements are made by [MENTION=1822143]xenoglyph[/MENTION].
[Fire TV General] Fruchttiger00x0:
I had the same idea but my restore is already running for some hours. Is there somebody who could test?
[Fire TV General] Liran Israel:
i got 5.0.4 on my fire tv, Thanks!!!
[Fire TV General] xenoglyph:
here's my idea: quick diagnostic check by checking first and last blocks of each partition with the emmc commands. any bad sections found could be sliced in half, have a block checked, etc. narrowing down bad regions intelligently and building a custom patch based on those addresses. slightly configurable to do a quick and dirty scan, or a more thorough one in in say 1mb or 4mb offsets. any discovered corruption could be narrowed down in size until diminishing returns in efficiency.

edit: i tore mine apart too, stuck some copper shims and better thermal paste between the cpu package and heatsink for the hell of it. you can't easily tell it's been opened though, you must've been eager =)
[Fire TV General] Liran Israel:
if i desable auto updates on 5.0.3 do i need to disable it again after this menual update to 5.0.4?
[Fire TV General] aboshi:
Hashes do not match.

Here are the hashes from the extracted .gz

MD5 (boot.img) = 4cc42c5a4ded1eb4d9529b2aede1dfb7
MD5 (lk.img) = f0b05f68cbcecb96722a4637eb06a8a0
MD5 (preloader.img) = 53649663ee0fa2f7c434b5acdbfddcda
MD5 (recovery.img) = 3aa70baba1bbb8b29f7d2fa7428e4e1e
MD5 (system.root.img) = 57bad37f08489b228ae71fc1246adb53

Here are the hashes that were posted a few posts back:

a3ad800f012a153953b403ef1fa36e14 EXPDB
50f24ce4c7ac388b33310bff6f79636a LOGO
59071590099d21dd439896592338bf95 MISC
f9b5ef697fde92c42bbbec35e5a6cad4 PRO_INFO
8a9d058f87711c2e8ccc698647f5026b TEE1
8a9d058f87711c2e8ccc698647f5026b TEE2
4cc42c5a4ded1eb4d9529b2aede1dfb7 boot
f0b05f68cbcecb96722a4637eb06a8a0 lk
3aa70baba1bbb8b29f7d2fa7428e4e1e recovery
3225e6eb05ed6202d92979dfb44ac7c9 system
53649663ee0fa2f7c434b5acdbfddcda preloader

As you can see system doesnt match up.

I will take the plunge once someone can confirm the correct hash for system 5.0.4
[Fire TV General] Patrick_445:
I have the same result as you. My MD5 of system.root.img for 5.0.4 is 57BAD37F08489B228AE71FC1246ADB53 which does not match what was posted. [MENTION=3411776]zeroepoch[/MENTION] would you double check your hash for this file please? Or would someone else who successfully upgraded using [MENTION=1822143]xenoglyph[/MENTION]'s method provide their MD5 hash for the extracted .img from http://download.zeroepoch.com/aftv2/5.0.4/system.root.img.gz ?
[Fire TV General] rbox:
What would be best is a statically linked busybox, and running sync from it. That should work better...
[Fire TV General] aboshi:
Hi [MENTION=3991724]rbox[/MENTION] ;)

Ok good news ;)

[MENTION=3991724]rbox[/MENTION] Yeah I should have def done things a bit differently to protect myself from a brick, but I was just taking a chance.

Nearly all basic commands will not work after you dd the system. No ls, dd, ./sync everything returned linking errors (as it should) so after about 15 mins I power cycled the box and its alive!

It started with the white amazon logo than the the normal colors behind the logo, and a few seconds later it came up with the optimizing storage screen.

A min later and poof the AFTV is back up and running. All in All it only took maybe 5 mins to use disk destroyer to do the update (if that long at all).

As for those of you muffing this up and bricking, if you have never worked in a linux environment this is a pretty dangerous method for you. You should at least have some basic understanding of the commands being used or you can kiss your AFTV goodbye.

I can make a a small tut simplified for people or maybe I should just write a small script to do everything for the end user.

I can really see a lot of bricks coming out of this method just because some people overlook little things such as unpacking the .gz files.

I cant stress enough to people that one slip up or typo with DD and its game over.
[Fire TV General] Patrick_445:
1) So you are rooted on 5.0.4?

2) You did not sync after the dd commands right? Just waited 15 mins and power-cycled?

3) Was this done over USB or over the network?

4) Did you execute it with the system.root.img whose hash did not match the reference or did you get another copy with matching hashes?
[Fire TV General] aboshi:
[MENTION=5075211]Patrick4[/MENTION]45

1. Yes I am on 5.0.4 now and rooted.

2. No I did not sync after all the dd, just waited 15 mins and than did hard power cycle

3. This was done over USB, I wouldn't test my luck with doing this over wifi (although I'm pretty sure you can if desperate)

The hashes for the files I used are:

MD5 (boot.img) = 4cc42c5a4ded1eb4d9529b2aede1dfb7
MD5 (lk.img) = f0b05f68cbcecb96722a4637eb06a8a0
MD5 (preloader.img) = 53649663ee0fa2f7c434b5acdbfddcda
MD5 (recovery.img) = 3aa70baba1bbb8b29f7d2fa7428e4e1e
MD5 (system.root.img) = 57bad37f08489b228ae71fc1246adb53

It is possible to make and interactive shell script for end users to do all of this, IE. Check image hashes, and than preform dd with interaction. All onc would have to do is make sure the images and scrip are in the same dir (root of micro sd)

I have to find some time to write one but I'm sure others can throw together a script real fast as its not really hard.

all it would have to do is:

Check paths, run md5 on all .img and make sure they match and echo it for the user to see. once approved say yes to start the process with a nice warning you can brick. Select Yes or No.

Once Yes selected start dd process. Echo when finished and make it say cycle the power in 15 mins.

after that you should be good to go with nothing for the end user to muff up ;)
[Fire TV General] Patrick_445:
A more hands-off script might even download the gz files and uncompress them, or ask the user to drag & drop the files (if available locally) to the command prompt (this will paste the path to the files) and press to enter.

After the dd operation, rather than tell the user to power-cycle in 15 minutes, I think a better script would echo "syncing. Please wait... 0%" with a hard-coded progress that lasts 15 minutes. Then echo "done! Power-cycle to complete" at the end. Otherwise, I think we would have a lot of bricks because most people don't read instructions that carefully.
[Fire TV General] aboshi:
I honestly don't believe you need to wait after the last dd. I'm pretty sure you can power cycle once it is all finished up because it is not syncing anyway due to linking being gone after the system dd is finished. So in fact no services/commands are running after the fact.
[Fire TV General] retyre:
Successfully moved from rooted 5.0.3.1 to rooted 5.0.4. Copied the .img files to /data/local/tmp and ran the disk dump from there. Also copied busybox to /data/local/tmp and created a link to sync in /data/local/tmp before beginning the dump.
[Fire TV General] zeroepoch:
The hash is for the original system image not the rooted one. I keep those there so I can track in the future what changes between releases. I can add a new checksum file into the directory with the images that anyone can quickly download.
[Fire TV General] rbox:
You most definitely need to wait after doing the dd. The data is all stuck in kernel buffers and will be written out to disk eventually. The 'sync' command just tells the kernel to force everything to disk immediately. In theory, using the dd conv option fsync would cause it to immediately flush, I don't know if the dd available has that option. Really, the safest way is NOT to do this... but the 2nd safest is to use a statically linked busybox and run it's sync command.
[Fire TV General] aboshi:
Yeah I'll be writing a script with little to no interaction with a staticly linked busybox. I just need to find some time between work, kids, and renovations. After I get the framework done I'll do some tests.
[Fire TV General] gen3benz:
I saw on the aftvnews site that 5.0.4 update allows sideloaded apps on the amazon home screen.

I tried looking but could not find a list of changes with the 5.0.4 update. Does anyone know where to find it?
[Fire TV General] zeroepoch:
I'm really curious if this worked (busybox sync) because my first quick approach of copying sync didn't (based on feedback), which makes sense now since the loader library and other dependencies were not in the right location anymore. That would seem like the "2nd" safest approach as [MENTION=3991724]rbox[/MENTION] said.

---------- Post added at 12:03 AM ---------- Previous post was at 12:01 AM ----------

I have added an md5sum file to both version directories now. It has the hashes for all image files, both rooted and stock. The 5.0.4 hash file is below:

http://download.zeroepoch.com/aftv2/5.0.4/MD5SUMS
[Fire TV General] :
I'm willing to try whatever I can to get my AFTV2 back before getting a replacement. If I knew the process, I'll start now. But, I don't know how since adb shell doesn't see the device even though I hear it connection. I'd just have to somehow stop it from automatically disconnecting and reconnecting.
[Fire TV General] Fruchttiger00x0:
This has nothing to do with adb shell, otherwise we don't have to wait so mich time for restore the complete partition. The preloader is right before the bootloader and adb init. This basic exploit is not comming over TCP network layer. It is a serial connection over USB with the MediaTek preloader API which is slow as hell cause it is not for writing big data streams. The clever idea of creating only the diff between a non rooted system and prerooted is the only reason for rooting so "quick"