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

Ayoub$#

Member
Mar 15, 2021
46
7
I think the new version of lebigmac will be universal because no one gives us how to format the read and write system. On version 10 or later
I hope this new version will be via phone or windows without twrp
 

lebigmac

Senior Member
Jan 31, 2017
946
561
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!
 
Last edited:

Ayoub$#

Member
Mar 15, 2021
46
7
Hi I run script and it work but partition still read-only on my umidigi . Please help
 

Attachments

  • Screenshot_20210316-173057[1].png
    Screenshot_20210316-173057[1].png
    80.3 KB · Views: 121
  • Screenshot_20210316-164615[1].png
    Screenshot_20210316-164615[1].png
    183.1 KB · Views: 118
  • Screenshot_20210316-164624[1].png
    Screenshot_20210316-164624[1].png
    207.1 KB · Views: 117
  • Screenshot_20210316-164641[1].png
    Screenshot_20210316-164641[1].png
    190.1 KB · Views: 119
  • mylog[1].txt
    7.2 KB · Views: 16
Last edited:
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
946
561
Hi I run script and it work but partition still read-only on my umidigi . Please help
------------------------------------------------------------------------
| makeSystemRW v1.15b automated script (by amateur:) lebigmac @xda ©2021) |
| Thanks @Kolibass @Brepro1 @munjeni @AndyYan @gabrielfrias @YOisuPU |
| without your help this script would not be possible! |
------------------------------------------------------------------------
makesysrw: Custom input detected: ./files/super/super_original.bin
makesysrw: Custom size detected: 100 MB
makesysrw: Phone is in TWRP recovery mode. Initiating procedure...
makesysrw: Your super partition is located at: /dev/block/mmcblk0p34

makesysrw: Unpacking embedded partitions from super...
makesysrw: Nested partitions were successfully extracted from super

makesysrw: Current size of product.img in bytes: 1510412288
makesysrw: Current size of product.img in MB: 1440
makesysrw: Current size of product.img in 512-byte sectors: 2950024

makesysrw: New size of product.img in 512-byte sectors: 3687530
makesysrw: Increasing filesystem size of product.img to 3687530 512-byte sectors...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/product.img to 460941 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/product.img is now 460941 (4k) blocks long.

makesysrw: The filesystem of product.img was successfully resized
makesysrw: Removing 'shared_blocks feature' of product.img...
makesysrw: Read-only lock of product.img successfully removed

makesysrw: Shrinking size of product.img back to minimum size...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/product.img to 362008 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/product.img is now 362008 (4k) blocks long.

makesysrw: Current size of product.img in bytes: 1482784768
makesysrw: Current size of product.img in MB: 1414
makesysrw: Current size of product.img in 512-byte sectors: 2896064

makesysrw: Custom size of product.img in bytes: 1587642368
makesysrw: Custom size of product.img in MB: 1514
makesysrw: Custom size of product.img in 512-byte sectors: 3100864

makesysrw: Increasing filesystem size of product.img to 3100864 512-byte sectors...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/product.img to 387608 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/product.img is now 387608 (4k) blocks long.

makesysrw: The filesystem of product.img was successfully resized
makesysrw: Current size of product.img in bytes: 1587642368
makesysrw: Current size of product.img in MB: 1514
makesysrw: Current size of product.img in 512-byte sectors: 3100864

════════════════════════════════════════════════════════════════════════

makesysrw: Current size of system.img in bytes: 1035304960
makesysrw: Current size of system.img in MB: 987
makesysrw: Current size of system.img in 512-byte sectors: 2022080

makesysrw: New size of system.img in 512-byte sectors: 2527600
makesysrw: Increasing filesystem size of system.img to 2527600 512-byte sectors...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/system.img to 315950 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/system.img is now 315950 (4k) blocks long.

makesysrw: The filesystem of system.img was successfully resized
makesysrw: Removing 'shared_blocks feature' of system.img...
makesysrw: Read-only lock of system.img successfully removed

makesysrw: Shrinking size of system.img back to minimum size...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/system.img to 248135 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/system.img is now 248135 (4k) blocks long.

makesysrw: Current size of system.img in bytes: 1016360960
makesysrw: Current size of system.img in MB: 969
makesysrw: Current size of system.img in 512-byte sectors: 1985080

makesysrw: Custom size of system.img in bytes: 1121218560
makesysrw: Custom size of system.img in MB: 1069
makesysrw: Custom size of system.img in 512-byte sectors: 2189880

makesysrw: Increasing filesystem size of system.img to 2189880 512-byte sectors...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/system.img to 273735 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/system.img is now 273735 (4k) blocks long.

makesysrw: The filesystem of system.img was successfully resized
makesysrw: Current size of system.img in bytes: 1121218560
makesysrw: Current size of system.img in MB: 1069
makesysrw: Current size of system.img in 512-byte sectors: 2189880

════════════════════════════════════════════════════════════════════════

makesysrw: Current size of vendor.img in bytes: 333676544
makesysrw: Current size of vendor.img in MB: 318
makesysrw: Current size of vendor.img in 512-byte sectors: 651712

makesysrw: New size of vendor.img in 512-byte sectors: 814640
makesysrw: Increasing filesystem size of vendor.img to 814640 512-byte sectors...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/vendor.img to 101830 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/vendor.img is now 101830 (4k) blocks long.

makesysrw: The filesystem of vendor.img was successfully resized
makesysrw: Removing 'shared_blocks feature' of vendor.img...
makesysrw: Read-only lock of vendor.img successfully removed

makesysrw: Shrinking size of vendor.img back to minimum size...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/vendor.img to 79958 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/vendor.img is now 79958 (4k) blocks long.

makesysrw: Current size of vendor.img in bytes: 327507968
makesysrw: Current size of vendor.img in MB: 312
makesysrw: Current size of vendor.img in 512-byte sectors: 639664

makesysrw: Custom size of vendor.img in bytes: 432365568
makesysrw: Custom size of vendor.img in MB: 412
makesysrw: Custom size of vendor.img in 512-byte sectors: 844464

makesysrw: Increasing filesystem size of vendor.img to 844464 512-byte sectors...
Resizing the filesystem on /data/local/tmp/makesysrw_1.15b/files/super/vendor.img to 105558 (4k) blocks.
The filesystem on /data/local/tmp/makesysrw_1.15b/files/super/vendor.img is now 105558 (4k) blocks long.

makesysrw: The filesystem of vendor.img was successfully resized
makesysrw: Current size of vendor.img in bytes: 432365568
makesysrw: Current size of vendor.img in MB: 412
makesysrw: Current size of vendor.img in 512-byte sectors: 844464

════════════════════════════════════════════════════════════════════════

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


makesysrw: Successfully created patched super image
makesysrw: Congratulations! Your system, product, vendor etc. are now rw
makesysrw: Rebooting to system...

Hi Ayoub thanks for your feedback.
It looks like the script worked and successfully resized your embedded super partitions. It also looks like it successfully removed the shared_blocks feature of the partitions.
If you run tune2fs -l /dev/block/dm-0 you should be able to verify this.
This is the feature that's causing many stock Android 10+ phones to be read-only.

I really don't know why you still can't mount root as r/w . Anybody know why? Maybe umidigi have double or triple read-only protection?
 
Last edited:
  • Like
Reactions: Ayoub$#

lebigmac

Senior Member
Jan 31, 2017
946
561
try running
mount -o remount,rw /
and at the same time check logcat output. Maybe it gives a hint about what's wrong
 
  • Like
Reactions: Ayoub$#

lebigmac

Senior Member
Jan 31, 2017
946
561
Ayoub I think I know what is your problem. You did not disable dm-verity and verification! Did you check is there Orangefox custom recovery available for Umidigi? Inside custom recovery you can easily disable dm-verity!
 
Last edited:
  • Like
Reactions: Ayoub$#

lebigmac

Senior Member
Jan 31, 2017
946
561
boot into custom recovery and then execute these 2 commands. Try with orangefox if you have no twrp

Code:
adb disable-verity

adb shell avbctl disable-verification
 
  • Like
Reactions: baxal0

lebigmac

Senior Member
Jan 31, 2017
946
561
thank you for listening using that command to mount system as read and write I was able to replace modded framework-res.apk I'm super happy sorry for bothering i did not know the script it was not meant for custom room thabks again for listening and helping.
Even if you're using a custom ROM that is already read write, you should still be able to use my script to resize your partitions inside super. For example you can give each partition 100 MB extra free space or more (system, vendor, product, odm,...).
Or you can use the script to shrink down each partition to its minimum size.
I checked your log file and your snapdragon is compatible with newest version of the script.
 
Last edited:
  • Like
Reactions: Frxhb
Please keep in mind this off-label use of the script is not supported as it was not designed to be run directly in Android. So you are doing this at your own risk!
Yes it's possible by doing 1 or 2 small modifications to the script but you must disable dm-verity and verification either way. This is very easy to do in TWRP by simply running 2 commands (see post #112)
Also you will have to flash the patched image files manually...
And you won't be able to flash the super from within Android using the super fast Kolibass technique! (flash 8GB file in under 30 seconds!). Fastboot flash is a slow turtle compared to that!
If you try to flash system while you're booted into the system you will probably get crash and bootloop. Or you might just get 'device is busy' error. That's why it's recommended to use the script just the way it is from recovery.
Also next version will be installed through flashable zip so it will not be easy to install that directly from Android.

Have you tried searching for Orangefox custom recovery for your device here at XDA subforums?
Yes both orangefox and twrp not available
 

lebigmac

Senior Member
Jan 31, 2017
946
561
Great news! Flashable zip is almost ready! I'll upload it later today. Any volunteers want to beta test the new flashable zip to help me iron out any bugs? Please send me a message. Thanks!

Installing the script has never been this easy. Simply swipe with finger inside TWRP and it's automatically installed to correct location on your phone.
Then it checks a config file for any custom script execution arguments and launches the script with these arguments depending on whether or not your phone has a super partition.

Let me tell you it was not easy to create this flashable zip installer but I had lots of fun learning about this whole flashable zip concept the past few days.
 
Last edited:

lebigmac

Senior Member
Jan 31, 2017
946
561
I'm interested in beta testing your flashable zip.
Thanks so much for your big effort!

HERE is the new flashable zip
Simply flash it in TWRP recovery like any other flashable zip.
You have to disable zip signature verification though. I tried to sign it with zipsigner.jar but without success.

If you want to modify the arguments that are used by the installer to launch the script itself simply extract the .zip and modify the makesysrw_1.15c/config.ini file and make your adjustments and then compress the makesysrw_1.15c and META-INF folders again as a new .zip and flash it.

First line of config.ini contains the arguments for those who have no super partition.
By default this line is completely empty
Here the in=x and out=x arguments will simply be ignored so no need to add them.
Code:

Second line of config.ini contains the arguments for those who do have a super partition on their device. Here is an example for line #2. Remember you need to add an empty space in front like this:
Code:
 in=./files/super/super_original.bin out=./files/super/super_fixed.bin size=50

If you decide to use custom arguments 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 it should be completely empty, no space, nothing.

Please report any bugs thank you!
If it's stable enough I'll add it to the first post.
 
Last edited:
  • Like
Reactions: Frxhb and Ayoub$#

jeryll

Senior Member
Dec 23, 2010
861
688
Realme GT
poco x3 nfc here, everything went smooth and FAST here, good work man, my super is now RW, seems you polished this flashable zip a lot, no errors or warnings on my side, super work! thanks for this, again!
 
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
946
561
lol jeryll I'm glad it worked for you :)
Much smoother than that first version right?
It took me a while to redirect the script output into that pseudo terminal thingy in TWRP.
Did the flashable zip successfully give all your (super) partitions 100 MB of extra free space?
You can check in root explorer in the top left corner if you navigate to root, /vendor and /product
 
Last edited:
  • Like
Reactions: jeryll

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    i use poco m3 rom xtrv hellas....your script is rock..i remove permanently bloatware with root explorer...nice job
    Hi @masricky I'm happy you like the script. Please send me your log files from this folder. Thanks (y)
    /data/local/tmp/systemrw_1.32/log/

    Enjoy tinkering with your fully read/write-able device and make lots of backups before modding stuff! :love:(y)

    Yes it's true. I wrote this script but it wouldn't exist as such without
    Thank you to everyone who contributed positively to this project! :D(y)
    Also keep in mind script is not perfect for all devices out there yet. Rest assured I'm always working hard on next version ;)(y)
    2
    Hi @Flashfire5606 thanks for your log files.
    Hi @Rahamatulla thanks for your interest in this project.
    Please keep in mind that removing shared_blocks read-only feature will duplicate lots of blocks that used to be shared. This will increase size of each partition which is embedded inside your super partition by approximately 200 MB.
    Maybe that's why @Flashfire5606 gets error 70 (insufficient space) despite using size=0 (shrink to minimum).
    I'm sure this can easily be fixed somehow...
    2
    Thanks! It works flawlessly (although I had to do it manually, it's easy enough). My device is a Redmi Note 9S (curtana). If I update my device, do I need to remake the fixed super.img or should I flash the one made before the update?
    Hi @LanceLot9980. Congratulations for getting the script to work on your device! Enjoy a fully read/write-able device! :love:(y)
    If you upload your log files from script folder and a screenshot of your system mounted as r/w then I can add you to the list of successful devices on front page ;)(y)

    @LanceLot9980 yes I noticed your question but I was on the road.
    If you update OTA this will most likely restore the shared_blocks read-only feature on your super partition which means you will have to run script again if you want to go full r/w again ;)
    Thanks! It works flawlessly (although I had to do it manually, it's easy enough). My device is a Redmi Note 9S (curtana). If I update my device, do I need to remake the fixed super.img or should I flash the one made before the update?
    The flashable zip gave you error 255? Don't worry I already fixed this issue in next version ;) Hopefully I can release it soon!
    2
    So while trying to get this script to work again on Redmi 9 I figured out something. @lebigmac if I run the script in recovery then reboot my device to "fastbootd" mode then do the commands fastboot erase system, vendor, product. Then reboot to recovery and reflash my rom I can get vendor and product RW but still no System RW
    Hi again @xda general. You never sent me your log files from script folder...

    Are you sure you can't mount your system as RW after running my script on your Redmi Note 9 (merlin) ?
    Here you said that it works on your device. According to your screenshot you can mount all your important partitions as RW including your system partition:

    Screenshot_20210908-102916854.jpg


    Now compare to my screenshot:
    1-jpg.5235933

    If you don't get the '/dev/block/dm-0' is read-only error that means it works! Congratulations! :love:(y)

    Why would you format or erase your partitions after running my SystemRW script? That doesn't make any sense at all.
    You must only reboot device once after running the script! That's all! ;)(y)

    Have fun debloating and customizing your fully read/write-able device! :love:(y)



    HI and thx. Your script works great.
    I just flashed it from TWRP (I have Super Partition and I didn't change size, default 15)
    It took few mins and all is ok. Now I can get my phone working much better .
    OnePlus Nord 2 (DN2103), android 11
    Thank you very much.
    Hi @jis251
    Thanks for your positive feedback. I'm happy that the script works perfectly on your OnePlus Nord 2 device.
    Have fun debloating and customizing your fully read/write-able device! :love:(y)



    Hi there, I'm running rooted Android 11 on a Moto G Power 2021. I have tried and failed a few attempts both with the initial instructions and also the repair method you have provided. I would like to attempt using the SuperRepack process you linked to in the first post but am not sure how to apply it to your method to make it work. Could you provide some guidance on this and if possible the location of the super.bin file and what needs to be entered in the command line? Thank you and please.
    Hi @JLamp thanks for your interest in this project. I'm sad to hear that you were not able to get the script to work on your Motorola device. Don't worry I'm sure we can get it to work. Please send me your log files from this folder:
    /data/local/tmp/systemrw_1.32/log/
    Hopefully in next version I can finally fix that annoying error 73 that some motorola users experience.
    Sadly I don't have access to a Motorola device or else I could've fixed this annoying issue a long time ago...

    To undo all changes performed by my 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).

    Then it should be no problem to run the amazing superrepack tool by @munjeni on your stock read-only super image. Even though both tools pretty much do the same thing but in a different way (his tool does the job in a much more sophisticated way and on the fly) you should have better luck with his tool because that guy is a real professional. Remember I am only beginner programmer that's why my script is not perfect yet but don't worry I'm constantly working on improving it so please keep your feedback coming. Thanks! ;)



    my friend we are thesame model redmi note 10 pro global miui 12.5.8...
    but for me is working perfectly..
    first thing i did is flash the zip file and give error...
    then i restart my phone after flash the zip...and start to flash again and its working perfectly without error..but sad things i can't remove the system file...then i download terminal emulator and grant permission then i type this code su and hit enter then mount -0 remount,rw /system_root
    after that i restart my phone and its work like a charm....
    what can i do to r/w the vendor...only system are r/w
    Hi again @jhayprince. Your first log looks good. Your second log is empty.
    systemrw: NO 'shared_blocks feature' detected @ system.img
    systemrw: NO 'shared_blocks feature' detected @ system_ext.img
    systemrw: NO 'shared_blocks feature' detected @ product.img
    systemrw: NO 'shared_blocks feature' detected @ vendor.img
    It looks like script successfully removed shared_blocks read-only feature from your most important partitions including /vendor :D(y)

    Please run this code below while device is in Android mode and upload this file here/sdcard/my_tune2fs_output.txt
    Thanks! (y)
    Bash:
    adb shell
    su
    touch /sdcard/my_tune2fs_output.txt
    for i in `seq 0 5`; do tune2fs -l /dev/block/dm-$i>>/sdcard/my_tune2fs_output.txt; done



    @lebigmac Realme Narzo 30 5G
    I can remount to RW almost all important partitions (after I fixed #238 string) and I have the same problem when I used default (size=15) but with size=50 all is working fine for now!
    Thx man!!!

    Here are both logs:
    Hi @Toreton thanks for your log files.
    You replaced this line of code
    if [[ "$imgName" == *"system"* || "$imgName" == *"product"* || "$imgName" == *"vendor"* ]]; then makeRW $fName; fi
    with this line of code?
    makeRW $fName
    That's a great idea! Why only make RW system, product and vendor if you can make them all RW? :D
    I shall make this the default behavior in next version. Thanks for your feedback!(y)

    I'm happy you got everything to work properly after running script a second time with larger custom size (y)
    Have fun debloating and customizing your fully read/write-able device! :love:(y)
    2
    hi and thank's for your work...
    I have an issue with your script, I flash it on twrp on my renoir on A11 LOS and the flash is correct but at the end got these errors messages
    failed to mount system/ext/product/vendor (invalid argument) here are the logs and the ss...

    when I try to copy a .xml on vendor partition got, no more space available and it copy a .xml but empty..
    Hello @rayman95. You're welcome. Thanks for your log files and the screenshot (y)
    Don't worry about this TWRP related error at the very end. This has nothing to do with the script. This only means you must reboot the device. That's all ;)(y)
    Failed to mount '/system_ext' (Invalid argument)
    Failed to mount '/product' (Invalid argument)
    Failed to mount '/vendor' (Invalid argument)

    According to your log it looks like everything worked as expected but I think you must run script again with larger custom size. Which custom size did you use? I can't see it in the log :(
    Hopefully I can release that new version soon. The included auto-resize feature should fix this kind of issue in next version ;)(y)



    it worked great on poco x3 pro, but vendor didn't, when I try to edit an XML located in "vendor/etc/device_features" it doesn't work, even so, thank you very much for the work.
    Hi @Revokke. You're welcome. Thanks for your feedback.
    Please feel free to send me your log files from this folder and I'll have a look at your specific issue. Thanks (y)
    /data/local/tmp/systemrw_1.32/log/

    Which MIUI version number are you using? Official stock MIUI or Xiaomi.eu ROM ?
    What do you mean it doesn't work? I just tried it on my device and it just works. I can create and delete files in this directory /vendor/etc/device_features
    Make sure you remount /vendor partition as rw before copying or deleting files.
    If you can only write empty files to /system, /product or /vendor that means you must run script again with larger custom size. Good luck! (y)
  • 111
    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© v1.32 by lebigmac

    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:
    • Extract BUNDLE.zip (the included sysrw_repair.zip is only for fixing error 73!)
    • Before launching script make sure you've got full read/write access to the /data partition by first decrypting and then mounting /data partition as R/W!
    • 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)
    • 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 these commands in Android:
      Bash:
      adb shell
      su
      touch /sdcard/my_tune2fs_output.txt
      for i in `seq 0 5`; do tune2fs -l /dev/block/dm-$i>>/sdcard/my_tune2fs_output.txt; 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=`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.
    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=`ls -l /dev/block/by-name/super | awk '{print $NF}'` 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 @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.
    Big thanks @munjeni for allowing me to use his 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!

    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 - #65) 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 my variables and more...) only to rename and republish my SystemRW project (or parts thereof) as his / her own without even mentioning original source or original credits!!! (yes this actually happened :( perpetrated by a fellow forum member...)
    • Unauthorized re-uploads of any files contained within this project to 3rd party websites are not permitted without the original author's prior consent!
    • 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 project thread @ xda-developers.com
    • If the end-user wants to integrate my SystemRW project into his/her own project then he/she shall first ask me (the original author) for permission.
      If you want to make a video tutorial about my script 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_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
    more official download mirrors coming soon!
    current status: experimental


    If you like this project and want to support further development of SystemRW & the creation of more amazing projects like this then please feel free to donate to the developer by clicking the button below. Thanks! Your support is very much appreciated!
    Donate
    12
    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!
    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!