yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] ale82to:
sorry for bothering its seem quite easy the part that is not clear for me is *Then simply call the script from the TWRP shell. *

this means like terminal emulator from twr.?

i launch terminal from TWRP and I write ./makesysrw.sh size=1000 correct?

obviously a folder named makesysrw_1.15 in data/temp will be first copied!
[Android Software/Hacking General [Developers Only]] d4ylight:
The terminal emulator in TWRP will probably work, or you could use the ADB SHELL command to navigate to /data/local/tmp

The point is that you'll want to boot into recovery for this.
[Android Software/Hacking General [Developers Only]] ale82to:
thabks for replying will u please yell me the command to paste in TWRP terminal

pasting

./makesysrw.sh size=100 tells me file inaccessible not found
[Android Software/Hacking General [Developers Only]] d4ylight:
Is makesysrw.sh in that directory? (run the 'ls' command)

Like this:
sofiap:/data/local/tmp/makesysrw_1.15 # ls
files lpdump.txt makesysrw.sh myargs.txt tools totalsize.txt

If it is, have you given it executable permission?

chmod +x ./makesysrw.sh

You're looking for no output when that command is run.
[Android Software/Hacking General [Developers Only]] ale82to:
thank you I could successfully run the script with right path but failed with error there was a problem

thank you for the help I could successfully run the script with right path but it failed with error

THERE WAS A PROBLEM REMOVING THE READ ONLY LOCK 😭
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi ale82to thanks for your interest in this project. Please show log and screenshot or it's very difficult to help you.
[Android Software/Hacking General [Developers Only]] ale82to:
I wanted to thank the developer but for me the script failed with this error THERE WAS A PROBLEM REMOVING THE READ ONLY LOCK

luckily I could boot the system normally after failiture but I did not get read permission.

I'm on Android 11 arrow OS mi 10 Lite phone

where are log located ?
[Android Software/Hacking General [Developers Only]] lebigmac:
Please upload your log files from this folder

/data/local/tmp/systemrw_1.32/log/
[Android Software/Hacking General [Developers Only]] d4ylight:
ArrowOS? As in a custom ROM? That might be why. Isn't this for stock ROMs, @lebigmac? I may be mistaken.
[Android Software/Hacking General [Developers Only]] ale82to:
just to make sure I'm not doing anything wrong what I did :

copy folder from zip to /data/local/tmp (using mixplorer and giving 755 permission.

then reboot to TWRP and from terminal i entered

/data/local/tmp/makesysrw_1.15/makesysrw.sh size =1000

process started but after about a minute failed with that error

thank you again for the help

arrow OS is a plain version of lineage OS without any customization (that I can see)
[Android Software/Hacking General [Developers Only]] d4ylight:
Oh. I was under the impression that custom ROMs aren't write-restricted by default and that you could remount the partition r/w with the 'mount' command. Sorry about that.
[Android Software/Hacking General [Developers Only]] ale82to:
I ve only one problem I ve got missing about 10 giga of storage now where are temp file from script supposed to be placed?
[Android Software/Hacking General [Developers Only]] lebigmac:
The script was designed for stock devices that have read-only lock (Android 10 and newer). Both with and without super partitions.

You can check read-only lock by running this command as admin:
[Android Software/Hacking General [Developers Only]] ale82to:
I'm sure I cannot write to system that's why I tried this script but now I ve over 10 giga missing from storage can u please help me locating tmp file from the script?

ok I found then I had 12 giga in tmp folder generated from the script

Spoiler content hidden.

thank you for listening using that command to mount system as read and write I was able to replace modded framework-res.apk I'm super happy sorry for bothering i did not know the script it was not meant for custom room thabks again for listening and helping.
[Android Software/Hacking General [Developers Only]] baxal0:
I have the same error in joyeuse (Invalid sparse file format at header magic) at the end of script. The device boot normally. Vendor and Product is rw now but system not.

edit: new test with another root file explorer. i can write-delete in system too.
[Android Software/Hacking General [Developers Only]] Frxhb:
which app did you use? I cannot write in system yet
[Android Software/Hacking General [Developers Only]] baxal0:
total commander.
[Android Software/Hacking General [Developers Only]] Lathi:
Hello bro ,what can this be without magisk ?
[Android Software/Hacking General [Developers Only]] lebigmac:
Your log has never looked this good before.

Congratulations for successfully removing read-only locks and for creating super_fixed.bin

That's half the job already done.

Now you must find a way to disable dm-verity and verification on your device or else you get bootloop after flashing super_fixed.bin!

If you have no custom recovery or your recovery have no avbctl binary you can try to flash empty vbmeta file like this (you can find empty vbmeta file here at XDA forum or you can try to generate it). Always backup original vbmeta before flashing new one!

fastboot --disable-verity --disable-verification flash vbmeta vbmeta_empty.img
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
I tried gamma.

I got the same error as the beta and the process did not complete.
[Android Software/Hacking General [Developers Only]] lebigmac:
No you got a different error this time. You actually reached the very end of the script. Congratulations! Not everyone can come this far! You're only one small step away from success.

If you really want to figure out what exactly caused your lpmake error then you could try lpmake for Linux with the same arguments from myargs.txt file. Lpmake always works as expected on that platform.

Lpmake for Android does not give enough output for some reason. I thought I had already fixed that bug...
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
How about this?

I replaced the files as instructed.

I can't run lpmake with the same arguments.

Nothing is displayed.
[Android Software/Hacking General [Developers Only]] overlimit1:
sorry l'm so amateur at this. Where can l run this command at ?. l tried to put it in power shell command on my computer then its appear : the term chmod is not reconized
[Android Software/Hacking General [Developers Only]] Xiaoleng:
Update: It might not the zero-sized files causing the problem; the reason is some devices have sort of protection mechanism by only executing binary from /system/bin/ but not /data/local/tmp/makesysrw_1.30; this explains the crash "cannot create super_fixed.img"; due to security mechanism the program simply cannot find lpmake binary

#Original:

Hi lebigmac here are my logs!

still it immediately fails entering section "creating super_fixed"; the other part of this log looks fine but product_b and vendor_b, which are with a zero size, gives only 3 lines of output; think the zero-size on product_b and vendor_b might be the reason for the next step to fail? It might not a dump error, the drive should be empty on the actual device;

Thank you!
[Android Software/Hacking General [Developers Only]] Abuzar Uzair:
Failed :(

Oneplus 9

Logs attached
[Android Software/Hacking General [Developers Only]] lebigmac:
Why the cow files cannot be resized on Oneplus devices?

Can you do this on cow file?

resize2fs -f /data/local/tmp/makesysrw_1.30/files/super/system_b-cow.img 3G

This is your lpmake error:

Not enough space on device for partition product_b-cow with size 1559404544

Try run again script without custom size like this:

cd /data/local/tmp/makesysrw_1.30/
./makesysrw.sh in=./files/super/super_original.bin

And send me new myargs.txt again. Thanks.

Where is your myargs.txt file? Please upload it. Thanks. Did you try running the script without custom size argument? See above.
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
This is what myargs.txt looks like.
[Android Software/Hacking General [Developers Only]] chintoocool:
I have oneplus 8 android 11

I has been created super_fix.bin with this v1. 30 gamma

I am also disabled dm verity

But after flashed bootloop here my logs

Can any body help?
[Android Software/Hacking General [Developers Only]] mclaude74:
Redmi K30S Ultra, Android 11, xiaomi.eu 21.4.14

makesysrw_1.30_delta_flashable.zip

The flashable zip doesn't work in TWRP.

So I unpacked the ZIP-archive and changed some lines:

'#!/system/bin/sh' to '#!/sbin/sh'

every './tools/bin/resize2fs' to 'resize2fs'

every './tools/bin/simg2img' to simg2img'

The script was executed successfully, but the RW possibility is still missing...

/dev/block/mapper/system on /system_root type ext4 (ro,seclabel,relatime)

/dev/block/mapper/system on /system type ext4 (ro,seclabel,relatime)

Additional information on screenshots and files
[Android Software/Hacking General [Developers Only]] lebigmac:
Mclaude74 thank you for the nice screenshots and logs.

The script worked for you despite the little extra size error that I accidentally introduced a couple of versions ago. This has already been fixed in new v1.31

If you can enter that mount command without error that means it worked. Try moving some useless system app to /sdcard and it should work.

Watch out with SecurityCenter and FindDevice and similar system apps. Those are very sensitive and if you delete those you will get bootloop!
[Android Software/Hacking General [Developers Only]] chintoocool:
But i can't edit system files?
[Android Software/Hacking General [Developers Only]] lebigmac:
How did you fix bootloop? Do you have custom ROM or stock Android?

My script will allow you to run this command mount -o remount,rw / without errors but unfortunately I cannot give much more support beyond that right now. I must focus on fixing the script for other Motorola, OnePlus and Oppo users. There are still lots of errors with the script that need to be fixed.

Maybe your device have some kind of special protection. Please search in your device subforum for more information. Good luck!
[Android Software/Hacking General [Developers Only]] chintoocool:
No I have official rom

actually problem is I flash through window normally but i try to flash ubuntu Linux and no error bootloop

but i can't del bloatware from system/product
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
The same is true for v1.31.

It did not work.

Attached is the log.
[Android Software/Hacking General [Developers Only]] chintoocool:
My 1.31 logs here
[Android Software/Hacking General [Developers Only]] lebigmac:
Why the script works perfectly on chintoocool's Oneplus device but on peach-pit's Motorola device it fails with unknown lpmake error? They both have slot A/B device...

@PEACH-PIT have you tried to launch script without size=50 parameter yet? I'm guessing lpmake fail for you due to size issue.

And if that doesn't work I can only suggest to try the Brepro1 tutorial and the AndyYan tutorial. My script is based on these two amazing tutorials after all ;)

If you manage to successfully run lpmake command manually then we should be able to find out why the script doesn't work for your motorola device. And if you manage to do it then make sure to save your lpmake arguments in a text file so we can compare to auto generated myargs.txt. Other motorola users will appreciate your helpful feedback! Thanks.
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
In the past I have tried lpmake on linux as well.

The results for linux usb and windows are the same.

Both do not output anything.
[Android Software/Hacking General [Developers Only]] Xiaoleng:
Finally I think I found the cause of super_fixed.bin creation error

if the command arguments are too long, some device simply drops the command whether in adb or terminal emulator; the purpose might be to prevent command injection; this explains the instant weird crash

As a temporary solution before Mr. lebigmac fix this problem, u may need to generate the super_fixed.bin by yourslef; the toturial is below.

This may also fix the problem system mounted as rw on Android but still not writible

1. run makesysrw on your Android device

2. copy every .img located in /data/local/tmp/makesysrw_xx/files/super to an Ubuntu PC

3. on Ubnuntu mount every partation as rw using terminal (eg: "sudo mkdir -p /tmp/product_a && sudo mount -o loop,rw,sync product_a.img /tmp/product_a")

4. on Ubuntu open file manager as superuser ("sudo nautilus"); then locate to /tmp, find all partitions and modify any thing in each partition (you may create a text file, write a few lines, and copy this text file to all these partitions)

5. unmount all paritions; use lpmake for linux (https://xdaforums.com/t/guide-ota-tools-lpunpack.4041843/) to manually create super_fixed.bin

#run lpmake for linux like this

./otatools/bin/lpmake COPY_PASTE_YOUR_ARGUMENTS_HERE

6. fastboot flash super_fixed.bin to your device

All partitions modified in step 4 should now be writable on your device
[Android Software/Hacking General [Developers Only]] Xiaoleng:
the reason might not insufficient space but incorrect partition size table; in such case u may see the partition mounted as rw, can delete files or add empty files, but cannot modify files or add non-empty files
[Android Software/Hacking General [Developers Only]] lebigmac:
@Xiaoleng you sir are doing some true detective work right there!

Thank you for sharing your interesting results with us.

The script worked perfectly for you all the way to the end but for some reason you are experiencing an unknown lpmake error at the very last step that is impossible for me to debug without an error code. Why some people get an error while others get zero output from aarch64 version of lpmake is still a mystery to me.

Why are you running stop command? You don't need to do this.

And running chmod +x once on the script file should be enough.

Using setenforce 0 is always a good idea though ;)

Please launch script without size argument and send me the logs again so I can take a look at your results. Thanks.
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
I tried it, but it didn't change anything.

Attached is the log of the results of this run.
[Android Software/Hacking General [Developers Only]] shafi1885:
yes, please post a video, new comers like me has a hard time. I know you guys are doing this for everybody's benefit. But not everyone understands all of the post. It would be really helpful if you break down them for people with mediocre knowledge about it.
[Android Software/Hacking General [Developers Only]] flypatriot:
I've just checked the script on my OnePlus 8 Pro. It takes effect after repeated flash. Also at second flash I've changed the size from 15 to 100. Now I can not only mount the system as rw, but copy files to it.

But I'am on OOS 10 and also made next steps before:

1. Flash Dm-verity_Force-encryption disabler.

2. Flash ElementalX kernel cause it has avb check disabled.

I think there is some difficulties in using original OOS kernels cause they have avb check in kona.dtsi file.
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi. Thanks for your interest in this project. You're at least 3rd person to request this.

I must fix one or two more issues and then a friend will create video tutorial. Don't worry ;)
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
The process has been completed to the end.

It is still r/o.

It did not work on moto g 5g.
[Android Software/Hacking General [Developers Only]] lebigmac:
Yes it worked. Check your screenshot. You don't get the read-only error after mount command. Congratulations!

You might be on to something with this theory. Maybe it's Motorola security feature.

That would explain why the same lpmake arguments work perfectly in linux with lots of output but they fail on Motorola device with unidentified error.

In next version of script I will replace long absolute paths with relative paths that are much shorter in myargs.txt. Hopefully this will fix this annoying issue.
[Android Software/Hacking General [Developers Only]] lebigmac:
Troubleshooting repair script v1.32

instructions

(LINUX ONLY!)

Description:

troubleshooting repair script for all slot _a/_b users to fix lpmake error 73

You need to run this troubleshooting repair script from a Linux operating system!

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.

Make sure adb and fastboot binaries are accessible in your $PATH environment variable (install platform-tools).

Instructions:

First run original SystemRW v1.32 script on your phone (if you haven't done so already) and then run troubleshooting repair script in Linux while phone is connected to PC through USB cable.

Please give it a try and send me your troubleshooting log files (log.txt, myargs.txt, lpmake_output.txt). Thank you. Good luck!

@PEACH-PIT @Keven11 @Articul8Madness @thelavip @harpreet.s @BlazingKahn35 @nttuan @m3nty @f1^ter @ITGrouch @Xiaoleng
[Android Software/Hacking General [Developers Only]] lebigmac:
Thank you for the feedback.

If you can mount system as read/write that means it worked! Congratulations! I think you're the first Motorola user in the whole world to make your system read/write in Android 10 or newer using my script.

What's interesting is that linux version of lpmake works perfectly with the exact same myargs.txt arguments pulled from phone. The repair script only slightly modifies the image paths inside myargs.txt

The troubleshooting repair script successfully created super_fixed.bin and successfully flashed it to your device with fastboot? I thought Motorola users can only flash sparsechunk files with fastboot?! @Articul8Madness
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
When I flashed the super_fix.bin, it was split and flashed.

It looked like it was flashed to moto g 5g without error.

It boots without any bricks.

However, I cannot add, delete, or rename folders in the system.

If you have the correct r/w, you should be able to add, delete, and rename folders.

Also, on boot, the fingerprint shows N/A.

I don't know much about this, but I'm guessing that it's failing to unblock shares?
[Android Software/Hacking General [Developers Only]] lebigmac:
@PEACH-PIT

To check if shared_blocks was successfully removed you can do

tune2fs -l ./system.img

Try this:

adb shell
su
mount -o remount,rw /
mount -o remount,rw /vendor
mount -o remount,rw /product
echo "file successfully created in system" > /test.txt
echo "file successfully created in /vendor" > /vendor/test.txt
echo "file successfully created in /product" > /product/test.txt
cat /test.txt
cat /vendor/test.txt
cat /product/test.txt
rm -f /test.txt
rm -f /vendor/test.txt
rm -f /product/test.txt
[Android Software/Hacking General [Developers Only]] b4minee:
Hello bro

how are you doing. Script ran successfully on my pixel 4 A11 stock. Now how can flash the super_fixed.bin. please advise.

This script is a milestone creation,Unbelievable solution for unbelievable stupid dynamic partitions that causes every problem on everything.

Can't thank you enough genius. 🤜🤛
[Android Software/Hacking General [Developers Only]] lebigmac:
Hello. Thanks for sharing your log files. I'm happy the script works so well on your device.

You can manually flash it like this:

adb pull /data/local/tmp/makesysrw_1.31/files/super/super_fixed.bin
adb reboot bootloader
fastboot flash super super_fixed.bin

If anything goes wrong you can simply pull the super_original.bin from the same location on your phone and flash it the same way and your device should be back to stock.

Simply open a terminal window in the same folder as the troubleshooting repair script and make it executable in Linux and run it like this:

chmod +x ./makesysrw_repair.sh
./makesysrw_repair.sh

Did you run the original Android script v1.31 on a fresh stock super partition?

Good luck!
[Android Software/Hacking General [Developers Only]] bobbyp1086:
That first red square means it tosses errors when not ro correct? And if you can't add, delete or modify isn't that not a success? Idk I'll try it I was sketched about this method cause I don't have access to Linux machine, will Linux on windows work?
[Android Software/Hacking General [Developers Only]] lebigmac:
@Abuzar Uzair According to your lpdump.txt file your total super partition size is 11190403072 bytes (10 GB)

And your cow group maximum size is 0 bytes. Why are the cow files not empty then?

Right now your cow files are too large to fit into cow group and if I calculate cow files + qti_dynamic_partitions_b image files the result is much greater than total super size!? I'm not surprised it didn't work.
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
I flushed the stock to "moto g 5g" and ran it again.

I still can't add, delete, or rename new folders in the system.

But other than that, it's working fine!

I am attaching a picture.
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
I understand.

I'll test it.
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
The installation completed successfully.

What's next?
[Android Software/Hacking General [Developers Only]] Xiaoleng:
As requested, here you go! https://drive.google.com/file/d/1f23-bZKwFKs7rfpkEpDY4u-W0-a_djPY/view?usp=drivesdk

It is really possible my super_fixed.bin (specific for Sony Xperia 10 II) not going to work on other devices. Consider generate the one for your device using these commands using otatools (https://xdaforums.com/t/guide-ota-tools-lpunpack.4041843/) under Ubuntu:

"

#pull all image files from phone to pc

for i in `adb shell "ls /data/local/tmp/makesysrw_1.30/files/super/*.img"`; do adb pull $i; done

#pull myargs.txt file from phone to pc

adb pull /data/local/tmp/makesysrw_1.30/myargs.txt

#run lpmake for linux like this

./otatools/bin/lpmake COPY_PASTE_YOUR_ARGUMENTS_HERE

#or like this

./otatools/bin/lpmake `cat ./myargs.txt`

"
[Android Software/Hacking General [Developers Only]] Xiaoleng:
It is possible caused by incorrect drive parameters; open the ".img"s dumped by makesysrw under Ununtu and modify sth. to correct the parameter

Refer to this:

Finally I think I found the cause of super_fixed.bin creation error

if the command arguments are too long, some device simply drops the command whether in adb or terminal emulator; the purpose might be to prevent command injection; this explains the instant weird crash

As a temporary solution before Mr. lebigmac fix this problem, u may need to generate the super_fixed.bin by yourself; the toturial is below.

This may also fix the problem system mounted as rw on Android but still not writible

1. run makesysrw on your Android device

2. copy every .img located in /data/local/tmp/makesysrw_xx/files/super to an Ubuntu PC

3. on Ubnuntu mount every partation as rw using terminal (eg: "sudo mkdir -p /tmp/product_a && sudo mount -o loop,rw,sync product_a.img /tmp/product_a")

4. on Ubuntu open file manager as superuser ("sudo nautilus"); then locate to /tmp, find all partitions and modify any thing in each partition (you may create a text file, write a few lines, and copy this text file to all these partitions)

5. unmount all paritions; use lpmake for linux (https://xdaforums.com/t/guide-ota-tools-lpunpack.4041843/) to manually create super_fixed.bin

#run lpmake for linux like this

./otatools/bin/lpmake COPY_PASTE_YOUR_ARGUMENTS_HERE

6. fastboot flash super_fixed.bin to your device

All partitions modified in step 4 should now be writable on your device
[Android Software/Hacking General [Developers Only]] lebigmac:
@Xiaoleng please check post # 461 for troubleshooting repair script (temporary lpmake error workaround for Motorola, Oneplus, Oppo and more devices). Thank you. There is also harpreet workaround method.