Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,802,856 Members 38,703 Now Online
XDA Developers Android and Mobile Development Forum

Boot/Recovery repack utils for WINDOWS

Tip us?
(Last edited by bovirus; 24th June 2014 at 01:37 PM.)
Senior Member
Thanks Meter 69
Posts: 418
Join Date: Oct 2007

I found several problem regarding pack/unpack tools for boot.img/recobvvery.

I tested it under Windows7 64bit. Tested with boot.img and chinese (MTK...) batch.

** Unapck

The main problem that many comamnd are recognized as internal command and the problem seems the variable %~dp0 that is nor recognzied correctly.Ex.

%~dp0bin\cpio.exe -i <../ram_disk

is not recognized as command

to set the start folder (where you run the app) you can set variable like set CURRECNT.PATH=%CD% then use

%CURRENT.PATH%\bin\cpio.exe -i <../ram_disk

** Repack
As unapck there are several problems regarding %~dp0 variables.
In some command you use for path "/" instead "\". Ex.

%~dp0bin\sfk166.exe partcopy ../../tmp1.dat 0 4 ../new_ram_with_header 4 -yes>nul
%~dp0bin\mkbootimg.exe --kernel ../kernel --ramdisk ../new_ram_with_header -o ../new_image.img


The problem now is fixed.
I copied the scritp into a path that contain a space.
To use batch file the path cannot contain space.

Thanks. Bye.

michfood's Avatar
Senior Member - OP
Thanks Meter 244
Posts: 188
Join Date: Oct 2009

Originally Posted by bovirus View Post
I copied the scritp into a path that contain a space.
sure. and no domestic letters
Like my works - feel free to donate ))
Senior Member
Thanks Meter 69
Posts: 418
Join Date: Oct 2007
On same platforms (with recent hardware) during unpack/repack I received an error about cygwin flag not supported.

I solved it using latest version (1.18.3) of Cygwin library. Please update into distribution archive.

I added some additonal batch

MTK_UNPACK_recovery (call MTK_UNPACK recovery.img)
MTK_UNPACK_boot -(call MTK_UNPACK boot.img)

MTK_PACK_recovery (call MTK_PACK recovery.img)
MTK_PACK_boot (call MTK_PACK boot.img)

To automatize the operation.

Future improvements

- Add check of presence of boot.,img/recovery.img and stop the batch if file is not available

- Cleanup boot/recovery folder before to unpack
Junior Member
Thanks Meter 0
Posts: 20
Join Date: Jul 2014
Default can i port custom recovery on window pc

Thanks for this tool
I purchased a Micromax A092 model and use many apps for rooting this phone
But no success then I create insecure boot.img with this tool and
Got Root success thanks again

Now i want to flash a custom recovery on my phone like CWM or TWRP i search over the net for recovery but no recovery for this Phone yet
I have a old Pentium 4 PC with 512 mb of Ram and I'm not able to run LINUX
On it only Win XP is Worked on it
Is there any way to port a recovery on win xp PC
Pls help me....
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes