yashsingh1/xdaforums huggingface dataset:
[Android Software Development] ipdev:
Bit OT for this thread. ;)

Depending on the device, Android version, ...

default.prop was replaced by prop.default.

default.prop is often just a symlink to prop.default

System-As-Root devices normally have multiple prop.defualt files across the partitions.

system | vendor | system_ext | ...

They all get loaded and merged during boot.​

You will need to determine which one you need to modify.

If the prop is in multiple files, the last one loaded is the active value.

Cheers. :cowboy:
[Android Software Development] CXZa:
Not necessarily. In some cases it just might be some nulls taking unnecessary space that are missing...

Are you sure? It might compromise the security. At least values that are in the same prop file cannot be changed if I remember correctly. The ro. values. that is...
[Android Software Development] alecxs:
you are talking about something different? please refer to post #2.722
[Android Software Development] Narkozzz:
Hi, guys! Trying to port TWRP to Samsung M52 5G phone, took A52 5G recovery as a base and stock from firmware. But I suspect unpacking done with errors - there is no /etc/, /vendor/ is empty, I cant find any fstab files besides recovery.fstab. I am using instructions from 2019, so maybe I just doing it wrong looking for files that is not supposed to be there in modern images?
[Android Software Development] alecxs:
one can't port TWRP. get sources and compile selinux permissive kernel then build TWRP from source
[Android Software Development] Narkozzz:
Well, usually you can by taking closest to your model available TWRP and replace some files in it with extacted from stock recovery of your phone. I did it before with other phones.
[Android Software Development] CXZa:
No way to know what kind of images they are talking about. please refer to post #2,720 .
[Android Software Development] K_a_m_i:
Hi everybody! I'm tryimg to unpack the boot image below but all tools I tried so far are unable to unpack ramdisk. I can unpack kernel but not the ramdisk. Can anyone help me?
[Android Software Development] kory-vadim:
There is simply no ramdisk in your boot.img.
[Android Software Development] HoraceHuang:
After unpacking, the "fstab.qcom" file keeps warning "couldn't find D:\Sony.txt" when being opened with Notepad. Sony Xperia 5 II
[Android Software Development] Kartoniq:
Hey, I was told to ask in this thread - I am stuck in bootloop after installing Magisk modules (Samsung S9 SM-G960F)

Things I tried:

- removing the modules with adb (says 'daemon started succesfully' but the phone is still stuck in bootloop after that)

- installing magisk manager for recovery mode (can't install, ERROR 1 in TWRP)

- installing the GUI version of mm (can't install it either, says 'invalid zip format')

- 'format data' in TWRP (nothing changed, still stuck in bootloop)

I'd appreciate any help, it's a new phone and I'm afraid I've permanently bricked it :(
[Android Software Development] alecxs:
as you already formatted /data (really?) all your data is lost. so why not start from scratch? extract stock ROM and flash stock boot.img
[Android Software Development] Kartoniq:
yep it was a new phone so I didn't have anything on it. Flashed the stock rom and everything works, thanks.
[Android Software Development] ace2nutzer:
@osm0sis

Using latest release with latest LTS Ubuntu 20.04 (Lubuntu 20.04.4 amd64) I'm getting this warning:

Is it still unsafe to use cpio v. 2.13 ? - Should we really downgrade to v. 2.12 ?
[Android Software Development] alecxs:
Little stupid question as 2.13 will always be 2.13 and therefore as long as it is 2.13 it will always have the bug.

check post #28 on other thread
[Android Software Development] ace2nutzer:
Well, it wasn't that stupid at all. I was just hoping that he already fixed it and just forgot to remove the warning from the script. Basically things that can happen when we developers are still coding late at night.

@osm0sis please check if this method is safe for AIK and please tell us if there is a "better" solution, or if you will fix it in some way in next release. :)

Anyway, downgrading to cpio 2.12 is a bit painful since it removes important packages. Of course we can re-install them, but it's quite painful to get them quickly properly re-installed, because you need to install those packages in the right order, otherwise you can end up with a non booting OS. Caused even two errors while booting about "plymouth" and "plymouthd". Also cpio binary is used every time after an system upgrade or when you need to run "update-initramfs".

See here:

~$ sudo apt purge cpio
[sudo] Passwort für ace2nutzer:
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
busybox-initramfs initramfs-tools-bin
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
Die folgenden Pakete werden ENTFERNT:
cpio* cryptsetup-initramfs* dmraid* initramfs-tools* initramfs-tools-core* kpartx-boot* ubuntu-standard*
0 aktualisiert, 0 neu installiert, 7 zu entfernen und 1 nicht aktualisiert.

Therefore it would be better to pass cpio_2.12 to AIK without to mess it up with the OS or not ?

Or even better: why not adding a static cpio binary to AIK package instead to complain to the user?

Actually I've fixed it this way:

Assuming you are in AIK folder:

wget http://archive.ubuntu.com/ubuntu/pool/main/c/cpio/cpio_2.12+dfsg-6ubuntu0.18.04.4_amd64.deb

open it with "Archive Manager" and unpack "data.tar.xz"

Then create a folder like "cpio_2.12" and put the bin folder inside containing the cpio binary.

## The following symlink fix for mt seems to be not needed since AIK doesn't use mt or mt-gnu binary at all. ##

Then create a symlink to mt-gnu for mt

cd cpio_2.12/bin
ln -s mt-gnu mt

Reference:

~$ ls -l /usr/bin/mt
lrwxrwxrwx 1 root root 20 Mär 17 22:31 /usr/bin/mt -> /etc/alternatives/mt
~$ ls -l /etc/alternatives/mt
lrwxrwxrwx 1 root root 11 Mär 17 22:31 /etc/alternatives/mt -> /bin/mt-gnu
$ ls -l /bin/mt
lrwxrwxrwx 1 root root 20 Mär 17 22:31 /bin/mt -> /etc/alternatives/mt
$
$ ls -l /bin/mt-gnu
-rwxr-xr-x 1 root root 88864 Aug 25 2021 /bin/mt-gnu

Now add the following two lines in line #4 of the "repackimg.sh" script;

CPIO=cpio_2.12
export PATH=$CPIO/bin:$PATH

Do the same for "unpackimg.sh".
[Android Software Development] chen939:
重新包装后无法使用
[Android Software Development] starbucks2010:
Hi @osm0sis,

Does the actual version of AIK v3.8 handles the boot.img header v4 found on Samsung S22 kernel?

Thanks.
[Android Software Development] osm0sis:
Nope. No v4 support yet while my development focus has shifted to my infant daughter here. :p

Finally got a new laptop though and slowly working on migrating my setup and build scripts/env over to Windows 11 and WSL2, then hopefully picking away at things for AIK v3.9 again after that.

See my previous announcement post for how to handle v4 in the meantime: https://xdaforums.com/t/tool-androi...roid-linux-mac.2073775/page-137#post-85997521
[Android Software Development] osm0sis:
Ughh, so my 3 month old (i.e. brand new) MSI laptop's SSD decided to fail about 3 days after I finished moving everything off of my old desktop HDDs and formatted the old drive, and of course Cygwin and WSL2 aren't backed up by Windows File History, so uhh, this is a bit of a setback... I had just finished updating all my build scripts for WSL2 too, but hadn't had the chance to publish them on xda yet...🤦‍♂️😓
[Android Software Development] ipdev:
Ouch. 🤕

Unless someone has gone though the same (rewriting their WIP code) they will never know how it feels to start over again.

I am still missing a complete section (working WIP update) I added to a script because all my notes about it were in the WIP script that I lost.🙁

We feel your frustration.

Look on the bright side...

Your (re)edit/changes might be better than your original changes. :unsure:

Cheers. :cowboy:

B.

PS.

Mine was a hardrive failure duing a normal Linux update.
[Android Software Development] Postman1year:
你重新包装后的IMG沒有签名,所以无法使用,它是AVBV1版本, 我很久沒上了, 今天才看到才做好了, 你试试
[Android Software Development] kpirnie:
google it (on phone atm) but you can move the .vhdx for WSL2
[Android Software Development] osm0sis:
Good idea! I'll look into adding that to File History once I get it back from RMA and have everything set up again.

I'd also been trying to figure out how to access the WSL2 home directory from across my home network but hadn't figured that out yet either... Probably setting it up with a WSL2-side SMB share or something could work, but no hits for anyone having tried that yet in my Google searches.
[Android Software Development] optimusodd:
Hello @osm0sis I can confirm that it's not working for Asus ZenFone 3 ZE552KL.Can we hope of finding a workaround ? Thank you!

https://xdaforums.com/t/help-how-to...ithout-losing-your-data.4383255/post-86817501
[Android Software Development] kpirnie:
you could. just have to open the samba ports on the host machines windows firewall.
[Android Software Development] doc.K:
During unpacking of recovery.img stock by AIk latest version I am getting 0kb files of default.prop and many 0kb files.

Can u help me?

I am One plus 10Pro user

Uploading recovery.img
[Android Software Development] alecxs:
open the 0 kb file with editor and read what's inside ;)
[Android Software Development] doc.K:
It's not opening by notepad + or ++

I m using windows 11
[Android Software Development] doc.K:
In previous reply I read that 3.7 version is working but I could not found the link to download it.can some one post the link plz
[Android Software Development] alecxs:
try HxD hex editor open the 0 kb file and read what's inside. download links bottom of post #2
[Android Software Development] osm0sis:
They're 0 bytes because they're symlinks...
[Android Software Development] alecxs:
... and open symlinks with hex editor will reveal its target :P
[Android Software Development] doc.K:
Default.prop file is also not opening by hxd editor.

3.8 kitchen is working good for TWRP unpack but it has issue of 0kb multifiles when I use stock recovery of One plus 10 pro obtained by payload dumper of fastboot enhanc.

Still I didn't found link of 3.7 version.

#2 post has links of perticular post that doesn't has download link. If anybody has that plz send me. Thanks 👍
[Android Software Development] alecxs:
You know there is no recovery partition for A/B devices, don't you? recovery ramdisk is in boot.img. there exist also no TWRP for this device (yet) so why don't you upload whatever you're trying to unpack so @osm0sis can have a look into why it "fails"
[Android Software Development] doc.K:
recovery

MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.

www.mediafire.com

i am trying unofficial TWRP port by following this guide: https://xdaforums.com/t/guide-porting-twrp-without-source.3843473/
[Android Software Development] osm0sis:
default.prop is now a symlink to prop.default... You can't open prop.default because it's on /system... This has all been since system-as-root has been a thing, which is years now.

Edit: Added to FAQ.
[Android Software Development] BlackMesa123:
I'm getting a "Unrecognized format" error on my MacBook with M1 Pro when trying to extract Galaxy A52s img files. Is there an issue on my side or are the missing aarch64 binaries a possible reason for this error to appear?
[Android Software Development] osm0sis:
Yeah, this predates M1 Macs existing. Not sure how to support them where I don't have one to test on and I'd need MacPorts prebuilts for all the things I don't build myself. That said, I'll look into it wherever I finally have a working development environment again.

Can you give me the output of `uname -s` and `uname -m` ?
[Android Software Development] BlackMesa123:
uname -s: Darwin

uname -m: arm64

Seems incredible but by forcing the arch to x86_64 in the .sh files the scripts work flawlessly, I imagine because the system automatically uses Rosetta to launch the binaries, but imho having native arm64 bins would be better
[Android Software Development] juniorhero:
i am getting this error

boot.img packed by mkbootimg

the same boot.img unpacked by unpackbootimg is causing this error.

is this tool working fine, is v3.8 the latest version??
[Android Software Development] osm0sis:
There's no error there.
[Android Software Development] juniorhero:
ok

but no output was generated
[Android Software Development] osm0sis:
Looks correct to me. Why didn't you use the AIK scripts?
[Android Software Development] juniorhero:
./repackimg.sh --help

usage: repackimg.sh [--local] [--original] [--origsize] [--level <0-9>] [--avbkey <name>] [--forceelf]

these variables are confusing. which variable for kernel Image and ramdisk?
[Android Software Development] osm0sis:
You need to unpack first..
[Android Software Development] juniorhero:
ok

i dont have boot.img to unpack first.

i need to make boot.img from ramdisk and kernel Image

how to do it?
[Android Software Development] osm0sis:
If you built them from source the device tree should do it automatically. Without a reference boot.img or Android build there's no way to know your device parameters for the boot image header/structure.
[Android Software Development] xinulhacker:
The Rockchip boot.img I'm using to port TWRP is not recognized by Android image kitchen or android image factory. I looked at the boot.img through a hex editor and it's missing the usual "Android" magic hex. Instead it starts with hex code spelling Kernel.

When trying to use Aik-Mobile, I receive Not recognized format error. Is there a patch to support Rockchip 31xx series images?
[Android Software Development] osm0sis:
Not sure what you mean. Both of those images have ANDROID! magic in the header and the recovery image you attached unpacked perfectly:

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

Supplied image: rk3128_recovery.img

Setting up work folders...

Image type: AOSP

Splitting image to "split_img/"...
ANDROID! magic found at: 0
BOARD_KERNEL_CMDLINE
BOARD_KERNEL_BASE 0x60400000
BOARD_NAME
BOARD_PAGE_SIZE 16384
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0x01c00000
BOARD_SECOND_OFFSET 0x00b00000
BOARD_TAGS_OFFSET 0xffc88000
BOARD_HEADER_VERSION 0

Unpacking ramdisk to "ramdisk/"...

Compression used: gzip
8951 blocks

Done!

There is something really weird about your boot.img though:

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

Supplied image: rk3128_boot.img

Setting up work folders...

Image type: AOSP

Splitting image to "split_img/"...
ANDROID! magic found at: 0
BOARD_KERNEL_CMDLINE �fef�Iٞ����l3-m�U-1+-+3+����s���O��}��}������,�yϻ��l�@v ;�2�fT�oB����?�K�.��.��c>L�:�fJE��(i�+g�M��PU7���@s:x;�铻�K:���.A�'�M���Μ������f�G��'̮��T]3�ZQ	����>����\QqI����+2��xȰ>�C	��Y�j+&ͮ�葎�	UU���4c֤靪fM�PW9kf�
G�l�1�G�1-��Q�tk8�8�o/OWd��|�����7��7
�<[��h�e�7E{!�eGlΡ�y�K;+y
zYC:S�!���Y��#�-q~��->�U-9Fe�ڕ+����߭��J�t�!�A�~Keu�q榝'c(�}���I��I�0J����Cc��8�v���1(���c�r�RFr���E�t�k�^���V�P75=\Gm�F�#��
h?�A�gi8d����V6�+���e�\�l%:�X�j�ӫ�:v�����ؤ*�����f�fY�2^��W�Fz��դS��&ݿ����mA}Xd�#pW��_�d#u2�9M�o����F���G��ҍt�[�hT�/!�Ï%���o>���Eǖe���Î�4��WQF5��d��<v�֝'o%�?I������ʨMȠ���9y;O���Q��J!���65�D�����*���?񈞿�kEO<�*C��':L;*뾩�ճ(��.�j�1�tP��敭n��x�ZQ���S�����
BOARD_KERNEL_BASE 0xffff8000
BOARD_NAME ��K.������Y��{�fef�Iٞ����l3-m�U-1+-+3+����s���O��}��}������,�yϻ��l�@v ;�2�fT�oB����?�K�.��.��c>L�:�fJE��(i�+g�M��PU7���@s:x;�铻�K:���.A�'�M���Μ������f�G��'̮��T]3�ZQ	����>����\QqI����+2��xȰ>�C	��Y�j+&ͮ�葎�	UU���4c֤靪fM�PW9kf�
BOARD_PAGE_SIZE 817922608
BOARD_HASH_TYPE sha256
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0xd554d809
BOARD_SECOND_OFFSET 0x30c3bb9d
BOARD_TAGS_OFFSET 0x0e38f733
BOARD_DT_SIZE -905304054

Warning: No ramdisk found to be unpacked!

Done!

The header is full of garbage; it's like it was zipped or something and you just used a hex editor to chop off the zip magic and header until you reached the Android magic, when you should have decompressed it. 🤔
[Android Software Development] xinulhacker:
Ty for your quick reply. I must be doing something wrong with the installation of Aik-Mobile... 😞

Yes. The boot image on this device is very strange. Magisk won't even touch it! Ha. As for the recovery, I will dig back into the thread and see if I can find my mistake.

Appreciate your time and help.
[Android Software Development] xinulhacker:
Hello, is there an option/flag to pass ramdisk alignment in Android image kitchen Mobile?

The recovery image I uploaded earlier in this thread RK 3128, can be unpacked and repacked without issue as you described above. However whether or not it boots is an entirely different story. It will not boot unless an alignment option is entered. If I use the alignment in carliv kitchen the image boots.

But I prefer using Android rather than Linux or Windows.

Ty for your time.
[Android Software Development] osm0sis:
What do you mean by alignment? Page size? Change the value in split_img/*-pagesize
[Android Software Development] osm0sis:
[MENTION=2471504]jeboo[/MENTION] Adjusted your code to give you credit (see above) and compiled this in Cygwin today and it's flawless man. Sometimes the simplest solution is the best. Amazing job! :D

Since Loki is a special case of standards breakage and the image needs to be android standard to be reloki'd before flash anyway, I'm thinking about including detection and support for the next version - BUT that might confuse people that it's not spitting out a loki'd image in the end.

As long as people get that they'd need to use the lokifying flashable zip, it'd work.. but people and reading.. hmm.. ;)

For now I've put it up as an add-on in the OP. If that's not okay, just let me know and I'll remove it. :good:
[Android Software Development] :
Hahahahahahahaha!!!!!!
[Android Software Development] JRJ442:
[MENTION=4544860]osm0sis[/MENTION] Gonna be checking out the Loki add on tomorrow ☺
[Android Software Development] sorullo_xgrx:
Moto X boot.img

hi everyone im trying to unpack the Boot.img from the Moto X but everytime I run the kitchen I get the Android Boot Magic not found Error!

help please/ advice thanks in Advance:crying:
[Android Software Development] osm0sis:
Red bold text in the OPs.
[Android Software Development] sorullo_xgrx:
Moto X verizon KK 4.4.2

https://www.dropbox.com/s/5per0bnr833nuy6/boot.img

---------- Post added at 01:17 PM ---------- Previous post was at 01:15 PM ----------

This explains everything thanks anyways.
[Android Software Development] osm0sis:
Yeah that must not actually be a boot.img, someone has it named incorrectly. It's only 1.2mb which would never hold a kernel zImage even.

If Motorola has a factory image or something you can flash to the unlocked bootloader, that's what you should be able to unpack. :good:

Edit: The header is IMGDIFF2 - did you take this from an OTA? In which case it was probably named boot.img.p ? That's a patch file and is definitely not a complete boot.img. :)
[Android Software Development] sorullo_xgrx:
Yep that's what it is lol Sorry. Got hold of the complete boot.img file thanks again
[Android Software Development] Vicolodo:
T-R42 valid rkimage?

Hello,

i need an update.zip or update.img of stock firmware for Android Tv Box : T-R42 B351 V1.0 or V1.1

to be put into the external sd card to recover the system

I have recovery version 4.2.01, that prompts for this options:

update from external storage: needs update.zip

update rkimage from external storage: needs update.img

I have no other options because my pc is no more able to recognize my T-R42 B351 V1.1

This is the link to the latest 'stock' rom img for my tv box (hopefully):

http://blog.geekbuying.com/index.ph...mware-for-t-r42-b351-v2-0-board/#.UxW0G85H7px

I tried with a custom ROM (in a single image file),

but when i select the option 'update rkimage from external storage'

the system stops with the error message 'rkimage not valid'

I hope that with 'Stock ROM" images this will not happen...

How to make valid rkimage for my device?

Thanks
[Android Software Development] fozzie:
Please don't cross-post. You've already asked in the appropriate place (http://xdaforums.com/showthread.php?t=2669650).
[Android Software Development] bgcngm:
If you want you can update the first post with a solution for MT65xx/MT83xx images unpacking/repacking.
[Android Software Development] aosp:
Ridiculousness thanks for continuing awesome dude can't believe you still using windows ? OTG FTW!
[Android Software Development] osm0sis:
Pulling the DL for now. A bug must have crept in last minute and the images don't boot. Apologies, and I'll figure it out shortly. I'll probably name it 1.0 when I do since that makes more sense than keeping it the same as the Windows version.

Edit: Remaking the image with the original ramdisk produces an identical sha1 sum to the before image, so it's something to do with the repacked ramdisk. I'm guessing permissions or busybox binary not cooperating. Narrowing it down now.
[Android Software Development] osm0sis:
Turns out booted Android FS permissions just don't appear to cooperate with a cpio repack of the ramdisk. This is confusing since cpio works fine in recovery where I was testing everything, so that's why I didn't pick up on the issue.

Anyway, much like for the obvious permissions limitations of Windows, mkbootfs is the answer; it's find, cpio and fix_perms all rolled into one. So I made a native Android compile of it and it's all tested and working perfectly now.

Release notes updated and the new AIK-mobile v1.0 is up in the OP. If you downloaded the previous version just flash this one over top. Have fun! :D

[MENTION=2838735]aosp[/MENTION] This is probably why those guys didn't support repacking the ramdisk in their app. Let them know they're free to use my binaries. :good:
[Android Software Development] nk7:
Fantastic
[Android Software Development] MrMarkEdward:
I have the AT&T Samsung Galaxy S4 when unpacking the TWRP recovery for the AT&T S4 get an error when it gets to

Unpacking ramdisk to "/ramdisk/" . . .

Compression used: empty

Error!

Press any key to continue . . .

I am just trying to add an image and repack it.
[Android Software Development] Scott:
Tool works great on Samsung Galaxy Tab Pro 8.4!

Thank you for this!
[Android Software Development] osm0sis:
TWRP pre-Loki's their images on devices which require it. See the OP for the addon to unpack, and links to info on how to flash the repacked image.
[Android Software Development] osm0sis:
I also just finished getting a crosstool-ng cross-compiler from Cygwin to Linux build working which I'll detail soon. ;)

Anyone willing to test out the AIK-Linux version I just made? PM me please. I've got dynamically linked binaries in there but if those don't work, then I'll make some static binaries. :D
[Android Software Development] xinulhacker:
This is what a friend said who is helping me with this project.

xinulhacker said:

The last two failed to boot.

Reply:

Repack image with the pack option /rmd4 - alignment of ramdisk in Android Boot image (pack option).

I think boot or not boot is random without this option, there is no logic between booting or not booting? It was a very small change in ramdisk to make twrp not work.

He is using carliv kitchen on Linux to repack and the images boot if he adds whatever this " /rmd4 " is ...
[Android Software Development] osm0sis:
Not seeing anything from Googling rmd4 ramdisk. What supports that pack option? Point me again to the .img which AIK repackimg --original doesn't result in a booting .img and supposedly needs "alignment" so I can compare what's different.
[Android Software Development] xinulhacker:
That's a great question. I will ask him. I thought it was some option known to those with more experience so I have not researched his recommendation myself.

I will look deeper.
[Android Software Development] xinulhacker:
171 failed to boot

171aligned booted

"alignment option" used

Stock recovery being ported

If I unpack and repack the stock recovery using AIK without making any changes, it will not boot. Hangs on splash screen.