Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

How to patching an updated boot.img.p(atch) to a fastboot boot.img -For Leak Install-

OP mattlgroff

10th June 2012, 08:50 AM   |  #1  
mattlgroff's Avatar
OP Recognized Developer
Flag San Diego
Thanks Meter: 2,416
 
2,263 posts
Join Date:Joined: Dec 2011
Donate to Me
More
My email is mattlgroff@gmail.com

Be rooted. Have a computer with adb working, or do this from an android terminal emulator. The instructions are for adb.

The applypatch commands are going to have [] around them to show you what to put, but we not used in the actualy script.


-----------------------------------------------------------------
Code:
adb shell
su
cd sdcard-ext
applypatch [Original Boot.img] [Desired Name of new Boot.img] [A] [B] [C]:[boot.img.p]
-----------------------------------------------------------------

A = Desired Boot.img's Sha-1 sum
B = Size (in bytes) of the desired boot.img
C = Original Boot.img's Sha-1sum




Looking at the updater-script you can see this line of code or something similar for applying the boot.img.p to the phone's boot.img.
You need this as a reference for the SHA-1 sums of the patch and boot.img and desired final boot.img.


//Reference script\\

Code:
assert(apply_patch("MTD:boot:[B]:[C]:[B]:[A]",
       "-", [A], [B],
       [C], package_extract_file("patch/boot.img.p")));


//Actual script\\

Code:
assert(apply_patch("MTD:boot:8388608:fe086e1f547082c3cf2a5f65dacb81fd232ecd89:8388608:4a7070c32d0312aa48e52e207c7932434bc46cb1",
       "-", 4a7070c32d0312aa48e52e207c7932434bc46cb1, 8388608,
       fe086e1f547082c3cf2a5f65dacb81fd232ecd89, package_extract_file("patch/boot.img.p")));



Actual commands used to patch D4 .219 fastboot file boot.img with D4 6.16.208 boot.img.p:
------------------------------------------------------------------------------------------
Code:
adb shell
su	
cd sdcard-ext
applypatch boot219.img boot208.img 4a7070c32d0312aa48e52e207c7932434bc46cb1 8388608 fe086e1f547082c3cf2a5f65dacb81fd232ecd89:boot208.img.p
------------------------------------------------------------------------------------------
Last edited by stylez; 3rd July 2012 at 01:21 AM.
The Following 16 Users Say Thank You to mattlgroff For This Useful Post: [ View ]
10th June 2012, 08:31 PM   |  #2  
pedrotorresfilho's Avatar
Senior Member
Thanks Meter: 1,098
 
1,590 posts
Join Date:Joined: Jan 2012
Donate to Me
More
Lightbulb
Quote:
Originally Posted by mattlgroff

My email is mattlgroff@gmail.com

Be rooted. Have a computer with adb working, or do this from an android terminal emulator. The instructions are for adb.

The applypatch commands are going to have [] around them to show you what to put, but we not used in the actualy script.


Thank you very much mattlgroff. Our Razr Dev section really need more tutorials as this one.

Excellent !

-- Edit --

Do you mind bringing us a Tutorial to port an ICS system app to make it work in another ICS?

Here's an example: SoundRecorder.app from a Motola GSM ICS leak to Retail.BR GSM ICS 4.0.4

This really worth a really cold beer.

BTW. I can provide you all the files you may need or follow a guide to make it work to upcoming Razr's ICS. I've tools to extract .img, DD's even an app compiler. But I get stuck in signing. framework-res.apk etc.

Reason: Some features are built in some ICS versions but not in others. There's more apps, like SIP native support wich are not present in most ICS 4.0.4. I've tried a few Tutorials, but they aren't that much noob Engineering friendly. lol

Thanks man
Last edited by pedrotorresfilho; 10th June 2012 at 08:47 PM.
10th June 2012, 11:34 PM   |  #3  
mattlgroff's Avatar
OP Recognized Developer
Flag San Diego
Thanks Meter: 2,416
 
2,263 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by pedrotorresfilho

Do you mind bringing us a Tutorial to port an ICS system app to make it work in another ICS?

Here's an example: SoundRecorder.app from a Motola GSM ICS leak to Retail.BR GSM ICS 4.0.4

This really worth a really cold beer.

BTW. I can provide you all the files you may need or follow a guide to make it work to upcoming Razr's ICS. I've tools to extract .img, DD's even an app compiler. But I get stuck in signing. framework-res.apk etc.

Reason: Some features are built in some ICS versions but not in others. There's more apps, like SIP native support wich are not present in most ICS 4.0.4. I've tried a few Tutorials, but they aren't that much noob Engineering friendly. lol

Thanks man

I've never done any modifications of apk's like this, I'm more into leaks and utilities

I agree that someone should make tutorials on this though. Sharing our knowledge is the best way to not have to repeat trying things that don't work over and over.
The Following 2 Users Say Thank You to mattlgroff For This Useful Post: [ View ]
11th June 2012, 12:37 AM   |  #4  
pedrotorresfilho's Avatar
Senior Member
Thanks Meter: 1,098
 
1,590 posts
Join Date:Joined: Jan 2012
Donate to Me
More
Quote:
Originally Posted by mattlgroff

I've never done any modifications of apk's like this, I'm more into leaks and utilities

I agree that someone should make tutorials on this though. Sharing our knowledge is the best way to not have to repeat trying things that don't work over and over.

Hi mattlgroff!

Do you know a Dev that may help us?

Thanks
11th June 2012, 01:34 AM   |  #5  
mattlgroff's Avatar
OP Recognized Developer
Flag San Diego
Thanks Meter: 2,416
 
2,263 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by pedrotorresfilho

Hi mattlgroff!

Do you know a Dev that may help us?

Thanks

I don't sorry.
The Following User Says Thank You to mattlgroff For This Useful Post: [ View ]
13th June 2012, 09:41 AM   |  #6  
xlightwaverx's Avatar
Member
Thanks Meter: 26
 
90 posts
Join Date:Joined: Jun 2010
Donate to Me
More
apktool
I thought it was possible to make changes to an apk with apktool and then repack those changes back into original apk so you don't lose signing.

X
13th June 2012, 08:09 PM   |  #7  
Senior Member
Flag Burnaby
Thanks Meter: 47
 
446 posts
Join Date:Joined: Dec 2009
Donate to Me
More
Quote:
Originally Posted by xlightwaverx

I thought it was possible to make changes to an apk with apktool and then repack those changes back into original apk so you don't lose signing.

X

We need to figure out how to check for dependencies on these disassembled APK files.

Also, these applypatch instructions have been posted by whirleyes before: http://forum.xda-developers.com/show...01&postcount=2
Last edited by stangri; 13th June 2012 at 08:12 PM.
15th June 2012, 06:17 PM   |  #8  
Q9Nap's Avatar
Senior Member
Thanks Meter: 535
 
623 posts
Join Date:Joined: Feb 2009
Donate to Me
trying to figure out why manually patching would be necessary, why not just dd the boot.img partition after updating?
16th June 2012, 06:07 AM   |  #9  
mattlgroff's Avatar
OP Recognized Developer
Flag San Diego
Thanks Meter: 2,416
 
2,263 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by Q9Nap

trying to figure out why manually patching would be necessary, why not just dd the boot.img partition after updating?

If no one who knows how can upgrade to that version. Here on the XT912 Verizon front, barely anyone is left on GB who can help us with this. This way I can pull a leak and flash it within minutes with no external help.
The Following User Says Thank You to mattlgroff For This Useful Post: [ View ]
17th June 2012, 11:21 PM   |  #10  
Recognized Contributor
Flag Frankfurt
Thanks Meter: 7,797
 
4,845 posts
Join Date:Joined: Oct 2011
Donate to Me
More
What I am doing wrong? It doesnt work. I get always an error:

"bootxxx.img" is already target; no patch needed.

I did everything like described in the OP.

Edit: My fault. Want to update an older boot.img to the newer one using the boot.img.p, but it doesn't work.

EDIT: It worked. As you said, it shows an error but done it already. Thx!
Last edited by dtrail1; 19th June 2012 at 03:13 PM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes