NameAndPassword icon indicating copy to clipboard operation
NameAndPassword copied to clipboard

How to deploy in cocoa app

Open yarneo opened this issue 11 years ago • 6 comments

Hi, I am trying to create an app in which i can lock & unlock my mac using a cocoa OS X app running on that computer. Its very easy to lock, but unlocking is an issue, and then I came across this repo. Could you please give me some guidelines on how I can go about implementing the lock/unlock mechanism using this code?

Thanks!

yarneo avatar Nov 23 '14 16:11 yarneo

How do you want to implement the unlock mechanism? By typing a password?

skycocker avatar Nov 23 '14 19:11 skycocker

Not exactly, I'm interested to unlock it using a cocoa app that is invoked by an http get it is listening to in the background

yarneo avatar Nov 23 '14 19:11 yarneo

The simplest way would be to store the encrypted password somewhere, then decrypt it on the NameAndPassword side, fill the password field and programatically click the button:

Set the decrypted password as either mIPPasswordSecureTextField or mPPasswordSecureTextField (or both if necessary), then just run [self buttonPressed:SFButtonTypeOK] (in this file: https://github.com/skycocker/NameAndPassword/blob/master/NameAndPasswordPlugin.m)

skycocker avatar Nov 23 '14 19:11 skycocker

Do I run [self buttonPressed:SFButtonTypeOK] in my cocoa app? Do I understand correctly? Thanks so much!

Im essentially trying to understand how I invoke the bundle from my app.

yarneo avatar Nov 23 '14 20:11 yarneo

No, not the cocoa app. You call it in this NameAndPassword code application. You need to form all your desired code in this application.

If I understood your needs correctly, you will need to move at least some part of your application code into the NameAndPassword .m files.

skycocker avatar Nov 23 '14 20:11 skycocker

I wouldnt mind passing all of my code to it, although as far as reading all the stackoverflow threads it is to my understanding that i need to create a bundle beforehand and move it to a certain directory. I am trying to make a standalone mac app that involves locking and unlocking the mac, therefore i need to be able to invoke an unlock from it. Would i be able to run the nameandpassword entirely in my app, or must it be bundled?

Sent from my iPhone

On Nov 23, 2014, at 12:53 PM, Michał Siwek [email protected] wrote:

No, not the cocoa app. You call it in this NameAndPassword code application. You need to form all your desired code in this application.

If I understood your needs correctly, you will need to move at least some part of your application code into the NameAndPassword .m files.

— Reply to this email directly or view it on GitHub.

yarneo avatar Nov 23 '14 21:11 yarneo