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

Search This thread

mattlgroff

Inactive Recognized Developer
Dec 5, 2011
2,291
2,446
San Diego
My email is [email protected]

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 a moderator:

pedrotorresfilho

Senior Member
Jan 4, 2012
1,596
1,098
decantodepoetas.blogspot.com
My email is [email protected]

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. :D

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:

mattlgroff

Inactive Recognized Developer
Dec 5, 2011
2,291
2,446
San Diego
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. :D

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.
 
Last edited:

Q9Nap

Senior Member
Feb 13, 2009
1,019
1,889
trying to figure out why manually patching would be necessary, why not just dd the boot.img partition after updating?
 

mattlgroff

Inactive Recognized Developer
Dec 5, 2011
2,291
2,446
San Diego
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.
 
  • Like
Reactions: Q9Nap

dtrail1

Senior Member
Oct 7, 2011
4,803
7,866
Frankfurt
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:

vickdu31

Senior Member
May 5, 2012
315
107
Hi guys, is there any way to let the patch install with any SHA for the currently installed boot.img ? Magisk messes it up so OTA updates cannot work
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    My email is [email protected]

    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
    ------------------------------------------------------------------------------------------
    2
    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. :D

    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.
    1
    Hi mattlgroff!

    Do you know a Dev that may help us?

    Thanks

    I don't sorry.
    1
    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.