Search This thread
You might be on to something with this theory. Maybe it's Motorola security feature.
That would explain why the same lpmake arguments work perfectly in linux with lots of output but they fail on Motorola device with unidentified error.

In next version of script I will replace long absolute paths with relative paths that are much shorter in myargs.txt. Hopefully this will fix this annoying issue.
that makes total sense because I've been trying to run erfangsi tool from termux and it works perfectly when I do android 10 non super.img or lower.... when trying to extract firmware especially moto with firmware tool or makedynamic it skip the super.img and moves on....even though it extracts all the moto super sparse chunk it wont make.....plus I'm on moto g7plus as host devices..... works fine from ubuntu same tools.... and with 1.24 I successfully ran the script manually on g7plus starting from B partition..... now with 1.31 I get weird msg success but no make file in non super folder or log.......


when flashing twrp i get the normal error.........manually from twrp shell or host shell ......
lake:/ # twrp mount system
Mounted '/system_root'
Done processing script file
lake:/ # twrp remountrw system
Done processing script file
lake:/ # cd data/local/tmp/makesysrw_1.31
lake:/data/local/tmp/makesysrw_1.31 # sh makesysrw.sh
--------------------------------------------------
| makeSystemRW v1.31 automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------

makesysrw: Please install Android 10 or newer and try again
lake:/data/local/tmp/makesysrw_1.31 #
C:\Users\Administrator\Desktop\Lake\STOCK10ENDOFLINEFEB21>

my twrp is sdk 28 on vendor prop in recovery.....


motoSignature.App which is the clock wigit on stock moto has special powers thats why we cant install stock moto ports without it
and ive debloated stock moto several devices and when you get rid of moto signature apk and reboot a couple of times long enough for the phone to log the error next reboot it either wont boot or injects stock backup img


to everyone that has flashed the script and got it but cant make changes still go through the mount folder to where your going to make changes i found that out with mixxplorer on android 11 12
 

Attachments

  • Screenshot_20210504-191700.png
    Screenshot_20210504-191700.png
    222.4 KB · Views: 59
  • Haha
Reactions: lebigmac

sebj84

Senior Member
Sep 23, 2015
134
33
Kanchanaburi
Hi,

I use Poco f2Pro/K30 Pro,

Running Android 10 stable,
disabled verity etc. and tried to flash your .zip (1.31), but running twrp it gives me error 255.
So I moved all into /data/local/tmp/makesysrw_1.31/

when I try run it from adb shell, it gives me: not found
(
-/sbin/sh: /data/local/tmp/makesysrw_1.31/makesysrw.sh: not found
)
i already used chmod to make it executable
 

lebigmac

Senior Member
Jan 31, 2017
745
400
Hey! I've recently tried this on my Redmi Note 9 (Merlinnfc) that's running MIUI 12.0.6.0
It doesen't work, the phone does have a super partition, in TWRP it fails with error "255",
Any Ideas on how to fix this issue? Also, why not just modify /proc/mounts?

Thanks!
Root: MagiskSU
TWRP ver: 3.4.1 (Un-official)
-FriendlyChemist

Hi. Please show screenshot and check manual installation instructions inside script!
You can run script manually from both rooted Android and custom recovery.
Is your error 255 different from the one by @Ax33_NightFall ?




View attachment 5298849

Hello, how to fix this kind of error?
im using poco x3 nfc
ROM: xiaomi EU ROM latest..

Hi. How is this possible? Poco X3 NFC should have unzip binary by default. What output do you get if you run this?
which unzip
You can install and run the script manually if automatic installation fails. See manual installation instructions inside script! Good luck!




Hi,

I use Poco f2Pro/K30 Pro,

Running Android 10 stable,
disabled verity etc. and tried to flash your .zip (1.31), but running twrp it gives me error 255.
So I moved all into /data/local/tmp/makesysrw_1.31/

when I try run it from adb shell, it gives me: not found
(
-/sbin/sh: /data/local/tmp/makesysrw_1.31/makesysrw.sh: not found
)
i already used chmod to make it executable

Hi. Try replacing shebang in first line of script with output of which sh (see troubleshooting section of first post). Good luck!




Xiaomi Redmi Note 9 (3/64), MIUI 12.0.6, the script works without errors, after flashing the patched image, the phone works fine, but there is no access. The terminal gives a response - "/ dev / block / dm-1 is read-only"


Hi. Boot into Android and run these commands and send me screenshot. Thank you.
Bash:
adb shell
su
mount -o rw,remount /
mount -o rw,remount /vendor
mount -o rw,remount /product

And did you try mounting these partitions as R/W inside custom recovery? Was there any difference?




that makes total sense because I've been trying to run erfangsi tool from termux and it works perfectly when I do android 10 non super.img or lower.... when trying to extract firmware especially moto with firmware tool or makedynamic it skip the super.img and moves on....even though it extracts all the moto super sparse chunk it wont make.....plus I'm on moto g7plus as host devices..... works fine from ubuntu same tools.... and with 1.24 I successfully ran the script manually on g7plus starting from B partition..... now with 1.31 I get weird msg success but no make file in non super folder or log.......


when flashing twrp i get the normal error.........manually from twrp shell or host shell ......
lake:/ # twrp mount system
Mounted '/system_root'
Done processing script file
lake:/ # twrp remountrw system
Done processing script file
lake:/ # cd data/local/tmp/makesysrw_1.31
lake:/data/local/tmp/makesysrw_1.31 # sh makesysrw.sh
--------------------------------------------------
| makeSystemRW v1.31 automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------

makesysrw: Please install Android 10 or newer and try again
lake:/data/local/tmp/makesysrw_1.31 #
C:\Users\Administrator\Desktop\Lake\STOCK10ENDOFLINEFEB21>

my twrp is sdk 28 on vendor prop in recovery.....


motoSignature.App which is the clock wigit on stock moto has special powers thats why we cant install stock moto ports without it
and ive debloated stock moto several devices and when you get rid of moto signature apk and reboot a couple of times long enough for the phone to log the error next reboot it either wont boot or injects stock backup img


to everyone that has flashed the script and got it but cant make changes still go through the mount folder to where your going to make changes i found that out with mixxplorer on android 11 12
lol Alan that screenshot :D It says successful even though it didn't even do anything!
What Android version are you running? The script failed in recovery due to wrong Android version and you can successfully launch it from Android? That's weird. Maybe try updating your custom recovery.
What device are you using? It doesn't have super partition and it doesn't look like it has shared_blocks read-only feature so the script doesn't know what to do. Hey at least it didn't brick your device so that's great ;)
You can check if your system partition has shared_blocks feature by doing this
tune2fs -l /dev/block/mmcblk0p68 | grep "feat"




@PEACH-PIT @Xiaoleng @Articul8Madness@munjeni
I was able to reproduce this same error 73 in Android 11. If I run script from recovery on stock firmware it will work just fine but if I run it again in Android on already patched super then it will throw unknown lpmake error.
If you run lpmake manually it will actually give you the error code. In next version of script I will try to show this error code by default in the log.

You can find out what this error code means inside sysexits.h

test_peach-pit-jpg.5293075


/**
* Can't create (user) output file.
* A (user specified) output file cannot be created.
*/
#define EX_CANTCREAT 73

I don't think this is limited to only Motorola devices. This looks like another one of those Android 11 security features. I never saw this error during development in Android 10.
Disabling selinux didn't really make a difference.

Anybody knows how to disable this new Android 11 feature? Thanks.
 
Last edited:

amurec

Member
Feb 3, 2014
5
0
40
Amursk
Redmi Note 9
Hi. Boot into Android and run these commands and send me screenshot. Thank you.
Bash:
adb shell
su
mount -o rw,remount /
mount -o rw,remount /vendor
mount -o rw,remount /product
And did you try mounting these partitions as R/W inside custom recovery? Was there any difference?
in recovery, partitions are mounted, but does not allow them to be changed ...
 

Attachments

  • IMG_20210506_093819.jpg
    IMG_20210506_093819.jpg
    319.7 KB · Views: 42
  • Sad
Reactions: lebigmac
Dec 12, 2020
11
0
View attachment 5298849

Hello, how to fix this kind of error?
im using poco x3 nfc
ROM: xiaomi EU ROM latest..
@lebigmac sir i already found a solution about this.. seems i cant flash it through SD card so i copy it into internal.. and it works but the problem is. i can't modify/edit system build prop and vendor build prop.. but i can modify other system files..

Here is the Output Error when i try to edit build props..
the old version of this zip file (v1.04) works fine for me and I don't have problems in editing props..
can u send the old flashable zip?
 

Attachments

  • 182380513_519041019107644_511590117038886491_n.jpg
    182380513_519041019107644_511590117038886491_n.jpg
    11.2 KB · Views: 30
Last edited:

Spaceminer

Senior Member
Sep 9, 2016
1,232
599
Olympus Mons
Moto E (2020)
@lebigmac sir i already found a solution about this.. seems i cant flash it through SD card so i copy it into internal.. and it works but the problem is. i can't modify/edit system build prop and vendor build prop.. but i can modify other system files..

Here is the Output Error when i try to edit build props..
the old version of this zip file (v1.04) works fine for me and I don't have problems in editing props..
can u send the old flashable zip?
If you have any magisk modules active then disable them, reboot, and try again. I'm unable to edit files with modules active. Just a heads up.
 
  • Like
Reactions: lebigmac

ianmansant

New member
  • Apr 26, 2021
    1
    0
    So, i've tested this script and at first it just gave me the lpmake error then i managed to get the troubleshooting version running on Linux and it seemed like it was working, until i saw my OS fingerprint nullified and the partitions apparently were R/W but as soon as you make a change, let"s say change the permissions of a folder it will or enter you in a bootlop when you restart or it will mount itself back to R/O, i just wished to know what the heck is making the partitions mount back to r/o, if someone knows please reply, i will keep an eye on that shared_blocks feature.
     
    • Wow
    Reactions: lebigmac

    lebigmac

    Senior Member
    Jan 31, 2017
    745
    400
    I checked dmesg and I think this has something to do with lpmake error 73

    avc: denied { ioctl } for comm="resize2fs" path="/data/local/tmp/makesysrw_1.31b/img/product.img" dev="dm-5" ino=42298 ioctlcmd=0x127c scontext=u:r:magisk:s0 tcontext=object_r:shell_data_file:s0 tclass=file permissive=1


    If I disable the shrink to minimum function (resize2fs -f -M system.img) it works and no error. As soon as I activate the shrink to minimum function I get error 73. Also it fails depending on where in the script I call this function?! This is just so weird.

    And this only happens in Android 11 apparently

    I'll try disabling or replacing that function and I'll release a hotfix soon!



    Xiaomi Redmi Note 9 (3/64), MIUI 12.0.6, the script works without errors, after flashing the patched image, the phone works fine, but there is no access. The terminal gives a response - "/ dev / block / dm-1 is read-only"
    in recovery, partitions are mounted, but does not allow them to be changed ...

    How did you flash the super_fixed.bin ? Your log couldn't look any better. Not sure what the problem is.



    @lebigmac sir i already found a solution about this.. seems i cant flash it through SD card so i copy it into internal.. and it works but the problem is. i can't modify/edit system build prop and vendor build prop.. but i can modify other system files..

    Here is the Output Error when i try to edit build props..
    the old version of this zip file (v1.04) works fine for me and I don't have problems in editing props..
    can u send the old flashable zip?
    Maybe the empty space in the path name was causing your unzip error 255 in recovery? Not sure. It's first time I saw this unzip error. Try a different recovery.

    What do you mean you can modify other system files but not build.prop? Which ones? Please send me your log files so I can check if script worked successfully.

    From your screenshot it looks like you tried to copy a file into a file?!

    Remember always make backups before modifying any system files or else you could easily end up in bootloop!
    v1.04 of the script is linux only and it's very old deprecated version. I cannot give support for such old version right now. Maybe one day I will update it we will see. Just wait for next Android version. I will release it soon!
     
    Last edited:
    Feb 3, 2021
    41
    0
    Hi. Please check manual installation instructions inside script!
    You can run script manually from both rooted Android and custom recovery.
    Show screenshot please. Is your error 255 different from the one by @Ax33_NightFall ?






    Hi. How is this possible? Poco X3 NFC should have unzip binary by default. What output do you get if you run this?
    which unzip
    You can install and run the script manually if automatic installation fails. See manual installation instructions inside script! Good luck!






    Try replacing shebang in first line of script with output of which sh (see troubleshooting section of first post). Good luck!







    Hi. Boot into Android and run these commands and send me screenshot. Thank you.
    Bash:
    adb shell
    su
    mount -o rw,remount /
    mount -o rw,remount /vendor
    mount -o rw,remount /product

    And did you try mounting these partitions as R/W inside custom recovery? Was there any difference?




    @PEACH-PIT @Xiaoleng @Articul8Madness
    I was able to reproduce this same error 73 in Android 11. If I run script from recovery on stock firmware it will work just fine but if I run it again in Android on already patched super then it will throw unknown lpmake error.
    If you run lpmake manually it will actually give you the error code. In next version of script I will try to show this error code by default in the log.

    You can find out what this error code means inside sysexits.h

    test_peach-pit-jpg.5293075




    I don't think this is limited to only Motorola devices. This looks like another one of those Android 11 security features. I never saw this error during development in Android 10.
    Disabling selinux didn't really make a difference.

    Anybody knows how to disable this new Android 11 feature? Thanks.

    I believe if the file size to be created is too large then this new Android protection is activated and prevents the file from being created. I tried with both /data/local/tmp and /sdcard as output path with same failure. Soon I will try with external SD card.
    Hi. Please check manual installation instructions inside script!
    You can run script manually from both rooted Android and custom recovery.
    Show screenshot please. Is your error 255 different from the one by @Ax33_NightFall ?






    Hi. How is this possible? Poco X3 NFC should have unzip binary by default. What output do you get if you run this?
    which unzip
    You can install and run the script manually if automatic installation fails. See manual installation instructions inside script! Good luck!






    Try replacing shebang in first line of script with output of which sh (see troubleshooting section of first post). Good luck!







    Hi. Boot into Android and run these commands and send me screenshot. Thank you.
    Bash:
    adb shell
    su
    mount -o rw,remount /
    mount -o rw,remount /vendor
    mount -o rw,remount /product

    And did you try mounting these partitions as R/W inside custom recovery? Was there any difference?




    @PEACH-PIT @Xiaoleng @Articul8Madness
    I was able to reproduce this same error 73 in Android 11. If I run script from recovery on stock firmware it will work just fine but if I run it again in Android on already patched super then it will throw unknown lpmake error.
    If you run lpmake manually it will actually give you the error code. In next version of script I will try to show this error code by default in the log.

    You can find out what this error code means inside sysexits.h

    test_peach-pit-jpg.5293075




    I don't think this is limited to only Motorola devices. This looks like another one of those Android 11 security features. I never saw this error during development in Android 10.
    Disabling selinux didn't really make a difference.

    Anybody knows how to disable this new Android 11 feature? Thanks.

    I believe if the file size to be created is too large then this new Android protection is activated and prevents the file from being created. I tried with both /data/local/tmp and /sdcard as output path with same failure. Soon I will try with external SD card.
    Hello,

    I have one thing to ask,

    Is there any way to list ALL partitions and see how much space has been used in all of them?
    I'm running TWRP 3.4.1, the error reads: "Updater Process ended with ERROR:255 Error installing zip file '/path/to/zip/file'


    PS: I've mounted all the partitions that I could through TWRP (Including rw remount through ADB shell - /vendor /product, etc.).
     

    totmakina

    Senior Member
  • Nov 13, 2013
    167
    69
    Moto G 5G Plus
    If the script works on your device please write me your phone model, Android version, script version and if you have super partition or not. Also please send me your log files.

    I will add you to the list of success and it will be helpful for further development. Thank you!
    I want to test the script on the Motorola g 5g plus. I haven't received it yet. just recoba, unlock and flash twrp install it.
    If it works it will be perfect to install according to what type of roms. Is that so? Thanks!!!!
     
    • Like
    Reactions: lebigmac

    lebigmac

    Senior Member
    Jan 31, 2017
    745
    400
    Flash in fastboot , flash in twrp - the result does not change...
    Please , give us the older version script , but many people said if the work normally ..
    Hi @amurec
    I have to disappoint you. If v1.31 works without errors on your device and your device is still read-only then the old version will give you the same result or worse.

    in recovery, partitions are mounted, but does not allow them to be changed ...
    You get same output dm-0 is read-only when trying to mount system as r/w in recovery?
    Bash:
    mount -o rw,remount /system_root

    If script works perfectly on your device but device is still read-only I can only suggest to try munjeni's amazing superrepack tool. Maybe his tool works better on your device. Give it a try. Good luck!



    I want to test the script on the Motorola g 5g plus. I haven't received it yet. just recoba, unlock and flash twrp install it.
    If it works it will be perfect to install according to what type of roms. Is that so? Thanks!!!!

    Hi @totmakina
    Thanks for your interest in this project. I would suggest you wait for new upcoming version.
    I will release it soon.



    Hello,

    I have one thing to ask,

    Is there any way to list ALL partitions and see how much space has been used in all of them?
    I'm running TWRP 3.4.1, the error reads: "Updater Process ended with ERROR:255 Error installing zip file '/path/to/zip/file'


    PS: I've mounted all the partitions that I could through TWRP (Including rw remount through ADB shell - /vendor /product, etc.).
    Hi @TheMagnificent_Y
    Try this code to view space usage in all partitions. I hope it helps ;)

    Bash:
    df -ha

    Regarding your error 255 is yours different from this one? Thanks.
     
    Last edited:
    So, i've tested this script and at first it just gave me the lpmake error then i managed to get the troubleshooting version running on Linux and it seemed like it was working, until i saw my OS fingerprint nullified and the partitions apparently were R/W but as soon as you make a change, let"s say change the permissions of a folder it will or enter you in a bootlop when you restart or it will mount itself back to R/O, i just wished to know what the heck is making the partitions mount back to r/o, if someone knows please reply, i will keep an eye on that shared_blocks feature.
    You answered your own question.

    Android 10 was build as a System As Root OS, meaning by design it's R/O and automatically has banned R/W access. The shared blocks feature does not help as they've figured out an asinine way to keep up from modding.
     

    @YudiTriyadi

    New member
    Oct 4, 2015
    1
    0
    At OrangeFox It didn't work. After Completing the Flashing Process and Getting a Successful Message Then Reboot the System. I tried to transfer a file from the SD card to the system and it didn't work ..
     

    lebigmac

    Senior Member
    Jan 31, 2017
    745
    400
    Hi @YudiTriyadi. Thanks for your interest in this project. What do you mean it didn't work? You say you got a successful message so that means it worked right? Please show your log files so I can check. And a screenshot would be helpful. Did you try mounting your system as read/write before trying to copy stuff? Keep in mind Android boots your partitions as read-only by default.
     
    Last edited:

    lebigmac

    Senior Member
    Jan 31, 2017
    745
    400
    Anybody want to try v1.31c ? Please keep in mind this version has not been thoroughly tested yet so you are trying it at your own risk!

    I was forced to change project name from makesysrw to systemrw AKA sysRW because some ruthless and spineless cyber pirate hacker who is also a member here has stolen my project, deleted all original info from script and replaced with his own meaningless words that had nothing to do with the project and then released as his own. He even hacked into my update-binary and changed the program title to his own bogus meaningless program title! Can you believe it? Talk about a lazy spineless hacker thief. This was also the reason why I had to stop the development of the Android app sadly. It was so close to being finished! Plagiarism and cyber piracy at its finest by a fellow forum member. It's unbelievable! Where has the mutual respect gone nowadays? And no apology or thanks from the guy to this date (been waiting since March 14th when I first caught him red-handed). Rest in peace open source!

    Anyways please let me know if this new version works on your device. I've finally figured out where this annoying lpmake error 73 is coming from and found 2 new ways to prevent it from happening. This error 73 seems to be related to Android 11.

    TWRP error 255 is not fixed yet but installing script manually should work (see manual installation instructions inside script if some ruthless hacker hasn't deleted it yet together with original source, credits, disclaimer and whatnot...)
    If your custom recovery cannot decrypt and mount /data partition yet then try manually running script from within Android!
    Good luck!
     

    Attachments

    • 1620520424353.jpg
      1620520424353.jpg
      139.3 KB · Views: 396
    Last edited:

    lebigmac

    Senior Member
    Jan 31, 2017
    745
    400
    Now all of a sudden it just works on all input files regardless of whether they are read-only or read-write without having to do any modifications to the source code!? Thanks to precious feedback by @chintoocool all I did was move getCurrentSize() function from makeRW() function into makeSuper() function. And now it just works without throwing that annoying lpmake error 73. WTF! It's such a mystery to me.
    Did I just magically fix the annoying lpmake error 73 (that has been plaguing us for 2 months now) just like that by randomly moving some functions around in the script?! It required some serious detective work for sure. Big thanks to everyone who gave helpful feedback and contributed to fixing it.
     
    Last edited:

    pandavova

    Senior Member
  • Feb 9, 2016
    116
    16
    Error 73 on my Sony Xperia 5 ii with systemrw_1.31b.
    I did flash from Android and not from TWRP (because TWRP doesn't work).
     

    Attachments

    • log_XQ-AS52_EEA_58.1.A.5.159_systemrw_1.31b_try1.zip
      98.8 KB · Views: 10
    Last edited:
    • Sad
    Reactions: lebigmac

    Top Liked Posts

    • There are no posts matching your filters.
    • 2
      @Keven11 don't worry in next version of troubleshooting repair script I will include platform-tools ;)
      2
      and the v1.31d script did not work.

      This is not true. Script works perfectly when launched manually but there is a little recovery installer issue on some devices in v1.31d that I have already fixed and will be released in next version v1.32!
      If this little installer issue bothers you feel free to use the old v1.31 that is still available in original post.

      Oh you using the TWRP by that spineless thief who stole my script, deleted me from my own project and released as his own... I'm still waiting on his public apology since he first steal my script on March 14th 2021... I would NOT recommend using recovery by a cyber thief as stealing other people's hard work is not very trustworthy behavior. I mean deleting all important comments from original script such as credits, disclaimer, author name, instructions (and much much more) and replacing with meaningless words that's despicable and inacceptable behavior by itself but hacking into the update-binary and replacing original program title with a made-up bogus program title that has absolutely nothing to do with the original project? Come on seriously? Only malware would do such a misleading and malicious thing!
      Maybe this project would already be finished and 100% working on all devices if some malicious hacker would actually contribute positively to the project and help me fix any bugs rather than only hacking my update-binary and deleting only my comments from script (and renaming my functions to some bogus meaningless words) and then releasing it as if he created whole project from scratch without even mentioning original source... Not once did this spineless and ruthless cyber pirate offer to help with the original project.
      2
      Hi thanks for feedback. Can you please send me myargs.txt and lpdump.txt they should be inside /data/local/tmp/systemrw_1.31d/log/

      It's the OnePlus COW error. @BlazingKahn35 had the same problem.
      It's possible to solve this puzzle don't worry ;)
      Maybe a small modification to the script source code can make it work on all OnePlus devices (y)
      Sure, there you have it both, I hope it helps
      2
      Hi there,

      First of all, great project.

      Secondly, I'm using a Oneplus 8T with the latest OOS beta 5. Script works while creating super_original.bin, then does all the imgs but, on the last step, creating the big super_fixed.img, my device seems to lack space (error 70) , or something. I've tried to use output:/sdcard/IMGs/superfixed.bin or similar but, It won't do it.

      What can I do? It's fresh formatted. I'll append the whole console log.
      Hi thanks for feedback. Can you please send me myargs.txt and lpdump.txt they should be inside /data/local/tmp/systemrw_1.31d/log/

      It's the OnePlus COW error. @BlazingKahn35 had the same problem.
      It's possible to solve this puzzle don't worry ;)
      Maybe a small modification to the script source code can make it work on all OnePlus devices (y)
      1
      kpykpy.....

      (I completely messed this post up) So, I thought that using Debian WSL was the fix but I can't get the linux adb package installed and working with Debian. Do you have any idea what I'm missing? I keep getting this: E: Unable to locate package adb. after running: sudo apt install adb.
    • 66
      If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni



      SystemRW v1.31d
      automated bash script by lebigmac for Android 10 and above

      Creation date: February 2021
      Updated: May 2021

      Requirements:
      • rooted STOCK Android 10 or newer (custom ROM should already be R/W!)
      • 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.

      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 make your adjustments. 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 and want to skip that process next time you install the .zip then put this in line #2 of config.ini :
      Code:
       in=./img/super_original.bin 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.
      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.
      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 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 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 ./img/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. 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:
      Code:
      # Run this command *IF YOU HAVE NO SUPER PARTITION*
      ./systemrw.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:
      ./systemrw.sh size=15
      
      # Plug an existing super image into the script like this *ONLY IF YOU HAVE 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 HAVE SUPER PARTITION*
      ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15

      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"

      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 into:
      /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!

      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 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). 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'
      Thanks @HemanthJabalpuri for assisting me in optimizing the underlying algorithm!

      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, liability and risk lies with the end-user. You hereby agree not to abuse this software for illegal purposes.
      The end-user is free to improve the underlying algorithm (as long as no malicious code is added) as well as redistribute this script in his own project as long as the comment and title section of the script (lines #1 - #65) as well as the included update-binary are not modified or removed.

      Please make sure to post your feedback, suggestions and improvements in the official thread right here.
      Enjoy customizing your read-write-able Android device!


      v1-31d_01-jpg.5309953
      v1-31d_02-jpg.5309955
      v1-31d_03-jpg.5309957


      1-jpg.5235933


      Download v1.31 (deprecated)
      Download v1.31d *NEW* (if you get error signal 6 in recovery try decrypt and mount /data partition first!)
      current status: experimental
      Please click my like button below if you like my work! Thanks!

      Confirmed working on these devices :

      Xiaomi Poco X3 NFC
      Xiaomi Poco X3 Pro
      Xiaomi Poco X2 - Android 10/11
      Xiaomi Poco X2 - Android 11 (v1.24)
      Xiaomi Poco F2 Pro - Android 11 (v1.26)
      Xiaomi Mi 10 T Lite - Android 11
      Xiaomi Mi 10 T lite - Android 11 - TWRP
      Xiaomi Mi 10 - Android 11
      Xiaomi Mi 10 Ultra - Android 11
      Xiaomi Mi Note 10 Lite - Android 11 - OrangeFox
      Xiaomi Redmi 9 - Android 10
      Xiaomi Redmi 9 - Android 10 (v1.26)
      Xiaomi Redmi Note 9 Pro joyeuse - Android 10
      Xiaomi Redmi Note 9 Pro gauguin (China) - Android 10
      Xiaomi Redmi 9T - Android 11 - TWRP
      Xiaomi Redmi K30 - Android 10
      Xiaomi Redmi K30S Ultra(China), Android 11 (v1.29)

      Asus Rog Phone 3 - Android 10 - TWRP
      OnePlus Nord - Android 11 (v1.24)
      Doogee S96Pro - Android 10 (v1.26)
      F150 model B2021 - Android 10
      Realme C12 - Android 11
      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). I bundled my sh program (which I used to develop the script) with the archive this time. Hopefully this will prevent avoidable sh-related syntax errors for some folks. The flashable installer binary automatically launches the script with the proper arguments using this bundled sh program (it's inside the tools folder).

      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
      If the script works on your device please write me your phone model, Android version, script version and if you have super partition or not. Also please send me your log files.

      I will add you to the list of success and it will be helpful for further development. Thank you!
      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
      @lebigmac
      I am happy to say that, all the things went fine with my Realme C12.

      I have removed original super.img right after lpunpack finishes. This makes me use your tool with just 15GiB free space.

      A small thing is that, in your update-binary, please create a dir /data/local/tmp if it does not exist.
      If it does not exist, your tool will fail to install.
      It will be not present if a person clean flashes your tool(wipe data).

      Also system RW works fine, but vendor RW gives operation not permitted.
      Do I need use chattr with the block of vendor?


      Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

      Thanks

      Hello HemanthJabalpuri. Did you actually get my script to work on your device? This is wonderful news.

      Thanks for the suggestion about creating /data/local/tmp folder if it doesn't exist. I will do it in the next version.

      vendor RW gives operation not permitted.
      Do I need use chattr with the block of vendor?


      Operation not permitted? I never seen this error before. Do you get this error in the script or elsewhere?
      Sorry I don't know what is chattr.

      Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

      Thank you very much for this precious piece of advice. Some people have old sh version in their twrp that don't even support basic array functions. Do you think it's possible to bundle my own sh file (that I used for development) with the flashable zip and rule out any sh compatibility issues this way?

      In the next version of the script I would like to remove twrp completely from the requirement list so that everybody can enjoy a system that's read write-able, not only those with twrp. Some devices have no twrp or orange fox available.

      No Orangefox recovery too for Oneplus 7T , unfortunately. Oneplus really messed up 7T's decryption with android 10. I'm hoping for it to fixed with OOS 11 update which too, got delayed because they didn't care for its decryption issues in the first place. Its mind boggling that the 7T doesn't have a working TWRP even after 1 ½ years of being launched.

      Hi shady_soldier
      Yes that kind of sucks I agree. I wish I knew how to actually compile recovery. Too bad I'm only an amateur!
      I tried to compile Xiaomi stock recovery the other day but no luck so far...

      @lebigmac Any chance to uninstall It?
      Thx!!

      Hi Morello12. Did you actually run the script successfully or not?
      Sure simply delete the entire folder /data/local/tmp/makesysrw_1.15c

      But is it a new version or what?
      Does it work without disabling DM-verify?

      No. Disable dm verity and verification is always a good idea!
      @Ayoub$# You could also try flashing an empty vbmeta with fastboot if you can't disable dm verity manually.

      Code:
      fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img