Fix sandboxed PluginKit discovery and move publication link to the top
这个提交包含在:
1 父节点
4e77cebd5e
当前提交
7bb14ea8da
4 个文件已更改
+22
-15
没有与搜索条件相匹配的文件
+1
-1
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.6.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>40</string>
|
||||
<string>41</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
|
||||
@@ -124,7 +124,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
self.window.title = @"大鱼调色";
|
||||
self.window.appearance = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
|
||||
self.window.titlebarAppearsTransparent = YES; self.window.backgroundColor = DYColor(.105,.14,.20);
|
||||
self.window.contentMinSize = NSMakeSize(760,620); [self.window setContentSize:NSMakeSize(920,790)]; [self.window center];
|
||||
self.window.contentMinSize = NSMakeSize(760,620); [self.window setContentSize:NSMakeSize(920,850)]; [self.window center];
|
||||
[self buildInterface]; [self buildMenu];
|
||||
[NSWorkspace.sharedWorkspace.notificationCenter addObserver:self selector:@selector(accessibilityChanged:)
|
||||
name:NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification object:nil];
|
||||
@@ -155,6 +155,11 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
[document.leadingAnchor constraintEqualToAnchor:scroll.contentView.leadingAnchor],
|
||||
[document.topAnchor constraintEqualToAnchor:scroll.contentView.topAnchor],
|
||||
[document.widthAnchor constraintEqualToAnchor:scroll.contentView.widthAnchor]]];
|
||||
NSButton *website = [NSButton buttonWithTitle:@"发布地址 https://dayu.media ↗" target:self action:@selector(openWebsite:)];
|
||||
website.bordered = NO; website.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
website.attributedTitle = [[[NSAttributedString alloc] initWithString:website.title attributes:@{
|
||||
NSFontAttributeName:[NSFont systemFontOfSize:13 weight:NSFontWeightMedium],NSForegroundColorAttributeName:DYBlue()}] autorelease];
|
||||
[website.heightAnchor constraintEqualToConstant:28].active = YES;
|
||||
NSDictionary *info = NSBundle.mainBundle.infoDictionary;
|
||||
NSArray *heroLabels = @[DYLabel(@"FINAL CUT PRO / MOTION",11,NSFontWeightSemibold,DYBlue()),
|
||||
DYLabel(@"大鱼调色",42,NSFontWeightBold,NSColor.whiteColor),
|
||||
@@ -191,12 +196,8 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
NSStackView *row2 = DYStack(@[cards[2],cards[3]],NSUserInterfaceLayoutOrientationHorizontal,14);
|
||||
[((NSView *)cards[0]).heightAnchor constraintEqualToAnchor:((NSView *)cards[1]).heightAnchor].active = YES;
|
||||
[((NSView *)cards[2]).heightAnchor constraintEqualToAnchor:((NSView *)cards[3]).heightAnchor].active = YES;
|
||||
NSStackView *release = DYStack(@[DYHeading(@"globe",@"发布地址 https://dayu.media",NSColor.whiteColor),
|
||||
DYLabel(@"版本发布、使用资讯与更多插件,尽在大鱼素材网。",13,NSFontWeightRegular,DYSecondary()),
|
||||
DYButton(@"访问发布地址 ↗",DYBlue(),NO,self,@selector(openWebsite:))],NSUserInterfaceLayoutOrientationVertical,10);
|
||||
self.exitDetail = DYLabel(@"注册成功后将自动退出,插件可继续在宿主中使用。",12,NSFontWeightRegular,DYSecondary()); self.exitDetail.alignment = NSTextAlignmentCenter;
|
||||
NSStackView *content = DYStack(@[hero,top,DYHeading(@"sparkles",@"一套工具,完成你的色彩表达",NSColor.whiteColor),row1,row2,
|
||||
DYCard(DYColor(.45,.50,.60),release),self.exitDetail],NSUserInterfaceLayoutOrientationVertical,18);
|
||||
NSStackView *content = DYStack(@[website,hero,top,DYHeading(@"sparkles",@"一套工具,完成你的色彩表达",NSColor.whiteColor),row1,row2,self.exitDetail],NSUserInterfaceLayoutOrientationVertical,18);
|
||||
DYPin(content,document,30);
|
||||
for (NSView *view in content.arrangedSubviews) [view.widthAnchor constraintEqualToAnchor:content.widthAnchor].active = YES;
|
||||
[document.heightAnchor constraintGreaterThanOrEqualToAnchor:scroll.contentView.heightAnchor].active = YES;
|
||||
@@ -220,10 +221,11 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
for (NSString *line in [query[@"output"] componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]) {
|
||||
NSArray *fields = [line componentsSeparatedByString:@"\t"]; if (fields.count < 4) continue;
|
||||
NSString *identity = [fields[0] stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];
|
||||
if ([identity hasPrefix:@"+"]) identity = [[identity substringFromIndex:1] stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];
|
||||
NSString *registered = [[fields lastObject] stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];
|
||||
// 1.1 is the registration protocol, not the APP version.
|
||||
NSString *expected = [DYPluginID stringByAppendingString:@"(1.1)"];
|
||||
if (([identity isEqualToString:expected] || [identity isEqualToString:[@"+ " stringByAppendingString:expected]]) &&
|
||||
if ([identity isEqualToString:expected] &&
|
||||
[registered.stringByResolvingSymlinksInPath isEqualToString:path.stringByResolvingSymlinksInPath]) return YES;
|
||||
}
|
||||
return NO;
|
||||
@@ -232,7 +234,8 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
if (self.diagnostics && (self.registrationState == DYChecking || self.registrationState == DYRegistering)) return;
|
||||
[self.exitTimer invalidate]; self.exitTimer = nil; self.registrationState = DYChecking;
|
||||
self.retryButton.enabled = NO; self.retryButton.title = @"检查中…";
|
||||
self.statusTitle.stringValue = @"正在检查插件…"; self.statusDetail.stringValue = @"正在检查本机插件登记,随后自动提交注册。";
|
||||
self.statusTitle.stringValue = @"正在检查插件…"; self.statusTitle.textColor = NSColor.whiteColor;
|
||||
self.statusDetail.stringValue = @"正在检查本机插件登记,随后自动提交注册。";
|
||||
self.progress.indeterminate = YES; [self.progress startAnimation:nil];
|
||||
NSString *path = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"Contents/PlugIns/大鱼调色 XPC Service.pluginkit"];
|
||||
self.diagnostics = [NSMutableDictionary dictionaryWithDictionary:@{
|
||||
@@ -245,7 +248,9 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
if (![plugin.bundleIdentifier isEqualToString:DYPluginID]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{ [self finishRegistration:NO details:@"未找到完整的插件组件。请从发布地址重新安装大鱼调色。" results:@{}]; }); return;
|
||||
}
|
||||
NSDictionary *before = [self runPluginKit:@[@"-m",@"-A",@"-D",@"-v",@"-i",DYPluginID]];
|
||||
// -A requests PKDiscoverAll and is rejected inside the APP sandbox.
|
||||
// Default discovery is sufficient for this APP's own embedded component.
|
||||
NSDictionary *before = [self runPluginKit:@[@"-m",@"-v",@"-i",DYPluginID]];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.registrationState = DYRegistering; self.statusTitle.stringValue = @"正在注册插件…";
|
||||
self.statusDetail.stringValue = @"正在向系统提交插件注册,并核对当前安装位置。";
|
||||
@@ -254,7 +259,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
NSDictionary *after = nil; BOOL registered = NO;
|
||||
for (NSInteger attempt=0; attempt<4; attempt++) {
|
||||
if (attempt) [NSThread sleepForTimeInterval:.35];
|
||||
after = [self runPluginKit:@[@"-m",@"-A",@"-D",@"-v",@"-i",DYPluginID]];
|
||||
after = [self runPluginKit:@[@"-m",@"-v",@"-i",DYPluginID]];
|
||||
registered = [self registry:after containsPlugin:path]; if (registered) break;
|
||||
}
|
||||
NSString *message = registered ? @"已确认当前插件登记。请在 Final Cut Pro 或 Motion 中使用;若宿主已打开,请保存后重新打开。" :
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.6.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>40</string>
|
||||
<string>41</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户