• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root How to sign apps and packages

DaSchmarotzer

Blame it on me
After a few queries on how to create an update.zip, I decided to make a quick guide with some basic information. You can use this to make app packages (install a lot of apps from the recovery), theming apks, overwrite system apps, etc.

Ok, so I'm using Windows 7 and this method should also work on XP and Vista. Linux users, you should check here for information on how to sign .apk and .zip files.

I'll take for granted that you already have the SDK and java. You'll need to download this (here is the original thread on XDA).

Open that .zip and copy the content to your SDK's "tools" folder. Please note that there shouldn't be any spaces in the pathname to the SDK. You don't actually have to put it there, but that was Stericson's recommendation.

Alright, before we start using this you need something to sign. I'll take an application as an example. What you can do is install the application from the market, open up Root Explorer, find the .apk, copy it to your SD card, plug the phone to your computer and transfer the .apk. In Galaxo they are located in "/data/app" or "/data/app_s" and it should be something similar for GAOSP.

Now that you have a .apk, you can easily modify its content. You can open a .apk file with programs like winrar, as it is simply a .zip file. So there you can modify or change the images, they are located in /res and then in the different sub-folders.

Now that you want to sign this apk, launch autosign.bat that should be in the tools folder of the SDK. Here's what it looks like:

1-2.png


You'll probably have to set it up before you can use it, so select the first option. All I had to do was to type yes.

2-2.png


Now select the second option. Once again I only had to type yes. (Told you this was easy. ;))

3.png


The third option isn't really needed, however you can select it and see what it is. I typed "no".

4-1.png


Now to the fourth choice. This is what we wanted to do, so select it and you're almost done signing your .apk or .zip (more on that later). You have to write the full path of the file, so that's what I did as you can see on this picture:

5-1.png


Then, if the path was written correctly, you have to confirm, which is what i was about to do:

6-1.png


Alright, you're pretty much done signing the apk. You should see something like this:

7-1.png


From now on, you should only have to select the fourth option if you want to sign something else, a .apk or a .zip.

To create a .zip file that you can apply in the recovery, I suggest you take an existing one and modify it. You'll understand how it is done quickly.

For example, if you want to change the GAOSP launcher, take a look at this .zip file. You never have to change stuff besides the .apks included in the zip files you work on.

When I first started working on themes and stuff like that, I always started from "Back to Galaxo" (or "Back to GAOSP"). If you downlaod it, you'll see that you can add any signed application in the app folder and that the framework-res.apk is the only app that is located somewhere else. So what you can do is delete the framework-res folder, delete the .apks from the app folder and just add your own signed apks there. Please note that without scripts, this will only add apps or overwrite them. You won't be able to uninstall them; you'll have to use root explorer on your phone and delete the .apk. When you are done modifying the .zip file, you have to sign it and then you can apply it from the recovery.

Alright, so this is pretty much everything you need to know. I know it's not such a great guide, but still, it should help you get started. ;)
 
I am currently trying to do this for a zip file so it will work on my phone.

Are you supposed to just sign the *.zip file itself, or do you have the contents in a folder, and then create a *.zip file and sign it in this signing program?

I don't know, I am so frustrated at this point. I have a zip file on my phone that my phone will not recognize. I do not know what I am doing wrong.

If anyone will help me, I would highly appreciate it. Seriously, I've been at this for 3 days now.

Thanks...
 
I am currently trying to do this for a zip file so it will work on my phone.

Are you supposed to just sign the *.zip file itself, or do you have the contents in a folder, and then create a *.zip file and sign it in this signing program?

I don't know, I am so frustrated at this point. I have a zip file on my phone that my phone will not recognize. I do not know what I am doing wrong.

If anyone will help me, I would highly appreciate it. Seriously, I've been at this for 3 days now.

Thanks...

You really should download an example zip (like a theme, or a launcher) to see where you need to place the files in the zip. It depends on what you are actually trying to do, so you should give more details if you need more help. The META-INF folder shouldn't be modified whatever you are doing though. It's really simple once you check out examples.
 
I've mistaken on the signing the zip file, so it's all good.

Thank you for trying to help me, I appreciate it. :)
 
Back
Top Bottom