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

lebigmac

Senior Member
Jan 31, 2017
843
486
@Leandro344 @wv8023

Okay folks I just uploaded a long overdue hotfix for you.
This should fix error signal 6 and maybe also error 255 in recovery. Thanks for all the feedback you guys gave me!
This time I've included the official platform-tools in the sysrw_repair tools subfolder.
Error 73 and 70 still need to be fixed within the script.
Check first post for download link. Enjoy!

Warning to OnePlus users: COW error is not fully fixed yet! Make sure you backup your original super before flashing!
 
Last edited:
Okay folks I just uploaded a long overdue hotfix for you.
This should fix error signal 6 and maybe also error 255 in recovery. Thanks for all the feedback you guys gave me!
This time I've included the official platform-tools in the sysrw_repair tools subfolder.
Error 73 and 70 still need to be fixed...
Check first post for download link. Enjoy!

Warning to OnePlus users: COW error is not fully fixed yet! Make sure you backup your original super before flashing!
Awesome! An amazing feat in and of itself. You sir are A GOD!
 
  • Haha
Reactions: lebigmac

rakoncwy

Member
Jul 17, 2021
27
11
I tried it on Realme GT, but the same symptom.
boot infinite loop.

And it cannot be restored with the "super_original.bin" file.

Realme gt does not have a proper recovery tool, so recovery is very difficult.
 

Attachments

  • mylog.txt
    4.4 KB · Views: 8
  • lpdump.txt
    6 KB · Views: 2
  • Sad
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
843
486
@wv8023

Make sure you have created a img folder inside the systemrw folder. The script won't make one for you, so it just fails to dump super_original.
@tha_mechanic That's not true. The script will try to create ./img folder in current path if it doesn't exist.
And the sysrw_repair script is bundled together with the img folder ;)

I tried it on Realme GT, but the same symptom.
boot infinite loop.

And it cannot be restored with the "super_original.bin" file.

Realme gt does not have a proper recovery tool, so recovery is very difficult.

@rakoncwy Your log looks very unusual.

To undo the boot loop you could try reactivating the verity and verification as well as restoring original stock super image.
Sometimes messing with the vbmeta can cause boot loop.

Just boot into recovery and try reactivating verity and verification using the avbctl program that's included in the script's tools subfolder.

If your device have no custom recovery simply flash the stock vbmeta.img and stock super.img using fastboot. You can download these files from your device manufacturer's website.
This should re-enable both dm-verity and verification.

The script only modifies super partition and vbmeta partition.

Good luck!
 
Last edited:
Your log looks very unusual.

To undo the boot loop you could try reactivating the verity and verification as well as restoring original stock super image.
Sometimes messing with the vbmeta can cause boot loop.

Just boot into recovery and try reactivating verity and verification using the avbctl program that's included in the script's tools subfolder.

If your device have no custom recovery simply flash the stock vbmeta.img and stock super.img using fastboot. You can download these files from your device manufacturer's website.
This should re-enable both dm-verity and verification.

The script only modifies super partition and vbmeta partition.

Good luck!
HaHa😂?? What's so funny Mr Hamburger? Hmmm? I congratulate u on overcoming a hurdle in these hard times, and you laugh at me? Phh! Whatever!,,....................,...................Lulz
 
Last edited:
  • Haha
Reactions: rhewins2268

DeathShot9

Senior Member
Sep 4, 2015
64
15
Boston
It looks like the maximum amount of downloads per day was reached (70).
I've attached the download to this post. Enjoy!
Thank you.

I am trying to run this on my Xperia 1II. I just used Newflahser to flash the latest Android 11 US firmware from XperiFirm (58.1.A.5.222-R6B) and I installed Shinyquagsire24's TWRP but when I run the script it says:

Code:
Installing zip file '/sdcard/Download/systemrw_1.32_BUNDLE.zip'
Unmounting System...
tw_has_recovery_partitio
E: Unable to open block device /dev/block/loop19: No such device or address
E: Unable to open block device /dev/block/loop19: No such device or address
E: Unable to open block device /dev/block/loop18: No such device or address
E: Unable to open block device /dev/block/loop17: No such device or address
Error installing zip file '/sdcard/Download/systemrw_1.32_BUNDLE.zip'
Updating partition details...
...done
 

lebigmac

Senior Member
Jan 31, 2017
843
486
HAHAHAHA. Okay, it's running now, I'll let you know how it goes. Thanks :)

Edit: Got Error 73. NBD, I don't have time to boot into Linux right this minute, but I'll do it later tonight.
Before you run the linux repair script please open the sysrw_repair.sh script file with text editor and change version number from 1.31d to 1.32 and save file.
I forgot to do that!
 
Last edited:
  • Like
Reactions: DeathShot9

DeathShot9

Senior Member
Sep 4, 2015
64
15
Boston
Before you run the linux repair script please open the sysrw_repair.sh script file with text editor and change version number from 1.31d to 1.32 and save file.
I forgot to do that!
I woke up, finally booted up Ubuntu MATE on my laptop, thought it was going to be a nightmare to get working, then one sudo apt-get install android-sdk-platform-tools and adb devices later and I'm running the script. Script does its thing, restarts phone, './img/super_fixed.bin':no such file or directory.

Immediately I get on here, don't read your reply, and start reading through every page in the thread until I get to your reply. I updated the script version number and found my phone was at 5% battery xD

Recharging phone and laptop, going to try again in a few minutes!
Edit: this time I got a popup saying I don't have enough storage on my drive, is there a workaround for this, or do I need to make a larger live USB with persistent storage?

Edit 2: Tried a VM last night, it didn't work, so this time I decided to read the error more carefully, it turns out VMWare defaults to a USB 2 controller which doesn't work with my phone. Setting it up to USB 3.1, got it to work. The only thing is once it restarts and the phone reconnects it doesn't get registered in fastboot and just sits on <waiting for any device>. I guess my next step for now is to try a larger live disk.

Edit 3: Without going into too many details, Ubuntu live managed to physically damage my laptop, and I'm very upset. Is there any way to do this without Linux?
 
Last edited:
  • Wow
Reactions: lebigmac

DeathShot9

Senior Member
Sep 4, 2015
64
15
Boston
Sorry for the double post but I think at this point it's better to just start fresh.

I had to step away because the runaway shutdown script that cooked my laptop really got me upset but I got around to testing it and I am having the same problem with the live system as I did my VM. I am thinking that this might be a Sony thing. Sony has their bootloader and also their download mode which work slightly differently than a lot of other android systems.

Right now it's all speculation, so I'm uploading the logs for reference. I don't see the super_fixed.bin file anywhere. How do I preserve it or generate it so that I can try and flash it manually?
 

Attachments

  • log.txt
    2.2 KB · Views: 2
  • lpmake_output.txt
    879 bytes · Views: 2
  • myargs.txt
    868 bytes · Views: 3
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
843
486
Hi @DeathShot9 thanks for your feedback. Apparently I didn't thoroughly test the sysrw_repair script before release 🤦‍♂️🌴
In your sysrw_repair log something is wrong. Let's solve the problem together ;)

Initiating procedure...
Pulling all *.img files from phone to ./img folder. Please wait...
/data/local/tmp/systemrw_1.32/img/odm_a.img: 1 file pulled, 0 skipped. 94.3 MB/s (1499136 bytes in 0.015s)
/data/local/tmp/systemrw_1.32/img/odm_b.img: 1 file pulled, 0 skipped.
/data/local/tmp/systemrw_1.32/img/product_a.img: 1 file pulled, 0 skipped. 126.7 MB/s (1617293312 bytes in 12.169s)
/data/local/tmp/systemrw_1.32/img/product_b.img: 1 file pulled, 0 skipped.
/data/local/tmp/systemrw_1.32/img/system_a.img: 1 file pulled, 0 skipped. 91.3 MB/s (2091855872 bytes in 21.859s)
/data/local/tmp/systemrw_1.32/img/system_b.img: 1 file pulled, 0 skipped. 6.1 MB/s (374607872 bytes in 58.431s)
/data/local/tmp/systemrw_1.32/img/vendor_a.img: 1 file pulled, 0 skipped. 12.8 MB/s (966987776 bytes in 72.008s)
/data/local/tmp/systemrw_1.32/img/vendor_b.img: 1 file pulled, 0 skipped.

Pulling myargs.txt file from phone to current folder
/data/local/tmp/systemrw_1.32/log/myargs.txt: 1 file pulled, 0 skipped. 0.4 MB/s (868 bytes in 0.002s)

Attempting to run lpmake for linux using arguments from myargs.txt. Please wait...
lpmake I 07-25 17:57:23 37563 37563 builder.cpp:1012] [liblp]Partition system_a will resize from 0 bytes to 2091855872 bytes
lpmake I 07-25 17:57:23 37563 37563 builder.cpp:1012] [liblp]Partition system_b will resize from 0 bytes to 374607872 bytes
lpmake I 07-25 17:57:23 37563 37563 builder.cpp:1012] [liblp]Partition product_a will resize from 0 bytes to 1617293312 bytes
lpmake I 07-25 17:57:23 37563 37563 builder.cpp:1012] [liblp]Partition vendor_a will resize from 0 bytes to 966987776 bytes
lpmake I 07-25 17:57:23 37563 37563 builder.cpp:1012] [liblp]Partition odm_a will resize from 0 bytes to 1499136 bytes
lpmake E 07-25 17:57:23 37563 37563 images.cpp:448] [liblp]open image file failed: /data/local/tmp/systemrw_1.32/img/system_a.img: No such file or directory
lpmake E 07-25 17:57:23 37563 37563 images.cpp:326] [liblp]Could not open image for partition: system_a

Successfully created patched super image at /home/ubuntu-mate/Desktop/sysrw_repair_v1.32/img/super_fixed.bin

Rebooting phone into bootloader for flashing super_fixed.bin...
There was a problem flashing the super partition

Apparently the files were pulled correctly from phone but the paths are wrong. Please allow me to fix that for you.
Try this fixed version of the sysrw_repair script. Better luck this time!

If this actually works I'll update the first post and reupload the whole BUNDLE.
Done
 

Attachments

  • sysrw_repair_v1.32_proper.zip
    9.3 MB · Views: 23
Last edited:
  • Like
Reactions: DeathShot9

DeathShot9

Senior Member
Sep 4, 2015
64
15
Boston
Hi @DeathShot9 thanks for your feedback. Apparently I didn't thoroughly test the sysrw_repair script before release 🤦‍♂️🌴
In your sysrw_repair log something is wrong. Let's solve the problem together ;)



Apparently the files were pulled correctly from phone but the paths are wrong. Please allow me to fix that for you.
Try this fixed version of the sysrw_repair script. Better luck this time!

If this actually works I'll update the first post and reupload the whole BUNDLE.
Running the script right now, I'll update this with the result.
Edit 1: it's been throwing some "Invalid sparse file format at header magic" messages, but it's still doing something, since the directory size is growing, so I'm letting it run.

Edit 2:
Congratulations! Successfully flashed the super partition Your partitions should now have rw capability

XQ-AT51:/ $ ls -l /dev/block/by-name/super lrwxrwxrwx 1 root root 16 1970-12-27 04:34 /dev/block/by-name/super -> /dev/block/sda89
 

Attachments

  • log.txt
    1.4 KB · Views: 5
Last edited:
  • Like
Reactions: lebigmac

DeathShot9

Senior Member
Sep 4, 2015
64
15
Boston
The only issue i got on using this flashable fix was i cant mount vendor partition but system and product partition can be modified and are mountable
Same. I just finished de-bloating all the system apps but I'm stuck with "Title 3 months free trial" (yeah, that's the actual name of the app), linkedin, and some random "call of duty" that is already old. I'm crossing my finger this script might be modifiable to fix /oem, if not then I know that for the Xperia 1II the Russian firmware does not have the "/oem" partition and so if I scrap everything I've done, and flash that, I won't have to deal with it. I prefer not to use the Russian one though because I lose some functionality with my carrier in the US.

When I try mount -o remount,rw /oem I get '/dev/block/bootdevice/by-name/oem_a' is read-only
 
  • Like
Reactions: lebigmac

Top Liked Posts

  • 1
    - extract Bundle
    - Flash the flashable file
    - beeing happy

    amazing work

    testet with Poco F1

    on /system/media I can create/rename new Files, but not move via root explorer why ?






    on my redmi Note 10 Pro I got an error via TWRP, so I did it via adb
    what is a super partition ?how I can check it ?


    tried:

    adb shell
    cd /data/local/tmp/systemrw_1.32
    chmod +x sytemrw.sh
    ./systemrw.sh

    finally I got my rw system


    I don't have to do this:

    su
    mount -o remount,rw /
    mount -o remount,rw /system
    mount -o remount,rw /product
    mount -o remount,rw /vendor

    right ?
    1
    - extract Bundle
    - Flash the flashable file
    - beeing happy

    amazing work

    testet with Poco F1

    on /system/media I can create/rename new Files, but not move via root explorer why ?






    on my redmi Note 10 Pro I got an error via TWRP, so I did it via adb
    what is a super partition ?how I can check it ?


    tried:

    adb shell
    cd /data/local/tmp/systemrw_1.32
    chmod +x sytemrw.sh
    ./systemrw.sh

    finally I got my rw system


    I don't have to do this:

    su
    mount -o remount,rw /
    mount -o remount,rw /system
    mount -o remount,rw /product
    mount -o remount,rw /vendor

    right ?
    Hi. Thanks for your feedback.

    on /system/media I can create/rename new Files, but not move via root explorer why ?

    Usually if you can only rename system files or create empty system files this means you must run script again with larger custom size. Try for example size=50 or size=100
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=50

    Regarding error 255 in some recoveries this is already fixed in next version ;)

    Enjoy a fully read/writeable device!
    1
    hey @lebigmac! i finally figured out the issue. basically, i'd extracted systemrw_1.32_flashable.zip into a folder in /data/local/tmp called "systemrw_1.32", making the directory structure look like this:
    Code:
    data/
    ├─ local/
    │  ├─ tmp/
    │  │  ├─ systemrw_1.32/
    │  │  │  ├─ systemrw_1.32/
    │  │  │  │  ├─ tools/
    │  │  │  │  ├─ config.ini
    │  │  │  │  ├─ systemrw.sh
    as a result, systemrw.sh was unable to find the tools directory because it was actually located in a subdirectory within the expected directory, which the script obviously doesn't know about as the location is hardcoded as "/data/local/tmp/systemrw_1.32/".

    so after moving everything in that rogue subdirectory up one directory, so it looked like this (as intended) :

    Code:
    data/
    ├─ local/
    │  ├─ tmp/
    │  │  ├─ systemrw_1.32/
    │  │  │  ├─ tools/
    │  │  │  ├─ config.ini
    │  │  │  ├─ systemrw.sh

    the script finally worked! (see attached logs).

    i booted into twrp and flashed the images, and my system is now finally(!) r/w!

    sorry for the wild goose chase there, and i send my sincerest thanks over to you and everyone else who made this possible! :3
    1
    Hi @Ricardo Cruz. Thanks for your feedback. It looks like your device is not recognized by adb?

    Did you get the sysrw_repair script to work inside your Linux environment? What was the problem?

    Was super_fixed.bin created successfully and did you fastboot flash it to your super partition yet?
    What is the result? Can you do this now?

    1-jpg.5235933



    Hi @krasevalex. Thanks for your feedback. Please send me your log files from this folder. Thanks.
    /data/local/tmp/systemrw_1.32/log/

    You can successfully boot device after flashing super_fixed.bin AND you can remount partitions as R/W? That sounds like a success to me. Congratulations!

    I think you need to run script again with larger custom size and generate new super_fixed.bin with the repair script and fastboot flash it manually to your super partition.
    After that everything should work as expected.

    Bash:
    adb shell
    su
    cd /data/local/tmp/systemrw_1.32
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=50


    /system is only in Android 9 and earlier. In Android 10+ it's called /
    I repeated all procedure (./systemrw.sh size=50 => error code 73 in the phone => repair script in Ubuntu) and result this time is very good. The system is RW, nothing wrong with build.prop. Now I have full root. :)
    So far everything's great. Thank you very much for this script.
  • 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
    1
    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.
    Hi. Thanks for your feedback. I'm happy that script works on your Motorola Moto G30 device.
    Hopefully we can make the linux-only sysrw_repair script obsolete in one of the next versions. I think error 73 is caused by very stubborn selinux settings. Completely disabling selinux should fix this annoying error 73.
    If anyone knows how to do this please contact me. Thanks!

    Good afternoon, your systemrw patch is not working on hentaiOS. the log forgot to do, but I guess it's because of several "dev / block / mapper / vendor" "vendor-cow" "vendor-base" "system" "system-cow" "system-base" "product" "product- cow "" product-base "

    Poco f3.
    Hi. Can you please send me log files and I will try to fix it! Thanks.
    What exactly you mean by not working?

    What exactly is hentaiOS ? Is this custom ROM?
    Poco F3 is a very nice device! You are lucky.

    Confirmed working on Moto G Power 2021 (borneo) using the repair script. Beautiful work! Thank you!
    Hi. I'm happy that script works on your Motorola Moto G Power 2021 (borneo) device using a combination of both the SystemRW script as well as the included sysrw_repair script (linux-only).
    Enjoy debloating and customizing your fully read/write-able device!

    Hi. What exactly do you mean? Please show me screenshot and log files. Thanks!

    Just ran this on my Pixel 4a and i believe it worked. Logs attached
    Hi @rhewins2268 thanks for your feedback! I'm happy that script works flawlessly on your Pixel 4a device. This is wonderful news!
    How have you been enjoying your fully read/write-able system so far? Did you debloat and customize it yet?

    Works for me perfectly
    Device infinix hot 10 x682b
    Android Verizon 10
    Flashing twrp
    Hi. I'm happy that script works on your Device infinix hot 10 x682b.
    How do you like that device? I've never heard of it.
    Enjoy debloating and customizing your fully read/write-able device!

    Thanks. Tried it but doesn't work for me (Redmi Note 9).
    After flashing the updated super image I have bootloop.
    If using twrp I get an error related to unzip.
    Hi. Bootloop it's always very sad. Can you fix bootloop simply by restoring original stock super image to super partition block device?

    Which MIUI version are you using?
    Please send me your log files from this folder: /data/local/tmp/systemrw_1.32/log/
    Thanks!

    Regarding the TWRP installer error. Did you properly decrypt and mount /data partition before launching script installer?

    Works on Poco F3. But after flashing I tried card emulator pro and it created empty files in /vendor/etc. Tried to restore from backup and when I copied I didn't have error, but files are still empty. Have to double check, it has rw, otherwise files would not be empty.

    What is other file in zip (sysrw proper)?

    Edit: error is No space left on device:
    at /data/media/0/a/libnfc-nxp-pnscr.conf > ./libnfc-nxp-pnscr.conf <
    cat: xwrite: No space left on device
    1|alioth:/vendor/etc # reboot
    Edit 2: Solved with changing size from 15 to 100
    Poco F3 confirmed working :)

    Hi @zogu I'm happy that script works on your Xiaomi Poco F3 device simply by increasing custom size parameter from 15 to 100 megabytes. That's wonderful news!
    Please send me your log files from this folder: /data/local/tmp/systemrw_1.32/log/
    Thanks!
    Enjoy debloating and customizing your fully read/write-able Xiaomi device!
    1
    Hi. Bootloop it's always very sad. Can you fix bootloop simply by restoring original stock super image to super partition block device?
    Too late, I had to flash stock image again
    Which MIUI version are you using?
    I had 12.0.4.0
    Please send me your log files from this folder: /data/local/tmp/systemrw_1.32/log/
    Again, too late :)
    Regarding the TWRP installer error. Did you properly decrypt and mount /data partition before launching script installer?
    No, it's the first time I read about that.
    I will retry again in a couple of days and let you know about the result.
    Thanks
    1
    1
    Hi @Ricardo Cruz. Thanks for your feedback. It looks like your device is not recognized by adb?

    Did you get the sysrw_repair script to work inside your Linux environment? What was the problem?

    Was super_fixed.bin created successfully and did you fastboot flash it to your super partition yet?
    What is the result? Can you do this now?

    1-jpg.5235933



    Hi @krasevalex. Thanks for your feedback. Please send me your log files from this folder. Thanks.
    /data/local/tmp/systemrw_1.32/log/

    You can successfully boot device after flashing super_fixed.bin AND you can remount partitions as R/W? That sounds like a success to me. Congratulations!

    I think you need to run script again with larger custom size and generate new super_fixed.bin with the repair script and fastboot flash it manually to your super partition.
    After that everything should work as expected.

    Bash:
    adb shell
    su
    cd /data/local/tmp/systemrw_1.32
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=50


    /system is only in Android 9 and earlier. In Android 10+ it's called /
    I repeated all procedure (./systemrw.sh size=50 => error code 73 in the phone => repair script in Ubuntu) and result this time is very good. The system is RW, nothing wrong with build.prop. Now I have full root. :)
    So far everything's great. Thank you very much for this script.
  • 97
    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 send me your log files from this folder:
    /data/local/tmp/systemrw_1.32/log/

    Then I can add you to the list of successful devices and it will be helpful for further development. Thank you!
    6
    New version 1.20 is ready! DOWNLOAD HERE
    Good news for those that don't have TWRP or couldn't get it to work in their TWRP. Now the script can also be run directly inside Android. Keep in mind that you will have to flash the patched images manually in this case using fastboot flash.

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

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

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

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

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