yashsingh1/xdaforums huggingface dataset:
[Android Software Development] osm0sis:
You list several devices but fail to explain/provide your setup, which AIK package, what the error actually is, a log from the installation, a log showing the error, steps to reproduce, steps you've taken to investigate/fix it, literally anything helpful.

You want a working version? Give a proper bug report and 2.9 will work with whatever the issue is (more than likely) with your device setup.
[Android Software Development] kessaras:
pc version.

i dunno how to log that.

i just extract the kitchen , drag & drop the boot.img to the unpack and immidiately i get error.

The 2.4 version i found it in Google and i test it and it works.

How can i log it and send it ?

Supplied image: boot.img

Removing old work folders and files . . .

Setting up work folders . . .

Unrecognized format.

Error!

Press any key to continue . . .

thats what i get whatever .img i use. TWRP img , boot.img, from any device. i renamed them to .bin also which is the default LG format from KDZs but nothing
[Android Software Development] osm0sis:
Okay, so AIK Win32? What's your PC setup?

That means this logic is always triggering for some reason: https://github.com/osm0sis/Android-Image-Kitchen/blob/master/unpackimg.bat#L56-L70

Are you sure 2.4 was the last working version for you? 2.5 did add that imgtest logic, but 2.5 was the last to support Win XP: https://xdaforums.com/showpost.php?p=70745088&postcount=1116, https://xdaforums.com/showpost.php?p=71218371&postcount=1167

Can you test out some of the included utilities in 2.8, file command in particular to see if they work, or what the exact error is?
[Android Software Development] kessaras:
windows 10x64 v1607

i will test 2.5 too.

2.4 works fine im currently modding LG kernel to reduce bootloop issues to problematic LG G4 models

2.8 nothing , only error. Sorry its just that i type fast , my time is limited before i go to work
[Android Software Development] osm0sis:
Okay, glad you're not WinXP. ;)

Put your OP3T file in the main AIK 2.8 folder as boot.img, then open a command prompt in the android_win_tools directory included and try

file -m androidbootimg.magic ..\boot.img

Anybody else on Win10 x64 experiencing anything similar? I can't reproduce the issue on Win10 x86 at all. OnePlus boot/recovery images are definitely AOSP standard.
[Android Software Development] robcore:
Hey [MENTION=1143630]osmosis[/MENTION] ,

Firstly, didn't know you were a full time nurse, that is badass! I can't believe you find time for programming. That said, I imagine that for some us it is akin to finding time for our drug addiction ;)

Question regarding ramdisk repacking. Should I add any switches to preserve absolute paths to symlinks? I have two "daemons" in sbin (ueventd and watchdogd) which are actually just symlinks to the init binary. The only way I've been able to properly link them so far has been during boot, which probably isn't optimal as I'm sure i don't win the race in that case. When I try doing it from my desktop, even when using a buildroot environment, my links always show up on the device as //init instead of /init, and I'm wondering if their are any bootimg tricks you're aware of that might fix this.

Sorry for the long winded post! Take care my busy friend :)
[Android Software Development] kessaras:
file -m androidbootimg.magic ..\boot.img

replace file with the boot.img ?

boot.img -m androidbootimg.magic ..\boot.img

it sais file is corrupted. But with kitchen 2.4 i can unpack it successfully
[Android Software Development] osm0sis:
No dude, file is the name of the utility. Type what I said.
[Android Software Development] osm0sis:
No dude, look in the directory; file is the name of the utility. Type what I said.

AIK should handle these I think. Absolute root paths unpack crazy in 2.8 because they aren't a good idea, so I've got cpio removing the absolute on 2.9, see my post a few pages back to try it now.

Relative symlinks is how AOSP and most OEMs handle things like that. Like: sbin/watchdog -> ../init
[Android Software Development] kessaras:
yes it is aosp
[Android Software Development] osm0sis:
"AOSP" is what the file command reported? If so, that shows the utility itself is working. Hmm.. I'll PM you the 2.9 WIP and we'll see from there.
[Android Software Development] osm0sis:
Again, anybody else on Win10 x64 experiencing anything similar? I can't reproduce the issue on Win10 x86 at all.
[Android Software Development] Paschfire:
I have a Win10 x64 PC, I'll give it a whirl tonight with a Nexus boot.img and report back.
[Android Software Development] osm0sis:
Also, what the **** is up with DevDB not showing anything under Downloads half of the time? My "direct redirect" links in the OP still work, but how the hell am I supposed to upload anything? So flakey.. no wonder download counts and rates are cut in half for the last version. :mad:
[Android Software Development] Paschfire:
Nope, AIK.v2.8-Win32 working fine here on Win10 x64.

Drag_n_drop or via terminal command prompt, Nexus5 stock factory boot.img unpackimg is functioning correctly for me(see Pic).
[Android Software Development] kessaras:
Can you please press in cmd

ver

And tell me your windows version ? Because here only 2.4 tool version works.

Will be great help for me. Maybe I will have to downgrade my windows or upgrade them to the latest. Dunno. Depends on your version
[Android Software Development] Paschfire:
Microsoft Windows [Version 10.0.15063]

---------- Post added at 10:29 PM ---------- Previous post was at 10:24 PM ----------

Though.. I'm having doubts it's Windows related, what JRE/JDK version are you using? I'm using the latest JDK 8u-144 .

I could be completely wrong though, just an educated guess for my knowledge level.
[Android Software Development] kessaras:
hmmm, i will finally do this upgrade i was avoiding........ pffff downloading a few gb again........

EDIT:

latest 144 was giving me error with the 2.4 version too so i downgrade java to 131 and 2.4 works again. At least i have 2.4 ... we will see. i will know until tomorrow night
[Android Software Development] Paschfire:
I apologize I was incorrect, I'm currently running Java Version 8 Update 131 (build 1.8.0_131-b11).

I'll update Java 8 v144 retest and report back.
[Android Software Development] kessaras:
nah, too bad. Now we have the same windows build.

i updated to the latest creators Version 10.0.15063 , but still gives the same error. I wonder why.......

At least 2.4 still works flawlessly hehe
[Android Software Development] osm0sis:
Java shouldn't matter before AVB was added (2.8), so hmm.. very weird indeed. Is your Windows localized? Something to do with language settings throwing something unexpected for one of the commands perhaps? In our last debugging PM you mention -imgtype exists but it only contains the word "open" - at that point it should contain "bootimg" from this command:

"%bin%"\file -m %rel%\androidbootimg.magic "%file%" | "%bin%"\cut -d: -f2- | "%bin%"\cut -d: -f2 | "%bin%"\cut -d" " -f3 | "%bin%"\cut -d, -f1 > "%~nx1-imgtype"

So there is something wrong there on your system.

set "file=%~f1"

should mean you always get a proper filepath for %file% - Maybe put an echo %file% right before that -imgtype line and make sure it's spitting out something sensible.

Other than that, we'll have to experiment with the actual utilities and hopefully nail where it goes weird.

[MENTION=5461026]kessaras[/MENTION], please go into the android_win_tools directory in a command prompt. Put your boot.img in the main AIK directory as boot.img (to keep things simple). Then try:

file -m androidbootimg.magic "..\boot.img" | cut -d: -f2 | cut -d" " -f3 | cut -d, -f1

As I said, it should display "bootimg" there, hopefully on yours it will still display "open" so we can continue to try to work away at the command to get to the bottom of it.

Edit

: Okay, so with the help of [MENTION=5461026]kessaras[/MENTION] via PM I figured out it's there being Greek Unicode characters in the filepath of the img being unpacked. I can reproduce the issue on my side now so I'm seeing about a fix.
[Android Software Development] osm0sis:
I've got a "fix" for the above that works by using the 8.3 shortname for the path, but keeps the long name of the file so that the split_img output doesn't go ugly from the unpackbootimg utility using the shortname. All filepaths should be good now.

Change line 9 of unpackimg.bat:

set "file=%~f1"

To:

set "file=%~dsp1%~nx1"

By the way, this site/reference page for batch is amazing: https://ss64.com/nt/syntax-args.html

I can't count the number of times it saved my ass. :)
[Android Software Development] mohsen8:
hi i have samsung g935fd when unpack and repack the boot.img without any edit moding phone get bootloop but in n920c in same android 7.0 i have no prob

i use this command

repackimg —original

repackimg

repackimg —original —3

any help for repack new boot.img samsung??
[Android Software Development] Wuby986:
flashed magisk after the kernel? might be encryption related
[Android Software Development] mohsen8:
TNX for replay i am in fully stock rom so yes its enctyption i used odin for flash not twrp

i want make kernel and flash it withe odin but get bootloop i test it before on another encryption samsung phone so maby samsung used new way encryption?? any idae

in command repackimg [--avbkey <name>] whats means name??
[Android Software Development] osm0sis:
repackimg --3 isn't a thing, and --avbkey isn't necessary if your image isn't detected as having an AVB signature.

If reflashing a file packed with repackimg --original causes bootloops then there's likely an enforced Samsung signature or something on the file. Can you upload the original unmodified boot.img so I can take a look?
[Android Software Development] mohsen8:
this is my unmodified boot.img tnx

https://www.mediafire.com/file/k118352e5adq520/boot.zip

edit: this boot for G935FD Android 7.0
[Android Software Development] farovitus:
For me on linux, i unpack and repack with this commands:

./unpackimg.sh

./repackimg.sh
[Android Software Development] osm0sis:
Yep, as I suspected, it's got one of Samsung's signatures at the end, after the SEANDROIDENFORCE footer, and it's the only difference between a repackimg --original file and the unmodified. They're clearly enforcing this on your device's bootloader, and nobody has reverse engineered this signature yet, so you're pretty much out of luck.

e.g.:

SEANDROIDENFORCE
................
û‹.kØ’C¹rÍ...çA.
þÀn.8€J•HR.Wc.Â+
.VÒ¿å.ß.\.h.éÐþˆ
ç.ÁÂ%%“MGïYîÚ÷3Ì
‹wÐ.ºè.·¾ÕiY/ô…ý
GO.ò.^C.7.®tÁëé.
žý)‹ÛÒ±.ïL”.nq?.
H.Ua'™ŽÌq¼.‡ÆÏvr

etc.

You can try just taking the signature from the unmodified boot.img and copying it to your modified one by appending it to the end in a hex editor after AIK repacks an image-new.img for you. I doubt it'll work since the signature looks like a massive checksum/hash/key, but it's worth a try. Let me know if it works.

See also Chainfire's attempts with modified images on Samsung devices enforcing their signature here: https://xdaforums.com/showpost.php?p=72204306&postcount=978
[Android Software Development] mohsen8:
Tnx for your help i try harder to find a way the hex editor way not working
[Android Software Development] Wuby986:
as i said before, you have to flash magisk or SU right after kernel to remove the encrypt and dm-verity, or you need to edit ramdisk manually..
[Android Software Development] mohsen8:
Ok but i say above i just want to throw odin so i need to edit ramdisk and add magisk in boot.img right? Can you guide me for this? It is possible!

In android 5 we can add auper su but its not worked now
[Android Software Development] Wuby986:
we're ot here. anyway just to conclude search the dm-verity disabler zip in this tread and investigate what it does and do the same to your ramdisk. should boot fine

https://xdaforums.com/showthread.php?t=3333770
[Android Software Development] osm0sis:
Are you sure? Samsung's signature enforcing is different from dm-verity. Read my previous post.
[Android Software Development] Wuby986:
well yeah.. it's not just dm-verity but it also removes force encryption.. or at least that's what i understood and i am used to do.. i unpack stock kernel, replace the zImage with my custom compiled, then repack and flash with magisk's zip inside the zip ,usually..
[Android Software Development] mohsen8:
Okay waht i do

Just repack and unpack and change the signature withe hex editor phone booted but when i make change on boot.img and again make signature withe hex editor like stick its booted normal and my change didn't work

But i removed the encryption and again what i do get bootloop on logo..so now i can't make change and it work but the twrp recovery worked good and boot the recovery.img can be like boot.img or the have different
[Android Software Development] mohsen8:
[MENTION=4544860]osm0sis[/MENTION]

hi i tested this https://teamw.in/devices/samsunggalaxys7.html and its work good but when i unpackimg and repackimg withe Android Image Kitchen get bootloop?

can you check it tnx
[Android Software Development] osm0sis:
Ah, so you're saying the missing Samsung signature footer is tied to the encryption key? That'd be news as well!

Interesting! Which file specifically? There are several devices linked from there.
[Android Software Development] mohsen8:
This

https://dl.twrp.me/herolte/

G930FD
[Android Software Development] osm0sis:
Okay, that one repacks identically with --original, so the signature isn't the problem in this case (since there isn't one). Thanks! Maybe some custom OEM ramdisk stuff to be accommodated for some newer Samsungs. I'll look into it.
[Android Software Development] mohsen8:
tnx your the man waiting for your new work

and one more thing when i repackimg with --original in some samsung new firmware even 4.4.4 the change i made in ramdisk not working maby this command return the ramdisk to orginal stats...but the repackimg work good only in android 7.0 new samsung get bootloop i hope this infomation help you keep up your good work

tnx again
[Android Software Development] osm0sis:
With the TWRP and unmodified boot image you pointed me to mkbootfs is setting the ownership correctly according to my updated AOSP list, and I guess it's possible that your device doesn't like that? I have no issues with repacked TWRP booting on any of my devices. :confused:

Do you have access to Linux? AIK-Linux with unpackimg.sh --sudo should always work for these types of things.
[Android Software Development] mohsen8:
yes i have Linux and for twrp you right it work now for me just no luck withe boot.img new samsung firmware tnx for your time sir
[Android Software Development] eriksson25:
Hi, super stupid Q but have scrolled thrue alot of pages and dont se anyone having the same problem.

Trying to use your program and when I try to unpack I get Android_win_tools\file not recognized as internal or external command.

Sprry for noob question.
[Android Software Development] ashyx:
For which device are you having issues with? I have repacked tons of Samsung images without issue with AIK.

I haven't repacked any Android O images yet, but everything up to NN is repacking fine.

I'm truly thankful to Osmosis for AIK as it makes my life so much easier and is always up to date.
[Android Software Development] osm0sis:
Very little to go on here.
[Android Software Development] mohsen8:
Hi G930F and G935F last n update
[Android Software Development] eriksson25:
Windows 10, x64. Downloaded zip from github and unzipped. Places a boot.img file in same folder. Then try to run the script. and get the following.

C:\Users\eriksson25\Downloads\Android-Image-Kitchen-master>unpackimg.bat boot.img
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: boot.img

Removing old work folders and files . . .

Setting up work folders . . .

'"C:\Users\eriksson25\Downloads\Android-Image-Kitchen-master\\android_win_tools"\file' is not recognized as an internal or external command,
operable program or batch file.

The folders are created but empty.

I have a dubble \\ and that looks wrong for me but I dont realy know.

Is there any other software needed to run this, that I need to install.
[Android Software Development] ashyx:
So it's just the latest update that is causing issues? Any changes in the header?
[Android Software Development] osm0sis:
Downloads are in the OP.
[Android Software Development] eriksson25:
Ahh, there we have it. Now it works! Thank you!
[Android Software Development] mohsen8:
orignal boot

modd boot

orig signature

mod signature
[Android Software Development] ashyx:
That's looks pretty normal and just like any other Samsung boot image.

Obviously the modded boot has no signature which isn't required on a device with an unlocked bootloader.

What happens if you append the signature to an unmodified boot image after repacking?

Also just to confirm, you are actually disabling dm-verity in the Ramdisk?

Would you mind posting the stock boot.img you are using so I can repack it for you to test?
[Android Software Development] osm0sis:
If unpackimg.sh --sudo doesn't work for the boot.img (where it does for TWRP), then that's still suggestive of either the bootloader doing signature verification or a dm-verity issue.

Did you try flashing your modded boot.img in recovery and then immediately flashing SuperSU?
[Android Software Development] osm0sis:
[MENTION=5288606]XCnathan32[/MENTION]

Any more news on this? Is repackimg working after all? I'm readying v2.9 in the next week or so and just want to make sure things are good for Oreo.

What was the fstab edit you had to make (for future reference)?
[Android Software Development] shreyas_kulkarni:
Trojan in dumpimage.exe :/
[Android Software Development] Vagelis1608:
Well, avast hasn't complaint to me...
[Android Software Development] osm0sis:
Uh no. Compiled it myself.

Because there isn't. ;)
[Android Software Development] shreyas_kulkarni:
See attachments :) Not being offensive, I really appreciate your great work :D, false positive (?) Maybe... But Trojan?!?!
[Android Software Development] osm0sis:
Oh I believe you, but it's definitely a false positive. I think it was brought up once before since I started including them, but because U-Boot contains such low-level Linux operating system stuff it seems it can sometimes mistakenly get flagged by heuristics.
[Android Software Development] asgharSo:
Hi Bro

Unfortunately my English is not good. And using the translator I raised my problem.

i unpack original boot.img And I do not do any edits and then repack

after Write with odin An encryption lock appears on the phone.

There is a pattern on the phone

But after repack boot.img file, another encryption lock will appear.

Why does this lock appear after repackimg the file?

i use this command

repackimg

repackimg --level 9

linux - windows

Other tested models work without problems! But on the J710F ANDROID 7.0 an encryption lock appears.

Without editing the s7 models, Android 7 will hang on the bootanimation.I think This method the new Android version does not work on the exynos chipset!

We unlock the phone screen by manipulating boot.img!We are by a method With editing Boot.img we could unlock the phone without clearing the data!

But in some models, because the type of repack does not work properly, we will not succeed.

what is the problem?

Please help
[Android Software Development] osm0sis:
Sounds like encryption might be tied to a signature in the boot.img, or something is losing necessary permissions on the repack. 2 tests to know which:

1) On Windows: repackimg.bat --original

If still broken you know it's a signature issue.

2) On Linux: unpackimg.sh --sudo; repackimg.sh

Might work if it's a permission/ownership issue
[Android Software Development] asgharSo:
Thank you sir

1- i use the --original And the phone will turn on without problems, On some models like S7 we have to copy the footer SEANDROIDENFORCE from the original kernel and paste it onto the customised kernel we built.

But this method is not applicable and the changes we made to ramdisk are not enforced And the original kernel is delivered to us.

2- This method works like the above method but it does not make any changes!

How can we make changes to the RAMdisk using any of the above?
[Android Software Development] osm0sis:
1 doesn't make changes since it uses the original ramdisk, 2 does, just use --sudo to unpack, change whatever you want then repack.
[Android Software Development] asgharSo:
i use the --sudo But the extracted content is locked

mediafire.com/view/jwcf4133xc4712v/download.png

How can I unlock? Or apply changes in this case?
[Android Software Development] osm0sis:
It's not locked, it's root user, so use root to edit it, with a root command prompt or typing sudo nano or something.
[Android Software Development] asgharSo:
Ohh!Yes, with the command "sudo nano" I was able to edit the file init.rc after repack with repackimg.sh

But again the encrypting lock appeared :(

What else could you do?
[Android Software Development] osm0sis:
Are you sure you got the command order correct?

./unpackimg.sh --sudo

sudo nano ramdisk/init.rc

./repackimg.sh
[Android Software Development] Vagelis1608:
I find using 'chmod -R 777 ramdisk' and 'chmod -R 755 ramdisk' easier.
[Android Software Development] asgharSo:
I also use this method

I even repack without editing, but an encryption will appear.

What is the problem?

---------- Post added at 02:35 PM ---------- Previous post was at 02:33 PM ----------

Is there a difference in this way?
[Android Software Development] Vagelis1608:
You can use gedit this way and other text editors, which I like better than nano.

You set the perms to 777 before the edit and 755 after the edit.

I suppose you could also use 'sudo gedit *file*', but I haven't tried it.
[Android Software Development] asgharSo:
This does not make a difference! Both boot editing modes do not work on the device!
[Android Software Development] osm0sis:
I wouldn't recommend recursive commands since many files will require fewer permissions than that so could also break things.

You previously posted that using --original and --sudo would both produce booting files. Either you were mistaken or you're editing something important and breaking things. There's not much else we can do for you at this point.
[Android Software Development] asgharSo:
I did not test the --sudo method just because I did not have edit access.This method also encrypt without editing the phone.And breaks in the S7 models :(
[Android Software Development] asgharSo:
hi dear

How to use --avbkey command?

[--avbkey <name>] What is this name command? How do we find the "name" of the command?
[Android Software Development] osm0sis:
Read the OP, it's explained there.
[Android Software Development] jack allen:
Where is aik 2.8 i cant find it anywhere all the the links just go to thread after thread etc etc
[Android Software Development] Paschfire:
Current available version of AIK is 2.9, DL links available within the OP section.
[Android Software Development] osm0sis:
[MENTION=903232]Magendanz[/MENTION], since I don't usually/generally take technical PMs I'll answer you here where it's on-topic.

That recovery.img is not signed at all. In fact, repacking with AIK, repackimg --original produces a literally identical file.

I don't see anything out of the ordinary in the boot.img from the OTA package you linked me in your follow-up PM either. There are some interesting binaries in the recovery /sbin directory, which the OEM might use via init.*.rc or some ROM-bits to do some sort of checks, but that wouldn't affect the boot. Those are my only thoughts on the matter though, and none of that would really be anything AIK itself needs to handle.

Best of luck with the ongoing work! FreakTab's a fun forum of orphan devices. :)