feat(client/macos): 开机自启用 SMAppService + LoginItem helper(学 Tailscale)
根因:launch_at_startup 0.5.1 在 macOS 无自带实现,需宿主接 MethodChannel,而我们 Runner 从没实现 → enable() 抛 MissingPluginException 被 try/catch 吞掉 → 登录项从未注册,自启失败。 学 Tailscale(LoginItemHelper-macsys + SMAppService): - 新增无界面 LoginItem helper(macos/login_helper,LSBackgroundOnly),登录时带 --autostart 拉起主 app(→隐藏到托盘); - build_login_helper.sh 构建期编译+签名+嵌入 Contents/Library/LoginItems/(新 Run Script 阶段); - MainFlutterWindow 接 launch_at_startup MethodChannel → SMAppService.loginItem 注册/注销。 构建通过:helper 嵌入+签名,主 app --deep --strict 校验过。Windows 自启(schtasks)不变。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -342,6 +342,7 @@
|
||||
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||
D3610C37E667F89FD1D27249 /* [CP] Embed Pods Frameworks */,
|
||||
A17B79EA2FE50746001ABF28 /* Copy System Extensions */,
|
||||
FACE0FF0FACE0FF0FACE0002 /* Embed Login Helper */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -371,6 +372,20 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "bash \"${SRCROOT}/sign_libbox.sh\"\n";
|
||||
};
|
||||
FACE0FF0FACE0FF0FACE0002 /* Embed Login Helper */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Embed Login Helper";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "bash \"${SRCROOT}/build_login_helper.sh\"\n";
|
||||
};
|
||||
A17B79DE2FE50745001ABF28 /* PacketTunnel */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = A17B79EF2FE50746001ABF28 /* Build configuration list for PBXNativeTarget "PacketTunnel" */;
|
||||
|
||||
Reference in New Issue
Block a user