diff --git a/research/MainApp1.6.1.md b/research/MainApp1.6.1.md index 2be1549..d6b72d5 100644 --- a/research/MainApp1.6.1.md +++ b/research/MainApp1.6.1.md @@ -1,4 +1,4 @@ -# 主 APP 1.6.1(42)改造 +# 主 APP 1.6.1(43)改造 本轮范围:仅主 APP 产品介绍、插件自动检查/提交注册、成功退出。不加入登录、授权、加密、自动更新或后端接口;以本轮用户说明为准,不执行旧交接中的下一阶段账号计划。 @@ -18,8 +18,10 @@ ## 保留范围 -主 Bundle ID com.dayu.color,服务com.dayu.color.XPC,唯一正式路径/Library/Plug-Ins/FxPlug/大鱼调色.app。主 APP/内嵌服务版本同步1.6.1(42)。调色/渲染、Uniform、参数、预设、Metal、模板无改动。现有自检及正式安装、宿主、打包/Release证据在verification记录;本文件不预先宣称未执行的验证通过。 +主 Bundle ID com.dayu.color,服务com.dayu.color.XPC,唯一正式路径/Library/Plug-Ins/FxPlug/大鱼调色.app。主 APP/内嵌服务版本同步1.6.1(43)。调色/渲染、Uniform、参数、预设、Metal、模板无改动。现有自检及正式安装、宿主、打包/Release证据在verification记录;本文件不预先宣称未执行的验证通过。 首轮正式40版发现沙盒查询-A会返回PKDiscoverAll未授权,虽然-a注册已经成功。41版移除-A/-D,仅查询自身组件,不取消沙盒、不新增权限。注册标记+后的可变空白单独归一化;发布地址按用户补充移到页面最顶部。40版保留为问题定位记录,不作为最终发行包。 41版实测证明系统CLI即使不带-A,查询也请求PKDiscoverAll;沙盒拒绝查询但允许显式注册。最终42版分别记录discoveryVerified、discoveryRestricted、submissionAccepted与confirmationMethod。只有明确的查询权限错误且精确组件验证/注册应答成功时,使用pkd应答判定注册成功;没有给沙盒增加权限,也没有把未知错误一律当成功。交付时由外部PluginKit回读和删除登记后重建的实际结果独立验证。 + +最终范围更新:用户明确允许关闭沙盒。43版移除外层APP的app-sandbox entitlement,Hardened Runtime、Developer ID、公证等交付要求保持;内嵌服务原本未启用该沙盒。恢复严格的系统登记回读,不再使用42版候选的pkd应答降级。主界面“打开FCP检查”会保留窗口,由用户在宿主确认画面及调节后点击“已确认正常,退出”。该确认写入本机诊断,自动验收不代替用户点击;系统注册成功与宿主用户确认分开。默认启动仍在注册成功5秒后退出。42版中断等待后未安装、不发布;40/41为定位问题的候选,不发布。 diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index b523185..9df97b8 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.6.1 CFBundleVersion - 42 + 43 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/AppDelegate.m b/大鱼调色/Wrapper Application/AppDelegate.m index e3203c9..121a85c 100644 --- a/大鱼调色/Wrapper Application/AppDelegate.m +++ b/大鱼调色/Wrapper Application/AppDelegate.m @@ -108,7 +108,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe @interface AppDelegate () @property(weak) IBOutlet NSWindow *window; @property(assign) NSTextField *statusTitle, *statusDetail, *exitDetail; -@property(assign) DYActionButton *retryButton, *keepButton; +@property(assign) DYActionButton *retryButton, *keepButton, *confirmationButton; @property(assign) NSProgressIndicator *progress; @property(assign) DYSurface *registrationCard; @property DYRegistrationState registrationState; @@ -177,10 +177,14 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe NSStackView *registration = DYStack(@[DYHeading(@"puzzlepiece.extension",@"插件连接",DYBlue()),self.statusTitle,self.statusDetail,self.progress, DYStack(@[self.retryButton,self.keepButton],NSUserInterfaceLayoutOrientationHorizontal,8)],NSUserInterfaceLayoutOrientationVertical,13); self.registrationCard = DYCard(DYBlue(),registration); - NSStackView *host = DYStack(@[DYHeading(@"play.rectangle",@"在剪辑中开始创作",DYGreen()), + self.confirmationButton = DYButton(@"已确认正常,退出",DYGreen(),NO,self,@selector(confirmHost:)); + self.confirmationButton.enabled = NO; + self.confirmationButton.toolTip = @"请先在 Final Cut Pro 中应用大鱼调色并确认效果正常,再点击此按钮。"; + NSStackView *host = DYStack(@[DYHeading(@"play.rectangle",@"在 Final Cut Pro 中检查",DYGreen()), DYLabel(@"调色,留在时间线里。",22,NSFontWeightSemibold,NSColor.whiteColor), - DYLabel(@"Final Cut Pro:效果 → 大鱼调色\nMotion:滤镜 → 大鱼调色\n将效果应用到片段,在检查器中调整。",13,NSFontWeightRegular,DYSecondary()), - DYStack(@[DYButton(@"打开 Final Cut Pro",DYColor(.20,.46,.94),YES,self,@selector(openFinalCut:)),DYButton(@"打开 Motion",DYGreen(),NO,self,@selector(openMotion:))],NSUserInterfaceLayoutOrientationHorizontal,8)],NSUserInterfaceLayoutOrientationVertical,13); + DYLabel(@"Final Cut Pro:效果 → 大鱼调色\n将效果应用到片段,确认画面与调节正常。\n打开宿主检查会保留本窗口,等待你确认。",13,NSFontWeightRegular,DYSecondary()), + DYStack(@[DYButton(@"打开 FCP 检查",DYColor(.20,.46,.94),YES,self,@selector(openFinalCut:)),DYButton(@"打开 Motion",DYGreen(),NO,self,@selector(openMotion:))],NSUserInterfaceLayoutOrientationHorizontal,8), + self.confirmationButton],NSUserInterfaceLayoutOrientationVertical,13); DYSurface *hostCard = DYCard(DYGreen(),host); NSStackView *top = DYStack(@[self.registrationCard,hostCard],NSUserInterfaceLayoutOrientationHorizontal,14); [self.registrationCard.heightAnchor constraintEqualToAnchor:hostCard.heightAnchor].active = YES; @@ -252,8 +256,8 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe if (!validComponent) { dispatch_async(dispatch_get_main_queue(), ^{ [self finishRegistration:NO details:@"未找到完整的插件组件。请从发布地址重新安装大鱼调色。" results:@{}]; }); return; } - // The system CLI may request PKDiscoverAll even without -A. A sandbox - // denies discovery while still allowing pkd to accept explicit registration. + // The stand-alone wrapper can inspect the registry directly. Registration + // and actual host rendering remain separate states; the user confirms FCP. NSDictionary *before = [self runPluginKit:@[@"-m",@"-v",@"-i",DYPluginID]]; dispatch_async(dispatch_get_main_queue(), ^{ self.registrationState = DYRegistering; self.statusTitle.stringValue = @"正在注册插件…"; @@ -266,20 +270,13 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe after = [self runPluginKit:@[@"-m",@"-v",@"-i",DYPluginID]]; registered = [self registry:after containsPlugin:path]; if (registered) break; } - BOOL discovered = registered; - BOOL discoveryRestricted = [after[@"output"] containsString:@"unauthorized discovery flag"] && [after[@"code"] intValue] != 0; BOOL submissionAccepted = [add[@"code"] intValue] == 0; - // An unavailable discovery operation is not a failed registration. - // Use the successful pkd acknowledgement only for this known restriction, - // after checking the exact embedded component's identity/build/protocol. - registered = discovered || (discoveryRestricted && submissionAccepted); - NSString *message = registered ? (discovered ? - @"已确认当前插件登记。请在 Final Cut Pro 或 Motion 中使用;若宿主已打开,请保存后重新打开。" : - @"系统已接受插件注册。可在 Final Cut Pro 或 Motion 中使用;若宿主已打开,请保存后重新打开。") : + NSString *message = registered ? + @"已确认当前插件登记。请在 Final Cut Pro 中实际应用并确认效果正常;若宿主已打开,请保存后重新打开。" : @"插件注册尚未完成。请点击“重新检查”,或重新安装后再试。窗口将保持打开。"; NSDictionary *results = @{@"before":before,@"submission":add,@"after":after ?: @{},@"registered":@(registered), - @"discoveryVerified":@(discovered),@"discoveryRestricted":@(discoveryRestricted),@"submissionAccepted":@(submissionAccepted), - @"confirmationMethod":discovered ? @"exact-path-discovery" : (registered ? @"pkd-registration-acknowledgement" : @"unconfirmed")}; + @"discoveryVerified":@(registered),@"submissionAccepted":@(submissionAccepted),@"hostVerification":@"awaiting-user-confirmation", + @"confirmationMethod":registered ? @"exact-path-discovery" : @"unconfirmed"}; dispatch_async(dispatch_get_main_queue(), ^{ [self finishRegistration:registered details:message results:results]; }); } }); @@ -289,9 +286,10 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe self.registrationState = success ? DYReady : DYFailed; [self.progress stopAnimation:nil]; self.progress.indeterminate = NO; self.progress.doubleValue = success ? 100 : 0; self.registrationCard.tint = success ? DYGreen() : DYColor(1,.67,.30); [self.registrationCard setNeedsDisplay:YES]; - self.statusTitle.stringValue = success ? @"✓ 插件已就绪" : @"需要重新检查"; + self.statusTitle.stringValue = success ? @"✓ 插件注册成功" : @"需要重新检查"; self.statusTitle.textColor = success ? DYGreen() : DYColor(1,.75,.4); self.statusDetail.stringValue = details; self.retryButton.title = @"重新检查"; self.retryButton.enabled = YES; + self.confirmationButton.enabled = success; [self.diagnostics addEntriesFromDictionary:results]; self.diagnostics[@"status"] = success ? @"registered" : @"failed"; [self writeDiagnostics]; NSAccessibilityPostNotificationWithUserInfo(self.window,NSAccessibilityAnnouncementRequestedNotification, @{NSAccessibilityAnnouncementKey:self.statusTitle.stringValue,NSAccessibilityPriorityKey:@(NSAccessibilityPriorityHigh)}); @@ -311,6 +309,12 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe self.keepButton.title = @"正在浏览介绍"; self.keepButton.enabled = NO; self.exitDetail.stringValue = @"已保留功能介绍窗口。插件可独立在宿主中使用。"; } +- (void)confirmHost:(id)sender { + if (self.registrationState != DYReady) return; + self.diagnostics[@"hostVerification"] = @"user-confirmed"; + self.diagnostics[@"terminationReason"] = @"user-confirmed-host"; + [self writeDiagnostics]; [NSApp terminate:nil]; +} - (void)writeDiagnostics { NSURL *base = [NSFileManager.defaultManager URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask].firstObject; NSURL *folder = [base URLByAppendingPathComponent:@"com.dayu.color" isDirectory:YES]; diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index c4792eb..408c41e 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.6.1 CFBundleVersion - 42 + 43 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/大鱼调色/Wrapper Application/SandboxEntitlements.entitlements b/大鱼调色/Wrapper Application/SandboxEntitlements.entitlements index 852fa1a..0c67376 100644 --- a/大鱼调色/Wrapper Application/SandboxEntitlements.entitlements +++ b/大鱼调色/Wrapper Application/SandboxEntitlements.entitlements @@ -1,8 +1,5 @@ - - com.apple.security.app-sandbox - - +