fix: retain FxPlug-compatible file dialogs and preserve previous app through host acceptance

这个提交包含在:
mac 于 2026-11-01 11:17:31 +08:00 提交
1 父节点 875add7adf
当前提交 cc7f9c952a
6 个文件已更改
+16 -9

没有与搜索条件相匹配的文件

+7 -3
查看文件
@@ -87,18 +87,22 @@ def main():
if target.exists():os.chflags(target,0)
shutil.copy2(source,target);os.chflags(target,2)
# All generated copies are removed before final registry/host verification.
for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]+([(old,'com.dayu.color')] if old else []):
for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]:
if copy.exists():identity(copy,expected);unregister(copy/PLUGIN if copy.suffix=='.app' else copy);shutil.rmtree(copy)
old=None;archive.unlink();backup=CACHE/'previous-template.moef'
if old:unregister(old/PLUGIN)
archive.unlink();backup=CACHE/'previous-template.moef'
if backup.exists():backup.unlink()
run('pluginkit','-a',str(DEST/PLUGIN));registry=run('pluginkit','-m','-A','-D','-v','-i','com.dayu.color.XPC')
entries=[l for l in registry.splitlines() if 'com.dayu.color.XPC(' in l]
if len(entries)!=1 or not entries[0].rstrip().endswith('\t'+str(DEST/PLUGIN)):raise RuntimeError('PluginKit发现多份/错误版本: '+registry)
record=dict(status='installed-awaiting-host-verification',path=str(DEST),bundleID='com.dayu.color',version=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleShortVersionString'],build=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleVersion'],team='B3W25FX5H5',notaryID=result['id'],notaryStatus=result['status'],gatekeeper=gate,sourceCommit=run('git','rev-parse','HEAD'),templatePath=str(TEMPLATE),templateSHA256=hashlib.sha256(TEMPLATE.read_bytes()).hexdigest(),shaderSHA256=hashlib.sha256((DEST/PLUGIN/'Contents/Resources/default.metallib').read_bytes()).hexdigest())
if old:record['previousInstallBackup']=str(old)
output=ROOT/'verification/Delivery.json';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n')
run('open',str(DEST));print('FORMAL_INSTALLED. Run installed self-test and host verification; type complete only after success. Type leave to preserve pending state.',flush=True)
for decision in sys.stdin:
if decision.strip()=='complete':record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break
if decision.strip()=='complete':
if old and old.exists():identity(old,'com.dayu.color');unregister(old/PLUGIN);shutil.rmtree(old);old=None
record.pop('previousInstallBackup',None);record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break
if decision.strip()=='leave':break
finally:
if stage and stage.exists():shutil.rmtree(stage)