• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
Search This thread
Jul 31, 2021
9
4
ОК на Xiaomi Redmi Note 10 Pro.
Итоговая папка systemrw_1.32_BUNDLE_proper \ systemrw_1.32_flashable \ systemrw_1.32 была помещена по пути:
данные / локальные / tmp / systemrw_1.32
Я вручную сделал папку img : data / local / tmp / systemrw_1.32 / img
Затем в Termux выполняются команды:
вс
cd /data/local/tmp/systemrw_1.32
./systemrw.sh размер = 500
После завершения скрипта в папке img находим файл super_fixed.bin
Копируем в основную память телефона super_fixed.bin и переименовываем в super_fixed.img, и вшиваем в TWRP как супер раздел.
Извините за мой плохой английский.
 

Attachments

  • mylog.txt
    6.9 KB · Views: 10
Last edited:
  • Like
Reactions: lebigmac

NisseGurra

Senior Member
Nov 22, 2005
1,134
442
Xiaomi Mi Pad 4
OnePlus 8T
Hello. I don't know but the probability is pretty high that it will just work straight out of the box. Give it a try and let us know your results! Good luck!


Hi. I don't think error 73 and cow files are related. Could you please send me your log files so I can double check?
Log files can be found in /data/local/tmp/systemrw_1.32/log/
Thanks!
Did you try yet the included troubleshooting repair script (Linux only)? That usually fixes error 73.
Another possible way to fix error 73 is the @harpreet.s slot switching method described in first post troubleshooting section. Good luck!
Here are the logs, did not try the repair script yet
 

Attachments

  • mylog.txt
    7.1 KB · Views: 2
  • lpdump.txt
    2.3 KB · Views: 2
  • myargs.txt
    812 bytes · Views: 3
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
846
487
OK on Xiaomi Redmi Note 10 Pro.
The final folder systemrw_1.32_BUNDLE_proper \ systemrw_1.32_flashable \ systemrw_1.32 was put along the path:
data / local / tmp / systemrw_1.32
I manually made the img folder: data / local / tmp / systemrw_1.32 / img
Then in Termux the commands are executed:
su
cd /data/local/tmp/systemrw_1.32
./systemrw.sh size = 500
After the script finishes, in the img folder we find the super_fixed.bin file
We copy it to the main memory of the phone super_fixed.bin and rename it super_fixed.img, and sew it into TWRP as the super section.
Sorry for my bad english.

Hi @sarychev.rescue thanks for your interest in this project and for your feedback!
Congratulations! I am happy for you that my script worked successfully on your Xiaomi device!
Please feel free to post some screenshots if you want!

If you look closely at line #453 of script file (systemrw.sh) you can see that mkdir -p command argument is used to create /img directory if not exist. No need to create /img directory manually.
size=500 is a little bit crazy! I don't recommend going above 100. The lower this value the higher the chance that script will actually work ;)


Here are the logs, did not try the repair script yet
Hi @NisseGurra thanks for your log files!
Holy cow! I just checked your log and you do have a system_b-cow partition!
It looks like cow error 70 is in fact fixed simply by omitting all cow related files when calling lpmake. This is great news!

Error 73 is easy to fix using the included troubleshooting repair script (Linux only).
Simply boot into any random Linux distro's live installation disk and run troubleshooting repair script from there.
Or you could try to run it from a virtual linux machine. Simply enable your USB 2.0 and 3.0 ports in virtual machine settings.
Good luck!
 
Last edited:
  • Like
Reactions: sarychev.rescue

NisseGurra

Senior Member
Nov 22, 2005
1,134
442
Xiaomi Mi Pad 4
OnePlus 8T
Hi @sarychev.rescue thanks for your interest in this project and for your feedback!
Congratulations! I am happy for you that my script worked successfully on your Xiaomi device!
Please feel free to post some screenshots if you want!

If you look closely at line #453 of script file (systemrw.sh) you can see that mkdir -p command argument is used to create /img directory if not exist. No need to create /img directory manually.
size=500 is a little bit crazy! I don't recommend going above 100. The lower this value the higher the chance that script will actually work ;)



Hi @NisseGurra thanks for your log files!
Holy cow! I just checked your log and you do have a system_b-cow partition!
It looks like cow error 70 is in fact fixed simply by omitting all cow related files when calling lpmake. This is great news!

Error 73 is easy to fix using the included troubleshooting repair script (Linux only).
Simply boot into any random Linux distro's live installation disk and run troubleshooting repair script from there.
Or you could try to run it from a virtual linux machine. Simply enable your USB 2.0 and 3.0 ports in virtual machine settings.
Good luck!
Tested the repair script in linux, cant not get it to run at all.
I don't find any clear install instructions but even with proper abd install it can not get the script to run:

adb shell
su
chmod +x /data/local/tmp/sysrw_repair_v1.32/sysrw_repair.sh
cd /data/local/tmp/sysrw_repair_v1.32
./sysrw_repair.sh

Gives "inaccessible or not found"
 
Last edited:

lebigmac

Senior Member
Jan 31, 2017
846
487
Bash:
adb shell
su
chmod +x /data/local/tmp/sysrw_repair_v1.32/sysrw_repair.sh
cd /data/local/tmp/sysrw_repair_v1.32
./sysrw_repair.sh
Tested the repair script in linux, cant not get it to run at all.
I don't find any clear install instructions but even with proper abd install it can not get the script to run:

adb shell
su
chmod +x /data/local/tmp/sysrw_repair_v1.32/sysrw_repair.sh
cd /data/local/tmp/sysrw_repair_v1.32
./sysrw_repair.sh

Gives "no file accessible"
Your paths are wrong. Please double check again your paths. You are running this on a Linux machine right? Good luck!

Bash:
sudo su
cd /PATH_TO_WHERE_YOU_EXTRACTED_/sysrw_repair_v1.32/
chmod +x ./sysrw_repair.sh
./sysrw_repair.sh
 

NisseGurra

Senior Member
Nov 22, 2005
1,134
442
Xiaomi Mi Pad 4
OnePlus 8T
Your paths are wrong. Please double check again your paths. You are running this on a Linux machine right? Good luck!

Bash:
sudo su
cd /PATH_TO_WHERE_YOU_EXTRACTED_/sysrw_repair_v1.32/
chmod +x ./sysrw_repair.sh
./sysrw_repair.sh
Paths seems ok, can change permissions of the file.
Yes, running in ubuntu
 

Attachments

  • Screenshot_20210803-023413633.jpg
    Screenshot_20210803-023413633.jpg
    118.3 KB · Views: 405

lebigmac

Senior Member
Jan 31, 2017
846
487
screenshot_20210803-023413633-jpg.5376637


Paths seems ok, can change permissions of the file.
Yes, running in ubuntu
Are you sure? Looking at your screenshot it looks like you're trying to run this troubleshooting repair script on your phone from within root explorer, right? Please keep in mind the troubleshooting repair script is Linux only and is not designed to be run on the phone itself, unlike the systemRW script

Tested the repair script in linux, cant not get it to run at all.
I don't find any clear install instructions but even with proper abd install it can not get the script to run:
Click here for error 73 troubleshooting repair script instructions
 
Last edited:

asuhoops8628

Senior Member
Nov 9, 2011
367
64
hello, having an issue... Oneplus Nord N10 5g. Latest flashable zip appears to fail at the last step in Updating Partition Details:

Failed to mount '/system-root' (invalid argument)
Failed to mount '/vendor' (invalid argument)
Failed to mount '/product' (invalid argument)
 

lebigmac

Senior Member
Jan 31, 2017
846
487
hello, having an issue... Oneplus Nord N10 5g. Latest flashable zip appears to fail at the last step in Updating Partition Details:

Failed to mount '/system-root' (invalid argument)
Failed to mount '/vendor' (invalid argument)
Failed to mount '/product' (invalid argument)
Hi @asuhoops8628 that's not related to script or update-binary. Those are TWRP related errors.
Can you successfully boot into system after flashing super_fixed.bin?
Please send me your log files from /data/local/tmp/systemrw_1.32/log/
Thanks!

OK,Let me try,thanks
Hi @Gentisz new version of script apparently works for OnePlus devices too. Feel free to give it a try while you're at it! And please send me back your results. Thanks!
Also keep in mind you will have to restore original stock read-only super image before using each tool (SystemRW script by @lebigmac or Superrepack tool by @munjeni) as both tools pretty much do the same thing but in a different way (y)
 
Last edited:

asuhoops8628

Senior Member
Nov 9, 2011
367
64
Hi @asuhoops8628 that's not related to script or update-binary. Those are TWRP related errors.
Can you boot into system after flashing super_fixed.bin?
Please send me your log files from /data/local/tmp/systemrw_1.32/log/
Thanks


False alarm - I reflashed my rom, flashed your zip and it appears to be working!


EDIT: Confirmed working flawlessly, OnePlus Nord N10 5G
 
Last edited:
  • Love
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
846
487
False alarm - I reflashed my rom, flashed your zip and it appears to be working!


EDIT: Confirmed working flawlessly, OnePlus Nord N10 5G
That's wonderful news for OnePlus users! Could you please upload a screenshot here in this thread and send me your log files? Thanks! You can send me logs through PM if you want.

Then I can add your device to the list of successful devices on first page! (y)✅

Try remounting your partitions as r/w like this:
Bash:
adb shell
su
for x in / /product /vendor; do mount -o remount,rw $x; done

1-jpg.5235933
 
Last edited:

bseosbseos

Member
Aug 3, 2021
16
6
I have installed/flashed my custom kernel with "EX Kernel Manager"

Is it possible to flash this script with EX Kernel manager or is it advised to use TWRP only?
Ok, so i managed to find an test version of TWRP compatible with Android 11 for my phone (Pixel 4 XL).

However I'm getting this error when i try flashing the image.

WhatsApp Image 2021-08-04 at 4.44.30 PM.jpeg


EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 
Last edited:

Danmann

Senior Member
Jan 11, 2015
481
122
pwoss.org
Hey

I just tried your script manually on Ulefone Armor X7 Pro phone.
The phone has only the possibility for root. TWRP might be possible but I haven't done it yet.
The script hasn't shown any major errors or at all. Check the logs.
So i flashed it:
Code:
fastboot flash super super_fixed.bin

But the system is still read only.


Any suggestions?
Thanks!
 

Attachments

  • lpdump.txt
    1.1 KB · Views: 1
  • mylog.txt
    4.4 KB · Views: 3

lebigmac

Senior Member
Jan 31, 2017
846
487
Ok, so i managed to find an test version of TWRP compatible with Android 11 for my phone (Pixel 4 XL).

However I'm getting this error when i try flashing the image.

View attachment 5377661
Hi @bseosbseos I can't find the error in your screenshot.
Please send me this file from your recovery /tmp/recovery.log

Hey

I just tried your script manually on Ulefone Armor X7 Pro phone.
The phone has only the possibility for root. TWRP might be possible but I haven't done it yet.
The script hasn't shown any major errors or at all. Check the logs.
So i flashed it:
Code:
fastboot flash super super_fixed.bin

But the system is still read only.


Any suggestions?
Thanks!
Hi @Danmann. First of all I'm happy the script didn't cause bootloop on your device.
Unfortunately your device have no shared_blocks (read-only) feature so script doesn't know what to do. Some other security feature is preventing your device from being mounted as r/w. If you figure out what's forcing your device to remain locked in read-only state please let us know! Thanks! Good luck!
 
Last edited:

bseosbseos

Member
Aug 3, 2021
16
6
Hi @bseosbseos I can't find the error in your screenshot.
Please send me this file from your recovery /tmp/recovery.log
Uploaded here: https://pastebin.com/pKycev6A

EDIT:

Confirmed working! on Google Pixel 4 XL on stock Android 11, rooted with magisk and on Kirisakura kernel with the following argument
Code:
size=50
Using the default size=15 would result in error "write error: no space left on device in system" when editing system partition.
 
Last edited:
  • Like
Reactions: lebigmac

Top Liked Posts

  • 1
    @lebigmac sir one more update I'm run this script in system mode and it did rebuild my super but when I'm flash super_fixed as fastboot flash super super_fix.img my device not boot anymore it always reboot to bootloader I'm disable all vbmeta verity and verification too but it give reboot to bootloader it seems Realme UI custom partition My_Product massed or corrupt coz driver not loading from that. Can you help me.. I Wanna be make it r/w.. thanks in advance logs attached here..
  • 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
    @lebigmac sir one more update I'm run this script in system mode and it did rebuild my super but when I'm flash super_fixed as fastboot flash super super_fix.img my device not boot anymore it always reboot to bootloader I'm disable all vbmeta verity and verification too but it give reboot to bootloader it seems Realme UI custom partition My_Product massed or corrupt coz driver not loading from that. Can you help me.. I Wanna be make it r/w.. thanks in advance logs attached here..
  • 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 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.

    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 BUNDLE.zip (NOTE: the included sysrw_repair.zip is only for fixing error 73!)
    • 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!
    If you experience bootloop after successfully flashing super_fixed.bin then your device probably has extra protection features that prevent it from booting modified super images. Try to undo bootloop simply by flashing original stock super image. You might have to flash stock vbmeta as well. Good luck!

    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