• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory
Search This thread

Greenspoof

Senior Member
May 28, 2020
79
18
Belgique
Did you try option A yet?
Well, I think I will abandon lol. I tried both your solution, before and after running the script manually because I wasn't sure how would I do it.
If I run manually the script 1.31d then your solution, I have on both the error : Invalid sparse file format at header magic and no super_fixed.img in IMG folder.
The script doesn't run, the error is instant

If I run your solution without running first your script (1.31d), then I have on your first solution : can't create ./IMG/system_a-cow.img : No such file or directory
On second solution : ./tools/lpmake : can't execute : permission denied. I was in SU and I tried to modify attributes of tools folder but still.

I'm sorry, I'm a big noob so I'm not sure it will help you. I don't have log for both because script doesn't run. Only log I have is when I first run your 1.31d script, but you already have them.

I think I will simply try to fix the error 6 via twrp, because I don't have enough knowledge to bypass this cow related stuff (but what I don't understand is that a another Poco f3 user manually used your script and it worked)

Thx anyways for your time. If you have a solution for error 6 on twrp I will take it !
(Like said before, twrp is decrypted and data already checked in mount in twrp)

Sorry I can't help you with this cow related stuff
 

012345678

Senior Member
May 25, 2017
136
64
Deep Inside Hell
Xiaomi Mi 11 Ultra
can confirm it works on Mi11 Ultra

with that lines in adb shell over pc:

C:\Program Files (x86)\Minimal ADB and Fastboot>adb shell
su
cd /data/local/tmp/systemrw_1.31d
./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=15






systemrw: Custom input detected: /dev/block/sda29
systemrw: Custom size detected: 15 MB
systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: Xiaomi Mi 11 Ultra
systemrw: Current Android version: 11
systemrw: Current SELinux status: Permissive
systemrw: Current slot is: 0
systemrw: Your super partition is located at: /dev/block/sda29

ect.....


thanks
 
  • Love
Reactions: lebigmac

joetbd

Member
Sep 25, 2017
18
3
I got error 73 on a rooted/twrp Moto Stylus (2020 version) running Android 10. So now I need to use Linux to patch. But I am poor at using linux (I am running ubuntu on a thumb drive).

I installed ADB by simply dropping the Platform-Tools folder onto my computer, and launching a terminal window. i do not know what I am doing

I tried launching sysrw_repair, but it gives me adb and fastboot errors.
not installed.jpg
Error73.jpg
 
  • Wow
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
783
441
Hi @Greenspoof why you not run possible cow solution that I gave you earlier (option A) while phone is booted into Android just like you did when you ran script for the first time? You were on the right track!



Hi @joetbd just download the official platform-tools for linux and drop the adb and fastboot binaries into the sysrw_repair/tools/bin subfolder
Now open sysrw_repair.sh with notepad and replace all occurences of adb with this:
./tools/bin/adb

same thing for fastboot. Save file and try again. Good luck!



Hi @012345678 I'm happy it works for you. Does your device have cow files? Could you please send me your log files? Thank you. It helps with further development!
 
Last edited:
  • Like
Reactions: joetbd

012345678

Senior Member
May 25, 2017
136
64
Deep Inside Hell
Xiaomi Mi 11 Ultra

Hi @Greenspoof why you not run possible cow solution that I gave you earlier (option A) while phone is booted into Android just like you did when you ran script for the first time? You were on the right track!



Hi @joetbd just download the official platform-tools for linux and drop the adb and fastboot binaries into the sysrw_repair/tools/bin subfolder
Now open sysrw_repair.sh with notepad and replace all occurences of adb with this:
./tools/bin/adb

same thing for fastboot. Save file and try again. Good luck!



Hi @012345678 I'm happy it works for you. Does your device have cow files? Could you please send me your log files? Thank you. It helps with further development!



where can i find these cow files
 

Attachments

  • mi11ultra.txt
    8.1 KB · Views: 14
Last edited:
  • Like
Reactions: lebigmac

Greenspoof

Senior Member
May 28, 2020
79
18
Belgique
Hi @Greenspoof why you not run possible cow solution that I gave you earlier (option A) while phone is booted into Android just like you did when you ran script for the first time? You were on the right track!



Hi @joetbd just download the official platform-tools for linux and drop the adb and fastboot binaries into the sysrw_repair/tools/bin subfolder
Now open sysrw_repair.sh with notepad and replace all occurences of adb with this:
./tools/bin/adb

same thing for fastboot. Save file and try again. Good luck!



Hi @012345678 I'm happy it works for you. Does your device have cow files? Could you please send me your log files? Thank you. It helps with further development!
That's what I did ?
Hi @Greenspoof why you not run possible cow solution that I gave you earlier (option A) while phone is booted into Android just like you did when you ran script for the first time? You were on the right track!



Hi @joetbd just download the official platform-tools for linux and drop the adb and fastboot binaries into the sysrw_repair/tools/bin subfolder
Now open sysrw_repair.sh with notepad and replace all occurences of adb with this:
./tools/bin/adb

same thing for fastboot. Save file and try again. Good luck!



Hi @012345678 I'm happy it works for you. Does your device have cow files? Could you please send me your log files? Thank you. It helps with further development!
That's what I did ? I wrote the result on my previous comment, it was made manually. After running 1.31d then your solution, I got as result : : Invalid sparse file format at header magic and no super_fixed.img in IMG folder.
If I run your solution only, without running 1.31d before, I have as result: first solution : can't create ./IMG/system_a-cow.img : No such file or directory
On second solution : ./tools/lpmake : can't execute : permission denied.
 
  • Wow
Reactions: lebigmac

joetbd

Member
Sep 25, 2017
18
3


Hi @joetbd just download the official platform-tools for linux and drop the adb and fastboot binaries into the sysrw_repair/tools/bin subfolder
Now open sysrw_repair.sh with notepad and replace all occurences of adb with this:
./tools/bin/adb

same thing for fastboot. Save file and try again. Good luck!
i did a find/replace all for "adb" and "fastboot"

i ran sysrw_repair and it seemed to successfully create a super_fixed.bin file in the img folder

but when the repair script rebooted the phone to flash the image, it stopped at <waiting for any device>

after waiting (and nothing happened) I advanced the phone passed the bootloader screen, to the recovery screen. it was still waiting for any device
20210624_213946_HDR_1.jpg


I dont know what to do with my newly created super_fixed.bin file
 
  • Like
Reactions: lebigmac

joetbd

Member
Sep 25, 2017
18
3
I flashed the fixed super file using windows/adb command prompt. Im not sure it it worked. i can not write to the system partition yet (but that might be a limitation of my file manager. i will need to test more
20210625_022758_1.jpg

I am getting mixed results. I can rename existing files on the system partition. But I can not write new files to it
 
Last edited:

Greenspoof

Senior Member
May 28, 2020
79
18
Belgique
I flashed the fixed super file using windows/adb command prompt. Im not sure it it worked. i can not write to the system partition yet (but that might be a limitation of my file manager. i will need to test moreView attachment 5347397
I am getting mixed results. I can rename existing files on the system partition. But I can not write new files to i

I flashed the fixed super file using windows/adb command prompt. Im not sure it it worked. i can not write to the system partition yet (but that might be a limitation of my file manager. i will need to test moreView attachment 5347397
I am getting mixed results. I can rename existing files on the system partition. But I can not write new files to it
Add more size on the script command. Your current size is probably 0, so you can't add anything new, only modify
 
  • Like
Reactions: lebigmac

joetbd

Member
Sep 25, 2017
18
3
Add more size on the script command. Your current size is probably 0
That seems sound. Because I can delete, rename, and create new zero sized files.
But I dont know anything about scripts or coding. Do I need to start over, Or can I modify the partitions as they are now?

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

Greenspoof

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

*also, if I delete existing system files, will that create free space?
Did you run the script manually or via twrp?
I think you have to run again but I'm not sure so maybe wait for people more experienced. To add size, it's not totally the same way between script run manually and twrp.
Also for your question about deleting system file, I think it would be wiser to change the size via the script
 

joetbd

Member
Sep 25, 2017
18
3
Did you run the script manually or via twrp?
I think you have to run again but I'm not sure so maybe wait for people more experienced. To add size, it's not totally the same way between script run manually and twrp.
Also for your question about deleting system file, I think it would be wiser to change the size via the script
I ran the script in twrp
but I got the error code 73 (like so many other people)
at that point the script had extracted the individual partitions but not rejoined them
so I ran linux on a thumb drive, and used lebigmac's repair file
that created the "fixed" super .bin file
I then flashed the fixed bin back to the phone with a windows PC running ADB fastboot (because fastboot was not recognizing my device in linux, after the phone rebooted)

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


*FYI - it does seem like deleting files does free up room. After deleting a system wallpaper file, I was able to copy a file to the system partition
 
Last edited:
  • Like
Reactions: lebigmac

LORENZ123456

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

version-x

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

any tips for this issue?
 

lebigmac

Senior Member
Jan 31, 2017
783
441
Hi @version-x please send me your log files. Thank you.

Does your super partition have cow files inside?

I'm starting to think that device manufacturers noticed this workaround and made it impossible on newer devices? I could be totally wrong and it's still possible to do it on newer devices. More research is required.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    @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!
    4
    My friends I am so busy with real things lately. Not virtual things. I will try to reply to every comment when I have a little bit more time. Thank you for your patience!

    Don't forget new version is coming soon. This summer. Stay tuned!

    And it will be much more clean and simple and less automatic installation errors. And hopefully we can finally fix that annoying cow error for the OnePlus users! Oh yeah and the error 73 ;)

    Dear @lebigmac are these errors in TWRP expected ? Do you know how to get rid of those?

    Hi @a.dibacco That's just a warning and can be safely ignored.

    @lebigmac hi thanks for your awesome work but i need your your guidance I'm Rog 3 user with own super img so i will make this command first./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15 and after this chmod +x /data/local/tmp/systemrw_*VERSION*/systemrw.sh?

    Hello @xaloundros You're welcome!
    Try like this. Good luck!
    Bash:
    adb shell
    cd /data/local/tmp/systemrw_1.31d
    chmod +x ./systemrw.sh
    ./systemrw.sh in=./PATH/TO/YOUR/SUPER/PARTITION/IMAGE size=15
    2
    A bit of offtopic... android is a spy os created to collect personal belongings and habits and pass it on to companies that live off all that data, and even data when you wake up at night to go to the toilet. This RO partition lock in recent android is so pathetic that I'm speechless. This RO is made to make it harder to wipe the faeces that float in the android, and things will go on indefinitely and it will be harder and harder to be able to do anything. What they will invent in android 12 and 13, I can't imagine but this is slowly becoming a brutal violation of personal ownership of the phone.
    1
    I agree 100%.... The dev community has become significantly smaller. Unfortunately, with that too many of the talented, knowledgeable, and active devs are now acting like the "elite" types they used to loathe. Irony at it's finest IMO. Thank Dog that there are still devs like LeBigMac on the scene keepin' it real... Putting their skills to work for the 'right reasons' while remaining grounded, and willing to help others out along the way.

    If I'm not mistaken, you are working with a Motorola device.. Correct? I am as well... Mine's a Moto G9+. So if you happen to get this error 73 issue licked please let me know, and I will be sure to do the same.

    Here's a link to a group of devs who are great people and willing to help people with most any issue. They are very knowledgeable, and ... Just good ppl. Hit em up next time you find yourself stuck with nowhere to turn.

    Yea edge + . I will do
    1
    @lebigmac

    Hey remember I messaged you a while back and posted on this thread that I did get it to work successfully. I also added a step by step on how I got it to work a few pages back. I believe @Keven11 got it to work as well
  • 79
    If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni



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

    Creation date: February 2021
    Updated: July 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.

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

    Script usage:
    If you've got no super partition then simply call the script with no arguments from the shell (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 images manually!
    Optional arguments: (replace x with your custom value)
    • in=x : *THIS IS IGNORED IF YOU HAVE NO SUPER PARTITION*
      With this flag you can specify an existing super image as input and skip the entire dumping of the super image process. Here you can use the super_original.bin which you dumped earlier with systemrw or the official unsparsed super.img from your downloaded firmware. (unsparse with simg2img). It's also possible to use your super partition block device as input.
      If omitted, systemrw will dump super image from phone to ./img/super_original.bin
      (path is relative to the script)
    • out=x : *THIS IS IGNORED IF YOU HAVE NO SUPER PARTITION*
      With this argument you can specify the output path of the new patched super file.
      If omitted, default output value is ./img/super_fixed.bin
    • size=x : *ONLY RECOMMENDED IF YOU HAVE SUPER PARTITION*
      With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
      If omitted, default extra size is 0 (shrink to minimum)
    Examples:
    Code:
    # Run this command *IF YOU HAVE NO SUPER PARTITION*
    ./systemrw.sh
    
    # Run this command if you're first time user *AND YOU HAVE SUPER PARTITION*
    # Specify the extra free space in megabytes for each partition:
    ./systemrw.sh size=15
    
    # Plug an existing super image into the script like this *ONLY IF YOU HAVE SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin size=15
    
    # Specify both the input file as well as the output destination *ONLY IF YOU HAVE SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15
    
    # 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 into:
    /data/local/tmp/systemrw_*VERSION*
    If you can't run the script try making the file executable like this: chmod +x ./systemrw.sh
    If you still can't get it to work run which sh in your shell and replace the shebang in the first line of the script with the output of that command. Don't remove the first two #! symbols though. Then save the file and try again.
    Make sure you have full read write access to the /data/local/tmp directory and that the containing files are not encrypted in custom recovery!

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

    Credits:
    Huge thanks to @Kolibass for allowing me to use his partition tools for Android. Without your tools this script would not work on the Android platform! This genius also showed me how to flash a 8GB file to my partition in just under 30 seconds! Much faster than fastboot! I still can't believe it!
    Big thanks to @Brepro1 for allowing me to basically copy his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Also big thanks @munjeni for allowing me to use his superunpack V1 tool in the previous version. It helped me to understand how these super images work.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the previous version which helped me to create this version. 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


    *NEW* Download v1.32 *NEW*
    current overall status:
    experimental
    If you like this project and want to support further development of this project and more projects like this then please feel free to send me an Amazon gift card code. Thanks! Your support is much appreciated!

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

    Asus Rog Phone 3 - Android 10 - TWRP
    OnePlus Nord - Android 11 (v1.24)
    Doogee S96Pro - Android 10 (v1.26)
    F150 model B2021 - Android 10
    Realme C12 - Android 11
    6
    If the script works on your device please write me your phone model, Android version, script version and if you have super partition or not. Also please send me your log files.

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

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

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

    Please give this new version a try and let me know if it works for you or not and I will add it to the first post. Thanks for your feedback!
    5
    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
    Great news! Flashable zip is almost ready! I'll upload it later today. Any volunteers want to beta test the new flashable zip to help me iron out any bugs? Please send me a message. Thanks!

    Installing the script has never been this easy. Simply swipe with finger inside TWRP and it's automatically installed to correct location on your phone.
    Then it checks a config file for any custom script execution arguments and launches the script with these arguments depending on whether or not your phone has a super partition.

    Let me tell you it was not easy to create this flashable zip installer but I had lots of fun learning about this whole flashable zip concept the past few days.