Giter Club home page Giter Club logo

smjobkit's Introduction

SMJobKit

Using SMJobBless and friends is rather ...painful. SMJobKit does everything in its power to alleviate that and get you back to writing awesome OS X apps.

SMJobKit is more than just a framework/library to link against. It gives you:

  • A Xcode target template for SMJobBless-ready launchd services, completely configured for proper code signing!

  • A client abstraction that manages installing/upgrading your app's service(s).

  • A service library that pulls in as little additional code as possible. Less surface area for security vulnerabilities!

Project Configuration

To get started, pull the SMJobKit project into your own project or workspace. Have your application depend on the SMJobKit framework, and hit build. In addition to building the framework, this also causes the Xcode template to install its self into ~/Library/Developer/Xcode/Templates.

Next, you should set up your service helper/target: Add a new SMJobKit Service target to the project. This is relatively configuration-heavy, so you should probably build it right away to make sure everything is properly configured (and your code signing certificates are in order). You may want to review the [template's documentation](https://github.com/nevir/XMJobKit/tree/master/SMJobKit Service.xctemplate) for an in-depth explanation of what it is doing for you.

Finally, you need to add a Copy Files build phase to your application target. The destination should be "Wrapper" with a subpath of Contents/Library/LaunchServices. Add the service's built product to the list. Make sure you add a dependency on your service target!

And, hopefully, that's all you need to do in order to configure your project!

Client Abstraction

You'll want to create a subclass of SMJClient in your application, and override serviceIdentifier at the very least.

Service Implementation

smjobkit's People

Contributors

nevir 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

Watchers

 avatar  avatar  avatar  avatar

smjobkit's Issues

Unclear documentation

Sorry if part of this question is due to my ignorance.

But, here is what I have

   var errors:NSError!

        do{
         try SampleService.installWithPrompt("some message")
        }catch {
            errors = error as NSError
        }

        if (errors != nil){
            print("Got an error")
        }else{
            print("all good")
        }

Here is sample service

import SMJobKit

class SampleService : Client{
//    let identifier =  "io.jabbari.Away.SampleService"

    override class var serviceIdentifier: String {
        return "io.jabbari.Away.SampleService"
    }
}
  1. Why would one of the errors be bundleNotFound?
  2. How can I fix that?
  3. Now, I believe my SampleService is able to run in a higher privilege mode?
  4. Also, how can I retain that privilege escalation the next time the applications launches?

Once, I figure these out, I'd love to add to the read me about how I made my project.

Here is the full project if you'd like to look at it: project
Thanks for the great work

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.