[SCRIPT][Android 10+] Universal Mount SystemRW / SuperRW featuring MakeRW (read/write)

Search This thread

khaiyang

New member
Jul 23, 2016
2
0
Hi, I have a problom, my device is xperia 5 ii, android 12.
I use this 'sysrw_repair.sh' on linux, and it can works R/W on system_ext, product and vendor.
Then, sony 'thermal-engine.conf' is in /oem folder, but /oem folder has oem_a and oem_b, so I can't edit this text.
Someone can solve this problom?
/oem folder position is on picture.
Screenshot_20220516-152733~2[1].png
 

I'm Boo

New member
May 16, 2022
2
0
Didnt work on my Device
Android Rom : 11 (RMX2086 Custom Rom Nusantara)
Base Vendor : Android 10
This is my log when i flash the file

systemrw: Initiating procedure...

systemrw: Device is in custom recovery mode
systemrw: Current device: realme realme X3
systemrw: Current Android version: 10
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/sda10
systemrw: /dev/block/dm-2 is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled.
verity is already disabled.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...

17006592+0 records in
17006592+0 records out
8707375104 bytes (8.1 G) copied, 38.475275 s, 216 M/s

systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super

systemrw: Current size of system.img in bytes: 2952695808
systemrw: Current size of system.img in MB: 2815
systemrw: Current size of system.img in 512-byte sectors: 5766984

systemrw: NO 'shared_blocks feature' detected @ system.img

systemrw: Shrinking size of system.img back to minimum size...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 688238 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 688238 (4k) blocks long.

systemrw: Custom size of system.img in bytes: 2834751488
systemrw: Custom size of system.img in MB: 2703
systemrw: Custom size of system.img in 512-byte sectors: 5536624

systemrw: Increasing filesystem size of system.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 692078 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 692078 (4k) blocks long.

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

systemrw: Current size of oppo_product.img in bytes: 119238656
systemrw: Current size of oppo_product.img in MB: 113
systemrw: Current size of oppo_product.img in 512-byte sectors: 232888

systemrw: 'shared_blocks feature' detected @ oppo_product.img

systemrw: Increasing filesystem size of oppo_product.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img to 36388 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img is now 36388 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of oppo_product.img...
systemrw: Read-only lock of oppo_product.img successfully removed

systemrw: Shrinking size of oppo_product.img back to minimum size...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img to 29203 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img is now 29203 (4k) blocks long.

systemrw: Custom size of oppo_product.img in bytes: 135344128
systemrw: Custom size of oppo_product.img in MB: 129
systemrw: Custom size of oppo_product.img in 512-byte sectors: 264344

systemrw: Increasing filesystem size of oppo_product.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img to 33043 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img is now 33043 (4k) blocks long.

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

systemrw: Current size of vendor.img in bytes: 1579606016
systemrw: Current size of vendor.img in MB: 1506
systemrw: Current size of vendor.img in 512-byte sectors: 3085168

systemrw: 'shared_blocks feature' detected @ vendor.img

systemrw: Increasing filesystem size of vendor.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 482057 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 482057 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of vendor.img...
systemrw: Read-only lock of vendor.img successfully removed

systemrw: Shrinking size of vendor.img back to minimum size...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 434367 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 434367 (4k) blocks long.

systemrw: Custom size of vendor.img in bytes: 1794895872
systemrw: Custom size of vendor.img in MB: 1711
systemrw: Custom size of vendor.img in 512-byte sectors: 3505656

systemrw: Increasing filesystem size of vendor.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 438207 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 438207 (4k) blocks long.

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

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

Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic

systemrw: Successfully created patched super image @
systemrw: /data/local/tmp/systemrw_1.32/img/super_fixed.bin

systemrw: Flashing /data/local/tmp/systemrw_1.32/img/super_fixed.bin to /dev/block/sda10
systemrw: Don't interrupt this process or you risk brick! Please wait...

systemrw: Successfully flashed /data/local/tmp/systemrw_1.32/img/super_fixed.bin to /dev/block/sda10

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

systemrw: Congratulations! Your image(s) should now have R/W capability
systemrw: Deleting /data/local/tmp/systemrw_1.32/img/super_fixed.bin to free up some space

systemrw: Please reboot to system...
Screenshot_20220517-033713345.jpg
 

ShadoV90

Senior Member
Mar 5, 2017
233
87
Legnica
Didnt work on my Device
Android Rom : 11 (RMX2086 Custom Rom Nusantara)
Base Vendor : Android 10
This is my log when i flash the file

systemrw: Initiating procedure...

systemrw: Device is in custom recovery mode
systemrw: Current device: realme realme X3
systemrw: Current Android version: 10
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/sda10
systemrw: /dev/block/dm-2 is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled.
verity is already disabled.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...

17006592+0 records in
17006592+0 records out
8707375104 bytes (8.1 G) copied, 38.475275 s, 216 M/s

systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super

systemrw: Current size of system.img in bytes: 2952695808
systemrw: Current size of system.img in MB: 2815
systemrw: Current size of system.img in 512-byte sectors: 5766984

systemrw: NO 'shared_blocks feature' detected @ system.img

systemrw: Shrinking size of system.img back to minimum size...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 688238 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 688238 (4k) blocks long.

systemrw: Custom size of system.img in bytes: 2834751488
systemrw: Custom size of system.img in MB: 2703
systemrw: Custom size of system.img in 512-byte sectors: 5536624

systemrw: Increasing filesystem size of system.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system.img to 692078 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system.img is now 692078 (4k) blocks long.

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

systemrw: Current size of oppo_product.img in bytes: 119238656
systemrw: Current size of oppo_product.img in MB: 113
systemrw: Current size of oppo_product.img in 512-byte sectors: 232888

systemrw: 'shared_blocks feature' detected @ oppo_product.img

systemrw: Increasing filesystem size of oppo_product.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img to 36388 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img is now 36388 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of oppo_product.img...
systemrw: Read-only lock of oppo_product.img successfully removed

systemrw: Shrinking size of oppo_product.img back to minimum size...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img to 29203 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img is now 29203 (4k) blocks long.

systemrw: Custom size of oppo_product.img in bytes: 135344128
systemrw: Custom size of oppo_product.img in MB: 129
systemrw: Custom size of oppo_product.img in 512-byte sectors: 264344

systemrw: Increasing filesystem size of oppo_product.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img to 33043 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/oppo_product.img is now 33043 (4k) blocks long.

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

systemrw: Current size of vendor.img in bytes: 1579606016
systemrw: Current size of vendor.img in MB: 1506
systemrw: Current size of vendor.img in 512-byte sectors: 3085168

systemrw: 'shared_blocks feature' detected @ vendor.img

systemrw: Increasing filesystem size of vendor.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 482057 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 482057 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of vendor.img...
systemrw: Read-only lock of vendor.img successfully removed

systemrw: Shrinking size of vendor.img back to minimum size...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 434367 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 434367 (4k) blocks long.

systemrw: Custom size of vendor.img in bytes: 1794895872
systemrw: Custom size of vendor.img in MB: 1711
systemrw: Custom size of vendor.img in 512-byte sectors: 3505656

systemrw: Increasing filesystem size of vendor.img...
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img to 438207 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor.img is now 438207 (4k) blocks long.

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

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

Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic

systemrw: Successfully created patched super image @
systemrw: /data/local/tmp/systemrw_1.32/img/super_fixed.bin

systemrw: Flashing /data/local/tmp/systemrw_1.32/img/super_fixed.bin to /dev/block/sda10
systemrw: Don't interrupt this process or you risk brick! Please wait...

systemrw: Successfully flashed /data/local/tmp/systemrw_1.32/img/super_fixed.bin to /dev/block/sda10

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

systemrw: Congratulations! Your image(s) should now have R/W capability
systemrw: Deleting /data/local/tmp/systemrw_1.32/img/super_fixed.bin to free up some space

systemrw: Please reboot to system...
View attachment 5615919
I guess you forgot to type su, then enter, and after that you will be able to type mount etc.
 
  • Haha
Reactions: lebigmac

ronaldocoyle

Member
Oct 28, 2021
13
3
It gives me this error on redmi note 11 on a custom rom

--------------------------------------------------
| SystemRW v1.32 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: Custom input detected: ./img/super_original.bin
systemrw: Custom size detected: 1000 MB
systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: Xiaomi Redmi Note 11
systemrw: Current Android version: 11
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/sda9
systemrw: / is read-only
systemrw: /product is read-only
systemrw: /vendor is read-only
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
./systemrw.sh[454]: ./tools/avbctl: inaccessible or not found
./systemrw.sh[454]: ./tools/avbctl: inaccessible or not found
./systemrw.sh[454]: ./tools/lpdump: inaccessible or not found
systemrw: Unpacking embedded partitions from ./img/super_original.bin
./systemrw.sh[454]: ./tools/lpunpack: inaccessible or not found
systemrw: Please make sure the super file exists and try again.

spes:/data/local/tmp/systemrw_1.32_flashable/systemrw_1.32 #



Edit: I tried in the official rom as well still gives me the same error.
 
Last edited:

akrox

Member
Mar 23, 2022
7
2
Hi @lebigmac ,

Your script is badass!
Follow attached logs for Samsung S22+ (SM-G906B).

I've only question, how can i flash the output (super_fixed.bin)? I've tried with Odin... but couldn't flash. (yes, i've put the super_fixed.bin inside a tar like: super.tar)

Can you anyone give any advice?
 

Attachments

  • lpdump.txt
    1.3 KB · Views: 3
  • mylog.txt
    2.2 KB · Views: 1
  • Like
Reactions: lebigmac

ronaldocoyle

Member
Oct 28, 2021
13
3
Hi you didn't install it properly
Path should look like this /data/local/tmp/systemrw_1.32
Good luck! (y)
ok that fixed the error but system isn't rw yet.



spes:/data/local/tmp/systemrw_1.32 # ./systemrw.sh size=15
--------------------------------------------------
| SystemRW v1.32 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: Custom size detected: 15 MB
systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: Xiaomi Redmi Note 11
systemrw: Current Android version: 11
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 1
systemrw: Your super partition is located at: /dev/block/sda9
systemrw: / is read-only
systemrw: /product is read-only
systemrw: /vendor is read-only
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled on slot with suffix _b.
verity is already disabled on slot with suffix _b.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...

17825792+0 records in
17825792+0 records out
9126805504 bytes (8.5 G) copied, 98.553376 s, 88 M/s

systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super

systemrw: Current size of system_b.img in bytes: 3067813888
systemrw: Current size of system_b.img in MB: 2925
systemrw: Current size of system_b.img in 512-byte sectors: 5991824

systemrw: 'shared_blocks feature' detected @ system_b.img

systemrw: Increasing filesystem size of system_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 936222 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 936222 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of system_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of system_b.img successfully removed

systemrw: Shrinking size of system_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 772751 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 772751 (4k) blocks long.

systemrw: Custom size of system_b.img in bytes: 3180916736
systemrw: Custom size of system_b.img in MB: 3033
systemrw: Custom size of system_b.img in 512-byte sectors: 6212728

systemrw: Increasing filesystem size of system_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 776591 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 776591 (4k) blocks long.

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

systemrw: Current size of system_ext_b.img in bytes: 513929216
systemrw: Current size of system_ext_b.img in MB: 490
systemrw: Current size of system_ext_b.img in 512-byte sectors: 1003768

systemrw: 'shared_blocks feature' detected @ system_ext_b.img

systemrw: Increasing filesystem size of system_ext_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img to 156838 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img is now 156838 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of system_ext_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of system_ext_b.img successfully removed

systemrw: Shrinking size of system_ext_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img to 125480 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img is now 125480 (4k) blocks long.

systemrw: Custom size of system_ext_b.img in bytes: 529694720
systemrw: Custom size of system_ext_b.img in MB: 505
systemrw: Custom size of system_ext_b.img in 512-byte sectors: 1034560

systemrw: Increasing filesystem size of system_ext_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img to 129320 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img is now 129320 (4k) blocks long.

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

systemrw: Current size of product_b.img in bytes: 1544888320
systemrw: Current size of product_b.img in MB: 1473
systemrw: Current size of product_b.img in 512-byte sectors: 3017360

systemrw: 'shared_blocks feature' detected @ product_b.img

systemrw: Increasing filesystem size of product_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img to 471462 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img is now 471462 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of product_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of product_b.img successfully removed

systemrw: Shrinking size of product_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img to 381281 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img is now 381281 (4k) blocks long.

systemrw: Custom size of product_b.img in bytes: 1577455616
systemrw: Custom size of product_b.img in MB: 1504
systemrw: Custom size of product_b.img in 512-byte sectors: 3080968

systemrw: Increasing filesystem size of product_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img to 385121 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img is now 385121 (4k) blocks long.

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

systemrw: Current size of vendor_b.img in bytes: 1279520768
systemrw: Current size of vendor_b.img in MB: 1220
systemrw: Current size of vendor_b.img in 512-byte sectors: 2499064

systemrw: 'shared_blocks feature' detected @ vendor_b.img

systemrw: Increasing filesystem size of vendor_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img to 390478 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img is now 390478 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of vendor_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of vendor_b.img successfully removed

systemrw: Shrinking size of vendor_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img to 337634 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img is now 337634 (4k) blocks long.

systemrw: Custom size of vendor_b.img in bytes: 1398677504
systemrw: Custom size of vendor_b.img in MB: 1333
systemrw: Custom size of vendor_b.img in 512-byte sectors: 2731792

systemrw: Increasing filesystem size of vendor_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img to 341474 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img is now 341474 (4k) blocks long.

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

systemrw: Current size of system_b-cow.img in bytes: 2718564352
systemrw: Current size of system_b-cow.img in MB: 2592
systemrw: Current size of system_b-cow.img in 512-byte sectors: 5309696

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

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

Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic

systemrw: Successfully created patched super image @
systemrw: /data/local/tmp/systemrw_1.32/img/super_fixed.bin

systemrw: Congratulations! Your image(s) should now have R/W capability
systemrw: Please reboot into bootloader and flash the file(s) manually

spes:/data/local/tmp/systemrw_1.32 # cd
spes:/ # mount -o remount,rw /
'/dev/block/dm-0' is read-only
spes:/ #
 
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
1,072
706
ok that fixed the error but system isn't rw yet.



spes:/data/local/tmp/systemrw_1.32 # ./systemrw.sh size=15
--------------------------------------------------
| SystemRW v1.32 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: Custom size detected: 15 MB
systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: Xiaomi Redmi Note 11
systemrw: Current Android version: 11
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 1
systemrw: Your super partition is located at: /dev/block/sda9
systemrw: / is read-only
systemrw: /product is read-only
systemrw: /vendor is read-only
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled on slot with suffix _b.
verity is already disabled on slot with suffix _b.
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...

17825792+0 records in
17825792+0 records out
9126805504 bytes (8.5 G) copied, 98.553376 s, 88 M/s

systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Nested partitions were successfully extracted from super

systemrw: Current size of system_b.img in bytes: 3067813888
systemrw: Current size of system_b.img in MB: 2925
systemrw: Current size of system_b.img in 512-byte sectors: 5991824

systemrw: 'shared_blocks feature' detected @ system_b.img

systemrw: Increasing filesystem size of system_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 936222 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 936222 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of system_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of system_b.img successfully removed

systemrw: Shrinking size of system_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 772751 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 772751 (4k) blocks long.

systemrw: Custom size of system_b.img in bytes: 3180916736
systemrw: Custom size of system_b.img in MB: 3033
systemrw: Custom size of system_b.img in 512-byte sectors: 6212728

systemrw: Increasing filesystem size of system_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 776591 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 776591 (4k) blocks long.

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

systemrw: Current size of system_ext_b.img in bytes: 513929216
systemrw: Current size of system_ext_b.img in MB: 490
systemrw: Current size of system_ext_b.img in 512-byte sectors: 1003768

systemrw: 'shared_blocks feature' detected @ system_ext_b.img

systemrw: Increasing filesystem size of system_ext_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img to 156838 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img is now 156838 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of system_ext_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of system_ext_b.img successfully removed

systemrw: Shrinking size of system_ext_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img to 125480 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img is now 125480 (4k) blocks long.

systemrw: Custom size of system_ext_b.img in bytes: 529694720
systemrw: Custom size of system_ext_b.img in MB: 505
systemrw: Custom size of system_ext_b.img in 512-byte sectors: 1034560

systemrw: Increasing filesystem size of system_ext_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img to 129320 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_b.img is now 129320 (4k) blocks long.

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

systemrw: Current size of product_b.img in bytes: 1544888320
systemrw: Current size of product_b.img in MB: 1473
systemrw: Current size of product_b.img in 512-byte sectors: 3017360

systemrw: 'shared_blocks feature' detected @ product_b.img

systemrw: Increasing filesystem size of product_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img to 471462 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img is now 471462 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of product_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of product_b.img successfully removed

systemrw: Shrinking size of product_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img to 381281 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img is now 381281 (4k) blocks long.

systemrw: Custom size of product_b.img in bytes: 1577455616
systemrw: Custom size of product_b.img in MB: 1504
systemrw: Custom size of product_b.img in 512-byte sectors: 3080968

systemrw: Increasing filesystem size of product_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img to 385121 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/product_b.img is now 385121 (4k) blocks long.

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

systemrw: Current size of vendor_b.img in bytes: 1279520768
systemrw: Current size of vendor_b.img in MB: 1220
systemrw: Current size of vendor_b.img in 512-byte sectors: 2499064

systemrw: 'shared_blocks feature' detected @ vendor_b.img

systemrw: Increasing filesystem size of vendor_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img to 390478 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img is now 390478 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of vendor_b.img...
e2fsck 1.45.4 (23-Sep-2019)
systemrw: Read-only lock of vendor_b.img successfully removed

systemrw: Shrinking size of vendor_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img to 337634 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img is now 337634 (4k) blocks long.

systemrw: Custom size of vendor_b.img in bytes: 1398677504
systemrw: Custom size of vendor_b.img in MB: 1333
systemrw: Custom size of vendor_b.img in 512-byte sectors: 2731792

systemrw: Increasing filesystem size of vendor_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img to 341474 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_b.img is now 341474 (4k) blocks long.

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

systemrw: Current size of system_b-cow.img in bytes: 2718564352
systemrw: Current size of system_b-cow.img in MB: 2592
systemrw: Current size of system_b-cow.img in 512-byte sectors: 5309696

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

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

Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic

systemrw: Successfully created patched super image @
systemrw: /data/local/tmp/systemrw_1.32/img/super_fixed.bin

systemrw: Congratulations! Your image(s) should now have R/W capability
systemrw: Please reboot into bootloader and flash the file(s) manually

spes:/data/local/tmp/systemrw_1.32 # cd
spes:/ # mount -o remount,rw /
'/dev/block/dm-0' is read-only
spes:/ #
Hi thanks for sharing your log. It looks promising. Did you reboot to bootloader and manually fastboot flash the super_fixed.bin to your super partition yet as suggested by the script? WAIT! Before you do this make sure you've got a proper backup of your original stock super partition in case anything goes wrong! You can find your original super.img in sparse format when you download your current FASTBOOT ROM MIUI firmware from official Xiaomi servers
Or use the one dumped by script (it's in raw format though so you might want to sparse it with img2simg)
If you've got any further questions just ask! Good luck (y)
 
Last edited:

ronaldocoyle

Member
Oct 28, 2021
13
3
Hi thanks for sharing your log. It looks promising. Did you reboot to bootloader and manually fastboot flash the super_fixed.bin to your super partition yet as suggested by the script? WAIT! Before you do this make sure you've got a proper backup of your original stock super partition in case anything goes wrong! You can find your original super.img in sparse format when you download your current FASTBOOT ROM MIUI firmware from official Xiaomi servers
Or use the one dumped by script (it's in raw format though so you might want to sparse it with img2simg)
If you've got any further questions just ask! Good luck (y)
thanks. Flashing fixed worked.
 

ronaldocoyle

Member
Oct 28, 2021
13
3
Last edited:

ronaldocoyle

Member
Oct 28, 2021
13
3
Okay so everything work as planned but now I have a question hopefully not annoying so here goes I ran
Everything as prescribed and now I have a .bin file how to I get this to flash or install
you need to transfer the super_fixed.bin to pc & then put phone into fastboot & flash the super_fixed.bin using the command
Code:
fastboot flash super super_fixed.bin
 

ronaldocoyle

Member
Oct 28, 2021
13
3
I have a question. Whenever I want to change a rom do I have to first install the rom then this package & then flash super_fixed.bin ?
If I already have the super_fixed.bin for that rom & never executed this script. can I just change the rom script to flash super_fixed.bin instead of super.img Will That work? or can i just flash this bin file over the rom? will that still give me rw permission? In other words can I just create a rom that already has rw permission?
 

ronaldocoyle

Member
Oct 28, 2021
13
3
Ok I'm now confused. Everything done exactly even was able to mount but can't copy file to system_ext.

Device: Redmi Note 11

[Note: I didn't run the script. The super_fixed.bin was from previous session. I just replaced super.img with super_fixed.bin of the same rom & flashed. Seems to be still able to mount but no idea why I can't copy. I can still delete stuff though]

PS C:\Users\Ryan> adb devices
List of devices attached
ac9353f device

PS C:\Users\Ryan> adb shell
spes:/ $ su
spes:/ # su mount -o remount, rw /
su: invalid option -- o

MagiskSU

Usage: su [options] [-] [user [argument...]]

Options:
-c, --command COMMAND pass COMMAND to the invoked shell
-h, --help display this help message and exit
-, -l, --login pretend the shell to be a login shell
-m, -p,
--preserve-environment preserve the entire environment
-s, --shell SHELL use SHELL instead of the default /system/bin/sh
-v, --version display version number and exit
-V display version code and exit
-mm, -M,
--mount-master force run in the global mount namespace

2|spes:/ # su mount -o remount, rw /system_ext
su: invalid option -- o

MagiskSU

Usage: su [options] [-] [user [argument...]]

Options:
-c, --command COMMAND pass COMMAND to the invoked shell
-h, --help display this help message and exit
-, -l, --login pretend the shell to be a login shell
-m, -p,
--preserve-environment preserve the entire environment
-s, --shell SHELL use SHELL instead of the default /system/bin/sh
-v, --version display version number and exit
-V display version code and exit
-mm, -M,
--mount-master force run in the global mount namespace


2|spes:/ # mount -o remount,rw /system
mount: '/system' not in /proc/mounts
1|spes:/ # mount -o remount,rw /system_ext
spes:/ # mount -o remount,rw /product
spes:/ # mount -o remount,rw /vendor
spes:/ # mount | grep dm-
/dev/block/dm-3 on / type ext4 (ro,seclabel,relatime,discard)
/dev/block/dm-0 on /system_ext type ext4 (rw,seclabel,relatime,discard)
/dev/block/dm-2 on /vendor type ext4 (rw,seclabel,relatime,discard)
/dev/block/dm-1 on /product type ext4 (rw,seclabel,relatime,discard)
/dev/block/dm-4 on /data type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,gc_merge,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=21484,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier)
/dev/block/dm-4 on /data/user/0 type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,gc_merge,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=21484,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier)
/dev/block/dm-4 on /data_mirror/data_ce/null type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,gc_merge,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=21484,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier)
/dev/block/dm-4 on /data_mirror/data_ce/null/0 type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,gc_merge,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=21484,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier)
/dev/block/dm-4 on /data_mirror/data_de/null type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,gc_merge,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=21484,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier)
/dev/block/dm-4 on /data_mirror/cur_profiles type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,gc_merge,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=21484,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier)
spes:/ #
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Oh **** it's June 1st already. You know what that means.
    That means meteorological summer time starts now. I guess I'll have to merge both the happy spring time version and the happy summertime edition into one single happy summertime edition then. 😃
    Don't worry I'll hurry up with the release ;)
    If you've waited this long for the new version then you are a true loyal customer. Thanks for your support! ;)(y)
    A couple more days and it should be ready... 🕗 ⌛
    4
    Will this work on any device that has super? I have an s22 ultra international version and i need my system to be R/O to delete files. Thanks.
    Hi. Current version v1.32 does not work properly with some modern Samsung / Realme devices.
    I am currently working on a fix behind the scenes for all Samsung / Realme users out there ;)(y)
    2
    Is it possible to use this on custom roms that use EROFS?
    2
    Did you need to rename the super fixed to super_origin for Oneplus ?
    I did not have to rename.
    2
    Outstanding! I have a OnePlus Nord n200 5g, and thanks to this script r/w is working great!

    I had to run the script from adb shell in system mode. Running this script in fastboot mode, or recovery did not work due to the encryption system. Decrypting with TWRP does not work on this phone no matter how many times you set a pin, or password for the phone. This phone does have a super partition.

    The steps I used to get it working are:

    unzip the flashable zip.

    adb push systemrw_1.32 /data/local/tmp/
    adb shell
    su
    cd /data/local/tmp/systemrw_1.32/
    chmod +x systemrw.sh
    ./systemrw.sh size=100

    ##### WAIT UNTIL YOU SEE: Please reboot into bootloader and flash the file(s) manually

    adb pull /data/local/tmp/systemrw_1.32/img/super_fixed.bin
    adb reboot fastboot
    fastboot flash super super_fixed.bin

    reboot into system, then tested with:

    adb shell
    su
    mount -o remount,rw /
    cd /system
    touch test
    ls -als test <- you should see the "test" file size, permissions, creatd date etc
    rm -rf test


    I hope this helps somebody else having issues with encrypted phones.

    Thank you for your hard work!
  • 146
    If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni


    logo_large.jpg

    SystemRW / SuperRW (feat. MakeRW) v1.32 by lebigmac
    NEW VERSION COMING SOON! STAY TUNED!;)(y)
    ANY TALENTED DEVELOPERS WANT TO CONTRIBUTE TO NEXT VERSION? PLEASE CONTACT ME NOW! THANKS! :love:(y)

    Creation date: February 2021
    Updated: August 2021

    Requirements:
    • rooted STOCK Android 10 or newer (custom ROM should already be R/W!)
    • at least 10+ GB free space on phone for dumping data
    Description:
    A script for all Android power users that wish to make their read-only Android 10+ system read/write-able again to remove bloatware and make more thorough customizations to their device.
    Script only modifies super and vbmeta partitions. /data partition is not affected. It's only used for dumping data and for storing script files.
    In a nutshell this is what the script is doing:
    • dumps your existing super OR your system / product / vendor partitions depending on whether or not you've got super partition
    • extracts embedded read-only partitions (system, vendor, product...) from super if applicable
    • makes these partitions read/write-able
    • joins everything back together to new super.img OR NOT depending on whether or not you've got super partition
    • flashes read/write-able images back to device using the super fast Kolibass technique (only in recovery mode)

    NOTE:
    • Before running this experimental software on your device it is recommended to make a full backup of your device (just in case you are unlucky enough to end up in an irreversible bootloop)
    • Extract BUNDLE.zip (the included sysrw_repair.zip is only for fixing error 73!)
    • The script can be run both inside custom recovery and inside Android operating system.
      If you run script in Android mode you will need to fastboot flash the patched image(s) manually!
    • To check whether or not you've got a super partition on your device you can run this command: adb shell "ls -l /dev/block/by-name/super"
    • To check whether or not your device has the notorious 'shared_blocks' read-only feature you can run this code:
      Bash:
      adb shell
      su
      for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol"; done
    • To check whether or not the script worked correctly you can run this code:
      Bash:
      adb shell
      su
      for a in /dev/block/dm-*; do mount -o remount,rw $a; done
    Manual installation:
    • Extract flashable.zip and copy systemrw_*VERSION* folder into /data/local/tmp/
    • run this command to make the script executable:
      chmod +x /data/local/tmp/systemrw_*VERSION*/systemrw.sh
    Automatic installation:
    Installation of the script has never been this easy!
    Download the flashable.zip below, do NOT enable zip signature verification and simply install it in your custom recovery (works in TWRP, OrangeFox and PBRP!)
    The installer binary will auto-detect whether or not your device has a super partition and launch the script accordingly with the proper command line arguments.

    Flashable zip custom usage:
    You can set these custom installation arguments in the included config.ini file.
    Simply extract the flashable.zip and modify the included config.ini file and then save the file. Then compress the systemrw_*VERSION* and META-INF folders again as a new .zip and install it in recovery.
    First line of config.ini contains the script arguments for those WITHOUT super partition.
    By default this line is completely empty (no space).
    Second line of config.ini contains the script arguments for those WITH super partition.
    For example if you already dumped your super_original.bin and want to skip that process next time you install the .zip then put this in line #2 of config.ini :
    in=`realpath /dev/block/by-name/super` size=15
    Remember if you decide to use custom arguments in config.ini then the first character should always be an empty space. If no arguments are used such as by default in line #1 (no super) then the line should be completely empty, no space, nothing.

    Script usage:
    If you've got no super partition then simply call the script with no arguments from the shell (see examples below).
    If you've got a super partition I would recommend using the optional size=15 parameter as well to give some extra free space (in MB) to each partition.
    Optional script arguments:
    Replace x with your custom value
    • in=x *THIS IS IGNORED IF YOU'VE GOT NO SUPER PARTITION*
      With this flag you can specify an existing super image as input and skip the entire dumping of the super image process. Here you can use the super_original.bin which you dumped earlier with systemrw or the official unsparsed super.img from your downloaded firmware. (unsparse with simg2img). It's also possible to use your super partition block device as input.
      If omitted, systemrw will dump super image from phone to ./img/super_original.bin
      (path is relative to the script)
    • out=x *THIS IS IGNORED IF YOU'VE GOT NO SUPER PARTITION*
      With this argument you can specify the output path of the new patched super file.
      If omitted, default output value is ./img/super_fixed.bin
    • size=x *ONLY RECOMMENDED IF YOU'VE GOT SUPER PARTITION*
      With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
      If omitted, default extra size is 0 (shrink to minimum)

    Examples:
    Bash:
    adb shell
    su
    cd /data/local/tmp/systemrw_1.32
    chmod +x ./systemrw.sh
    
    # Run this command *IF YOU'VE GOT NO SUPER PARTITION*
    ./systemrw.sh
    
    # Run this command if you're first time user *AND YOU'VE GOT SUPER PARTITION*
    # Specify the extra free space in megabytes for each partition:
    ./systemrw.sh size=15
    
    # Plug an existing super image into the script like this *ONLY IF YOU'VE GOT SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin size=15
    
    # Specify both the input file as well as the output destination *ONLY IF YOU'VE GOT SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15
    
    # EXPERT EXAMPLE:
    ./systemrw.sh in=`realpath /dev/block/by-name/super` out=./img/super_fixed.bin size=50

    Uninstallation:
    • To free up space and keep script as well as r/w capability you can simply delete /img subfolder at /data/local/tmp/systemrw_1.32/img
    • To delete script and keep r/w capability you can simply delete whole script folder at /data/local/tmp/systemrw_1.32
    • To undo all changes performed by the script you can simply reflash original stock read-only super image and re-enable dm-verity and verification either through adb/fastboot or with the included avbctl binary (inside /tools/ subfolder - also available in recovery).

    Troubleshooting:
    If you get error 255 in custom recovery when trying to install flashable zip then try to install it manually. If you encounter this error please send me this file /tmp/recovery.log
    Make sure the script folder was correctly extracted to:
    /data/local/tmp/systemrw_*VERSION*
    If you can't run the script try making the file executable like this: chmod +x ./systemrw.sh
    If you still can't get it to work run which sh in your shell and replace the shebang in the first line of the script with the output of that command. Don't remove the first two #! symbols though. Then save the file and try again.
    Make sure you have full read write access to the /data/local/tmp directory and that the containing files are not encrypted in custom recovery!
    If you get bootloop after successfully flashing super_fixed.bin then you can undo bootloop simply by re-flashing original stock super image and re-enabling dm-verity and verification with the included avbctl binary (inside /tools/ subfolder - also available in recovery). Those are the only changes performed by the script.
    Good luck!

    About:
    I did not come up with all this by myself. After searching for a solution for countless days without success, going even as far as learning hex editing - I accidentally came across a couple of very interesting threads burried deep inside the new forum interface where this method has been described by various enthousiasts (links can be found in the credits section below). Therefore I take absolutely no credit for the underlying core mechanisms of the script. I'm only the amateur who put it all together into a compact script so that everybody can enjoy an Android system that's read/write-able again. Just like it used to be in Android 9 or earlier. Before this annoying 'shared_blocks feature' was implemented.

    Credits:
    Huge thanks to @Brepro1 for allowing me to use his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Huge thanks to @Kolibass for allowing me to use his partition tools for Android. Without your tools this script would not work on the Android platform! This genius also showed me how to flash a 5GB file to my partition in just under 30 seconds! Much faster than fastboot! I still can't believe it!
    Big thanks @munjeni for allowing me to use his amazing superunpack V1 tool in the initial version. It helped me to understand how these super images work.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the initial version which helped me to create this universal version. It's still part of the troubleshooting repair script to fix error 73.
    More thanks @gabrielfrias for his helpful comment
    Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'
    Thanks @HemanthJabalpuri for assisting me in optimizing the underlying algorithm!
    Thanks @aIecxs for helping me fix some shell scripting errors (y)

    Disclaimer:
    #Disclaimer v2.0​
    This open source software is provided as is without any kind of warranty or support whatsoever.
    By using and viewing this software you agree to the following terms:
    • Under no circumstances shall the author be held responsible for any damages that may ensue from the (inappropriate) use of this software.
    • All responsibility, liability and risk lies with the end-user. You hereby agree not to abuse this software for illegal purposes.
    • Under no circumstances shall the comments & title section of the script (lines #1 - #100) as well as the included update-binary be modified or removed by the end-user without the original author's explicit consent.
    • Under no circumstances shall the end-user steal and / or abuse my entire SystemRW project or parts thereof (including but not limited to my update-binary, my script, my program logo, my program name or the names of my functions and/or my variables and more...) only to rename and republish my SystemRW / SuperRW feat. MakeRW project (or parts thereof) as his/her own creation without even mentioning original source!!! (yes this actually happened :( perpetrated by at least 2 fellow forum members...)
    • Unverified, unauthorized re-uploads of any files contained within this project to 3rd party websites are not permitted without the original author's prior knowledge and consent!
      If you want to share this software with your friends please just send them the link to this website. Thanks.
    • The end-user is allowed to improve the underlying algorithm (as long as no malicious code is added) and post his/her improvements, results and feedback right here in the official SystemRW / SuperRW feat. MakeRW project thread @ xda-developers.com
    • If the end-user wishes to re-use my SystemRW / SuperRW featuring MakeRW project (or any parts thereof) inside his/her own project then he/she shall first contact me! Thanks!
      If you want to make a video tutorial about this project please contact me first!
      Thank you! I can give you high resolution project logo and more!

    Please make sure to post your feedback and suggestions in the official thread right here.
    Enjoy customizing your fully read/write-able Android device! And feel free to share your Android system mods with other users in this thread! Thanks!


    v1-31d_01-jpg.5309953
    v1-31d_03-jpg.5309957


    1-jpg.5235933


    working-jpg.5525671


    Confirmed working on these devices:

    Download v1.32 mirror #1
    Download v1.32 mirror #2
    more official download mirrors coming soon!
    current status: experimental


    If you like this project and want to support further development of SystemRW / SuperRW feat. MakeRW & the creation of more amazing projects like this then please feel free to donate to the original developer by clicking the button below. Thanks! Your support is very much appreciated!
    Donate
    15
    If the script works on your device please send me your log files from this folder:
    /data/local/tmp/systemrw_1.32/log/

    And please write your phone model - Android version - firmware version

    Then I can add you to the list of successful devices and it will be helpful for further development. Thank you!(y)
    8
    Is it summer holidays yet or what? So much interest in my thread right now it's crazy. I can't even keep up with every single comment there's just too many. I just want to say thank you to every single one of you for your enthousiastic interest in this amazing SystemRW / SuperRW feat. MakeRW by lebigmac project! (y)

    Guys please stop wasting your time trying to get that old version to work in Android 12 + as it was originally not designed for such a new Android version. Just be patient for a couple more days and I will officially release BRAND NEW VERSION :D(y) which has Android 12+ support out of the box, auto-resize feature and more ;)(y)
    I'm working on it hard as we speak... 🛠️

    If you're Samsung or Realme device user just send me a message and we can work on a fix! Thanks (y)
    8
    Okay I know you guys have been waiting a long time... Thanks for your patience, loyalty, support and your interest in this amazing project for the past year! Unfortunately there's lots of dubious copycats floating around by now. Remember you saw it here first ;)(y)
    The one and only, the original
    SystemRW / SuperRW featuring MakeRW by lebigmac
    This month new version should be ready :D(y)
    I'm working on it hard 🛠️⚙️⛏️🔧✂️🔨
    Hopefully we can start beta testing in 2nd half of April May and then it should be ready for final release :love:
    I'm so excited!


    This is awesome! Unfortunately, it doesn't support Android 12 yet : ( .

    The new version has support for Android 12 and beyond! :ROFLMAO:

    Bash:
    sdkCheck(){
        sdkVersion=`getprop ro.build.version.sdk`
        if [ $sdkVersion -lt 29 ]; then
            printf "$app: Please install Android 10 or newer and try again\n\n" && exit 1
        else
            android=$(($sdkVersion - 19))  
        fi
        printf "$app: Current Android version: %s\n" $android
    }
    6
    New version 1.20 is ready! DOWNLOAD HERE
    Good news for those that don't have TWRP or couldn't get it to work in their TWRP. Now the script can also be run directly inside Android. Keep in mind that you will have to flash the patched images manually in this case using fastboot flash.

    The zip can still be flashed in TWRP (make sure zip signature verification isn't checked). This time I bundled my device's stock sh binary (which I used to develop the script) with the archive. Hopefully this will prevent avoidable sh-related syntax errors for some folks. The flashable zip installer update-binary automatically launches the script with the proper arguments using this bundled sh program (it's inside the tools subfolder).

    To those that were having difficulties running the previous version due to empty partitions or multiple partition groups inside their super : this has finally been fixed :D

    Please give this new version a try and let me know if it works for you or not and I will add it to the first post. Thanks for your feedback!