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

munjeni

Senior Member
Jun 2, 2011
9,455
22,048
You also do not get it - without TWRP, just flashing stock, Moto WILL NOT ALLOW ANY .IMG FILES TO BE FLASHED. that aren't recovery, vbmeta, or boot. Believe me, I have TRIED. If you do it, it gives an error. So the super.img files have to be REPACKED BACK TO super_sparsechunk, etc which NO TOOL AS OF NOW WILL DO.

If it was that easy I would have just used your tool and flashed product.img and been done with it. LOL :0P
You again "to flash image"? Did you read what I told you?
 
  • Like
  • Haha
Reactions: Frxhb and lebigmac

munjeni

Senior Member
Jun 2, 2011
9,455
22,048
If you have working root on your device first thing is to shutdown selinux to permissive mode, seccond thing to disable other protections if it exist so to make you allow do conversion to block device using superrepack tool. You should give us log if it give you error.
 
  • Like
Reactions: HemanthJabalpuri

harpreet.s

Senior Member
Oct 27, 2012
152
47
Hi ,

Mine is oneplus nord on Android 11 with A and B partitions, and the version 1.24 script worked perfectly.

# mount -o remount,rw /
#
# cd /system
# touch test
# ls -ltrh test
-rw-r--r-- 1 root root 0 Apr 3 20:46 test
#


Great job @lebigmac , your effort is really appreciated , and keep the energy up !!
 
  • Love
  • Like
Reactions: Frxhb and lebigmac

james28909

Senior Member
Mar 27, 2016
90
9
I have just noticed that I can create files in root directory, but I cannot edit or create anything in /system or /vendor
 

harpreet.s

Senior Member
Oct 27, 2012
152
47
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
 
Last edited:
But I only have android 8.1 <.<
Its almost like they rolled function from newer android source in to this device somehow. It is 8.1 and api level 27 and I cannot write to system. All I can do is use magisk module and that is a pita to manage a lot of files
In Oreo you should be able to have it without the fuss. Depending on your device you should have PLENTY of TWRP options and root options. It shouldn't be locked down unless they patched something in the update. When I was on Oreo with my E5 it was a simple root and hit the r/w toggle and that was that.
 
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
What phone do you have?
 

james28909

Senior Member
Mar 27, 2016
90
9
In Oreo you should be able to have it without the fuss. Depending on your device you should have PLENTY of TWRP options and root options. It shouldn't be locked down unless they patched something in the update. When I was on Oreo with my E5 it was a simple root and hit the r/w toggle and that was that.
Trust me, its not that simple on this device for some reason. Everything I have tried does not make /system writable. I can make files in rootfs / but not anything in system etc. I am rooted and it is working good. Everything I working as it should. This thing does have proprietary device drivers for sound though as it has a built in stereo. But I am fully rooted with magisk and cannot write to system folder in android 8.1. Wonder how I can figure out how to know for fact why I cannot write to system.
 

james28909

Senior Member
Mar 27, 2016
90
9
What phone do you have?
Its actually not a phone. Its a chinese 10" android touch screen stereo head unit. Its actually OK. The sound sucks because I got the cheapest version, but they have some very nice ones that sound good that have built in dsp etc. And ive had some minor problems with this one I have, and customer service has been 100% top notch, and they are sending me a new one completely free of charge. I plan on making a complete dump before even turning it on, and comparing with what I have installed on this one. I think when I got this one it was actually a lower android (api 23) and they send me an update file, so I wonder if I can write to system on the new one they are going to send me.

Its Ac8227L but its the yt9213aj fake 2gb (really just 1gb) quad core armv7 I think. It has mediatek6323 chip on it and I cannot find any info for it. But I created my own scatter file and have rooted the device. Sometimes the device will reboot itself into recovery and factory reset itself. My solution was to wipe recovery partition and just flash it back when I need it. But if it can reboot itself into bootloader then it can erase partitions anyway. Need to figure out why its doing this
 
Its actually not a phone. Its a chinese 10" android touch screen stereo head unit. Its actually OK. The sound sucks because I got the cheapest version, but they have some very nice ones that sound good that have built in dsp etc. And ive had some minor problems with this one I have, and customer service has been 100% top notch, and they are sending me a new one completely free of charge. I plan on making a complete dump before even turning it on, and comparing with what I have installed on this one. I think when I got this one it was actually a lower android (api 23) and they send me an update file, so I wonder if I can write to system on the new one they are going to send me.

Its Ac8227L but its the yt9213aj fake 2gb (really just 1gb) quad core armv7 I think. It has mediatek6323 chip on it and I cannot find any info for it. But I created my own scatter file and have rooted the device. Sometimes the device will reboot itself into recovery and factory reset itself. My solution was to wipe recovery partition and just flash it back when I need it. But if it can reboot itself into bootloader then it can erase partitions anyway. Need to figure out why its doing this
It sounds like there is something going on that is triggering it to reboot into recovery, as in the device may be perceiving the wrong file. Not saying this is the case, but I know from building roms and playing with TWRPS in these new filesystems is that the devices can be tempermental. SOmetimes its as easy as taking the battery out and letting the device reset itself that way (if you can take the battery out). On a lot of Chinese devices can be extremely sensitive to any system changes. The Redmi comes to mind when debloating. Tinkering with the scatterfile could have made it skittish.

I'd clone the new device and make a backup. If you can try making a TWRP for it with Hovatek's Mediatek tool. Just make sure you have the firmware if you go that way in case it goofs. Or post in the general forums to see if anyone has that model and has some hacks for it. Since I don't have that particular device I can't go in it and take a peep for you.
 

james28909

Senior Member
Mar 27, 2016
90
9
It sounds like there is something going on that is triggering it to reboot into recovery, as in the device may be perceiving the wrong file. Not saying this is the case, but I know from building roms and playing with TWRPS in these new filesystems is that the devices can be tempermental. SOmetimes its as easy as taking the battery out and letting the device reset itself that way (if you can take the battery out). On a lot of Chinese devices can be extremely sensitive to any system changes. The Redmi comes to mind when debloating. Tinkering with the scatterfile could have made it skittish.

I'd clone the new device and make a backup. If you can try making a TWRP for it with Hovatek's Mediatek tool. Just make sure you have the firmware if you go that way in case it goofs. Or post in the general forums to see if anyone has that model and has some hacks for it. Since I don't have that particular device I can't go in it and take a peep for you.
I am fairly certain that the dump I have and scatter file are 100% compatible with my device. Ive made complete backups, but not messed with preloader because I am not sure what it is. But the rest of the device, unless there are hidden partitions, I have backed up multiple times and the dumps I get look like hat they are suppose to I think. I am fairly confident that I could erase my flash completely and the dump I have would get me back running. I just wish I had a dump from the original firmware. I am going to try this on my device just to see what happens, and since I am pretty much brick proof.
 
I am fairly certain that the dump I have and scatter file are 100% compatible with my device. Ive made complete backups, but not messed with preloader because I am not sure what it is. But the rest of the device, unless there are hidden partitions, I have backed up multiple times and the dumps I get look like hat they are suppose to I think. I am fairly confident that I could erase my flash completely and the dump I have would get me back running. I just wish I had a dump from the original firmware. I am going to try this on my device just to see what happens, and since I am pretty much brick proof.
I'd say give it a go, the write down all the steps so you can start a good thread about the device. You never know, there might be some other XDAers out there with it that have tinkered a time or two with it. I'm now very curious as to how the Universal Script will behave on your new device compared to the old one.
 

james28909

Senior Member
Mar 27, 2016
90
9
I'd say give it a go, the write down all the steps so you can start a good thread about the device. You never know, there might be some other XDAers out there with it that have tinkered a time or two with it. I'm now very curious as to how the Universal Script will behave on your new device compared to the old one.
I tried running this on my system.img but it says not a super partition or somehting
 

james28909

Senior Member
Mar 27, 2016
90
9
That's odd. Oreo didn't have any issues with system.img files. the sparsechunk files didn't start until 9 and the super_sparsechunks started I think in 10. If you ran the script post the errors so lebigmac can take a peek.
I'm telling you, there si something different going on with these head units like this. I was just able to do a mount -o remount,rw / and then su cat > /system/lol and it made the file. Ls /system/ verified the file was now there. But as soon as I created that one I tried to create another cat > /system/lol1 and it gave me the read only error. To me, there is some process or some watchdog that is enforcing this beyond the scope of what we are used to dealing with. Either that, or this head unit is just wack.

How could I listen for and/or trace down processes that are doing things like this (forcing read only mode on certain partitions.

EDIT: also to disable dm_verity on this device you boot into fastboot and do fastboot --disable-verification flash vbmeta vbmeta.img with a blank vbmeta (has to be made with avb tool.) I don't have a vbmeta partition and I got an error saying that in fastboot. But when I rebooted it would not boot into the system. I had to reboot into bootloader and do the vbmeta thing and then reflash recovery. Then for some reason that let me boot back into system, then I erased recovery again because I am having an issue where it is wiping itself clean randomly.
 
Last edited:
I'm telling you, there si something different going on with these head units like this. I was just able to do a mount -o remount,rw / and then su cat > /system/lol and it made the file. Ls /system/ verified the file was now there. But as soon as I created that one I tried to create another cat > /system/lol1 and it gave me the read only error. To me, there is some process or some watchdog that is enforcing this beyond the scope of what we are used to dealing with. Either that, or this head unit is just wack.

How could I listen for and/or trace down processes that are doing things like this (forcing read only mode on certain partitions.
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).
 

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!