yashsingh1/xdaforums huggingface dataset:
[Android Software Development] martyfender:
I have no experience with SonyXperia devices, but that looks like a similar message I get on my device if dm_verity is not disabled in the boot.img ramdisk, in other words, Android Verified Boot.

Here is a post I used as a guide on how to do that. I'm sure Osmosis will correct me if I am wrong for Sony devices.

https://xdaforums.com/nexus-5x/general/modified-boot-imgs-android-n-t3495169/page8
[Android Software Development] levone1:
Thanks

I have fstab.qcom. Lines are not the same. There is

/dev/block/bootdevice/by-name/system...

With empty space already after 'wait', but no

/dev/block/bootdevice/by-name/vendor...

So, maybe not related... Anyway, at this point, I'm more curious about why my new bootimg that gets created with 'repack' command doesn't work. Am I missing something? For example, if I simply use unpack bootimg, then without doing anything to the files, use repack bootimg, the resulting new bootimg is half the size and doesn't boot...
[Android Software Development] osm0sis:
Sony ELF formats are pretty varied, so it's hard to say. Some devices just don't accept the AOSP format and require the ELF instead, which is why Boot Bridge was made. You could start by uploading the kernel.elf in question.
[Android Software Development] levone1:
Sorry, you reminded me of something I should have mentioned- custom stock-based kernel, (Genesis). Boot IMG I'm using came from a dump with dd command. Also, kernel patched with su and ta tool...

I guess best thing would be to try first with clean kernel...
[Android Software Development] osm0sis:
Also upload the image like I asked. I can't help you based on anecdotes and screenshots.
[Android Software Development] levone1:
...

https://mega.nz/#!5xMzhYiZ!bm23XMXJWzxQap_VBzMu9npn1vmBclEI3LIgzilXhWQ
[Android Software Development] qqzwc:
A Powerful,Wonderful And Useful tool~~~
[Android Software Development] osm0sis:
Interesting, so it's already an AOSP boot.img.. There is something weird about it though because it's missing the sha hash that is normally part of the header so the script had to make the assumption that it was sha1.

You can change the contents of the split_img/boot.img-hash file from sha1 to sha256 and see if that works, but otherwise I don't see any reason it shouldn't work at first glance. That being missing could indicate something else being different in the boot.img format used so you should probably ask the Genesis Kernel dev to see how they do it. Let me know what the story is, please.

The reason the resulting file is smaller is because you have a dump of the entire partition but the actual contents are only a portion of that. Running your boot.img dump through my Flashlt package's trimit.sh script removed the padding brought it down to 27.5mb, about the same as the repack.

Edit: Hmm, repackimg.sh --original is still producing a 26.5mb file where it should be identical (other than the header hash), so perhaps there's a signature in that 1mb difference.. I'll take a closer look when I'm home in front of my PC again tomorrow.
[Android Software Development] levone1:
I posted in Genesis thread. I'll let you know. BTW - I have no boot.img-hash file...
[Android Software Development] osm0sis:
Uh, not possible if you are using the latest AIK, it was added in v2.7. Make sure you're using the latest.. mkbootfs would also explain why it wouldn't boot, which is the reason it's gone as of v3.0+.

This is the output from your boot.img with AIK-mobile v3.1:

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

Supplied image: boot.img

Setting up work folders...

Image type: AOSP

Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 zram.backend=z3fold earlyprintk
BOARD_KERNEL_BASE 00000000
BOARD_NAME
BOARD_PAGE_SIZE 4096
BOARD_HASH_TYPE unknown
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 22000000
BOARD_SECOND_OFFSET 00f00000
BOARD_TAGS_OFFSET 00000100

Warning: "unknown" hash type detected; assuming "sha1" type!

Unpacking ramdisk to "ramdisk/"...

Compression used: gzip
60044 blocks

Done!

And the resulting split_img directory:
[Android Software Development] levone1:
That was it. Latest version took care of it. I had 2.6...

Thanks
[Android Software Development] osm0sis:
Seriously?

Man, I've been pretty patient with your terrible bug reporting so far, i.e. no output/log, no boot.img, etc., but if this whole time you haven't even been using the latest version then, what the ****? Why are you wasting your and my time on bugs I've actually already fixed? I mean, holy ****! Beyond frustrating... :mad::eek:
[Android Software Development] levone1:
So sorry - I downloaded from afh dev called Ah raj, https://androidfilehost.com/?fid=529152257862720645, and found this thread later. I didn't think to check for updates. I'll be more thoughtful in the future. Thanks for your work. I'll go to your donate link.

____________

Donated. Thanks again...
[Android Software Development] jack allen:
Im having trouble locating the actual AIK 3.0/3.1 ZIP i click on the links and just get passed from forum to forum
[Android Software Development] Paschfire:
Scrolling down further in the OP till you see Downloads(see pic)
[Android Software Development] jack allen:
Sweet, thank you bro.
[Android Software Development] osm0sis:
[MENTION=7798662]AH Raj[/MENTION], take it down. No rehosting. Case in point of why I don't allow it.

[MENTION=6283426]levone1[/MENTION], thank you. I appreciate that. Glad you were able to get it working.

I looked into that extra 1mb and it looks like an unlisted or hidden dtb + SIN/NIS cert appended to the end, so if all else failed you could try and hex edit it from the trimmed original onto the repacked img. :good:
[Android Software Development] djb77:
Just noticed the 3.1 release, I'll give it a shot and see how it goes.

Thanks for the update :)
[Android Software Development] tripLr:
Noob questions

Does this unpack a oem full ROM? ie bootloader, radio etc.

Does this work on Oreo Trebel?

Thanks in advance
[Android Software Development] osm0sis:
Be sure to check out the release post. I explain the situation with the --nosudo mode I added for you there. :good::)

Read before you post. The answer is pretty obviously no. It's in the title of the thread even.
[Android Software Development] osm0sis:
That's because a) -o needs to be a directory, and it needs to exist, and b) you shouldn't be putting a boot.img into the bin, that's only for important required files and binaries for AIK-mobile to function, read the instructions in the OP and AIK-mobile release post again..

[MENTION=5483848]PiggyFlooper[/MENTION], if there was an error, then post the log and the boot.img you're trying to unpack. Also, what "boot.img supplied" are you talking about? There is no boot.img supplied in my AIK-mobile zip.. :confused:
[Android Software Development] PiggyFlooper:
Here it is
[Android Software Development] PiggyFlooper:
Ok, I did what you mentioned, and unpacked it into a ramdisk folder, but it didn't unpack the way I need it to to edit, it's stuck inside a .gz file, how do I unpack that and repack?
[Android Software Development] osm0sis:
Okey so I reread your posts, you clearly deleted bin/ramdisk.img. It's not "an example boot.img", you deleted the most important component in AIK-mobile v3.0+. ;)

Reinstall to get that back and all should work.
[Android Software Development] PiggyFlooper:
That's what it was, my mistake

I tried it again with ramdisk.img in place and the output was the same- an uneditable .gz file

I used terminal emu.-

/data/local/AIK-mobile/bin/unpackbootimg -i /data/local/AIK-mobile/boot.img -o /data/local/AIK-mobile/ramdisk

Then I tried the unpackimg.sh with following results:

Android Image Kitchen - UnpackImg Script

by osm0sis @ xda-developers

Supplied image: boot.img

Removing old work folders and files...

Setting up work folders...

mount: can't read '/etc/fstab': No such file or directory

My fstab is at /fstab.qcom

Not in /etc

What can I do now?
[Android Software Development] osm0sis:
Um yeah, that's what AIK's scripts are for, so you can unpack and edit the cpio files.

Why haven't you uploaded the boot.img yet? This is still sounding an awful lot like user error.
[Android Software Development] PiggyFlooper:
I suppose it may be user error

Here's the upload -

https://www.dropbox.com/s/w7wk6dybeife1bh/J7boot+ramdisk.zip?dl=0

It has the boot.img along with the ramdisk edits I've been trying to add
[Android Software Development] osm0sis:
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: J7boot.img

Setting up work folders...

Image type: AOSP

Footer with "SEAndroid" type detected.

Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE console=null androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 androidboot.selinux=permissive
BOARD_KERNEL_BASE 80000000
BOARD_NAME SRPPI22A000KU
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02000000
BOARD_SECOND_OFFSET 00f00000
BOARD_TAGS_OFFSET 01e00000
BOARD_OS_VERSION 7.0.0
BOARD_OS_PATCH_LEVEL 2017-02
BOARD_DT_SIZE 1488896

Unpacking ramdisk to "ramdisk/"...

Compression used: gzip
20354 blocks

Done!

No issues here. If you're running it from your file explorer app, try it from FX File Explorer instead, I've never had any issues with it.

First, redownload and reinstall AIK-mobile v3.1 from the OP.

Then, here's what I did to get the above:

1) Extract J7boot.img from your zip and move it to /data/local/AIK-mobile using FX

2) Run unpackimg.sh in FX (detailed picture instructions here)

Nice and easy. :):good:
[Android Software Development] DodoGTA:
Or just run the script from Termux or other terminal emulator :p
[Android Software Development] osm0sis:
Oh absolutely, but I think the issue may lie with a) a bad file explorer app, and/or b) unfamiliarity with the *nix command line, so instead I'm suggesting a nice and easy way via FX, a known working explorer app. :good::)
[Android Software Development] shoey63:
Too much typing for mine. In FX, unpacking is 3 taps of the screen plus type boot.img in the command line parameters.

Repacking is just 3 taps, with no parameters[emoji16]
[Android Software Development] osm0sis:
And no need for boot.img or path on the unpack parameters even, as long as you copy it into the AIK-mobile dir beforehand. :good:
[Android Software Development] ashyx:
That used to be the case with earlier versions, but the latest version I have installed I have to give the full path in the command.

This is in a terminal emulator.

It may be an error my end, so I'll try re-installing.
[Android Software Development] osm0sis:
Working fine here in Terminal Emulator with AIK-mobile v3.1 run as just `./unpackimg.sh` in /data/local/AIK-mobile with a .img in the directory with it.
[Android Software Development] ashyx:
It seems he's attempting to unpack the boot.img from this which is not the stock boot image as it's modified to include Supersu:

https://xdaforums.com/galaxy-j7/development/root-sm-j727p-galaxy-j7-perx-td-lte-t3611202

It unpacks perfectly on Windows, but I have a strange issue on AIK-mobile. When I unpack any boot.img it adds extra folders in the ramdisk folder, one of them being /ETC which seems to be linked to the /ETC directory of my phone as it shows all my files and folders on my phone, WTF? :confused:

This is on a HTC M8 running MM.
[Android Software Development] osm0sis:
That's a non-issue. They are symlinks and repack as symlinks. It's always been that way.
[Android Software Development] ashyx:
That works, but I could have sworn in a previous version I didn't need to change to the AIK directory and could just run unpackimg.sh from wherever, didn't even need to type su first.

Maybe It's me and I'm dreaming.:silly:

---------- Post added at 01:41 PM ---------- Previous post was at 01:22 PM ----------

Right, of course. Thanks.
[Android Software Development] osm0sis:
Definitely always had to type su first (unless you used the `aik` command first, which does that and switches to the AIK-mobile directory).

You can also use it in any directory, but when no (at least relative - added in v3.0) filename/filepath is supplied it only looks in the AIK-mobile directory.
[Android Software Development] ashyx:
Maybe that's it then. Thanks.
[Android Software Development] Swakamthe:
Hello, i am using mi max 32 gb miui 9 stable os

I tried android image kitchen in that there is no error while unpacking image file but while repacking I got an error as,

signing new image.....

using signature: AVB boot

error!

and a new image file is created as unsigned-new.img which is not bootable.

please help me in this.
[Android Software Development] ashyx:
At least post the specs of your device and the image you're trying to repack. :rolleyes:
[Android Software Development] osm0sis:
AVB signing requires JRE 8+, as written in the OP.
[Android Software Development] problemathic:
Anyone have a GUI for this? Thank you. That would be awesome.
[Android Software Development] ashyx:
A GUI? Seriously? :eek:

It couldn't be more simple to use.

How hard is it to double click a batch file?
[Android Software Development] problemathic:
yeam im serious. just having an interface is good. and also i state that if anyone have. im not asking on the developer making this script.
[Android Software Development] ashyx:
Why, there's simply no need? :silly:
[Android Software Development] DaniDeVega:
Sure, I think that it's not really necessary, but it would be easier to understand for people who comes for the first time to "developing world" or (at least in my situation) that aren't very experienced and/or always used Windows cmd codes being very noob using Linux codes.

My example:

If I get stuck in a so apparently easy kind of work, me, that I'm yet learning but used few kind of dev tools since many time ago, I can now imagine the mind of the most completly posible noob who make a try with this.

I don't know how of difficult is to build a Gui for such kind of tools, but it would be easier for all and help noobs (and not so noob) to learn about developing. Is a suggest, because just building that kind of tools, is a very great (and usually very hard) work to have all devs very thanked about them. :)

No one was born as an expert. Let's help the rest to understand our world. :good:
[Android Software Development] osm0sis:
Luckily you don't need to use the command line at all in the Windows version, as was already mentioned to you; you can just double-click unpackimg.bat with the .img in the same directory, or drag-and-drop the .img from anywhere onto the .bat. Then double-click repackimg.bat when you're done making changes via Notepad2 or whatever. There's nothing difficult to understand about pointing and clicking I hope, since that's what you'd be doing in a GUI anyway! :silly:

Other than that, AIK-mobile + FX File Explorer app for on-device editing is the closest to a GUI we've got currently.
[Android Software Development] DaniDeVega:
I don't need a GUI for AIK today, but if you show me that tool around 3 years ago, a GUI should be the best teacher than reading long texts. Really, osm0sis , congrats, because you did a great work with this tool, despite my awkwardness hahaha :p

And thanks, I will try this way you told me now. So, my only work to do is to get the ramdisk.img and kernel from the patched_boot.img I have now.

If this tool works instead of using codes with cygwin64 (that I must have the not found yet abootimg file), then I'll have finished the installation of Magisk in Phoenix OS 2.5.9. x64.

If not, I'll edit this post later asking too about the files needed, if someone can help me then.

UPDATE: DIDN'T WORK SO I'M STILL SEARCHING FOR THE FILE "ABOOTIMG" TO FINISH INSTALLING MAGISK ON PHOENIX OS 2.5.9. x64. Incredible, but real... Tomorrow will be my 5th day trying to do it and the 3rd day stucked on the step 4 of this guide. I just need the files mentioned on 1st step, but really, I don't know where the f*~k are them or how to get them for Phoenix OS or what to do now... Really frustrating in something that looks like very easy to do...
[Android Software Development] samuraychik:
Attention! Colleagues who the author of this Kernel kernel_MIUI9_CPU@2.15G_GPU@624M_by_JMXL_20171215155305 (or participated in work on it) please respond!
[Android Software Development] osm0sis:
What? Upload the boot.img in question.

Edit: Nevermind. Judging from that guide, you don't need abootimg (which pretty much does what unpackbootimg does). Just run your patched_boot.img through AIK then rename the -cpio.gz file in split_img to ramdisk.img..
[Android Software Development] DaniDeVega:
What??? Then, I was getting the file to rename in front of my face all this time and never thought about it to try?? :eek: :eek: :eek: :eek: :eek: :eek:

WHAT AN EPIC FACEPALM SHAME MOMENT IN MY LIFE...

Really, thanks to solve it to me !!! I'll do it in this moment! THANKS!!!
[Android Software Development] MiZzCHaOtic:
Hey there... I have the boot.img from the latest Oreo image inside the folder where unpackimg.bat is, I go and drag boot.img to it and 2 folders are created, the split_img and ramdisk but both folders are empty. What am I doing wrong here?
[Android Software Development] osm0sis:
What is output by the script? Upload the boot.img? What device is it from? In short, details please.
[Android Software Development] MiZzCHaOtic:
C:\Users\crmil\Desktop\Android\Android.Image.Kitchen.v3.1-Win32>unpackimg.bat boot.img
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: boot.img

Setting up work folders . . .

'"C:\Users\crmil\Desktop\Android\Android.Image.Kitchen.v3.1-Win32\\android_win_tools"\file' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\crmil\Desktop\Android\Android.Image.Kitchen.v3.1-Win32\split_img>

Let me know if the attachment doesn't work for you. I used tar so that it won't be too big to upload. I have the Nexus 6 and it was running Oreo 8.1. I downloaded the image directly from Google that I pulled the boot.img from.
[Android Software Development] osm0sis:
The only way I can reproduce that error is by deleting the contents of android_win_tools, so you must have done something when you moved it from the original "Android Image Kitchen" directory to your "Android.Image.Kitchen.v3.1-Win32" directory. Download the zip again from the OP and then unzip again and try it without touching any of the included files. :good:
[Android Software Development] MiZzCHaOtic:
That worked!! Thanks so much! :victory:
[Android Software Development] mtkmanjaro:
i tryed to download the aik for android but link is broken i get a loop please fix it
[Android Software Development] osm0sis:
Works fine. I just tried it.
[Android Software Development] Kamonnai063@gmail.com:
Samsung galaxy J7 pram
[Android Software Development] ace2nutzer:
Hi! I've downloaded

AIK-Linux-v3.1-ALL.tar.gz

but i can't unpack the boot.img.lz4 (tried to rename to boot.img) from latest Stock ROM Android 8.0 for Galaxy S8.

ace2nutzer@V5535:~/Downloads/AIK-Linux$ ./unpackimg.sh

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

Supplied image: boot.img

Setting up work folders...

Image type: AOSP

Footer with "SEAndroid" type detected.

Splitting image to "split_img/"...
Android magic found at: 21
BOARD_KERNEL_CMDLINE
BOARD_KERNEL_BASE 10000000
BOARD_NAME RPPK02A001KU$
BOARD_PAGE_SIZE 8
BOARD_HASH_TYPE sha256
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 01000000
BOARD_SECOND_OFFSET f010f010
BOARD_TAGS_OFFSET f0100001
BOARD_OS_VERSION 41.68.0
BOARD_OS_PATCH_LEVEL 2000-01
BOARD_DT_SIZE 570434104
Unrecognized format.
Error!

Download boot.img.lz4:

https://uploadfiles.io/0t3ic

Can u pls patch it? :good:
[Android Software Development] ashyx:
I get:

Image type: AOSP

Footer with "SEAndroid" type detected.

Splitting image to "split_img/"...

Android magic found at: 21

BOARD_KERNEL_CMDLINE

BOARD_KERNEL_BASE 10000000

BOARD_NAME RPPK02A001KU$

BOARD_PAGE_SIZE 8

BOARD_HASH_TYPE sha256

BOARD_KERNEL_OFFSET 00008000

BOARD_RAMDISK_OFFSET 01000000

BOARD_SECOND_OFFSET f010f010

BOARD_TAGS_OFFSET f0100001

BOARD_OS_VERSION 41.68.0

BOARD_OS_PATCH_LEVEL 2000-01

BOARD_DT_SIZE 570434104

Segmentation fault

Error!
[Android Software Development] osm0sis:
Nothing to patch, it's just a normal boot image lz4'd, unpack it first then it'll work.

[MENTION=4899305]ashyx[/MENTION], what platform did you get the segfault on?
[Android Software Development] ashyx:
Marshmallow MSM8974 32bit.
[Android Software Development] nguyentankiet:
Use this version 7-zip to extract boot.img.lz4 first

https://github.com/mcmilk/7-Zip-zstd/releases
[Android Software Development] ace2nutzer:
@ up

Thanks .. that should work too .. but it's for me a bit annoying to reboot to win xp pro 32-bit.

I'm trying to get it to work with my lubuntu 12.04 64bit.

(i know both OS's are quite old ... but it's just an old laptop .. still OK :D)

Anyway, i'll try it! :)

Thank u very much! Right now i'm trying to unpack it .. but i get this error:

$ lz4 -d boot.img.lz4 boot.img
Error 64 : Does not support stream size

Maybe i should update LZ4 package ??
[Android Software Development] ashyx:
Never mind got it sorted unpacks fine now.

Must not have decompressed properly first time.
[Android Software Development] osm0sis:
Working fine here. Latest lz4 is included with AIK, so from in the AIK-Linux directory try `bin/linux/x86_64/lz4 -d boot.img.lz4` (swap x86_64 for i686 if you're on 32bit Linux).
[Android Software Development] ace2nutzer:
Yes! - Good Job! :)

It works like a charm now :good:

btw is your included lz4 binary a static one? - If so, i can just replace it with my outdated one from my distro ??
[Android Software Development] osm0sis:
They're dynamically linked in AIK-Linux, but if you want static you can try the static x86 or x86_64 binaries from AIK-mobile, they should work too.
[Android Software Development] EMSpilot:
Hex-Rays IDA

Do you have a link to Hex-Rays IDA?

Thanks
[Android Software Development] osm0sis:
It's a paid Windows application called "IDA Pro". Google will tell you more.

aboot is part of the bootloader though.
[Android Software Development] problemathic:
thank you for the awesome improvements [MENTION=4544860]osm0sis[/MENTION]
[Android Software Development] ashyx:
As ever, much appreciate your time and effort with AIK. It's my most used tool :good:
[Android Software Development] Skrappy187:
I am about to use AIK to unpack and repack same files on almost the same device but mine is SM-G550T1. I am a beginner at this type of customisation. I just don't know where in my device to locate the files that have the boot image or is it the recovery image filed at. I have a RAR app to extract the files in my not rooted device. Any tips advice or input will be highly appreciated.
[Android Software Development] ashyx:
You can pull the images from the stock firmware which is easiest or dump the boot partition to an image.
[Android Software Development] osm0sis:
Record low for AIK-mobile downloads... goo.gl reports 1,346 clicks, but apparently there have only been 112 downloads. :confused:

****ing DevDB... :mad:

The problem is obviously the way the DevDB won't allow direct downloads from any external use of the link anymore, which is why from a browser like Chrome the link will work perfectly if you click it in the OP, but if you copy it to a new tab it'll redirect you to the DevDB Download page. I imagine something similar happens from Tapatalk/XDA Labs since I've seen complaints of circular links from time-to-time. Well I've reached the limit of my patience with the DevDB Downloads issues, so I've reuploaded to my BasketBuild and direct linked to that from the OP via goo.gl instead.

Please let me know directly if there are any further issues with downloading, so I'm not just inferring it from the download stats. :eek:
[Android Software Development] problemathic:
im a follower of this project. it bump me now that is it updated. i downloaded this . did you update this now bro?