• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
Search This thread

bseosbseos

Member
Aug 3, 2021
16
4
You are trying to flash the wrong file. The flashable zip is inside the BUNDLE. I hope this helps. Good luck!
Thanks, I've flashed the flashable zip, looks like it succeeded. Here's my log: https://pastebin.com/y9PMNf6j

However I still can't seem to rename or delete some files within the system folder. Please see screen recording below:


EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 
Last edited:
Jul 31, 2021
9
4
However I still can't seem to rename or delete some files within the system folder.
Have you noticed that when you go to a folder ETC, your system becomes RO?
Have you tried to tap on the "mount RO" ?
 

Attachments

  • ETC.png
    ETC.png
    341.1 KB · Views: 27

bseosbseos

Member
Aug 3, 2021
16
4
Have you noticed that when you go to a folder ETC, your system becomes RO?
Have you tried to tap on the "mount RO" ?
I was aware, I've also changed the parent directories to RW, still same error.
I've also used different file managers.

EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 
Last edited:

lebigmac

Senior Member
Jan 31, 2017
836
483
@bseosbseos thanks for your feedback.
Your Pixel 4 XL device still boots up after flashing super_fixed.bin
I'd call that a success ;) Just kidding

To verify if script worked properly try these commands and send me screenshot.

Bash:
adb shell
su
for x in / /product /vendor; do mount -o remount,rw $x; echo "it works! @ $x">$x/test.txt; cat $x/test.txt; rm $x/test.txt; done

1-jpg.5235933
 

bseosbseos

Member
Aug 3, 2021
16
4
@bseosbseos thanks for your feedback.
Your Pixel 4 XL device still boots up after flashing super_fixed.bin
I'd call that a success ;) Just kidding

To verify if script worked properly try these commands and send me screenshot.

Bash:
adb shell
su
for x in / /product /vendor; do mount -o remount,rw $x; echo "it works! @ $x">$x/test.txt; cat $x/test.txt; rm $x/test.txt; done

1-jpg.5235933
adbpr.png


fsde.png


EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 
Last edited:
  • Wow
Reactions: lebigmac

asuhoops8628

Senior Member
Nov 9, 2011
367
64
That's wonderful news for OnePlus users! Could you please upload a screenshot here in this thread and send me your log files? Thanks! You can send me logs through PM if you want.

Then I can add your device to the list of successful devices on first page! (y)✅

Try remounting your partitions as r/w like this:
Bash:
adb shell
su
for x in / /product /vendor; do mount -o remount,rw $x; done

1-jpg.5235933
I had to wipe data/factory reset after flashing the zip, the tmp file is gone.

If I reflash the zip, will it generate the log you need?
 

lebigmac

Senior Member
Jan 31, 2017
836
483
I had to wipe data/factory reset after flashing the zip, the tmp file is gone.

If I reflash the zip, will it generate the log you need?
Hi @asuhoops8628 the log files can be found in /data/local/tmp/systemrw_1.32/log/
Thanks!
@bseosbseos thanks for the screenshots. Can you also please send me log files from this path? Thanks!
/data/local/tmp/systemrw_1.32/log/

Hmm that's weird. Apparently you can only write to /product but it also worked on / (system), otherwise you couldn't mount it as r/w without error.

Why does it still say that / (system) is read-only? This must be an additional read-only protection feature implemented by your manufacturer (in addition to read-only feature called 'shared-blocks')

Can you check the filesystem features of your system partition? It might give you a clue as to what is causing it to still be read-only
tune2fs -l /dev/block/dm-? (replace ? symbol with 0, 1, 2, 3 , 4 or 5. Which ever is your system. You can check that with mount command mount | grep "dm-" )
 
Last edited:

NisseGurra

Senior Member
Nov 22, 2005
1,124
434
Xiaomi Mi Pad 4
OnePlus 8T
I came a bit further on my messed up sysrw repair
But got stuck on :

"!lpmake E 08-04 22:21:37 7769 7769 images.cpp:448] [liblp]open image file failed: /data/local/tmp/systemrw_1.32/img/system_b.img: No such file or directory"

The file is there but something messes up, ideas?
 

Attachments

  • log.txt
    2.1 KB · Views: 7
  • lpmake_output.txt
    884 bytes · Views: 3
  • myargs.txt
    812 bytes · Views: 5

lebigmac

Senior Member
Jan 31, 2017
836
483
I came a bit further on my messed up sysrw repair
But got stuck on :

"!lpmake E 08-04 22:21:37 7769 7769 images.cpp:448] [liblp]open image file failed: /data/local/tmp/systemrw_1.32/img/system_b.img: No such file or directory"

The file is there but something messes up, ideas?
Was the file system_b.img successfully pulled from phone (/data/local/tmp/systemrw_1.32/img/) to the /img subfolder of sysrw_repair script project directory on your linux computer?
According to your log it was successfully pulled
/data/local/tmp/systemrw_1.32/img/system_b.img: 1 file pulled, 0 skipped. 38.6 MB/s (3487551488 bytes in 86.086s)
If all files were successfully copied to your linux computer then try running lpmake command manually using arguments from myargs.txt
 

NisseGurra

Senior Member
Nov 22, 2005
1,124
434
Xiaomi Mi Pad 4
OnePlus 8T
Was the file system_b.img successfully pulled from phone (/data/local/tmp/systemrw_1.32/img/) to the /img subfolder of sysrw_repair script project directory on your linux computer?
According to your log it was successfully pulled

If all files were successfully copied to your linux computer then try running lpmake command manually using arguments from myargs.txt
Yes, files was pulled from phone ok, are there any guide in how the lpmake commands looks like?
 

lebigmac

Senior Member
Jan 31, 2017
836
483
Yes, files was pulled from phone ok, are there any guide in how the lpmake commands looks like?

Wait a second are you using old sysrw_repair version or the proper release? Re-download the latest sysrw_repair script from first page. The file paths have not been updated properly in your myargs.txt

You can run lpmake manually like this:
Bash:
./tools/bin/lpmake `cat ./myargs.txt`
 
Last edited:

bseosbseos

Member
Aug 3, 2021
16
4
@bseosbseos thanks for the screenshots. Can you also please send me log files from this path? Thanks!
/data/local/tmp/systemrw_1.32/log/

lpdump.txt: https://pastebin.com/9KV6RNub
mylog.txt: https://pastebin.com/eX2uQ6ZM

@bseosbseos Can you check the filesystem features of your system partition? It might give you a clue as to what is causing it to still be read-only
tune2fs -l /dev/block/dm-? (replace ? symbol with 0, 1, 2, 3 , 4 or 5. Which ever is your system. You can check that with mount command mount | grep "dm-" )

tune2fs: https://pastebin.com/W2ATtgLC

EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 

Attachments

  • lpdump.txt
    4.3 KB · Views: 3
  • mylog.txt
    8.3 KB · Views: 5
  • tune2fs.txt
    6.9 KB · Views: 3
Last edited:
  • Love
Reactions: lebigmac

Gentisz

Member
Jun 17, 2021
6
1
Xiaomi Mi 9
Redmi Note 8 Pro
use command:./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` out=./img/super_fixed.bin size=50

mannal flash: fastboot flash super .\super_fixed.bin

reboot just like last time: crashdump mode
 

Attachments

  • lpdump.txt
    2.2 KB · Views: 6
  • mylog.txt
    7.6 KB · Views: 7
  • Sad
Reactions: lebigmac

flypatriot

Senior Member
Jul 24, 2018
66
34
OnePlus 8 Pro
OnePlus 8T
Finally, I've got it worked on my OnePlus 8T.
To resolve the issue with "not enough space" on /system_root, /system and /vendor partitions when trying to write a file you need to do following:
1. Reboot to recovery and flash custom kernel with avb check removed. Most of the custom kernels support this feature. Reboot back to system.
2. Reboot to recovery and flash system_rw script with standard size=15. Reboot back to system.
3. Reboot to recovery and flash system_rw script one more time but with size=50. Reboot back to system.
4. Finally mount /, /system_ext, /vendor and /product partitions in rw mode.
Now you can copy and write non-zero files to this partitions.
@lebigmac Thanks a lot for your great job!!! You're the greatest man in the world!!!
P.S. I have KB2000 with OOS 11.0.8.14.KB05BA on board.
 
Last edited:
  • Like
Reactions: enzobelmont

lebigmac

Senior Member
Jan 31, 2017
836
483
@bseosbseos check your mount output:
/dev/block/dm-0 on / type ext4 (rw,seclabel,relatime,errors=remount-ro)
/dev/block/dm-3 on /system_ext type ext4 (ro,seclabel,relatime)
/dev/block/dm-1 on /vendor type ext4 (rw,seclabel,relatime)
/dev/block/dm-2 on /product type ext4 (rw,seclabel,relatime)
It looks like it worked! Congratulations!

Finally, I've got it worked on my OnePlus 8T.
To resolve the issue with "not enough space" on /system_root, /system and /vendor partitions when trying to write a file you need to do following:
1. Reboot to recovery and flash custom kernel with avb check removed. Most of the custom kernels support this feature. Reboot back to system.
2. Reboot to recovery and flash system_rw script with standard size=15. Reboot back to system.
3. Reboot to recovery and flash system_rw script one more time but with size=50. Reboot back to system.
4. Finally mount /, /system_ext, /vendor and /product partitions in rw mode.
Now you can copy and write non-zero files to this partitions.
@lebigmac Thanks a lot for your great job!!! You're the greatest man in the world!!!
P.S. I have KB2000 with OOS 11.0.8.14.KB05BA on board.

Hi @flypatriot thanks for the kind words! Congratulations for getting it to work on your device!
 

bseosbseos

Member
Aug 3, 2021
16
4
@bseosbseos check your mount output:

It looks like it worked! Congratulations!

So, what am i doing wrong here?


EDIT:
So after trying to rename it in adb its giving me this error below. Looks like file is is use and I'm doing something wrong on my end. My bad.

err1.png


I managed to get it working by using adb in recovery buy mounting in TWRP and doing mount -o rw,remount /system_root , and managed to delete the file: privapp-permissions-platform.xml.

but when i tried pushing the local copy of privapp-permissions-platform.xml im getting the folowing error: "write error: no space left on device in system".

Because i cant push this fil emy phone is stuck in bootloop.

EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 
Last edited:

bseosbseos

Member
Aug 3, 2021
16
4
Finally, I've got it worked on my OnePlus 8T.
3. Reboot to recovery and flash system_rw script one more time but with size=50. Reboot back to system.

I will try this and report if it works for me too.

EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Works on a Motorola Moto G30 with super. However, since there is no TWRP for this device and the stock recovery is brain-dead, you have to use the sysrw_repair.sh method and flash with fastboot.
    Code:
    systemrw: Initiating procedure...
    
    systemrw: Device is in Android mode. Ignoring
    systemrw: Current device: motorola
    systemrw: Current Android version: 11
    systemrw: Current SELinux status: Permissive
    systemrw: Current slot is: 0
    systemrw: Your super partition is located at: /dev/block/mmcblk0p75
    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 _a.
    verity is already disabled on slot with suffix _a.
    systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
    systemrw: Please wait patiently...
    
    21102592+0 records in
    21102592+0 records out
    10804527104 bytes (10 G) copied, 160.101076 s, 64 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_a.img in bytes: 857608192
    systemrw: Current size of system_a.img in MB: 817
    systemrw: Current size of system_a.img in 512-byte sectors: 1675016
    
    systemrw: 'shared_blocks feature' detected @ system_a.img
    
    systemrw: Increasing filesystem size of system_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img to 261721 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img is now 261721 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_a.img...
    systemrw: Read-only lock of system_a.img successfully removed
    
    systemrw: Shrinking size of system_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img to 227660 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img is now 227660 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_b.img in bytes: 30310400
    systemrw: Current size of system_b.img in MB: 28
    systemrw: Current size of system_b.img in 512-byte sectors: 59200
    
    systemrw: 'shared_blocks feature' detected @ system_b.img
    
    systemrw: Increasing filesystem size of system_b.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 9250 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 9250 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_b.img...
    systemrw: Read-only lock of system_b.img successfully removed
    
    systemrw: Shrinking size of system_b.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 7259 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 7259 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_ext_a.img in bytes: 649871360
    systemrw: Current size of system_ext_a.img in MB: 619
    systemrw: Current size of system_ext_a.img in 512-byte sectors: 1269280
    
    systemrw: 'shared_blocks feature' detected @ system_ext_a.img
    
    systemrw: Increasing filesystem size of system_ext_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img to 198325 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img is now 198325 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_ext_a.img...
    systemrw: Read-only lock of system_ext_a.img successfully removed
    
    systemrw: Shrinking size of system_ext_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img to 160226 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img is now 160226 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_ext_b.img in bytes: 0
    systemrw: Current size of system_ext_b.img in MB: 0
    systemrw: Current size of system_ext_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Current size of vendor_a.img in bytes: 776093696
    systemrw: Current size of vendor_a.img in MB: 740
    systemrw: Current size of vendor_a.img in 512-byte sectors: 1515808
    
    systemrw: 'shared_blocks feature' detected @ vendor_a.img
    
    systemrw: Increasing filesystem size of vendor_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img to 236845 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img is now 236845 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of vendor_a.img...
    systemrw: Read-only lock of vendor_a.img successfully removed
    
    systemrw: Shrinking size of vendor_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img to 194394 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img is now 194394 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of vendor_b.img in bytes: 0
    systemrw: Current size of vendor_b.img in MB: 0
    systemrw: Current size of vendor_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Current size of product_a.img in bytes: 2554847232
    systemrw: Current size of product_a.img in MB: 2436
    systemrw: Current size of product_a.img in 512-byte sectors: 4989936
    
    systemrw: 'shared_blocks feature' detected @ product_a.img
    
    systemrw: Increasing filesystem size of product_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img to 779677 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img is now 779677 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of product_a.img...
    systemrw: Read-only lock of product_a.img successfully removed
    
    systemrw: Shrinking size of product_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img to 633770 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img is now 633770 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of product_b.img in bytes: 0
    systemrw: Current size of product_b.img in MB: 0
    systemrw: Current size of product_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Joining all extracted images back into one single super image...
    systemrw: Please wait and ignore the invalid sparse warnings...
    
    
    systemrw: Error! failed to create super_fixed.img file. Error code: 73
    There's kernel source for this device but very little else.
    2
    For everyone using RN9 merlin and Lancelot it works. I am on Lancelot with custom rom A11 OSS. You have to put the script in /data/local/tmp and go to recovery and run the script manually using the command: systemrw.sh size=20. Afterwards wipe data and format.

    Then reboot back into recovery (don't boot rom) and flash your rom again. Once rom is flashed please go ahead and reboot to recovery again.

    Once back in recovery please go to mount and select (SYSTEM ONLY!!) Then go to your terminal in your recovery and type: "mount -o remount,rw /system_root" once done flash magisk and your gapps and flash disable encryption last and reboot.
    Screenshot_20210908-102731202 (1).jpg
    Screenshot_20210908-102916853.jpg
    2
    why using yandex. I don't want create a account for downloading
    2
    I really would like to try the script with Redmi Note 9 (miui 12.0.4.0) but the yandex link doesn't work.
    Could you please use some universal file hosting with less limitations, like gdrive, mega, ...

    why using yandex. I don't want create a account for downloading

    New download mirror available on front page ;)
    More official download mirrors coming soon!
    1
    Confirmed working on Moto G Power 2021 (borneo) using the repair script. Beautiful work! Thank you!
  • 95
    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

    *NEW* SystemRW v1.32 *NEW*
    automated bash script by lebigmac for Android 10 and above

    Creation date: February 2021
    Updated: August 2021

    Requirements:
    • rooted STOCK Android 10 or newer (custom ROM should already be R/W!)
    • at least 20 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.

    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 have 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 have super partition
    • flashes read-write-able images back to device using the super fast Kolibass technique (only in recovery mode)
    User data is not affected.

    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.
    Before launching script make sure you've got full read/write access to the /data partition and that /data partition is not encrypted!

    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=`ls -l /dev/block/by-name/super | awk '{print $NF}'` 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.
    The script can be run both inside custom recovery and inside Android operating system. If you run it in Android you will need to fastboot flash the patched image(s) manually!
    Optional arguments: (replace x with your custom value)
    • in=x : *THIS IS IGNORED IF YOU HAVE 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 HAVE 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 HAVE 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:
    Code:
    # Run this command *IF YOU HAVE NO SUPER PARTITION*
    ./systemrw.sh
    
    # Run this command if you're first time user *AND YOU HAVE 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 HAVE 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 HAVE SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15
    
    # EXPERT EXAMPLE:
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` out=./img/super_fixed.bin size=50

    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"

    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!

    NOTE:
    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). So 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 @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 to @Brepro1 for allowing me to basically copy his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Also big thanks @munjeni for allowing me to use his superunpack V1 tool in the previous version. It helped me to understand how these super images work.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the previous version which helped me to create this 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!

    Disclaimer:
    This is open source software and 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 arrise 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.
    The end-user is free to improve the underlying algorithm (as long as no malicious code is added) as well as redistribute this script in his own project as long as the comment and title section of the script (lines #1 - #65) as well as the included update-binary are not modified or removed.

    Please make sure to post your feedback, suggestions and improvements in the official thread right here.
    Enjoy customizing your read-write-able Android device!


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


    1-jpg.5235933


    Confirmed working on these devices :

    Download v1.32 mirror #1
    Download v1.32 mirror #2
    current status:
    experimental
    If you like this project and want to support the developer at finishing this project & creating more amazing projects like this then please feel free to donate to the developer by clicking the link below. Thanks! Your support is very much appreciated!

    Donate
    8
    If the script works on your device please write me your phone model, Android version, script version and if you have super partition or not. Also please send me your log files.

    I will add you to the list of success and it will be helpful for further development. Thank you!
    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!
    5
    I try to redo the procedure, i want to change the size. but i get error, can't remove lock.

    Good news. New hotfix available HERE
    I got rid of that buggy get minimum size function and reworked the size querying algorithm a little bit. Should be more stable now.

    Next step will be to make the script compatible with those devices that have empty partitions embedded inside their super partition...
    Also ronnie was complaining about syntax error but I have yet to find the syntax error... If anyone finds it please let me know so I can fix it. Thank you!
    4
    @lebigmac
    I am happy to say that, all the things went fine with my Realme C12.

    I have removed original super.img right after lpunpack finishes. This makes me use your tool with just 15GiB free space.

    A small thing is that, in your update-binary, please create a dir /data/local/tmp if it does not exist.
    If it does not exist, your tool will fail to install.
    It will be not present if a person clean flashes your tool(wipe data).

    Also system RW works fine, but vendor RW gives operation not permitted.
    Do I need use chattr with the block of vendor?


    Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

    Thanks

    Hello HemanthJabalpuri. Did you actually get my script to work on your device? This is wonderful news.

    Thanks for the suggestion about creating /data/local/tmp folder if it doesn't exist. I will do it in the next version.

    vendor RW gives operation not permitted.
    Do I need use chattr with the block of vendor?


    Operation not permitted? I never seen this error before. Do you get this error in the script or elsewhere?
    Sorry I don't know what is chattr.

    Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

    Thank you very much for this precious piece of advice. Some people have old sh version in their twrp that don't even support basic array functions. Do you think it's possible to bundle my own sh file (that I used for development) with the flashable zip and rule out any sh compatibility issues this way?

    In the next version of the script I would like to remove twrp completely from the requirement list so that everybody can enjoy a system that's read write-able, not only those with twrp. Some devices have no twrp or orange fox available.

    No Orangefox recovery too for Oneplus 7T , unfortunately. Oneplus really messed up 7T's decryption with android 10. I'm hoping for it to fixed with OOS 11 update which too, got delayed because they didn't care for its decryption issues in the first place. Its mind boggling that the 7T doesn't have a working TWRP even after 1 ½ years of being launched.

    Hi shady_soldier
    Yes that kind of sucks I agree. I wish I knew how to actually compile recovery. Too bad I'm only an amateur!
    I tried to compile Xiaomi stock recovery the other day but no luck so far...

    @lebigmac Any chance to uninstall It?
    Thx!!

    Hi Morello12. Did you actually run the script successfully or not?
    Sure simply delete the entire folder /data/local/tmp/makesysrw_1.15c

    But is it a new version or what?
    Does it work without disabling DM-verify?

    No. Disable dm verity and verification is always a good idea!
    @Ayoub$# You could also try flashing an empty vbmeta with fastboot if you can't disable dm verity manually.

    Code:
    fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img