i would like to add apk files into the gapps zip that will install into /data/app on a persons phone, but every time i do it, i get status 6 error. i have a modified gapp file that i am working with and it puts apps into /system/app and i tried to mimic the updater-script to put files into /data/app but it isnt working for me
here is what i have. in the gapps zip file i have put all the apk files into extra/data/app
Code:
run_program("/sbin/busybox", "mount", "/data");
show_progress(1, 15);
package_extract_dir("extra/data", "/data");
run_program("/sbin/busybox", "umount", "/data");
Related
I'm planning on using the UpdatezipCreator from this thread http://forum.xda-developers.com/show....php?t=1274736 to build an update script for some APK updates I want to package up. It appears this app has the ability to build a update-binary file for you.
I have APK files in both the system/app and data/app that I want to be copied to my phone. I'm confused on a few things.
First thing, can I have multiple destinations for the files in the script? I haven't found any examples with two destinations and there doesn't seem to be a spot to configure the source which makes me think it just takes everything in the zip and puts it in the folder you specifiy in the package_extract_dir function and that adding a second "package_extract_dir" function would confuse it.
The second question is I keep running across scripts that us busybox instead of the built in commands. Why would you need to/want to do that?
This is what I would think would work for my script:
Code:
ui_print("Preparing to update");
ui_print("Copying files..");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
ui_print("Done! You can reboot your system now!");
I know I need a mount command before the package_extraction but I don't know which I should use and if I need a second mount for the /data/app folder as well.
"run_program("/sbin/busybox", "mount", "/system");"
or
"mount("/dev/block/stl6", "system", "/system", "rw");"
The folder structure of my zip is;
Zip
/system/app/apk files
/data/app/apk files
/META-INF
Do this in your updater-script:
Code:
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Preparing to update");
ui_print("Copying files..");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Done! You can reboot your system now!");
How to create flashable zip which will install required applications in /data folder like regular installation as this would reduce time while trying new ROM.
I have tried by making changes in existing zip by putting /data folder instead of system but found not working
Sent from my GT-S5830 using Tapatalk 2
shriramc4 said:
How to create flashable zip which will install required applications in /data folder like regular installation as this would reduce time while trying new ROM.
I have tried by making changes in existing zip by putting /data folder instead of system but found not working
Sent from my GT-S5830 using Tapatalk 2
Click to expand...
Click to collapse
Nice idea. But why not use titanium backup or cwm backup??
Sent from my GT-S5830 using XDA
I haven't tried this, but in theory it should work. This will copy a single app to data/app, but you can make it so all the /data folder is copied (which is done easier through CMW backup):
1 Create a folder named "app" on ur pc and put the appyou want inside
2 Go to UOT kitchen to get a CWM flashable zip (recomended you don't use any mods for this, but you can apply a mod if you want to, won't make a difference)
3 use 7zip or winrar to open it
4 locate META-INF\com\google\android\updater-script and extract it. Open it with Notepad++ (recomended, but you can use Notepad just as well)
it shoul read something similar to this:
Code:
ui_print("Applying UOT framework");
run_program("/sbin/busybox", "mount", "/system");
delete("/system/framework/framework-res.apk");
package_extract_dir("framework", "/system/framework");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "mount", "/system");
delete("/system/app/SystemUI.apk");
package_extract_dir("app", "/system/app");
run_program("/sbin/busybox", "umount", "/system");
as you can see, the steps for adding apps (in this case framework-res.apk or SystemUI.apk) are mount the system, delete original app (if it already exists on your phone), copy the app from zip file and unmount system:
Code:
run_program("/sbin/busybox", "mount", "/system");
delete("[B]location of the app in your phone goes here[/B]");
package_extract_dir("[B]folder to extract from zip[/B]", "[B]location in your phone where you want to place it[/B]");
run_program("/sbin/busybox", "umount", "/system");
so, if you are replacing an app that already exists in your phone, the steps should be to mount data, delete original app, copy the app from zip file, unmount data:
Code:
run_program("/sbin/busybox", "mount", "/data");
delete("/data/app/[B]name of app here[/B]");
package_extract_dir("app", "/data/app");
run_program("/sbin/busybox", "umount", "/data");
if the app doesn't exist in your data/app directory, justy remove the "delete" line:
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("app", "/data/app");
run_program("/sbin/busybox", "umount", "/data");
So just replace the code inside updater-script with the one that suits you. If you don't understand what the code does, or how to edit it then don't mess with it and find an alternate method.
5 once your done editing the updater-script, save it (not as text or anything, just save it as it is).
6 place it inside the META-INF\com\google\android\ of the flashable zip you got from UOT Kitchen, replacing the original updater-script thats in there. Remember, DON'T extract and repackage the flashable zip, just open it with winrar or 7zip and replace (drag and drop) the updater-script directly inside winrar or 7zip.
7 delete all folders of the flashable zip except for META-INF and settings
8 add the "app" folder you created in your pc to the flashable zip. The same way you added the updater-script, drag from your pc and drop in the zip file thats open with winrar or 7zip
You should have now 3 folders in your flashable zip file:
app (the one you put the app inside)
META-INF (which contains your modded updater-script)
settings (Uot settings)
That's it, a zip ready to be flashed through CWM.
If you want to flash the complete /data folder, just copy it from your phone to your pc and make the adjustments to the updater script and flashable zip
What is the update-binary file in the same folder as updater-script? Do I need to do something with it? I can't edit it because it's a bunch of ASCII.
yeah this be handy, I may use it for titanium backup. Because normally I have to go through the hassle of logging into google services etc. to get titanium backup on every rom change.
thnX, It helps me too..
Still not sure what to do with update-binary
Cares said:
Still not sure what to do with update-binary
Click to expand...
Click to collapse
Don't do anything, leave it there.
Sent from the other side... of the screen
Try this
I decided to give this a try.
Its a very simple flash and I guess an easy beginner task.
All I'm doing is adding S_opener.ogg to the notifications directory.
It's not in FJs AOSP rom and I just want to flash it after flashing his updates.
I found a tool that makes creating the zip pretty easy AFAIK
http://forum.xda-developers.com/showthread.php?t=1248486
I want to mount the system, copy the file, unmount.
The default script is below.
I have three questions before I create and flash this....don't wanna brick it
1)What's our mount point?
2)On the extract directory, can I use the parent like it is or do I have to specify by drilling down? (/system/media/audio/notifications)
3)Does it unmount? Is that part of the extract command?
THANKS!
Here's the script:
ui_print("Preparing to update");
# mounting system as r/w - ATTENTION - set the the mount point
# to the proper for your device! Example mountr command is
# mounting system for Samsung GT-I5800 aka Galaxy 3
mount("/dev/block/stl6", "system", "/system", "rw");
ui_print("Copying....");
# copy system content to the system directory on your device
package_extract_dir("system", "/system");
ui_print("Done! You can reboot your system now!");
Cool project. Good luck.
Yea. I thought it would be a cool way to get a better idea of what it takes for these developers.
Any developers able to lend me a hand here?
I think my questions are clear....
I'd appreciate it.
Thanks!
Why not team up with Jessooca. She wants to learn too. Plus I think she will get more attention than you.
1) I find it easiest to use the "busybox" mount
-- this will always be compatible with just about any custom ROM. (no need to know the mount partition)
2) Yes, just use the parent directory
3) No, it doesn't unmount automatically (not that it really needs to anyway)
If copying system apps, you can also save some time by wiping dalvik-cache and rebooting right here in the script.
Here is a generic script good for just about anything you might want to throw into system/
Code:
ui_print("Updating System...");
show_progress(0.1, 0);
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "umount", "/system");
ui_print(" ");
ui_print("Wiping Cache & Rebooting...");
run_program("/sbin/busybox", "mount", "/data");
delete_recursive("/data/dalvik-cache");
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/reboot");
Hope this is helpful for you
Thanks! I found busy box in xbin. I also looked at fjs rom script and that's what he uses. I'll give it a shot
Sent from my SAMSUNG-SGH-I717 using xda premium
Bummer. I feel like I'm so close...
I have flashed three times and luckily no side effects but the file isn't there....
sbin doesn't have busybox in it but system/xbin does
So I did this:
Code:
ui_print("Preparing to update");
ui_print("Updating System...");
show_progress(0.1, 0);
ui_print("Coying Opener Notification");
run_program("/system/xbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
run_program("/system/xbin/busybox", "umount", "/system");
ui_print(" ");
ui_print("Done! You can reboot your system now!");
And that doesn't work either...
The cool thing is that I'm learning quite a bit with all these failures
That's why I chose a 'simple' task
Tried this to but it didn't work.
It flashed and said it went but the file isn't there....
Guess I'll try again tomorrow.
Code:
ui_print("Preparing to update");
ui_print("Updating System...");
show_progress(0.1, 0);
mount("/dev/block/mmcblk0p24", "system", "/system");
ui_print("Copying files Opener Notification");
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Done! You can reboot your system now!");
You see /system/xbin/busybox while booted normally; however
when booted in recovery it sees /sbin -- trust me on this.
If you still want to use standard partition mounting try this:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system");
Thanks for your help on this. I'll try sbin today. I trust ya
I did try that string but it threw an error and said I had four variables and it only wanted three.
Sent from my SAMSUNG-SGH-I717 using xda premium
hmm yeah well I just plucked that one out of a ROM installer
the /sbin/busybox mount has worked well for me over lots of zip and lots of different ROMs
Yep, that did it! Thanks
My first successful zip
Now to figure out how to make that the default notification.
It looks like it's in the build.prop but I haven't searched enough on xda yet.
I found the default notification for the ROM in build.prop but can't find where the current default notification is.
Is that in a file similar to build.prop?
So as I see in a flashable zip there is:
META-INF\com\google\android\
where you have updater-script.
Mine contains this:
ui_print("text_to_write");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/system");
ui_print("");
package_extract_dir("cache", "/cache");
package_extract_dir("data", "/data");
package_extract_dir("system", "/system");
unmount("/cache");unmount("/data");
unmount("/system");
ok, basically this mounts the cache, data, system partition.
Now I want to do something like:
got a file in /system/media/sounds/ui/lock.ogg
I want it to rename it to /system/media/sounds/ui/lock.ogg.back
as I searched the forum, I need to run a bash script, something like:
for file in *.html; do
mv "$file" "`basename $file .html`.txt"
or simply
mv Lock Lock_old
now my question
what to write in update script to rename these files before copying the actual files.
What to write in the the update-script to run the bash.
as I understand I should paste a new line
run_program("/sbin/busybox", "mount", "/system");
ui_print(""); <-right here the script line
package_extract_dir("cache", "/cache");
the main goal is this:
copy for example Lock.ogg to system/media/ui/
but before copying rename the existing Lock.ogg to Lock.ogg.back or Lock_old.ogg.
Please help
I have a custom device with a custom ROM and I need to be able to delete some files given a certain scenario. I have a script that should delete wpa_supplicant.conf file. The script runs but the file isn't deleted. Here is my script:
show_progress(0.500000, 0);
mount("ext4", "EMMC", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/userdata", "/data");
delete("/data/misc/wifi/wpa_supplicant.conf");
show_progress(0.100000, 0);
unmount("/data");
-Steve