yashsingh1/xdaforums huggingface dataset:
[General Topics] ChromiumOS-Guy:
when you mean The parse 'error' was shown

you mean: Invalid sparse file format at header magic / Invalid sparse file format at header

right? (if not then idk)

if that's that than its fine its a good sign actually, well if the super.img generated then it will most likely work and if it doesn't that likely means the source super.img has something wrong with it I debugged this whole thing for 2h that one time when my downloaded super.img got corrupted without me noticing (and another when i had miss matched versions of frimware between super.img and rest of the things),

that or you inputed the settings incorrectly but I highly doubt that because as you said you created a GSI so I assume you know your stuff.

edit:

also I'm kinda new in the smartphone modding community so if i don't know terms that's why as I'm more from the firmware / hardware world.

also added an example_log to the release log so you can see how it's supposed to behave (also couldn't hurt to try other GSIs just in case)

if it still doesn't work you can point me to the files and I'll try it on my linux install then i can debug it further so if its something with my script then i can have access to all variables (and if that doesn't work i can probably try doing it manually figure out why and fix my script)
[General Topics] harvey186:
Yes, I mean thhis warning:Invalid sparse file format at header magic / Invalid sparse file f... I know it from flashing GSIs via fastboot. It's really a warning and not an error.

I will come back to you, when my super image for the watch is also looping. thx in advance
[General Topics] ChromiumOS-Guy:
np :)
[General Topics] Loopback7084:
Hi all... I'm sorry this is 'slightly' off topic... Thanks for the great guide for unpacking / repacking. This has been a go-to thread for a long time for me. However I'm struggling with a follow-on activity. After stripping down a stock ROM image, I've come to add a few apks back to an image... a process many many years ago I used to refer to as 'slipstreaming'... and back when I last did it.. ( Android 7 )... it was very straightforward.

However, this image is android 12, and although I'm perfectly able to unpack & repack the image, and successfully boot and use it, no apps I add to the system.img will actually run. The process is thus:-

1) unpack super

2) resize2fs system img ( add space )

3) mount it

4) add the apks to ./system/app/[appname]/[app].apk

5) chmod the folder to 755 and the apk to 644 ( not entirely sure why this was found on searches )

6) unmount

7) resize2fs -M system

8) repack with lpmake

9) reflash the NAND, optionally wipe data ( depending on how much I've butchered the ROM ).

Everything "else" works... apart from the APKs I've added... ( they 'appear' as apps but not correctly - icons are "off" and the won't execute... ( see attached )... really grateful of any help... what am I doing wrong...?
[General Topics] harvey186:
try to add the apks in folder /system/priv-app/
[General Topics] Loopback7084:
Just seems to cause a boot-loop doing that :-/

( Edit:- The apks themselves are "fine" - installing them with after firstboot with adb -i [app] works fine )
[General Topics] harvey186:
And why do you want add the to system ? Have you tried to add them in 'product' or 'vendor' image ?
[General Topics] Noah Allen:
Hello

I am getting a new error with your latest tool.

When I tried to run the script on Ubuntu, it said "Permission denied."

So someone suggested running from usr/bin with Python, and it gave me this issue.

flags successfully verified and appear to be correct, error code (OK)

============================

unpacking...

============================

File "/home/noah/Desktop/SuperPatcherGSI/linux/SuperPatcherGSI.AppDir/usr/bin/lpunpack.py", line 61

match attributes:

^

SyntaxError: invalid syntax

============================

choose img to replace

============================

Traceback (most recent call last):

File "./SuperPatcherGSI.py", line 173, in <module>

err = main()

File "./SuperPatcherGSI.py", line 145, in main

IMGchoose() # replaces selcted partition with GSI

File "./SuperPatcherGSI.py", line 48, in IMGchoose

TempImgList = os.listdir(TempDIR)

FileNotFoundError: [Errno 2] No such file or directory: '/home/noah/Desktop/SuperPatcherGSI/linux/SuperPatcherGSI.AppDir/usr/bin/tmp'
[General Topics] harvey186:
That's not correct. The issue of 'no permission' is coming from none executable AppImage. And was solved when using

'bash' instead of . /
[General Topics] Noah Allen:
I have tried with bash. But I am getting the same error.

SuperPatcherGSI-x64.AppImage: SuperPatcherGSI-x64.AppImage: cannot execute binary file
[General Topics] ChromiumOS-Guy:
you can always use the source directly just download my main and try to run SuperPatcherGSI.py directly (would love to help more but my distro was giving me trouble so I'm currently on clean install so I have stuff to do)
[General Topics] Noah Allen:
Oh yeah. I have tried that too. It showed me like this.

flags successfully verified and appear to be correct, error code (OK)

============================

unpacking...

============================

File "/home/noah/Desktop/SuperPatcherGSI/linux/SuperPatcherGSI.AppDir/usr/bin/lpunpack.py", line 61

match attributes:

^

SyntaxError: invalid syntax

============================

choose img to replace

============================

Traceback (most recent call last):

File "./SuperPatcherGSI.py", line 173, in <module>

err = main()

File "./SuperPatcherGSI.py", line 145, in main

IMGchoose() # replaces selcted partition with GSI

File "./SuperPatcherGSI.py", line 48, in IMGchoose

TempImgList = os.listdir(TempDIR)

FileNotFoundError: [Errno 2] No such file or directory: '/home/noah/Desktop/SuperPatcherGSI/linux/SuperPatcherGSI.AppDir/usr/bin/tmp'
[General Topics] ChromiumOS-Guy:
I'm using lpunpack from here:

GitHub - unix3dgforce/lpunpack: command-line tool for extracting partition images from super

command-line tool for extracting partition images from super - unix3dgforce/lpunpack

github.com

if this doesn't work then i guess something about you're linux install is weird, you can try downloading lpunpack binary (and its libs) from https://ci.android.com/builds/branches/aosp-master/grid and change the call to lpunpack.py to lpunpack binary it should work all the same the only reason i have the python version is that it doesn't require a lot of work to use

edit:

don't use ci.adnorid.com... version they have invalid utf-8 incoding so it can't run (at least through python)
[General Topics] Noah Allen:
Alright, thanks, it works. But I am having this issue. Could you please look into this?

lpmake E 08-07 20:33:31 70292 70292 images.cpp:320] [liblp]Partition should only have linear extents: mi_ext_b
[General Topics] sbanskot:
Hey guys,

I am relatively new to this custom ROM business, so maybe my situation is less complicated than it seems to me, so any advice would be appreciated.

I have a Samsung Galaxy Tab Active3 tablet that I have rooted with Magisk. Therefore, at the vbmeta.img level, dm-verity is surely disabled. I can confirm this because I can pretty much follow this XDA thread on modifying the system.img inside the stock super.img (Android 13) and flashing it back to the device. I do not get stuck in a boot loop or anything like that. I can confirm that I did all of this correctly.

The issue is that none of my changes that I made in the system.img persists once I boot the device. For example, I added a "hello_world.txt" into the root directory of system.img and I also added some comments to the init.environ.rc file. After flashing and booting up, these changes are gone. I am unsure as to why this is. I am using odin 3.14 to flash and I only flash the super.img partition.

Shouldn't magisk modifications to vbmeta.img have allowed me to flash custom ROM? Is my flashing step incorrect? After some research, I have some suspicion that it has to do with fstab and dtb. The fstab file in my device has the following for the system partition:

wait,avb=vbmeta, logical,first_stage_mount, avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey

I am not sure where to go from here. This is a non A/B device btw.

Thank you for any help!
[General Topics] ChromiumOS-Guy:
I didn't actually modify any system.img so i can't tell for sure but i do have some knowledge in linux and this seems like a permission problem the user can't see you're files because permissions are not correct as for why you're comments don't show up inside existing files all i can say is it sounds like some fallback idk android that much, I will at somepoint make my own GSI but i have a lot of project going on so all i have is general knowledge on the the topic and can only make educated guesses still i hope this helps :)
[General Topics] zhaozhixin:
Thank you, this help me a lot. I have been took weeks with Amlogic Kitchen which the bluetooth did not work with Android 10
[General Topics] ChromiumOS-Guy:
i already had this issue just delete the partition and make a new one with size of 0 with the same name (this is now possible in latest release of my tool)

that is if you don't need the data in mi_ext_b which you probably don't because i assume you are using some GSI and not stock ROM (which is the only ROM that will ever need the partition) on my phone i deleted all dynamic partitions but system_a vendor_a product_a and it works so if you don't use Stock ROM you can do this method if not then i guess you can try repairing the img to only have linear extensions (could probably do it by flashing to an SD then changing the extensions with gparted then dd it back to an .img file)
[General Topics] Noah Allen:
Well, I did it for GSI, But now I am trying to port a MIUI Rom. I couldn't use your tool at all. Giving errors. Here are the logs.
[General Topics] ChromiumOS-Guy:
SuperPatcherGSI-x64.AppImage: SuperPatcherGSI-x64.AppImage: cannot execute binary file

you need to chmod, just do sudo chmod +x SuperPatcherGSI-x64.AppImage

also use my new release v1.5.3, also make sure you have the libs: argparse , copy , enum , io , json , re , struct , sys , dataclasses , pathlib , string and typing, all should be by default but check anyways (you nned them for lpunpack.py) if you still can't use lpunpack.py you can try editing SuperPatcherGSI.py to use a binary instead of lpunpack.py i already commented what will happen if you try to do it but you can try anyways for reference the problem is your linux install because if i can run this on arch/debian/WSL/etc.. and on different hardware then its something with you're install maybe config files or something idk, hoped this helped :)
[General Topics] Noah Allen:
I think it works. But somehow it doesn't let me keep choosing a number because it doesn't show anything to choose me. Could you please take a look at my problem? Something was wrong from the beginning. It should convert to non-sparse, shouldn't it?

python3 SuperPatcherGSI.py -i super.img -o output.img -s 2

flags successfully verified and appear to be correct, error code (OK)

============================

unpacking...

============================

File "/home/noah/Desktop/SuperPatcherGSI/SuperPatcherGSI.AppDir/usr/bin/lpunpack.py", line 61

match attributes:

^

SyntaxError: invalid syntax

============================

img manipulation

============================

Chosse Operation:

1. Delete Partition

2. Replace Partition

3. Add Partition

select: 3

Input Partition Name: test

Input Partition Size: 0

name: test

size: 0

Is This Correct? (Y/n): y

0+0 records in

0+0 records out

0 bytes copied, 0.000422027 s, 0.0 kB/s

Replace/Delete/Add another (Y/n): y

Chosse Operation:

1. Delete Partition

2. Replace Partition

3. Add Partition

select: 1

option number 0 test.img size of (0) bytes

Please Choose: 0

Partition Deleted!

Replace/Delete/Add another (Y/n): y

Chosse Operation:

1. Delete Partition

2. Replace Partition

3. Add Partition

select: 2

Please Choose:
[General Topics] ChromiumOS-Guy:
very simple problem lpunpack.py crashes (you still have the same problem) so you don't get you're super.img unpacked but my script just continues like nothing happened (bug on my side that i can't do anything about) so it doesn't show any images (i also make .temp through lpunpack so it dose not let you make or see any images even if created (if you ask me you're python install is the problem try updating python3 to latest version if this still dose not work you can unpack manually and put unpacked contents in a .temp folder and run the appimages unpack will crash but you'll still get to next stages of script)
[General Topics] Noah Allen:
Thank you so much for your help. Now, I could repack super.img with my modified parts without any issues. I will try to flash it today. I hope it boots. Smile :)
[General Topics] Noah Allen:
OOPS: those system_a_ext.ext,system_ext_a.ext should be.img

What was wrong? I modified the product, but it's fine here.

And it's weird that when I unpacked the same super.img, all the parts were described as.img.

And when I repacked it, I had the same issue as I described in my screenshot.
[General Topics] ChromiumOS-Guy:
I actually have no idea but system_slot_ext is useless if you have anything which isn't Stock ROM so you can just ignore it and it will work the minimum .img that you need are vendor_a.img system_a.img product_a.img (system_a being you're chosen ROM)
[General Topics] Noah Allen:
ye

Yeah, system_a is also system_a.ext.

It should be system_a.img.

Do you have any ideas? I tried to flash it, but it wouldn't let me.

As you can see here.
[General Topics] ChromiumOS-Guy:
system_a.img is what you should rename you're ROM to as long as that ROM is a GSI and not a phone specific ROM than just delete system_a_ext and rename you're ROM to system_a.img, again the only things you need vendor product and system if you have a system_a_ext that stands for system_a_extension which you can disregard because you're GSI doesn't use it.

edit (clarification):

again you need to unpack with lpunpack then you need to repack with lpmake you can't treat it the same as normal raw disk files because its not raw its dynamic you need lpunpack and you need lpmake or some other program you are showing me phone screenshots so i assume you don't use lpunpack you need to use you can just download the cvd_host_package from ci.android.com asop-master branch there is lpunpack and lpmake inside just use lpunpack to unpack you're super.img after that take the insides and repack with lpmake after changing system_a.img (i recommend also deleting anything which isn't vendor_a/b.img product_a/b.img or system_a/b.img) to whatever rom you downloaded I included below where to download the lpmake / lpunpack binaries and also github repo that points to all sources needed to get started with doing super.img shenanigans

link to info page:

(https://github.com/ChromiumOS-Guy/Tools-And-Roms-For-Android)

link to binraies (don't forget to download latest aosp_cf_x86_64_phone userdebug cvd_host_package.zip:

(https://ci.android.com/builds/branches/aosp-master/grid)
[General Topics] ChromiumOS-Guy:
as of v1.6.4 of my script you can specify a folder with unpacked contents to be used instead of a super.img so that can ease you're process a bit hopefully :)

edit (forgot to link):

(https://github.com/ChromiumOS-Guy/SuperPatcherGSI/releases/tag/v1.6.4)
[General Topics] Noah Allen:
Alright, my head is turning now. It's so hard to have a conversation with you at the same time. Can I know your Telegram account, or would you mind if I asked you to PM me in Telegram? I really need your help. I hope you can help me, bro.

@noah_allen is my TG ACC Could you please help me?

{Mod edit: Link removed! Oswald Boelcke, Senior Moderator}
[General Topics] Oswald Boelcke:
@Noah Allen I've removed the link to Telegram from your post! Regarding social media links please observe that as an exemption from the last bullet of rule no. 5 of the XDA Forum Rules, we grant only developers the privilege to share references to their social media in their own development threads and if thorough support is provided in the thread. These conditions obviously don't apply to this post or the thread in general. Additional information is also available here:

Telegram Chat Channels - Way Forward

WhatsApp/Telegram Groups and Channels - Going Forward Hello XDA family! Just notifying all members that posting certain links to Telegram and other sites like WhatsApp is now allowed on XDA. What does that mean? We will allow links to messages...

xdaforums.com

Please refrain from attempts to push our members to social media or sharing any references or links to social media unless done in your own development threads!

Thanks for your cooperation.

Regards

Oswald Boelcke

Senior Moderator
[General Topics] Noah Allen:
Umm Sorry for my stupidity.
[General Topics] Oswald Boelcke:
No "stupidity"... No problem at all. We all occasionally forget something. With my 67 years of a young, great and interesting life I could prove with lots of examples...:D

Regards

Oswald Boelcke

Senior Moderator
[General Topics] ChromiumOS-Guy:
sorry but I don't have an official telegram account only my private and I would like it to stay private you can and should start a private conversation with me here in xda-developers.
[General Topics] Noah Allen:
Alrighty. Thanks

I just created a private conversation with you. I will always be thankful for this.
[General Topics] warfront1:
I'm having the same problems that sbanskot was having.

I'm working with a SAMSUNG Galaxy Tab S6 Lite.

I am adding essentially a hello world text file to /system/bin, and it won't persist.

The lpmake command runs fine and flashes successfully via Odin3.

However, my changes aren't there when I search for them in Termux or any root file explorer.

One thing that was never answered clearly in this guide is what to set your --device super flag to.

I just assumed it was the size of the raw super, "super.ext4.img".

My lpmake command is as follows:

lpmake --metadata-size 65536 --super-name super --metadata-slots 1 --device super:8891924480 --group main:7626584064 --partition system:readonly:5250441216:main --image system=./system.img --partition vendor:readonly:976347136:main --image vendor=./vendor.img --partition product:readonly:1395445760:main --image product=./product.img --partition odm:readonly:4349952:main --image odm=./odm.img --sparse --output ./super.new.img
[General Topics] ChromiumOS-Guy:
super flag is the size of the super partition yes (it has to be dividable by 512)

you're changes do not persist because of problems you had with adding them this tool does not patch you're system partition (aka you're android) it patches you're super to remove add or replace existing partitions if you add a .txt file my script does not care it won't be used what you want to do is patch you're system or system_a (on A/B) to have you're hello_world.txt then rebuild it and then patch it into the super
[General Topics] tham.400:
lpunpack E 12-16 23:12:12 13696 13696 reader.cpp:171] [liblp]Logical partition metadata has invalid checksum.

lpunpack E 12-16 23:12:12 13696 13696 reader.cpp:171] [liblp]Logical partition metadata has invalid checksum.

Image does not appear to be in super-partition format.

Is there any way to fix this happening? it keeps happening when i unpack the super ext4 image.
[General Topics] ChromiumOS-Guy:
I don't really know maybe it was an error on you're part you could try my script I just ported it over for windows in v1.6.6 but I doubt it will help

here's the link though :)
[General Topics] wooli:
I have followed all the instructions, but the final super.img generated by lpmake, shows this when viewed in 7zip and the size is way lower than what it should be.

I have noticed this only after resizing the image. if i simply unpack and repack, then it does not happen. If I unpack, just remove stuff from the mounted drive, repack, it also does not happen.

I noticed some replies with similar issues that over the years never got an answer on this forum and others.

I have also used some kitchen tools and all have the same problem.

I tried on ubuntu vm, WSL, and with windows binaries and tools.

what.am.i.doing.wrong.

Any help or direction is appericiated.
[General Topics] ChromiumOS-Guy:
I think , that if the size is fine if you unpack the patched super.img again then its fine the super.img containes android's dynamic partitions so its not exactly something that 7z can view as far as I'm aware so its probably not seeing all of it just part of it, you probably did it right and its 7z that's the problem you could try it and see if it works if it doesn't than you should start debugging your lpmake flags
[General Topics] wooli:
First, thank you for your time and reply. I really appericiate it.

I think you were correct. After retrying again and flashing with a super.img that showed system.ext it worked and the device booted up.

BUT, i replaced the bootanimation in /system/media and reflashed with fastboot, however, the old bootanimation was displayed. I also see a lot of similar comments here. And I know its not specific to bootanimation because even adding a test file does not seem to make a change. Is this specific to devices?

I am very confused, it seems my eyes are lying to me.

I have super.img, which I can see in system.img, it has a bootanimation with only 800kb in system/media.

I flash this with fastboot, device loads, but shows old animation.

I enable debug and pull the file with adb and its the old animation file with 12mb.

I searched the unpacked super.img and there is only a single bootanimation.zip which is in system/media...

EDIT:

Wow, it seems like I have figured it out. I needed to flash super and vbmeta and vbmeta_system ... with disable_verity flag and all is working well.

I hope this helps someone.
[General Topics] ChromiumOS-Guy:
thanks I was wondering what it was I'll be sure to answer with a quote to you're comment , also glad to help
[OnePlus 7T Questions & Answers] Kirahvi:
After the update to 10.0.15 EU I can't use long press on space bar to switch languages in GBoard. The selection page pops up for a second and then force closes the keyboard app.

Just a heads up for the peeps that use multiple languages witch different keyboard layouts. Let us know if you have the same problem if you already installed the update!

And as per usual I have tried clearing caches and installing and uninstalling the app and so on. Using swiftkey for now.
[Honor 6, 6 Plus Q&A, Help & Troubleshooting] dblokillo:
Hello!

I am following the 'How to root DIG-L21HN' phone thread, and after downloading the images they provided (they are supposed to be modified TWRP for this specific model, or so I understood) and flashing them using the 'fastboot flash recovery 1streco.img' command my computer shows the following:

However, when I try to get into recovery mode on the phone itself, I am greeted with the default Huawei recovery, and not TWRP. I tried downloading another TWRP file from another site, supposedly for the same model, but got the same results...

One other interesting thing I noticed is that the phone does not boot into fastboot mode if I use the command on the PC, but it does if I manually do it (vol down + power).

OEM is unlocked, USB debugging in on, fastboot is enabled and I can see the device using the 'fastboot devices' command... It's like if there was another layer of security that I don't know.

What can this be? Any ideas?
[Honor 6, 6 Plus Q&A, Help & Troubleshooting] sappi13:
Hello Dear

How you able to unlock bootloader?

View attachment 5340129

View attachment 5340131