Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
circa85
Old
(Last edited by circa85; 13th February 2009 at 05:22 PM.)
#1  
Member - OP
Thanks Meter 0
Posts: 66
Join Date: Dec 2008
Default [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
http://android-dls.com/forum/index.p...rb_v=viewtopic

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.
 
derfolo
Old
#2  
Senior Member
Thanks Meter 1
Posts: 183
Join Date: Jan 2009
Thanks very much! I was getting tired of launching Parallels whenever I wanted to do something like this.
Phone 1:
T-Mobile NEXUS S (unrooted)

Phone 2:
NEXUS ONE (unrooted)

Phone 3:
Brown and Black T-Mobile G1
ROM: Cyanogen's latest
Partitions: 6500MB FAT, 500MB EXT3
Recovery: RA-dream-v1.5.2
SPL: 1.33.2005
Radio: blahblah.26I
SD: 8GB Class 6
Theme: none
XDA contribution: Author of the "Keep screen awake" Call Setting on Cytown's phone.apk (used in cyanogen and other mods)
 
sedracer
Old
#3  
Member
Thanks Meter 4
Posts: 83
Join Date: Jan 2009
yes super useful, was sick of tossing files back and forth between my computers. definitely needs to be a sticky.
 
broopa
Old
(Last edited by broopa; 17th February 2009 at 12:01 AM.)
#4  
Junior Member
Thanks Meter 0
Posts: 22
Join Date: Dec 2008
I couldn't get it to work for me with ADP1.1 When I try to boot up with update.zip I get the error that the files were not signed. For argument sake I redid everything a few times. And saved my files exactly where you saved them and still no luck. Any ideas?

::edit:: I think that my problem has something to do with certain files not changing to .apk when I change them back from .zip. Some of my .apks change to that black square that you know are some executable program while the rest remain little white ones. Any ideas on how to change them to normal executable files?
 
circa85
Old
#5  
Member - OP
Thanks Meter 0
Posts: 66
Join Date: Dec 2008
yeah, if you open the info (command + i) on the file you'll see that the file has the .zip hidden. In the info window you can delete the .zip extension and just leave the .apk. Theres a setting somewhere to enable file extensions always, and it's quite nice to have that enabled
 
broopa
Old
(Last edited by broopa; 17th February 2009 at 03:51 AM.)
#6  
Junior Member
Thanks Meter 0
Posts: 22
Join Date: Dec 2008
I already have it enabled. That is why I can't figure out why some files do that and some don't.

Edit: Finder is reading some of them as Unix executable and others as documents. I guess the trick is trying to figure out how to fix that.
 
circa85
Old
#7  
Member - OP
Thanks Meter 0
Posts: 66
Join Date: Dec 2008
That would be as simple as running chmod on them in the console, however I've never had a problem with that, as long as they're named.apk and not .apk.zip I've never had a problem putting them back on the phone even if osx didn't see them as unix executables
 
broopa
Old
(Last edited by broopa; 17th February 2009 at 09:02 PM.)
#8  
Junior Member
Thanks Meter 0
Posts: 22
Join Date: Dec 2008
That is the only thing I could think of and chmod did not work. But I am not 100% sure that it is even the files that is the problem.

::Edit:: After testing things a little more I think it has something to do with the signing itself. Even though it makes that copy I don't think it is actually signing the file. Would you be able to upload your program?
 
liam.baker.g
Old
#9  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Jan 2009
i have had the exact same problem as Broopa and its getting really anoying lol could someone please upload the file for us to use.
 
broopa
Old
#10  
Junior Member
Thanks Meter 0
Posts: 22
Join Date: Dec 2008
Anyone have any idea why the folders aren't getting signed. I even installed java from Apples developer site and no luck.

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Guide Your Sheep to Safety with Finger Shepherd

Just a coupe of days ago, we brought you news about a game calledAgent Sheep. In that … more

Nandroid Manager Receives Major Update

Do you find yourself obsessively jumping from ROM to ROM? And do you hate having to restore a full … more

Careers in Android: Recruiter Reveals How Resumes are Chosen – XDA Developer TV

XDA Developer TV Producer Jayce released a video a … more

HttpClient Tutorial to Upload and Download with Your App

Developers wanting to interact with the Internet need to choose a package to do the … more