Giter Site home page Giter Site logo

evenbetterauthorizationsample's Introduction

HelperTool + XPCService Project Setup

This is how to set everything up (I believe)

The original Apple Doc for this project can be found in README-APPLE

In this example the 3 identifiers for the 3 targets are

Name Identifier
Broker (Main app) com.blackwellapps.Broker
BrokerHelper (HelperTool) com.blackwellapps.BrokerHelper
XPCService com.blackwellapps.XPCService

1 Add Copy File build phase

Main App Add Copy File build phase to main app target: Destination: Wrapper Subpath: Contents/LibraryXPCServices, Codesign on Copy:Disable.

screen shot 2015-04-17 at 15 35 48

XPCService Add Copy File build phase to XPCService target: Destination: Wrapper Subpath: Contents/Library/LaunchServices, Codesign on Copy:Disable.

screen shot 2015-04-17 at 15 37 12


2 Modify Info.plists

XPCService-Info.plist (Tools owned after installation)

Add a new key value pair to the XPCService's Info.plist

  • Key: "Tools owned after installation"
  • Type: dictionary

Inside this new dictionary add a another key value pair:

  • Key: Your helper's bundle identifier
  • Type: string
  • Value: "anchor apple generic and certificate leaf[subject.CN] = Certificate Name and certificate 1[field.1.2.840.113635.100.6.2.1] / exists /"

screen shot 2015-04-17 at 15 55 47

HelperTool-Info.plist (Clients allowed to add and remove tool)

Add a new key value pair the HelperTools's Info.plist

  • Key: "Clients allowed to add and remove tool"
  • Type: array

As this is an array, we will add a new item to the 0 index:

  • Key/Position: "Item 0"
  • Type: string
  • Value: "identifier XPCService identifier and anchor apple generic and certificate leaf[subject.CN] = Certificate Name and certificate 1[field.1.2.840.113635.100.6.2.1] / exists /"

screen shot 2015-04-17 at 15 38 38


3 Developer ID

Choose Developer ID:* in Code Signing Identity in build settings for each targets.

Main App

screen shot 2015-04-17 at 15 46 53

XPCService

screen shot 2015-04-17 at 15 46 45

HelperTool

screen shot 2015-04-17 at 15 46 59


4 Build

Build the app.


5 SMJobBlessUtil.py

Use SMJobBlessUtil.py cli script

Update Info.plist:

Format: $ ./SMJobBlessUtil.py setreq <XPCService path> <XPCService's Info.plist path> <Helper's Info.plist>

./SMJobBlessUtil.py setreq Build/Products/Debug/com.blackwellapps.XPCService.xpc XPCService/XPCService-Info.plist BrokerHelper/HelperTool-Info.plist HelperTool/HelperTool-Info.plist

Check Code Signing status:

Format: $ ./SMJobBlessUtil.py check <XPCservice path>

./SMJobBlessUtil.py check Build/Products/Debug/com.blackwellapps.XPCService.xpc

Troubleshooting

  • If it doesn't pass the CLI check then make sure #3 is correct
  • Also Make sure each .plist file is set as Info.plist in the corresponding Target's Build settings.

Credit

Got some of this from this gist https://gist.github.com/xiao99xiao/0509091001bdd6259249

evenbetterauthorizationsample's People

Contributors

brenwell avatar lucasderraugh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

evenbetterauthorizationsample's Issues

Helper Tools Fails To Install Helper

Hello ,

I am working on MAC Application and I am using "EvenBetterAuthorizationSample" code to do some root level stuff.

I have signed the application with my Developer ID and replace dev id everywhere ( 4 Places ) in code with my Developer ID.

The issue is when ever i tried to install the helper tool using SMJobBless is always returns false.

It returns error "CFErrorDomainLaunchd Code=4 "The operation couldn’t be completed. (CFErrorDomainLaunchd error 4.)"

Sandboxed failed

In order to verify the validate of the App Store, the XPC service is codesign,but the error is still reported in the installAction:
installHelperToolWithReply replyError is: Error Domain=CFErrorDomainLaunchd Code=4

error NSPOSIXErrorDomain / 25

=== In this method “connectAndExecuteCommandBlock”,connectReplyEndpoint Always nil ===

  • (void)connectAndExecuteCommandBlock:(void(^)(NSError *))commandBlock {
    if (connectReplyEndpoint == nil)
    }
    === error: error NSPOSIXErrorDomain / 25 ===

HelperTool Integration Steps

Hello,

I am new to GitHub so I hope that it is the right place to ask for help.

I am working on Mac OS application in which I have to create VPN Connection direct through my application and for that I have to store PASSWORD and SHAREDSECRETKEY in SYSTEM KEYCHAIN.

After lot of research I came to know about this sample code "EvanBetterAuthorizationExample”, I have gone throughout the code but didn't understand how I can implement this sample to my existing application.I have read the readme file but not much idea.

As I am new to this Network Programming can anyone please help me with proper integration steps?
Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.