yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] ronlkh1965:
┌────────────────────────────────────────────────────────────────────────┐

│ makeSystemRW v1.04 automated script (by amateur:) lebigmac @xda ©2021) │

│ Thanks @munjeni without your help this script would not be possible │

│ Also thanks @Brepro1, @AndyYan, @gabrielfrias, @YOisuPU, @topjohnwu │

└────────────────────────────────────────────────────────────────────────┘

makesysrw: Phone is in Android OS. Checking root...

makesysrw: Root detected. Initiating procedure...

makesysrw: Your super.img is located at: /dev/block/sda32

makesysrw: Dumping super partition to: /data/local/tmp/makesysrw/super_original.img

makesysrw: Please wait patiently...

17825792+0 records in

17825792+0 records out

9126805504 bytes (8.5 G) copied, 26.059970 s, 334 M/s

makesysrw: Successfully dumped super partition to: /data/local/tmp/makesysrw/super_original.img

makesysrw: Pulling super partition to: /home/ronlkh/super_original.img

[ 52%] /data/local/tmp/makesysrw/super_original.img

makesysrw: There was a problem pulling the partition to your computer

makesysrw: Please try again.

root@ubuntu:/home/ronlkh#

any idea what is my problem?
[Android Software/Hacking General [Developers Only]] lebigmac:
Probably the virtual machine settings... Are you windows user?

Please keep in mind this version was developed for a real Linux machine, not a virtual one.

@ronlkh1965 I suggest you wait for the universal version which will be released this week. That should fix your problem.
[Android Software/Hacking General [Developers Only]] Bob_Howard:
Yes and yes :)
[Android Software/Hacking General [Developers Only]] ronlkh1965:
Yes I am a windows user. I am using VMWare on Ubuntu. I think it is the instatlltion of Ubuntu into VMware. I manage to get it working after few Ubuntu installation. I can extra super image from my poco f2 pro and redo a new fixed super image, but i did not flash it yet. I dont know what would be the result. I am worried that it may brick my phone
[Android Software/Hacking General [Developers Only]] Frxhb:
I am waiting for the windows Version. thank you
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @Francescohub thanks for your interest in this project. I could release the universal version right now but I'm still trying to improve the Linux version a little bit before I port it over to the other platform(s). So please give me a couple more days ;)

Development goes much easier and faster on the physical Linux machine ;)

The new version 1.04 works perfectly on my device but there is always room for improvement. And I want it to work as smoothly as can be on as many devices as possible.
[Android Software/Hacking General [Developers Only]] Frxhb:
sure.. dont get stressed :D
[Android Software/Hacking General [Developers Only]] lebigmac:
Great news! New update is on the horizon :)

Just had another major scientific breakthrough
[Android Software/Hacking General [Developers Only]] lebigmac:
Wait a second you want me to troubleshoot two different phones at the same time? lol. I'm not superman.

So on one phone the super is located at /dev/block/sda32 and on your other phone it's the vendor that is at /dev/block/sda32? Is this correct? Please double check it like this:

adb shell
ls -al `toybox find /dev/block/platform -type d -name by-name` | grep 'super'
[Android Software/Hacking General [Developers Only]] ronlkh1965:
Yes, Poco F2 Pro has super.img and Mi9Pro5G has no super
[Android Software/Hacking General [Developers Only]] lebigmac:
That's interesting. And both are locked to read-only?

Does version 1.04 work with your Poco F2 Pro that has super partition?

I will have to adjust my script accordingly to work properly with both of your devices.

Keep in mind my script was never designed for phones that have no super. I was so focused on this super that I didn't realize that some Android 10 devices have no super and still suffer from the notorious 'shared_blocks feature' ...

Thanks for your feedback! Back to work...
[Android Software/Hacking General [Developers Only]] ronlkh1965:
Yes it works, but I have not flash my poco f2 pro yet. What i want to try is my Mi9Pro5G but i has no super.img My Mi9pro5G has problem, it cannot recgonise the baseband, it has no signal and cant read SIM card.

View attachment 5245213
[Android Software/Hacking General [Developers Only]] lebigmac:
It's better to keep this version of the script in its own makesysrw folder. At the end of the script all .ext4 files in current directory are deleted :D

Just sayin'
[Android Software/Hacking General [Developers Only]] ronlkh1965:
I was testing your script with no intention to flash it on my Poco f2 pro. Actually I am more keen to fix the Mi9Pro5g thathas no signal. Thats why after extraction and repacking, i took out the poco f2 pro out of my PC. ;)

PS: I am happy that your script works :)
[Android Software/Hacking General [Developers Only]] munjeni:
@lebigmac does all this conversions necesary? Did you hex compared partitions with RO flag and after you convert it to RW flag? I'm believing all this can be done in 1 miliseccond by directly changing RO flag to RW on the fly & directly on phone partitions. I don't have time to mess with it but if you give me original system_b.ext4 and RW

system_b.ext4 I can compare it and try to extend my tool!

Nevermind, I will download xperia 5II image and will try to implement all the things in superimage dumper to omit all conversions, no need system_b!
[Android Software/Hacking General [Developers Only]] lebigmac:
lol @munjeni I'm sure you're right and it can be easily done by hex editing only a few bytes directly on the phone itself without all this unnecessary conversion stuff but I am not genius I am only amateur so I can only use my limited knowledge and resources to solve this read-only problem ;)

My script is not as fast as simply hex editing a few bytes but it works fine on my device. I achieved my goal which was to make my partitions read-write-able so I can make some deeper customizations to my device. Some users without super image however are reporting some issues so I will try to adjust my script accordingly to be compatible with more devices.
[Android Software/Hacking General [Developers Only]] munjeni:
Ok. I will try something. Curently I'm analysing this https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout , and I'm believing this need to be changed s_feature_ro_compat , RO images seems have set 0x1000 (RO only) and it I'm believing need to be modified. I will compare RO and RW image and try to implement into superdumper with an prompt for setting rw or ro
[Android Software/Hacking General [Developers Only]] lebigmac:
@munjeni

That would be great if you could modify superunpack to dump the read-only images from the super directly as read-write images. Then we can plug them into lpmake directly without all the unshare_blocks hassle and then flash.

Also please keep in mind some users have empty unused partitions inside their super and these should also be dumped for lpmake to work properly later on when putting everything back together (or else they could get bootloop).

It's not that urgent. Take your time. I know you are very busy man. Always working hard.
[Android Software/Hacking General [Developers Only]] Lossyx:
I'm pretty sure that won't work, these are not normal partitions, and I think unshared block command proves just that.

And I'm not sure exactly how you're going to hex edit the partition if it's read only?

With that said, a super partition doesn't necessarily mean the partition are R/O (samsung for example if i recall correctly), so that method might work, or just mounting R/W might work as well.
[Android Software/Hacking General [Developers Only]] munjeni:
I'm talking about extracted ext4 images since all have ro flag and can be mount in linux only in read only mode! What I want to do is to on the fly make it rw (so to be able to mount them rw). Later I will try something. What I have facing now is our OP tool is not working for me since I'm using Ubuntu but script reguire android device and my android device do not have superimage.

lebigmac does your script convert all ext4 images to sparse format?
[Android Software/Hacking General [Developers Only]] lebigmac:
Next version will have support for android 10+ users that have no super image. I might release it later today. It's almost ready. Just doing some final tweaks and little bit of polishing.

I think it does yes. This is not really necessary because lpmake also accept raw files but then it gives annoying warning that I'd like to avoid.

It also helps make the final size of super_fixed.img smaller
[Android Software/Hacking General [Developers Only]] munjeni:
Can you share here an smallest ext4 partition, booth with ro and rw flag? I need to compare

If I understand correctly this command make system rw?

e2fsck -y -E unshare_blocks vendor_b.ext4
[Android Software/Hacking General [Developers Only]] lebigmac:
yes that's the command but first you must resize it with resize2fs and increase its size or else unshare_blocks will fail.

I just checked my vendor_ro.ext4 and compare it to vendor_rw.ext4 and it's over 200 MB of size difference?! I thought it would be much less than that!

I can upload it but are you sure you want to compare over 200 megabytes of file difference?

View attachment 5245747
[Android Software/Hacking General [Developers Only]] munjeni:
No need, it can't be compared.
[Android Software/Hacking General [Developers Only]] munjeni:
My linux resize2fs and e2fsck doesn't work with all this. Where you found working tools? Thats a reson why you using it directly on android because of working e2fsck and resize2fs?
[Android Software/Hacking General [Developers Only]] lebigmac:
I use ubuntu and here resize2fs and e2fsck work for me. What errors do you get?
[Android Software/Hacking General [Developers Only]] munjeni:
resize2fs 1.42.13 (17-May-2015)

resize2fs: Filesystem has unsupported read-only feature(s) while trying to open vendor_b.ext4

Couldn't find valid filesystem superblock.
[Android Software/Hacking General [Developers Only]] lebigmac:
my resize2fs version is:

resize2fs 1.44.6 (5-Mar-2019)

maybe that's why mine works on ubuntu and yours doesn't ?
[Android Software/Hacking General [Developers Only]] munjeni:
Probably true. When I get som free time for research I will do it my way, its hard for my head right now. :)
[Android Software/Hacking General [Developers Only]] lebigmac:
I will bundle my resize2fs version with the next version of the script, maybe that helps eliminate this issue for some folks. Thanks for the feedback!
[Android Software/Hacking General [Developers Only]] alecxs:
Android version is unrelated to dynamic partitions / deduplication, you can find lot Android 10 devices without super partition. AFAIK only Virtual A/B Seamless Update is enforced on Android 11
[Android Software/Hacking General [Developers Only]] Lossyx:
Dynamic partitions are mandatory for devices launched with A10. The should have a super partition, however this doesn't necessarily mean they are deduplicated(R/O). If i recall correctly, this is the case with samsung devices launched with A10.

And Virtual A/B is different from Dynamic partitions, but not enforced (from what I read) on A11.
[Android Software/Hacking General [Developers Only]] alecxs:
Only devices launched with A10
[Android Software/Hacking General [Developers Only]] lebigmac:
Guys I'm afraid I'll have to postpone the release until tomorrow. Still lots of work to do on this but I'm heading in the right direction for sure! Lots of major breakthroughs in development here :D

And the source code is much cleaner now.

Next version should work on all Android 10+ devices both with and without super image.
[Android Software/Hacking General [Developers Only]] lebigmac:
Anyone know what this error means?

resize2fs ./super.img

resize2fs 1.44.4 (18-Aug-2018)
resize2fs: Bad magic number in super-block while trying to open ./super.img
Couldn't find valid filesystem superblock.

I used this command to dump it:

dd if=/dev/block/sda15 of=./super.img bs=4096

What's even more interesting is I get the same error when running:

tune2fs -l /dev/block/sda15

I could've sworn that tune2fs command worked earlier -.-

I guess I've hit another roadblock...

Back to square 1
[Android Software/Hacking General [Developers Only]] jhill110:
A shot of my firmware package files.

Will this work for me?
[Android Software/Hacking General [Developers Only]] kory-vadim:
You most likely need to check which file system is used in the phone, because on many Huawei phones fs = "erofs", and naturally resize2fs cannot be applied to an image with such fs.
[Android Software/Hacking General [Developers Only]] jhill110:
If by file system you mean Android version...

Moto g power android 10
[Android Software/Hacking General [Developers Only]] kory-vadim:
On your screenshot, the files of the super.img split into parts from the stock firmware archive, and since the image is merged from the phone's memory, the script will work.
[Android Software/Hacking General [Developers Only]] BlazingKahn35:
View attachment 5246579

I get this error anyone who can help?
[Android Software/Hacking General [Developers Only]] jhill110:
Will restoring a TWRP back up undo what the script has done.
[Android Software/Hacking General [Developers Only]] d4ylight:
If you refer to the opening post, the super partition is what is flashed at the end. Following that logic, a backup of your super partition will undo what the script has done. The short answer is yes from what I understand.
[Android Software/Hacking General [Developers Only]] lebigmac:
To all those people trying to run this version of the script on virtual machines without success, have you tried to run it in a Linux live USB setup disk environment? Maybe that works a little bit better than virtual machines. Just sayin'

I have not tested it on virtual machine at all.
[Android Software/Hacking General [Developers Only]] alecxs:
looks like damaged partition. file size is 4 GB i guess? use /data/local/tmp for dumping, sdcard file system type does not allow large files
[Android Software/Hacking General [Developers Only]] ronlkh1965:
I am using Ubuntu in VMware environment and it took me quite few times to install my Ubuntu to get it working. I setup the environment to have 16gb memory and 64Gb HDD was my final working setting. Hope these info will be helpful for those not able to get the script running properly on VMWare.

VMware® Workstation 16 Pro

16.1.0 build-17198959

Ubuntu 20.04.2.0 LTS Desktop Verison​

View attachment 5247101
[Android Software/Hacking General [Developers Only]] kory-vadim:
This command will not work. You cannot apply resize2fs to super.img because it has its own supeblock.
[Android Software/Hacking General [Developers Only]] lebigmac:
status update about next version:

making some slow progress over here and debugging if anyone was wondering ;)

How you guys like version 1.04 so far? It's not as smart and efficient as the upcoming version but hey it's still better than doing the whole process manually right?
[Android Software/Hacking General [Developers Only]] lebigmac:
resize2fs ./system.img
resize2fs 1.44.6 (5-Mar-2019)
resize2fs: Bad magic number in super-block while trying to open ./system.img
Couldn't find valid filesystem superblock.

Not sure how I'm supposed to include support for people that have no super if I'm stuck at this problem for days...

How can I check the file system? I get same error when I run tune2fs -l on the file...
[Android Software/Hacking General [Developers Only]] lebigmac:
LOL I fixed it. I must run simg2img on the file first.

Now it all makes sense!

Kory aren't you the guy that said unsparsing the file is waste of time? Well guess what. It's a very important step for the proper functioning of the script.

Maybe I shouldn't listen to random strangers on the internet :D
[Android Software/Hacking General [Developers Only]] alecxs:
do a simple check if file is sparsed. if you extract system.img from OTA it is always compressed in some way, could be brotli, sdat, simg or payload. But if extracted from super.img (or pulled from device) it is different, these are plain (mountable) partition images

Nevertheless always take care of fat32 file size limitation 4 GiB (applies even for sdcardfs fuse/vold mounted emulated internal storage)
[Android Software/Hacking General [Developers Only]] lebigmac:
Sparse check done.
[Android Software/Hacking General [Developers Only]] lebigmac:
Should I convert back from raw to sparse at the end?

Can fastboot flash raw images or only sparse?
[Android Software/Hacking General [Developers Only]] lebigmac:
Alright folks. I think it's ready for release :D

Looking for some beta testers both with and without super image

PM me with some details about your phone such as model, android version , do you have super or not...

The only thing that's missing is the script automatically flashing the partitions to the phone... Do you want this functionality to be automated or do you prefer flashing manually?
[Android Software/Hacking General [Developers Only]] jhill110:
both...:geek:
[Android Software/Hacking General [Developers Only]] jhill110:
OH, BTW, I'd be glad to test.
[Android Software/Hacking General [Developers Only]] lebigmac:
Here is screenshot of me flashing system from recovery using dd command.

Funny thing is it actually worked LOL!

Took almost 8 minutes though as you must use raw file. Doesn't work with sparse file! I know because I've tried it lol

I was thinking of adding a prompt at the end of the script asking whether or not the user is brave enough to flash the new file to the phone using dd command ;)

Flashing with dd is a bit slow. I can flash a sparse super on my Xiaomi with fastboot in just 2 minutes.

Anyone know how to port fastboot to Android and use fastboot flash from recovery?
[Android Software/Hacking General [Developers Only]] CuongNC.Dev:
@lebigmac I'm waiting your script for macOS :P
[Android Software/Hacking General [Developers Only]] lebigmac:
Universal version coming very very soon. Get ready.

It will work directly on the phone so no need for computer :)
[Android Software/Hacking General [Developers Only]] alecxs:
do you mean `fastbootd` this is only available from stock recovery. in custom recovery you can flash from PC

adb push super.img /dev/block/bootdevice/by-name/super

or flash from MicroSD Card (if file is smaller than 4 GiB)

adb shell
cat /external_sd/super.img > /dev/block/bootdevice/by-name/super
[Android Software/Hacking General [Developers Only]] kory-vadim:
tune2fs and resize2fs do not work with sparse images.

I didn't tell you anything about converting from sparse.

I talked about not having to convert from raw to sparse before building super.img.
[Android Software/Hacking General [Developers Only]] lebigmac:
oh yeah right. You said resparsing the file is waste of time. My bad ;)

Well guess what. In next version there is no more resparsing at the end. And lots of invalid header magic warnings ;)
[Android Software/Hacking General [Developers Only]] lebigmac:
Last steps to do:

Make flashable zip.

If the script is executed in flashable zip, will it automatically switch to the TWRP terminal? If not, how can I achieve this?
[Android Software/Hacking General [Developers Only]] lebigmac:
New error just when I was about to release new version!

How the hell am I supposed to fix this error? Lpmake give pretty much zero text output. I've got absolutely no clue what's going on inside lpmake...

@kory-vadim you think it's failing because of invalid sparse file format at header magic?

View attachment 5248661
[Android Software/Hacking General [Developers Only]] lebigmac:
Ok I run it again this time with custom extra size and now it's actually giving an error

Debugging this is a nightmare but somebody have to do it :)
[Android Software/Hacking General [Developers Only]] ronlkh1965:
I am ready to test.

Mi9Pro5G CRUX Android 10 Miui12

No super.img
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @ronlkh1965

Thank you for your interest in the new upcoming version.

I was just about to release it today but when I did my final testing I noticed an error. I don't know how to fix it?!

It was working so well yesterday and now this.

Here is my full log. I cannot really see an error. Only invalid sparse file format at header magic.

The problem is at the very end when doing the lpmake command to merge all extracted images into new super_fixed image.

I don' t know what is lpmake doing under the hood. Maybe I have to modify lpmake source code and recompile it to know exactly what's causing the error.

I will try it on an external sdcard. Maybe this issue has to do with not enough space on read only system...
[Android Software/Hacking General [Developers Only]] lebigmac:
After trying it on external sdcard that is formatted to ext4 same error. I guess it wasn't a space issue after all.

It looks like this new universal version needs further testing :D

Back to the drawing board...
[Android Software/Hacking General [Developers Only]] alecxs:
is this the missing space maybe?

$ echo 319352 256 / p | dc
1247
[Android Software/Hacking General [Developers Only]] walid77dz:
hi,

what means :"

adb and fastboot commands should be in your $PATH environment variable

thank you for this great work
[Nubia Red Magic 5G / 5S  Questions & Answers] Galathil:
Hello,

I purchased a pair of Nubia Cyberpods not so long ago. Since I'm from a country in Asia where Nubia Global isn't available, I bought my Cyberpods from a third party store. Sadly, the accessories are in Chinese language.

Is there a way that I can change/flash it to the English language?

Addendum: I also bought the Nubia War Drum and yes, you guessed it right. It's in Chinese language.

I hope that someone can shed light to this.
[Nubia Red Magic 5G / 5S  Questions & Answers] justin1121:
Jj
[Samsung Galaxy S21 Ultra] ventolino:
Hi.

sometimes (at least once a day) it happens to find the volume of notifications at 0. The volume of calls, system and multimedia are ok, that of notifications is set by itself to zero.

do you have any suggestions on what it might be?
[Samsung Galaxy S21 Ultra] SiNJiN76:
Do you have any automation turned on? (Bixby Routines) 🤷‍♂️
[Samsung Galaxy S21 Ultra] ventolino:
I use DnD during the night, but it is set like the other phone
[General Questions and Answers] meinadigitalworld:
Hi,

We have an industrial equipment that is running a VNC Server. I have bought an Android TV box to connect to the equipment with a VNC Client. The Android TV Box is connected to a 65 inches television. I'm able to connect to the equipment's VNC server and it is rendered on the big screen TV. The VNC Client is "bVNC free", an open source VNC client. The Android TV Bos is running Android 10.

What I would like to achieve, is on bootup of the Android TV Box, have the VNC Client automatically connect to the VNC Server, unattended to a specific IP address.

Is there anyone that has a solution on how to achieve that?

Thanks!
[Tilt, TyTN II, MDA Vario III General] naheelja:
From yesterday onwards i am getting this problem.power button is nt workn as previous.Phone automatically get the signal of long press power button.it means automatically it asks "power will be turned off,and you may lose data if...".and also when i press power button it doesnt goes to standby mode.when i long press the power button sometimes it doesnt switch off..As i think the power button dnt work as normal or may it seems that power button keep pressed internally..pls help me to solve this problem.thnx in advance
[Tilt, TyTN II, MDA Vario III General] naheelja:
some1 pls help me
[Tilt, TyTN II, MDA Vario III General] alt236:
I'd suggest you make a full backup and hard reset the device in order to make sure its not a hardware problem. If it works fine after a hard reset, you'll know its something you installed relatively recently.
[Tilt, TyTN II, MDA Vario III General] naheelja:
I did a hard reset.nothing changed.then i flashed a different ROM.But still i am facing the problem.