yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] lebigmac:
Thanks for your compliments

Hopefully soon I can offer support for all devices. It's not easy but I might have found a possible solution thanks to very helpful feedback by @kpykpy :D
[Android Software/Hacking General [Developers Only]] RavenRein:
Thanks a lot for this, finally i can get rid unwanted apps.
[Android Software/Hacking General [Developers Only]] YasuHamed:
is there a way to WIPE super partitions while flashing cusom roms?

i have SURYA (POCO NFC)
[Android Software/Hacking General [Developers Only]] lebigmac:
It could be possible with fastboot erase super

but I've never done this before and therefore cannot recommend it

You're welcome. Did it work on your device?

Congratulations for getting it to work on your device!

No downsides to making your system r/w ;)

Congratulations! Is your device slot A only? Please send me your text files next to the script. Thanks!
[Android Software/Hacking General [Developers Only]] Rahamatulla:
Working in Poco X2 (Redmi K30) miui eu stable Android 10
[Android Software/Hacking General [Developers Only]] Rahamatulla:
But we lose 10gb storage.... If we erase super from fastboot will the system restore to read only? will it effect /data/media?
[Android Software/Hacking General [Developers Only]] munjeni:
Hello! I have managed to understand how those unshare block feature is setled up! Probably I will update my superunpack tool to make all partitions rw on the fly without need for extra conversions, what I have mannaged to do is to make ext4 partition rw by removing shared_blocks feature from s_feature_compat from superblock. What I need to investigate is to nderstand how to regenerate sha256 hashes inside superimage, that mean my superimage tool will be able to make your partitions inside superimage all rw on the fly without a need for extra conversions and needs for any lpmake, resize2fs and things :)

This is my investigation right now for rw only -> https://pastebin.com/fJTP31n7

the rest I will do when I get some free time for it.
[Android Software/Hacking General [Developers Only]] lebigmac:
Congratulations my friend! It was about time you figure this one out :D

Giving customer support for my script can be quite exhausting depending on the technical understanding of the user.

Finally munjeni comes to the rescue :D
[Android Software/Hacking General [Developers Only]] Lossyx:
No, and you generally should not erase the logical partitions. When flashing something they will automatically get destroyed and recreated.
[Android Software/Hacking General [Developers Only]] munjeni:
Probably we not need to modify all three sha256 hashes at all since we do not modify partitions geometry inside super partition!!? I'm able to generate right checksums up to first two -> https://postlmg.cc/jnVVMczK , the last one is not easy but I'm probably can do it too (believing we no need to modify any of those 3 checksums)

/* 44: The total size of all tables. This size is contiguous; tables may not

* have gaps in between, and they immediately follow the header.

*/

unsigned int tables_size;

/* 48: SHA256 checksum of all table contents. */

unsigned char tables_checksum[32];

So I'm believing I can make easy modification to my superunpack to make partitions rw on the fly during superimage extraction, even no need to be extracted but modified on the fly :)
[Android Software/Hacking General [Developers Only]] munjeni:
I'm uploaded changes to git you should compile it and try https://github.com/munjeni/super_image_dumper/commit/e1b7c96a787fa374ace39b7d34c9883741a7d953 what I'm done is simple prompt while extracting each ext4 image it will promt you to make it rw, with it you no need tools like tune2fs and e2fsck anymore

I will implement in next month super image on the fly tool withuot need to extract anything if you confirm hex editing super image didn't giving bootloop. You sholud hex compare rw and ro images to get idea what need to be modified inside superimage
[Android Software/Hacking General [Developers Only]] lebigmac:
This is great news. Do you mean your tool can change the ro flag to rw directly inside the /dev/block/sda15 super partition block without extracting and dumping the files to internal storage? This would be awesome! Some people don't have much free space on internal storage. I have over 80GB of free space so for me extracting the files to internal storage is not an issue ;)
[Android Software/Hacking General [Developers Only]] quanqw:
So my device has no super partition can be use?
[Android Software/Hacking General [Developers Only]] munjeni:
You no need any tool, you just need to remount your partition rw

mount -o remount,rw /system

you need root permission and selinux permission to do that. Search xda for "how to root your device model" e.g. how to root xperia XZ1. This thread title should be changed to:

[SCRIPT][Android 10+] Universal Mount System read write R/W for devices with super partition only​
[Android Software/Hacking General [Developers Only]] drdani335:
Hi, first I'd like to thank you for your wonderful job.

I have a "Redmi Note 9" with android 10. I had some issues with the script. first I had to change "#!/system/bin/sh" to "#!/sbin/sh". then i found out that the script can't find files inside tools/bin dir. i tried chmod on all parent dirs and also files with no success. i even tried accessing them using adb shell and also twrp terminal but the result was the same. so i moved all the files to the root directory of "makesysrw_1.22". with changing the script that problem was solved. then some other issues were coming up and i had to change the script like "./tune2fs" to "tune2fs". now i facing another issue that i can't solve. it says "stat: invalid option -- c". apparently "stat -c" is not recognized. I tried to find a replacement but nothing worked and as a result it can't get the size right and fails to resize the partition.

I can't find a way around it so I'm asking for your help. thanks in advance.
[Android Software/Hacking General [Developers Only]] quanqw:
But another partition can not mount. Ex I mount vendor partition to modify fstab but it restore to stock when it reboot.
[Android Software/Hacking General [Developers Only]] lebigmac:
haha nice detective work sir!

simply go to line #99

and comment it out by putting # symbol in front like this

#currentSize=$(stat -c "%s" $1)

now uncomment line #100 by removing # symbol like this:

currentSize=$(wc -c < $1)

I also implemented additional functionality for those without super partition a couple of weeks ago. You not try it yet? ;)

Of course it is not guaranteed to work on your device.

This whole script will be obsolete as soon as you release your new tool. That's just great. I can't wait. Then I will no longer have to write over 10 pages of customer support in private message with some people and I can finally start a new project :D

It's not important how somebody achieved system read/write access. The important thing is that a lot of people get r/w access to their device. This is great for the open source community.
[Android Software/Hacking General [Developers Only]] lebigmac:
I've sent you a possible solution yesterday. Have you not got it to work yet?

Alright let me wrap up a new zip then. Hopefully you can install it ;)
[Android Software/Hacking General [Developers Only]] munjeni:
I have good news for you! https://xdaforums.com/t/tool-win-lin-and-darw-super-image-unpack-repack-tools.4120963/post-84771495

Please do not use to block devices directly since things need to be tested first and confirmed working!
[Android Software/Hacking General [Developers Only]] lebigmac:
Me too I have good news for you ;)

v1.24 of my script is ready! All those with lpmake error feel free to give it a try and report back if it works for you or not. Thanks! I can't guarantee that it will work on all devices but I'm hoping for the best.

@Articul8Madness
[Android Software/Hacking General [Developers Only]] lebigmac:
Are you serious? Have you tried munjeni's tool yet? I'm sure it works perfectly on many devices. I myself will give it a try hopefully very soon. I am so excited to try it. My script is a joke compared to munjeni's tool ;) This guy is a true genius and has over 10 years of professional programming experience under his belt! I could never come up with such a tool such as superunpack. You must be a real genius and an expert programmer to do that.
[Android Software/Hacking General [Developers Only]] munjeni:
But I have made new tool called superrepack which will do things on the fly by direct modification in block device, eg. "superrepack /dev/block/superpartition ; sync". Dynamic disk format is the same on all devices so it should work. Do in mind this is not a tested yet, confirmation is need, be ready for probably brick if it not work! Root is need, selinux and other protections disabled to make sure things not get blocked during conversion. Conversion is done in milisecconds. Further questions about my tool lets continue in my thread
[Android Software/Hacking General [Developers Only]] Frxhb:
thanks @lebigmac ! It worked flawlessly and without problems for me.

My device: XIAOMI Mi 10T lite, Android 11 TWRP (rooted with magisk)
[Android Software/Hacking General [Developers Only]] lebigmac:
Darling super_sparsechunk.0 , sparsechunk.1,sparsechunk.2.... files are just Motorola's silly way of splitting up the super.img file into multiple smaller files to make it easier to flash. There must be a way to merge them into one single super.img and the other way around. Maybe an interesting new project for @munjeni ;)
[Android Software/Hacking General [Developers Only]] munjeni:
You not getting what I mean by superrepack. You no need to flash anything since conversion is done directly to block device. Diferencie in format between block device and image is image have sparse chuncks but block device have no sparse chunks but raw format. If you do not have root offcourse it will not make conversion.
[Android Software/Hacking General [Developers Only]] munjeni:
You again "to flash image"? Did you read what I told you?
[Android Software/Hacking General [Developers Only]] munjeni:
If you have working root on your device first thing is to shutdown selinux to permissive mode, seccond thing to disable other protections if it exist so to make you allow do conversion to block device using superrepack tool. You should give us log if it give you error.
[Android Software/Hacking General [Developers Only]] harpreet.s:
Hi ,

Mine is oneplus nord on Android 11 with A and B partitions, and the version 1.24 script worked perfectly.

# mount -o remount,rw /

#

# cd /system

# touch test

# ls -ltrh test

-rw-r--r-- 1 root root 0 Apr 3 20:46 test

#

Great job @lebigmac , your effort is really appreciated , and keep the energy up !!
[Android Software/Hacking General [Developers Only]] harpreet.s:
I want to delete this post , wrote it accidentally , is it possible?
[Android Software/Hacking General [Developers Only]] james28909:
I have just noticed that I can create files in root directory, but I cannot edit or create anything in /system or /vendor
[Android Software/Hacking General [Developers Only]] harpreet.s:
Hi All, It is odd but thats how it is working for me -

For phones with A and B partition , one way to make it work is upgrade both partitions to same version, make partition B as active and then run script fresh that will work perfectly.

Or just make partition B as active and then run script fresh that can also work.

When partiton A is active, this is the failure.

========================================================================

makesysrw: Joining all extracted images back into one single super image...

makesysrw: Please wait and ignore the invalid sparse warnings...

makesysrw: Error! failed to create super_fixed.img file

No change , only swap active partition to B , and it is success !!

========================================================================

makesysrw: Joining all extracted images back into one single super image...

makesysrw: Please wait and ignore the invalid sparse warnings...

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

Invalid sparse file format at header magic

makesysrw: Successfully created patched super image @

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

makesysrw: Congratulations! Your images should now be rw

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

#

Slot swapping can be done from fastboot -

#command to check current active

.\fastboot.exe getvar current-slot

#command to swap , below will set active slot to b

./fastboot --set-active=b
[Android Software/Hacking General [Developers Only]] james28909:
But I only have android 8.1 <.<

Its almost like they rolled function from newer android source in to this device somehow. It is 8.1 and api level 27 and I cannot write to system. All I can do is use magisk module and that is a pita to manage a lot of files
[Android Software/Hacking General [Developers Only]] james28909:
Trust me, its not that simple on this device for some reason. Everything I have tried does not make /system writable. I can make files in rootfs / but not anything in system etc. I am rooted and it is working good. Everything I working as it should. This thing does have proprietary device drivers for sound though as it has a built in stereo. But I am fully rooted with magisk and cannot write to system folder in android 8.1. Wonder how I can figure out how to know for fact why I cannot write to system.
[Android Software/Hacking General [Developers Only]] james28909:
Its actually not a phone. Its a chinese 10" android touch screen stereo head unit. Its actually OK. The sound sucks because I got the cheapest version, but they have some very nice ones that sound good that have built in dsp etc. And ive had some minor problems with this one I have, and customer service has been 100% top notch, and they are sending me a new one completely free of charge. I plan on making a complete dump before even turning it on, and comparing with what I have installed on this one. I think when I got this one it was actually a lower android (api 23) and they send me an update file, so I wonder if I can write to system on the new one they are going to send me.

Its Ac8227L but its the yt9213aj fake 2gb (really just 1gb) quad core armv7 I think. It has mediatek6323 chip on it and I cannot find any info for it. But I created my own scatter file and have rooted the device. Sometimes the device will reboot itself into recovery and factory reset itself. My solution was to wipe recovery partition and just flash it back when I need it. But if it can reboot itself into bootloader then it can erase partitions anyway. Need to figure out why its doing this
[Android Software/Hacking General [Developers Only]] james28909:
I am fairly certain that the dump I have and scatter file are 100% compatible with my device. Ive made complete backups, but not messed with preloader because I am not sure what it is. But the rest of the device, unless there are hidden partitions, I have backed up multiple times and the dumps I get look like hat they are suppose to I think. I am fairly confident that I could erase my flash completely and the dump I have would get me back running. I just wish I had a dump from the original firmware. I am going to try this on my device just to see what happens, and since I am pretty much brick proof.
[Android Software/Hacking General [Developers Only]] james28909:
I tried running this on my system.img but it says not a super partition or somehting
[Android Software/Hacking General [Developers Only]] james28909:
I'm telling you, there si something different going on with these head units like this. I was just able to do a mount -o remount,rw / and then su cat > /system/lol and it made the file. Ls /system/ verified the file was now there. But as soon as I created that one I tried to create another cat > /system/lol1 and it gave me the read only error. To me, there is some process or some watchdog that is enforcing this beyond the scope of what we are used to dealing with. Either that, or this head unit is just wack.

How could I listen for and/or trace down processes that are doing things like this (forcing read only mode on certain partitions.

EDIT: also to disable dm_verity on this device you boot into fastboot and do fastboot --disable-verification flash vbmeta vbmeta.img with a blank vbmeta (has to be made with avb tool.) I don't have a vbmeta partition and I got an error saying that in fastboot. But when I rebooted it would not boot into the system. I had to reboot into bootloader and do the vbmeta thing and then reflash recovery. Then for some reason that let me boot back into system, then I erased recovery again because I am having an issue where it is wiping itself clean randomly.
[Android Software/Hacking General [Developers Only]] james28909:
Personally, I think it is functioning as intended. It is not in the best interest of this company to allow modification of the device to allow recovery of proprietary data or information in regards to how the device works. If you can unlock other functions via simple software edits in some file then it would be of the companies best interest to try and protect all of that somehow. I bet the other unit is going to be identical in terms of read/write in system. The new one might be on an older firmware/api, but I'm willing to bet it will act the same as this one.
[Android Software/Hacking General [Developers Only]] drdani335:
excellent, i did it and it finally finished with a message saying Congratulations...

but when it reboots the system partition is still read-only. the twrp and magisk are in place and i have su but "mount -o rw,remount /" says it's read-only and the partition can't be written. i've tried it multiple times with the same result. what should i do ?
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @drdani335 it looks like you reached the end of the script. Feel free to send me your log files so I can see what exactly happened.

You are aware that there is a new stallion in town right?

I think my script require 1 or 2 small updates to improve compatibility with more devices and then it should be finished and I can finally put it on the shelf

Thanks @harpreet.s for sharing this interesting discovery and your workaround. I still don't know what exactly is causing this issue but I will try to wrap my head around it :D
[Android Software/Hacking General [Developers Only]] harpreet.s:
It would be worth trying a different busybox or use a root file explorer to check if it can mount the partition as rw.
[Android Software/Hacking General [Developers Only]] harpreet.s:
Oneplus Nord
[Android Software/Hacking General [Developers Only]] S8Mate:
I installed the 1.24 zip with TWRP and it appeared to work without any errors that I saw, but my phone restarted itself afterward and now it takes me straight to the fastboot menu instead of starting up the phone. When I try to flash anything else in TWRP now (Backup, Stock Firmware) I get 2 error lines at the start of the flashing and it fails:

Failed to mount '/product' (Invalid argument)

Failed to mount '/vendor' (Invalid argument).

So I seem to be bricked.

The device is Motorola Edge
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi S8Mate. Sad to hear that. Please share your log files which are next to the script thanks!

Also a screenshot would be nice.

Are you using Samsung?

Got a super partition?

If your device is bricked simply reboot into bootloader and flash your stock super image again.

fastboot flash super super.img

You could also unbrick your device from recovery.
[Android Software/Hacking General [Developers Only]] S8Mate:
I'm on Motorola Edge, and I do not know if I have a super partition. Should the log files have been created on the SD card? I don't see anything new on there.

Upon trying to flash in fastboot it is not recognizing my device as connected, maybe because it is not in debug mode? But I can't turn on debug mode because I can't start up the OS. When I try to flash anything in TWRP, I get the errors seen in the attachment.
[Android Software/Hacking General [Developers Only]] lebigmac:
What's debug mode?

The log files should be in the script folder in /data/local/tmp/

I know an easy way to restore your system if you've got a backup. You do have a backup right?

Check your PM
[Android Software/Hacking General [Developers Only]] Kurtsu:
Thanks for your hard work!

I am waiting the timer end to unlock my Xiaomi device but very eager to try your script. Does your script mean i can use root required apps without magisk's modules?
[Android Software/Hacking General [Developers Only]] james28909:
Yes, this is exactly what this does. It makes your system rw and I think it sticks even after reboot. Guess youll have to test and find out right?
[Android Software/Hacking General [Developers Only]] drdani335:
after a few tests I was able to write to system partition while in twrp and using adb shell. but the device went on a boot loop afterwards. i tried flashing vbmeta.img, disabling verity and verification, wiping data and cache, i even uninstalled magisk in twrp using magisk uninstaller but it wouldn't boot to system. at the end i flashed stock boot.img and recovery.img but it still doesn't boot up. it just keeps trying to boot, shows the logo for a few minutes, but goes back to recovery. is there anything i can do without flashing the whole rom ?

regarding the "new stallion" you mentioned, i checked and apparently the author has deleted the attachments and asked everyone not to use it since it has some serious bugs.
[Android Software/Hacking General [Developers Only]] lebigmac:
Hi @Kurtsu thanks for your interest in this project.

Once you've got full r/w access to your device you should be able to push your own custom su binary to your system and you can root your device that way.

Hi @drdani335 Please send me all log files in script folder if you want me to investigate the issue.

The script worked and you can mount system as r/w in recovery but now you have a bootloop issue?

What did you change in system? Even the smallest change to init.rc, default.prop or other system files can be enough to cause bootloop...

Did you use the latest v1.24 ? In your screenshot it says v1.22

If you can't fix the bootloop from recovery simply flash original super again and try again with v1.24

fastboot flash super super.img

In next version of the script I will try to implement a feature that automatically creates log file.
[Android Software/Hacking General [Developers Only]] saginesht:
Working on my POCO X2 Device with super partition using v1.24....

Working on MIUI 12 global stable ANDROID 11 and Latest Xiaomi.eu beta roms...
[Android Software/Hacking General [Developers Only]] Rezrex:
Suggestion.

Remove the reboot to system and replace with exit. I updated my phone and after updating I rebooted to twrp and flashed the zip. Process completed without error but left my data partition encrypted/unmountable. Had to format data (i had a backup) in twrp to be able to boot the os. Not sure what caused it to happen, definitely something with my twrp. I did find however removing reboot system from the script and running the exit command in twrp terminal prevents this from occuring. Exit from the script afaik does not.