Replies: 1 comment 3 replies
-
Thanks so much for this detailed feedback, it's much appreciated! With your usage of "heaps" I've got to ask - Aussie or Kiwi? Greetings from Auckland!
My understanding is
These are two unrelated concepts.
It ought to be called from the main thread when the app first loads, but otherwise should be running on the "directory monitor" In terms of performance, in my own experience it's extremely fast, but it does involve spinning up a new process so it's far more overhead than a normal function call would involve.
I can't think of a reason why an app would need the file system monitoring, but it's useful for the demo. I think you'd just want the
This isn't in the sample yet. Support for custom error types was added in SecureXPC 0.4.0 which I just released. However, the sample doesn't yet make use of this functionality. The sample uses the closure-based version of |
Beta Was this translation helpful? Give feedback.
-
I've just spent the day migrating from my bespoke privileged helper solution to leverage the trilemma-dev trinity of awesomeness (Blessed, SecureXPC andEmbeddedPropertyList) lol. It went so much smoother than my previous work in this arena, and the result is already feeling far more solid (and doubtless far more secure).
It's clear an enormous amount of time, thought & skill went into creating this, so overall I just wanted to say thanks heaps for sharing this. The fantastic documentation in particular was of real help as I worked my way through it all.
A few comments on specifics:
the plist handling worked really impressively — getting the
SMAuthorizedClients
signature correct was a real pain for me previously. And I really love the auto-version-incrementing system based on the code hash. Again, it's working perfectly out-of-the-box for me. It's a huge DX & productivity improvement.I'm a little confused by the need for
APP_VERSION
instead of usingCURRENT_PROJECT_VERSION
. Is the latter not available as an environment variable perhaps? (I've always found the availability of such variables to build scripts to be quite incomprehensible.) In some respects it's not ideal eg setting the app's Info.plistCFBundleVersion
to$(APP_VERSION)
gets overwritten if you ever forget and change the version in Xcode's Target "Identity" config GUI.Also, the docs state regarding
CURRENT_PROJECT_VERSION
: "This setting defines the current version of the project. The value must be a integer or floating point number, such as57
or365.8
." whereas your code appears to expect (or at least prefer as a best-practice) something like1.0.0
.HelperToolMonitor
— querying/bin/launchctl
directly is a stroke of genius :) However I noticed that this is sometimes called from the main thread. Is it always quick enough to be a non-issue? (it was in my testing)Secondly, it feels a bit overkill for a normal app (as opposed to this demo) to monitor the helper installation directories. Am I missing a bigger reason for this monitoring? Since you've already implemented it, it's tempting to use it, but I'm just not sure if it's really needed outside the demo.
Beta Was this translation helpful? Give feedback.
All reactions