[PC][APP] D4 Update Zip Maker - Edify script like never before! - Android Apps and Games

Hello guys, wanna share this app I made with you xda guys, hope it to be useful. Also will need help from other devices, so I can get update binarys, and make boot.img code
http://forum.xda-developers.com/showthread.php?p=16431272

New version it's up!

Bump, New version it's up!, now installable!

Thanks great Work!!!!
Tengo una pregunta de Newbie... :S
I'm trying to created a package to install/replace 3 apps... Below is the code... I successfully created the zip but is not extracting nothing... any guidance would be appreciated...
mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "userdata", "/data");
ui_print("Deleting Current Exchnage clients...");
delete("/system/app/email.apk", "/system/app/exchange.apk", "/system/app/emailwidget.apk ");
# Deleting Current Exchange client/apk...
ui_print("Extracting new email app...");
package_extract_file("data/Email.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Email.apk");
# Extracting Current Email client...
package_extract_file("data/EmailWidget.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/EmailWidget.apk");
# Extracting Current EmailWidget client...
package_extract_file("data/Exchange.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Exchange.apk");
# Extracting Current Exchange client...
ui_print("Installation Completed. Enjoy!");

corrections are
chpimentelpr said:
Thanks great Work!!!!
Tengo una pregunta de Newbie... :S
I'm trying to created a package to install/replace 3 apps... Below is the code... I successfully created the zip but is not extracting nothing... any guidance would be appreciated...
mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "userdata", "/data");
ui_print("Deleting Current Exchnage clients...");
delete("/system/app/email.apk", "/system/app/exchange.apk", "/system/app/emailwidget.apk ");
# Deleting Current Exchange client/apk...
ui_print("Extracting new email app...");
package_extract_file("data/Email.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Email.apk");
# Extracting Current Email client...
package_extract_file("data/EmailWidget.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/EmailWidget.apk");
# Extracting Current EmailWidget client...
package_extract_file("data/Exchange.apk", "/system/app");
set_perm(0, 0 , 755, 644, "/system/app/Exchange.apk");
# Extracting Current Exchange client...
ui_print("Installation Completed. Enjoy!");
Click to expand...
Click to collapse
Please make sure that you place email and widgets apk file in a folder system>app and then use package_extract_dir("system","/system") to move all apps at once .
Then when setting permission it should be 0755 and 0644 not 755 and 644
And add unmount("/system") command at the end before ui_print line
Make this correction and hopefully it will work

Related

[Q] help with my kernel.zip, doesn't install kernel modules

In my kernel installer ZIP file, I have added some modules in system/lib/modules ... however they never end up getting installed.
My updater-script is:
Code:
ui_print("");
ui_print("Flashing Kernel");
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system");
package_extract_dir("system", "/system");
symlink("/lib/modules", "/system/lib/modules");
set_perm(0, 0, 0644, "/system/lib/libhardware_legacy.so");
set_perm(0, 0, 0644, "/system/lib/hw/lights.msm8660.so");
set_perm(0, 2000, 0550, "/system/etc/init.qcom.post_boot.sh");
set_perm_recursive(0, 0, 0755, 0644, "/system/lib/modules");
unmount("/system");
show_progress(0.500000, 0);
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "/dev/block/mmcblk0p8"),
delete("/tmp/boot.img"));
show_progress(0.100000, 0);
ui_print("Done");
I've included my kernel zip file also so you can extract it and find the directory structure. Is it because the initramfs in boot.img overwrites this directory or something?
http://users.ece.cmu.edu/~gnychis/hedpe_kernel.zip
it appears that anything put in the root of /system or in /system/lib is not honored. If I put something in /system/etc it will get installed via the updater script

Update script permission?

I am finishing off an update script and ran into a problem trying to set the permissions on an init.d script that I am loading to the system. Here are a few things I have tried to set on "crystal_clear" without success.
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm(0, 0, 0777, "/system/etc/init.d/crystal_clear");
Am I even close with this? This is my first update script. I bet i'm just missing something stupid but it's been killing me for hours and tried so many variations.
Here is everything so far. If there is something else you see here that doesn't look right please let me know.
show_progress(0.1, 0);
ui_print("Mounting System Partition");
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
package_extract_file("tweaks/buildprop.sh", "/tmp/buildprop.sh");
package_extract_file("tweaks/sysmount/sysrw", "/tmp/sysrw");
package_extract_file("tweaks/sysmount/sysro", "/tmp/sysro");
set_perm(0, 0, 0777, "/tmp/buildprop.sh");
set_perm(0, 0, 0777, "/tmp/sysrw");
set_perm(0, 0, 0777, "/tmp/sysro");
ui_print("");
ui_print("Patching Build.prop");
run_program("/sbin/sh", "/tmp/sysrw");
run_program("/sbin/sh", "/tmp/buildprop.sh");
ui_print("");
ui_print("Patching adreno_config.txt, and egl.cfg");
package_extract_dir("system", "/system");
run_program("/sbin/sh", "/tmp/sysro");
show_progress(0.1, 10);
ui_print("");
ui_print("All tweaking processes are done");
ui_print("Adjusting framebuffer and color depth");
package_extract_file("system", "/system/etc/init.d");
set_perm(0, 0, 0777, 0777, "/etc/init.d/crystal_clear");
show_progress(0.2, 0);
unmount("/system");
ui_print("DONE");
General comments.
A simple
Code:
set_perm_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
after I've extracted the all the files I've wanted to the right place has always worked fine in the CWM ZIP I keep for personal use to install BusyBox etc.
razz1 said:
package_extract_file("tweaks/sysmount/sysrw", "/tmp/sysrw");
package_extract_file("tweaks/sysmount/sysro", "/tmp/sysro");
set_perm(0, 0, 0777, "/tmp/sysrw");
set_perm(0, 0, 0777, "/tmp/sysro");
run_program("/sbin/sh", "/tmp/sysrw");
run_program("/sbin/sh", "/tmp/sysro");
Click to expand...
Click to collapse
You don't need these. CWM/TWRP will mount /system rw by default and you don't really need to remount it ro in CWM.
package_extract_dir("system", "/system");
package_extract_file("system", "/system/etc/init.d");
Click to expand...
Click to collapse
Is "system" a directory or a file?
That said, I think you want the former - just have a system folder in the root of your ZIP mirroring where you want the files to be placed (so in your ZIP, create a "system" folder at the same level as META-INF and then have a "etc" folder inside that, then a "init.d" folder inside "etc" with your script inside "init.d").
THANK YOU!
I'm going to try a few things you said and go from there.
Here is my current hierarchy...
4xMultiSampling_Antialiasing.zip
......META-INF
..........com
.............google
................android
.....................update-binary
.....................updater-script
......system
.........etc
.............Init.d
................crystal_clear. <-----this is what would not change to 0777
......lib
........egl
..........egl.config
......tweaks
.........build.prop.sh
.........sysmount
..............sysro
..............sysrw
razz1 said:
.............Init.d
Click to expand...
Click to collapse
If that's not a typo, it needs to be init.d - ext* file systems, unlike Windows', are case-sensitive
Yes that was a typo, but I appreciate your attention to detail because that's is exactly what I need. As you know, its that sort of thing that can kill a script. Critique away!
It appears I was able to pull it off with your help. Thanks. All is well here now.
Glad to hear it.

[Q] Help with update-script (status 6)

Hi guys, I have this error on my own update.zip, so I need help
- Edited with notepad++
- I checked, end of line, it's correct
- I checked, unix system, not windows.
So, I think is a bad mount command, my file system it's rfs (i think, just flashed with odin) , not ext4.
Paste my script:
show_progress(0.500000, 0);
ui_print("========================");
ui_print("== Value.and.Fast 2.5 ==");
ui_print("========================");
run_program("/sbin/busybox", "mount", "/system");
assert(is_mounted("/system"));
package_extract_dir("system", "/system");
ui_print("Asignando permisos...");
set_perm(0, 0, 0644, "/system/build.prop");
set_perm(0, 0, 0644, "/system/app/AxT9IME.apk");
set_perm(0, 0, 0644, "/system/app/ClockWidgets.apk");
set_perm(0, 0, 0644, "/system/app/Home_MultiResolution.apk");
set_perm(0, 0, 0644, "/system/app/WidgetPicker.apk");
ui_print("Eliminando aplicaciones...");
delete("/system/app/BuddiesNow.apk");
delete("/system/app/BuddiesNow.odex");
delete("/system/app/Dlna.apk");
delete("/system/app/Dlna.odex");
delete("/system/app/Signin.apk");
delete("/system/app/Signin.odex");
delete("/system/app/Days.apk");
delete("/system/app/Days.odex");
delete("/system/app/DualClock.apk");
delete("/system/app/DualClock.odex");
delete("/system/app/Gallery3D.apk");
delete("/system/app/Gallery3D.odex");
delete("/system/app/Email.apk");
delete("/system/app/Layar-samsung.apk");
delete("/system/app/Maps.apk");
delete("/system/app/MiniDiary.apk");
delete("/system/app/MiniDiary.odex");
delete("/system/app/MinimalHome.apk");
delete("/system/app/MinimalHome.odex");
delete("/system/app/MobileTrackerEngineTwo.apk");
delete("/system/app/MobileTrackerEngineTwo.odex");
delete("/system/app/MobileTrackerUI.apk");
delete("/system/app/MobileTrackerUI.odex");
delete("/system/app/Protips.apk");
delete("/system/app/Protips.odex");
delete("/system/app/RoseEUKor.apk");
delete("/system/app/SamsungApps.apk");
delete("/system/app/SamsungAppsUNA3.apk");
delete("/system/app/SamsungWidget_FeedAndUpdate.apk");
delete("/system/app/SamsungWidget_FeedAndUpdate.odex");
delete("/system/app/SamsungWidget_StockClock.apk");
delete("/system/app/SamsungWidget_StockClock.odex");
delete("/system/app/ShareApp.apk");
delete("/system/app/ShareApp.odex");
delete("/system/app/Street.apk");
delete("/system/app/Swype.apk");
delete("/system/app/syncmldm.apk");
delete("/system/app/syncmldm.odex");
delete("/system/app/thinkdroid.apk");
delete("/system/app/UnifiedInbox.apk");
delete("/system/app/UnifiedInbox.odex");
delete("/system/app/WriteandGo.apk");
delete("/system/app/WriteandGo.odex");
delete("/system/app/MagicSmokeWallpapers.apk");
delete("/system/app/MagicSmokeWallpapers.odex");
run_program("/sbin/busybox", "umount", "/system");
ui_print(" === FIN === ");
show_progress(0.200000, 0);
show_progress(0.200000, 10);
show_progress(0.100000, 0);
Click to expand...
Click to collapse
Thank!!
check on CMW - advance - show log
it will show what wrong after you flash the zip
Nevermind, i fix the problem
deleting line:
ui_print("=================");
how can it fix your problem? I got a staus 6 too
You mean if I remov this lines
set_progress(0.95);
ui_print("**************************************** ******");
ui_print("* Creating system links *");
ui_print("**************************************** ******");
and this...
set_progress(0.99);
ui_print("**************************************** ******");
ui_print("* Install kernel *");
ui_print("**************************************** ******");
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "/dev/block/mmcblk0p8"),
delete("/tmp/boot.img"));
unmount("/data");
unmount("/system");
unmount("/custpack");
set_progress(1.00);
ui_print("**************************************** ******");
ui_print(" DONE !!! ");
ui_print("**************************************** ******");
will fix it

[Q] zip for recovery with installation of apps /data

Good morning,
First I apologize if this post goes here.
I'm trying to make a flash file to install some apps in memory data, but there is no way to run the script because I do not know how to mount / data.
How could mount /data?
I put the script that used so far to copy some melodies, the bootanimation and some app to /system
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p12", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system/media/audio");
set_perm_recursive(0, 0, 0755, 0644, "/system/media/bootanimation.zip");
unmount("/system");
Im not a pro in developing x)
From what i know u can make flashaple zips at android kitchen
Sent from my GT-N7100 using xda premium

Editing build.prop via flashable zip

Hey folks,
to avoid doing this manually with every nightly, I wanted to change some build.prop values via a flashable zip, which doesn't seem to work.
I used the script from here and modified it for my needs. It doesn't throw an error in recovery, but doesn't change any values, either.
Here are my files:
updater-script
Code:
ui_print("fixer");
ui_print("Mounting System partition...");
#mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
#Properly unmounting to avoid issues
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "mount", "/system");
ui_print("bloat removal..");
delete_recursive("/system/app/Apollo");
delete_recursive("/system/app/BasicDreams");
delete_recursive("/system/app/Browser");
delete_recursive("/system/app/Calculator");
delete_recursive("/system/app/CMHome");
delete_recursive("/system/app/CMWallpapers");
delete_recursive("/system/app/Development");
delete_recursive("/system/app/Email");
delete_recursive("/system/app/Galaxy4");
delete_recursive("/system/app/GoogleTTS");
delete_recursive("/system/app/HoloSpiralWallpaper");
delete_recursive("/system/app/Launcher3");
delete_recursive("/system/app/LiveWallpapers");
delete_recursive("/system/app/NoiseField");
delete_recursive("/system/app/OmaDmclient");
delete_recursive("/system/app/OpenWnn");
delete_recursive("/system/app/PrebuildExchange3Google");
delete_recursive("/system/app/PhaseBeam");
delete_recursive("/system/app/PhotoTable");
delete_recursive("/system/app/PicoTts");
delete_recursive("/system/app/PrintSpooler");
delete_recursive("/system/app/SprintHiddenMenu");
delete_recursive("/system/app/Stk");
delete_recursive("/system/app/Trebuchet");
delete_recursive("/system/app/UpdateSetting");
delete_recursive("/system/app/VisualizationWallpapers");
delete_recursive("/system/priv-app/CellBroadcastReceiver");
delete_recursive("/system/priv-app/CMUpdater");
delete_recursive("/system/priv-app/GoogleFeedback");
delete_recursive("/system/priv-app/VoiceDialer");
delete("/system/media/audio/ui/camera_click.ogg");
delete("/system/media/audio/ui/camera_focus.ogg");
ui_print("tweaking build.prop...");
package_extract_dir("tmp", "/tmp");
set_perm(0, 0, 0777, "/tmp/mytweaks.sh");
run_program("/tmp/mytweaks.sh", "mytweak");
unmount("/system");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Completed.");
mytweaks.sh
Code:
#!/sbin/sh
bp="/system/build.prop"
busybox mount /system
busybox mount /data
if [ -f /system/build.prop.bak ];
then
rm -rf $bp
cp $bp.bak $bp
else
cp $bp $bp.bak
fi
echo " " >> $bp
echo "# build.prop editor" >> $bp
echo " " >> $bp
for mod in misc;
do
for prop in `cat /tmp/$mod`;do
export newprop=$(echo ${prop} | cut -d '=' -f1)
sed -i "/${newprop}/d" /system/build.prop
echo $prop >> /system/build.prop
done
done
misc
Code:
ro.sf.lcd_density=420
drm.service.enabled=false
wifi.supplicant_scan_interval=60
dalvik.vm.isa.arm.features=lpae,div
dalvik.vm.dexopt-flags=m=y,v=a,o=v,u=y
Furthermore, my device runs on TWRP 2.8.1.0 and CM12. I suspect the path to the shell is wrong, but couldn't find anything on that. Any suggestions?
Anyone?
I haven't time to troubleshoot your zip and script but attached is the one I wrote. In the uodater-script, its the part after wireless charging you want. I've removed my files that I also flash via this zip, but left the shell script.
In the shell, the sed lines are original_value/new_value and the echo lines add new lines at the bottom.
Hope this helps.
Not sure but if you unmount the system can you modify after that?
Sent from my Nexus 5 using XDA Free mobile app
shri_chanakya said:
Not sure but if you unmount the system can you modify after that?
Sent from my Nexus 5 using XDA Free mobile app
Click to expand...
Click to collapse
You'll need /system mounted to make changes in the /system/build.prop (good point)
rootSU said:
I haven't time to troubleshoot your zip and script but attached is the one I wrote. In the uodater-script, its the part after wireless charging you want. I've removed my files that I also flash via this zip, but left the shell script.
In the shell, the sed lines are original_value/new_value and the echo lines add new lines at the bottom.
Hope this helps.
Click to expand...
Click to collapse
THank you, that worked marvellously!
anon768 said:
THank you, that worked marvellously!
Click to expand...
Click to collapse
No probs;
I know this is an old thread, but I have a question for Dan or whomever else could answer it.
I was trying to integrate this script into another updater-script that I use for other stuff. so (since it uses the new updater-binary) I put these lines in it
set_metadata_recursive("/system/build_prop.sh", "uid", 0, "gid", 0, "dmode", 0777, "fmode", 0777, "capabilities", 0x0, "selabel", "ubject_r:system_file:s0");
run_program("sbin/sh", "/system/build_prop.sh");
delete("/system/build_prop.sh");
It works sort of fine. All the sed lines replace some text with some other text as expected. However, the echo lines, rather than appending the build.prop file, instead make a totally new build.prop file, with an identical name, sitting right next to it. I didn't even know that could happen.
Any thoughts on how to fix it?
oh ps an example of a line that works and one that doesn't are as follows
sed -i 's/telephony.lteOnCdmaDevice=0/telephony.lteOnCdmaDevice=1/g' /system/build.prop;
echo -e "telephony.lteOnGsmDevice=1" >> /system/build.prop
nevermind. turns out the echo lines were just missing semicolons. at first I thought it was a permissions issue on build.prop, so i set it to universal read/write then set it back to what it was supposed to be after script finishes
set_metadata("/system/build_prop.sh", "uid", 0, "gid", 0, "mode", 0777, "selabel", "ubject_r:system_file:s0", "capabilities", 0x0)
set_metadata("/system/build.prop", "uid", 0, "gid", 0, "mode", 0777, "selabel", "ubject_r:system_file:s0", "capabilities", 0x0)
run_program("sbin/sh", "/system/build_prop.sh");
delete("/system/build_prop.sh");
set_metadata("/system/build.prop", "uid", 0, "gid", 0, "mode", 0644, "selabel", "ubject_r:system_file:s0", "capabilities", 0x0)

Categories

Resources