yashsingh1/xdaforums huggingface dataset:
[Android Software Development] topet2k12001:
Hi [MENTION=4544860]osm0sis[/MENTION],

Would just like to drop a note to thank you for sharing your work. I find them useful. I created a simple automation with GUI named ImageprepGUI, from the Lollipop days of LG G3. It basically:

1. Downgrades aboot.img and laf.img to Kitkat

2. "Bumps" (signs with a Kitkat digital-signature) the boot.img (and in order to do that, the boot.img needs to be unpacked/repacked prior)

3. Installs TWRP

4. Has some other options like embedded KDZ/TOT Extractor Tool by [MENTION=2452553]bullghost[/MENTION], "bumping" of recovery.img, and downloading only the needed files (Kitkat laf.img and Kitkat aboot.img)

In my latest available ImageprepGUI (version 2.6), unpacking/repacking/bumping of the boot.img happens "on-device". I would like to try using your version of unpackbootimg and mkbootimg since it does a pretty good job "on PC". If possible, can I include these binaries in an upcoming version that I'm going to make? Thank you in advance.
[Android Software Development] osm0sis:
Yep, sure. Just provide credit (as you've been doing already). Keep up the good work! :)

Edit: Oh yeah, [MENTION=5231281]topet2k12001[/MENTION], you'll also need mkbootfs for Windows.

[MENTION=7299016]munimkazia[/MENTION], did that patch fix non-sudo Moto X repacks?
[Android Software Development] munimkazia:
Hey, sorry for the late reply. Didn't get time to check it all week. I took the latest pull of mkbootfs from your repo and tried it again, and it seems to work this time! Thanks a lot for your help!
[Android Software Development] topet2k12001:
Hi [MENTION=4544860]osm0sis[/MENTION],

Sorry for the delayed response; it looks like your current version of AIK (Windows) already has mkbootfs.exe. I'm able to unpack a boot.img, edit it, and repack it. Then I flashed it to my device and it booted properly with the changes I made to it. Thank you once again!
[Android Software Development] shyvam:
Thank You so Much Bro [MENTION=4544860]osm0sis[/MENTION], ...God Bless You...<3i was loosing My Confiedent!:( When My New Compiled zImage From SOurce Was Not Packing......with [abootimg]..But this tool has solved my problem.Wooooh You MAde MY Day MY brother....Thanks... And dont WOrry..i already clicked THanks button...
[Android Software Development] alex009988:
Hi. I'm Xperia Tablet Z4 user who wants to get rooted stock kernel by editing ramdisk.

I used the tool. Unfortunately it doesn't work for stock kernel, both for android 5.0.2 and 6.0.

But tool works for androplus kernel.

Im sure that extracted kernel is exactly stock kernel

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

but I get this error

android boot magic not found

I attached stock kernel of latest Android 6.0.

Please, help me out!
[Android Software Development] monx®:
@alex009988

u tying to unpack ELF image. of course no magic header using this tool.

[MENTION=4544860]osm0sis[/MENTION]

latest xperia MM kernel dtb image doesnt hv qcdt header wich lead to dtb not found when booting. maybe we need new mkboot which can force dtb offset?
[Android Software Development] alex009988:
Thanks for your answer. But what should I do? Where should I get kernel with ramdisk from?
[Android Software Development] monx®:
U can unpack the elf with flashtools or 7zip. The prob u cant repack it at leasr not now.
[Android Software Development] osm0sis:
Search for Sony ElfTool

Not sure what you mean. The boot image already has an offset in the header for the dtb.
[Android Software Development] monx®:
1-doesnt work. ELF magic not found. kernel.elf as per alex's attachment.

2-attached is the latest MM dtb & latest LP dtb.

when repacking with MM dtb, error 'dtb not found' thrown
[Android Software Development] osm0sis:
1- Ah, well I guess someone will have to update ElfTool to support the new Sony changes. :good:

2- There isn't any sort of dtb header checking in mkbootimg. Sounds like you're using another custom tool that will need an update because of Sony. :)
[Android Software Development] alex009988:
Guys, did I understand you right? There is no tool to edit stock kernel ramdisk in the sony marshmallow?
[Android Software Development] monx®:
Unpack & edit shud be no prob. Just repacked boot image may cause bootloop due to dtb not found.
[Android Software Development] andy_zhang:
In linux tool, error,unpack bootimg

Boot address

http://pan.baidu.com/share/link?shareid=1918732953&uk=4164162834

vs985 China user
[Android Software Development] osm0sis:
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: boot.img

Setting up work folders...

Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=g3 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 androidboot.bootdevice=msm_sdcc.1 lpm_levels.sleep_disabled=1 androidboot.selinux=permissive
BOARD_KERNEL_BASE 00000000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 01000000
BOARD_TAGS_OFFSET 00000100
BOARD_DT_SIZE 485376

Unpacking ramdisk to "ramdisk/"...

Compression used: lz4
13321 blocks

Done!

Works fine here. More details please.

Edit: I see by checking in some other threads that you weren't even using AIK, you were using SuperR's ROM kitchen and now his latest version supports lz4 like mine does, so it should also work. ;)
[Android Software Development] atoxyd:
AIK&Flasher apk, my new apk to backup, unpack, edit, repack and flash kernel.img or recovery.img.

https://drive.google.com/file/d/0B-TzffkfHw-BeVU1RGVhOEN3cVk/view?usp=docslist_api
[Android Software Development] andy_zhang:
Thanx.

vs985 China user
[Android Software Development] osm0sis:
Another bugfix/maintenance release! Features my latest patched mkbootfs adding support for Motorola special ramdisk files, and a fixed up busybox. If anyone knows of any other OEMs which commonly package extra files that don't work correctly after being repacked with mkbootfs please post the original image and I'll add a patch for it.

If anyone is playing along at home, there were also some minor fixups to busybox patching and building in my AIK Build Farm script. ;)

This took a fair amount of my time off this week, so if you like the progress I'm making on this project, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

AIK-mobile v2.2 + AIK-Linux v2.2:

- Update mkbootfs binary from my repo.

- Fix unpackimg.sh cleanup function when using --sudo repeatedly (AIK-Linux).

- Update busybox binary (still 1.24.1) with the latest patches and fixes from my repo (AIK-mobile).

- Add working directory to PATH of "aik" su shell to allow simply "unpackimg.sh", etc. (AIK-mobile).

- Clean up aik symlink re-creation commands (AIK-mobile).

More on my own build changes in the commits here: https://github.com/osm0sis/mkbootfs; https://github.com/osm0sis/android-busybox-ndk.

Installation information and details on each edition can be found in the AIK-mobile and AIK-Linux initial release notes.

If you are reporting a problem with your device, please clearly state your device name and model/variant as well as provide a link to the image file.
[Android Software Development] atoxyd:
AIK&Flasher v1.0.1 build date 03/15/2016. I found many bugs and I fix them.

https://drive.google.com/file/d/0B-TzffkfHw-BVURLcXFxUTRBbU0/view?usp=docslist_api FOR android 6 users I don't test it, sorry
[Android Software Development] osm0sis:
Doesn't work. Last one just crashed and this one just says "Root access failed." I still don't really follow what the purpose of this app is, but maybe you should start a different thread?
[Android Software Development] atoxyd:
Well, when it say "Root access failed that's mean it require Root to work ;)

You must root your android device boss

---------- Post added at 02:06 AM ---------- Previous post was at 01:59 AM ----------

and the purpose of this app is, backup, unpack, edit, repack and flash kernel.img or recovery.img in just one click and I use AIK-mobile tools, your tools, so I think that's a good idea to make it in apk....

I will start a tread for that, thanks.
[Android Software Development] osm0sis:
Obviously my device is rooted. ;)

SuperSU 2.70, latest Marshmallow 6.0.1, stock ROM. Your app failed to request root on a fresh app install, hence my report.

If you're just making a front end, would it be possible to have it just use whatever version of AIK-mobile is installed in /data/local? That would be useful, and if you could add a text editor to facilitate editing the unpacked ramdisk files, along the lines of SGit that would be cool. :good:
[Android Software Development] atoxyd:
Okay boss, but I sed in the beginning that I don't test it on android 6, but I will do.

Thank you very much for your great tools boss.
[Android Software Development] osm0sis:
That wasn't entirely clear when you said "FOR android 6 users". Thanks for explaining further. :good:
[Android Software Development] andy_zhang:
Sir, feedback. I use [MENTION=5787964]SuperR.[/MENTION]kitchen unpack &repack boot, then use your windows tool unpack, prompt ERROR!

vs985 China user
[Android Software Development] osm0sis:
Glad to hear you're actually using my kitchen when reporting an issue in my thread this time. :p

That said, post the image in question or there's no way I can test anything to help you. ;)
[Android Software Development] Lanchon:
BUG/RFE, linux version

hi,

BUG: the scripts cleanup.sh, repackimg.sh, unpackimg.sh do not work when invoked though links, which is a typical way to add them to the PATH.

WHY: the scripts bork when finding the directory in which they reside, then they try to access 'bin' in the wrong place.

FIX:

replace:

aik="$(cd "$(dirname "$0")"; pwd)";

with:

aik="$(dirname "$(readlink -f "$0")")";

thanks!

EDIT: well of course the rest of the script didn't work either :(

to fix it you need to canonicalize the relative paths (input and output files and dirs) with readlink before the cd to your directory, or better yet, never cd and use full "$aik/whatever" paths for all stuff that is absolute.
[Android Software Development] D_Vovan_238:
Hi :)

Hi :)

Thank you for great work .

I was using it on my Sony Xperia Z1 (C6903) and everything was perfect . But now my Z1 is death and i purchased LG Optimus 3D.

Now wanted to make some small changes in Ramdisk, change kernel logo , fix init.d support and maybe something more , but can't unpack the kernel with latest AIK mobile and Windows versions :(

Its BlueKernel by IBlueMind for LG Optimus 3D (P920) Android 2.3.5 .

Can you please add support for LG O3D Kernels .

Thank you very much for your work :)
[Android Software Development] osm0sis:
No magic means it's not following Google's standard format so you'll need to find other tools to unpack and edit your image.

At first glance it looked a lot like the old Samsung headerless images I mention in the OPs, but it's actually a U-Boot file, so would require their dumpimage and mkimage tools.
[Android Software Development] D_Vovan_238:
Thanks :)

Yes i already found one tool able to unpack this image , but when repacking get error "wrong page size" and i looked in text file called pagesize it has number "76".

Will try to find other tool ...

Thanks a lot for your advice and great tool ;)
[Android Software Development] :
Thread cleaned.

Working out development issues between members should be done in private, not in the forums.

(See rule 12 of the site rules) http://xdaforums.com/announcement.php?a=81

Also, do not post links to your work in other members threads. Its highly disrespectful. And, if you use any work at all by another member, credit them in your thread. That also is covered in rule 12.

If credit is due, credit properly, or work can be removed from the site. I hope that is taken care of quickly.

Thanks,

Darth

Forum Moderator
[Android Software Development] osm0sis:
Thanks to [MENTION=4141005]Lanchon[/MENTION]'s suggestion above getting the wheels turning, I have come up with a solution for Android scripts being run as sourced (with . or source command through mksh) to determine their location, allowing AIK-mobile users to do unpacking, editing, and repacking all without leaving the comfort of a file explorer app (my personal favorite is FX File Explorer, which comes with its own text editor). This allows us to avoid the command prompt entirely, and allows users to add command-line options to repackimg.sh if desired, with no need for an external app! It's a real game changer and I'm pretty excited about it. :cool::cowboy:

I'm just finishing up with the new busybox 1.24.2 builds and I'll post with instructions in a little bit. :D
[Android Software Development] elreydenj:
Thank you again or this. Similar to the very first post in this thread on page one; the newest TWRP image fails to repack when clicking repackimg. It just does nothing. The image file unpacks just fine. Any thoughts...
[Android Software Development] shoey63:
Lol. I was about to report a certain user for spamming the thread with his app. Looks like someone beat me to it.

2.1 linux version still works perfectly for Sony (After you have made a standard Android boo.t.img from the "elf" image) as long as you unpack and re-pack as root. Time to upgrade (just for fun) :p

This script https://github.com/jackfagner/twrp-sony-recovery-boot-script is interesting. If you strip out the extract elf- ramdisk stuff, it maybe useful for other devices.
[Android Software Development] osm0sis:
Just tried with twrp-3.0.1-0-hammerhead.img and AIK-mobile with no issues. Can you explain what device you're using and point me to the image, per usual, so I can take a look?
[Android Software Development] elreydenj:
Mobile worked just fine using my Nexus 6P. twrp 3.0.1-0 Angler.img. Thank you for that. However on my Dell running Windows 10, it was unable to repackimg. A command window flashed quickly and just disappears when i click on repack.img. It flashes up so quick that you can barely notice. unpackimg works just fine. What do you think?

Edit: Seems to be working now. I think computer security was quarantining some boot.exe file that was possibly messing things up. Ill report back if i see something else. Thank you for your time.
[Android Software Development] USBhost:
[MENTION=4544860]osm0sis[/MENTION] i found something...

./unpackimg.sh --sudo boot.img

sudo chown -R usbhost:usbhost ramdisk

edit somthing....

sudo chown -R root:root ramdisk

./repackimg.sh

and it still boots... Android N

so adding "sudo chown -R $USER:$USER ramdisk"

after unpacking then "sudo chown -R root:root ramdisk" when repacking.

to make life better for us linux users! :D
[Android Software Development] osm0sis:
I already chown root before repack after an unpack with the --sudo option is detected, so that's basically covered, but I was wondering if even that was a good idea since it would blanket change things like root:shell or radio:radio or something that could potentially exist..
[Android Software Development] USBhost:
if i do not do "sudo chown -R root:root ramdisk"

./repackimg.sh does not know ./unpackimg.sh used --sudo
[Android Software Development] osm0sis:
No? Works for me on Ubuntu.

https://github.com/osm0sis/Android-Image-Kitchen/blob/AIK-Linux/repackimg.sh#L33

What's the output of that stat command look like on your distro/setup?
[Android Software Development] USBhost:
usbhost@G46VW:~/Desktop/nexus9/AOSPN$ sudo chown -R $USER:$USER ramdisk
usbhost@G46VW:~/Desktop/nexus9/AOSPN$ stat -c %U ramdisk/* | head -n 1
usbhost
usbhost@G46VW:~/Desktop/nexus9/AOSPN$

ubuntu 15.10
[Android Software Development] osm0sis:
Sounds like you didn't use --sudo to unpack, or you already used your chown command to change it all to usbhost:usbhost?

Please post the output of repackimg after you use cleanup.sh to start fresh and used unpackimg.sh --sudo to unpack.
[Android Software Development] USBhost:
usbhost@G46VW:~/Desktop/nexus9/AOSPN$ ./c
Working directory cleaned.
usbhost@G46VW:~/Desktop/nexus9/AOSPN$ cat ./up
./unpackimg.sh --sudo "$@"
usbhost@G46VW:~/Desktop/nexus9/AOSPN$ ./up boot.img

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

Supplied image: boot.img

Setting up work folders...

Splitting image to "split_img/"...
Android magic found at: 256
BOARD_KERNEL_CMDLINE androidboot.hardware=flounder
BOARD_KERNEL_BASE 10000000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 01000000
BOARD_TAGS_OFFSET 00000100

Unpacking ramdisk (as root) to "ramdisk/"...

Compression used: gzip
7496 blocks

Done!
usbhost@G46VW:~/Desktop/nexus9/AOSPN$ sudo chown -R $USER:$USER ramdisk
usbhost@G46VW:~/Desktop/nexus9/AOSPN$ stat -c %U ramdisk/* | head -n 1
usbhost
usbhost@G46VW:~/Desktop/nexus9/AOSPN$
[Android Software Development] osm0sis:
I told you not to run your chown command. ;)

Everything appears to be working fine; of course you'll need to chown back to root for repackimg to detect sudo, since you changed it in the first place. :good:
[Android Software Development] USBhost:
nvm misunderstanding

"I already chown root before repack after an unpack with the --sudo option is detected"

i thought that meant the repackimg.sh chown it to root

if you ever do put "sudo chown -R $USER:$USER ramdisk"

you will need to find another way to detect --sudo
[Android Software Development] osm0sis:
https://github.com/osm0sis/Android-Image-Kitchen/blob/AIK-Linux/repackimg.sh#L65

It does but it's more just to make sure a user didn't have to chown back if something got changed by mistake during editing. As I was saying, I'm not really sure if even that is wise since there could potentially be root:shell or radio:radio in a ramdisk and changing it all to root:root could break it. So I'm more toying with the idea of removing that blanket chown than adding more.

Any reason why non-sudo AIK-Linux isn't working for you? mkbootfs was made to handle this stuff and make editing easier for the end user. :)
[Android Software Development] USBhost:
didn't you say mkbootfs did not support adding files and chmoding?

thats why you added --sudo
[Android Software Development] osm0sis:
mkbootfs just follows rules to set basic permissions, --sudo is for those where that doesn't quite do the trick and need full control for some reason.

https://github.com/osm0sis/mkbootfs/blob/master/private/android_filesystem_config.h#L316

I'd definitely recommend trying non-sudo first to see if you can get away with it. You can also just have an init.*.rc or *.sh file in the ramdisk run and set the added file permissions you might want during boot and handle it that way. :)
[Android Software Development] KreNtal:
Hi guys, can someone please point me on how to modify splash.xml to accept a static image instead of 2 logos??
[Android Software Development] z31s1g:
Look inside the materialised theme zip. Inside the folder "splashes". There are templates for static image and xml splashes.
[Android Software Development] osm0sis:
Materialised thread might still be the best place to ask. ;)

I think z31s1g already explained the Materialised theme still can do this in one of his posts:

http://xdaforums.com/showpost.php?p=66375866&postcount=2960

Also:

http://xdaforums.com/showpost.php?p=66177907&postcount=2855

:)

Edit: aaand he beat me to it. :D
[Android Software Development] n0ts0smart:
[MENTION=1143630]osmosis[/MENTION] Been using AIK (W32) for some time and was excited to try the mobile edition. Been messing around for the past day and wanted to leave a little feedback.

Absolutely fantastic. Great instructions, couldn't be more user friendly and in conjunction with the Flash-it add on is just about perfect. I have been wanting the functionality of the Windows version on my device and this app delivers. I have been using the FX file explorers script executor and everything works great and beyond that is as simple as it could possibly be.

Thank you for your time and effort. Really solid work(s)
[Android Software Development] flonec:
UPDATE-AIK.Mobile.Installer.v2.3-ALL-signed working LG D855 ?
[Android Software Development] osm0sis:
Thank you so much for the kind words! Very much appreciated. Glad you're finding the new functionality as useful as I am! :D

Try and let us know? A lot of LG devices' images require "bumping" so be aware it may work with AIK but you could still have to bump the image so that it will boot. There are lots of tools available to help with that part. :)
[Android Software Development] osm0sis:
Small bugfix/maintenance release.

We've got a new version of file for AIK-mobile, and I rolled it forward a couple commits from the new git tag since the maintainer apparently realized there was a compile error only after he made the source release. Then a small change to AIK-Linux for those using --sudo; now repackimg.sh does not fix the ownership to try and prevent breakage (because blanket changing to root could cause further breakage), so be sure to edit your files as root and/or fix the ownership individually before repack if this is your use case. I also fixed some longstanding typos in the authors.txt. :p

Flashlt v2.2 is available over in my Odds and Ends thread as well in case anyone missed it last week. It has a number of improvements including a standalone dumpit.sh wrapper script (defaulting to dump boot.img) and dump trimming! :D

This took a fair amount of my time off this week, so if you like the progress I'm making on this project, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

AIK-mobile v2.4 + AIK-Linux v2.4:

- hide some occasional possible stderr from lsof in the sourced execution workaround. (AIK-mobile)

- remove blanket ownership change to root before sudo repack to avoid possible breakage this could cause to root:shell or radio:radio files that could exist. (AIK-Linux)

- update file binary (5.26-f8eaefb). (AIK-mobile)

- update slimmed magic file (from file 5.26) with my own fixes.

Installation information and details on each edition can be found in the AIK-mobile and AIK-Linux initial release notes.

If you are reporting a problem with your device, please clearly state your device name and model/variant as well as provide a link to the image file.
[Android Software Development] Jonatino:
Awesome tutorial very easy to use. Maybe you could add an argument to repacking for LG users to bump the new image? Just a thought.

I modified my Lg G2 boot.img with this, then you gotta bump it with http://xdaforums.com/lg-g2/orig-development/tool-bump-sign-boot-images-t2950595. After that it works like normal, just be sure that you bump it :)
[Android Software Development] ashyx:
[MENTION=4544860]osm0sis[/MENTION]

Can you help me out with the correct Syntax and binary required to create a sparse image from a raw image for a Spreadtrum device.

I'm trying to create an ODIN flashable cache.img , but no matter what Syntax I use the image fails in ODIN.

I have tried: ext2simg -v cache.raw.img cache_new.img

Also mounting as a loop device: make_ext4fs -s -l 32M cache_new.img cache_mnt

The image gets created just fine, but is just fails in ODIN. I don't know if its a missing header or what?

Any ideas?

Thanks.
[Android Software Development] osm0sis:
Never really dealt with Spreadstrum.. Chainfire added fastboot flashable sparse image building to the last version of Flashfire, so I imagine he might be able to help you out with the commands. :good:

The Bump addon script for SuperSU could be invoked from the command line on-device as well. :good:

I support this automatically in my AnyKernel2 zips since they flash in recovery and modify the boot.img like SuperSU's installer, but I feel it's somewhat beyond the scope of AIK to support every kind of image Loki/Bump/whatever crack that should ever arise. Hopefully that makes sense. Luckily it's simple enough to do yourself with the various Bump tools/scripts for PC and mobile. :)
[Android Software Development] KreNtal:
Is it possible to uninstall the aik mobile after installing it?
[Android Software Development] andy_zhang:
IF you use linux tool modify lgs boot,you will bootloop.

vs985 China user
[Android Software Development] Vagelis1608:
Delete this directory: /data/local/AIK-mobile

And this file: /system/xbin/aik