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

gearmaker

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

Attachments

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

flypatriot

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

Attachments

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

lebigmac

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

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

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

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

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

flypatriot

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

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

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

lebigmac

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

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

gearmaker

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

lebigmac

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

DeathShot9

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

Pcsl

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

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

systemrw: Initiating procedure...

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

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

lebigmac

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

1-jpg.5235933


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

cass89

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

phanimitra vadlamani

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

Attachments

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

lebigmac

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

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

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

lebigmac

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

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

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



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

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



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



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



That's what I did ?

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



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

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


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

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

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

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

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

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



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

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

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



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

any tips for this issue?

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


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


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

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


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


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

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

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Works on a Motorola Moto G30 with super. However, since there is no TWRP for this device and the stock recovery is brain-dead, you have to use the sysrw_repair.sh method and flash with fastboot.
    Code:
    systemrw: Initiating procedure...
    
    systemrw: Device is in Android mode. Ignoring
    systemrw: Current device: motorola
    systemrw: Current Android version: 11
    systemrw: Current SELinux status: Permissive
    systemrw: Current slot is: 0
    systemrw: Your super partition is located at: /dev/block/mmcblk0p75
    systemrw: / is read-only
    systemrw: /product is read-only
    systemrw: /vendor is read-only
    systemrw: Adjusting permissions...
    systemrw: Attempting to disable dm-verity and verification...
    verification is already disabled on slot with suffix _a.
    verity is already disabled on slot with suffix _a.
    systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
    systemrw: Please wait patiently...
    
    21102592+0 records in
    21102592+0 records out
    10804527104 bytes (10 G) copied, 160.101076 s, 64 M/s
    
    systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
    systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
    systemrw: Nested partitions were successfully extracted from super
    
    systemrw: Current size of system_a.img in bytes: 857608192
    systemrw: Current size of system_a.img in MB: 817
    systemrw: Current size of system_a.img in 512-byte sectors: 1675016
    
    systemrw: 'shared_blocks feature' detected @ system_a.img
    
    systemrw: Increasing filesystem size of system_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img to 261721 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img is now 261721 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_a.img...
    systemrw: Read-only lock of system_a.img successfully removed
    
    systemrw: Shrinking size of system_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img to 227660 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img is now 227660 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_b.img in bytes: 30310400
    systemrw: Current size of system_b.img in MB: 28
    systemrw: Current size of system_b.img in 512-byte sectors: 59200
    
    systemrw: 'shared_blocks feature' detected @ system_b.img
    
    systemrw: Increasing filesystem size of system_b.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 9250 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 9250 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_b.img...
    systemrw: Read-only lock of system_b.img successfully removed
    
    systemrw: Shrinking size of system_b.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 7259 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 7259 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_ext_a.img in bytes: 649871360
    systemrw: Current size of system_ext_a.img in MB: 619
    systemrw: Current size of system_ext_a.img in 512-byte sectors: 1269280
    
    systemrw: 'shared_blocks feature' detected @ system_ext_a.img
    
    systemrw: Increasing filesystem size of system_ext_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img to 198325 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img is now 198325 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_ext_a.img...
    systemrw: Read-only lock of system_ext_a.img successfully removed
    
    systemrw: Shrinking size of system_ext_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img to 160226 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img is now 160226 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_ext_b.img in bytes: 0
    systemrw: Current size of system_ext_b.img in MB: 0
    systemrw: Current size of system_ext_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Current size of vendor_a.img in bytes: 776093696
    systemrw: Current size of vendor_a.img in MB: 740
    systemrw: Current size of vendor_a.img in 512-byte sectors: 1515808
    
    systemrw: 'shared_blocks feature' detected @ vendor_a.img
    
    systemrw: Increasing filesystem size of vendor_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img to 236845 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img is now 236845 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of vendor_a.img...
    systemrw: Read-only lock of vendor_a.img successfully removed
    
    systemrw: Shrinking size of vendor_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img to 194394 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img is now 194394 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of vendor_b.img in bytes: 0
    systemrw: Current size of vendor_b.img in MB: 0
    systemrw: Current size of vendor_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Current size of product_a.img in bytes: 2554847232
    systemrw: Current size of product_a.img in MB: 2436
    systemrw: Current size of product_a.img in 512-byte sectors: 4989936
    
    systemrw: 'shared_blocks feature' detected @ product_a.img
    
    systemrw: Increasing filesystem size of product_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img to 779677 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img is now 779677 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of product_a.img...
    systemrw: Read-only lock of product_a.img successfully removed
    
    systemrw: Shrinking size of product_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img to 633770 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img is now 633770 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of product_b.img in bytes: 0
    systemrw: Current size of product_b.img in MB: 0
    systemrw: Current size of product_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Joining all extracted images back into one single super image...
    systemrw: Please wait and ignore the invalid sparse warnings...
    
    
    systemrw: Error! failed to create super_fixed.img file. Error code: 73
    There's kernel source for this device but very little else.
    2
    For everyone using RN9 merlin and Lancelot it works. I am on Lancelot with custom rom A11 OSS. You have to put the script in /data/local/tmp and go to recovery and run the script manually using the command: systemrw.sh size=20. Afterwards wipe data and format.

    Then reboot back into recovery (don't boot rom) and flash your rom again. Once rom is flashed please go ahead and reboot to recovery again.

    Once back in recovery please go to mount and select (SYSTEM ONLY!!) Then go to your terminal in your recovery and type: "mount -o remount,rw /system_root" once done flash magisk and your gapps and flash disable encryption last and reboot.
    Screenshot_20210908-102731202 (1).jpg
    Screenshot_20210908-102916853.jpg
    2
    I really would like to try the script with Redmi Note 9 (miui 12.0.4.0) but the yandex link doesn't work.
    Could you please use some universal file hosting with less limitations, like gdrive, mega, ...

    why using yandex. I don't want create a account for downloading

    New download mirror available on front page ;)
    More official download mirrors coming soon!
    2
    why using yandex. I don't want create a account for downloading
    1
    it worked on my one fusion device with dynamic partition. you are a genius bro
  • 95
    If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni


    logo_large.jpg

    *NEW* SystemRW v1.32 *NEW*
    automated bash script by lebigmac for Android 10 and above

    Creation date: February 2021
    Updated: August 2021

    Requirements:
    • rooted STOCK Android 10 or newer (custom ROM should already be R/W!)
    • at least 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.
    Before launching script make sure you've got full read/write access to the /data partition and that /data partition is not encrypted!

    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.
    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 image(s) 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
    
    # EXPERT EXAMPLE:
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` out=./img/super_fixed.bin size=50

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

    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 5GB file to my partition in just under 30 seconds! Much faster than fastboot! I still can't believe it!
    Big thanks to @Brepro1 for allowing me to basically copy his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Also big thanks @munjeni for allowing me to use his superunpack V1 tool in the previous version. It helped me to understand how these super images work.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the previous version which helped me to create this version. It's still part of the troubleshooting repair script to fix error 73.
    More thanks @gabrielfrias for his helpful comment
    Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'
    Thanks @HemanthJabalpuri for assisting me in optimizing the underlying algorithm!

    Disclaimer:
    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 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


    Confirmed working on these devices :

    Download v1.32 mirror #1
    Download v1.32 mirror #2
    current status:
    experimental
    If you like this project and want to support the developer at finishing this project & creating more amazing projects like this then please feel free to donate to the developer by clicking the link below. Thanks! Your support is very much appreciated!

    Donate
    8
    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!
    6
    New version 1.20 is ready! DOWNLOAD HERE
    Good news for those that don't have TWRP or couldn't get it to work in their TWRP. Now the script can also be run directly inside Android. Keep in mind that you will have to flash the patched images manually in this case using fastboot flash.

    The zip can still be flashed in TWRP (make sure zip signature verification isn't checked). This time I bundled my device's stock sh binary (which I used to develop the script) with the archive. Hopefully this will prevent avoidable sh-related syntax errors for some folks. The flashable zip installer update-binary automatically launches the script with the proper arguments using this bundled sh program (it's inside the tools subfolder).

    To those that were having difficulties running the previous version due to empty partitions or multiple partition groups inside their super : this has finally been fixed :D

    Please give this new version a try and let me know if it works for you or not and I will add it to the first post. Thanks for your feedback!
    5
    I try to redo the procedure, i want to change the size. but i get error, can't remove lock.

    Good news. New hotfix available HERE
    I got rid of that buggy get minimum size function and reworked the size querying algorithm a little bit. Should be more stable now.

    Next step will be to make the script compatible with those devices that have empty partitions embedded inside their super partition...
    Also ronnie was complaining about syntax error but I have yet to find the syntax error... If anyone finds it please let me know so I can fix it. Thank you!
    4
    @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