Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,733,198 Members 41,248 Now Online
XDA Developers Android and Mobile Development Forum

FixFlash - Flash Verify and Repair Tool by SavvyX4 (Updated 9/9/10)

Tip us?
 
SavvyX4
Old
(Last edited by SavvyX4; 9th September 2010 at 10:45 PM.) Reason: Info on Update
#1  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2010
Default FixFlash - Flash Verify and Repair Tool by SavvyX4 (Updated 9/9/10)

FixFlash - Flash Verify and Repair Tool by SavvyX4

I was always running into problems getting my Hero CDMA to boot custom ROMs. After eventually getting frustrated enough with what seemed like inexplicable errors, I finally determined that on my phone, I would occasionally end up with corrupt files after the flash process was done. If I was lucky, it would be an unimportant file or two that would end up corrupt, but sometimes it would be a critical framework, which is why I was having trouble booting.

Enter FixFlash, a shell script that runs on the phone after flashing a new ROM image from recovery. FixFlash will verify the integrity of the files copied to the phone during the flash process and in the event of a problem, automatically make a fresh copy of the corrupt file in an effort to resolve the problem.

I developed this tool because of my own problems, but I think that I may be able to help some other people who's phones are giving them them same sorts of problems that mine does me. I am open to any suggestions on improvements, and welcome any feedback!

FixFlash is very easy to use, and only requires that you do the following:

1. Copy FixFlash.sh to the root of your sdcard
2. Extract the zip of the ROM you want to flash to your phone on your computer. This is necessary for the verification process.
3. Copy both the original .zip file and the extracted folder of the .zip to the root of your sdcard
4. Boot into recovery and follow your normal flash procedure.
5. Once the flash has finished, but before doing anything else in Recovery, run this command from your computer's terminal/command prompt:

adb shell sh /sdcard/FixFlash.sh

You should see output in your terminal/command prompt indicating if there were any corrupted files encountered, and whether or not they were repaired. The whole process is fairly quick, and should only take a minute or so, depending on your sdcard speed.
6. Reboot your phone and enjoy!

At this point you can remove the extracted copy of the zip from your sdcard, its job is done!

** Updated Script available ** Download from link below and replace existing copies with that file to update.
Sep 9 2010 - 1.1 - Fixed problem with files like AVRCP.kl showing as bad because of case change of filename between phone and zip


More information (including full changelog) is available here:
http://notepad.cc/fixflash

Direct Download Link:
http://db.tt/GPssIoe

If you have any problems with FixFlash PLEASE post your recovery.log to PasteBin along with a description of the issue so that I may look into whatever is causing the problem. Thanks!
 
x99percent
Old
#2  
Senior Member
Thanks Meter 113
Posts: 356
Join Date: Dec 2007
Location: Detroit

 
DONATE TO ME
Quote:
Originally Posted by SavvyX4 View Post
I was always running into problems getting my Hero CDMA to boot custom ROMs.
I have always wondered what people might be doing wrong, because I have *never* had an issue booting a known good ROM.

Perhaps the internet connection or SD card is to blame?
 
mrinehart93
Old
#3  
mrinehart93's Avatar
Senior Member
Thanks Meter 299
Posts: 1,823
Join Date: Oct 2009
Location: Chicago

 
DONATE TO ME
Hmm, this is a very good idea. Maybe it will be incorporated into future CyanogenMOD builds?
Want news/reviews/tutorials on technology? Visit my website http://www.techneektv.com
CyanogenMod for the Moto Photon 4G
My GitHub: GitHub
 
SavvyX4
Old
#4  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2010
Quote:
Originally Posted by x99percent View Post
I have always wondered what people might be doing wrong, because I have *never* had an issue booting a known good ROM.

Perhaps the internet connection or SD card is to blame?
I always verify hashes on downloaded ROMs, and as the files are extracted to the sdcard they are verified by Recovery. The problem is that they aren't verified after they are copied to the phone's internal storage, which is where with my phone I'm seeing corruption. I have been dealing with this problem for a long time, and tried numerous different combinations before finally catching a break with a flash that corrupted one of the frameworks that gets called immediately when booting. that narrowed down the number of files to check manually and once I found a bad hash on my phone's internal storage, I knew for sure what was wrong and set about automating a workaround.
 
x99percent
Old
#5  
Senior Member
Thanks Meter 113
Posts: 356
Join Date: Dec 2007
Location: Detroit

 
DONATE TO ME
Quote:
Originally Posted by SavvyX4 View Post
... once I found a bad hash on my phone's internal storage, I knew for sure what was wrong and set about automating a workaround.
Is it fair to say that, in your case, this workaround is a software fix for a hardware problem?
 
SavvyX4
Old
#6  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2010
Quote:
Originally Posted by x99percent View Post
Is it fair to say that, in your case, this workaround is a software fix for a hardware problem?
I would agree, this would certainly qualify as a software fix for a hardware problem.

Sent from my HERO200 using XDA App
 
Sparticuz
Old
#7  
Member
Thanks Meter 18
Posts: 93
Join Date: Sep 2007
Location: Tampa, FL

 
DONATE TO ME
Quote:
Originally Posted by mrinehart93 View Post
Hmm, this is a very good idea. Maybe it will be incorporated into future CyanogenMOD builds?
Even better, this should be incorporated into Clockwork & Amon RA!
 
SavvyX4
Old
#8  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2010
I would agree, having the recovery automatically verify the flashed files in a similar manner to what I've done with this script would be ideal. Even though I believe that FixFlash is easy to use, not having to do anything other than a normal flash would be easier and possibly save people who may not be aware of a lurking issue with their phones a lot of grief.

Sent from my HERO200 using XDA App
 
mrinehart93
Old
#9  
mrinehart93's Avatar
Senior Member
Thanks Meter 299
Posts: 1,823
Join Date: Oct 2009
Location: Chicago

 
DONATE TO ME
Savvy, you should contact Koush and have him add this into ClockwordMOD... you would help SO many people out with this. Quick question just so I can learn something: How does the script know how to repair the framework files? I mean how can it tell what ROM it is, and know the correct file to repair?
Want news/reviews/tutorials on technology? Visit my website http://www.techneektv.com
CyanogenMod for the Moto Photon 4G
My GitHub: GitHub
 
SavvyX4
Old
#10  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2010
I am using the recovery.log that is generated during the flash process to figure out which files belong where. Inside the zip for the rom the files are in the same directory structure so it ended up only requiring some minor work to get it to locate everything. And the same log identifies what is being flashed which is how it knows which directory to work with.



Sent from my HERO200 using XDA App

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Benchmark Your CPU Performance with Mini CPU Integer Script

When it comes to device testing, there are two types of people on XDA. The first … more

Rid Yourself of Charging Annoyances with No Wake on Charge Xposed Module

Almost every OEM has skinned and otherwise modifiedAndroid to suit … more