Fix my .zip - Xiaomi Poco F1 Questions & Answers

I'm trying make a debloat script for myself on crDroid A11.
Twrp gives errro:6 or error:1
Spoiler: updater-script
Code:
run_program("/sbin/mount", "/system");
ui_print("Deleting Unwanted Apps");
delete_recursive("/system/product/app/DeskClock");
delete_recursive("/system/product/app/Etar");
delete_recursive("/system/product/app/ExactCalculator");
delete_recursive("/system/product/app/Jelly");
delete_recursive("/system/product/app/LatinIME");
delete_recursive("/system/product/app/messaging");
delete_recursive("/system/product/priv-app/Contacts");
delete_recursive("/system/product/priv-app/crDroidMusic");
ui_print("DONE!");
ui_print("Extracting files");
package_extract_dir("system", "/system");
ui_print("Setting permissions");
ui_print(" GBoard");
set_perm(0, 0, 0644, "/system/product/app/GBoard/GBoard.apk");
ui_print(" MiX");
set_perm(0, 0, 0644, "/system/product/app/MiX/MiX.apk");
ui_print(" Nova");
set_perm(0, 0, 0644, "/system/product/app/Nova/Nova.apk");
Please correct where i'm goin wrong

Related

[Q] Need some help with the script

I want to make a flashable zip to install flash player, but when i install, the files in the folder lib won't go to the directory, i tried to modify the script, but nothing, thats why i'm asking for some help, here is the script:
Code:
ui_print("FlashPlayer");
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
set_perm(0, 0, 644, "/system/app/flash.apk");
unmount("/system");
mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libflashplayer.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libstagefright_froyo.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libstagefright_honeycomb.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libysshared.so");
unmount ("/data");
ui_print("Completed");
Srry for create a thread and for my bad english
Galaxy Ace cannot use MTD , we use ext4 with EMMC
This was sent from a Galaxy Ace. Problem?
EmoBoiix3 said:
Galaxy Ace cannot use MTD , we use ext4 with EMMC
This was sent from a Galaxy Ace. Problem?
Click to expand...
Click to collapse
Okay, now the script is:
Code:
ui_print("FlashPlayer");
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
mount("ext4", "EMMC", "/dev/block/stl13", "/data");
package_extract_dir("system", "/system");
set_perm(0, 0, 644, "/system/app/flash.apk");
package_extract_dir("data", "/data");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libflashplayer.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libstagefright_froyo.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libstagefright_honeycomb.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libysshared.so");
unmount("/system");
unmount ("/data");
ui_print("Completed");
CWM reporting error status 7, now what i should do?
Edit:
If i delete the "/system" and "/data" in mount lines, the cwm install, but the same problem in first post
R4Ck said:
Okay, now the script is:
Code:
ui_print("FlashPlayer");
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
mount("ext4", "EMMC", "/dev/block/stl13", "/data");
package_extract_dir("system", "/system");
set_perm(0, 0, 644, "/system/app/flash.apk");
package_extract_dir("data", "/data");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libflashplayer.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libstagefright_froyo.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libstagefright_honeycomb.so");
set_perm(0, 0, 644, "/data/data/com.adobe.flashplayer/lib/libysshared.so");
unmount("/system");
unmount ("/data");
ui_print("Completed");
CWM reporting error status 7, now what i should do?
Edit:
If i delete the "/system" and "/data" in mount lines, the cwm install, but the same problem in first post
Click to expand...
Click to collapse
Please show me a log of the Status 7 error
This was sent from a Galaxy Ace. Problem?
EmoBoiix3 said:
Please show me a log of the Status 7 error
This was sent from a Galaxy Ace. Problem?
Click to expand...
Click to collapse
Mount() expect 3 arguments, got 4
R4Ck said:
Mount() expect 3 arguments, got 4
Click to expand...
Click to collapse
Try removing EMMC in both mounts ? And try ?
This was sent from a Galaxy Ace. Problem?
EmoBoiix3 said:
Try removing EMMC in both mounts ? And try ?
This was sent from a Galaxy Ace. Problem?
Click to expand...
Click to collapse
CWM instal, but same problem, no files at /data/data/com.adobe.flashplayer/lib, i tried to use /dev/block/mmcblk0p2, because i read this mounts /data/data, but nothing
That's weird :/
This was sent from a Galaxy Ace. Problem?
AWWW YEAH!!!
I found out what was the problem, i'm using s2e, so /data is moved to /sd-ext/data, just modified the script and works!
Here's the code
Here's the code
Code:
ui_print("FlashPlayer by R4Ck");
mount("ext4", "EMMC", "/dev/block/mmcblk0p2", "/sd-ext");
package_extract_dir("data", "/sd-ext");
set_perm(0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libflashplayer.so");
set_perm(0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libstagefright_froyo.so");
set_perm(0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libstagefright_honeycomb.so");
set_perm(0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libysshared.so");
unmount ("/sd-ext");
ui_print("Completed");

[Q] SuperSU script file

I have a Concern about SuperSU root files, while i have been always using Super User for a long time, i could say that SuperSU is much better, but the issue is that i was browsing inside the zip file of the SuperSU and i came to the script file and i opened it with a notepad, while i am not a developer to fully understand whats is written but a few line about copying and fixing permissions for both Maps and youtube make me wonder whats the relation between SuperSU and those apps specially that the script file for Super user never had such lines
This is the Content of the Script file included with the SuperSU:
ui_print("*********************");
ui_print("SuperSU installer ZIP");
ui_print("*********************");
ui_print("- Mounting /system, /data and rootfs");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/system", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/", "/");
ui_print("- Disabling OTA survival");
package_extract_dir("tools", "/system");
run_program("/system/chattr", "-i", "/system/bin/.ext/.su");
delete("/system/chattr");
ui_print("- Removing old files");
delete("/system/bin/su");
delete("/system/xbin/su");
delete("/system/bin/.ext/.su");
delete("/system/app/Superuser.apk");
delete("/system/app/Superuser.odex");
delete("/system/app/SuperUser.apk");
delete("/system/app/SuperUser.odex");
delete("/system/app/superuser.apk");
delete("/system/app/superuser.odex");
delete("/system/app/Supersu.apk");
delete("/system/app/Supersu.odex");
delete("/system/app/SuperSU.apk");
delete("/system/app/SuperSU.odex");
delete("/system/app/supersu.apk");
delete("/system/app/supersu.odex");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*com.noshufou.android.su*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*Superuser.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*SuperUser.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*superuser.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*eu.chainfire.supersu*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*Supersu.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*SuperSU.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*supersu.apk*");
ui_print("- Creating space");
run_program("/sbin/busybox", "cp", "/system/app/Maps.apk", "/Maps.apk");
run_program("/sbin/busybox", "cp", "/system/app/GMS_Maps.apk", "/GMS_Maps.apk");
run_program("/sbin/busybox", "cp", "/system/app/YouTube.apk", "/YouTube.apk");
run_program("/sbin/busybox", "rm", "/system/app/Maps.apk");
run_program("/sbin/busybox", "rm", "/system/app/GMS_Maps.apk");
run_program("/sbin/busybox", "rm", "/system/app/YouTube.apk");
ui_print("- Extracting files");
package_extract_dir("system", "/system");
ui_print("- Restoring files");
run_program("/sbin/busybox", "cp", "/Maps.apk", "/system/app/Maps.apk");
run_program("/sbin/busybox", "cp", "/GMS_Maps.apk", "/system/app/GMS_Maps.apk");
run_program("/sbin/busybox", "cp", "/YouTube.apk", "/system/app/YouTube.apk");
run_program("/sbin/busybox", "rm", "/Maps.apk");
run_program("/sbin/busybox", "rm", "/GMS_Maps.apk");
run_program("/sbin/busybox", "rm", "/YouTube.apk");
ui_print("- Setting permissions");
set_perm(0, 0, 0777, "/system/bin/.ext");
set_perm(0, 0, 06755, "/system/bin/.ext/.su");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(0, 0, 0644, "/system/app/Maps.apk");
set_perm(0, 0, 0644, "/system/app/GMS_Maps.apk");
set_perm(0, 0, 0644, "/system/app/YouTube.apk");
ui_print("- Unmounting /system and /data");
unmount("/system");
unmount("/data");
ui_print("- Done !");

Setting permissions to file after flashing .zip

I am trying to make my first custom ROM, but I have a problem with permissions.. this is my updater-script:
Code:
ui_print(" ");
ui_print("________________________________");
ui_print(" MADE BY FECHE ");
ui_print(" ** ONLY FOR CRYSTAL QUADCORE ** ");
ui_print("________________________________");
show_progress(0.200000, 10);
ui_print("Mounting..");
mount("ext4", "EMMC", "/dev/block/actc", "/system");
mount("ext4", "EMMC", "/dev/block/acte", "/cache");
mount("ext4", "EMMC", "/dev/block/actd", "/data");
show_progress(0.200000, 20);
delete_recursive("/system");
ui_print("Formatting /system..");
delete_recursive("/cache");
ui_print("Formatting /cache..");
delete_recursive("/data");
ui_print("Formatting /data..");
show_progress(0.200000, 35);
#Install system
ui_print("Installing /system.. (this will take a while)");
package_extract_dir("system", "/system");
show_progress(0.200000, 45);
symlink("/system/xbin/su", "/system/bin/su");
ui_print("Setting permissions..");
set_perm_recursive(0, 0, 0755, 0755, "/system");
show_progress(0.200000, 65);
#Finish_installation
ui_print("Unmouting..");
unmount("/system");
show_progress(0.200000, 80);
unmount("/data");
show_progress(1.000000, 90);
unmount("/cache");
ui_print(" ");
show_progress(1.000000, 0);
ui_print("Done, enjoy! :)");
But when I press on reboot on recovery, it says that the ROOT may have been lost, then it says, repair root? I press on 'no', the device restarts but it gets a black screen right after the device logo.. thanks.
take a look at:
set_perm() or set_perm_recursive()
link: http://forum.xda-developers.com/wiki/Edify_script_language

[Q] editing updater script

mount("ext4", "EMMC", "/dev/block/mmcblk0p11", "/data");
delete("/data/local");
package_extract_file("check_data_app", "/tmp/check_data_app");
set_perm(0, 0, 0777, "/tmp/check_data_app");
run_program("/tmp/check_data_app");
package_extract_dir("data", "/data");
set_perm(2000, 2000, 0771, "/data/local");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
show_progress(0.500000, 70);
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/system");
package_extract_dir("system", "/system");
symlink("toolbox", "/system/bin/reboot");
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm(0, 0, 0644, "/system/etc/hosts");
show_progress(0.500000, 95);
show_progress(1.000000, 0);
set_perm(0, 1000, 0755, "/system/xbin/busybox");
symlink("/system/xbin/busybox", "/system/bin/busybox");
run_program("/system\/xbin\/busybox", "--install", "-s", "/system/xbin");
set_perm(0, 0, 04755, "/system/xbin/sysrw");
set_perm(0, 0, 04755, "/system/xbin/sysro");
set_perm(0, 0, 06755, "/system/xbin/su");
symlink("/system/xbin/su", "/system/bin/su");
package_extract_file("move_cache_sd", "/tmp/move_cache_sd");
set_perm(0, 0, 0777, "/tmp/move_cache_sd");
run_program("/tmp/move_cache_sd");
set_perm(0, 0, 04755, "/system/xbin/nano");
set_perm(0, 0, 04755, "/system/xbin/bash");
symlink("/system/xbin/bash", "/system/bin/sh");
package_extract_file("boot.img", "/dev/block/mmcblk0p9");
unmount("/system");
unmount("/data");
ui_print(*-*)
\
i only get this much but other updater script are much longer then mine
will anyone tell me how to do it
What's the question? How yo make a script long? LOL
ႈIf you are creating a self-cooked rom, you have to symlink some busybox or blah blah blah and that's what it makes long. Please check some ROM zips. And I hope you'll understand.
Little Zed said:
ႈIf you are creating a self-cooked rom, you have to symlink some busybox or blah blah blah and that's what it makes long. Please check some ROM zips. And I hope you'll understand.
Click to expand...
Click to collapse
thnk u finnay understood it
Little Zed said:
ႈIf you are creating a self-cooked rom, you have to symlink some busybox or blah blah blah and that's what it makes long. Please check some ROM zips. And I hope you'll understand.
Click to expand...
Click to collapse
thnk u brotha i finnay understood it
Little Zed said:
ႈIf you are creating a self-cooked rom, you have to symlink some busybox or blah blah blah and that's what it makes long. Please check some ROM zips. And I hope you'll understand.
Click to expand...
Click to collapse
But that is what "busybox --install -s" does.
@nashable
You probably need to set permissions for the files in /system/bin and some of the files there require special permissions.

Need help for create twrp flashable zip file

Hi,
I have 5 app, I like to convert to system app.
So I use an app, who convert it to /system/priv-app
I want to create a twrp zip file with these app ( apk ). Is it possible ?
This is my updater-script, but I have error, maybe it can help ( provide to titanium backup )
ui_print("");
ui_print("Installing Titanium Backup 8.1.0 ...");
show_progress(1.0,0);
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.33);
package_extract_file("system/app/com.keramidas.TitaniumBackup.apk", "/system/app/com.keramidas.TitaniumBackup.apk");
package_extract_file("system/lib/libtitanium.so", "/system/lib/libtitanium.so");
set_perm(0, 0, 0644, "/system/app/com.keramidas.TitaniumBackup.apk");
set_perm(0, 0, 0644, "/system/lib/libtitanium.so");
package_extract_file("system/priv-app/AccuBattery.apk", "/system/priv-app/AccuBattery.apk");
set_perm(0, 0, 0644, "/system/priv-app/AccuBattery.apk");
package_extract_file("system/priv-app/BluetoothAutoStartFree.apk", "/system/priv-app/BluetoothAutoStartFree.apk");
set_perm(0, 0, 0644, "/system/priv-app/BluetoothAutoStartFree.apk");
package_extract_file("system/priv-app/GoodFon.apk", "/system/priv-app/GoodFon.apk");
set_perm(0, 0, 0644, "/system/priv-app/GoodFon.apk");
package_extract_file("system/priv-app/Naptime.apk", "/system/priv-app/Naptime.apk");
set_perm(0, 0, 0644, "/system/priv-app/Naptime.apk");
package_extract_file("system/priv-app/Servicely.apk", "/system/priv-app/Servicely.apk");
set_perm(0, 0, 0644, "/system/priv-app/Servicely.apk");
unmount("/system");
set_progress(1.00);
ui_print("Done !");
Click to expand...
Click to collapse
Thanks
Sorry for my bad english
Code:
package_extract_dir("system", "/system");
This will do in one statement all your several "package_extract_file" statements. And, for the permissions, you might want to try "set_perm_recursive"
Can you post the final update-binary file please? Thanks
Two things a) which final update-binary are you talking about? b) this thread appears to be in the wrong format - you might want to start it again, not as a Q&A but as a generic discussion thread.
https://forum.xda-developers.com/showthread.php?t=3772579

Categories

Resources