diff --git a/Backend/deploy_online_luts.py b/Backend/deploy_online_luts.py new file mode 100644 index 0000000..5f106b0 --- /dev/null +++ b/Backend/deploy_online_luts.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +"""Deploy only the two reviewed online-LUT files from the scoped local workspace.""" +import json, os, shutil, subprocess +from pathlib import Path +from deploy import ROOT, LOCAL, NAS, STAMP, check_mount, deploy_file, sha, write_json + +FILES=[Path('wp-content/mu-plugins/dayu-color-online-luts/renderer.php'),Path('wp-content/mu-plugins/dayu-color-online-luts.php')] + +def main(): + mount=check_mount() + contract=subprocess.run(['php',str(ROOT/'Backend/tests/online_luts.php')],capture_output=True,text=True,check=True) + assert json.loads(contract.stdout)['pass'] + report=ROOT/'verification/OnlineLUTDeployment.json' + previous=json.loads(report.read_text()) if report.exists() else {} + old={entry['relativePath']:entry for entry in previous.get('files',[])} + LOCAL.mkdir(parents=True,exist_ok=True);lock=LOCAL/'.deployment.lock';lock.mkdir() + write_json(lock/'owner.json',dict(pid=os.getpid(),cwd=str(ROOT),started=STAMP)) + results=[] + try: + for relative in FILES: + source=ROOT/'Backend'/relative;local=LOCAL/relative;target=NAS/relative + subprocess.run(['php','-l',str(source)],check=True,capture_output=True) + # Deploy only a remotely saved source checkpoint. + tracked=subprocess.check_output(['git','show','HEAD:Backend/'+str(relative)],cwd=ROOT) + assert tracked==source.read_bytes(),'Backend source is not committed' + expected=old.get(str(relative),{}).get('sha256') + if local.exists() and local.read_bytes()!=source.read_bytes():assert sha(local)==expected,'Local undeployed changes exist' + local.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(source,local) + result=deploy_file(local,target,allow_new=not expected,expected=expected) + result['relativePath']=str(relative);result['readable']=os.access(target,os.R_OK);result['mode']=oct(target.stat().st_mode&0o777);results.append(result) + write_json(report,dict(timestamp=STAMP,mount=mount,localProject=str(LOCAL),nasRoot=str(NAS),sourceCommit=subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT,text=True).strip(),files=results)) + print(json.dumps(dict(deployed=len(results),report=str(report)),ensure_ascii=False)) + finally: + shutil.rmtree(lock) +if __name__=='__main__':main() diff --git a/Packaging/build_pkg.py b/Packaging/build_pkg.py index a2afa17..154a00d 100644 --- a/Packaging/build_pkg.py +++ b/Packaging/build_pkg.py @@ -144,7 +144,7 @@ def main(): appearance=dict(title="大鱼调色", subtitle="适用于 Final Cut Pro 与 Motion 的原生调色效果", badgeImage=str(ROOT / "design/dayu-color-app-icon-v1.png"), authorContact="https://dayu.media"), pages=dict(welcome="安装大鱼调色 " + version + ",包含原生 FxPlug 调色插件和 Final Cut Pro 效果入口。", - readme="系统要求:macOS 14.6 或更高版本。本发行构建适用于 Apple Silicon Mac。\n\n安装内容:\n/Library/Plug-Ins/FxPlug/大鱼调色.app\n登录用户“影片/Motion Templates/Effects/大鱼调色”中的效果模板与预览图。\n\n重新打开 Final Cut Pro 后,在“效果 → 大鱼调色”中应用;Motion 中可选择原生滤镜。\n本安装包不包含用户自选 LUT、预设或媒体文件。\n\n公测诊断默认开启,可在主 APP 关闭。仅发送版本、系统环境、阶段耗时、资源使用与本产品崩溃/卡顿调用栈摘要到 dayu.media;不发送素材、预设或账号,保留30天。主 APP 启动时检查更新,新版由用户确认安装。", + readme="系统要求:macOS 14.6 或更高版本。本发行构建适用于 Apple Silicon Mac。\n\n安装内容:\n/Library/Plug-Ins/FxPlug/大鱼调色.app\n登录用户“影片/Motion Templates/Effects/大鱼调色”中的效果模板与预览图。\n\n重新打开 Final Cut Pro 后,在“效果 → 大鱼调色”中应用;Motion 中可选择原生滤镜。\n本安装包不包含用户自选 LUT、预设或媒体文件。\n\n公测诊断默认开启,可在主 APP 关闭。仅发送版本、系统环境、阶段耗时、资源使用与本产品崩溃/卡顿调用栈摘要到 dayu.media;不发送素材、预设或账号,保留30天。在线 LUT 需要在主 APP 微信登录,有效会员或购买文章 14421 / 15792 可使用全部已发布在线 LUT。插件内点击“预览当前帧”时,单独发送当前帧缩略图到 dayu.media 用于在线效果预览;服务器内存处理,不保存预览帧,不上传视频文件。主 APP 启动时检查更新,新版由用户确认安装。", license="", conclusion="大鱼调色已安装。主 APP 自动注册插件,成功后保持运行。关闭窗口仍在后台收集已开启的诊断;菜单栏可重新打开或退出。请重开宿主并实际检查效果。")) manifest_path = CACHE / "dayu-color-package-manifest.json" manifest_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2) + "\n") diff --git a/research/OnlineLUTIntegration-20261111.md b/research/OnlineLUTIntegration-20261111.md index a22c690..dfceffa 100644 --- a/research/OnlineLUTIntegration-20261111.md +++ b/research/OnlineLUTIntegration-20261111.md @@ -21,3 +21,5 @@ ## 实现检查点 已完成专用会话与权限接口、在线目录及内存 PNG 渲染器;主 APP 微信登录/权限卡片、共享钥匙串客户端、浏览器在线分类/分页/帧预览/下载应用及去重导入已接入。首次 Release 配置编译通过,PHP 合约检查通过。尚未部署后端、尚未运行正式新版、尚未公证或发布;下一步补充原生浏览器与导入检查,检查线上接口后进行正式交付。 + +第二阶段:PHP/GD 权限与渲染合约 36 项、原生 AppKit 在线浏览器与导入合约 36 项通过;原生测试模拟网络应答,未使用用户凭据或上传真实时间线帧。已从现有公开接口盘点 1,233 个发布 LUT 和 17 个分类。准备 1.22.0(127)正式交付,后台部署前检查点包含专用部署脚本及安装说明。 diff --git a/tools/verify_online_luts.mm b/tools/verify_online_luts.mm new file mode 100644 index 0000000..3de3c86 --- /dev/null +++ b/tools/verify_online_luts.mm @@ -0,0 +1,96 @@ +#import +#import +#import +#import "../大鱼调色/Plugin/DYLUTLibrary.h" +#import "../大鱼调色/Plugin/DYLUTBrowser.h" +#import "../大鱼调色/Shared/DYOnlineLUT.h" +#include + +@interface DYLUTBrowser (OnlineAcceptance) +- (void)sourceChanged:(id)sender; +- (void)revealLibrary:(id)sender; +- (void)previousOnlinePage:(id)sender; +- (void)folderClicked:(id)sender; +- (void)searchChanged:(id)sender; +- (void)captureOnlineFrame; +- (void)thumbnailClicked:(id)sender; +- (void)rebuildGrid; +- (void)layoutBrowser; +@end +static NSMutableArray *checks,*requests; +static NSData *cubeData,*renderPNG; +static NSString *checksum; +static BOOL paid=YES,badDownload=NO; +static NSUInteger activePreviews=0,maxPreviews=0; +static void require(BOOL pass,NSString *name){[checks addObject:@{@"name":name,@"pass":@(pass)}];if(!pass){fprintf(stderr,"FAIL %s\n",name.UTF8String);exit(1);}} +static void pump(BOOL (^done)(void)){ + NSDate *end=[NSDate dateWithTimeIntervalSinceNow:15];while(!done()&&end.timeIntervalSinceNow>0)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]]; + require(done(),@"asynchronous operation finished"); +} +static NSUInteger count(NSString *suffix){NSUInteger n=0;for(NSDictionary *r in requests)if([r[@"path"]hasSuffix:suffix])n++;return n;} +static NSProgress *requestFixture(id cls,SEL sel,NSString *path,NSDictionary *body,BOOL authenticated,DYOnlineLUTReply reply){ + NSProgress *task=[NSProgress discreteProgressWithTotalUnitCount:1]; + [requests addObject:@{@"path":path,@"body":body?:@{},@"authenticated":@(authenticated)}]; + BOOL preview=[path hasSuffix:@"/preview"];if(preview){activePreviews++;maxPreviews=MAX(maxPreviews,activePreviews);} + dispatch_after(dispatch_time(DISPATCH_TIME_NOW,30*NSEC_PER_MSEC),dispatch_get_main_queue(),^{ + if(preview)activePreviews--; + if(task.cancelled){reply(nil,[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:nil]);return;} + if(!paid){reply(nil,[NSError errorWithDomain:@"test" code:403 userInfo:@{NSLocalizedDescriptionKey:@"需要会员或购买权限"}]);return;} + NSData *data=nil; + if([path hasSuffix:@"/catalog"]){ + NSString *category=[body[@"category"]length]?body[@"category"]:@"胶片";NSUInteger page=[body[@"page"]unsignedIntegerValue]; + NSMutableArray *items=[NSMutableArray array]; + for(NSUInteger i=0;i<10;i++)[items addObject:@{@"id":@(1+(page-1)*60+i),@"title":[NSString stringWithFormat:@"测试胶片 %lu",(unsigned long)i],@"category":category,@"file_size":@(cubeData.length),@"checksum":checksum}]; + data=[NSJSONSerialization dataWithJSONObject:@{@"items":items,@"categories":@[@"胶片",@"婚礼",@"相机还原"],@"total":@1233,@"page":@(page)}options:0 error:nil]; + }else if([path hasSuffix:@"/download"])data=badDownload?[@"broken" dataUsingEncoding:NSUTF8StringEncoding]:cubeData; + else if(preview)data=renderPNG; + reply(data,nil); + });return task; +} +int main(int argc,const char **argv){@autoreleasepool{ + if(argc!=2)return 2;checks=[NSMutableArray new];requests=[NSMutableArray new]; + NSMutableString *text=[NSMutableString stringWithString:@"TITLE test\nLUT_3D_SIZE 2\n"]; + for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++)[text appendFormat:@"%d %d %d\n",x,y,z]; + cubeData=[[text dataUsingEncoding:NSUTF8StringEncoding]retain];unsigned char bytes[32];CC_SHA256(cubeData.bytes,(CC_LONG)cubeData.length,bytes);NSMutableString *digest=[NSMutableString string];for(unsigned char b:bytes)[digest appendFormat:@"%02x",b];checksum=[digest copy]; + NSURL *root=[NSURL fileURLWithPath:[NSTemporaryDirectory()stringByAppendingPathComponent:[@"dayu-online-lut-" stringByAppendingString:NSUUID.UUID.UUIDString]]]; + DYLUTLibrary *library=[[DYLUTLibrary alloc]initWithRootURL:root]; + __block BOOL imported=NO;__block NSString *installed=nil; + [library importOnlineData:cubeData identifier:@1 name:@"测试风格" category:@"../../胶片/风格" checksum:checksum completion:^(NSString *path,NSError *error){require(path&&!error,@"valid online LUT imports");installed=[path copy];imported=YES;}];pump(^{return imported;}); + require([installed hasPrefix:[library.rootURL.path stringByAppendingString:@"/"]]&&![installed.pathComponents containsObject:@".."],@"server names cannot escape local library"); + imported=NO;[library importOnlineData:cubeData identifier:@1 name:@"测试风格" category:@"../../胶片/风格" checksum:checksum completion:^(NSString *path,NSError *error){require([path isEqual:installed]&&!error,@"repeat online download reuses matching local file");imported=YES;}];pump(^{return imported;});require(library.entries.count==1,@"repeat imports do not create duplicate LUTs"); + imported=NO;[library importOnlineData:cubeData identifier:@2 name:@"损坏" category:@"胶片" checksum:[@"0" stringByPaddingToLength:64 withString:@"0" startingAtIndex:0] completion:^(NSString *path,NSError *error){require(!path&&error,@"checksum mismatch rejected before library changes");imported=YES;}];pump(^{return imported;});require(library.entries.count==1,@"existing local LUT preserved after rejected download"); + imported=NO;NSProgress *cancel=[library importOnlineData:cubeData identifier:@2 name:@"取消" category:@"胶片" checksum:checksum completion:^(NSString *path,NSError *error){require(!path&&error.code==NSUserCancelledError,@"cancelled online import reports cancellation");imported=YES;}];[cancel cancel];pump(^{return imported;}); + [NSApplication sharedApplication];[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited]; + method_setImplementation(class_getClassMethod(DYOnlineLUTClient.class,@selector(request:body:authenticated:completion:)),(IMP)requestFixture); + NSMutableData *pixels=[NSMutableData dataWithLength:320*180*16];float *p=(float *)pixels.mutableBytes;for(NSUInteger i=0;i<320*180;i++){p[i*4]=.2;p[i*4+1]=.4;p[i*4+2]=.8;p[i*4+3]=1;} + NSDictionary *frame=@{@"standard":pixels,@"standardSize":[NSValue valueWithSize:NSMakeSize(320,180)],@"time":@1}; + NSImage *image=DYLUTThumbnail(nil,pixels,320,180,NSMakeSize(320,180),nil);renderPNG=[[(NSBitmapImageRep *)image.representations[0]representationUsingType:NSBitmapImageFileTypePNG properties:@{}]retain]; + __block NSString *applied=nil; + DYLUTBrowser *browser=[[DYLUTBrowser alloc]initWithLibrary:library preview:frame selectedPath:nil palette:@{} selection:^NSProgress *(NSString *path,void(^completion)(NSError *)){NSProgress *job=[NSProgress discreteProgressWithTotalUnitCount:1];dispatch_async(dispatch_get_main_queue(),^{[applied release];applied=[path copy];completion(nil);});return job;}]; + pump(^{return [browser valueForKey:@"libraryTask"]==nil;});require(!browser.window.visible,@"acceptance never displays an unsigned test app"); + NSPopUpButton *source=[browser valueForKey:@"sourceMenu"];[source selectItemAtIndex:1];[browser sourceChanged:source];pump(^{return [[browser valueForKey:@"onlineEntries"]count]==10;}); + require(count(@"/catalog")==1&&count(@"/preview")==0,@"opening online categories does not upload a timeline frame"); + require([[browser valueForKey:@"folderPaths"]count]==4,@"online categories include all and named categories"); + require([[[browser valueForKey:@"countLabel"]stringValue]containsString:@"1233"],@"online total and pagination remain visible"); + [browser revealLibrary:nil];pump(^{return [[browser valueForKey:@"onlineCatalogTask"]isFinished]||[browser valueForKey:@"onlineCatalogTask"]==nil;});require([[requests.lastObject objectForKey:@"body"][@"page"]integerValue]==2,@"next page requests page two"); + [browser previousOnlinePage:nil];pump(^{return [browser valueForKey:@"onlineCatalogTask"]==nil;}); + NSButton *folder=[NSButton buttonWithTitle:@"婚礼" target:nil action:nil];folder.identifier=@"婚礼";[browser folderClicked:folder];pump(^{return [browser valueForKey:@"onlineCatalogTask"]==nil;});require([requests.lastObject[@"body"][@"category"]isEqual:@"婚礼"],@"category filter is sent to the server"); + NSUInteger before=count(@"/preview");[browser captureOnlineFrame];pump(^{return count(@"/preview")>before&&[[browser valueForKey:@"onlineTransfers"]count]==0;}); + require(maxPreviews<=2,@"browser limits simultaneous remote preview work"); + NSDictionary *upload=nil;for(NSDictionary *r in requests)if([r[@"path"]hasSuffix:@"/preview"]){upload=r;break;} + require([upload[@"body"]allKeys].count==1&&[upload[@"body"][@"frame_png"]isKindOfClass:NSString.class],@"frame request sends image pixels without project paths or filenames"); + NSBitmapImageRep *uploaded=[NSBitmapImageRep imageRepWithData:[[[NSData alloc]initWithBase64EncodedString:upload[@"body"][@"frame_png"]options:0]autorelease]];require(uploaded.pixelsWide==320&&uploaded.pixelsHigh==180,@"uploaded frame preserves timeline aspect"); + NSUInteger previous=count(@"/preview");[browser updatePreview:@{@"standard":pixels,@"standardSize":[NSValue valueWithSize:NSMakeSize(320,180)],@"time":@2}];require(count(@"/preview")==previous,@"new timeline frames never trigger automatic uploads"); + NSDictionary *tiles=[browser valueForKey:@"tiles"];NSButton *tile=tiles.allValues.firstObject;[browser thumbnailClicked:tile];pump(^{return [browser valueForKey:@"selectionTask"]==nil&&applied!=nil;}); + require([applied hasPrefix:library.rootURL.path]&&[NSFileManager.defaultManager fileExistsAtPath:applied],@"downloaded verified LUT is applied through local host selection"); + NSUInteger localCount=library.entries.count;[browser thumbnailClicked:tile];pump(^{return [browser valueForKey:@"selectionTask"]==nil;});require(library.entries.count==localCount,@"repeated online click does not duplicate installed LUT"); + badDownload=YES;[browser thumbnailClicked:tile];pump(^{return [browser valueForKey:@"selectionTask"]==nil;});require([[[browser valueForKey:@"statusLabel"]stringValue]containsString:@"大小"],@"incomplete download produces a visible error");badDownload=NO; + paid=NO;[browser folderClicked:folder];pump(^{return [browser valueForKey:@"onlineCatalogTask"]==nil;});require([[browser valueForKey:@"onlineEntries"]count]==0,@"permission rejection removes online entries"); + [source selectItemAtIndex:0];[browser sourceChanged:source];require(![[browser valueForKey:@"onlineMode"]boolValue]&&[[browser valueForKey:@"visibleEntries"]count]>0,@"local LUT library remains usable without online permission"); + [browser close];[browser release];[library release];[applied release];[installed release]; + [NSFileManager.defaultManager removeItemAtURL:root error:nil]; + for(NSString *key in NSUserDefaults.standardUserDefaults.dictionaryRepresentation.allKeys)if([key containsString:root.path])[NSUserDefaults.standardUserDefaults removeObjectForKey:key]; + NSDictionary *report=@{@"pass":@YES,@"count":@(checks.count),@"checks":checks,@"scope":@"Isolated AppKit browser with simulated network replies; real Cube validation/import; no user credentials, no production frame upload, no visible test app."}; + [[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:nil]writeToFile:[NSString stringWithUTF8String:argv[1]]atomically:YES]; + printf("PASS %lu checks\n",(unsigned long)checks.count);return 0; +}} diff --git a/verification/OnlineLUTBackendContracts.json b/verification/OnlineLUTBackendContracts.json index ea7e6a4..47ec127 100644 --- a/verification/OnlineLUTBackendContracts.json +++ b/verification/OnlineLUTBackendContracts.json @@ -1,21 +1,3 @@ - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/tests/online_luts.php on line 73 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/wp-content/mu-plugins/dayu-color-online-luts/renderer.php on line 77 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/wp-content/mu-plugins/dayu-color-online-luts/renderer.php on line 77 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/tests/online_luts.php on line 75 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/wp-content/mu-plugins/dayu-color-online-luts/renderer.php on line 77 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/wp-content/mu-plugins/dayu-color-online-luts/renderer.php on line 77 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/tests/online_luts.php on line 78 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/wp-content/mu-plugins/dayu-color-online-luts/renderer.php on line 77 - -Deprecated: Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0 in /Volumes/备份/大鱼调色/大鱼调色/Backend/wp-content/mu-plugins/dayu-color-online-luts/renderer.php on line 77 { "pass": true, "count": 36, diff --git a/verification/OnlineLUTNativeContracts.json b/verification/OnlineLUTNativeContracts.json new file mode 100644 index 0000000..222ad4b --- /dev/null +++ b/verification/OnlineLUTNativeContracts.json @@ -0,0 +1,151 @@ +{ + "scope" : "Isolated AppKit browser with simulated network replies; real Cube validation\/import; no user credentials, no production frame upload, no visible test app.", + "count" : 36, + "pass" : true, + "checks" : [ + { + "name" : "valid online LUT imports", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "server names cannot escape local library", + "pass" : true + }, + { + "name" : "repeat online download reuses matching local file", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "repeat imports do not create duplicate LUTs", + "pass" : true + }, + { + "name" : "checksum mismatch rejected before library changes", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "existing local LUT preserved after rejected download", + "pass" : true + }, + { + "name" : "cancelled online import reports cancellation", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "acceptance never displays an unsigned test app", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "opening online categories does not upload a timeline frame", + "pass" : true + }, + { + "name" : "online categories include all and named categories", + "pass" : true + }, + { + "name" : "online total and pagination remain visible", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "next page requests page two", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "category filter is sent to the server", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "browser limits simultaneous remote preview work", + "pass" : true + }, + { + "name" : "frame request sends image pixels without project paths or filenames", + "pass" : true + }, + { + "name" : "uploaded frame preserves timeline aspect", + "pass" : true + }, + { + "name" : "new timeline frames never trigger automatic uploads", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "downloaded verified LUT is applied through local host selection", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "repeated online click does not duplicate installed LUT", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "incomplete download produces a visible error", + "pass" : true + }, + { + "name" : "asynchronous operation finished", + "pass" : true + }, + { + "name" : "permission rejection removes online entries", + "pass" : true + }, + { + "name" : "local LUT library remains usable without online permission", + "pass" : true + } + ] +} \ No newline at end of file diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index 4b4d6c7..b45df74 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.21.8 + 1.22.0 CFBundleVersion - 126 + 127 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Shared/DYOnlineLUT.mm b/大鱼调色/Shared/DYOnlineLUT.mm index 6ef74a8..d3f4ef0 100644 --- a/大鱼调色/Shared/DYOnlineLUT.mm +++ b/大鱼调色/Shared/DYOnlineLUT.mm @@ -72,11 +72,11 @@ static NSDictionary *DYOnlineKeyQuery(void) { CFTypeRef result=NULL;OSStatus status=SecItemCopyMatching((CFDictionaryRef)query,&result); if(status!=errSecSuccess)return nil; NSData *data=[(NSData *)result autorelease];NSDictionary *value=[NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; - if(![value isKindOfClass:NSDictionary.class]||![value[@"token"]isKindOfClass:NSString.class]||[value[@"token"]length]!=64||[value[@"token"]rangeOfString:@"^[a-f0-9]{64}$" options:NSRegularExpressionSearch].location==NSNotFound||[value[@"expires_at"]doubleValue]<=NSDate.date.timeIntervalSince1970)return nil; + if(![value isKindOfClass:NSDictionary.class]||![value[@"token"]isKindOfClass:NSString.class]||[value[@"token"]length]!=64||[value[@"token"]rangeOfString:@"^[a-f0-9]{64}$" options:NSRegularExpressionSearch].location==NSNotFound||![value[@"expires_at"]isKindOfClass:NSNumber.class]||[value[@"expires_at"]doubleValue]<=NSDate.date.timeIntervalSince1970)return nil; return value; } + (BOOL)saveCredential:(NSDictionary *)value error:(NSError **)error { - if(![value[@"token"]isKindOfClass:NSString.class]||[value[@"token"]length]!=64){if(error)*error=DYOnlineError(401,@"登录凭据无效。");return NO;} + if(![value[@"token"]isKindOfClass:NSString.class]||[value[@"token"]length]!=64||[value[@"token"]rangeOfString:@"^[a-f0-9]{64}$" options:NSRegularExpressionSearch].location==NSNotFound||![value[@"expires_at"]isKindOfClass:NSNumber.class]||[value[@"expires_at"]doubleValue]<=NSDate.date.timeIntervalSince1970){if(error)*error=DYOnlineError(401,@"登录凭据无效。");return NO;} NSData *data=[NSJSONSerialization dataWithJSONObject:value options:0 error:error];if(!data)return NO; OSStatus status=SecItemUpdate((CFDictionaryRef)DYOnlineKeyQuery(),(CFDictionaryRef)@{(id)kSecValueData:data}); if(status==errSecItemNotFound) { diff --git a/大鱼调色/Wrapper Application/AppDelegate.m b/大鱼调色/Wrapper Application/AppDelegate.m index bc1604e..4f16111 100644 --- a/大鱼调色/Wrapper Application/AppDelegate.m +++ b/大鱼调色/Wrapper Application/AppDelegate.m @@ -284,7 +284,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe - (void)stopAccountLogin { self.accountGeneration++;[self.accountTask cancel];self.accountTask=nil; [self.loginTimer invalidate];self.loginTimer=nil;self.loginSessionKey=nil;self.pollingLogin=NO; - self.loginButton.enabled=YES;self.accessButton.enabled=YES; + self.loginButton.title=@"微信登录";self.loginButton.enabled=YES;self.accessButton.enabled=YES; } - (void)refreshOnlineAccount:(id)sender { if(self.loginSessionKey.length)return; @@ -303,6 +303,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe }]; } - (void)loginOnlineAccount:(id)sender { + if(self.loginSessionKey.length){[self stopAccountLogin];self.accountTitle.stringValue=@"登录已取消";self.accountDetail.stringValue=@"可以重新点击微信登录。";return;} [self stopAccountLogin];NSUInteger generation=self.accountGeneration; NSString *device=[DYOnlineLUTClient deviceUUID]; if(!device){self.accountDetail.stringValue=@"无法读取本机身份,请稍后重试。";return;} @@ -317,6 +318,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe [self stopAccountLogin];self.accountTitle.stringValue=@"登录未完成";self.accountDetail.stringValue=error.localizedDescription?:@"登录服务返回的地址无效。";return; } self.loginSessionKey=key;self.accountTitle.stringValue=@"请在浏览器中完成微信登录";self.accountDetail.stringValue=@"完成扫码和账号确认后,这里会自动验证在线 LUT 权限。"; + self.loginButton.title=@"取消登录";self.loginButton.enabled=YES; if(![NSWorkspace.sharedWorkspace openURL:url]){[self stopAccountLogin];self.accountDetail.stringValue=@"无法打开浏览器,请重试。";return;} self.loginTimer=[NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(pollOnlineLogin:) userInfo:@{ @"started":NSDate.date } repeats:YES]; }]; diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index bfd111d..718443d 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.21.8 + 1.22.0 CFBundleVersion - 126 + 127 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/开发交接.md b/开发交接.md index b10ca9a..2b226ad 100644 --- a/开发交接.md +++ b/开发交接.md @@ -4,7 +4,7 @@ ## 2026-11-11 在线 LUT 下载可行性 -后续用户已要求实际接入在线分类、主 APP 登录、14421/15792 任一购买或会员权限,以及时间线帧在线效果预览。实现与生产路径见[专项记录](research/OnlineLUTIntegration-20261111.md),接入前基线为 `5fae1150f4b7b6087f5da8298b5ac3ad8916e529`。首个实现检查点已包含后端、主 APP 登录和浏览器接入;Release 编译与隔离 PHP 合约通过,部署及正式交付仍待执行。以下保留此前可行性结论。 +后续用户已要求实际接入在线分类、主 APP 登录、14421/15792 任一购买或会员权限,以及时间线帧在线效果预览。实现与生产路径见[专项记录](research/OnlineLUTIntegration-20261111.md),接入前基线为 `5fae1150f4b7b6087f5da8298b5ac3ad8916e529`。首个实现检查点已包含后端、主 APP 登录和浏览器接入;Release 编译、PHP/GD 权限渲染合约与 36 项原生在线浏览器检查通过。准备 1.22.0(127),部署及正式交付仍待执行。以下保留此前可行性结论。 用户询问 LUT 浏览器能否联网下载预置 LUT,随后明确关心 FxPlug4 插件独立界面本身是否能够联网。核对当前源码、正式安装元数据及 Apple 官方文档;正式版本仍为 **1.21.8(126)**。首轮接手提交 `f554b11e6c17aaf38a7ae136787cdbb3eb9d45da` 与远端 `main` 一致,可行性记录已保存为 `995ac745d05fa0f5f1bbd142ae4ef6af45e281df`。两轮均未修改功能、运行宿主或发布新版本。