# Can't Seem to Make a Zip File (install fail)



## TenderloinShadow (Nov 4, 2011)

ok, so as everyone who has used my Aroma app installer know, I've made flashable zips before. No problem, no issue. Lately, though, it seems like no zip I make works. I use winrar, which I know is an old program but it's always worked fine for me before. But now anything I zip refuses to run in TWRP.

I've done extensive testing. I've even gone to far as to unzip existing ROMs that I know flash properly, re-zipping them, and then flashing the new zip. Sure enough, while the old zip works fine, the new one doesn't. And I made ZERO changes to it.

I've tried flashing from the internal and external sd. Any previously compiled zips I can move over to the phone and flash no problem, but any zips that I have compiled in the last 24 hours refuse to work. I'm compiling them as zips, not rars (the first thing I checked). I even tried 7zip, which I hear tons of people talk about, and had the same results.

I'm starting to think I have some sort of bug on my computer that's interfering with the zip-making process. What I'm wondering is has anyone ever experienced this before?


----------



## blaineevans (Jul 11, 2011)

1) Download 7zip.. seriously.
2) Are you re-signing your .zips? The only way you can edit a zip without modifying it's signature is by using RootExplorer on the phone, or 7zip on your PC. Don't unzip or rezip, simply edit the files internally through 7zip.

The alternate option would obviously be to get something like AndroidSigner that signs that zip's with test keys.


----------



## TenderloinShadow (Nov 4, 2011)

I've generally been able to unzip and rezip easily for making flashables. Are you saying that if I do that I botch the signature, and that's preventing the install?

Also, I'm still quite new at this. Can you explain how signing works? Treat me like you would a child. lol


----------



## invisiblek (Aug 19, 2011)

I never sign my zips....

What's the error its giving you?


----------



## blaineevans (Jul 11, 2011)

Open up any .zip you've downloaded and navigate to /META-INF. You will see a folder named "com" and 3 other files. The other 3 are what are created when you sign a .zip (or .apk). Anytime you unpackage a .zip, and modify any files, you change the signature of said .zip. If you just repackage it with the same 3 files that were included before (in META-INF I mean), you're going to get a signature mismatch.

There are ways around this, as I had mentioned previously. But in my opinion, your best option is to use something to sign the .zip's after creating them. Google AndroidSigner, it's a great little signing tool for windows.


----------



## TenderloinShadow (Nov 4, 2011)

invisiblek said:


> Open up any .zip you've downloaded and navigate to /META-INF. You will see a folder named "com" and 3 other files. The other 3 are what are created when you sign a .zip (or .apk). Anytime you unpackage a .zip, and modify any files, you change the signature of said .zip. If you just repackage it with the same 3 files that were included before (in META-INF I mean), you're going to get a signature mismatch.
> 
> There are ways around this, as I had mentioned previously. But in my opinion, your best option is to use something to sign the .zip's after creating them. Google AndroidSigner, it's a great little signing tool for windows.


I'll check out AndroidSigner, see if that fixes it. I'm new at actually developing things, appreciate all the help.

When I run AndroidSigner, should I first delete the existing signature files?


----------



## blaineevans (Jul 11, 2011)

TenderloinShadow said:


> When I run AndroidSigner, should I first delete the existing signature files?


Yes.

Not entirely what you're looking for, but related: http://www.freeyourandroid.com/guide/introdution_to_edify


----------



## invisiblek (Aug 19, 2011)

TenderloinShadow said:


> It just fails, doesn't even begin to install. Just says Error flashing zip and a big red Failed.
> 
> Again, I was able to do all of this fine just last week. As far as I can tell I'm not doing anything different.


Get me a zip that you have that is failing so I can look at it.


----------



## TenderloinShadow (Nov 4, 2011)

invisiblek said:


> Get me a zip that you have that is failing so I can look at it.


Just PM'd you the link.


----------



## invisiblek (Aug 19, 2011)

TenderloinShadow said:


> Just PM'd you the link.


META-INF and data need to be in the root of the zip

also, your apk files would need to go in data/app


----------



## TenderloinShadow (Nov 4, 2011)

invisiblek said:


> META-INF and data need to be in the root of the zip
> 
> also, your apk files would need to go in data/app


goddamn it!!! your right!!! hahaha, wow do I feel stupid. And I knew this too for god sakes. lmfao. wow, feel free to abuse my sillyness here, I'm about to test this and invisiblek is totally going to end up being right.

Thanks so much for everyone for putting up with my noobishness at all this. That's one of the things I love about Rootz here.

Edit: Yep, it works now. In the words of the ever wise Homer Simpson, DOH!

Thanks again for the help. I feel really stupid. lol Big props to Invisiblek.


----------



## blaineevans (Jul 11, 2011)

Hahaha, yeah I guess file structure should have been looked at frist.

Sent from my SCH-I535 using Tapatalk 2


----------



## TenderloinShadow (Nov 4, 2011)

blaineevans said:


> Hahaha, yeah I guess file structure should have been looked at frist.
> 
> Sent from my SCH-I535 using Tapatalk 2


But like I said, I KNEW that. lol. It was one of the first mistakes I made when I was first trying this a few weeks ago, and I figured it out. You know, this is probably the reason you should code sober. Although that would be far less fun


----------

