Problem signing Update.zip files - myTouch 3G, Magic Android Development

Hi all,
I've recently got my Vodafone Magic and am enjoying the awesome work of all those here that have helped to root the phone and create the brilliant custom ROMs. So big thanks to all those involved.
On to my problem. I actually tweaking the updates I apply to the phone slightly, such as adding ring tones or changing to the android keyboard. I've got scripts that do this, but I'd really like to alter the update.zip and apply it in a single go. I understand what needs to be done, but the signing of the altered update.zip file doesn't work.
I am using signapk as per instructions, which succesfully completes, but it removes the META-INF\com directory (and yes it is in the original zip). I saw someone had a similar problem a while ago, but the thread didn't have a solution.
I'm using Windows XP 32bit. I've downloaded and installed the JDK 6 Update 14, and installed it to \Java to ensure no spaces are in the directory path.
Can anyone help?
Thanks

RogueJay said:
Hi all,
I've recently got my Vodafone Magic and am enjoying the awesome work of all those here that have helped to root the phone and create the brilliant custom ROMs. So big thanks to all those involved.
On to my problem. I actually tweaking the updates I apply to the phone slightly, such as adding ring tones or changing to the android keyboard. I've got scripts that do this, but I'd really like to alter the update.zip and apply it in a single go. I understand what needs to be done, but the signing of the altered update.zip file doesn't work.
I am using signapk as per instructions, which succesfully completes, but it removes the META-INF\com directory (and yes it is in the original zip). I saw someone had a similar problem a while ago, but the thread didn't have a solution.
I'm using Windows XP 32bit. I've downloaded and installed the JDK 6 Update 14, and installed it to \Java to ensure no spaces are in the directory path.
Can anyone help?
Thanks
Click to expand...
Click to collapse
the signapk never removes files. (imho)
you have to put all the files in one zip file
META-INF
-com
--google
---android
----update-script
-cert.rsa
-cert.sf
-manifest.sf
system
boot.img
Click to expand...
Click to collapse
the cert.rsa, cert.sf, manifest.sf, will be updated (imho) by the signapk

kingchris said:
the signapk never removes files. (imho)
Click to expand...
Click to collapse
Well it is on my machine.
kingchris said:
you have to put all the files in one zip file
the cert.rsa, cert.sf, manifest.sf, will be updated (imho) by the signapk
Click to expand...
Click to collapse
All the files are in the original zip file and signapk does update the cert.rsa, cert.sf & manifest.sf. It just seems to remove the com directory and hence the update script.
I started with the ION update, extracted it, changed a couple of things under system, rezipped it and tried to sign it with the outcome I mentioned.
I've tried creating the zip with XPs built in zip handler and WinZip.

RogueJay said:
Well it is on my machine.
All the files are in the original zip file and signapk does update the cert.rsa, cert.sf & manifest.sf. It just seems to remove the com directory and hence the update script.
I started with the ION update, extracted it, changed a couple of things under system, rezipped it and tried to sign it with the outcome I mentioned.
I've tried creating the zip with XPs built in zip handler and WinZip.
Click to expand...
Click to collapse
you can do a test like this.
download the signed rom and try to sign it again. then take a look into the zip file in the meta directory

Yay - got it working.
It would seem that the problem was the zip files as created by WinZip. When I created the zip file using 7-zip, all went well. At least all the files are there - haven't tried putting it on the phone yet.

Related

rezipping update

I have opened jf1.5 adp1 and removed the camera app from it how do I zip it back up so my phone will perform the update. I have already updated my phone to the unedited version of jf1.5 adp1 when I try to use the edited version it aborts the updated
quilobo said:
I have opened jf1.5 adp1 and removed the camera app from it how do I zip it back up so my phone will perform the update. I have already updated my phone to the unedited version of jf1.5 adp1 when I try to use the edited version it aborts the updated
Click to expand...
Click to collapse
it has to be signed .. read JFs info for his "Build Environment" .. very easy to do in linux .. you can't just modify the zip and be done .. files must be signed
thanks for your response
No need for the entire build environment. Just get the AndroidMod.zip file (google for dl sources) and run the modified update.zip through signapk. There is a readme included detailing how to use it.
I have the sign app but I can't figure out how to use it. I searched but I could not find a good set of instructions.
Open your command line, change directory to the signapk directory (also for convenience your update.zip file should be in this directory too) then type:
java -jar signapk.jar testkey.x509.pem testkey.pk8 update.zip update_signed.zip
That's it. The update_signed.zip file will be the finished file. If it gives you an error 'java' is not a valid executable, that is because you don't have JRE or JDK installed.
ok I did all that put the update.zip that is signed on my sd card with nothing else on it. started teh up date the phone verifies the file. then it starts installing as soon as it starts to install I get this error on my phone. "E:Can't find update script installation aborted.
Somehow you deleted the update-script. Check the zip file to see if its still present:
\META-INF\com\google\android\update-script
it is still there
quilobo said:
it is still there
Click to expand...
Click to collapse
Confusing.
it is only a 3k file. I found a 14k file in another update.zip I had
still says it can't find it
What archive creation program are you using to create the zip?
winzip what should I be using
Hm. Idk, I was just curious. It shouldn't make a difference really. Particularly if the signing tool worked fine. Maybe someone else can shed some light on this.
Try and re download your sources and then modify and resign.
Also be sure to check your sources after download and transfer (SHA1, MD5 etc)
ok I redownloaded the file and repeated the process and still get the same error. all I am trying to do is remove the camera app from the jf1.5adp1 build and put it on my phone .

Signing the update.zip in Mac OS X?

I'm sure this has been asked before but after prolific searching of the forums and our friend Google I turn to you guys for help. As the title says I'm using OS X and I need a solution (that isn't dual booting to use XP) to signing the update.zip so that I can customise aspects of my ROM, I'm very eager to learn how to do this and this so far seems to be quite an annoying problem.
Thanks for your time in advance
tristyB said:
I'm sure this has been asked before but after prolific searching of the forums and our friend Google I turn to you guys for help. As the title says I'm using OS X and I need a solution (that isn't dual booting to use XP) to signing the update.zip so that I can customise aspects of my ROM, I'm very eager to learn how to do this and this so far seems to be quite an annoying problem.
Thanks for your time in advance
Click to expand...
Click to collapse
pm me............
korndub said:
pm me............
Click to expand...
Click to collapse
Hi korndub,
Cannot you post the answer here so everybody that uses OS X can also sign?
I'm also having problems signing full roms (update.zip files) with signapk.jar
Any help is appreciated
rommelin said:
Hi korndub,
Cannot you post the answer here so everybody that uses OS X can also sign?
I'm also having problems signing full roms (update.zip files) with signapk.jar
Any help is appreciated
Click to expand...
Click to collapse
i have a folder on the desktop which contains the signapk.jar and both sets of keys...put the Archive.zip that you have created and want to sign in this folder, then open terminal
in terminal, you type
$cd FOLDER-containing-files
$java -jar signapk.jar testkeys.x509.pem testkey.pk8 Inputfile.zip outputfile.zip
the outputfile.zip is your update which is signed....
OK, I do all that I think.
Heres my process.
Download ROM
Extract downloaded zip to folder eg update
Make changes to files
Compress folder back to zip eg update1.zip
java -jar signapk.jar testkeys.x509.pem testkey.pk8 update1.zip update_signed.zip
rename and copy the signed file to sd
reboot recovery
wipe and apply update
It doesn't moan about the signing (so I assume its ok) but I get an update script not found error and it doesn't install.
I haven't changed the update scripts, only the boot.img and one or two scripts in system.
Does every file I change have to be resigned as well? I muct be missing something here
on OSX 10.5
Signing has nothing to do with that error. Make sure that the update-script is in the correct path.
META-INF/com/google/android/update-script
it is, is a normal update.zip (ie cyanogen rom), and the only file I've changed is boot.img and a2sd in system/bin
i have a folder on the desktop which contains the signapk.jar and both sets of keys...put the Archive.zip that you have created and want to sign in this folder, then open terminal
in terminal, you type
$cd FOLDER-containing-files
$java -jar signapk.jar testkeys.x509.pem testkey.pk8 Inputfile.zip outputfile.zip
the outputfile.zip is your update which is signed....
Click to expand...
Click to collapse
Thank you so much, this works for me, I might try and build it into an automator workflow
Edit: I spoke too soon, I get the update script error also
Edit Again: my update-script is in the same place as it should be also
Wonder if this is a specific OSX problem? We do have apples 'interpretation' of java don't we?
dazcox5181 said:
Wonder if this is a specific OSX problem? We do have apples 'interpretation' of java don't we?
Click to expand...
Click to collapse
haha, yeah that's right, those crazy cats at Apple. but I assume that korndub also has Apples 'interptretation' so something else could be the problem also
perhaps the way we zip the archive?
dazcox5181 said:
perhaps the way we zip the archive?
Click to expand...
Click to collapse
sadly not, I just used a application that zips in a PC format (without mac hidden files) and no joy. Good idea though.
Edit: Just tried archiving the zip but not compressing. Thought I was on to something. I wasn't.
Another update, I have tried the same in Fedora 11 and again, getting the update script error message when I flash.
I signed modified update for 3 different builds on my Mac, everything worked w/o problems every time. I did everything like described in readme and several times here. So, it's not a global OS X problem.
BTW, I used muCommander to directly modify all zips.
neuro159 said:
I signed modified update for 3 different builds on my Mac, everything worked w/o problems every time. I did everything like described in readme and several times here. So, it's not a global OS X problem.
BTW, I used muCommander to directly modify all zips.
Click to expand...
Click to collapse
When I find the time later on I will give the muCommander a go. Fingers crossed.
dazcox5181 said:
OK, I do all that I think.
Heres my process.
Download ROM
Extract downloaded zip to folder eg update
Make changes to files
Compress folder back to zip eg update1.zip
java -jar signapk.jar testkeys.x509.pem testkey.pk8 update1.zip update_signed.zip
rename and copy the signed file to sd
reboot recovery
wipe and apply update
It doesn't moan about the signing (so I assume its ok) but I get an update script not found error and it doesn't install.
I haven't changed the update scripts, only the boot.img and one or two scripts in system.
Does every file I change have to be resigned as well? I muct be missing something here
on OSX 10.5
Click to expand...
Click to collapse
you dont archive (zip) the folder, this is where you are having the issue... say you extracted the rom to ROMFOLDER, what you need to do is go into that folder, select all, then right click or two finger click and choose Compress - you will end up with an archive that contains all sub folders, if you zip the folder then you have a folder within a folder and that is where all goes south..
korndub said:
you dont archive (zip) the folder, this is where you are having the issue... say you extracted the rom to ROMFOLDER, what you need to do is go into that folder, select all, then right click or two finger click and choose Compress - you will end up with an archive that contains all sub folders, if you zip the folder then you have a folder within a folder and that is where all goes south..
Click to expand...
Click to collapse
Oh my god, you're right. And I think I actually read that somewhere before now you've reminded me. Damn. Thanks though! Thanks a lot!
Awesome, knew it was me being stupid.
sure thing guys! glad i could help...
Always something stupid...

How to sign a file? (Need Help)

I am looking for a run down on signing a file.
So far, I have taken other people files and just edited images from the apk moved them back and signed using Kitchen (Only way I know how)
So I am at a stand still here...
I want to add
app\Rosie.apk
and
system\com.htc.resources.apk
to a file so that I can change things a little more.
But have not had luck.
Can someone give the rest of us some steps?
Thanks.
are you on windows? if so, then use this batch script. unzip it and get to signing
how would you sign a zip on a mac?
mrchu001 said:
how would you sign a zip on a mac?
Click to expand...
Click to collapse
firstly, install java. then look inside the batch script and you'll see the basic layout for signing files from terminal.
EDIT: what it inside the script is this basic layout for signing, "java -jar signapk.jar testkey.x509.pem testkey.pk8 update.zip update_signed.zip"
replace "update.zip" with your zip file and update_signed.zip with your zip file with "signed" or something so you know it's signed appended before the .zip
darchstar said:
are you on windows? if so, then use this batch script. unzip it and get to signing
Click to expand...
Click to collapse
Yes, I am running windows. Thanks for the file! I will give it a try.
So I see the Sign.bat All I know so far, (Sorry, still new)
My folder will be laid out like this.
<update.zip>
<system>
<app>Rosie.apk</app>
<framework>com.htc.resources.apk</framework>
</system>
<update.zip>
But I dont know where to go from there?
I wonder if we counted, how many threads do you think were started here with this EXACT same question?
chaos67731 said:
Yes, I am running windows. Thanks for the file! I will give it a try.
So I see the Sign.bat All I know so far, (Sorry, still new)
My folder will be laid out like this.
<update.zip>
<system>
<app>Rosie.apk</app>
<framework>com.htc.resources.apk</framework>
</system>
<update.zip>
But I dont know where to go from there?
Click to expand...
Click to collapse
run the batch script from command prompt
darchstar said:
run the batch script from command prompt
Click to expand...
Click to collapse
I dont know how to do that or what it does.
I unziped the folder to my desktop but really dont know where to go from there.
I also dont know command prompt at all for the most part.
Only little things {cd} {*} things like that but even than its just at sight.
I looked http://forum.xda-developers.com/showthread.php?t=618874 and there does not seem to be a wiki or anything on this.
make a new folder where you'll want to zip all your files
copy the autosign.zip to this folder
unzip it.
zip up your files and update-script, name the zip update.zip and put them in this folder
run the batch script from command prompt
Code:
Sign.bat
you will now have a new zip called update_signed.zip, which is you signed update.zip
Does flipzmode's Kitchen do the same thing?
I know there is a sign part to it.
I have used it but not sure if it does the same thing.
When doing this is get an error.
It says it can not find the update script?
mrchu001 said:
how would you sign a zip on a mac?
Click to expand...
Click to collapse
Unzip this. Place the testsign.jar in the root directory of your Mac. Not the home (user) directory, but should be "Macintosh HD" or something of the sort. Then place the Android-Sign.app in /Applications. Even easier to make a shortcut to it in the dock. Whenever you want to sign a file, drag it to the Android-sign app, and it will sign it and put it in the same directory as the original, with "signed" at the end so you'll know which one is which.
For Mac there is an auto-sign program. Just put testsign.jar on the root of your computer hard drive (Macintosh HD) and it works. To sign a ROM, open the rom folder, select all the contents, right-click, and click Conpress. Rename archive.zip to whateveer you want. Drag it onto the Android Sign program and then wait for the program to close (when the dot goes away). There should be another file in the ROM folder called Archive-signed.zip. That is your signed zip.
...That's what I just posted.
ajones7279 said:
...That's what I just posted.
Click to expand...
Click to collapse
We posted it at like the same time I think he figured out how to do the actual signing, but he zipped the folder and not the contents. So... It was rom.zip>rom>contents of rom.
ajones7279 said:
Unzip this. Place the testsign.jar in the root directory of your Mac. Not the home (user) directory, but should be "Macintosh HD" or something of the sort. Then place the Android-Sign.app in /Applications. Even easier to make a shortcut to it in the dock. Whenever you want to sign a file, drag it to the Android-sign app, and it will sign it and put it in the same directory as the original, with "signed" at the end so you'll know which one is which.
Click to expand...
Click to collapse
this is great man!
many thanks!
No problem.
ok so im on windows. it says java not rec.. so im assuming i need to dl java. but would someone be able to leave a little more detailed how to on this. i figured most of it out. but idk if im spose to have the unziped auto-sign folder in my rom zip or outsided of my rom zip..
feefeeboomboom said:
ok so im on windows. it says java not rec.. so im assuming i need to dl java. but would someone be able to leave a little more detailed how to on this. i figured most of it out. but idk if im spose to have the unziped auto-sign folder in my rom zip or outsided of my rom zip..
Click to expand...
Click to collapse
You're using Stericson's autosign.bat correct?
I might be wrong but if you use Kitchen you can auto sign things and it works really good.

Google Experience only

I am happy with what I have since the new update from Viewsonic.
If I only want to add Google Experience, marketplace, do I still need to go through the process of rooting, installing clockwork and a new UI?
Is there just a simple way to add GE to the Classic UI?
Gapps install
http://forum.xda-developers.com/showthread.php?t=842590
Everyone,
I have had zip luck with this method of installing zapps. Not a dev, but I've been doing this long enough.....
I moved the Recovery file to to /sdcard. Checked for command and command line inside that file All ok to my eye.
Downloaded the gapps file which my WinRAR pronounces a WinRAR/Zip file. So I tried renamein the original update.zip and didn't get any install. So I extracted using winRAR. Still no install.
I tried the permutations as well. Extracted using G-Tablet extract. Still no results.
There must be something I am missing here -- too much holiday cheer or too many crowds or whatever.
Suggestions?!
Rev
butchconner said:
Everyone,
I have had zip luck with this method of installing zapps. Not a dev, but I've been doing this long enough.....
I moved the Recovery file to to /sdcard. Checked for command and command line inside that file All ok to my eye.
Downloaded the gapps file which my WinRAR pronounces a WinRAR/Zip file. So I tried renamein the original update.zip and didn't get any install. So I extracted using winRAR. Still no install.
I tried the permutations as well. Extracted using G-Tablet extract. Still no results.
There must be something I am missing here -- too much holiday cheer or too many crowds or whatever.
Suggestions?!
Rev
Click to expand...
Click to collapse
I HAD to resort to putting on Clockwork Mod 0.8 to get GApps on my G Tablet.
Putting the update.zip on the internal and sd card storage did not work for me either with the newest update installed.
Clockwork Mod is a super easy install - just follow the instructions on how to install G Apps...basically: put CWM on your SD card in it's root (meaning NOT in any directories) and rename it update.zip, put the corresponding recovery directory on the SD as well. I use Winrar as well, I drag the recovery directory right from the file itself and to the SD Card.
Will look like:
Drive: update.zip
Drive: /recovery/command
basically.
Flash it the normal stock way (power and volume +). I press Power and Volume + without even powering off the device, because if the device is powered down and then you start it and miss that first start up, the device WILL delete the recovery/command file and the update won't flash.
GL
I don't officially get to play with my GTab until after package opening tomorrow so I can't do anything today, but I'm trying to line up my to do list. I have never rooted, flashed, or modded anything but am not afraid to play around as long as I don't brick the tablet.
What do you mean when you say "put the corresponding recovery directory on the SD as well. I use Winrar as well"? What is the corresponding recovery directory? What do you use Winrar for? I Googled "winrar" and found " WinRAR is a shareware file archiver and data compression utility developed by Eugene Roshal, and first released in the fall of 1993.[1] It is one of the few applications that is able to create RAR archives natively, because the encoding method is held to be proprietary. " I cannot figure out why it would be needed to load the standard Android market.
MSU_Sparty,
When you do updates (or installs) that have to be flashed onto the internal sdcard, they usually com in pairs of files. You will have an update.zip file that has the update in it (DUH!) -- and accompanying it will be a "Recovery" directory that has a command file in it (The command file has only one line that "calls" the update.zip file.
WinRAR "Zip" utility enters the picture because most of the devs here use WinRAR to package updates. The when they tell you to decompress it, you use WiinRAR and are left with a .zip file to install.
That's the question I had about this update. The Gapp file show to be a RAR package, but when I un-RAR it I come up with no .zip file -- only regular files.
Hope this helps you understand.
Rev
P. S. -- If you are new to this business, take it slow and easy and read ahead on this site and make sure you understand what you are doing. I try to do that, but even with years of IT experience I still mess things up once in a while.
Neoprimal,
Thanks for the tip about CWM. I have two tablets and the other has CWM on it and is fairly modded.
But this tablet I am trying to keep basically stock so I can get updates, etc. and see what the "state of product" is.
As mentioned in my previous answer, I am stumped because I am not getting what looks to be an update.zip file from the Gapp download. When I use WinRAR to decompress the Gapp file, I don't get a .zip file -- only a couple of directories. On the other hand, when I rename the Gapp file update.zip and try to flash it it doesn't work.
Again, thanks for the reply.
Anyone else with suggestions!!!????
Rev
Thanks. What you've written really does clarify the previous post. I appreciate it.
But let me ask another naive question. Why don't the developers create their update programs so they can be installed by just downloading them OTA like most applications? That would sure make it easier for neophytes. I'm guessing that the reason is because we aren't really adding an application but replacing the OS.
I greatly appreciate your guidance and that of all of the folks who use this forum.
Happy Holidays!

[REQUEST] OTA .182 update Zip

Hi!
I'd like to know where the OTAs are stored in our M2. Anyone that hasn't done yet the update download, and that has Root permissions, can use this app to find where they're stored, and if possible, upload it and post a link to it.
Thank you!
Do you still needed the file, sir ?
FunSucker said:
Do you still needed the file, sir ?
Click to expand...
Click to collapse
Yep. It's for some research
I think, the app didn't work sir. After I wait 30 minutes, none of the files were copied to my storage. Then I try searching using manual method, I found one file, the file size is as large as my OTA update. The nama file is "update-package".
The file extension is not ".zip", in the folder recovery (internal storage). My estimate, the file extension .LZMA or .tar.LZMA or .zipx.
I've tried to extract and decompress in the PC (windows os) using some programs, but failed.
If you still need the file, I'll upload it now .
FunSucker said:
I think, the app didn't work sir. After I wait 30 minutes, none of the files were copied to my storage. Then I try searching using manual method, I found one file, the file size is as large as my OTA update. The nama file is "update-package".
The file extension is not ".zip", in the folder recovery (internal storage). My estimate, the file extension .LZMA or .tar.LZMA or .zipx.
I've tried to extract and decompress in the PC (windows os) using some programs, but failed.
If you still need the file, I'll upload it now .
Click to expand...
Click to collapse
Yes please! Thanks
oke, sir. when finished i will share the link.
Oke sir, check this out --> Google Drive
FunSucker said:
Oke sir, check this out --> Google Drive
Click to expand...
Click to collapse
Great, thank you very much!
Okay, so this is what I got:
The update zip refuses to be flashed in UBL devices. FOTAkernel system is broken after you open the bootloader, which leads us with an unused partition (but that's other thing). The recovery logs just say: WARN: Status Rooted, ERR: Bootloader is unlocked.
I've tried to force it using AOSP Recovery commands
Code:
echo 'boot-recovery' > /cache/recovery/command
echo '--update_package=/sdcard/update.zip' >> /cache/recovery/command
reboot recovery
But just got a big nope.
So, now time to have a look at it. I tried to unpack it several times but no luck. The reason seems to be, very probably, because this is a LZMA compressed file (as 7-Zip reported) but with 2 additions at the end (which corrupts the entire read of it): An unencrypted/uncompressed XML which points out which is the software available right now in the phone (<source>), and which is the version that is going to be installed (<target>), plus, some a weird <generation> section. This is the XML
Code:
<?xml version='1.0' encoding='ISO-8859-1'?>
<metadata version="3.3">
<product>
<manufacturer>Sony</manufacturer>
<model>D2302</model>
<hwplatform>msm8226</hwplatform>
</product>
<update>
<generation>
<version>1.1.2</version>
<date>2015-12-28T12:10:19Z</date>
<rb_version>7.0.15.117</rb_version>
<rb_ua_version>7.0.15.117</rb_ua_version>
</generation>
<source>
<software>
<revision>18.6.A.0.175</revision>
</software>
<customization>
<variant>1281-0464</variant>
<revision>R2C</revision>
</customization>
</source>
<target>
<software>
<revision>18.6.A.0.182</revision>
</software>
<customization>
<variant>1281-0464</variant>
<revision>R2C</revision>
</customization>
</target>
</update>
</metadata>
And, right after that, I can perfectly see a SIN header, so I isolated it and, looks quite similar to the FOTAkernel.sin included in FTFs (330613072905Z010U S1_FOTA0 ‚"0), I personally guess it's a very, very small ELF binary, by the size of it.
So, the problem now comes to isolate the 3 parts, the LZMA file, the XML and the SIN, separetly. After that, I think we can probably have a look insde them.
How about linux os? Can we unpack or decompress that file on linux os, sir? Do you have tried?
FunSucker said:
How about linux os? Can we unpack or decompress that file on linux os, sir? Do you have tried?
Click to expand...
Click to collapse
I've tried many tools and combinations (ext4, .img, etc) and none of them worked... I'll think more about it.

Categories

Resources