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

[SCRIPT][Android 10+] Universal Mount SystemRW / SuperRW featuring MakeRW (read/write)

Search This thread

jhayprince

Member
Nov 20, 2021
19
9
this is the result sir...
It looks like you can read write to all important partitions except /vendor...
Further research required...

Try this:
Bash:
tune2fs -l /dev/block/dm-3
df -h /dev/block/dm-3
 

Attachments

  • dm-3.jpg
    dm-3.jpg
    593.7 KB · Views: 63
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
973
594
@jhayprince have you tried running script a second time with larger custom size? For example size=50 or size=100. That works well for Xiaomi devices. Good luck!
 

lebigmac

Senior Member
Jan 31, 2017
973
594
sir you have flashable zip that contains size is 100 because i dont know what to do...thank you in advance sir
You can simply extract the flashable zip and modify the config.ini with text editor and then save file and create new flashable.zip with random name and flash it in recovery. It's very easy to do on your phone itself.
Or run script manually according to the official instructions.
If you have further questions just ask. Good luck!
 

jhayprince

Member
Nov 20, 2021
19
9
You can simply extract the flashable zip and modify the config.ini with text editor and then save file and create new flashable.zip with random name and flash it in recovery. It's very easy to do on your phone itself.
Or run script manually according to the official instructions.
If you have further questions just ask. Good luck!
Good evening sir i try size=100 it give me error 255
i try size=50 but still the system_ex and vendor are not r/w kindly see the log files sir...thanks
 

Attachments

  • lpdump.txt
    1.5 KB · Views: 4
  • mylog.txt
    5.9 KB · Views: 4
  • Screenshot_2021-11-30-03-10-52.png
    Screenshot_2021-11-30-03-10-52.png
    178.1 KB · Views: 53
  • Screenshot_2021-12-02-11-30-54.png
    Screenshot_2021-12-02-11-30-54.png
    181.9 KB · Views: 54

lebigmac

Senior Member
Jan 31, 2017
973
594
Working smoothly for MI 10T Android 10 Firmware Global 12.0.3 with argument size=100
Hello @QuaZero. I'm very happy that my script works smoothly on your Xiaomi device! Congratulations! (y)
Please send me your other log files from this folder /data/local/tmp/systemrw_1.32/log/
Thanks! Your feedback is very useful for further script development (y)
Enjoy debloating and customizing your fully read/write-able device! :love:(y)



Good evening sir i try size=100 it give me error 255
i try size=50 but still the system_ex and vendor are not r/w kindly see the log files sir...thanks
Hi again @jhayprince. Thanks for your log files and screenshots. It helps to better understand your problem.

According to your latest log everything worked correctly and shared_blocks read-only feature of your most important partitions was successfully removed by script :D(y)

Don't worry error 255 it's already fixed in next version which shall be released soon ;)(y)
In the meantime you can simply launch script manually in terminal (y)
You can subscribe to the thread and you will be notified when a new version of the script will be released (y)
 
Last edited:

jhayprince

Member
Nov 20, 2021
19
9
Hello @QuaZero. I'm very happy that my script works smoothly on your Xiaomi device! Congratulations! (y)
Please send me your other log files from this folder /data/local/tmp/systemrw_1.32/log/
Thanks! Your feedback is very useful for further script development (y)
Enjoy debloating and customizing your fully read/write-able device! :love:(y)




Hi again @jhayprince. Thanks for your log files and screenshots. It's very useful to better understand your problem.

According to your latest log everything worked correctly and shared_blocks read-only feature of your most important partitions was successfully removed by script :D(y)

Don't worry error 255 it's already fixed in next version which shall be released soon ;)(y)
In the meantime you can simply launch script manually in terminal (y)
You can subscribe to the thread and you will be notified when a new version of the script will be released (y)
o think its working now see the screenshot..before the vendor its in RO...but now its in RW...
 

Attachments

  • Screenshot_2021-12-02-22-22-34-317_com.estrongs.android.pop.pro.jpg
    Screenshot_2021-12-02-22-22-34-317_com.estrongs.android.pop.pro.jpg
    465.5 KB · Views: 64
  • Like
Reactions: lebigmac

InfaMan

New member
Oct 28, 2017
4
2
Armavir
Xiaomi Poco X3 Pro
lebigmac Hello bro from Russia! Your script works without any problems on the POCO X3 PRO phone! There was a problem mounting partitions in TWRP from Nebrassy. Installed Orangefox and everything went smoothly! Thanks for your work!
P.S. size=250
 
Last edited:
  • Love
Reactions: lebigmac

QuaZero

Member
Aug 23, 2019
6
2
Hello @QuaZero. I'm very happy that my script works smoothly on your Xiaomi device! Congratulations! (y)
Please send me your other log files from this folder /data/local/tmp/systemrw_1.32/log/
Thanks! Your feedback is very useful for further script development (y)
Enjoy debloating and customizing your fully read/write-able device! :love:(y)
Here you go, there is only 2 files
 

Attachments

  • mylog.txt
    4.8 KB · Views: 6
  • lpdump.txt
    1.3 KB · Views: 6
  • Like
Reactions: lebigmac

sampei

Senior Member
Apr 3, 2009
171
39
Hi, @lebigmac

I have facing the issue which is an error shows up. "There was a problem shrinking system.img. Please try again."

If you could tell me any instructions to solve this problem, I would very appreciate.

My device is Poco F2 pro / Android 11 MIUI 12.6

THANK YOU.
 

Attachments

  • mylog.txt
    1.5 KB · Views: 12
  • myargs.txt
    137 bytes · Views: 3
  • lpdump.txt
    1.5 KB · Views: 2
  • Wow
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
973
594
Hi, @lebigmac

I have facing the issue which is an error shows up. "There was a problem shrinking system.img. Please try again."

If you could tell me any instructions to solve this problem, I would very appreciate.

My device is Poco F2 pro / Android 11 MIUI 12.6

THANK YOU.
Hi @sampei thanks for your log files. That's an interesting error. I don't know why it happens. Maybe ./tools subfolder doesn't have the required execution permissions?
Does your device have resize2fs binary by default?
You can try opening systemrw.sh script file with notepad and replace all instances of ./tools/resize2fs with resize2fs then save file and try again. Good luck (y)
 

Md652

New member
Dec 4, 2021
4
0
I ran it on kingkong mini2 with android 10 I did everything required for the script to run and stone it started running and got stuck in things requiring 64 bit below error
KINGKONG_MINI2:/ $ su
KINGKONG_MINI2:/ # ./systemrw.sh size=100
/system/bin/sh: ./systemrw.sh: inaccessible or not found
127|KINGKONG_MINI2:/ # cd /data/local/mtp/systemrw_1.32/
/system/bin/sh: cd: /data/local/mtp/systemrw_1.32: No such file or directory
2|KINGKONG_MINI2:/ # cd /data/local/tmp/systemrw_1.32/
KINGKONG_MINI2:/data/local/tmp/systemrw_1.32 # ./systemrw.sh size=100
--------------------------------------------------
| SystemRW v1.32 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! |
--------------------------------------------------

systemrw: Custom size detected: 100 MB
systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: CUBOT
systemrw: Current Android version: 10
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/mmcblk0p34
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...
./systemrw.sh[454]: ./tools/avbctl: not executable: 64-bit ELF file
./systemrw.sh[454]: ./tools/avbctl: not executable: 64-bit ELF file
./systemrw.sh[454]: ./tools/lpdump: not executable: 64-bit ELF file
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...

8388608+0 records in
8388608+0 records out
4294967296 bytes (4.0 G) copied, 67.532360 s, 61 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.sh[454]: ./tools/lpunpack: not executable: 64-bit ELF file
systemrw: Please make sure the super file exists and try again.

I would be very happy if you could help me because I can not change anything and it stings me all the time
Thank you
 
Last edited:

lebigmac

Senior Member
Jan 31, 2017
973
594
lebigmac Hello bro from Russia! Your script works without any problems on the POCO X3 PRO phone! There was a problem mounting partitions in TWRP from Nebrassy. Installed Orangefox and everything went smoothly! Thanks for your work!
P.S. size=250
Hello to Russia @InfaMan. Thank you for your feedback. You are welcome. Enjoy a fully read/write-able system :love:(y)



work on pixel 4xl android 12 👍 just change the size to 50
I can't believe this RW vulnerability was not fixed yet in Android 12?! Talk about lazy programmers...

@Anhlatuananh please send me your log files from script folder thanks! (y)



I ran it on kingkong mini2 with android 10 I did everything required for the script to run and stone it started running and got stuck in things requiring 64 bit below error
KINGKONG_MINI2:/ $ su
KINGKONG_MINI2:/ # ./systemrw.sh size=100
/system/bin/sh: ./systemrw.sh: inaccessible or not found
127|KINGKONG_MINI2:/ # cd /data/local/mtp/systemrw_1.32/
/system/bin/sh: cd: /data/local/mtp/systemrw_1.32: No such file or directory
2|KINGKONG_MINI2:/ # cd /data/local/tmp/systemrw_1.32/
KINGKONG_MINI2:/data/local/tmp/systemrw_1.32 # ./systemrw.sh size=100
--------------------------------------------------
| SystemRW v1.32 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! |
--------------------------------------------------

systemrw: Custom size detected: 100 MB
systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: CUBOT
systemrw: Current Android version: 10
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/mmcblk0p34
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...
./systemrw.sh[454]: ./tools/avbctl: not executable: 64-bit ELF file
./systemrw.sh[454]: ./tools/avbctl: not executable: 64-bit ELF file
./systemrw.sh[454]: ./tools/lpdump: not executable: 64-bit ELF file
systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
systemrw: Please wait patiently...

8388608+0 records in
8388608+0 records out
4294967296 bytes (4.0 G) copied, 67.532360 s, 61 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.sh[454]: ./tools/lpunpack: not executable: 64-bit ELF file
systemrw: Please make sure the super file exists and try again.

I would be very happy if you could help me because I can not change anything and it stings me all the time
Thank you
Hi @Md652 sorry no 32-bit version available at the moment. You're the first person in almost 1 year to ask me for 32-bit version...



I have Poco F1 ROM MIUI a10 I have error 255 Recovery log>
"The file was not found"
Hi @Gimmyy please show screenshot of your error. Thanks (y)
Did you try running script manually yet? See instructions on first page. Good luck! (y)



No new fixed script for RN10PRO (sweet)?
Hi @uvs. Thanks for your interest in this project.
Don't worry, new version is coming soon! ;)(y)

What exactly is the issue that you are experiencing on your Xiaomi Redmi Note 10 Pro device? Please send me your log files from script folder (y)
If your device has shared_blocks read-only feature then the script can do the job.
To check if your device has shared_blocks read-only feature you can run this code in Android:
Bash:
adb shell
su
tune2fs -l /dev/block/dm-0 | grep "feat"
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Can someone explain what does this script do? ELI15
    Do I need it on my OnePlus 7 Pro OOS 11.0.5.1?
    Hi @iamMG thanks for your interest in this project. By default Android 10+ devices have their partitions locked to read-only due to shared_blocks read-only feature. This script attempts to remove this shared_blocks read-only feature from your partitions. Enjoy!(y)



    Confirm, works on Oneplus 8 Pro with OOS 11.0.10.10 IN11BA.
    I needed use repair script. adb shell has no root access I modified it a little.

    Bash:
    adb_shell(){
      ./tools/bin/adb shell "su -c [email protected]"
    }


    Awesome job, thanks a lot.

    EDIT: I used munheni's superrepack tool and I socked on R/W /vendor but not writable. I've lost /vendor/etc/mixer_paths.xml than all audio. This lebigmac's script has fixed my phone!
    Of course file content has been restored from old backup.
    Hello @rysson_. I'm very happy that my script works smoothly on your Oneplus 8 Pro device with OOS 11.0.10.10 IN11BA firmware! Congratulations! (y)
    Thanks for sharing your optimization with me. I'm very new to bash scripting as you can tell :)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    This works on my moto g stylus 2021 android 11
    I just flashed the imgs files manually through my custom recovery that had fastboot mode
    And after I reboot vendor system and product are rw
    Hello @footjobs. Thanks for your feedback. I'm glad that my script works on your moto g stylus 2021 device with android 11 firmware! Congratulations! (y)
    Did you have to use the included sysrw_repair script at the end?
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    thanks for the tool
    I've been using it since Xiaomi.eu 12.5.18
    and now installed on 12.5.19 also working fine
    poco f3 xiaomi.eu rom v 12.5.19View attachment 5491695
    Hi @samy2015. Thanks for your feedback. I'm happy that my SystemRW script works well on your Xiaomi Poco F3 device with Xiaomi.eu 12.5.19 firmware! Congratulations! (y)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    Works on duoqin F21 pro, thanks. Still testing some things but it does work, i'm able to import/delete/edit in /system
    Hi @kaidok997. Thanks for your feedback. I'm happy that my script works as expected on your duoqin F21 pro device! Congratulations! (y)

    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    Works on Oneplus 8 Pro with OOS 11.0.10.10 IN11BA.
    Good job thanks.
    Hello @Johncaffee. You're welcome. Thanks for your kind words. I'm very happy that my script works smoothly on your Oneplus 8 Pro device with OOS 11.0.10.10 IN11BA firmware! Congratulations! (y) You've got the same device as @rysson_ above.
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    I flash the script using recovery mode and it succusfully installed and reboot
    It still say
    '/dev/block/dm-1' is read-only'


    There is log files
    Should i use bigger size??

    I want rw😭😭

    I have redmi 9 fully rooted with magisk
    Hello there, I tried this on Mi11x running AICP rom. Even after successful installation I don't see any difference in particular. I can only copy to the system/priv-apps when in android and it reverts to normal when I reboot. When in recovery it doesn't even see it as rw at all, keeps saying the partition is read-only. @lebigmac
    Hi @sarbazg180 @Peter1212 thanks for your interest in this project.
    Did you check if shared_blocks read-only feature was successfully removed from your partitions? See NOTE section in first post on how to do this.
    Please send me your log file to check for any errors. Thanks. You can find the log files here /data/local/tmp/systemrw_1.32/log/
    Did you try to remount your partitions as rw? And immediately after that run dmesg to catch the error. What was the result? Please show screenshot thanks. I'm afraid your device has some additional special read-only features :(

    Maybe if you're lucky next upcoming release version might fix your issue but I can't guarantee it ;)(y)



    @lebigmac first of all great work.
    I flashed a RW100 zip in 7t pro. Everything went as usual but ur code to test whether script works fails. Not in /proc/mounts is the reply.

    But I can copy/delete stuff from /system using total commander.😅.

    But unfortunately the OS is broken. Awkward bugs are happening here and there.

    So my question is can I make system.img rw before flashing on android. I want to do the job on windows to avoid too much write operation on phone nand after every OS update is release.

    Is it possible to do it on windows?
    Hi @Ayan Chakraborty thanks for your interest in this project. I'm happy that script works on your OnePlus 7t Pro device!
    If you send me your log files from script folder I can add you to the list of successful devices on first page ;)(y)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)

    You mean the code in the NOTE section first post How to check if script worked? What result do you get?
    Maybe this code doesn't work on older devices.

    Yes sometimes modifying the wrong system file can cause unstable system :D

    Sorry this tool is Android only (and the included sysrw repair script is Linux) only. If you want to do the job on the fly you can check out the amazing superrepack tool by @munjeni see first post for link. Have fun!



    Dear lebigmac,
    a BIG THANK YOU.
    It works, after a bit of struggle with the error code 73 I was able to run sysrw_repair file from a VM and Linux Mint. Everything was fine and automatic. After the parsing it rebooted to bootloader and flashed. It cost ca. 5 min. The file system is shown as ro, but it behaves like rw. As first I got rid of preinstalled YouTube. Nice.
    Moto g30, Stock ROM Android 11, Magisk, A/B, Ramdisk.
    Again, you helped to solve the biggest Android problem nowadays. Thank you for it.

    Update:
    One thing: I tried to change gpio-keys.kl in /system/... With x-plorer the permission set to 777. In system/usr/keylayout/ one can create/delete/change the files, but after every change they become empty, even if copied in here. The same after reboot. Apparently there is still a problem with the /system/ directory. Other things are superb.
    Any idea hjw to “fill“ a *.kl file?

    Tomas
    Hi @anglican007. If I had access to a Motorola device I'm sure I could fix error code 73 easily. I've already fixed it before on my Poco but that didn't fix it for Motorola devices it seems?!
    Thanks for your kind words. The solution was already out there. I only put the pieces of the puzzle together into one compact script (or 2 if you count that repair script lol).
    Can you successfully remount your partitions as rw now in terminal? That's awesome! (y)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)

    If you can only create empty files in /system that means you must run script again with larger custom size. Try again with something like size=50 for example. Good luck! Don't worry next upcoming version has auto-resize feature so you shouldn't encounter this problem anymore in the future ;)(y)

    What do you mean file system is shown as ro ? Even if you remount your partitions as rw in terminal?
    Please show screenshot thanks.

    What's a .kl file?

    I have one plus Nord and flash your script successfully and got rw system.
    But system/reserve folder still ro how to got rw in this folder. This folder has lot of bloatware.
    hi guys
    can you help me to change system/product R/O to R/W?

    system partition is R/W but system/product R/O and cant change

    my device : redmi note 10 pro max
    android : 11 miui : 12.5.8.9
    root method : magisk 23
    Hi again @Facebooook and hi @Pouya Rezaei thanks for your interest in this project.
    Congratulations for unlocking rw capability in your /system partition with the script! :love:(y)
    Please send me the output of your mount command
    Bash:
    adb shell
    su
    mount>/sdcard/mymount.txt
    Did you try to remount that path in question as rw? What was the result?
    ~ $ mount -o remount,rw /system/reserve
    mount: '/dev/block/loop6' not user mountable in fstab
    You forgot su command!

    HI, lebigmac and all others
    I think I cannot install OTA because of this script, is that so?
    Is the solution to flash repair zip and then install OTA and then I can run r/w again?
    Or any other solution?
    Thank you
    Hi @jis251 thanks for chiming in.
    Yes you can install OTA but this will remove your new RW features.
    After installing OTA you will have to run script again to get RW features back.
    Only use the included sysrw_repair script if you experience error 73!
    2
    Thanks and respect to sir Lebigmac for this awesome creation.

    It works on Redmi 9 Power (India variant)

    Over: MIUI 12.5.4 / 12.5.5 Android 11 (Xiaomi eu)
    Rooted: Magisk Canary - f822ca5b (patched boot image)
    Kernel: Stock
    Recovery: TWRP (XTRV)
    After flashing this script, I got my full super partitions as rw namely but not limited to /system; /system_ext; /product & /vendor respectively.
    THANK YOU AGAIN SIR!
    Feeling blessed.
    1
    Confirm, works on Oneplus 8 Pro with OOS 11.0.10.10 IN11BA.
    I needed use repair script. adb shell has no root access I modified it a little.

    Bash:
    adb_shell(){
      ./tools/bin/adb shell "su -c [email protected]"
    }


    Awesome job, thanks a lot.

    EDIT: I used munheni's superrepack tool and I socked on R/W /vendor but not writable. I've lost /vendor/etc/mixer_paths.xml than all audio. This lebigmac's script has fixed my phone!
    Of course file content has been restored from old backup.
    1
    Hi @lebigmac . I flash "systemrw_1.32_flashable.zip" on my pixel 3 (rom stock A12, rooted magisk 23).
    twrp version 3.6.0
    Without errors , but R/W not working.
    Maybe there is another way?

    Log file and adb shell command:
    Hi @simora.lesha .Thanks for your interest in this project.
    systemrw: Flashing /data/local/tmp/systemrw_1.32/nosuper/.img to /dev/block/sda6
    systemrw: Don't interrupt this process or you risk brick! Please wait...

    systemrw: Successfully flashed /data/local/tmp/systemrw_1.32/nosuper/.img to /dev/block/sda6
    According to your log it looks like something went wrong and it flashed a corrupted file to your device?!
    I can't believe your device still works after that! :ROFLMAO:
    Did you check if shared_blocks read-only feature was successfully removed from your partition /dev/block/sda6 ? tune2fs -l /dev/block/sda6
    Don't worry the new version which is just around the corner should fix your problem! (y)




    Hi @alex_theta thanks for your interest in this project. Please send me your log files from script folder if you want me to check for errors.
    I'm sad to hear about your bootloop issue. Please understand that all devices are different and while the script works perfectly on older devices, it can cause bootloop on newer devices. Phone manufacturers had plenty of time to close this vulnerability and implement new annoying bootloops should the user decide to install the script.
    Did you make full phone backup as recommended in first post before running script? Then it shouldn't be too difficult to undo the bootloop.
    Script only modifies super partition and it uses the included avbctl binary to disable dm-verity & verification which to my knowledge only modifies vbmeta / vbmeta_system partition.

    To get back out of the bootloop you can flash back stock read-only super image (with same firmware version) that you downloaded from your phone manufacturer's website or use the super_original.bin dumped by the script.

    And to re-enable dm-verity and verification you can use the included avbctl binary in /tools subfolder of script folder.
    Or you can try to fastboot flash back stock vbmeta / vbmeta_system using the --enable-verity --enable-verification parameters.

    Then you have undone all changes that the script has done to your device.
    If you still have bootloop after that then I don't know what you changed on your device for getting stuck in such a mess.
    Good luck!
    1
    Device - Realme GT Neo 2 Android 11 rooted with magisk RUI 2.0 Stock ROM

    No error reported system has rebooted without any problem . NO BootLoop



    Can you check if Device shows requirement for flashing both partitions
    Since I get this when I try to check slot
    C:\adb>.\fastboot.exe getvar current-slot
    current-slot:
    finished. total time: 0.003s

    Now I can see partitions in mixplorer but I still cant delete files , I removed Facebook App Manager it failed i thought on reboot it will go but after reboot also it stays there .

    I have attached photo of partitions that reappeared but i cant seem to delete any apps or even change permissions .
    Hi @Email44841 thanks for your interest in this project & for providing your log files. According to your log the script didn't do anything other than disable dm-verity and verification. I'm happy that your phone still boots :D
    It looks like you've got the same problem as @diogen78 in this comment here
    @Email44841 @diogen78 please run these commands and show me result thanks! (y)
    Bash:
    adb shell
    su
    for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol"; done

    Don't worry new upcoming version (which is just around the corner) should work better on your device I think ;)(y)
    Any talented developers want to contribute PM me!
  • 121
    If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni


    logo_large.jpg

    SystemRW / SuperRW (feat. MakeRW) v1.32 by lebigmac
    NEW VERSION COMING SOON! STAY TUNED!;)(y)
    ANY TALENTED C++ DEVELOPERS WANT TO CONTRIBUTE TO NEXT VERSION PLEASE CONTACT ME NOW! THANKS! :love:(y)

    Creation date: February 2021
    Updated: August 2021

    Requirements:
    • rooted STOCK Android 10 or newer (custom ROM should already be R/W!)
    • at least 10+ GB free space on phone for dumping data
    Description:
    A script for all Android power users that wish to make their read-only Android 10+ system read/write-able again to remove bloatware and make more thorough customizations to their device.
    Script only modifies super and vbmeta partitions. /data partition is not affected. It's only used for dumping data and for storing script files.
    In a nutshell this is what the script is doing:
    • dumps your existing super OR your system / product / vendor partitions depending on whether or not you've got super partition
    • extracts embedded read-only partitions (system, vendor, product...) from super if applicable
    • makes these partitions read/write-able
    • joins everything back together to new super.img OR NOT depending on whether or not you've got super partition
    • flashes read/write-able images back to device using the super fast Kolibass technique (only in recovery mode)

    NOTE:
    • Before running this experimental software on your device it is recommended to make a full backup of your device (just in case you are unlucky enough to end up in an irreversible bootloop)
    • Extract BUNDLE.zip (the included sysrw_repair.zip is only for fixing error 73!)
    • The script can be run both inside custom recovery and inside Android operating system.
      If you run script in Android mode you will need to fastboot flash the patched image(s) manually!
    • To check whether or not you've got a super partition on your device you can run this command: adb shell "ls -l /dev/block/by-name/super"
    • To check whether or not your device has the notorious 'shared_blocks' read-only feature you can run these commands:
      Bash:
      adb shell
      su
      for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol"; done
    • To check whether or not the script worked correctly you can run this code:
      Bash:
      adb shell
      su
      for a in /dev/block/dm-*; do mount -o remount,rw $a; done
    Manual installation:
    • Extract flashable.zip and copy systemrw_*VERSION* folder into /data/local/tmp/
    • run this command to make the script executable:
      chmod +x /data/local/tmp/systemrw_*VERSION*/systemrw.sh
    Automatic installation:
    Installation of the script has never been this easy!
    Download the flashable.zip below, do NOT enable zip signature verification and simply install it in your custom recovery (works in TWRP, OrangeFox and PBRP!)
    The installer binary will auto-detect whether or not your device has a super partition and launch the script accordingly with the proper command line arguments.

    Flashable zip custom usage:
    You can set these custom installation arguments in the included config.ini file.
    Simply extract the flashable.zip and modify the included config.ini file and then save the file. Then compress the systemrw_*VERSION* and META-INF folders again as a new .zip and install it in recovery.
    First line of config.ini contains the script arguments for those WITHOUT super partition.
    By default this line is completely empty (no space).
    Second line of config.ini contains the script arguments for those WITH super partition.
    For example if you already dumped your super_original.bin and want to skip that process next time you install the .zip then put this in line #2 of config.ini :
    in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=15
    Remember if you decide to use custom arguments in config.ini then the first character should always be an empty space. If no arguments are used such as by default in line #1 (no super) then the line should be completely empty, no space, nothing.

    Script usage:
    If you've got no super partition then simply call the script with no arguments from the shell (see examples below).
    If you've got a super partition I would recommend using the optional size=15 parameter as well to give some extra free space (in MB) to each partition.
    Optional script arguments:
    Replace x with your custom value
    • in=x *THIS IS IGNORED IF YOU'VE GOT NO SUPER PARTITION*
      With this flag you can specify an existing super image as input and skip the entire dumping of the super image process. Here you can use the super_original.bin which you dumped earlier with systemrw or the official unsparsed super.img from your downloaded firmware. (unsparse with simg2img). It's also possible to use your super partition block device as input.
      If omitted, systemrw will dump super image from phone to ./img/super_original.bin
      (path is relative to the script)
    • out=x *THIS IS IGNORED IF YOU'VE GOT NO SUPER PARTITION*
      With this argument you can specify the output path of the new patched super file.
      If omitted, default output value is ./img/super_fixed.bin
    • size=x *ONLY RECOMMENDED IF YOU'VE GOT SUPER PARTITION*
      With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
      If omitted, default extra size is 0 (shrink to minimum)

    Examples:
    Bash:
    adb shell
    su
    cd /data/local/tmp/systemrw_1.32
    chmod +x ./systemrw.sh
    
    # Run this command *IF YOU'VE GOT NO SUPER PARTITION*
    ./systemrw.sh
    
    # Run this command if you're first time user *AND YOU'VE GOT SUPER PARTITION*
    # Specify the extra free space in megabytes for each partition:
    ./systemrw.sh size=15
    
    # Plug an existing super image into the script like this *ONLY IF YOU'VE GOT SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin size=15
    
    # Specify both the input file as well as the output destination *ONLY IF YOU'VE GOT SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15
    
    # EXPERT EXAMPLE:
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` out=./img/super_fixed.bin size=50

    Uninstallation:
    • To free up space and keep script as well as r/w capability you can simply delete /img subfolder at /data/local/tmp/systemrw_1.32/img
    • To delete script and keep r/w capability you can simply delete whole script folder at /data/local/tmp/systemrw_1.32
    • To undo all changes performed by the script you can simply reflash original stock read-only super image and re-enable dm-verity and verification either through adb/fastboot or with the included avbctl binary (inside /tools/ subfolder - also available in recovery).

    Troubleshooting:
    If you get error 255 in custom recovery when trying to install flashable zip then try to install it manually. If you encounter this error please send me this file /tmp/recovery.log
    Make sure the script folder was correctly extracted to:
    /data/local/tmp/systemrw_*VERSION*
    If you can't run the script try making the file executable like this: chmod +x ./systemrw.sh
    If you still can't get it to work run which sh in your shell and replace the shebang in the first line of the script with the output of that command. Don't remove the first two #! symbols though. Then save the file and try again.
    Make sure you have full read write access to the /data/local/tmp directory and that the containing files are not encrypted in custom recovery!
    If you get bootloop after successfully flashing super_fixed.bin then you can undo bootloop simply by re-flashing original stock super image and re-enabling dm-verity and verification with the included avbctl binary (inside /tools/ subfolder - also available in recovery). Those are the only changes performed by the script.
    Good luck!

    About:
    I did not come up with all this by myself. After searching for a solution for countless days without success, going even as far as learning hex editing - I accidentally came across a couple of very interesting threads burried deep inside the new forum interface where this method has been described by various enthousiasts (links can be found in the credits section below). Therefore I take absolutely no credit for the underlying core mechanisms of the script. I'm only the amateur who put it all together into a compact script so that everybody can enjoy an Android system that's read/write-able again. Just like it used to be in Android 9 or earlier. Before this annoying 'shared_blocks feature' was implemented.

    Credits:
    Huge thanks to @Kolibass for allowing me to use his partition tools for Android. Without your tools this script would not work on the Android platform! This genius also showed me how to flash a 5GB file to my partition in just under 30 seconds! Much faster than fastboot! I still can't believe it!
    Big thanks to @Brepro1 for allowing me to use his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Big thanks @munjeni for allowing me to use his superunpack V1 tool in the initial version. It helped me to understand how these super images work.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the initial version which helped me to create this universal version. It's still part of the troubleshooting repair script to fix error 73.
    More thanks @gabrielfrias for his helpful comment
    Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'
    Thanks @HemanthJabalpuri for assisting me in optimizing the underlying algorithm!

    Disclaimer:
    #Disclaimer v2.0​
    This open source software is provided as is without any kind of warranty or support whatsoever.
    By using and viewing this software you agree to the following terms:
    • Under no circumstances shall the author be held responsible for any damages that may ensue from the (inappropriate) use of this software.
    • All responsibility, liability and risk lies with the end-user. You hereby agree not to abuse this software for illegal purposes.
    • Under no circumstances shall the comments & title section of the script (lines #1 - #65) as well as the included update-binary be modified or removed by the end-user without the original author's explicit consent.
    • Under no circumstances shall the end-user steal and / or abuse my entire SystemRW project or parts thereof (including but not limited to my update-binary, my script, my program logo, my program name or the names of my functions and my variables and more...) only to rename and republish my SystemRW project (or parts thereof) as his / her own without even mentioning original source or original credits!!! (yes this actually happened :( perpetrated by a fellow forum member...)
    • Unauthorized re-uploads of any files contained within this project to 3rd party websites are not permitted without the original author's prior consent! If you want to share this project with your friends just send them the link to this website. Thanks.
    • The end-user is allowed to improve the underlying algorithm (as long as no malicious code is added) and post his/her improvements, results and feedback right here in the official SystemRW project thread @ xda-developers.com
    • If the end-user wants to integrate my SystemRW project into his/her own project then he/she shall first ask me (the original author) for permission.
      If you want to make a video tutorial about my script please contact me first!
      Thank you! I can give you high resolution project logo and more!

    Please make sure to post your feedback and suggestions in the official thread right here.
    Enjoy customizing your fully read/write-able Android device! And feel free to share your Android system mods with other users in this thread! Thanks!


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


    1-jpg.5235933


    Confirmed working on these devices:

    Download v1.32 mirror #1
    Download v1.32 mirror #2
    more official download mirrors coming soon!
    current status: experimental


    If you like this project and want to support further development of SystemRW/SuperRW & the creation of more amazing projects like this then please feel free to donate to the original developer by clicking the button below. Thanks! Your support is very much appreciated!
    Donate
    13
    If the script works on your device please send me your log files from this folder:
    /data/local/tmp/systemrw_1.32/log/

    And please write your phone model - Android version - firmware version

    Then I can add you to the list of successful devices and it will be helpful for further development. Thank you!(y)
    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!