Error 0 when trying to install update.zip - Android Q&A, Help & Troubleshooting

Whenever I try flash a new nightly, my custom sounds go away. So, I created an update file with the ringtones, and some notification sounds. But every time I try to install the file, I get a error 0 in CWM. Here is my script file, what am I doing wrong. I use Notepad++ for editing the file. Any help is appreciated. Thanks.
ui_print("............................");
ui_print("............................");
ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Copying files...");
package_extract_dir("system", "/system");
ui_print("Unmounting system...");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Installation done!.........");

prabs99 said:
Whenever I try flash a new nightly, my custom sounds go away. So, I created an update file with the ringtones, and some notification sounds. But every time I try to install the file, I get a error 0 in CWM. Here is my script file, what am I doing wrong. I use Notepad++ for editing the file. Any help is appreciated. Thanks.
ui_print("............................");
ui_print("............................");
ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Copying files...");
package_extract_dir("system", "/system");
ui_print("Unmounting system...");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Installation done!.........");
Click to expand...
Click to collapse
Usually a status 0 error refers an incompatible update-binary in the zip file. I would recommend replacing it with a compatible one (Can be pulled from a ROM or other flashable zip that you know will flash successfully), then re-signing the zip file, will usually fix this error.
Sent from my SCH-I535 using xda premium

I pulled the update-binary from the cm 10.1.2 nightly. I know it works, because I can flash it, but the update file I created does not work.
shimp208 said:
Usually a status 0 error refers an incompatible update-binary in the zip file. I would recommend replacing it with a compatible one (Can be pulled from a ROM or other flashable zip that you know will flash successfully), then re-signing the zip file, will usually fix this error.
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse

prabs99 said:
I pulled the update-binary from the cm 10.1.2 nightly. I know it works, because I can flash it, but the update file I created does not work.
Click to expand...
Click to collapse
Interesting, do you have the correct folder structure for the flashable such as META-INF->com->android and google folder->google folder->android->update-binary and updater script? Also do you have the correct folder structure for the ringtones and sounds? If you have named the .zip file update.zip try renaming it to something else (For example ringtonessounds.zip). Finally not that this should make a difference by try replacing:
Code:
run_program("/sbin/busybox", "umount", "/system");
With:
Code:
unmount("/system");

Is busybox installed in your device since you use busybox commands in your updater-script?
Also try to sign your zip file,, download signapk and run this command:
Code:
java -Xmx512M -jar signapk.jar -w testkey.x509.pem testkey.pk8 <Your zip file> <Your result zip file>
ensure you have installed java environment,,
..

shimp208 said:
Interesting, do you have the correct folder structure for the flashable such as META-INF->com->android and google folder->google folder->android->update-binary and updater script? Also do you have the correct folder structure for the ringtones and sounds? If you have named the .zip file update.zip try renaming it to something else (For example ringtonessounds.zip). Finally not that this should make a difference by try replacing:
Code:
run_program("/sbin/busybox", "umount", "/system");
With:
Code:
unmount("/system");
Click to expand...
Click to collapse
It was my directory structure that was bad. Thanks for your help.
Sent from my Galaxy Nexus using xda app-developers app

majdinj said:
Is busybox installed in your device since you use busybox commands in your updater-script?
Also try to sign your zip file,, download signapk and run this command:
Code:
java -Xmx512M -jar signapk.jar -w testkey.x509.pem testkey.pk8 <Your zip file> <Your result zip file>
ensure you have installed java environment,,
..
Click to expand...
Click to collapse
Have busybox installed. I am signing the zip with the test key. I don't have a private key.
Sent from my Galaxy Nexus using xda app-developers app

Related

Creating flashable zip for installing app in /data folder

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

Flashable zip help

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?

How to change permission of System File without Android initialize?

Hello,
My device is Chinese and has no brand. (with Android 4.0)
I changed some things in framework-res.apk, but not set the permission to 755 before saving in /system/framework/
so now the phone keeps resetting! :crying:
How do I change the permission of this file without the device to start??
Tanks.
If it gets to the bootanimation, you can use ADB
These are the commands you'll need
adb remount
adb shell
su
cd /system/framework
chmod 755 framework-res.apk
Should work that way, didn't test it.
Lesicnik1 said:
If it gets to the bootanimation, you can use ADB
These are the commands you'll need
adb remount
adb shell
su
cd /system/framework
chmod 755 framework-res.apk
Should work that way, didn't test it.
Click to expand...
Click to collapse
But how do initialize phone in Debug Mode without initialize the Android system?
daniel.uramg said:
But how do initialize phone in Debug Mode without initialize the Android system?
Click to expand...
Click to collapse
If your device has a recovery, ADB should work through that.
Lesicnik1 said:
If your device has a recovery, ADB should work through that.
Click to expand...
Click to collapse
On press "Vol- + Power" system initialize on "Android System Recovery <3e>", but the computer recognized "USB Mass Storage Device"
Have to create a Shell Script with the command chmod 755 /system/framework/framework-res.apk, and save to update.zip, and run on Recovery System?
Does it work?
I make this file update.zip
with the original system/framework/frameword-res.apk of the my backup
META-INF/com/google/android/updater-script with the commands:
Code:
ui_print("Unlock the Phone");
ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
show_progress(1, 15);
package_extract_dir("system/framework", "/system/framework");
set_perm(0, 0, 0755, "/system/framework/framework-res.apk");
ui_print("Unmounting system...");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Unlocking complete!");
I followed this tutorial to sign the file: http://forum.xda-developers.com/showthread.php?t=1610121
But when I try to recover the device shows the error: "Invalid OTA package"
Need META-INF/com/google/android/update-binary ?
Because several update.zip file I downloaded from the Internet have different sizes.
I do not know what to do!
daniel.uramg said:
I make this file update.zip
with the original system/framework/frameword-res.apk of the my backup
META-INF/com/google/android/updater-script with the commands:
Code:
ui_print("Unlock the Phone");
ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
show_progress(1, 15);
package_extract_dir("system/framework", "/system/framework");
set_perm(0, 0, 0755, "/system/framework/framework-res.apk");
ui_print("Unmounting system...");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Unlocking complete!");
I followed this tutorial to sign the file: http://forum.xda-developers.com/showthread.php?t=1610121
But when I try to recover the device shows the error: "Invalid OTA package"
Need META-INF/com/google/android/update-binary ?
Because several update.zip file I downloaded from the Internet have different sizes.
I do not know what to do!
Click to expand...
Click to collapse
when i want to change setting background
menu image i have chang framework.apk and i replae that file in
system/framework and now my phone is just boot looping.i have also
take backup i have also restore it but no luck
i am thinking that if i change the file permission than i will be
successfully booted so i have attached one image too you can see that
i can't change file permission please help me bro
Bhg73 said:
when i want to change setting background
menu image i have chang framework.apk and i replae that file in
system/framework and now my phone is just boot looping.i have also
take backup i have also restore it but no luck
i am thinking that if i change the file permission than i will be
successfully booted so i have attached one image too you can see that
i can't change file permission please help me bro
Click to expand...
Click to collapse
Hello, I used Auto-Sign to sign the package.
Or change recovery.bin to an alternative that allows you to do the update.zip without signing
similar question to OP, if we are using ADB in recovery, then the system protection should be down (Hopefully). Shouldn't we then be able to modify the /system/xbin folder permissions to rwx using chmod command? I am asking because I have an old ZTE Z750c which is known for system protection issues. I have tried temp-root via Cydia Impactor then re-run.bat command to disable system protection and it still won't perm-root. I've noticed that some needed root apps (SuperSU, Busybox) need rwx access to /system/xbin. So my hypothetical thinking is that if we mod the folder permissions in recovery, that should trick the system protection.
Lesicnik1 said:
If it gets to the bootanimation, you can use ADB
These are the commands you'll need
adb remount
adb shell
su
cd /system/framework
chmod 755 framework-res.apk
Should work that way, didn't test it.
Click to expand...
Click to collapse
thank you so much !!!!

add user apps to gapps

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");

[Q] Find /dev/block/ for /data

Maybe this is not correct forum, but I used dsixda's kitchen. Everything went fine, but in updater-script file I have got an error:
Code:
mount("ext4", "EMMC", "???", "/data");
Kitchen warned me to fix this, but I need to replace the ??? signs with correct
Code:
/dev/block/<something>
like this:
Code:
mount("ext4", "EMMC", "/dev/block/stl12", "/system"); "0 /system/
My question is, how I can fix <something> to be correct? Every help is appreciated!
Solved! I do not even have any files in /data to flash.
Mods: please delete this thread.
Sent from my Prestigio tablet using XDA Developers 4 Premium app

Categories

Resources