yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] aarnet:
Why is the partition size decreasing in newer versions? 1.27 / 1.29 - 50 but on 1.31 - 15
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @aarnet. I am making the custom extra size parameter (that you can easily modify in config.ini) smaller to make the script better compatible with more devices.

For example size=100 works great on Xiaomi devices but it will fail on Oppo devices.

In next version of script I will try to only increase partition size of system, vendor and product and forget about all those other weird partitions such as odm, cow and more.

Which device have you got? And how does the script perform on your device? Can you please send me your log files? Thank you. It helps with further development.
[Android Software/Hacking General [Developers Only]] aarnet:
Xiaomi Mi 10T (full analogue Mi 10T Pro/Redmi K30S) 8/128

MIUI 12.6 21.4.21 xiaomi.eu Android 11 Magick/root

but I not installed your script yet - as soon as i do it i send log to you

what is the optimal size I should set? 100 or more?
[Android Software/Hacking General [Developers Only]] QRCode:
Confirmed to work on Samsung Galaxy S20 FE with Ressurection remix & NikGapps working flawlessly
[Android Software/Hacking General [Developers Only]] Spaceminer:
@lebigmac

Moto G Fast & Moto E (2020) - Working on both!

You just need an external sdcard to get around the storage requirements. I unzipped it to tmp, set permissions, and ran it with these arguments in Orange Fox...

cd /data/local/tmp/makesysrw_1.31
./makesysrw size=20 out=/external_sd/super.img

It worked flawlessly. You wrote a beautiful script! Thank you so much!
[Android Software/Hacking General [Developers Only]] lebigmac:
It depends on how much extra space you need on each partition (in megabytes).

size=100 seems to work well with Xiaomi devices

size=1000 will fail on Xiaomi

@QRCode @Spaceminer

Thank you I'm happy it works for you guys.

lol @Spaceminer you're like the 2nd person to use that out= feature ;)

It's nice to see I didn't put it in there for no reason :)
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
I see.

So you can avoid errors by doing so.

I hadn't noticed it at all.
[Android Software/Hacking General [Developers Only]] lebigmac:
Has any slot _A/_B user been able to identify and reproduce the unknown lpmake error on their device yet?

@Xiaoleng believes it's an internal Android kernel panic "feature" that prevents the lpmake command from executing if the arguments are too long. Can any slot _a/_b users confirm this? Please try running dmesg on it! Thanks!

And what about the amazing @harpreet.s workaround: simply switch boot slots with fastboot? No clue how this genius was able to discover that workaround. Does anybody know what it actually means? Has any Motorola, Sony, Oppo or Oneplus user had success with harpreet workaround?

To run lpmake manually on your device you can do this

adb shell
su

cd /data/local/tmp/makesysrw_1.31
./tools/bin/lpmake `cat ./myargs.txt`
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
adb shell

su

chmod +x /data/local/tmp/makesysrw_1.31/tools/bin/lpmake

setenforce 0

cd /data/local/tmp/makesysrw_1.31

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

The result will be the same as when you enter it directly.

Nothing will be output.

No error will be printed.

In the case of Motorola, it is not possible to switch to B slot.

I tried to do that before, but the "moto g 5g" itself warned me that it would be bricked.
[Android Software/Hacking General [Developers Only]] chintoocool:
I have try manually but it's working for me
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
You're running it from TWRP, right?

It doesn't work on adb for some smartphones.

And there is no TWRP in moto g 5g.
[Android Software/Hacking General [Developers Only]] chintoocool:
I have oneplus 8 android 11 there is no TWRP available.

I'm using Terminal Emulator
[Android Software/Hacking General [Developers Only]] lebigmac:
@PEACH-PIT I think that number 73 means that the command wrote some output to stderr (standard error stream).

Try redirecting stderr to standard output or to file like this:

./tools/bin/lpmake `cat ./myargs.txt` 2>&1

# or like this

./tools/bin/lpmake `cat ./myargs.txt` 2> ./error.txt
[Android Software/Hacking General [Developers Only]] poiyqqq:
After running the script and flashing super.img I'm still getting " '/dev/block/dm-1' is read-only "

In my phone (Oukitel WP5 Pro) there is no TWRP so what I did was unzip the file and move the contents of "makesysrw_1.31" to "/data/local/tmp/makesysrw_1.31" and run the script, everything went well and it shows:

makesysrw: Successfully created patched super image @

makesysrw: /data/local/tmp/makesysrw_1.31/files/super/super_fixed.bin

makesysrw: Congratulations! Your images should now have rw capability

makesysrw: Please reboot into bootloader and flash the file(s) manually

So I copied the super_fixed.bin to /storage/sdcard0/Downloads/ and from there I copied to my computer adb folder.

Then on adb console I typed:

>adb reboot bootloader

>fastboot flash super super_fixed.bin

Sending sparse 'super' 24/24 (37028 KB) OKAY [ 0.874s]

Writing 'super' OKAY [ 0.504s]

Finished. Total time: 118.003s

>fastboot reboot

Rebooting

But I try to remount to RW and I get the same error.

WP5_Pro:/ $ su

WP5_Pro:/ # mount -o remount,rw /

'/dev/block/dm-1' is read-only

WP5_Pro:/ #

Please help me what I'm doing wrong. Thank you.
[Android Software/Hacking General [Developers Only]] harpreet.s:
Hi , some time issue is with the busybox. Try to use any root file manager or different busybox.
[Android Software/Hacking General [Developers Only]] Spaceminer:
**Try running it from your device with termux instead of using a PC.**

Regarding slot switching: Just flash the stock bootloader over to slot B, or use the copy_partitions.zip that's floating around on xda. From there you can use magisk+termux to dd the partitions over and it should make the other slot bootable. I wouldn't try it without stock firmware on hand as a precaution, but it should work. Since we use a super partition, you'll need to tweak the commands a little like so...

dd if=/dev/block/mapper/product_a of=/dev/block/mapper/product_b
dd if=/dev/block/mapper/system_a of=/dev/block/mapper/system_b
dd if=/dev/block/mapper/vendor_a of=/dev/block/mapper/vendor_b

Assuming you have your firmware you can just flash this stuff to slot_b, but if not you can use dd to handle it. (Disclaimer: I'm not sure if lolinet has your firmware yet.)

dd if=/dev/block/by-name/dtbo_a of=/dev/block/by-name/dtbo_b
dd if=/dev/block/by-name/boot_a of=/dev/block/by-name/boot_b
dd if=/dev/block/by-name/vbmeta_a of=/dev/block/by-name/vbmeta_b
dd if=/dev/block/by-name/dsp_a of/dev/block/by-name/dsp_b
dd if=/dev/block/by-name/fsg_a of=/dev/block/by-name/fsg_b
dd if=/dev/block/by-name/recovery_a of=/dev/block/by-name/recovery_b
dd if=/dev/block/by-name/modem_a of=/dev/block/by-name/modem_b
dd if=/dev/block/by-name/logo_a of=/dev/block/by-name/logo_b

The product partition must be done first or you'll likely get an "out of space" error. If you get an out of space error on product, then your best bet is trying to expand it with resize2fs. Unfortunately, I don't know the commands to do that though.
[Android Software/Hacking General [Developers Only]] lebigmac:
@Spaceminer That's very interesting but

@chintoocool @PEACH-PIT & others before you overwrite slot B with content from slot A or the other way around please try these commands below and send me screenshot or log. Thanks.

What I'm trying to figure out is will the same empty *_b.img file also be empty if unpacked from the other slot? Maybe some people get lpmake error due to empty _b files? In that case the easy solution would be to run lpmake twice. Once for the A side and once for the B side before plugging everything back into lpmake.

adb shell
su
cd /data/local/tmp/makesysrw_1.31
# create two directories in script folder img_A and img_B
mkdir -p ./img_A ./img_B
# unpack slot A
./tools/bin/lpunpack --slot=0 ./files/super/super_original.bin ./img_A
# unpack slot B
./tools/bin/lpunpack --slot=1 ./files/super/super_original.bin ./img_B
# now let's compare img file sizes in both folders
ls -l ./img_A
ls -l ./img_B
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
The error.txt file is empty.

Nothing is output.

Perhaps there is a bug in the smartphone that prevents it from reading the command if it is too long.

Otherwise, I can't explain why extracting the img to / on external storage works.

Edit；

The output file is attached.

It is an empty file.
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
The super_original.bin is outputted normally.

After that, an error occurs at the r/w release stage.

If you use makesysrw_repair, this will be avoided.
[Android Software/Hacking General [Developers Only]] Yuri.G:
Can i delete this files after successful work of script?
[Android Software/Hacking General [Developers Only]] Spaceminer:
Yes. rm -rf /data/local/tmp/*
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi. Sure. Simply delete files folder. It will be recreated next time you run the script ;)

rm -rf /data/local/tmp/makesysrw_1.31/files

@Yuri.G

The super_original.bin is dumped for backup purposes.

I can automatically delete super_fixed.bin after flashing it from recovery but if script is run from within android then you will have to flash and delete it manually.
[Android Software/Hacking General [Developers Only]] Yuri.G:
May be make it automatically or make choice in script?
[Android Software/Hacking General [Developers Only]] b4minee:
Hey bro how are you doing. Na I haven't reflash stock . Should I? and flash back created super bin?
[Android Software/Hacking General [Developers Only]] asskriss:
is not work for me.. redmi 9T lime miui 12.0.4 when i try to flash the zip i got error 255....
[Android Software/Hacking General [Developers Only]] condor323:
Vía adb
[Android Software/Hacking General [Developers Only]] condor323:
Vía twrp
[Android Software/Hacking General [Developers Only]] lebigmac:
How about automatically deleting super_fixed.bin after successfully flashing super partition to free up some space while keeping the super_original.bin for backup purposes?

What's up? Sure just reboot bootloader and fastboot flash super super_fixed.bin

If you want to restart the whole process from scratch you can flash stock read-only super.img and then run script and then flash the super_fixed.bin ;)

Try install script folder manually as described in comments section of script if some dubious Russian hacker hasn't deleted it yet... Good luck finding it!

It looks like your Motorola device requires some assistance from troubleshooting repair script (y)
[Android Software/Hacking General [Developers Only]] condor323:
ok. iḿ test now
[Android Software/Hacking General [Developers Only]] condor323:
okay. on moto g9 play, flash stock firmware (42.4) in slot_a. then update via OTA (.69), which activated slot_b. and start the script via adb shell and the process completed without errors. flash super_fixed.bin via fastboot and boot without errors and partitions in r / w.
[Android Software/Hacking General [Developers Only]] amurec:
Xiaomi Redmi Note 9 (3/64), MIUI 12.0.6, the script works without errors, after flashing the patched image, the phone works fine, but there is no access. The terminal gives a response - "/ dev / block / dm-1 is read-only"
[Android Software/Hacking General [Developers Only]] PEACH-PIT:
This script also works on motorola edge s.

To do so, I disabled all vbmeta and used makesysrw_repair.

Fortunately, I was able to disable vbmeta on adb, so I didn't need twrp.

fastboot -–disable-verity -–disable-verification flash vbmeta vbmeta.img
fastboot -–disable-verity -–disable-verification flash vbmeta_system vbmeta_system.img
[Android Software/Hacking General [Developers Only]] asskriss:
you need to mount system in twrp..then in adb shell type

mount -o remount,rw /system_root
[Android Software/Hacking General [Developers Only]] TheMagnificent_Y:
Hey! I've recently tried this on my Redmi Note 9 (Merlinnfc) that's running MIUI 12.0.6.0

It doesen't work, the phone does have a super partition, in TWRP it fails with error "255",

Any Ideas on how to fix this issue? Also, why not just modify /proc/mounts?

Thanks!

Root: MagiskSU

TWRP ver: 3.4.1 (Un-official)

-FriendlyChemist
[Android Software/Hacking General [Developers Only]] amurec:
its not work ...
[Android Software/Hacking General [Developers Only]] HemanthJabalpuri:
Can you please run this and give output,

tune2fs -l /dev/block/mapper/system | grep share

Thanks
[Android Software/Hacking General [Developers Only]] Ax33_NightFall:
Hello, how to fix this kind of error?

im using poco x3 nfc

ROM: xiaomi EU ROM latest..
[Android Software/Hacking General [Developers Only]] kalhiro:
what recovery did you use?......try switch recovery.

twrp miui-hellas 30032021 work for me,

if ofox, try unoficial 11.02.
[Android Software/Hacking General [Developers Only]] amurec:
Not any output ...
[Android Software/Hacking General [Developers Only]] alansworld2010@gmail:
that makes total sense because I've been trying to run erfangsi tool from termux and it works perfectly when I do android 10 non super.img or lower.... when trying to extract firmware especially moto with firmware tool or makedynamic it skip the super.img and moves on....even though it extracts all the moto super sparse chunk it wont make.....plus I'm on moto g7plus as host devices..... works fine from ubuntu same tools.... and with 1.24 I successfully ran the script manually on g7plus starting from B partition..... now with 1.31 I get weird msg success but no make file in non super folder or log.......

when flashing twrp i get the normal error.........manually from twrp shell or host shell ......

lake:/ # twrp mount system

Mounted '/system_root'

Done processing script file

lake:/ # twrp remountrw system

Done processing script file

lake:/ # cd data/local/tmp/makesysrw_1.31

lake:/data/local/tmp/makesysrw_1.31 # sh makesysrw.sh

--------------------------------------------------

| makeSystemRW v1.31 automated script by lebigmac |

| @xda ©2021 Big thank you to @Kolibass @Brepro1 |

|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |

| without your help this would not be possible! |

--------------------------------------------------

makesysrw: Please install Android 10 or newer and try again

lake:/data/local/tmp/makesysrw_1.31 #

C:\Users\Administrator\Desktop\Lake\STOCK10ENDOFLINEFEB21>

my twrp is sdk 28 on vendor prop in recovery.....

motoSignature.App which is the clock wigit on stock moto has special powers thats why we cant install stock moto ports without it

and ive debloated stock moto several devices and when you get rid of moto signature apk and reboot a couple of times long enough for the phone to log the error next reboot it either wont boot or injects stock backup img

to everyone that has flashed the script and got it but cant make changes still go through the mount folder to where your going to make changes i found that out with mixxplorer on android 11 12
[Android Software/Hacking General [Developers Only]] sebj84:
Hi,

I use Poco f2Pro/K30 Pro,

Running Android 10 stable,

disabled verity etc. and tried to flash your .zip (1.31), but running twrp it gives me error 255.

So I moved all into /data/local/tmp/makesysrw_1.31/

when I try run it from adb shell, it gives me: not found

(

-/sbin/sh: /data/local/tmp/makesysrw_1.31/makesysrw.sh: not found

)

i already used chmod to make it executable
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi. Please show screenshot and check manual installation instructions inside script!

You can run script manually from both rooted Android and custom recovery.

Is your error 255 different from the one by @Ax33_NightFall ?

Hi. How is this possible? Poco X3 NFC should have unzip binary by default. What output do you get if you run this?

which unzip

You can install and run the script manually if automatic installation fails. See manual installation instructions inside script! Good luck!

Hi. Try replacing shebang in first line of script with output of which sh (see troubleshooting section of first post). Good luck!

Hi. Boot into Android and run these commands and send me screenshot. Thank you.

adb shell
su
mount -o rw,remount /
mount -o rw,remount /vendor
mount -o rw,remount /product

And did you try mounting these partitions as R/W inside custom recovery? Was there any difference?

lol Alan that screenshot :D It says successful even though it didn't even do anything!

What Android version are you running? The script failed in recovery due to wrong Android version and you can successfully launch it from Android? That's weird. Maybe try updating your custom recovery.

What device are you using? It doesn't have super partition and it doesn't look like it has shared_blocks read-only feature so the script doesn't know what to do. Hey at least it didn't brick your device so that's great ;)

You can check if your system partition has shared_blocks feature by doing this

tune2fs -l /dev/block/mmcblk0p68 | grep "feat"

@PEACH-PIT @Xiaoleng @Articul8Madness@munjeni

I was able to reproduce this same error 73 in Android 11. If I run script from recovery on stock firmware it will work just fine but if I run it again in Android on already patched super then it will throw unknown lpmake error.

If you run lpmake manually it will actually give you the error code. In next version of script I will try to show this error code by default in the log.

You can find out what this error code means inside sysexits.h

I don't think this is limited to only Motorola devices. This looks like another one of those Android 11 security features. I never saw this error during development in Android 10.

Setting selinux to permissive didn't really make a difference. Maybe disabling selinux completely could fix it.

Anybody knows how to disable this new Android 11 feature? Thanks.
[Android Software/Hacking General [Developers Only]] amurec:
in recovery, partitions are mounted, but does not allow them to be changed ...
[Android Software/Hacking General [Developers Only]] Ax33_NightFall:
@lebigmac sir i already found a solution about this.. seems i cant flash it through SD card so i copy it into internal.. and it works but the problem is. i can't modify/edit system build prop and vendor build prop.. but i can modify other system files..

Here is the Output Error when i try to edit build props..

the old version of this zip file (v1.04) works fine for me and I don't have problems in editing props..

can u send the old flashable zip?
[Android Software/Hacking General [Developers Only]] Spaceminer:
If you have any magisk modules active then disable them, reboot, and try again. I'm unable to edit files with modules active. Just a heads up.
[Android Software/Hacking General [Developers Only]] ianmansant:
So, i've tested this script and at first it just gave me the lpmake error then i managed to get the troubleshooting version running on Linux and it seemed like it was working, until i saw my OS fingerprint nullified and the partitions apparently were R/W but as soon as you make a change, let"s say change the permissions of a folder it will or enter you in a bootlop when you restart or it will mount itself back to R/O, i just wished to know what the heck is making the partitions mount back to r/o, if someone knows please reply, i will keep an eye on that shared_blocks feature.
[Android Software/Hacking General [Developers Only]] lebigmac:
I checked dmesg and I think this has something to do with lpmake error 73

If I disable the shrink to minimum function (resize2fs -f -M system.img) it works and no error. As soon as I activate the shrink to minimum function I get error 73. Also it fails depending on where in the script I call this function?! This is just so weird.

And this only happens in Android 11 apparently

I'll try disabling or replacing that function and I'll release a hotfix soon!

How did you flash the super_fixed.bin ? Your log couldn't look any better. Not sure what the problem is.

Maybe the empty space in the path name was causing your unzip error 255 in recovery? Not sure. It's first time I saw this unzip error. Try a different recovery.

What do you mean you can modify other system files but not build.prop? Which ones? Please send me your log files so I can check if script worked successfully.

From your screenshot it looks like you tried to copy a file into a file?!

Remember always make backups before modifying any system files or else you could easily end up in bootloop!

v1.04 of the script is linux only and it's very old deprecated version. I cannot give support for such old version right now. Maybe one day I will update it we will see. Just wait for next Android version. I will release it soon!
[Android Software/Hacking General [Developers Only]] TheMagnificent_Y:
Hello,

I have one thing to ask,

Is there any way to list ALL partitions and see how much space has been used in all of them?

I'm running TWRP 3.4.1, the error reads: "Updater Process ended with ERROR:255 Error installing zip file '/path/to/zip/file'

PS: I've mounted all the partitions that I could through TWRP (Including rw remount through ADB shell - /vendor /product, etc.).
[Android Software/Hacking General [Developers Only]] totmakina:
I want to test the script on the Motorola g 5g plus. I haven't received it yet. just recoba, unlock and flash twrp install it.

If it works it will be perfect to install according to what type of roms. Is that so? Thanks!!!!
[Android Software/Hacking General [Developers Only]] amurec:
Flash in fastboot , flash in twrp - the result does not change...

Please , give us the older version script , but many people said if the work normally ..
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @amurec

I have to disappoint you. If v1.31 works without errors on your device and your device is still read-only then the old version will give you the same result or worse.

You get same output dm-0 is read-only when trying to mount system as r/w in recovery?

mount -o rw,remount /system_root

If script works perfectly on your device but device is still read-only I can only suggest to try munjeni's amazing superrepack tool. Maybe his tool works better on your device. Give it a try. Good luck!

Hi @totmakina

Thanks for your interest in this project. I would suggest you wait for new upcoming version.

I will release it soon.

Hi @TheMagnificent_Y

Try this code to view space usage in all partitions. I hope it helps ;)

df -ha

Regarding your error 255 is yours different from this one? Thanks.
[Android Software/Hacking General [Developers Only]] @YudiTriyadi:
At OrangeFox It didn't work. After Completing the Flashing Process and Getting a Successful Message Then Reboot the System. I tried to transfer a file from the SD card to the system and it didn't work ..
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @YudiTriyadi. Thanks for your interest in this project. What do you mean it didn't work? You say you got a successful message so that means it worked right? Please show your log files so I can check. And a screenshot would be helpful. Did you try mounting your system as read/write before trying to copy stuff? Keep in mind Android boots your partitions as read-only by default.