Embed mach service
This commit is contained in:
@@ -10,13 +10,70 @@
|
||||
CD41F5D32E62431D00E0027B /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = CD41F5D22E62431D00E0027B /* KeychainAccess */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
CD41F5D92E6284FD00E0027B /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = Contents/Library/LaunchAgents;
|
||||
dstSubfolderSpec = 1;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CD41F5DD2E6285E800E0027B /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 6;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
CD41F5972E5B8E7300E0027B /* kordophone2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = kordophone2.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
|
||||
CD41F5DA2E62850100E0027B /* Exceptions for "kordophone2" folder in "kordophone2" target */ = {
|
||||
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
|
||||
membershipExceptions = (
|
||||
Daemon/kordophoned,
|
||||
Daemon/net.buzzert.kordophonecd.plist,
|
||||
);
|
||||
target = CD41F5962E5B8E7300E0027B /* kordophone2 */;
|
||||
};
|
||||
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
|
||||
|
||||
/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
|
||||
CD41F5DC2E62853800E0027B /* Exceptions for "kordophone2" folder in "Copy Files" phase from "kordophone2" target */ = {
|
||||
isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;
|
||||
buildPhase = CD41F5D92E6284FD00E0027B /* CopyFiles */;
|
||||
membershipExceptions = (
|
||||
Daemon/net.buzzert.kordophonecd.plist,
|
||||
);
|
||||
};
|
||||
CD41F5E12E62860700E0027B /* Exceptions for "kordophone2" folder in "Copy Files" phase from "kordophone2" target */ = {
|
||||
isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;
|
||||
attributesByRelativePath = {
|
||||
Daemon/kordophoned = (CodeSignOnCopy, );
|
||||
};
|
||||
buildPhase = CD41F5DD2E6285E800E0027B /* CopyFiles */;
|
||||
membershipExceptions = (
|
||||
Daemon/kordophoned,
|
||||
);
|
||||
};
|
||||
/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
|
||||
|
||||
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||
CD41F5992E5B8E7300E0027B /* kordophone2 */ = {
|
||||
isa = PBXFileSystemSynchronizedRootGroup;
|
||||
exceptions = (
|
||||
CD41F5DA2E62850100E0027B /* Exceptions for "kordophone2" folder in "kordophone2" target */,
|
||||
CD41F5DC2E62853800E0027B /* Exceptions for "kordophone2" folder in "Copy Files" phase from "kordophone2" target */,
|
||||
CD41F5E12E62860700E0027B /* Exceptions for "kordophone2" folder in "Copy Files" phase from "kordophone2" target */,
|
||||
);
|
||||
path = kordophone2;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -60,6 +117,8 @@
|
||||
CD41F5932E5B8E7300E0027B /* Sources */,
|
||||
CD41F5942E5B8E7300E0027B /* Frameworks */,
|
||||
CD41F5952E5B8E7300E0027B /* Resources */,
|
||||
CD41F5D92E6284FD00E0027B /* CopyFiles */,
|
||||
CD41F5DD2E6285E800E0027B /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -264,7 +323,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = DQQH5H6GBD;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_HARDENED_RUNTIME = NO;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
@@ -291,7 +350,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = DQQH5H6GBD;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_HARDENED_RUNTIME = NO;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
|
||||
BIN
kordophone2/Daemon/kordophoned
Executable file
BIN
kordophone2/Daemon/kordophoned
Executable file
Binary file not shown.
26
kordophone2/Daemon/net.buzzert.kordophonecd.plist
Normal file
26
kordophone2/Daemon/net.buzzert.kordophonecd.plist
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>net.buzzert.kordophonecd</string>
|
||||
<key>BundleProgram</key>
|
||||
<string>Contents/MacOS/kordophoned</string>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>RUST_LOG</key>
|
||||
<string>info</string>
|
||||
</dict>
|
||||
<key>MachServices</key>
|
||||
<dict>
|
||||
<key>net.buzzert.kordophonecd</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
<key>StandardOutPath</key>
|
||||
<string>/tmp/kordophoned.out.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/tmp/kordophoned.err.log</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -19,7 +19,7 @@ struct MessageEntryView: View
|
||||
.frame(height: 1.0)
|
||||
|
||||
HStack {
|
||||
TextField("", text: $viewModel.draftText, axis: .vertical)
|
||||
TextField("iMessage", text: $viewModel.draftText, axis: .vertical)
|
||||
.focusEffectDisabled(true)
|
||||
.textFieldStyle(.plain)
|
||||
.lineLimit(nil)
|
||||
@@ -30,7 +30,7 @@ struct MessageEntryView: View
|
||||
.padding(8.0)
|
||||
.disabled(selectedConversation == nil)
|
||||
.background {
|
||||
RoundedRectangle(cornerRadius: 6.0)
|
||||
RoundedRectangle(cornerRadius: 8.0)
|
||||
.stroke(SeparatorShapeStyle())
|
||||
.fill(.background)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
|
||||
<array>
|
||||
<string>net.buzzert.kordophonecd</string>
|
||||
|
||||
@@ -29,6 +29,7 @@ struct TranscriptView: View
|
||||
.padding()
|
||||
}
|
||||
.scaleEffect(CGSize(width: 1.0, height: -1.0))
|
||||
.id(model.displayedConversation)
|
||||
.task { await watchForMessageListChanges() }
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ struct TranscriptView: View
|
||||
|
||||
func attachmentDownloaded(id: String) {
|
||||
// TODO: should be smarter here
|
||||
setNeedsReload(animated: true)
|
||||
setNeedsReload(animated: false)
|
||||
}
|
||||
|
||||
private func observeDisplayedConversation() {
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import ServiceManagement
|
||||
import XPC
|
||||
|
||||
private let serviceName = "net.buzzert.kordophonecd"
|
||||
|
||||
|
||||
final class XPCClient
|
||||
{
|
||||
private let connection: xpc_connection_t
|
||||
@@ -17,7 +19,22 @@ final class XPCClient
|
||||
private var signalSinks: [UUID: (Signal) -> Void] = [:]
|
||||
private var didSubscribeSignals: Bool = false
|
||||
|
||||
static let appService: SMAppService = {
|
||||
do {
|
||||
let service = SMAppService.agent(plistName: "net.buzzert.kordophonecd.plist")
|
||||
if service.status != .enabled {
|
||||
try service.register()
|
||||
}
|
||||
|
||||
return service
|
||||
} catch {
|
||||
fatalError("Unable to register agent: \(error)")
|
||||
}
|
||||
}()
|
||||
|
||||
init() {
|
||||
_ = Self.appService
|
||||
|
||||
self.connection = xpc_connection_create_mach_service(serviceName, nil, 0)
|
||||
|
||||
let handler: xpc_handler_t = { [weak self] event in
|
||||
|
||||
Reference in New Issue
Block a user