yashsingh1/xdaforums huggingface dataset:
[Android Software Development] osm0sis:
Whoops bro! Turns out I forgot to include the new mkimage/dumpimage builds in the original AIK-mobile v3.2 upload! Oh well, I guess only 112 from the DevDB upload and 6 so far from the new BasketBuild upload have downloaded, so I just reuploaded it with that corrected!

Please, all, download again. :silly:;)

Edit: And one more time because I bumped the AIK-mobile version to 3.3 by mistake when I repacked it.. Sorry to the 12 who downloaded! Maybe I shouldn't be developing when I've got a chest cold this bad? :rolleyes::p
[Android Software Development] problemathic:
okay. will download it now. only the aik mobille right? :)
[Android Software Development] Vagelis1608:
Give him an hour or two.

He might realize that he messed up something else too.

Just kidding :p

Get well soon, man.
[Android Software Development] problemathic:
wait what? is he sick ? get well soon bro.
[Android Software Development] osm0sis:
Nah, this one's pretty solid. Download away. :p

Chest cold is clearing up, but the head cold drags on. :fingers-crossed:
[Android Software Development] serajr:
New sin?

[MENTION=4544860]osm0sis[/MENTION] [MENTION=4120742]munjeni[/MENTION]

Here is the kernel from the new xperia XA2 Ultra (2018).

AIK 3.2 output:

Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: XA2_Ultra_H4233_50.1.A.4.102_kernel.sin

Setting up work folders . . .

Unrecognized format.
Error!

And kernel_dump:

--------------------------------------------------------
Sony Any kernel Dumper by Munjeni @ 2016
--------------------------------------------------------
Created ouput folder "out"
opening XA2_Ultra_H4233_50.1.A.4.102_kernel.sin
XA2_Ultra_H4233_50.1.A.4.102_kernel.sin is Sony sin v4 format.
setting up infflate...
infflating...
infflate returned: 0
gzpipe: ok.
unziped: ok.
Extracting from XA2_Ultra_H4233_50.1.A.4.102_kernel.sin
Extracting file out/XA2_Ultra_H4233_50.1.A.4.102_kernel.crt
Extracting file out/XA2_Ultra_H4233_50.1.A.4.102_kernel.000
End of XA2_Ultra_H4233_50.1.A.4.102_kernel.sin

Maybe you could look into that when you have some spare time!

Thanks in advance!
[Android Software Development] Skrappy187:
Ok thank you....I have leard somethings since my last message. What I am trying to do is extract or download my stock recovery img. With the aid of AIK.apk I was showing on youtube how to unpack twrp and repack it in the stock img. Stock recovery img needs to be unpacked before Custom Image repack. Then flash via the (I think) update from ex sd card in the recovery mode on my Samsung Galaxy on5 device. Android V. 6.0.1....SM-G550T1
[Android Software Development] osm0sis:
No.. It's just gzip, just gunzip it first, then it's an AOSP boot.img ;)
[Android Software Development] ashyx:
You're trying to do what?

Why do you need to unpack the stock recovery image to use with TWRP?

Also you can't flash anything with stock recovery except official updates.

Maybe I'm not clear on what you're attempting to do?
[Android Software Development] osm0sis:
Ugh.. just noticed he said he's using the "AIK" APK from that imposter on the Play Store. :(
[Android Software Development] ashyx:
Ah yes, bloomin rat bag. :mad:
[Android Software Development] Vagelis1608:
You should report it.

Just saying...
[Android Software Development] ashyx:
Google don't give a monkeys. :rolleyes:
[Android Software Development] Vagelis1608:
You never know.
[Android Software Development] serajr:
Thank you bro! Unpacking it twice did the trick!!

Could AIK do that check and deal with this kind of file/compression in future versions?

(users, including me, may think there's something wrong with the input file)
[Android Software Development] osm0sis:
I've tried twice. They ignored my takedown requests, no follow-up whatsoever.

Someone told me he rebranded in his Play Store Beta to "Image System for Android" (I guess abbreviated as AIS, since that's how he currently does AIK, presumably to avoid stealing my name entirely :confused:), but the beta is from May last year, and I'm sure he's dragging his feet because of the donations he gets due to the confusion. :mad::rolleyes:

But AIK isn't meant to be 7zip... What you're suggesting would be making it unpack anything gzip as "SINv4", which isn't really super sensible, nor correct.

Samsung people understand they need to untar their ODIN .tar files before unpacking, Sony people will just have to learn that SINv4 is just gzip and to gunzip before.
[Android Software Development] Zerbonwski:
Someone can send me the previous version please
[Android Software Development] Vagelis1608:
Why would you need that?
[Android Software Development] Zerbonwski:
Because seems that I have a problem with the new version, so I want to test if I solve the problem with the old version
[Android Software Development] xdarthanonx:
Sure
[Android Software Development] Zerbonwski:
Lol you are so funny teach me how to become like you...

btw I need the 3.1, not the oldest version
[Android Software Development] xdarthanonx:
https://androidfilehost.com/?fid=890129502657589071 (thanks Google!)
[Android Software Development] osm0sis:
What's the issue? Can you elaborate? Device info, logs, uploaded image.

I'd like to try and reproduce it if there's an issue that needs fixing. Other than people not reading/experimenting to understand how permissions on Windows work with rooted boot.img dumps in v3.0+ (so, user error) I haven't had any reports.
[Android Software Development] KaaMyA:
Sorry for quoting this old post, osm0sis, but I'm facing a similar problem to kessaras in those days, I'm trying to modify some splash images for Xiaomi Mi A1's TWRP recoveries (Fastboot booteable, and TWRP installable ones), but always I try to "unpackimg" I get the following text. I use Windows10x64 + AIK 3.2:

Setting up work folders . . .

Unrecognized format.
Error!

I followed you recommendation and as response, I received this text following response:

..\boot.img: AOSP bootimg

I went back to "unpackimg" by drag and drop, and command, but the same Error! message appeared.

Is there something I forgot to do?

This TWRP recovery can be found below, I'm not sure if this is also related to unicode characters written inside modded Recovery:

https://xdaforums.com/mi-a1/development/recovery-twrp-3-1-1-0-touch-recovery-t3688472

Thanks in advance!
[Android Software Development] osm0sis:
Upload the image for me please. I'll see what I can figure out.
[Android Software Development] KaaMyA:
Sorry, I was editing my post while you replied me. :D

There I linked mohancm's thread, who is the author.

These are the links:

1- This is the TWRP bootable recovery: https://www.androidfilehost.com/?fid=818070582850498337

This file has to be used to boot as TWRP recovery only, and then install TWRP installable recovery from there. It affects Xiaomi Mi A1 boot.img.

2- This is the TWRP installable recovery: https://www.androidfilehost.com/?fid=746010030569959456

Inside this Zip you'll find a ramdisk file I was also hoping to change its splash screen, because after installed, it keeps fixed on device.

Thanks again :)
[Android Software Development] osm0sis:
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: recovery-3.2.1-2-oreo.img

Setting up work folders...

Image type: AOSP

Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78af000 androidboot.selinux=permissive buildvariant=userdebug
BOARD_KERNEL_BASE 80000000
BOARD_NAME
BOARD_PAGE_SIZE 4096
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 01000000
BOARD_SECOND_OFFSET 00f00000
BOARD_TAGS_OFFSET 00000100
BOARD_OS_VERSION 7.1.2
BOARD_OS_PATCH_LEVEL 2017-11

Unpacking ramdisk to "ramdisk/"...

Compression used: gzip
40415 blocks

Done!

Working fine in AIK-mobile. Looks like a normal image, should be fine in Windows as well.
[Android Software Development] KaaMyA:
Well... that's the same I think, but I didn't have this problem before.

I was used to do this procedure with different devices like Huawei Boulder, Moto G, Samsung Galaxy Grand Prime, Samsung Captivate Glide, as well as with Moto X2... all with Windows7x86 or Windows10x86.

I'm not sure if this is related to Win10x64, or if there's something I have to install in order to make AIK run well in this architecture, but I forgot to.

As I told you, no matter if i Drag the file, or I run via command, the response is the same. :eek:
[Android Software Development] osm0sis:
Does it work for you on AIK-mobile or AIK-Linux? I'll try it on my x86 Windows 10 when I get home tomorrow. Where do you keep your AIK directory (exact path please)?

Also, the "ramdisk.img" in that TWRP zip is just a .cpio.gz I believe, so if you aren't comfortable with unpacking that manually you could add it to an AOSP .img and then use AIK to unpack, and then repack, just grabbing the ramdisk-new.cpio.gz from the process.

Edit: [MENTION=1733798]KaaMyA[/MENTION] I tried recovery-3.2.1-2-oreo.img with AIK on Win10 x86 and it worked perfectly as well. Can you answer my above question about where your unzipped "Android Image Kitchen" directory is located?
[Android Software Development] wadpasu@gmail.com:
#2
[Android Software Development] KaaMyA:
[SOLVED] Thank you so much, osm0sis... I'm worried because I found the cause of this problem... and I was the mentor.

I had AIK located in a path that had a folder with "[" and "]" characters, so, since you mentioned AIK's folder location, I checked it and deleted those characters. All worked OK and I was able to unpack TWRP image correctly.

I'm afraid I took your time with this, because I respect you so much.

PD: I'll also take a look to what you mentioned about ramdisk image ;)

You've my thanks and symphathies :cowboy:
[Android Software Development] wadpasu@gmail.com:
:laugh:
[Android Software Development] martyfender:
Just out of curiosity, were those strange characters in the folder structure a user error, or did Windows somehow create them?
[Android Software Development] KaaMyA:
Well, friend, they were my fault.

I installed Windows10x64 on my PC (I had Windows10x86), and when I started to reorganize things, I created a little happy folder named [Android], and put all tools and things inside it. Then I just simply forgot how could that cause problems to all inside it, like in this case.

On the other hand, I don't know how to edit things from the ramdisk (recovery) img osm0sis was talking about.

If that's a CPIO file, I could extract it and replace PNG images there, but... using Windows, I'm total afraid that I don't know how to update that folder as a new CPIO file. I tried PeaZip and I know AIK has a little tool GPIO inside, but I don't know how to use it.
[Android Software Development] osm0sis:
It's roundabout, but unpack your other TWRP .img, delete the split_img/*.cpio.gz, put your ramdisk.img from the TWRP zip in there renamed as temp-ramdisk.cpio.gz, repackimg --original into image-new.img with the kitchen, then rename image-new.img to temp.img, unpack temp.img with the kitchen, edit what you want in the ramdisk, repack normally with the kitchen, then copy and rename the ramdisk-new.cpio.gz as ramdisk.img if you want to replace the one in the zip.
[Android Software Development] KaaMyA:
[SOLVED] Thank you so much, friend.

Worked like a charm!! ;)
[Android Software Development] agus_ulo:
Hey guys im compiled kernel from linage os kernel sources and succesfully, im get Image.gz-dtb on arch/arm64/boot

And unpack boot.img from lineageos.zip rom. Then replace boot.img-zImage on split_img directory with Image.gz-dtb (renamed boot.img-zImage).

Repacked again succes new-image.img, and Im try flash image with twrp, but my problem stuck on mi logo..

Any solutions this problem thank you
[Android Software Development] osm0sis:
Are you using unpackimg.sh --nosudo in AIK-Linux? Don't. Also since you're not touching the contents, use repackimg.sh --original

If none of that works then there's a problem with the zImage you made. You can easily check that by using AIK to unpack and repack the ROM boot.img without adding your zImage (with and without --original) and seeing if it boots.
[Android Software Development] osm0sis:
[MENTION=1733798]KaaMyA[/MENTION]

I'm still trying to reproduce this issue on my PC, I've tried making a "[Android]/Android Image Kitchen" on my desktop but it still detects AOSP and unpacks correctly for your "recovery-3.2.1-2-oreo.img" file. Can you tell me exactly what the full path directory was that you were running AIK from so I can see about maybe fixing it in the next version? You still haven't actually told me!
[Android Software Development] osm0sis:
Any Windows 10 x64 users able to replicate the issue based on the information he's given so far?
[Android Software Development] ashyx:
I can try it later, but he doesn't state the path of the folder.
[Android Software Development] shadavis08:
Is the AIK mobile installer just a flash able zip? Or do I need to do anything else? I'm trying to use a twrp themer to change the splash screen and it keeps saying download AIK mobile installer. Thanks for any help!
[Android Software Development] ashyx:
Yes, it installs via custom recovery or you could use Flashfire on a rooted device.
[Android Software Development] osm0sis:
Yeah, just try the "[Android]/Android Image Kitchen" from your desktop, since we don't have the rest of the path. Please and thanks! :)
[Android Software Development] ashyx:
Unpacked absolutely no issues. Detected as a standard AOSP image, unpacked perfectly.
[Android Software Development] osm0sis:
Thanks. Well, I guess unless he drops back in with a proper log and report we'll chalk it up to pure user error. :good:
[Android Software Development] lehmancurtis:
I have experienced said error once. I over populated the AIK folder without running cleanup.sh. I corrected it in my case by running the cleanup bash twice in a row. On an unrelated note, which files are responsible for the functionality of the digitizer (touch screen)?
[Android Software Development] lijianjunyonghu:
Hello friends I have a Qualcomm S8 trapped in the boot repeatedly restart

I want to know where the problem is

Can you help me?
[Android Software Development] osm0sis:
Often firmware files in vendor or a persist partition, with some compiled-in code in the Image.gz. Sometimes there are some sysfs values you can modify with a boot .sh/.rc script, but you'd have to dig around in /sys while booted to see what you've got.

There are maaaaany reasons that could be happening. You should go open a Q&A thread on the S8 subforum. They should be able to better direct you to narrow it down and hopefully fix.
[Android Software Development] lijianjunyonghu:
ok
[Android Software Development] ashyx:
Please don't unnecessarily quote issues unrelated to your question.

The OP will see your post.
[Android Software Development] tanish2k09:
[MENTION=4544860]osm0sis[/MENTION]

I want to use mkmtkhdr binary in anykernel2 script for flashing kernel on certain mtk boot img properly

Currently using only mkbootimg causes bootloop.

My device is Lenovo A7000-a (code aio_row)

The chipset is MT6752

The mkmtkhdr.c source makes clear that the usage command is :

mkmtkhdr --kernel $zImage --rootfs $ramdisk_file

I've even attached a boot.img that I'm using.

Can you help me with the following :

1) For --rootfs parameter, what am I supposed to pass? The compressed ramdisk.gz file? Or the path of extracted ramdisk folder?

2) If that parameter is the ramdisk.gz file, when am I supposed to call the mkmtkhdr command? Before decompression of ramdisk.gz or after the ramdisk is recompressed to ramdisk-new.gz?

I really couldn't find an example where mkmtkhdr is used so I had to ask directly. Sorry if my question is too dumb, but please help me because I'm basically stuck until I make the script for flashing the kernel work.

Boot image : https://drive.google.com/file/d/1NL9M7m3Bzr0vCzJobKnq__Bsh7foZF3O/view?usp=drivesdk
[Android Software Development] osm0sis:
Read the AK2 thread/README.. I make it pretty clear mkmtkhdr can just be dropped into the tools folder to enable the functionality. Just grab it for the architecture you need from AIK-mobile.
[Android Software Development] lehmancurtis:
Works for Coolpad 3622a
[Android Software Development] KaMyKaSii:
[MENTION=4544860]osm0sis[/MENTION] a friend attempted to do an unpack-repack without modifications through AIK for Windows but an error occurred while signing the image. I thought it would probably be a problem with his setup, so I asked for the file to be made via AIK Mobile myself. But at no time did AIK Mobile report anything about signing. Is it expected or a bug? Here's the image if you need to take a look. Thank you!

https://drive.google.com/file/d/1bsgyYbw6ECsEHuj3cvtU29GrSwzXkSjc/view
[Android Software Development] duckbearlab:
Thank you! That's awesome :D
[Android Software Development] Wolfcity:
I never have been asked to sign an image with AIK for Windows. Just unpack it, do your stuff and repack it again.
[Android Software Development] osm0sis:
At first glance looks like there are a few things going on with this image.. it's got the BFBF pre-header (see the 2nd OP), then it may have a kind of AVBv1 signature on the end, but then there's yet another chunk or two of more data after it which might be part of the BFBF signing, or yet another signature?

From what I've seen with the new BFBF signed files from MTK so far, there isn't a high likelihood it'll work repacked since AVB is far from the only signing done on their files and the other ones are proprietary (plus we don't have their key for AVB either if they enforce that).

That said, I'll take a closer look and if that is a weird little AVB signature tucked in there I'll try to make sure it gets detected on all platforms for AIK v3.3.
[Android Software Development] ipdev:
I tried a few of my own and then tried the one you linked. No errors but, no signing on mobile.

Not sure if it helps.

I can not speak for Win 10 but, here is what I get with Mac and Nexus 7. PasteBin

macOS 10.13.4

AIK-Linux-v3.2-ALL

Linage 14.1

UPDATE-AIK.Mobile.Installer.v3.2-ALL-signed
[Android Software Development] osm0sis:
AVB signing works here on other normal images, like my stock OP5T boot.img:

Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: boot-A5010_43_180420.img

Setting up work folders...

Image type: AOSP

Signature with "AVB" type detected.

Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 sched_enable_hmp=1 sched_enable_power_aware=1 service_locator.enable=1 swiotlb=2048 buildvariant=user
BOARD_KERNEL_BASE 00000000
BOARD_NAME
BOARD_PAGE_SIZE 4096
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 01000000
BOARD_SECOND_OFFSET 00f00000
BOARD_TAGS_OFFSET 00000100
BOARD_OS_VERSION 8.1.0
BOARD_OS_PATCH_LEVEL 2018-04

Unpacking ramdisk to "ramdisk/"...

Compression used: gzip
9342 blocks

Done!

Like I said, it's likely all the extra crap at the end of KaMyKaSii's recovery.img and similar images screwing up the tail search in some instances. If you've got some more examples of images you're certain are AVBv1 signed but are being missed by AIK, then please upload them and I'll make sure they work for AIK v3.3 as well.

Edit: Confirmed as I thought above. You can fix it right now in AIK-mobile by opening unpackimg.sh, going down to the line that starts "tailtest=" and changing both instances of 4096 to 8192. :good:

My guess for the error in Windows is that KaMyKaSii's friend doesn't have Java 8+ installed correctly.
[Android Software Development] ipdev:
The recoveries I tried are from a BLU R2 LTE MT6735 and the newer Nook 7 BNTV-450 MT8163.

I do not have the above linked Quantum Q13 MT6753 so I can not give that a proper test.

All three had no errors when signing with AIK-Linux.

Building image...

Using format: AOSP

Signing new image...

Using signature: AVB recovery

All three with AIK-Mobile.

Building image...

Using format: AOSP

Done!

If you want to look at either of the ones I compared it with.

BLU-R2

BNTV-450

I tried your edit on Mobile. Worked with the Q13(MT6753) recovery and BLU-R2(MT6735). I'll try BNTV-450 and some more tomorrow (now today :) ) after sleep and work.

Edit.

Note both R2 and Nook will boot unsigned images.
[Android Software Development] ipdev:
AIK-Mobile v3.2 - With the edit.

Barns and Noble Nook 7 (BNTV-450)

BLU R2 LTE

AIK-Mobile v3.2 - As is or with the edit.

BLU R1 HD unlocked bootlader.

Nextbit Robin (ether)

All four work fine with AIK-Linux-v3.2-ALL macOS 10.13.4

Maybe a few new devices for the known working device list. :)
[Android Software Development] onliner:
Hi!

I was reading about this project and I had some doubts.

Is it possible to unpack stock boot.img from a rom and use AnyKernel2 to install the kernel in other roms? From what I've read, the answer is: yes, assuming that: after unpacking the boot.img I get several files in a directory called "split_img", how can I convert "boot.img-zImage" to "Image.gz-dtb"? (This format corresponds to a custom kernel for my device that uses AnyKernel2) Or should I use another file? I'm new with kernel stuff ?.
[Android Software Development] osm0sis:
Between ROMs on the same device maybe, but there is a lot of device/hardware-specific code compiled into the zImage/Image.gz (they're the same thing), so you can't use the same kernel binary on drastically different devices.
[Android Software Development] onliner:
Yeah, my idea was for one device, but the best thing seems to be to build the kernel.

Thanks!
[Android Software Development] levanhau03:
[MENTION=4544860]osm0sis[/MENTION]

please help me

https://xdaforums.com/showpost.php?p=76756351&postcount=1873
[Android Software Development] osm0sis:
Nobody can until you follow the instructions you were given:

I need the unaltered boot.img you're trying to unpack, information about the system you're trying to unpack it on, and ideally a log from your attempt to unpack it.
[Android Software Development] drakulaboy:
i can't unpack this boot.img (from a tv box with Amlogic S912 cpu ) Android 7.1.2, thank you very much.
[Android Software Development] osm0sis:
Just a reminder to myself that extracting a file dragged from anywhere would be nice for the next release. ;)

Edit: K. Already fixed. Basically a typo when I was coding it the first time. :p

Line 32-33:

%bin%\unpackbootimg -i "%~p0%~n1%~x1"
%bin%\dd ibs=1 count=2 skip=22 obs=1 if="%~p0%~n1%~x1" 2>nul | %bin%\od -h %errout% | %bin%\head -n 1 %errout% | %bin%\cut -c 9- %errout% > %~n1%~x1-ramdiskaddr

Just needs to become:

%bin%\unpackbootimg -i "%~p1%~n1%~x1"
%bin%\dd ibs=1 count=2 skip=22 obs=1 if="%~p1%~n1%~x1" 2>nul | %bin%\od -h %errout% | %bin%\head -n 1 %errout% | %bin%\cut -c 9- %errout% > %~n1%~x1-ramdiskaddr

%~p0 is the path of the batch file (ie. current working folder) where %~p1 is of the supplied file/name.

Edit 2: Little snag, the above breaks commandline usage. I think that's why I did it the other way originally. :rolleyes:

Edit 3: For some bizarre ass reason %~f1 (full path) doesn't even work, but putting set "file=%~f1" and then using %file% does. :confused: Whatever, problem solved. :p
[Android Software Development] osm0sis:
No source unfortunately so I can't make a Win32 Cygwin build...

The good news is big papa Cyanogen has also updated for dtb:

https://github.com/CyanogenMod/android_system_core/blob/cm-10.2/mkbootimg/mkbootimg.c

Should have all the fixes we need. Not sure how we get the dtb out of the original image though.. working on it.

Edit: https://github.com/osm0sis/mkbootimg/commits/cm-10.2 :D

[MENTION=581992]hkfriends[/MENTION] [MENTION=3866535]danieljamie[/MENTION] I need some Snapdragon 800 device people to test out dtb before I can release v1.8. The images look good but I need to be sure that the dtb is okay and working when just rebundled under all circumstances. Please lend a hand. You or any other volunteers, please PM me.