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

gearmaker

Senior Member
Oct 7, 2012
63
33
Boise, Idaho
Well, what a nice surprise! I tried running your latest script 1.32 again, this time flashing in twrp.
It worked! On my Oneplus HD1913 7T Pro McLaren. My system is finally R/W !
Thank you so much for your efforts! By the way, what is COW error on Oneplus?
I will upload my logs in case you want to take a look. I entered the mount remount text in terminal
and it confirmed. I was also able to edit a file in /system/app/ which I was never able to do before.
Thanks again:)
Edit: This is stock OOS 10.0.13
Screenshot_20210726-203324.png
 

Attachments

  • mylog.txt
    10.1 KB · Views: 7
  • lpdump.txt
    3.3 KB · Views: 13
Last edited:
  • Love
Reactions: lebigmac

flypatriot

Senior Member
Jul 24, 2018
69
36
OnePlus 8 Pro
OnePlus 8T
Flashed script through TWRP recovery in OnePlus 8T (stock OOS 11.0.8.13).
Everything has gone well and I can mount system in rw mode as a result.
I can't modify or write files in system partition however cause of not enough space error.
Tried to flash with size 100 and 500 mb but no luck.
There is also 0 bytes super_original.bin image in img folder after successful flash (I've disabled CleanUp function to check everything is fine).
Maybe it'll be useful for researching.
 

Attachments

  • mylog.txt
    6.1 KB · Views: 9
  • lpdump.txt
    2.6 KB · Views: 9
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
867
505
Well, what a nice surprise! I tried running your latest script 1.32 again, this time flashing in twrp.
It worked! On my Oneplus HD1913 7T Pro McLaren. My system is finally R/W !
Thank you so much for your efforts! By the way, what is COW error on Oneplus?
I will upload my logs in case you want to take a look. I entered the mount remount text in terminal
and it confirmed. I was also able to edit a file in /system/app/ which I was never able to do before.
Thanks again:)
Edit: This is stock OOS 10.0.13
View attachment 5371441

Hi @gearmaker thanks for your log files!
That's great news! I'm happy the script works on your OnePlus device!
If you check the lpdump.txt by flypatriot above, you will notice COW group with 0 bytes size but if you check his mylog.txt you can see that the contents of COW have a very large size. This has caused an error since first version of script. I can't believe it's now finally fixed! It was very difficult for me to fix this because I don't own OnePlus device...

Flashed script through TWRP recovery in OnePlus 8T (stock OOS 11.0.8.13).
Everything has gone well and I can mount system in rw mode as a result.
I can't modify or write files in system partition however cause of not enough space error.
Tried to flash with size 100 and 500 mb but no luck.
There is also 0 bytes super_original.bin image in img folder after successful flash (I've disabled CleanUp function to check everything is fine).
Maybe it'll be useful for researching.
Hi @flypatriot thanks for your feedback.
Are you saying that v1.32 of script actually works as expected on OnePlus 8T device despite your device having COW group with 0 bytes size in lpdump.txt ?

So everything works except custom size? You can mount /, /product and /vendor as r/w now?

Did you try with very small custom size such as size=15 ?
 
Last edited:
  • Like
Reactions: gearmaker

flypatriot

Senior Member
Jul 24, 2018
69
36
OnePlus 8 Pro
OnePlus 8T
Hi @flypatriot thanks for your feedback.
Are you saying that v1.32 of script actually works as expected on oneplus 8t device despite your device having cow group in lpdump.txt ?

So everything works except custom size? You can mount /, /product and /vendor as r/w now?

Did you try with very small custom size such as size=15 ?
Yes it is! Script works with cow group. /, /product and /vendor partitions mount as r/w. However I can't write to this partitions. Only create 0 byte (empty) files. When I try to write some code in such files I always get error about not enough space on partition.
I tried to flash script with size=15 (preinstalled config file in your script) first but it didn't work. So I changed it to 100 and then to 500 but it didn't help. And I restored super partition every time I changed the size to be sure that everything is clear.
 
  • Wow
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
867
505
Yes it is! Script works with cow group. /, /product and /vendor partitions mount as r/w. However I can't write to this partitions. Only create 0 byte (empty) files. When I try to write some code in such files I always get error about not enough space on partition.
I tried to flash script with size=15 (preinstalled config file in your script) first but it didn't work. So I changed it to 100 and then to 500 but it didn't help. And I restored super partition every time I changed the size to be sure that everything is clear.
Thanks for this confirmation. That means cow error is finally fixed. I still can't believe it!
That's great news for all OnePlus users!
@BlazingKahn35 @Greenspoof @abszy @rakoncwy @xatornet @Abuzar Uzair

Until I fix the custom size issue for OnePlus users, you can remount / as r/w and try deleting some system apps to free up some space. Be very careful though. One little mistake can cause bootloop. Try disabling some useless system apps first and reboot device to double check if it's safe to permanently delete. Make backups just in case. Good luck!
 
Last edited:
  • Like
Reactions: Yevgen.A

gearmaker

Senior Member
Oct 7, 2012
63
33
Boise, Idaho
Hi @gearmaker thanks for your log files!
That's great news! I'm happy the script works on your OnePlus device!
If you check the lpdump.txt by flypatriot above, you will notice COW group with 0 bytes size but if you check his mylog.txt you can see that the contents of COW have a very large size. This has caused an error since first version of script. I can't believe it's now finally fixed! It was very difficult for me to fix this because I don't own OnePlus device...
My logs have no mention of COW. Maybe not all OnePlus devices are affected?
Again, great work and thank you!
 
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
867
505
I think I saw some Xiaomi devices start to use 0 byte COW group recently.
Somebody said it's the same cow as in dirtycow.
I wonder if the OnePlus users will get bootloop later down the road due to missing cow group? :unsure:
I'm thinking this whole COW thing has something to do with slot A/B devices...
 
Last edited:

DeathShot9

Senior Member
Sep 4, 2015
64
15
Boston
I think I also saw some Xiaomi devices start to use 0 byte COW group recently.
Somebody said it's the same cow as in dirtycow.
I wonder if the OnePlus users will get bootloop later down the road due to missing cow group? :unsure:
I'm thinking this whole COW thing has something to do with slot A/B devices...
It does. I think it has to do with A/B and their encryption thing. I remember trying to install Lineage OS with TWRP on a One Plus 6 I fixed for my father, and I kept hitting a wall.
 
  • Like
Reactions: lebigmac

Pcsl

Member
Jul 14, 2010
24
5
Thank you very much for your software.

I'm getting this error saying that my partitions are already writable on my OnePlus 6T, but they are not.

systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: OnePlus
systemrw: Current Android version: 10
systemrw: Current SELinux status: Permissive
systemrw: Unable to locate super partition on device. Ignoring
systemrw: /system is already R/W capable. Ignoring
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
/sdcard/systemrw_1.32/systemrw.sh[454]: ./tools/avbctl: inaccessible or not found
/sdcard/systemrw_1.32/systemrw.sh[454]: ./tools/avbctl: inaccessible or not found
systemrw: Partition detected -> system_a @ /dev/block/sda13
systemrw: NO 'shared_blocks feature' detected @ system_a. Ignoring
systemrw: Partition detected -> system_b @ /dev/block/sda14
systemrw: NO 'shared_blocks feature' detected @ system_b. Ignoring
systemrw: Partition detected -> vendor_a @ /dev/block/sde16
systemrw: NO 'shared_blocks feature' detected @ vendor_a. Ignoring
systemrw: Partition detected -> vendor_b @ /dev/block/sde44
systemrw: NO 'shared_blocks feature' detected @ vendor_b. Ignoring
systemrw: There was a problem removing read-only restriction(s) of your device. Abort

Any tip to make it actually R/W?
 
  • Sad
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
867
505
@Pcsl what output you get if you run these commands?

1-jpg.5235933


Try commands above with /system, /product and /vendor and show me screenshot. Thanks.
Good luck!
 
Last edited:

cass89

Member
Jan 17, 2013
29
3
Trying to run this on one plus 9 5g global
running the sh script seemed to work, I now have super_original.bin and super_fixed.bin
How do I flash it? I'm assuming just
"fastboot flash super super_fixed.bin"?
Then if it doesn't work reflash super_original.bin?
Can it be flashed with TWRP?
Don't want to brick my device lol, has anyone with OP9 tried this yet? What are the chances that super_original.bin is corrupted or won't flash, is there another way to backup my super img?
 
Last edited:
  • Like
Reactions: lebigmac

phanimitra vadlamani

Senior Member
Oct 26, 2016
51
3
failed agian with latest version.....thankfully without errors.....
it says already r/w capable......but they are not😭....im desperate to remove useless system apps
 

Attachments

  • Screenshot_2021-07-28-12-59-00.png
    Screenshot_2021-07-28-12-59-00.png
    282.4 KB · Views: 25
  • Screenshot_2021-07-28-13-09-30-039_com.termux.jpg
    Screenshot_2021-07-28-13-09-30-039_com.termux.jpg
    319.2 KB · Views: 26
  • Screenshot_2021-07-28-13-05-52.png
    Screenshot_2021-07-28-13-05-52.png
    208.1 KB · Views: 25
  • mylog.txt
    4.8 KB · Views: 9
  • lpdump.txt
    1.1 KB · Views: 4
  • Wow
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
867
505
failed agian with latest version.....thankfully without errors.....
it says already r/w capable......but they are not😭....im desperate to remove useless system apps
Hi @phanimitra vadlamani thanks for your log.
It's not 'shared_blocks feature' that's preventing your device from being mounted as r/w. There must be another 'protection feature' that's stopping you from going fully r/w.

I like how you used my script to resize your partitions that are embedded inside your super image! Good job! And device still boots to system! What a surprise!
Did you use the default size=15 custom size value in config.ini when you flashed the flashable zip in recovery?

If you run script again with size=50 you can add 50 MB of free space to each partition (/system, /product, /vendor) inside super partition.
 
Last edited:

lebigmac

Senior Member
Jan 31, 2017
867
505
@lebigmac check this thread out. I was reading through this and this is familiar being that if I run your script it fails to make super_fixed. I have a edge plus with super and A/B. I noticed that the output has empty "b" images from the super. Here is a screenshot and link. I hope it helps! I desperately want this to work on my device but so far no luck. Thank you for your work.

Thread '[GUIDE] OTA Tools LPUnpack' https://forum.xda-developers.com/t/guide-ota-tools-lpunpack.4041843/View attachment 5349463
Hi @tha_mechanic what exactly do you mean by this? Script is specifying current slot to lpunpack at runtime.

@lebigmac here is my log. I can't get it to work. I have tried flashing the individual images but it bootloops. Can't get the super_fixed because of error. And I have absolutely no clue on using Linux lol. So I can't figure out how to use the fix Linux script. I've been ripping my hair out trying to get something to work but I'm at a loss
Are you getting the error 73 that many Motorola and some Xiaomi users are experiencing?
You can fix it with troubleshooting repair script version 1.32 or with @harpreet.s slot switching method (see first post troubleshooting section)



I'm not alone! My apologies, but it's a relief. I'm stuck at the same spot.
Hi @Keven11 please see my answer to @tha_mechanic above. Same thing applies to you. Did you guys try troubleshooting repair script version 1.32 on a Linux device yet?

I'm sure there's got to be another easy way to fix error 73 on the device itself without having to patch your kernel.



Doesn't work on Xiaomi mi10T lite. :(
Hi @xiaomieu. Did you try latest v1.32 yet? What results do you get on your Xiaomi device?



Hello thank you i mean not working still have read only
@veerjalil Please send me your log files from this folder : /data/local/tmp/systemrw_1.32/log/



That's what I did ?

That's what I did ? I wrote the result on my previous comment, it was made manually. After running 1.31d then your solution, I got as result : : Invalid sparse file format at header magic and no super_fixed.img in IMG folder.
If I run your solution only, without running 1.31d before, I have as result: first solution : can't create ./IMG/system_a-cow.img : No such file or directory
On second solution : ./tools/lpmake : can't execute : permission denied.
Hi @Greenspoof did you try installing the flashable zip (latest version 1.32) in recovery?



I ran the script in twrp
but I got the error code 73 (like so many other people)
at that point the script had extracted the individual partitions but not rejoined them
so I ran linux on a thumb drive, and used lebigmac's repair file
that created the "fixed" super .bin file
I then flashed the fixed bin back to the phone with a windows PC running ADB fastboot (because fastboot was not recognizing my device in linux, after the phone rebooted)

I only have a loose idea how any of this works, and I can not do anything without concrete examples.
I should have resized my partitions, but do not know how.


*FYI - it does seem like deleting files does free up room. After deleting a system wallpaper file, I was able to copy a file to the system partition

That seems sound. Because I can delete, rename, and create new zero sized files.
But I dont know anything about scripts or coding. Do I need to start over, Or can I modify the partitions as they are now?

*also, if I delete existing system files, will that create free space?

Hi @joetbd. Congratulations for fixing error 73 successfully by first launching the script on the phone itself and afterwards running the troubleshooting repair script on a linux device. And then flashing the patched super image to your device. I know it's not the perfect solution but hey, as long as it works, right?

Yes you can delete useless system bloatware to free up some space that way. But it's very risky!
You can first disable system app, do a reboot and check for bootloop and other errors. Then you can delete it if you really want to (make a backup though!). Good luck!

Or to increase space in / you can just run script again like this:
extract flashable zip
open config.ini with text editor
write this in line #2 of config.ini and then save file
size=50 in=`ls -l /dev/block/by-name/super | awk '{print $NF}'`
You can play around with the size parameter here. Just make sure first character of line #2 is an empty space!
Now compress both META-INF and systemrw_1.32 folders into a new flashable zip (random file name)
And install this new flashable zip in your custom recovery. It should launch script without dumping super image again. This should save you some time.



I managed to make system rw, i have super partition , and i have a Xiaomi mi 11 lite 4g with android 11. I added 500 MB free space to add a new boot Image and other. Great job!
P.S. I have run the script manually via adb because on twrp It gave me error 6. But maybe Is because i have an unofficial xda's twrp in alpha version.

Hi @LORENZ123456 I'm happy the script works on your Xiaomi Mi 11 lite 4G with Android 11.
Thank you for the kind words.

Next time try install new flashable zip version 1.32, error signal 6 should be fixed!



@lebigmac, im testing this for mi 11 lite 5g, the super_fixed.bin file is generated, but after flashing the file i can not boot into the system, it boots back into fastboot. I have tested both shrinked to minimum (0) and with an extra memory free (15).

any tips for this issue?

munjeni's superrepack tool results in a boot-loop aswell, I searched thru his thread it seems that there are other devices that do not boot aswell even after the scripts/tools have been successful. I suspect its a security feature, perhaps kernel side. I guess in conclusion, your script and munjenis tool both work, whatever is causing the bootloop is something else. For now mark this device as unbootable as reference for others. Anyways, thank you.
Hi @version-x. Thanks for your in depth feedback!
Did you try restoring your original vbmeta or using the included avbctl binary to re-enable dm-verity and verification after flashing patched super image? Maybe it just works? Sometimes messing with the vbmeta can cause a bootloop all by itself! Good luck!
 
Last edited:
Hi @tha_mechanic what exactly do you mean by this? Script is specifying current slot to lpunpack at runtime.


Are you getting the error 73 that many Motorola and some Xiaomi users are experiencing?
You can fix it with troubleshooting repair script version 1.32 or with @harpreet.s slot switching method (see first post troubleshooting section)


Hi @Keven11 please see my answer to @tha_mechanic above. Same thing applies to you. Did you guys try troubleshooting repair script version 1.32 on a Linux device yet?

I'm sure there's got to be another easy way to fix error 73 on the device itself without having to patch your kernel.


Hi @xiaomieu. Did you try latest v1.32 yet? What results do you get on your device?


@veerjalil Please send me your log files from this folder : /data/local/tmp/systemrw_1.32/log/
Yeah, I got it working on Moto G9+ (Odessa) using the repair script (1.31d). What have you changed in the new 1.32 script? I am just curious.
 
  • Like
Reactions: lebigmac
@lebigmac

Hey remember I messaged you a while back and posted on this thread that I did get it to work successfully. I also added a step by step on how I got it to work a few pages back. I believe @Keven11 got it to work as well
I did indeed get it working. I just installed Linux Mint on my old laptop. My issue wasn't so much that I don't know how to use Linux. I was having a hard time navigating the windows file system using the Linux UI. Once I had a full Linux environment as opposed to a VM it wasn't a problem.
 
  • Haha
Reactions: lebigmac

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    is there any tutorial on how to use sysrw_repair_v1.32 ? :

    1- Sorry for spamming the thread.
    2- Thank you Keven11 and lebigmac
    3- Finally I got it, first flashed the stock rom (android 11) and started it just to create the /data/media/ folder. Right after that I turned off the device, flashed the twrp and magisk, and placed the systemrw_1.32 in the /data/local/tmp/ folder. I started the script from the twrp terminal "sh /data/local/tmp/systemrw_1.32/systemrw.sh size=15. After getting the error "73" screen, I started sysrw_repair_v1.32 in vmware emulating linux mint... And everything went really well! :)

    View attachment 5425517
    It is definitely a journey. Well worth the work, and time invested in then end. Also, it helps many people understand their devices just that much more. I am glad that you were successful.

    Also, everytime a person manages to get this to work for themselves, and explains how they did. That alone helps many others. So thank you for putting in the work, and sharing your experience.
    2
    1- Sorry for spamming the thread.
    2- Thank you Keven11 and lebigmac
    3- Finally I got it, first flashed the stock rom (android 11) and started it just to create the /data/media/ folder. Right after that I turned off the device, flashed the twrp and magisk, and placed the systemrw_1.32 in the /data/local/tmp/ folder. I started the script from the twrp terminal "sh /data/local/tmp/systemrw_1.32/systemrw.sh size=15. After getting the error "73" screen, I started sysrw_repair_v1.32 in vmware emulating linux mint... And everything went really well! :)

    c74256c2706c6e8f74e5858e4aa85f57.gif
    2
    Thanks. But you can tell in more detail. Where to get the super_original.bin and super_fix files. Please write detailed instructions.
    this script have 2 mode one is from recovery flash as zip second have run it in android environment.
    if you run this in recovery then it patch and flash super automatically.
    second if you run it in android environment with as mention location of /data/local/tmp/here_your_script_folder/here_script.sh then it create a "img" folder inside of script folder then pull super from your device make a backup and rename that to super_orignal.bin then extract that super and patch r/w capability then make that again super and rename it as super_fix.img so simply you get two bin files inside "img" folder
    if you wanna r/w your device flash super_fix.img from bootloader.
    if you wanna go back to original state "flash super_orignal.bin" from bootloader.
    directory tree will like this :-
    data/ ├─ local/ │ ├─ tmp/ │ │ ├─ systemrw_1.32/ │ │ │ ├─img/ │ │ │ │ ├─super_orignal.bin │ │ │ │ ├─super_fix.bin │ │ │ ├─ tools/ │ │ │ ├─ config.ini │ │ │ ├─ systemrw.sh
    thanks this for @The_Tablet
    That's it!
    1
    Hola, [USER = 11816235] @Ricardo Cruz [/ USER]. Envíeme sus archivos de registro desde esta carpeta. Gracias.
    /data/local/tmp/systemrw_1.32/log / [/ ICODE] Simplemente conecte el teléfono a la computadora usando un cable usb-c a usb-a. [URL='https://forum.xda-developers.com/t/script-android-10-universal-mount-system-read-write-r-w.4247311/page-23#post-84901531'][B]Aquí[/B][/URL] puede encontrar las instrucciones oficiales del script de reparación de resolución de problemas (solo Linux). [/QUOTE] Hello, sorry for the delay, I imagine that these are the files that you ask me [/QUOTE]
    1
    Frankly, your log looks weird. It is not clear how the script can reports about the super partition, if Pixel 4 stock images DON'T have it. Also it doesn't have the
    '/dev/block/by-name/super' file!
    I've been using it for a long time, here are some videos before and after I used it
    Before I could install it automatically using flashable zip, I followed the instructions here: (and it works on both Android 10 and 11):
    Do you use "Magisk" for rooting?
    Did you run just ./systemrw.sh without parameters?
    - Yes i used Magisk to root
    - I simply downloaded and flashed the zip file with TWRP
  • 100
    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 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.

    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)
    User data is not affected.

    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!
    • 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"
    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

    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 experience bootloop after successfully flashing super_fixed.bin then your device probably has additional protection features that prevent it from booting modified super images. Try to undo bootloop simply by flashing original stock super image. You might have to flash stock vbmeta as well. 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.
    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:
    #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 any files included in this project be re-uploaded to 3rd party websites without the original author's explicit consent. That means NO RE-UPLOADS of my files please! Thank you!
    • Under no circumstances shall the end-user disrespect, abuse or steal my project for his own disturbed purposes! The end-user also agrees not to steal my program logo or program name or the names of my functions and variables (and more) only to re-publish them as his/her own without even mentioning the original source.
    • The end-user is encouraged to improve the underlying algorithm (as long as no malicious code is added) and post his/her modifications, results and feedback right here in the official SystemRW project thread @ xda-developers.com
    • If the end-user wants to re-publish my work in 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
    current status:
    experimental
    If you like this project and want to support further development of this project & the creation of 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
    9
    If the script works on your device please send me your log files from this folder:
    /data/local/tmp/systemrw_1.32/log/

    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!
    4
    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.