Posts

Post not yet marked as solved
1 Replies
519 Views
Does there exist any functionality for checkpointing a live running process to a disk snapshot and then resuming execution for OSX? Similar to CRIU for Linux: https://criu.org/Main_Page I have read there was similar solutions for FreeBSD which is more similar to OSX perhaps than Linux. The benefit would be that applications which have a slow start-up time can be restarted faster, which especially happens a lot for developers.
Posted
by rrva.
Last updated
.
Post not yet marked as solved
2 Replies
856 Views
I have a swift app which uses SMJobBless with kSMDomainSystemLaunchd to install a privileged helper tool which performs some actions which require root. My app talks to it over XPC using NSXPCConnection. I embed the helper tool under Contents/Library/LaunchServices When building my app under macOS 13.2.1 with Xcode 14.2, installing the helper tool with SMJobBless no longer works. A copy of the app built on earlier macOS / Xcode does work fine. Can I use SMAppService.agent() ? The helper does not need to run when the user logs out. It only performs some actions as root when invoked over XPC and can exit afterwards. Is there some workaround to make SMJobBless work as before? If I use SMAppService.agent, where do I put the plist file? In which directory should I embed the tool executable if I use an agent? How should the plist file look like for a XPC launch agent? Can I have a working example xcode project which uses SMAppService.agent() to embed a privileged helper?
Posted
by rrva.
Last updated
.
Post not yet marked as solved
1 Replies
828 Views
Is it possible to use alternate media (video) for packaging both a sign interpreted variant and a non sign interpreted variant in the same multivariant playlist? Is there a reference playlist implementation for this use case? I was looking at techniques described in https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/adding_alternate_media_to_a_playlist
Posted
by rrva.
Last updated
.
Post not yet marked as solved
0 Replies
407 Views
I have a swiftui app without storyboard that is a menu bar app (UIElement). In it, I have a swiftui view that is displayed using NSWindowController. In that view, I have a swiftui TextField for which pasting with cmd+v does not work, but right-click gives a context menu offering me to paste (which works). What could be wrong? https://github.com/rrva/gitlab-notifier/blob/main/GitlabNotifier/PrefsView.swift
Posted
by rrva.
Last updated
.
Post not yet marked as solved
4 Replies
776 Views
I have an XPC connection that I want to know if I should trust using the following code. Does this look like a workable secure approach? func connectionIsValid(connection: NSXPCConnection) -> Bool {  let checker = CodesignChecker()  var localCertificates: [SecCertificate] = []  var remoteCertificates: [SecCertificate] = []  let pid = connection.processIdentifier  do {   localCertificates = try checker.getCertificatesSelf()   remoteCertificates = try checker.getCertificates(forPID: pid)  } catch let error as CodesignCheckerError {   NSLog(CodesignCheckerError.handle(error: error))  } catch let error {   NSLog("Something unexpected happened: \(error.localizedDescription)")  }  NSLog("Local certificates: \(localCertificates)")  NSLog("Remote certificates: \(remoteCertificates)")  let remoteApp = NSRunningApplication.init(processIdentifier: pid)  if remoteApp != nil && !remoteCertificates.isEmpty {   let policy = SecPolicyCreateBasicX509()   var optionalTrust: SecTrust?   let status = SecTrustCreateWithCertificates(remoteCertificates as AnyObject,                         policy,                         &optionalTrust)   guard status == errSecSuccess else {    NSLog("failed evaluating trust")    return false   }   let trust = optionalTrust!   var secResult = SecTrustResultType.invalid   SecTrustGetTrustResult(trust, &secResult)   if(secResult == .proceed || secResult == .unspecified) {    let names = remoteCertificates.map { commonName(cert:$0) }    let validCert1 = ["Apple Development: john.doe(at)example.com (XY12XY12X)", "Apple Worldwide Developer Relations Certification Authority", "Apple Root CA"]    if(names == validCert1) {     NSLog("Found a valid client (fingerprint #1)")     return true    }    let validCert2 = ["Developer ID Application: John Doe (XY13XY13X)", "Developer ID Certification Authority", "Apple Root CA"]    if(names == validCert2) {     NSLog("Found a valid client (fingerprint #2)")     return true    }    return false   } else {    NSLog("Got invalid secResult: \(secResult.rawValue)")   }   return false  } func commonName(cert: SecCertificate) -> String {  var commonName: CFString?  SecCertificateCopyCommonName(cert, &commonName)  return commonName as String? ?? "" }
Posted
by rrva.
Last updated
.
Post not yet marked as solved
0 Replies
466 Views
I have added that build numbers are auto-incremented using agvtool next-version -all && xcrun agvtool new-marketing-version \"1.$(agvtool what-version | sed -n 2p |tr -d ' ')\" I believe this causes random build failures in Xcode where the build fails without proper error messages and I have to retry the build. What is a correct solution for auto-incrementing build numbers?
Posted
by rrva.
Last updated
.