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

james28909

Senior Member
Mar 27, 2016
90
9
Android 10 has a system trace. I'm not sure if that was implemented on Oreo. That would be a start.

It might be as simple as you got a screwy device that was bugged out. It could be a update gone wrong that the device forced. You'll know when the replacement unit comes. Until then I probably wouldn't try the script - you don't know if that is going to make it skittish even more (even though it would produce error logs).
Personally, I think it is functioning as intended. It is not in the best interest of this company to allow modification of the device to allow recovery of proprietary data or information in regards to how the device works. If you can unlock other functions via simple software edits in some file then it would be of the companies best interest to try and protect all of that somehow. I bet the other unit is going to be identical in terms of read/write in system. The new one might be on an older firmware/api, but I'm willing to bet it will act the same as this one.
 

drdani335

New member
Dec 6, 2018
4
0
haha nice detective work sir!

simply go to line #99
and comment it out by putting # symbol in front like this
Bash:
#currentSize=$(stat -c "%s" $1)

now uncomment line #100 by removing # symbol like this:
Bash:
currentSize=$(wc -c < $1)
excellent, i did it and it finally finished with a message saying Congratulations...
but when it reboots the system partition is still read-only. the twrp and magisk are in place and i have su but "mount -o rw,remount /" says it's read-only and the partition can't be written. i've tried it multiple times with the same result. what should i do ?
 
  • Wow
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
931
554
Hi @drdani335 it looks like you reached the end of the script. Feel free to send me your log files so I can see what exactly happened.
You are aware that there is a new stallion in town right?
I think my script require 1 or 2 small updates to improve compatibility with more devices and then it should be finished and I can finally put it on the shelf

Hi All, It is odd but thats how it is working for me -

For phones with A and B partition , one way to make it work is upgrade both partitions to same version, make partition B as active and then run script fresh that will work perfectly.

Or just make partition B as active and then run script fresh that can also work.

When partiton A is active, this is the failure.

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

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


makesysrw: Error! failed to create super_fixed.img file


No change , only swap active partition to B , and it is success !!
========================================================================

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

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

makesysrw: Successfully created patched super image @
makesysrw: /data/local/tmp/makesysrw_1.24/files/super/super_fixed.bin
makesysrw: Congratulations! Your images should now be rw
makesysrw: Please reboot into bootloader and flash the file(s) manually
#

Slot swapping can be done from fastboot -
#command to check current active
.\fastboot.exe getvar current-slot

#command to swap , below will set active slot to b
./fastboot --set-active=b

Thanks @harpreet.s for sharing this interesting discovery and your workaround. I still don't know what exactly is causing this issue but I will try to wrap my head around it :D
 
Last edited:
  • Like
Reactions: drdani335

harpreet.s

Senior Member
Oct 27, 2012
152
47
excellent, i did it and it finally finished with a message saying Congratulations...
but when it reboots the system partition is still read-only. the twrp and magisk are in place and i have su but "mount -o rw,remount /" says it's read-only and the partition can't be written. i've tried it multiple times with the same result. what should i do ?
It would be worth trying a different busybox or use a root file explorer to check if it can mount the partition as rw.
 

S8Mate

New member
Oct 21, 2017
3
0
I installed the 1.24 zip with TWRP and it appeared to work without any errors that I saw, but my phone restarted itself afterward and now it takes me straight to the fastboot menu instead of starting up the phone. When I try to flash anything else in TWRP now (Backup, Stock Firmware) I get 2 error lines at the start of the flashing and it fails:
Failed to mount '/product' (Invalid argument)
Failed to mount '/vendor' (Invalid argument).
So I seem to be bricked.

The device is Motorola Edge
 

lebigmac

Senior Member
Jan 31, 2017
931
554
Hi S8Mate. Sad to hear that. Please share your log files which are next to the script thanks!
Also a screenshot would be nice.

Are you using Samsung?
Got a super partition?

If your device is bricked simply reboot into bootloader and flash your stock super image again.
fastboot flash super super.img

You could also unbrick your device from recovery.
 
Last edited:

S8Mate

New member
Oct 21, 2017
3
0
I'm on Motorola Edge, and I do not know if I have a super partition. Should the log files have been created on the SD card? I don't see anything new on there.

Upon trying to flash in fastboot it is not recognizing my device as connected, maybe because it is not in debug mode? But I can't turn on debug mode because I can't start up the OS. When I try to flash anything in TWRP, I get the errors seen in the attachment.
 

Attachments

  • 20210404_121114.jpg
    20210404_121114.jpg
    541.6 KB · Views: 107

lebigmac

Senior Member
Jan 31, 2017
931
554
What's debug mode?
The log files should be in the script folder in /data/local/tmp/

I know an easy way to restore your system if you've got a backup. You do have a backup right?
Check your PM
 
Last edited:

drdani335

New member
Dec 6, 2018
4
0
Hi @drdani335 it looks like you reached the end of the script. Feel free to send me your log files so I can see what exactly happened.
You are aware that there is a new stallion in town right?
I think my script require 1 final update to improve compatibility with more devices and then it should be finished and I can finally put it on the shelf
after a few tests I was able to write to system partition while in twrp and using adb shell. but the device went on a boot loop afterwards. i tried flashing vbmeta.img, disabling verity and verification, wiping data and cache, i even uninstalled magisk in twrp using magisk uninstaller but it wouldn't boot to system. at the end i flashed stock boot.img and recovery.img but it still doesn't boot up. it just keeps trying to boot, shows the logo for a few minutes, but goes back to recovery. is there anything i can do without flashing the whole rom ?

regarding the "new stallion" you mentioned, i checked and apparently the author has deleted the attachments and asked everyone not to use it since it has some serious bugs.
 

lebigmac

Senior Member
Jan 31, 2017
931
554
Thanks for your hard work!

I am waiting the timer end to unlock my Xiaomi device but very eager to try your script. Does your script mean i can use root required apps without magisk's modules?

Hi @Kurtsu thanks for your interest in this project.
Once you've got full r/w access to your device you should be able to push your own custom su binary to your system and you can root your device that way.

after a few tests I was able to write to system partition while in twrp and using adb shell. but the device went on a boot loop afterwards. i tried flashing vbmeta.img, disabling verity and verification, wiping data and cache, i even uninstalled magisk in twrp using magisk uninstaller but it wouldn't boot to system. at the end i flashed stock boot.img and recovery.img but it still doesn't boot up. it just keeps trying to boot, shows the logo for a few minutes, but goes back to recovery. is there anything i can do without flashing the whole rom ?

regarding the "new stallion" you mentioned, i checked and apparently the author has deleted the attachments and asked everyone not to use it since it has some serious bugs.

Hi @drdani335 Please send me all log files in script folder if you want me to investigate the issue.

The script worked and you can mount system as r/w in recovery but now you have a bootloop issue?
What did you change in system? Even the smallest change to init.rc, default.prop or other system files can be enough to cause bootloop...

Did you use the latest v1.24 ? In your screenshot it says v1.22

If you can't fix the bootloop from recovery simply flash original super again and try again with v1.24
fastboot flash super super.img

In next version of the script I will try to implement a feature that automatically creates log file.
 
Last edited:

Rezrex

Member
Oct 9, 2018
19
14
Suggestion.
Remove the reboot to system and replace with exit. I updated my phone and after updating I rebooted to twrp and flashed the zip. Process completed without error but left my data partition encrypted/unmountable. Had to format data (i had a backup) in twrp to be able to boot the os. Not sure what caused it to happen, definitely something with my twrp. I did find however removing reboot system from the script and running the exit command in twrp terminal prevents this from occuring. Exit from the script afaik does not.
 
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
931
554
I will remove automatic reboot in next version. @Francescohub also suggested this. Thanks for feedback.

EDIT: new v1.26 uploaded to first post
Not much has changed since last version. I added automatic logging capability. Now log will automatically be saved to /data/local/tmp/makesysrw_1.26/mylog.txt
Automatic reboot has been disabled
code was cleaned up a little bit

I have not yet figured out why some folks get error 255 when flashing zip in recovery?
Also have not yet fully understood why script works on some A/B devices but others not.
If you've got A/B device and script fails with lpmake error try this workaround discovered by @harpreet.s

And @uvzen has discovered that you can only use custom size up to a certain point with the size parameter.
For example size=100 works great with Xiaomi devices to give 100MB extra space to each embedded partition but as soon as you use size=1024 or greater this will likely cause lpmake error at the end because the files simply won't fit into the super partition anymore.
For some Oppo devices even size=100 is too much! In next version I will change this to size=50 by default
 
Last edited:
  • Like
Reactions: SmartphoneOwner

Christos2714

Member
Jan 22, 2017
24
6
makeSystemRW v1.26
automated bash script by lebigmac for Android 10 and above

Creation date: February 2021
Updated: April 2021

Requirements:
  • STOCK Android 10 or newer (custom ROM should already be read-write!)
  • Custom recovery is recommended but no longer required in latest version
  • 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.

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 BOTH TWRP AND ORANGEFOX!)
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 makesysrw_*VERSION*/config.ini file and make your adjustments. Then compress the makesysrw_*VERSION* and META-INF folders again as a new .zip and install it.
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 and want to skip that process next time you install the .zip then put this in line #2 of config.ini :
Code:
 in=./files/super/super_original.bin size=100
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.
If you've got a super partition I would recommend using the optional size=100 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 images 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 makesysrw or the official unsparsed super.img from your downloaded firmware. (unsparse with simg2img)
    If omitted, makesysrw will dump super image from phone to ./files/super/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 ./files/super/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.
    If omitted, default extra size is 0 (shrink to minimum)
Examples:
Code:
# Run this command *IF YOU HAVE NO SUPER PARTITION*
./makesysrw.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:
./makesysrw.sh size=100

# Plug an existing super image into the script like this *ONLY IF YOU HAVE SUPER PARTITION*
./makesysrw.sh in=./files/super/super_original.bin size=100

# Specify both the input file as well as the output destination *ONLY IF YOU HAVE SUPER PARTITION*
./makesysrw.sh in=./files/super/super_original.bin out=./custom/path/super_fixed.bin size=100

To check whether or not you've got a super partition on your device you can run this command:

Code:
adb shell "ls -Alg /dev/block/by-name | grep 'super'"

Troubleshooting:
If you get error 255 when trying to install flashable zip then try to install it manually.
Make sure the script folder was correctly extracted to:
/data/local/tmp/makesysrw_*VERSION*
If you can't run the script try making the file executable like this: chmod +x ./makesysrw.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 coincidentally 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 8GB 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.
More thanks @gabrielfrias for his helpful comment
Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'

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 or negative consequences that may arrise from the (inappropriate) use of this software.
All responsibility and liability lies with the end-user. You hereby agree not to abuse this software for illegal purposes. Use this software at your own risk!

Please feel free to improve this script as you see fit (as long as you don't add anything malicious).
And make sure to post your feedback, suggestions and improvements in the official thread right here.
If you decide to use my work in your project please send me a message and include a link to this official thread in your project. Thank you.


makesysrw_1-21_01-jpg.5264625
makesysrw_1-21_02-jpg.5264627
makesysrw_1-21_03-jpg.5264631

01-jpg.5259863
03-jpg.5259867


1-jpg.5235933


God bless you!
Works like a charm on Doogee S96Pro android 10.
After makong super.img rw I have to put stock recovery and do a factory reset. After that put TWRP again. If I dont do that han I get a TWRP loop.
Thanks again!!!
Keep up the good work!!!
 

m3nty

New member
Dec 19, 2015
3
0
Error! Failed to create super_fixed.img file

Moto g stylus Android 10

Screenshot from twrp:
 

Attachments

  • Screenshot_2021-04-10-10-08-42.png
    Screenshot_2021-04-10-10-08-42.png
    159.6 KB · Views: 90
  • Wow
Reactions: lebigmac

Top Liked Posts

  • 1
    Be very careful when modifying system files! One little mistake can cause a bootloop!
    I'm happy that you managed to get back out of that bootloop :D
  • 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
    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
    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)
    2
    @tids2k için çok fazlaki geri bildiriminiz için teşekkür edilir. Evet, bu bootloop bekleniyordu. Sanırım bu, [2470925]@Hippie459MN[/KULLANICI]'nın birkaç gün önce genel Sony Xperia amiral gemisi yemekta aynı inatçı çekirdekli paniksi.
    gerçek betiğin bir sürüm, Almanya'da kötü durumdaki 255, motorola sürücüsündeki can sıkıcı 73 ve bu inatçı hata siniri gibi bu sorunlardan bazılarını çözecektir. Tam Android 12 olur de harika olurdu.




    Merhaba [KULLANICI=11226285]@kafeinsiz[/KULLANICI] geri bildiriminiz için teşekkürler! Senaryomun Xiaomi azda çok memnunum. Tebrikler! Okunabilir/yazılabilir bir ürünlerden çıkarılabilir!:Aşk :()

    mevcut özel boyutlar=25 (MB) mi kullandınız?

    Android 11 çalıştırdığınızdan emin misiniz? Günlüğünüzde söylüyor diyor ki:
    Evet kesinlikle A11. A10 bir hata nedeniyle burada görünüyor.
    1
    Here log, some system file i can't modify, size after edit 0b.
  • 110
    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 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

    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!