yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] :
version 0.3

2015.02.16 Update version 0.3

rebuilt binaries to correct few issues.

some fixes in scripts.

generate correct sha id.

use minigzip for repacking ramdisk as in recovery or boot image building.

compiled standalone bzip2 module.
[Miscellaneous Android Development] bigrammy:
I like Drag "n" Drop :D

Thanks for making me even more lazy than I am already bro. :laugh:

Great work carliv

Great contribution yuweng

You guys rock!!
[Miscellaneous Android Development] Pannam:
android boot magic not found

Hi carliv great work!

i am using your tool but i get an error android magic not found. some help please ?
[Miscellaneous Android Development] :
Can you post your image here for me to take a look?
[Miscellaneous Android Development] Pannam:
basically the ram disk folder is empty. with hex editor the first 7 hex were ANDROID .

my device is LG G3 F460K.
[Miscellaneous Android Development] :
That's because your ramdisk is compressed in lz4 format and my tool doesn't support that yet.
[Miscellaneous Android Development] Pannam:
Well thank you. Actually your wonderful tutorial about compiling recovery brought me here. I will try and see if i can find other alternatives.
[Miscellaneous Android Development] :
Update!

2015-04-08 Big Update to version 1.0 stable

Changelog:

- corrected few issues in scripts;

- rebuilt all modules also to correct some issues;

- cleaned up the source;

- added more compression support - see next;

- now the kitchen supports ramdisks compressions as following: gz, bz2, lzma, xz, lzo, lz4;

- converted to a Menu driven interface: now everything can be done from inside kitchen menu with few clicks;

- updated Instructions (can be loaded in kitchen interface for reading).

Check the OP and post #3.
[Miscellaneous Android Development] EnerJon:
Stable-v1.0-Windows Works Fine With My MT6589 Device, And Thanks For The v0.5 Non-GUI Version For Lazy People Like Me :laugh:
[Miscellaneous Android Development] EnerJon:
i Mean To Say, The Non-GUI Version Still Operates via GUI, e.g Choosing BOOT/RECOVERY, i Was Thinking To implement File Name Checking, So That if The File Name is *boot*.img/MyBootSomething.img The Script Should Automatically Detect That i Want To UnPack Boot, it Should Automatically Skip That GUI, in Case if The IMG Type is Not Found in File Name, Then it Should Provide A GUI To Choose What Type Of IMG it iz.... i Think This Way The Script Will Become More Smart...

Thanks For increasing My Knowledge About Second Option... i Prefer The Registry One, Cause i Want To Make a Completely Separate Sub Menu For These Android Related Tools...
[Miscellaneous Android Development] :
Ah, that... well it was like you say, before (0.1 - 0.3) when it used to ask for the new image name, and I changed that to this one letter answer at start to be more simple than write a whole new name. The only reason for doing this is that the repack module needs it for appending the right header (ROOTFS or RECOVERY to ramdisk). Of course you can modify it in any way it suits you :) - I never claimed to remain untouched. We discuss now here these things for other users who may want to try one way or another different than my "official" release ;) and you can share your ideeas freely.

I think you already knew that about send to menu, I posted those images for other users too. I understand you prefer registry variant, only that will make it dependant on a place, which is fine; it's just that I have this thing with being portable :) (in send to menu is also place dependant but it is much easier to modify it when you change the place to other partition, other folder, etc.).

Thanks for bringing up many useful ideeas :good:

Cheers!
[Miscellaneous Android Development] bovirus:
[MENTION=5186178]carliv[/MENTION]

Error during repacking

Log

Processing the boot folder.

Repacking the image....

The kernel is: boot.img-kernel

Getting the ramdisk compression....

Ramdisk compression: gz

The ramdisk is: boot.img-ramdisk.gz

Getting the image repacking arguments....

Board: 'G2FW-20141027-W-R-V0.3.6'

Base: 0x10000000

Pagesize: 2048

Command line: 'R-V0.3.6'

Kernel offset: 0x00008000

Ramdisk offset: 0x01000000

Tags offset: 0x00000100

Your new image is boot_173203.img.

Executing the repacking command....

Error: board name too large

usage: mtkbootimg

--kernel <filename>

--ramdisk <filename>

[ --second <2ndbootloader-filename> ]

[ --cmdline <kernel-commandline> ]

[ --board <boardname> ]

[ --base <address> ]

[ --pagesize <pagesize> ]

[ --dt <filename> ]

[ --kernel_offset <kernel_offset> ]

[ --ramdisk_offset <ramdisk_offset> ]

[ --second_offset <2ndbootloader_offset> ]

[ --tags_offset <tags_offset> ]

-o|--output <filename>

: mtkbootimg --kernel boot-kernel --ramdisk boot-ramdisk.gz --cmdline ''

Done. Your new image was repacked as boot_173203.img.

You can find it in[output] folder.

boot.img-board = G2FW-20141027-W-R-V0.3.6

boot.img-cmdline = R-V0.3.6

Is the new boot.img OK or not?
[Miscellaneous Android Development] :
/* tools/mkbootimg/bootimg.h
**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef _BOOT_IMAGE_H_
#define _BOOT_IMAGE_H_
typedef struct boot_img_hdr boot_img_hdr;
#define BOOT_MAGIC "ANDROID!"
#define BOOT_MAGIC_SIZE 8
[COLOR="Red"]#define BOOT_NAME_SIZE 16[/COLOR]
#define BOOT_ARGS_SIZE 512

The android standard lenght for board name is 16 characters - my tool respects that; yours has 25. Just change the name to something shorter to not see that error again. It won't matter because the board name is not checked for security.
[Miscellaneous Android Development] bovirus:
Which file have to change ? boot.img-board? Like

boot.img-board = G2FW-20141027
[Miscellaneous Android Development] :
Yes, open in notepad++ or geany that file boot.img-board and delete some part from that G2FW-20141027-W-R-V0.3.6 that is inside.
[Miscellaneous Android Development] bovirus:
[MENTION=5186178]carliv[/MENTION]

I hope that be useful.

Tools for decompress/compress images based on latest build (5.1.0-r5) of Android kit (for Linux & Windows)

http://xdaforums.com/showthread.php?t=2600364
[Miscellaneous Android Development] :
No, that's not helpfull for my tool. I'm building my own binaries and I'm using the sources from cyanogenmod and aosp but with my modifications. As I said in OP, and seems that you didn't read, I made this from scratch - building every binary and writting every script: this is not a reworked version of something else (michfood or other's). If you don't believe me, there is no problem, don't use my works and find something better.
[Miscellaneous Android Development] bovirus:
Sorry but your answer is quite hard (than I expected) and out of the needs.

I want to offer an help. That's all. If is not useful you could just answer "No thanks is not useful".

All other things that you wrote I believe that are not necessary and out of the needs.

I read well your first psots and I didn't write or express opinion about the source (original or not/reworked/etc) of your utils.

My scope was only to propose somethings. That's all.
[Miscellaneous Android Development] :
Ok then. Probably I didn't understand right. Cheers!
[Miscellaneous Android Development] Jeb1008:
Hi

I am working samsung device boot.img and recovery.img. When ever I take the orginal boot.img, decompile it and recompile without modifying. The file is now different from the way it was before. Most of the time it's a few kilobytes smaller. Is there something I am doing wrong.
[Miscellaneous Android Development] :
I can't tell based on your message. Actually I couldn't test it on any samsung device, but if the repacked images are working, then the difference is because of the compression used - maybe it's used a different compression level; btw what compression method are they using?

Did you tested the repacked images? Are they working?
[Miscellaneous Android Development] Jeb1008:
What would be a easy way to find compression of the .img files.
[Miscellaneous Android Development] :
The easy way is to read the output of my tool when you are doing the unpack command. Somewhere near the end of the executing script it will be displayed: "Compression used: ...." and the level of copression in percents if the copression method can show it.
[Miscellaneous Android Development] Jeb1008:
The compression used is gz on the boot.img.
[Miscellaneous Android Development] :
Ok, that's the answer. I'm using in my tool minigzip with compression 9, not gzip with standard compression like all the other tools. This will reduce few Kb in recompression. I choose to use minigzip because it is used in Cyanogenmod ramdisk packing (for boot or clockworkmod). But you didn't say anything if the images are working or not. For me all worked regardless the reduced size.
[Miscellaneous Android Development] Jeb1008:
The img files are not working once repacked. I get Odin secure fail.
[Miscellaneous Android Development] :
That doesn't mean they won't work, it means you just can't flash them. I can't help you with odin related issues, sorry.
[Miscellaneous Android Development] Jeb1008:
Ok. I understand your point. But if I take a orginal img that will flash and unpack it. Do nothing to it in the folder, then repack it to the .img and it will not flash. Is there a way to covert it back to us? Are is there some one else that may be able to help me with this issue.

---------- Post added at 03:35 PM ---------- Previous post was at 03:34 PM ----------

Back to gz?
[Miscellaneous Android Development] :
As I said this is odin related. Here is something that may help. I don't know who can help you with odin. Try dedicated forums and threads.
[Miscellaneous Android Development] DerTeufel1980:
Maybe just load the tar, without md5
[Miscellaneous Android Development] iZLeeP:
You used Odin to flash a boot image? Try using custom recovery (CWM/TWRP/Philz) instead and see if it works.
[Miscellaneous Android Development] Jeb1008:
I can't Because there is no official root for this tablet. This is a Samsung Galaxy Tab 4 8.0

SM-T337V running android 4.4.4. No one has found a way to root this tablet. I have been trying to load a custom recovery threw odin by modifying a stock recovery.img. I have been working on it for about 2 weeks. I have been involved in multiple forms while trying to root this tablet. I am very good at rooting tablets and modifying stock rom, but this is taking me a lot futher. I needs some ideas on how to modify a stock recovery, so that we can gain root access.
[Miscellaneous Android Development] iZLeeP:
Try pre-rooting the ODIN images. Go here and here for reference as we might be OT on this thread.
[Miscellaneous Android Development] Jeb1008:
Thanks I will look in to it.
[Miscellaneous Android Development] bovirus:
[MENTION=5186178]carliv[/MENTION]

I'd like if you can help though your experience.

I found a procedure to backup via adb the partition of phones with new Mediatek 64bit chipset (MT6732/MT6752).

The procedure use adb and dd command create a file image with a dump for every partition.

But dd make the image file bigger than real partition contents (dd make a dump of all partition also with empty space).

Do you think that is it possible using your kit decompress/ and recomrpess the system.img and data.img cutting empty space?

Could be possible iN Windows or could be possiblke in linux (to maintan file owner/permission)?

Do you have any suggestion to do that?
[Miscellaneous Android Development] :
Unfortunately my tool only works with boot and recovery images. For backup via adb there is a guide two years old, which is very good but will work only in linux, or in cygwin for windows (it uses shell). I don't think though that can be done only in linux, it is just nobody wrote a batch script for that in windows yet.
[Miscellaneous Android Development] AlexZap:
Not that this is the thread for it, but when you dd your image, use this to create a sparse file:

dd if=/dev/whatever | cp --sparse=always /dev/stdin disk.image

I know it works in Linux... dunno about windows/cygwin. You could probably pipe your disk.image over adb to back it up over your computer too.
[Miscellaneous Android Development] bovirus:
[MENTION=537037]cali[/MENTION]v

Proposal for future update.

When create the new Mediatek boot.img/recovery.img could be usefull to have new image with date_time (now is only with time)

Ex. I modified the script that repack new mediatek image

for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"

set MYDATE=%DATE:~6,4%.%DATE:~3,2%.%DATE:~0,2%

set MYDATE=%MYDATE: =%

set "timestamp=%dt:~8,6%"

set "newimage=%folder%_%MYDATE%_%timestamp%"

In bold my changes.

In this way the newimage always ended with _YYYY.MM.DD_TIME.img.

If you have more img created in different date it's easier to recognize it and are in alphabetoical order.

Thanks.
[Miscellaneous Android Development] :
Thanks, but I won't do that. I've choose the way it is right now after a lot of thinking (don't get me wrong, but do you really think I didn't know what you say?) and to be useful for the most of the users not just a few. You can modify it to suits your needs but others may not like it (I don't like, for example, that repacked images to have long names).

Cheers!
[Miscellaneous Android Development] bovirus:
I explain with sample

This afterneoon I created a new boot img.

the filename will be boot_1755.img (created at 1755)

Tomorrow I decide to create a new one (at 09:20)

The file will be boot_0920.img. Then i will have two file

boot_0920.img

boot_1755.img

Then the second one is the oldest but is not so easy to find that is the oldest at first check (seems most recent beacsue the list is based on time not on date). With my proposal will be

boot_20150527_1755.img

boot_20150528_0920.img

Now the list is alphabertical and in the date order.

I hope that is now more clear.
[Miscellaneous Android Development] xdarthanonx:
I use

set "timestamp=%dt:~[COLOR="Red"][B]0,12[/B][/COLOR]%"
[Miscellaneous Android Development] patrol31:
I have htc desire 820s, 64 bit with mt6752 chip. I was provided with a carliv cwm based recovery ported from Elephone P6000 with the same chip. It flashed successfully and can use it. However these:

1. It can mount partitions except data, which resulted to not backing up user data.

2.If I choose backup to sdcard, it gives mounting error. If backup to sdcard1, the backup can be found on external sd, which is, /storage/sdcard0 in my case. sdcard1 is the internal one. So, it is quite confused.

Can somebody help/point to me how to solve this problem?

Im trying to port the image using this kitchen to correct those errors, my first try, but having a hard time with the proper codes/lines to be placed on ramdisk files. I have repacked and tried 3 images already but same issues.

Hoping for your kind consideration, thank you.
[Miscellaneous Android Development] jbliz:
[MENTION=5186178]carliv[/MENTION]

I try to unpack boot.img using Image Kitchen v1.0 on Ubuntu 14.04. But it getting error and there is no files on ramdisk folder.

On Windows, it's working good.

Please help me with this.
[Miscellaneous Android Development] jbliz:
Which version of Carliv Recovery?

Have you try match usrdata mount points on recovery.fstab and fstab from Stock Recovery to Carliv Recovery?

I four times porting Carliv Recovery from MT6572 to another MT6572, and I have no trouble with mount, format, backup or restore.
[Miscellaneous Android Development] :
There must be something wrong with permissions after you unpacked the tool. If you did used the gui fileroller it must be a reason. Unpack it instead with terminal command and it should preserve the permissions. Anyway it's at your end because for me on ubuntu 14.04.1 it works flawless.
[Miscellaneous Android Development] opg:
[MENTION=5186178]carliv[/MENTION]

Hi! I can not unpack the boot.img MediaTek MT6735 android 5.1
[Miscellaneous Android Development] :
In your screenshot read the red line!
[Miscellaneous Android Development] AlexZap:
Hey, carliv, here is a recovery I couldn't unpack https://goo.gl/6E33bf. It is a ported twrp for the um I hammer.
[Miscellaneous Android Development] :
I don't know, for me it worked: http://imgur.com/a/SF6KA
[Miscellaneous Android Development] opg:
boot.img
[Miscellaneous Android Development] AlexZap:
Sorry... I am an idiot... I kept hitting regular unpack instead of mediatek unpack... D'Oh!

Your still the man, carliv!
[Miscellaneous Android Development] :
Have you tried with option 1 (Android regular)? Your image seems to not have the MTK header. In cases like this it helps to post all infos about that phone (name, manufacturer, etc) because maybe you can get a faster answer from someone who already knew that the phone doesn't have mtk header (like Android One phones).

Using Android regular script http://imgur.com/a/Tbi6f
[Miscellaneous Android Development] ghost45:
[MENTION=5186178]carliv[/MENTION] [MENTION=4478781]yuweng[/MENTION],

during the my last attempt to decript the boot and the recovery images from one new Zopo called Speed 7 (Zp951) octa core Mtk 6753 3gb Ram,

i receive this message from the Carliv v.1 program:

This errors appear during the boot decripting and during the recovery decripting.

If i Check well with other tools like "Bigrammy tools or also Yuweng tools" but i do not remember well who is the owner, i see that in the new boot and recovery is present the Kernel compressed and the ramdisk compressed.

kernel.gz

and

ramdisk.gz

If i decompress them the kernel became too big more than the 15 mb.

I tryied to leave it so big in new recovery but flashtool not recognize the files recovery,maybe i'm have passed the memory block ...but i don't know well.

These are the two files:

http://d-h.st/a380

What happened in these new two files? Possible that mediatek create new compression? and Why these two files are compressed?

I wait for your big and great answers .

thanks a lot for all what you do for everybody .......Thank you very much, friends.

:good:
[Miscellaneous Android Development] :
Same answer as for opg above. Option 1 (Android regular), because probably Mediatek header isn't present anymore in your images.

The name Mediatek in my tool commands doesn't mean to use it to all Mediatek phones, only for the ones with MTK header.

Cheers!

PS: I tested recovery.img and it unpack and repack well with regular commands.
[Miscellaneous Android Development] ghost45:
Thanks a lot Carliv,

i have opened one thread to how to rebuild this new recovery for new Mtk6753 ...here:

http://xdaforums.com/speed-7-plus/general/how-to-build-recovery-modded-zopo-t3184086

And of "Course" you have added inside together to all others friends.

thanks:good:
[Miscellaneous Android Development] chavv:
Tried the tool on Malis MX Base rom

Successfully unpacked using Option 1 (Android regular)

chipset is mtk6735 - it seems Mediatek are using "regular" packing in their roms for newest chipset?
[Miscellaneous Android Development] ghost45:
Yes is true,

Like what have said Carliv in several post ago.

Android regular Unpacking !

This step run also on Zopo Speed7 Mtk 6753

:p
[Miscellaneous Android Development] bovirus:
Then I have to change it into /scrripts/repack.ibat

Then I amde some changes like

set "timestamp=%dt:~0,4%.%dt:~4,2%.%dt:~6,2%_%dt:~8,2%.%dt:~10,2%"

it will create boot_2015.09.06_11.02.img

I will make two improvements

1. Substitute space for yme befroe 10.00 AM with 0

2. USe image file name as boot.img and create a zip instead like boot-yyyy.mm.dd-HH.MM.zip that contains boot.img
[Miscellaneous Android Development] LowTension:
[MENTION=5186178]carliv[/MENTION] If I need to port such as your CTR recovery, how do I replace the kernel?

recovery.img-base
recovery.img-kernel
recovery.img-kernel_offset
recovery.img-pagesize
recovery.img-ramdisk_offset
recovery.img-ramdisk-compress
recovery.img-tags_offset
[Miscellaneous Android Development] :
Well, you can do that just like I wrote in my porting guide (post no 2). Here is a quote:
[Miscellaneous Android Development] hohassan444:
thanks a lot , i succeeded in unpacking jiayu s3 mt6752 boot.img , after extensive search on internet.
[Miscellaneous Android Development] DarkHeart Z:
Changing partition table for more os installation . As always you are best carliv . Wanna give this a try :D
[Miscellaneous Android Development] DarkHeart Z:
Bro I can't decompile my boot.img . My device is mt6572 and I am using ubuntu 14.04 LTS 32 bit version . Please help :(
[Miscellaneous Android Development] EnerJon:
DarkHeart, it would be easier to help you if you can tell about any error message or some more details...
[Miscellaneous Android Development] :
I hope you will not quote the OP every single replay you make here. It will be enough just to use mention system, or just to post because I'm monitoring my threads.

So, exactly as EnerJon said, you have to post more info: what phone is that, what Android version, even attach a printscreen with the error and the image you can't unpack...

From what you say I have no clue. Do you know how many mtk phones have mt6572?
[Miscellaneous Android Development] DarkHeart Z:
Sorry

But I didn't mean any offensive meaning . I always appreciated your work and I also didn't mean anything to bother you if it wasn't that much important . I gave you cheer up before just to appreciate you . When I faced problem I came here to ask for your help . And also there are a lot of people posting their problems or suggestions etc. and also I know that you are so much busy . And that is the reason why I quoted you so that you would give me a solution for my problem . And didn't meant anything which leads to 'you don't have any clue' also . No offense . I have attached all infos you have asked for and some addtional infos too . sorry for double quoting before once again . My phone is symphony w82 .
[Miscellaneous Android Development] :
I didn't take any offense, I just wanted to save some space in my thread.

To attract my attention it is enough to do this [MENTION=5844027]DarkHeart Z[/MENTION] only with my username.

Attached is your boot.img unpacked and repacked in my ubuntu 14.04 but 64 bits. So your problem is either some permissions messed up (this happens sometime if you unpack the kitchen zip with the gui file roller and is better to use command line) or the fact that is used in a 32 bits environment. Probably the best thing for you is to install de 64 version, especially if you're planning to do other android stuffs, because this is the version recommended by google.
[Miscellaneous Android Development] DarkHeart Z:
but my processor only supports 32 bit only . Even if I want to , I can't install 64 bit version of any os . My processors instruction set is 32 bit . Isn't there any solution bro ? your windows version works like a charm without any problem . but all my work is done under ubuntu ( 32 bit ) mostly . Do you have a 32 bit compatible executable ? i can replace it with the present one if you can provide me one ? will it gonna happen the same with cygwin too ? Because I am using superr's kitchen for my projects and your kernel kitchen is a part of it . Clearly it's the main part for bootimg unpacking :(