yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] 012345678:
can confirm it works on Mi11 Ultra

with that lines in adb shell over pc:

C:\Program Files (x86)\Minimal ADB and Fastboot>adb shell

su

cd /data/local/tmp/systemrw_1.31d

./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=15

systemrw: Custom input detected: /dev/block/sda29

systemrw: Custom size detected: 15 MB

systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring

systemrw: Current device: Xiaomi Mi 11 Ultra

systemrw: Current Android version: 11

systemrw: Current SELinux status: Permissive

systemrw: Current slot is: 0

systemrw: Your super partition is located at: /dev/block/sda29

ect.....

thanks
[Android Software/Hacking General [Developers Only]] joetbd:
I got error 73 on a rooted/twrp Moto Stylus (2020 version) running Android 10. So now I need to use Linux to patch. But I am poor at using linux (I am running ubuntu on a thumb drive).

I installed ADB by simply dropping the Platform-Tools folder onto my computer, and launching a terminal window. i do not know what I am doing

I tried launching sysrw_repair, but it gives me adb and fastboot errors.
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @Greenspoof why you not run possible cow solution that I gave you earlier (option A) while phone is booted into Android just like you did when you ran script for the first time? You were on the right track!

Hi @joetbd just download the official platform-tools for linux and drop the adb and fastboot binaries into the sysrw_repair/tools/bin subfolder

Now open sysrw_repair.sh with notepad and replace all occurences of adb with this:

./tools/bin/adb

same thing for fastboot. Save file and try again. Good luck!

Hi @012345678 I'm happy it works for you. Does your device have cow files? Could you please send me your log files? Thank you. It helps with further development!
[Android Software/Hacking General [Developers Only]] Greenspoof:
That's what I did ?

That's what I did ? I wrote the result on my previous comment, it was made manually. After running 1.31d then your solution, I got as result : : Invalid sparse file format at header magic and no super_fixed.img in IMG folder.

If I run your solution only, without running 1.31d before, I have as result: first solution : can't create ./IMG/system_a-cow.img : No such file or directory

On second solution : ./tools/lpmake : can't execute : permission denied.
[Android Software/Hacking General [Developers Only]] joetbd:
i did a find/replace all for "adb" and "fastboot"

i ran sysrw_repair and it seemed to successfully create a super_fixed.bin file in the img folder

but when the repair script rebooted the phone to flash the image, it stopped at <waiting for any device>

after waiting (and nothing happened) I advanced the phone passed the bootloader screen, to the recovery screen. it was still waiting for any device

I dont know what to do with my newly created super_fixed.bin file
[Android Software/Hacking General [Developers Only]] lebigmac:
Just flash it with fastboot to the super partition ;) Good luck!
[Android Software/Hacking General [Developers Only]] joetbd:
I flashed the fixed super file using windows/adb command prompt. Im not sure it it worked. i can not write to the system partition yet (but that might be a limitation of my file manager. i will need to test more

I am getting mixed results. I can rename existing files on the system partition. But I can not write new files to it
[Android Software/Hacking General [Developers Only]] Greenspoof:
Add more size on the script command. Your current size is probably 0, so you can't add anything new, only modify
[Android Software/Hacking General [Developers Only]] joetbd:
That seems sound. Because I can delete, rename, and create new zero sized files.

But I dont know anything about scripts or coding. Do I need to start over, Or can I modify the partitions as they are now?

*also, if I delete existing system files, will that create free space?
[Android Software/Hacking General [Developers Only]] Greenspoof:
Did you run the script manually or via twrp?

I think you have to run again but I'm not sure so maybe wait for people more experienced. To add size, it's not totally the same way between script run manually and twrp.

Also for your question about deleting system file, I think it would be wiser to change the size via the script
[Android Software/Hacking General [Developers Only]] joetbd:
I ran the script in twrp

but I got the error code 73 (like so many other people)

at that point the script had extracted the individual partitions but not rejoined them

so I ran linux on a thumb drive, and used lebigmac's repair file

that created the "fixed" super .bin file

I then flashed the fixed bin back to the phone with a windows PC running ADB fastboot (because fastboot was not recognizing my device in linux, after the phone rebooted)

I only have a loose idea how any of this works, and I can not do anything without concrete examples.

I should have resized my partitions, but do not know how.

*FYI - it does seem like deleting files does free up room. After deleting a system wallpaper file, I was able to copy a file to the system partition
[Android Software/Hacking General [Developers Only]] LORENZ123456:
I managed to make system rw, i have super partition , and i have a Xiaomi mi 11 lite 4g with android 11. I added 500 MB free space to add a new boot Image and other. Great job!

P.S. I have run the script manually via adb because on twrp It gave me error 6. But maybe Is because i have an unofficial xda's twrp in alpha version.
[Android Software/Hacking General [Developers Only]] version-x:
@lebigmac, im testing this for mi 11 lite 5g, the super_fixed.bin file is generated, but after flashing the file i can not boot into the system, it boots back into fastboot. I have tested both shrinked to minimum (0) and with an extra memory free (15).

any tips for this issue?
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @version-x please send me your log files. Thank you.

Does your super partition have cow files inside?

I'm starting to think that device manufacturers noticed this workaround and made it impossible on newer devices? I could be totally wrong and it's still possible to do it on newer devices. More research is required.
[Android Software/Hacking General [Developers Only]] veerjalil:
Note working for Redmi note 10 pro
[Android Software/Hacking General [Developers Only]] version-x:
I also tried to check if there is something wrong with the generated super_fixed.bin by using munjeni's superunpacktool. It gives an error saying that "This is not a super image!". I then tried to use the same tool for the generated super_original.bin and it worked. Therefore it makes sense that it doesn't boot, the device doesn't seem to recognise it as a valid super img, perhaps a compatibility error.
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi. I checked your log and it looks good. I don't see why it shouldn't work? According to the log dm-verity and verification were successfully disabled. And selinux was successfully changed to permissive.

Please keep in mind munjeni's superrepack tool only accepts raw files and the lpmake command at the end of my script generates a sparse file. You can unsparse it with the included simg2img tool. Then you can unpack it with the included lpunpack and then you can try mounting the extracted system.img or product.img on a Linux computer as R/W and it should work ;) That would mean that something else is stopping your phone from booting this patched super image. Some kind of additional security feature in your bootloader perhaps?

What results do you get if you pipe your unmodified read-only super block device (/dev/block/sda21) directly into munjeni's amazing superrepack tool?

Hi @veerjalil. Thanks for your screenshot. It looks good. Can you please send me your log files? Thanks.

What exactly do you mean by note working? Not working or Note 10 pro working? Please give more details. (y)
[Android Software/Hacking General [Developers Only]] tha_mechanic:
@lebigmac check this thread out. I was reading through this and this is familiar being that if I run your script it fails to make super_fixed. I have a edge plus with super and A/B. I noticed that the output has empty "b" images from the super. Here is a screenshot and link. I hope it helps! I desperately want this to work on my device but so far no luck. Thank you for your work.

Thread '[GUIDE] OTA Tools LPUnpack' https://xdaforums.com/t/guide-ota-tools-lpunpack.4041843/
[Android Software/Hacking General [Developers Only]] Dron74:
Redmi Note 10 Pro (Indonesian firmware 12.0.6.0)

It turned out to apply the script, when moving to the manual folder systemrw_1.31d (with a resolution of 777), to / data / local / tmp / and running systemrw.sh through the console.

PS. It seems that access to the super section has been obtained and it is even possible to delete files from the app and priv-app folders, but if you make changes in files like build.prop and sweet.xml, then after that the files are empty ... it is also not copied to the system / media folder (it is not possible to copy it) although it was monitored for recording ... (((
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @tha_mechanic thanks for bringing that to my attention. It's a very good thread by @bynarie and I keep coming back to it. Without the Otatools by bynarie this script would not be where it is today. It was a crucial part of some of the earlier linux only versions and it's still part of the troubleshooting repair script to fix error 73.

Please send me your log files so I can take a closer look at your issue.

@Dron74 thanks for the nice screenshots. It looks like script worked perfectly on your device. Try running script again with size=15 parameter. Play around with the size. size=50 could work too. Good luck!
[Android Software/Hacking General [Developers Only]] Dron74:
After a while, even if nothing has changed in the system, the phone goes to bootloop after rebooting. :(
[Android Software/Hacking General [Developers Only]] Greenspoof:
Answer from the dev in a previous comment to recover original super partition :

adb pull /data/local/tmp/makesysrw_1.29/files/super/super_original.bin

adb reboot bootloader

fastboot flash super super_original.bin

Just change makesysrw_1.29 to systemrw_1.31d (if you used the last version)
[Android Software/Hacking General [Developers Only]] munjeni:
Why just not implement auto sizing? E.g. use remaining available unused space of the partition?

partition_3_name = product_a
attributes = 0x1
first_extent_index = 0x2
num_extents = 0x1
group_index = 0x1
partition_group = somc_dynamic_partitions_a
extent num_sectors = 0x293448 (0x52689000 bytes total)
extent target_type = 0x0
extent target_data = 0x441000 (dumping offset = 0x88200000)
extent target_source = 0x0
Partition: product_a | EXT4 | 0x511a5000

in this example you should get max size from extent num_sectors which is 0x52689000 bytes, and current size of the product_a ext4 partition is 0x511a5000 bytes, so to calculate size for resize do it with 0x52689000 - 0x511a5000 = 0x14E4000 available free space for resize, in decimal its 21905408 bytes which is around 20,9 mb free space, in this example you should resize product_a with 20,8 mb more, just example!
[Android Software/Hacking General [Developers Only]] xiaomieu:
Doesn't work on Xiaomi mi10T lite. :(
[Android Software/Hacking General [Developers Only]] version-x:
munjeni's superrepack tool results in a boot-loop aswell, I searched thru his thread it seems that there are other devices that do not boot aswell even after the scripts/tools have been successful. I suspect its a security feature, perhaps kernel side. I guess in conclusion, your script and munjenis tool both work, whatever is causing the bootloop is something else. For now mark this device as unbootable as reference for others. Anyways, thank you.
[Android Software/Hacking General [Developers Only]] veerjalil:
Hello thank you i mean not working still have read only
[Android Software/Hacking General [Developers Only]] veerjalil:
I simply launched the script via root explorer
[Android Software/Hacking General [Developers Only]] NisseGurra:
Functional on Asus Zenfone 8, tested with omnirom only
[Android Software/Hacking General [Developers Only]] tha_mechanic:
@lebigmac here is my log. I can't get it to work. I have tried flashing the individual images but it bootloops. Can't get the super_fixed because of error. And I have absolutely no clue on using Linux lol. So I can't figure out how to use the fix Linux script. I've been ripping my hair out trying to get something to work but I'm at a loss
[Android Software/Hacking General [Developers Only]] Keven11:
I'm not alone! My apologies, but it's a relief. I'm stuck at the same spot.
[Android Software/Hacking General [Developers Only]] tha_mechanic:
No apology needed. I don't know if the dev community is falling out, being bought out? But it seems to me that devs are getting rare. I really appreciate guys like @lebigmac! I have recently started to try to learn Linux because it feels like android keeps getting more locked down, and dev community doesn't seem as active as it was back in the jellybean days.
[Android Software/Hacking General [Developers Only]] Keven11:
I agree 100%.... The dev community has become significantly smaller. Unfortunately, with that too many of the talented, knowledgeable, and active devs are now acting like the "elite" types they used to loathe. Irony at it's finest IMO. Thank Dog that there are still devs like LeBigMac on the scene keepin' it real... Putting their skills to work for the 'right reasons' while remaining grounded, and willing to help others out along the way.

If I'm not mistaken, you are working with a Motorola device.. Correct? I am as well... Mine's a Moto G9+. So if you happen to get this error 73 issue licked please let me know, and I will be sure to do the same.

Here's a link to a group of devs who are great people and willing to help people with most any issue. They are very knowledgeable, and ... Just good ppl. Hit em up next time you find yourself stuck with nowhere to turn.

Telegram: Contact @Android_General_Chat

t.me
[Android Software/Hacking General [Developers Only]] Namlunxanh:
Works on Redmi note 9s (curtana, miui 11.0.11, Android 10).
[Android Software/Hacking General [Developers Only]] a.dibacco:
I get this on Mi 10 T

apollo:/ # /data/local/tmp/systemrw.sh
--------------------------------------------------
| SystemRW v1.31d automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------

systemrw: Initiating procedure...

mkdir: './nosuper': Read-only file system
mkdir: './img': Read-only file system
systemrw: Device is in Android mode. Ignoring
systemrw: Current device: Xiaomi Mi 10T
systemrw: Current Android version: 11
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/sda32
systemrw: / is read-only
systemrw: /product is read-only
systemrw: /vendor is read-only
chmod: ./tools/*: No such file or directory
systemrw: Attempting to disable dm-verity and verification...
/data/local/tmp/systemrw.sh[448]: ./tools/avbctl: inaccessible or not found
/data/local/tmp/systemrw.sh[448]: ./tools/avbctl: inaccessible or not found
/data/local/tmp/systemrw.sh[448]: ./tools/lpdump: inaccessible or not found
systemrw: Dumping super partition to: ./img/super_original.bin
systemrw: Please wait patiently...

dd: ./img/super_original.bin: No such file or directory
systemrw: Error: Failed to dump file to: ./img/super_original.bin

apollo:/ #
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @a.dibacco thanks for your feedback. Please wait for next version. It will be released soon ;)

Are you trying to tell me that your /data partition is mounted as read-only while your phone is booted into Android 11?
[Android Software/Hacking General [Developers Only]] a.dibacco:
Launching the script in a different way I get this, then no problem writing into data partition but still some tools missing:

apollo:/data/local/tmp # ./systemrw.sh
--------------------------------------------------
| SystemRW v1.31d automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------

systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: Xiaomi Mi 10T
systemrw: Current Android version: 11
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/sda32
systemrw: / is read-only
systemrw: /product is read-only
systemrw: /vendor is read-only
chmod: ./tools/*: No such file or directory
systemrw: Attempting to disable dm-verity and verification...
./systemrw.sh[448]: ./tools/avbctl: inaccessible or not found
./systemrw.sh[448]: ./tools/avbctl: inaccessible or not found
./systemrw.sh[448]: ./tools/lpdump: inaccessible or not found
systemrw: Dumping super partition to: ./img/super_original.bin
systemrw: Please wait patiently...

dd: ./img/super_original.bin: No such file or directory
systemrw: Error: Failed to dump file to: ./img/super_original.bin

apollo:/data/local/tmp #
[Android Software/Hacking General [Developers Only]] khan00000:
Hi got this working perfectly in my Realme 7.... Great work bro

But there's an issue I'm facing is now my system has occupied dual space than before.

For ex. Like before it was using 12gb as system, so now it is using 24gb as system space.

So my question now is if I delete /data/local/temp/makesysrw_1.31/ will it give any issue? As the super files are stored in it
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @khan00000 I'm happy it works on your device. Please feel free to post a screenshot if you want.

To uninstall script just delete whole script folder

adb shell "rm -rf /data/local/tmp/systemrw_1.31d"

Your first line is wrong! It should be:

Did you install script folder properly?

Please send me your log files! Thanks!
[Android Software/Hacking General [Developers Only]] NisseGurra:
Getting an Error 70 when script add img to super:

systemrw: Joining all extracted images back into one single super image...

systemrw: Please wait and ignore the invalid sparse warnings...

Not enough space on device for partition system_b-cow with size 1219526656

systemrw: Error! failed to create super_fixed.img file. Error code: 70

Is it possible to only patch system and product img for flashing with fastboot?
[Android Software/Hacking General [Developers Only]] lebigmac:
@NisseGurra @BlazingKahn35

To all those with COW error did you try to run lpmake command manually yet according to the excellent BrePro1 tutorial as well as the great AndyYan tutorial? This script is based on those tutorials after all ;)

If you guys manage to do it manually then we can easily translate that into the script and have it be done automatically.

One option is to run script and then remove all cow related stuff from myargs.txt and then manually run lpmake with those arguments.

cd /data/local/tmp/systemrw_1.31d
./tools/lpmake `cat ./log/myargs.txt`

This will successfully create the super_fixed.bin on COW devices but I'm afraid you will end up in bootloop if you flash it. Maybe device is looking for cow files at boot time?

Another option is to keep all cow related arguments in myargs.txt and only adjust the sizes accordingly to make everything fit into the super image. How to fit 3 GB large cow files into empty COW group though?!

My device have no COW files so it's difficult for me to fix this crazy cow error.
[Android Software/Hacking General [Developers Only]] a.dibacco:
OK, now seems to work, previously I simply unzipped the systemrw_1.31d_flashable.zip and I transferred the resulting folder to /data/local/tmp but then I understood that I had to transfer only the systemrw_1.31d folder and run the script. It seems to work I see just a few dreadful messages saying that:

Invalid sparse file format at header magic

I hope this is not a big problem.

Anyway, trying automatic installation from TWRP I get some errors at the end (see screenshot) and /system remains RO.

Alternatively I can flash the images using fastboot?
[Android Software/Hacking General [Developers Only]] NisseGurra:
Yes, i did an manual run with lpmake, it bootloops, but the original bin also bootloops so not sure what's going on.
[Android Software/Hacking General [Developers Only]] a.dibacco:
Dear @lebigmac are these errors in TWRP expected ? Do you know how to get rid of those?
[Android Software/Hacking General [Developers Only]] a.dibacco:
Sorry, trying the automatic installation with TWRP I get errors regarding writing of the images, what could be the error (see screenshot)?
[Android Software/Hacking General [Developers Only]] lebigmac:
@a.dibacco Please check again your log and screenshot and you will realize that it fully worked on your device. To verify this you can run these commands in Android:

Hi @aerial4ce. To fix error 73 please run troubleshooting repair script (that's included in the v1.31d BUNDLE) on a linux machine
[Android Software/Hacking General [Developers Only]] Yevgen.A:
OnePlus 8T aslo getting 70 errorCode:

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

systemrw: Current size of system_ext_b-cow.img in bytes: 438304768
systemrw: Current size of system_ext_b-cow.img in MB: 418
systemrw: Current size of system_ext_b-cow.img in 512-byte sectors: 856064

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

systemrw: Joining all extracted images back into one single super image...
systemrw: Please wait and ignore the invalid sparse warnings...

Not enough space on device for partition system_ext_b-cow with size 438304768

systemrw: Error! failed to create super_fixed.img file. Error code: 70

Any advice?
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @Yevgen.A please send me log files from log folder.

I am not receiving enough feedback from COW users to be able to fix this problem 100%

One of the COW users must successfully run lpmake manually and then give me feedback so I can include solution in next version of script.

If you are COW user please check post #768 and send me your feedback and log files. Thanks!

#Oneplus #xiaomi
[Android Software/Hacking General [Developers Only]] Yevgen.A:
Sure, please let me know you would need anything else.

I saw @NisseGurra got bootloop, I just came out from boot loop by trying to switch partitions. I am not sure which guide I should follow..

Thank you for your help!:)
[Android Software/Hacking General [Developers Only]] Yevgen.A:
Can I know model of your variant please? Did you run those from custom recovery?
[Android Software/Hacking General [Developers Only]] Yevgen.A:
1) when I run this command - I have no output;

2) if we do not need those cow files may be we can skip them in this loop instead of dancing and rebuilding kernel?

P.S.: I am a windows user:-)

for o in `grep -E -m $imgCount "Name:|Group:" $lpdumpPath | awk '{ n = $NF ; getline ; print n "|" $NF }'`; do
imgName=${o//|*}
groupName=${o//*|}
fName="$sDumpDir/$imgName.img"
if [[ "$imgName" == *"system"* || "$imgName" == *"product"* || "$imgName" == *"vendor"* ]]; then makeRW $fName; fi
getCurrentSize $fName 1
if [[ "$currentSize" > 0 ]]; then
echo -n "--partition $imgName:none:$currentSize:$groupName ">>$myArgsPath
echo -n "--image $imgName=$fName ">>$myArgsPath
fi
done
[Android Software/Hacking General [Developers Only]] Yevgen.A:
deleted
[Android Software/Hacking General [Developers Only]] Gentisz:
Not enough space on device for partition system_b with size 33790033920

systemrw: Error! failed to create super_fixed.img file. Error code: 70

Oneplus 8T , OOS v11.6.8, Magisk 23.0, I use ./systemrw.sh size=30720,20480,1024, but all not work with me