yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] :
Drag & Drop on linux CarlivImageKitchen version! function implemented by yuweng

Alternative linux version with Drag and Drop functionality, modded by my friend yuweng! -* carliv's edit: copied here from my friend's post.

Yes, now you can also Drag&Drop to UnPack/ RePack Android images on linux using CarlivImageKitchen !

Download CarlivImageKitchen-DnD.zip & extract to your linux Desktop, copy out all the five .desktop files to your Desktop & start Dragging & Dropping . . . :laugh: You can also Drag&Drop it to same .desktop files inside CarlivImageKitchen folder & it'll to work too . . . :good:

Tested working perfectly on BBQLinux & also Ubuntu, however, for Ubuntu you need to open the .desktop launcher shortcut with any text editor & manual edit the command as below . . .

[COLOR="Blue"]gnome-terminal[/COLOR] -e "bash -c \"~/Desktop/CarlivImageKitchen/image_info %f\""

i have also tested it on numerous of linux terminal program & it works perfectly too so you gotta manual edit it if you are using those . . . :good:

[URL="https://launchpad.net/terminator"]terminator[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="https://konsole.kde.org/"]konsole[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/unpack_MTK_img %f""
[URL="http://mate-desktop.org/#mate-terminal"]mate-terminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://en.wikipedia.org/wiki/GNOME_Terminal"]gnome-terminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/repack_MTK_img %f""
[URL="http://wiki.lxde.org/en/LXTerminal"]lxterminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://roxterm.sourceforge.net/"]roxterm[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="https://www.enlightenment.org/p.php?p=about/terminology"]terminology[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/repack_img %f""
[URL="https://launchpad.net/sakura"]sakura[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://en.wikipedia.org/wiki/Xterm"]xterm[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/image_info %f""
[URL="http://en.wikipedia.org/wiki/Terminal_(Xfce)"]xfce4-terminal[/URL] -e "bash -c "~/Desktop/CarlivImageKitchen/unpack_img %f""

No more typing to unpack/ repack, just draaaagggg & drooooopppp it like you use to do that on Windows . . . :laugh:

Full credits to Master Shifu Carliv, i just modded a few lines to support Drag&Drop, that's all . . . :o

Drag&Drop in Action !

Konsole

roxterm

sakura

gnome-terminal

lxterminal

mate-terminal

xterm

terminator

terminology

xfce4-terminal

If you want to hit the THANKS button for yuweng's version, go here and do it.
[Miscellaneous Android Development] superdragonpt:
awesome

More goodies for me to test.

Thanks guys
[Miscellaneous Android Development] iZLeeP:
This is great! No need to shuffle programs for unpacking/repacking boot and recovery images of various platforms.

Windows version working (MTK and non-MTK).

Tried to use the Linux version in cygwin and encountered the following errors:
[Miscellaneous Android Development] yuweng:
There are already separate package for Windows & Linux so use the appropriate package however for beta-testing sake . . . :cowboy:

Copy all the *.exe from Windows package -> hidden folder bin to Linux .bin folder.

Add the extension exe to all linux binary at the script

Eg.

gzip -> gzip.exe

mkbootfs -> mkbootfs.exe

unpackmtkimg -> unpackmtkimg.exe

mtkbootimg -> mtkbootimg.exe

unpackbootimg -> unpackbootimg.exe

mkbootimg -> mkbootimg.exe

Now the linux script will work on cygwin . . . :cool:
[Miscellaneous Android Development] iZLeeP:
Thanks for the suggestion.

Now, unpack (MTK and non-MTK) works but repack does not. The repacked image is much smaller in size than that of the original. It also produces errors when I unpack the repacked image.
[Miscellaneous Android Development] :
If you want to test it in cygwin you need to add all binaries from windows bin with exe extension except dlls (those are native) and compressing modules, and to replace those from linux. You can see in linux version all compressing modules are missing - they have to be installed in system. Same for cygwin. It's possible you got a cygwin with some packages missing. That error message you see is because it's missing cpio probably. The linux binaries are much smaller because the compiler works different in linux. In windows the modules are standalone and don't need any dll, except those for archiving from cygwin, but we are not talking about those.

Anyway what you do here is just cross testing, and you don't need to use linux version in windows because windows version works the same.
[Miscellaneous Android Development] iZLeeP:
Yes, I was just testing the functionality of the linux version in cygwin. As I don't have linux here (office), I use cygwin instead. I'll re-download full cygwin package and test again. Nonetheless, I have no problems with the windows version (tested in Vista and 7). I'll try it on XP at home.
[Miscellaneous Android Development] :
It's ok, but you have to be carefull to search manually for some packages, because depending from what mirror you install cygwin, they may be there or not. This situation is very well exposed in cygwin forums. When I built mkbootfs in cygwin for windows the compiler complains for few missing packages and I had to add them one by one searching online in cygwin packages. Some of them were on mirrors.kernel.org and some on cygwin.cybermirror.org. In any other mirror site they were missing. Same for compression packages: xz was only in mirrors.kernel.org. When you install cygwin you don't see any message of something not being there.

Or maybe I don't know how to work with cygwin, I don't know...
[Miscellaneous Android Development] iZLeeP:
It's working now after updating cygwin. If I recall correctly, I used dsixda's instructions on how to setup cygwin for kitchen. The procedure required to install additional packages including cpio. Maybe, the files were just outdated since I had this last 2011.
[Miscellaneous Android Development] yuweng:
Refer to post #2 for details . . .
[Miscellaneous Android Development] EnerJon:
Fantabulous Work Sir :good: Going To Test it :D

Sir if i am Not Mistaken, Michfood's Recovery/Boot UnPacker/Repacker Tool Don't Need This, Right?
[Miscellaneous Android Development] :
Yes, you're right, but his tool uses a different method. It stores the ramdisk and kernel headers on unpack in separate files and add them back for repack. My tool strip off the headers on unpack and will recreate them during repack and it need that info to determine wich header to add for ramdisk (ROOTFS or RECOVERY). :)
[Miscellaneous Android Development] EnerJon:
Got it, So Michfood's Tool Just Extracts The Headers Of The IMG File While UnPacking And Adds Them Back As it is, This Way it Don't Need To Take Care Of The IMG Type Because The Type Of Output IMG Automatically Becomes Same as input IMG in The End...

But Your Tool Needs To Know The Type Of IMG Because it Creates Those Headers By itself... Hmm, But Sir, i Don't Understand One Thing, What's Wrong With Extracting And Adding Same Headers As input IMG File?

i Think, You/OmniROM DEVs Did This To Make Boot.img Usable As Recovery.img Or Vice Versa? Thats The Only Reason Comes in My Mind :rolleyes:
[Miscellaneous Android Development] :
The original MTK module (mkimage) - which source is not published (I never find it anywhere), append the right header during build of a ROM, and that's for boot - ROOTFS and for recovery - RECOVERY (on ramdisk). Omnirom code will add ROOTFS to any ramdisk, and same is the code from dsixda kitchen. This may be fine and may work in some phones, but I wanted to do it the right way, as in bgcngm's tool - because of the new MTK platforms. So I changed the source code to do it as I wanted, and instead of an extra argument I'm using just the name of image. I think it's not that hard to name the new image boot-something or something-boot-something or somethingboot, etc - same for recovery.

And for extracting old headers it's nothing wrong and it's easy to do it, but for adding back it needs an extra module (michfoods use sfk166 - now I think it reached version 173) and I wanted to reduce the number of binaries involved.

And again, really, I think my method with adding the name for newly created image is better.
[Miscellaneous Android Development] EnerJon:
Thanks For The info Sir, Yes, its Not That Hard To Rename it, Actually i Work With Dozens Of IMGs, But No Worries, its Just a One Time Process... Previously Michfood's Boot/Recovery RePacking Tool Was Not Working if i Try To RePack The IMGs Made With Sir Yuweng's Easy Magic Tool... But Your Tool Has No Such issues... Thank You Very Much For This Great Tool :highfive:

i Just Tested it And its Working Perfectly Fine For My Qmobile-A900 (Gionee Elife E3)

Just a Suggestion:

instead Of Asking User To input Final IMG Name, The Tool Should Automatically Expand The File Name By Adding "_NEW"

For Example:

Original IMG Name ===> MyStockBoot.img

1st Modified IMG Name ===> MyStockBoot_NEW.img

2nd Modified IMG Name ===> MyStockBoot_NEW_NEW.img

3rd Modified IMG Name ===> MyStockBoot_NEW_NEW_NEW.img

The Code Of You Tool Seems To Be Very Clean, And Handles The Errors Very Well :good:
[Miscellaneous Android Development] :
Thanks, I worked quite a bit to make it that way because I do like clean and easy to read codes - easy to spot errors :laugh:

First test version was as you suggest without asking for a name and everything done automatic, but when I send it to my friend yuweng to test it, he came out with the ideea to ask user for the name and I think it's a good ideea and I added that prompt; this way you can repack same image with little modifications again and again, for tests purposes or other, and give related names, like boot-1, boot-2, or recovery-1, etc. In automated method for such things it needs to rename the new repacked image or the unpacked folder and at the end it creates more troubles than current method.
[Miscellaneous Android Development] :
I understand your point of view, but I have to tell you few things. :)

First thing I tested was 7zip because at start I didn't want to use any cygwin dll in my tool, but 7zip isn't "the same" in windows and linux (I use ubuntu and it is provided in official ubuntu packages), and I wanted my tool to be consistent across OSes. Then, 7zip changes the original file attributes (date of creation for example, permissions, etc.) and it takes longer to do the job (execution time), so I moved to gzip built by me from source for windows. Gzip keeps original data for files by default and it is faster. But windows standalone module didn't worked - I mean technically worked, repack unpack but the created image didn't worked in phone. That's how I ended up with cygwin compression modules - they do the job.

So, thank you for your suggestion, but I will stick with gzip as "official" way for both versions, since it proves to work in every situation. Maybe if I didn't provided a linux version too and I didn't care about preserving files original infos, I would use 7zip for the advantage of a slightly better compression.

It's good though that you posted here your modd, because if someone wants to try it or use it, all it needs to do is to check your post! :good:
[Miscellaneous Android Development] bovirus:
[MENTION=5186178]carliv[/MENTION]

I think that it's important that you post the info about any changes to the tool (also if you didn't change version - burt it can create misunderstanding) on first posts.

Because if someone get your tool v. 1.1 (like me and believe other users) and didn't see some post back can believe/understand that no changes were made because the version is always 1.1.

version 1.1 of 25.03.2016 is not equal to v. 1.1 of 28.05.2016 (but both are named 1.1)

For this I propose you to avoid misunderstanding ex. naming new version it as 1.1a (not major changes - just an update/fix - but is change - is not equal before). Ex.

v. 1.1 is version of 25.03.016 / v 1.1a is version of 28.05.2016.

If you will make another fix can name it as v. 1.1b etc.
[Miscellaneous Android Development] fhndroid:
thanks
[Miscellaneous Android Development] KaMyKaSii:
Version 1.1 both x86 and x64 to press enter a window simply closes. Version 1.0 running perfectly
[Miscellaneous Android Development] :
That because in version 1.0 I used a chmod exe from cygwin to regain permissions for executables, but in version 1.1 I removed that because there was a side effect (multiple permissions levels on files and folders after some time).

In your screenshot clearly I can see permissions and folder attributes are messed up (folders bin, scripts and working should be hidden - faded out). You have to tell me where did you get the kitchen and how did you unpacked it (I recommend to use 7zip for windows)? Other questions: have you turned off UAC? - you should do that or to start the kitchen several times until all executables get rights to execute and save those rights for future access.
[Miscellaneous Android Development] KaMyKaSii:
The tool I got this thread. Extract with 7-zip (16.02 x64). I disabled UAC and continued with the same error
[Miscellaneous Android Development] :
I did same steps you say you did. Downloaded from the OP, unpacked on a portable USB like I saw you did tested one boot image and worked (windows 7 x64). I made screenshots with every step. And I saw now that 7zip removed the folders atributes but the kitchen worked normal.

So, I can't reproduce your error and I'm not an windows expert to figure out what is the problem in your case but it is something at your end.
[Miscellaneous Android Development] KaMyKaSii:
Here is also Windows 7 x64, did the same steps that you, and only works correctly in version 1.0. So I'll assume it's a problem on my Windows, thanks for your attention
[Miscellaneous Android Development] :
Can someone please port recovery for Xolo Era 4g with Spreadtrum SC9830A processor
[Miscellaneous Android Development] bovirus:
[MENTION=5709704]Raakib Zargar[/MENTION]

The request is OT. here. This thread is only for AIK.
[Miscellaneous Android Development] :
What is OT and AIK
[Miscellaneous Android Development] bovirus:
[MENTION=5709704]Raakib Zargar[/MENTION]

This thead is about AIK and command to unpack/repack boot and recovery.

This thread is NOT about how to port a recovery. And you cannot ask it here.
[Miscellaneous Android Development] :
Oh thanks can u plz suggest me where can i get ny recovery ported some developer or something or can u manage to pm me... Thanks?
[Miscellaneous Android Development] bovirus:
[MENTION=5709704]Raakib Zargar[/MENTION]

Please check the threads like

http://xdaforums.com/showthread.php?t=2748169

http://xdaforums.com/showthread.php?t=1825722
[Miscellaneous Android Development] :
Actualy the thread for AIK is somewhere else. This one is for Carliv Image Kitchen.
[Miscellaneous Android Development] bovirus:
[MENTION=5186178]carliv[/MENTION]

Sorry. It's true. It was a lapsus.

This the thread if for CIV (not AIK). Sorry again.
[Miscellaneous Android Development] xancin:
In short words , you are the best carliv
[Miscellaneous Android Development] :
Update

2016-06-21 Update to version 1.2 stable

Changelog:

- improved the clean menu;

- added option to clean the output folder;

- new binary for coloring dos in windows;

- added the command to apped execute rights to executables in windows;

Also cleaned some old or leftover things from scripts.
[Miscellaneous Android Development] KaMyKaSii:
It seems that permissions were corrected, but still with the same error. Tested both x86 and x64
[Miscellaneous Android Development] goldchang:
[MENTION=5186178]carliv[/MENTION] [MENTION=6450691]KaMyKaSii[/MENTION]

It seems that you passed command grep with --o

Shouldn't it be -o
[Miscellaneous Android Development] :
No, if you check my script you can see the command is passed like this [ grep -obUaPc "\x88\x16\x88\x58" ]. The problem is with his computer. Nobody else has this problem.
[Miscellaneous Android Development] goldchang:
Yep, I've checked it.

I can confirm with [MENTION=5186178]carliv[/MENTION]

[MENTION=6450691]KaMyKaSii[/MENTION] There may be a issue on your side
[Miscellaneous Android Development] zishan rehman:
Carlive error

Please help mee carliv is now unpack my ramdisk
[Miscellaneous Android Development] :
Please read the red text of the error and do what it says. Hint: provide the image doesn't mean to post a picture here.
[Miscellaneous Android Development] AlexZap:
But.. it's an image of sorts :confused: ;)
[Miscellaneous Android Development] :
update

2016-06-30 Update to version 1.3 stable

Changelog:

- detect mtk header during unpacking (hopefully it will find it in first 4096 bytes);

- removed grep method;

Maybe this will fix that grep error since there is no grep anymore.
[Miscellaneous Android Development] KaMyKaSii:
Yes, everything is working again. You are the best :D
[Miscellaneous Android Development] HackTube:
Hi dev, please help me.

I cant unpack boot.img (MT6752) xperia e4g with carliv image. I have already test several software to unpack boot.img xperia e4g. But always error. :(
[Miscellaneous Android Development] bovirus:
[MENTION=5760146]HackTube[/MENTION]

Wihout thw boot.img file no one can help you.

Please upload the file on some host and post the link.
[Miscellaneous Android Development] HackTube:
I get this boot.img from stock firmware. The first file extension is .sin, and then I extract from the firmware. Then I extract data again with flashtool, file extension change to .elf last i rename extension in .img
[Miscellaneous Android Development] :
For sony images you need a special tool, which you should find it if you have searched the forum.
[Miscellaneous Android Development] HackTube:
Thank you bro, but how to run elftool ? Sorry iam noob ?
[Miscellaneous Android Development] KaMyKaSii:
Rename extension will not convert the file. If you have root, try to backup boot.img with any app like Partitions Backup
[Miscellaneous Android Development] HackTube:
I hope can backup boot.img with app or software. But no one app can backup partitions or kernel this phone. Not only that if i backup from adb always show can't write. And then this phone have not stock recovery in partitions. /Dev/block/.../by-name
[Miscellaneous Android Development] :
You have to ask for help in sony's threads. I never had a sony device or even touched one and so I can't help you with something I don't know.
[Miscellaneous Android Development] AlexZap:
This took me literally 3 seconds of Google to find. It is taking me longer to respond to you then it took me to find.

http://xdaforums.com/showthread.php?t=2699858

Being a "noob" really isn't an excuse. It would have been better to type "sorry I am lazy".
[Miscellaneous Android Development] robterza:
To make a "patched boot.img" for rooting what do we need to mod in the "stock boot.img"?
[Miscellaneous Android Development] bovirus:
Check here (boot.img file default.prop)

http://www.androidiani.com/forum/mo...l-flash-di-telefoni-con-chipset-mediatek.html

Which device have you to root?
[Miscellaneous Android Development] robterza:
Lenovo K3 Note K50T5 DEV.

Lenovo every week releases DEV OTA for this phone.

I made an app that backups the stock boot.img-recovery.img-system.img so i can install the OTAs, but i need to root everytime to install my stuff.
[Miscellaneous Android Development] bovirus:
[MENTION=7119498]robterza[/MENTION]

The root/mod recovery are not compatible with OTA update.
[Miscellaneous Android Development] robterza:
Thanks for response. Dont bother about recovery, already resolved, need to know only about boot.img.

One question: I tryed your your Carliv mod, but why in the ouput, the boot.img is reduced in size? Original is 16.384Kb and the mod one is 8.952Kb.

This is the stock boot.img : https://drive.google.com/file/d/0B_FvGqUZPknjaEQ3UXZKcDFIRjQ/view?usp=sharing
[Miscellaneous Android Development] bovirus:
[MENTION=7119498]robterza[/MENTION]

It's right.

boot.img 16MB is the full partition image. Is not the real size of of boot.img.
[Miscellaneous Android Development] robterza:
Well, i always flash the boot.img by Zip package by TWRP with sucess. I think it will not work reduced in size. it will go in bootloop.
[Miscellaneous Android Development] bovirus:
[MENTION=7119498]robterza[/MENTION]

Not right

TWRP use dd Linux command and flash an image of 16NB and also the new boot.img (not reduced size - it's real size - 16MB is padded size).

The 16MB boot.img is equal to your the same boot.img just padded with not used data.
[Miscellaneous Android Development] robterza:
thank you. Will try this evening, when back from work. (y)
[Miscellaneous Android Development] robterza:
So i made a "patched boot.img" test for my phone.

Just changing the values in "default.prop" and flashing "Supersu 2.74" did not work. The phone got stuck on the boot logo. :(

To make it work, i changed "sepolicy" and "init.rc", flashed "Supersu 2.74" and phone booted up. :good:

Maybe my "boot.img" its more complex than others. :confused:
[Miscellaneous Android Development] bovirus:
[MENTION=7119498]robterza[/MENTION]

The discussion about specific phone is OT here.

Here we can discuss only about decompress/recompress boot/recovery.

I believe that you have to open a specific thread for your device.
[Miscellaneous Android Development] sagarsorathiya433:
anyone please help me how to unpack and repack zImage or boot.img-kernel file using calive image kitchen
[Miscellaneous Android Development] hacknmtk:
If you have the latest version, there is a help section that tells how to use this wonderful piece of software.

If you have the Linux version, cd to the CarlivKitchen folder (wherever you chose to place it), type "./carliv" (without the quotes). It should open in your terminal. If not you need to "chmod +x carliv" (again without the quotes) to make it executable. Then run the "./carliv" command again and type "p" (without the quotes), and it has a great help page detailing how to use the Kitchen.

Good luck, and feel free to ask anything else if you still need help. :)

Edit: I just read your question again. There is no way of decompiling the kernel with this, or any other tool that I know of. Sorry.
[Miscellaneous Android Development] sagarsorathiya433:
okkk:(: thnx :)
[Miscellaneous Android Development] hacknmtk:
Sorry I wasn't able to be more help. A little off topic, but if you have hexdump you can run "hexdump -C zImage | tee kernel_dump" and get a dump of the kernel in ASCII that may be helpful, but it still won't decompile the kernel. You can name "kernel_dump" to whatever you want. That will be your output file from the hexdump of the zImage.

Back on topic... This is a wonderful tool for working with boot and recovery images. I'm glad that it was ported to Linux. Writing the commands to unpack and repack on the command line can get tedious after awhile, especially when you're building images over and over for testing. This just makes it so much easier and faster.

I haven't tried the drag and drop version, but it sounds even easier to use. :)
[Miscellaneous Android Development] hacknmtk:
[MENTION=5186178]bluefirebird[/MENTION]

I thought I would do some testing since all of the boot images that I have made fail each time. I took a stock boot.img, unpacked it and then repacked it without touching anything. I then did a hexdump on both the stock boot.img and the one the kitchen made, then did a check between the two files with diff and logged the differences to a text file. I was surprised to see that the log file was 702350 lines long. This was with no changes, just a quick unpack and repack of the stock boot.img. I'm not sure if anyone else has had any problems with boot images not working after using your kitchen or not, but there seems to be some kind of error somewhere during the recompiling of the ramdisk and kernel into a boot.img. Is there something different that needs to be done? I need bootable images that work, and if a simple unpack and repack causes this much of a difference, I'm never going to get a custom image to boot. The recompiled stock image doesn't even boot, it just bootloops.

I'm using the 64bit Linux version.