diff --git a/research/MainApp1.6.1.md b/research/MainApp1.6.1.md index a52f55d..5d460d6 100644 --- a/research/MainApp1.6.1.md +++ b/research/MainApp1.6.1.md @@ -1,4 +1,4 @@ -# 主 APP 1.6.1(40)改造 +# 主 APP 1.6.1(41)改造 本轮范围:仅主 APP 产品介绍、插件自动检查/提交注册、成功退出。不加入登录、授权、加密、自动更新或后端接口;以本轮用户说明为准,不执行旧交接中的下一阶段账号计划。 @@ -6,7 +6,7 @@ 延续现有 Objective-C/AppKit、Nib 连线和手动内存管理。使用 standard 档原生交互;静态深色渐变、圆角彩色卡片与胶囊按钮呼应用户参考图,不引入常驻动画、模糊或新的渲染依赖。 -比较了单列介绍、左右双栏状态+功能、状态+使用指引+双列特色卡三种结构,选择第三种:优先显示注册与宿主入口,接着完整调色、LUT、胶片、蒙版叠层,最后发布地址 https://dayu.media。窗口默认920×790,最小760×620,纵向滚动;介绍可通过按钮/⌘I保留,菜单⌘R重试、⌘W关闭、⌘Q退出。保留可访问的原生按钮、文本、焦点环和状态播报;表面不透明,增强对比度加粗边框。 +比较了单列介绍、左右双栏状态+功能、状态+使用指引+双列特色卡三种结构,选择第三种:优先显示注册与宿主入口,接着完整调色、LUT、胶片、蒙版叠层,顶部首先显示可点击的发布地址 https://dayu.media。窗口默认920×850,最小760×620,纵向滚动;介绍可通过按钮/⌘I保留,菜单⌘R重试、⌘W关闭、⌘Q退出。保留可访问的原生按钮、文本、焦点环和状态播报;表面不透明,增强对比度加粗边框。 状态唯一归属 AppDelegate:checking → registering → ready/failed。所有 PluginKit 操作在后台队列;主线程负责状态和窗口。重复检查期间禁用重入。每次打开都提交内嵌组件注册;以回读 Bundle ID、FxPlug登记协议1.1和当前插件完整路径为成功条件,不能仅凭命令退出码判定。成功默认5秒后退出;查看介绍取消本次倒计时;失败保留窗口和重试。关闭窗口退出,无后台常驻。 @@ -18,4 +18,6 @@ ## 保留范围 -主 Bundle ID com.dayu.color,服务com.dayu.color.XPC,唯一正式路径/Library/Plug-Ins/FxPlug/大鱼调色.app。主 APP/内嵌服务版本同步1.6.1(40)。调色/渲染、Uniform、参数、预设、Metal、模板无改动。现有自检及正式安装、宿主、打包/Release证据在verification记录;本文件不预先宣称未执行的验证通过。 +主 Bundle ID com.dayu.color,服务com.dayu.color.XPC,唯一正式路径/Library/Plug-Ins/FxPlug/大鱼调色.app。主 APP/内嵌服务版本同步1.6.1(41)。调色/渲染、Uniform、参数、预设、Metal、模板无改动。现有自检及正式安装、宿主、打包/Release证据在verification记录;本文件不预先宣称未执行的验证通过。 + +首轮正式40版发现沙盒查询-A会返回PKDiscoverAll未授权,虽然-a注册已经成功。41版移除-A/-D,仅查询自身组件,不取消沙盒、不新增权限。注册标记+后的可变空白单独归一化;发布地址按用户补充移到页面最顶部。40版保留为问题定位记录,不作为最终发行包。 diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index 4e2c4ea..239080f 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.6.1 CFBundleVersion - 40 + 41 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/AppDelegate.m b/大鱼调色/Wrapper Application/AppDelegate.m index d80083e..c4db8b4 100644 --- a/大鱼调色/Wrapper Application/AppDelegate.m +++ b/大鱼调色/Wrapper Application/AppDelegate.m @@ -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 中使用;若宿主已打开,请保存后重新打开。" : diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index 7401e10..46cbf8e 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.6.1 CFBundleVersion - 40 + 41 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright