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