[HOW TO] build an autosigner for OSX
Ok, so I'm kind of new to automator which is why I'm making this as a tutorial instead of a download.
1. First you need to download the AndroidMod.zip JesusFreke posted
2. Copy the three highlighted objects from the SignApk folder to the folder of your choice, I chose one called signapk in my applications folder
3. Open the info window for one of the files in there final destination, keep it open as we're going to use the Where field in the next step.
4. Open Automator and choose a custom workflow. First go to Files and Folders then choose Duplicate Finder Items. What this does is create a duplicate of the file we're going to sign and pass it to the shell script we're about to create.
Then scroll down to utilities and then choose Run Shell Script.
5. Change the drop down for pass inputs from to stdin to as arguments. This allows us to either create an application we can drop files we want to sign onto, or create a finder plugin so we can right click(or ctrl-click if you're on a single button trackpad or mouse) and sign it from there.
6. The basic usage for the signapk.jar included in the android mod file is as follows: java -jar signapk.jar testkey.x509.pem testkey.pk8 <update.zip> <update_signed.zip>
what we need to change is add the absolute path to signapk.jar, testkey.x509.pem, and testkey.pk8. Thats what is listed in the where field in the get info window comes into play, just type everything listed there right infront of each of those three files. In my case thats going to be /Applications/signapk/. We also need to change <update.zip> to "$@" with
the quotes. Thats what is actually going to be the input from either dragging and dropping or right clicking. Finally the last parameter we just need to remove because we made a duplicate of the file to be signed, and if theres no final parameter it overwrites the file sent to it. My final shell script is shown in the image below.
7. Save the file as an application if you want to drag and drop files onto it and Save it as a plugin and then select finder if you want to be able to right click and sign. When using a finder plugin you right click and go to more, then automator, then choose the plugin you just saved.
Thats It! whenever you use it it will automatically create a copy of the file you're signing (ex. Launcher.apk -> Launcher copy.apk or update.zip -> update copy.zip) and sign that. The copy is the signed version and the original is left untouched.
Feel free to modify this however you want, if someone wants to release a prebuilt version of this automator action, thats perfectly fine by me, you don't even need to ask for permission. Do whatever you want with it.