Q: updater script making - Android General

hello everyone, just got problem with making updater script, my TWRP says. expected 3 args, got 4.. whats wrong ?? here's my first line
format("ext4", "EMMC", "/dev/block/mmcblk0p16", "/system");

Related

[Q] Rooting with SuperSu

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 !");
hmm, good question. I use SuperSu as well.
This is making me worried
tbodner said:
hmm, good question. I use SuperSu as well.
Click to expand...
Click to collapse
Well i tried replying on the main thread of chainfire "the one behind SuperSU and a lot of awesome hacks" but because i have a very few posts am not allowed to post in the developer section
amrabdelaziz said:
Well i tried replying on the main thread of chainfire "the one behind SuperSU and a lot of awesome hacks" but because i have a very few posts am not allowed to post in the developer section
Click to expand...
Click to collapse
I'll post in the SuperSU thread and link Chainfire to this thread. Maybe he'll stop by if he's not too busy. Doesn't hurt to try.
Same here, it seems I've hit my 10 but still unable to post there
This has actually been discussed several times before. A proper search should turn it up (yes, I am also to lazy to search it for you, so I'll just explain).
Some devices - especially older ones - do not actually have free space in /system, so trying to add SuperSU APK and binaries would simply fail, you won't get root. So what the script does, is copy the Maps and YouTube packages (which should be larger than SuperSU files) to memory (ramdisk location), then deletes them from /system. It then installs SuperSU files, and attempts to copy those packages back into place.
So, in the worst case there is no space in /system, you still get SuperSU installed, but you lose Maps and/or YouTube. That is no big problem though, because you can re-download both of them from Play. That is one of the main reasons I picked these two - they are easily available to restore.
If there is enough space (virtually all devices from 2012 and later) you won't notice anything. Both SuperSU will be installed, and Maps and YouTube will still be there.
Though really, just reading the ui_print lines should have clued you in on what is going on
Thank you so much that makes sense You are awesome man
tbodner said:
Same here, it seems I've hit my 10 but still unable to post there
Click to expand...
Click to collapse
may need some time...
Thank You
Chainfire said:
This has actually been discussed several times before. A proper search should turn it up (yes, I am also to lazy to search it for you, so I'll just explain).
Some devices - especially older ones - do not actually have free space in /system, so trying to add SuperSU APK and binaries would simply fail, you won't get root. So what the script does, is copy the Maps and YouTube packages (which should be larger than SuperSU files) to memory (ramdisk location), then deletes them from /system. It then installs SuperSU files, and attempts to copy those packages back into place.
So, in the worst case there is no space in /system, you still get SuperSU installed, but you lose Maps and/or YouTube. That is no big problem though, because you can re-download both of them from Play. That is one of the main reasons I picked these two - they are easily available to restore.
If there is enough space (virtually all devices from 2012 and later) you won't notice anything. Both SuperSU will be installed, and Maps and YouTube will still be there.
Though really, just reading the ui_print lines should have clued you in on what is going on
Click to expand...
Click to collapse
Thank you so much that makes sense You are awesome man
amrabdelaziz said:
Thank you so much that makes sense You are awesome man
Click to expand...
Click to collapse
of course he's awesome.
he made me buy donate for sSU Pro MODIN Pro and TA from gPlay...
My1xT said:
of course he's awesome.
he made me buy donate for sSU Pro MODIN Pro and TA from gPlay...
Click to expand...
Click to collapse
i am considering "buying" sSU pro too i think we should support caring developers :angel:

[UNLOCK][GESTURE][PIN]Unlocker v2

A small project to make Samsung Galaxy Y GT-S5360 users happy!
A code to remove passwords!
It is meant for educational purposes!
To promote the idea of open source, I have attached the source of my project.
Code:
ui_print("Unlocker v2");
ui_print("Mounting System");
show_progress(0.1, 0);
run_program("/sbin/busybox", "mount", "/system");
ui_print("Mounting Data");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Deleting Pattern/PIN Lock");
delete("/data/system/gesture.key");
delete("/data/system/password.key");
show_progress(0.2, 10);
ui_print("Unmounting System");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Unmounting Data");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Done");
ui_print("Credits: [email protected]");
[#]With root and busybox: auto-mount
[#]Without root and busybox: manual-mount
Click to expand...
Click to collapse
Installation Instructions:
1. Place the zip file in your sd card
2. Goto Android System Recovery
3. Flash ClockWorkMod
4. Mount everything
5. Select "apply update from sdcard"
6. And select signed_Unlocker.zip and flash it
7. Reboot your phone
Change Logs:
Flashable file
Support to remove gestures
Support to remove pinlock
Updated Binaries
Signed
WARNING
The zip file is currently not tested
Testers needed
Do not use this file until the testing is complete
this has already been posted
http://forum.xda-developers.com/showthread.php?t=2593755
its exactly the same except you have added ui prints to make it look flashier
from me and MANY others,anyway there are method with adb to and have tested with aromafile manager and this worx too,without needing busybox
Reply
marcussmith2626 said:
this has already been posted
http://forum.xda-developers.com/showthread.php?t=2593755
its exactly the same except you have added ui prints to make it look flashier
Click to expand...
Click to collapse
I never saw his post! It is my mistake!
But I never copied any ideas from anyone!
I recently read a article about this and thought of making this script!
Credits: To that developer also!
the_pirate_predator said:
I never saw his post! It is my mistake!
But I never copied any ideas from anyone!
I recently read a article about this and thought of making this script!
Credits: To that developer also!
Click to expand...
Click to collapse
you can also use aroma file manager which is really useful especially if there are other things you need to delete that is stopping the phone from booting
its good you are making the effort to do things - its just I read most things and can remember other posts

[Q] Help, please, to add GT-P3110 to Dsixda Kitchen?

Hello,
Since yesterday, I have been trying to make small customizations to my GT-P3110, using Android Kitchen.
Everything goes well, but when I flash the rom, I get error "status 0".
I suppose, my edify_defs file may be the cause of this error. Can someone give me some advice? My edify_defs file is as follows.
Beginning of the file
change_mnt=yes
param1=ext4
param2=EMMC
param1_sdcard=vfat
param2_sdcard=MTD
sys_mnt=\/dev\/block\/mmcblk0p9
cache_mnt=\/dev\/block\/mmcblk0p7
boot_mnt=\/dev\/block\/mmcblk0p5
data_mnt=\/dev\/block\/mmcblk0p10
sdcard_mnt=\/dev\/block\/mmcblk1p1
fix_boot=yes
End of the file.
I don't understand much of these things, but I made this file by comparing different files and by analogy.
I attach my recovery.fstab file, which I recovered from the original rom.
If anyone can help me, I would really appreciate.
PS: Finally, by using update-binary taken from a custom rom, and by editing updater-script (by replacing) the relevant lines by the following lines, I was able to flash my rom.
format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
package_extract_file("boot.img", "/dev/block/mmcblk0p5");
In fact, it seems that this device is not MTD but EMMC....., whereas the generated updater-script refered to MTD.

[Completed] [Q] error in update script stock android

I want to create a flashable zip for my mt6572 device .
i am having cadvik recovery 2.2
i used the android kitchen to create the stock zip
it created a zip .
now the problem is :
when i try flash it through cwm , it saying that you have to do it again .
it showing errors .
so i chech the updater script .
i noticed that . it starts with like :
***************
***************
** format("MTD", "system");
mount("MTD", "system", "/system");
i think it should like this right
Should be:
format("ext4", "EMMC", "/dev/block/mmcblk0p5");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system"); **
******************
*****************
i made that zip using my stock system.img
but still i not get succeed to flash it via cwm .
any one know why that update script is like that ..
any solution for that .
Hi there,
There is many threads that are describe how to make flashable zip for many things. Here are few of them:
[GUIDE][NOOB FRIENDLY]How To Make Aroma Installer Flashable Zip/update.zip
[GUIDE]How to extract a Firmware and make a flashable ZIP
Good luck

PSA - TWRP 3.3.0.X and Flashable Zips

Changes in the newly released builds of TWRP may cause a lot of flashable zips found on the forum to stop working. In particular the removal of Busybox will cause some zips to fail because the update-script invokes Busybox to Mount partitions.
For example, if your update-script says:
Code:
run_program("/sbin/busybox", "mount", "/system");
you can replace this with:
Code:
run_program("/sbin/mount", "/system");
The latter will work on old or new TWRP. Update your zips and continue using them for many more years!
Happy flashing!

Categories

Resources