[Android Q&A, Help & Troubleshooting] Dennys_Sobrinho:
I have a Xiaomo 12 Pro (zeus) with twrp-3.7.1_12-v8.6_A14-zeus-skkk

I'm using the ROM HyperOS 24.6.3 by xiaomi.eu

Unfortunately, this ROM blocks the installation of system applications, due to MiuiPackageInstaller.apk having been modified and implementing this prohibition.

I want to create a TWRP script so that it is possible to modify this MiuiPackageInstaller.apk, using official Xiaomi APPs, being installed via TWRP.

But I can't correctly mount the partitions in Read/Write mode

Could anyone who knows the correct name of the partitions help me?

NOTE:

Apparently the name of the mapping partition '/dev/block/bootdevice/by-name/system' and '/dev/block/bootdevice/by-name/system_root' are incorrect, as it is not mounted in Read/Write mode .

The only mapping that actually works is '/dev/block/bootdevice/by-name/data'

I know that these mappings exist:

/system_root (Root of the Android filesystem)

/system

/system_ext

/vendor

/product

/data

Download here.

Here's my test script 'updater-script':

ui_print(" ");
ui_print("***************************************");
ui_print("* MIUI Package Installer 3.1.8-global *");
ui_print("* *");
ui_print("* Script of Installation *");
ui_print("* by Dennys_Santos @ xiaomi.eu *");
ui_print("* *");
ui_print("* --- Use it at your own risks! --- *");
ui_print("***************************************");
show_progress(1.000000, 0);
set_progress(0.100000);
ui_print(" ");
ui_print("Checking partitions...");
ui_print(" ");
package_extract_dir("tmp", "/tmp");

set_perm(0, 0, 0777, "/tmp/busybox/busybox");

set_progress(0.300000);
ifelse(
is_mounted("/system"), (
run_program("/tmp/busybox/busybox", "mount", "-o", "remount,rw", "/system");
), (
run_program("/tmp/busybox/busybox", "mount", "-o", "rw", "/dev/block/bootdevice/by-name/system", "/system");
)
);
sleep(0.1);
ifelse(
is_mounted("/data"), (
run_program("/tmp/busybox/busybox", "mount", "-o", "remount,rw", "/data");
), (
run_program("/tmp/busybox/busybox", "mount", "-o", "rw", "/dev/block/bootdevice/by-name/data", "/data");
)
);
sleep(0.1);
ifelse(
is_mounted("/system_root"), (
run_program("/tmp/busybox/busybox", "mount", "-o", "remount,rw", "/system_root");
), (
run_program("/tmp/busybox/busybox", "mount", "-o", "rw", "/dev/block/bootdevice/by-name/system_root", "/system_root");
)
);
sleep(0.1);
ifelse(
is_mounted("/system_root"), (
run_program("/tmp/busybox/busybox", "mount", "-o", "remount,rw", "/product");
), (
run_program("/tmp/busybox/busybox", "mount", "-o", "rw", "/dev/block/bootdevice/by-name/product", "/product");
)
);
sleep(0.1);

# -----------------------------------------------------------------------------------------------------------------
ifelse(
is_mounted("/system"), (
ui_print("Installing, please wait...");
package_extract_dir("system", "/system");

ui_print("Fixing permissions...");
run_program("/tmp/busybox/busybox", "chmod", "755", "/system/priv-app/MiuiPackageInstaller");
run_program("/tmp/busybox/busybox", "chmod", "755", "/system/priv-app/MiuiPackageInstaller/*.apk");

ui_print("Clearing cache...");
run_program("/tmp/busybox/busybox", "rm", "-rf", "/data/resource-cache/*");
run_program("/tmp/busybox/busybox", "rm", "-rf", "/data/system/package_cache/*");
run_program("/tmp/busybox/busybox", "rm", "-rf", "/cache/*");
run_program("/tmp/busybox/busybox", "rm", "-rf", "/data/dalvik-cache/*");
), (
ui_print("ERROR: Partition not mounted...");
)
);
# -----------------------------------------------------------------------------------------------------------------

set_progress(0.900000);
run_program("/tmp/busybox/busybox", "umount", "/system");
run_program("/tmp/busybox/busybox", "umount", "/data");
run_program("/tmp/busybox/busybox", "umount", "/system_root");
run_program("/tmp/busybox/busybox", "umount", "/product");

delete_recursive("/tmp/busybox");
ui_print("Done.");
ui_print("");