• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[DEV][TOOL] mktool unpack/repack boot & recovery images

GameTheory

Android Expert
Unpack and Repack the Android Boot & Recovery Images

This is a tool I made for unpacking, repacking, and loki patching the android boot and recovery images.

mktool is very simple to use with an interactive menu.

mktool.png


To use mktool you simply run the following command in a terminal from the mktool root directory:
Code:
java -jar mktool.jar

You can download mktool from the projects page:
https://techstop.github.io/mktool/

Note:
mktool has been tested on ubuntu & xubuntu
Must have java 8 or higher installed
 
Last edited:
Q - Why did I post this in the rom development section?
A - Most roms come packaged with a boot.img which can be unpacked and tweaked.
A - Besides, there is no kernel development section to post this tool.
 
Last edited:
Unpack and Repack the Android Boot & Recovery Images

This is a tool I made for unpacking, repacking, and loki patching the android boot and recovery images. Perfect for making a kernel developer's life a little easier or the beginner that just wants to unsecure their own boot image and/or add init.d support.

mktool is very simple to use with an interactive menu.

menu.png


These are the options mktool handles automatically:
Code:
--kernel <filename>
--ramdisk <filename>
--second <2ndbootloader-filename>
--cmdline <kernel-commandline>
--board <boardname>
--base <address>
--pagesize <pagesize>
--dt <filename>
--ramdisk_offset <address>
--tags_offset <address>
--output <filename>

To use mktool you simply run the following command in a terminal from the mktool root directory:
Bash:
./mktool

You can download mktool from the projects page on my github:
https://github.com/GameTheory-/mktool

Note:
mktool has been tested on linux (ubuntu). May possibly run on windows with cygwin (not sure).
Im new in this area of android.
Is there specific boot.img structure this works with or is it a "universal fit"? Sorry if that is a dumb question, I'm just trying to understand it better.
I didn't research it yet (the .lok image??), but I will.
 
Im new in this area of android.
Is there specific boot.img structure this works with or is it a "universal fit"? Sorry if that is a dumb question, I'm just trying to understand it better.
I didn't research it yet (the .lok image??), but I will.

I tested it on a couple of devices, one running android 4.1.2 (3.4.0 kernel version) and the other android 5.1.1 (3.10.49 kernel version). It's intended to be universal, however I have not tested it on all boot images out there.

As for the ".lok" feature you will not need that unless you're working on an older device that has loki support.
 
I tested it on a couple of devices, one running android 4.1.2 (3.4.0 kernel version) and the other android 5.1.1 (3.10.49 kernel version). It's intended to be universal, however I have not tested it on all boot images out there.

As for the ".lok" feature you will not need that unless you're working on an older device that has loki support.
So anything above ICS, this should work with.
I'm trying to get into developing and figure out what I have available to use, for making a pleasurable experience instead of a hair-ripping one. Lol:p

Thanks for the speedy reply :)
 
Going to test this tomorrow on our Tribute's 4.4.2 kernel. I'll let you know how it goes. I've been hoping to find a nice little utility like this. The only one I had previously, was for Windows and it sometimes gave a secure boot issue...(I think it doesn't pack properly.) Than you for this! I'll try my best to put it to good use, or break everything trying! :D
 
New update to version 3.0

Hello everyone. Sorry it took so long to update this tool. I took a break from android development for a couple years.

This is a major update to mktool. It is now more universal with the exception of a few obscure devices. It's also more simplified now. You simply place all you're images in the input folder then choose from the menu options. Unpacked images will be in the "extracted" folder and repacked images in the "output" folder.

You can also now check for updates to mktool right from within the menu. I also added a desktop shortcut option for quick access which you can place anywhere, like a folder or a launcher or on your desktop.

I considered removing the loki patch option since that exploit was long patched in android, but I decided to leave it for the folks still having some dev fun with those older devices.

Hope you guys like the update. Happy modding.
 
New Update! v4.0
  • Added ramdisk lzma compression detection.
  • Re-written from bash to java for a proper GUI
Currently this is for linux only. If you'd like to also make it available for Mac and Windows, I've made this open source.

mktool.png
 
Last edited:
Back
Top Bottom