feat(mobile,deploy): 接入安卓极光与华为通道并准备公网部署配置

客户端默认指向 jxd.jinniu.ink 的 HTTPS/WSS;登录后把 OpenIM userID 设为极光 alias。
华为 agconnect-services.json 不伪造、不入库。Master Secret 只从服务器文件注入。

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
编码工程师
2026-08-30 21:32:58 +08:00
co-authored by multica-agent
parent f35e1f03d5
commit f1fe4a3928
35 changed files with 687 additions and 64 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# 从服务器安全文件注入极光 Master Secret 到环境变量。
# 不打印文件内容、不写入仓库。供总工部署时 source,本卡不执行。
set -euo pipefail
SECRET_FILE="${JPUSH_MASTER_SECRET_FILE:-/root/.config/jinxunda/jpush_master_secret}"
if [ ! -f "$SECRET_FILE" ]; then
echo "缺少极光 Master Secret 文件(已配置路径,不打印内容)" >&2
exit 1
fi
perm=$(stat -c '%a' "$SECRET_FILE" 2>/dev/null || stat -f '%OLp' "$SECRET_FILE")
if [ "$perm" != "600" ] && [ "$perm" != "400" ]; then
echo "Master Secret 文件权限应为 600 或 400(当前 $perm" >&2
exit 1
fi
len=$(wc -c < "$SECRET_FILE" | tr -d ' ')
if [ "$len" -lt 16 ] || [ "$len" -gt 64 ]; then
echo "Master Secret 文件长度异常(不打印内容)" >&2
exit 1
fi
JPUSH_MASTER_SECRET="$(tr -d '\n\r' < "$SECRET_FILE")"
export JPUSH_MASTER_SECRET
# 有意不 echo 该变量