yashsingh1/xdaforums huggingface dataset:
[Android Software Development] osm0sis:
Are you using --nosudo with AIK-Linux? Maybe ownership got screwed up.

Link the before and after images please, and provide some kind of info about your device.
[Android Software Development] the-blind-bandit:
I've now tried both using "sudo ./unpackimg.sh" and "./unpackimg.sh --nosudo" (and of course for repackimg too) and I still get the same result.

I'm using a Oneplus 3T and TWRP 3.2.3-0 but now you've mentioned it I'll also try it for a different twrp and device.

Sorry if this is a stupid question but what do you want before and after images of? Terminal output?

Edit: Same problem with HTC one m7 and TWRP 3.2.1-0
[Android Software Development] Augustoandro:
Type

su

Enter your root password.

Now, type this and press enter

chmod +x whatever.sh

Type unpackimg.sh, repackimg.sh or cleanup.sh instead of whatever.sh

Now, go in bin->linux

Open terminal in that directory.

Now, type the commands stated above, replacing whatever.sh with the filenames in bin->linux

Come back to the directory containing unpackimg.sh, repackimg.sh and cleanup.sh files

Open terminal, type su, enter root password.

Now, you can unpack and repack TWRP.
[Android Software Development] osm0sis:
I need what I said, links to the before and after images, i.e. TWRP image unmodded (I can grab that from the TWRP website) and the one you repacked that doesn't work. I need to compare them.
[Android Software Development] the-blind-bandit:
Sorry for being so stupid, I thought you meant pictures rather than .img files :rolleyes:

Original TWRP img HERE

Unpacked then repacked img without modification HERE

Edit: Just thought I'd point out that I HAVE checked that the TWRP image I downloaded is working correctly

---------- Post added 31st August 2018 at 12:02 AM ---------- Previous post was 30th August 2018 at 11:59 PM ----------

I'm a little confused, I have no /bin/linux directory? I'll certainly try that if you can explain what I'm meant to be doing though, I'll try the chmods now though

Edit: chmod +x on unpack and repack didn't do anything
[Android Software Development] osm0sis:
Thanks. I'll look into it. For further help, please try it using AIK-mobile and report back as well. Thanks!
[Android Software Development] the-blind-bandit:
Thanks and will try tomorrow.
[Android Software Development] osm0sis:
So the issue with your repacked image was immediately obvious: every single file and directory had permissions changed to 777.

That said, I have no idea how you're managing to have that happen. On my Ubuntu VM and my fiancee's MacBook Pro all permissions are preserved through an AIK-Linux repack both with using unpackimg.sh --nosudo and without.

Maybe make sure you've got the latest AIK tar.gz downloaded correctly, unpack it again into your ~ directory, and try again?

Some details about your system, logs from the unpack/repack of the unmodded twrp.img would be helpful as well.
[Android Software Development] tripLr:
Noob question.

Goal.

Take a stock Samsung ROM, extract from the ROM

The stock drivers and kernel

So I can update the kernel (upstream)

Add the unlocked bootloader for my phone, note 4.

Add magisk

Remove Knox and bloat.

Question, do these tools help do that?
[Android Software Development] osm0sis:
It might help the last 2 items if you're manually patching the boot.img for some reason, though Magisk Manager can just as easily do all that with a boot.img on-device.

For everything else you should go check out SuperR.'s Kitchen. It includes AIK for things as well.
[Android Software Development] turbo81:
Tried repackimg --original, unfortunately, did not work. Still boot loop after the google G logo during boot. Running out of idea. Really not sure which step I did wrong.

I copied the original boot.img into the AIK folder.

run ./unpackimg boot.img

replaced boot.img-zImage with my custom patched kernel. (same filename boot.img-zImage)

run ./repackimg.sh --original

rename image-new.img to boot.img

run fastboot flash boot boot.img

I am using AIK Linux. When I repack the original boot.img, it works. That leads to the kernel being the issue. However, I am able to boot using my custom kernel through

fastboot boot customkernel.img
[Android Software Development] Diabolik2770:
false positive ?

Android.Image.Kitchen.v3.3-Win32.zip false positive ?

https://www.virustotal.com/it/file/...9e257fb777570e60c2093989d89c671f5cf/analysis/
[Android Software Development] osm0sis:
Obviously, as long as you downloaded it from here and not some third party rehost. sudo and file binaries sometimes trigger heuristics.
[Android Software Development] Diabolik2770:
after repack recovery big

I followed this tutorial https://www.youtube.com/watch?v=rFnG7fso9HE

but after the repack my file is big about 13 mb

my recovery (s4 i9515) is about 9 mb and also twrp is about 9 mb

when I try istall the new recovery, the message comes out

failed

size of image is larger than target device

I tried it also with Image Kitchen for Android apk but it's the same
[Android Software Development] osm0sis:
Link the image or we can't help.
[Android Software Development] Diabolik2770:
my device s4 gt-i9515 jvelte Qualcomm Snapdragon 600 APQ8064T Quad-Core

twrp is s4 gt-i9505 jfltexx Quad-Core Snapdragon 600 APQ8064T

i can make last twrp 3.2.3.0 for my device with Android Image Kitchen ??

https://drive.google.com/open?id=1NByDiKYkH7QTGmqYQzMY3vMzGfG6Z--_
[Android Software Development] osm0sis:
Working just fine in AIK-mobile:

Are you using the latest AIK from the OP? What platform? Log? Errors?

Edit: Same result on AIK-Win32 on Windows 10 here, so... :confused:
[Android Software Development] ouzqan:
How can update twrp for z5 premium?
[Android Software Development] Paschfire:
By searching, or asking, within the appropriate discussion thread(s) related to TWRP recovery specific to your device(z5 premium).
[Android Software Development] ouzqan:
I have a kernel. with this program.twrp can update?
[Android Software Development] ouzqan:
Thank you for not helping me.
[Android Software Development] Paschfire:
Your question make no sense, not to me anyways.

I suggest you to follow the directions I provided you within my last response if you're looking for help with updating TWRP recovery for your device.

---------- Post added at 05:51 PM ---------- Previous post was at 05:37 PM ----------

Maybe try helping yourself a little.

I have given you appropriate directions to find an answer to your question, it's totally upto you to follow them or not.
[Android Software Development] ouzqan:
Okay, please don't bother me any more.
[Android Software Development] Paschfire:
Seriously? Bother you? :rolleyes:

You're asking questions unrelated to Android Image Kitchen, to which I indirectly informed you of, then you don't follow those simple directions for continuing your search.

It also seems you cannot provide a response containing more than 9 words as to allow anyone to even understand what it is you're asking about.

Nope, no bother at all.

Maybe next time you decided to post within XDA forums looking for help try to elaborate on what it is exactly that you're trying to accomplish, doing so within the appropriate section for your specific device. Details mean everything here.

Anyways goodluck with your hunt for answers, you're very welcome.
[Android Software Development] ErbDroid:
Mr [MENTION=1143630]osmosis[/MENTION] sir,

First if all, a big thank you for all you have given us over the years! It is greatly appreciated!!

After all this time, my first ask for help, or more like needed guidance!

Let me back-track a little....

I am developing an Amlogic TV rom for a personal project.... and my decent laptop died, leaving me with my old notebook.... this little beauty is 32 bits of pure intel atom power thats rocking... a FULL 1gb of ram.

;):laugh::crying:

So basically, i dont really have a PC, i'd say i have a way of running .exe's, sometimes. (Its dual-boot Lubuntu BTW).

Now, i can use a reworked Amlogic tool on windows, it unpacks, allow changes to level 1, 2 & 3 and will repack to an Amlogic USB tool .zip for flashing via PC, although at the end it doesnt burn, it fails before 10%.

And the linux tool needs 64 bit for nougat.

Hence, i am here, AiK mobile!

Anyways, im pretty sure that between:

an APK i have already that unpacks Amlogic firmware .img's natively on device,

Your AiK mobile,

Your Flash-it and your BusyBox, plus...

either Termux or LinuxDeploy

Surely that is all i need to achieve all customisations? unpack .img, mount to edit and repack all natively on device??

So.... my new project is to find a way of doing this!!

A. Can these tools help me in your experience?????

Also once I have unpacked my firmware i am left with this:

B. how can i extract or mount the contents of these folders now????

Thank you again osm0sis!!!
[Android Software Development] osm0sis:
AIK only unpacks boot.img/recovery.img, sounds like you want to modify system.img, so you'd need SuperR.'s ROM Kitchen most likely, but you'll need a PC to use it.
[Android Software Development] pascua28:
Can't download any of the three attachments. My internet runs fine though

EDIT: works fine when downloading using XDA Labs
[Android Software Development] mey2009:
Hi

I ported TWRp from on5xllte SM-g5510 to on5xflte SM-g5520 using android 7 china rom with no google apps. i replaced (fstab from etc folder, init.rc, fstab and uenvent and uevent.qom from ramdisk. i also replaced file from split_img folder. I can get into TWRp but nothing works and device is bootlooped. when i want to wipe chache or data. it says no EFs (file exists) and red erros. who can i fix it??[
[Android Software Development] osm0sis:
You likely can't. AIK is not for porting TWRP.
[Android Software Development] mey2009:
what should i do to make TWRP works on my device?

thank you for answering..
[Android Software Development] osm0sis:
Dees_Troy posted an official bringup/porting guide. Search for it, should be easily found.
[Android Software Development] ncandroid84:
Hello [MENTION=4544860]osm0sis[/MENTION],

On my Motorola G5S Plus with Android 8.1, AIK is not working.

The mod is installed well but at when trying to unpack, I get an error. As soon as I can, I upload a screenshot of the terminal emulator.

-------------------------------------------------------------------------------

En mi Motorola G5S Plus con Android 8.1, no esta funcionando AIK.

El mod se instala bien pero al intentar desempaquetar me sale error. En cuanto pueda subo una captura de pantalla del terminal emulator.
[Android Software Development] osm0sis:
Screenshot isn't super useful. Give me an install log from recovery/Magisk Manager, a log from your unpack attempt and the boot.img you're trying to unpack.
[Android Software Development] VincentJoshuaET:
Can you upload the zips somewhere else? I'm getting an error from the attachments. Thanks.
[Android Software Development] osm0sis:
Working fine even logged out in an Incognito Window for me, so maybe try again. XDA attachment servers are flaky once in awhile but generally reliable, and has been the only effective way to serve my packages, pretty much proven over time by the low download counts when I had them anywhere else, including XDA DevDB Download or BasketBuild.
[Android Software Development] osm0sis:
Pixel 3 support is here! OnePlus 6 and other newer devices also started using this new format with the upgrade to Android Pie (but their bootloaders don't seem to enforce it like the Pixel 3s' do); Google updated the AOSP bootimg format to v1 (from v0), so I've backported the changes into my C mkbootimg/unpackbootimg from the upstream Python versions to intelligently continue to support v1, v0 and pre-version images, verified with repackimg[.sh] --original producing identical header.id sha*sums to the originals in all of those cases! Enjoy!

Per usual the AIK Build Farm scripts are updated.

The new Fla**** v3.4 is available over in my Odds and Ends thread, highly recommended as it's the perfect companion package to AIK-mobile.

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

Android Image Kitchen v3.4:

- update lz4 binary (1.8.3)

- update mkimage and dumpimage binaries (2018.09)

- update mkbootimg and unpackbootimg binaries from my repo

- support header_version and recovery_dtbo* from AOSP boot_img_hdr_v1

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

- adjust format detection weight modifiers for file 5.35 compatibility

- update to the latest Cygwin binaries and libraries

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

- installer fixes for detecting BINDSBIN SuperSU and using Magisk busybox (AIK-mobile)

- update busybox binary (1.29.3) with the latest patches and fixes from my repo (AIK-mobile)

- update lz4 binary (1.8.3)

- update mkimage and dumpimage binaries (2018.09)

- fix ramdisk loop mount case issues under Magisk with modules affecting many files (AIK-mobile)

- update mkbootimg and unpackbootimg binaries from my repo

- support header_version and recovery_dtbo* from AOSP boot_img_hdr_v1

- update file binary (5.35) (AIK-mobile)

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

- adjust format detection weight modifiers for file 5.35 compatibility

- update to the latest MacPorts binaries and libraries (AIK-Linux)

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

Installation information and details on each edition can be found in the OP for Win32 or 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] onliner:
Thanks for this, you are the number one! :highfive:
[Android Software Development] RebelLion_:
[MENTION=4544860]osm0sis[/MENTION] this keeps happening and I'm sure it shouldn't be. I made a post before about it but I think it hasn't been addressed yet, so here's some more info. AIK-mobile installs itself as 64bit, presumably because my recovery is 64bit however my kernel and rom are 32. Is there a way to circumvent this or do I just need to manually swap for the ARM executables instead?

https://del.dog/etisupikih.coffeescript
[Android Software Development] osm0sis:
Huh. Definitely a very edge case you've got there. For now you could install from Magisk Manager if using Magisk, or FlashFire if using SuperSU and that should detect the 32bit ROM/kernel since it'll still be booted for both of those.

Can you PM me your ROM's build.prop? Maybe I can add some logic to the installer to prefer the values from the ROM if they differ.
[Android Software Development] ncandroid84:
Android Image Kitchen - UnpackImg Script

by osm0sis @ xda-developers

/data/local/AIK-mobile/unpackimg.sh[53]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file Supplied image:

Setting up work folders...

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

/data/local/AIK-mobile/unpackimg.sh[83]: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

sh: /data/local/AIK-mobile/bin/busybox: not executable: 64-bit ELF file

1|sanders_n:/ #

I have Android 8.1 stock, root with magisk, in my motorola g5splus.

I'm trying to unpack the boot.img of my firmware
[Android Software Development] madbat99:
I think he's talking about the Moto E4 Qualcomm version. Squid2 made a 64-bit TWRP for it in preparation for 64-bit ROMs but it hasn't gotten to the ROMs just yet.
[Android Software Development] osm0sis:
Sounds like a similar problem to [MENTION=8687921]RebelLion_[/MENTION]. Upload a recovery.log from after flashing the AIK installer in recovery, and send me your ROM's build.prop please.
[Android Software Development] madbat99:
I was referring to RebelLions post. I run stock on mine
[Android Software Development] osm0sis:
I was mostly just quoting your post to reference the issue for ncandroid.
[Android Software Development] RebelLion_:
Will do, and I can reinstall and grab the recovery log if you like. But its exactly what MadBat said, TWRP is 64bit for now and we gotta wait a while for the device and kernel trees to catch up lol. Unless I can manage to convert the kernel on my own somehow since I'm maintaining the only custom kernel we have. I didn't see AIK in Magisk though? It only pops up as the " AIK Helper Script" in my modules after installing the zip in recovery. Ill look again right now
[Android Software Development] ncandroid84:
Renamed build.prop to buildprop.txt for upload
[Android Software Development] osm0sis:
It's not in the list, I mean for now you should be able to work around the issue by installing the AIK-mobile zip manually via Magisk Manager using the + button in the Modules page. :good:

Thanks! This confirms your 2 Moto devices both suffer from the same edge case issue: your recovery is arm64 but your ROM is only arm. Very unusual!

Use the above workaround for now. I'll make it so the build.prop arch value takes precedence over recovery getprop or default.prop in the next release. :good:
[Android Software Development] ncandroid84:
Yeeeessss, now works! Thank you very much for your help !!
[Android Software Development] madbat99:
You can switch over to the last release of TWRP and it should help with that problem you're having. Then you can switch back afterwards if you need a new one. Sorry for the OT
[Android Software Development] RebelLion_:
Ohhh gotcha, will do that thanks
[Android Software Development] osm0sis:
Please test out my latest Busybox module zip in recovery, it has the same fix I'll have in the installer for the next AIK-mobile version. Let me know if it installs the arm binary it should now.
[Android Software Development] RebelLion_:
Sorry, I forgot to report back last night. It installed the ARM binaries, so your fix worked :good: thanks for the quick response!
[Android Software Development] alecxs:
OT

I know it is wrong thread, but i have fixed the Alternative linux version with Drag and Drop functionality. Thread is closed, therefore i will post it here instead (because it is using your source). all credits to OP

after unpacking CarlivImageKitchen-Linux-DnD-yuweng.zip just run install.sh it will create hopefully the Desktop Icons.

unpack_kernel is new, its just working with combination gzip + 7z and for unpacking kernel binary only - you don't need this
[Android Software Development] alecxs:
i guess the windows version need to be fixed because there is no sudo? get the following error when try to re-pack boot.img

C:\Android\Android_Image_Kitchen>cleanup.bat
C:\Android\Android_Image_Kitchen>unpackimg.bat
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/" . . .

BOARD_KERNEL_CMDLINE console=null androidboot.console=null androidboot.hardware=
qcom user_debug=23 msm_rtb.filter=0x37 androidboot.selinux=permissive androidboo
t.bootdevice=msm_sdcc.1 buildvariant=userdebug
BOARD_KERNEL_BASE 00000000
BOARD_NAME
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.1.2
BOARD_OS_PATCH_LEVEL 2017-10
BOARD_DT_SIZE 145408

Unpacking ramdisk to "ramdisk/" . . .

Compression used: gzip
6259 blocks

Done!

Drücken Sie eine beliebige Taste . . .

C:\Android\Android_Image_Kitchen>repackimg.bat
Android Image Kitchen - RepackImg Script
by osm0sis @ xda-developers

Packing ramdisk (as root) . . .

Using compression: gzip
Der Befehl ""C:\Android\Android_Image_Kitchen\\android_win_tools"\sudo" ist entweder falsch geschrieben oder konnte nicht gefunden werden.

C:\Android\Android_Image_Kitchen>
[Android Software Development] osm0sis:
Check the zip, it's definitely in there. My guess would be either an issue with your antivirus falsely quarantining it, or something with the directory permissions since you're keeping it in a C:\ root subdirectory instead of your user folder.

Download the zip again and unzip on your desktop and try again. :good:
[Android Software Development] cipri10:
Hi, i tried to unpack boot.img from Lenovo P2 custom rom with AIK Mobile 3.4 using Fx explorer and Terminal but says "unrecognized format" , anyone can help me? Can't upload .img because is too large.
[Android Software Development] KaMyKaSii:
Without providing the boot.img is impossible. You can upload to drive/mega/mediafire and post the link here
[Android Software Development] ashyx:
That doesn't wash, there are countless free hosting solutions.

Put the work in if you want the assistance.
[Android Software Development] osm0sis:
Even a 64mb boot.img dump will generally zip down to like 13mb, which would attach fine, so, many options.
[Android Software Development] sekk:
Sorry for this stupid question, but I didn't understand exactly: I'm able to unpack the boot.img directly from android, no need of windows? I downloaded the AIK mobile installer, but I'm not sure whether I should flash it through magisk/twrp or anything else. And if I should flash it, how to use on android?

Sorry guys
[Android Software Development] ashyx:
You should really read the OP before posting such questions. All the info you need is fully explained.

https://xdaforums.com/showthread.php?t=2073775&page=28
[Android Software Development] HassanMirza01:
in latest versions, there are permission issues... dont know why this tool needs to extract files using 'root'. anyways, thats acceptable, but the extracted zImage file is of archive type, but the kernel i built is pure kernel not archive thing, its something like binary type... when i replace it, phone never boots, if i use anykernel zip method, using dtb image, it works fine... any idea about that ?? [MENTION=4544860]osm0sis[/MENTION]