Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/scripts/d1-migration-manifest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,22 @@ export const D1_MIGRATIONS = [
file: "worker/migrations/2026-09-01-message-mentions.sql",
artifacts: ["column:messages.mention_user_ids"],
},
{
id: "2026-09-02-voice-messages",
{
id: "2026-09-02-voice-messages",
file: "worker/migrations/2026-09-02-voice-messages.sql",
artifacts: [
"column:messages.attachment_kind",
"column:messages.attachment_duration_ms",
"column:messages.attachment_waveform",
],
},
{
id: "2026-09-04-message-replies",
file: "worker/migrations/2026-09-04-message-replies.sql",
artifacts: [
"column:messages.reply_to_message_id",
"column:messages.reply_to_sender_id",
"index:idx_messages_reply_attention",
],
},
];
46 changes: 31 additions & 15 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ jobs:
fetch-depth: 0
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "24"
cache: npm
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
java-version: "21"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install Android SDK 36
run: sdkmanager "platforms;android-36" "build-tools;36.0.0"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Resolve release version
Expand Down Expand Up @@ -61,36 +70,43 @@ jobs:
for name in ANDROID_KEYSTORE_BASE64 ANDROID_KEYSTORE_PASSWORD ANDROID_KEY_ALIAS ANDROID_KEY_PASSWORD; do
test -n "${!name}"
done
printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 --decode > android/release.keystore
cat > android/signing.properties <<EOF
printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 --decode > capacitor/android/release.keystore
cat > capacitor/android/signing.properties <<EOF
storeFile=release.keystore
storePassword=$ANDROID_KEYSTORE_PASSWORD
keyAlias=$ANDROID_KEY_ALIAS
keyPassword=$ANDROID_KEY_PASSWORD
EOF
- name: Install dependencies
run: npm ci
- name: Run Node tests
run: npm test
- name: Build and sync bundled Web UI
run: npm run capacitor:sync
- name: Test, lint and build signed artifacts
working-directory: android
run: >-
./gradlew testDebugUnitTest assembleDebugAndroidTest lintRelease assembleRelease bundleRelease
node capacitor/scripts/run-gradle.mjs
:app:testDebugUnitTest :app:assembleDebugAndroidTest
:app:lintRelease :app:assembleRelease :app:bundleRelease
-PedgechatVersionName=${{ steps.version.outputs.version }}
-PedgechatVersionCode=${{ github.run_number }}
--stacktrace
- name: Prepare checksums
shell: bash
run: |
mkdir -p android/release-artifacts
cp android/app/build/outputs/apk/release/app-release.apk android/release-artifacts/edgechat-${{ steps.version.outputs.version }}.apk
cp android/app/build/outputs/bundle/release/app-release.aab android/release-artifacts/edgechat-${{ steps.version.outputs.version }}.aab
cd android/release-artifacts
mkdir -p capacitor/release-artifacts
cp capacitor/android/app/build/outputs/apk/release/app-release.apk capacitor/release-artifacts/edgechat-${{ steps.version.outputs.version }}.apk
cp capacitor/android/app/build/outputs/bundle/release/app-release.aab capacitor/release-artifacts/edgechat-${{ steps.version.outputs.version }}.aab
cd capacitor/release-artifacts
sha256sum *.apk *.aab > SHA256SUMS.txt
- name: Verify APK signature
shell: bash
run: |
apksigner_path="$(find "$ANDROID_HOME/build-tools" -type f -name apksigner | sort -V | tail -n 1)"
test -n "$apksigner_path"
"$apksigner_path" verify --verbose --print-certs android/release-artifacts/*.apk
# AAB 是 JAR 签名格式;JDK 17 的 strict 模式会把 App Bundle 合法的 ZIP 结构警告误判为失败。
jarsigner -verify -verbose -certs android/release-artifacts/*.aab
"$apksigner_path" verify --verbose --print-certs capacitor/release-artifacts/*.apk
# AAB 使用 JAR 签名格式;这里只校验签名完整性,不把 ZIP 结构警告升级为失败。
jarsigner -verify -verbose -certs capacitor/release-artifacts/*.aab
- name: Publish GitHub Release
shell: bash
env:
Expand All @@ -105,12 +121,12 @@ jobs:
git push origin "$RELEASE_TAG"
fi
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release upload "$RELEASE_TAG" android/release-artifacts/* --clobber
gh release upload "$RELEASE_TAG" capacitor/release-artifacts/* --clobber
else
gh release create "$RELEASE_TAG" android/release-artifacts/* \
gh release create "$RELEASE_TAG" capacitor/release-artifacts/* \
--title "EdgeChat Android ${{ steps.version.outputs.version }}" \
--generate-notes $prerelease_flag
fi
- name: Remove signing material
if: always()
run: rm -f android/release.keystore android/signing.properties
run: rm -f capacitor/android/release.keystore capacitor/android/signing.properties
61 changes: 61 additions & 0 deletions .github/workflows/capacitor-android-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Capacitor Android CI
on:
push:
branches: [master, main]
paths:
- "frontend/**"
- "capacitor/**"
- "package.json"
- "package-lock.json"
- "test/**"
- ".github/workflows/capacitor-android-ci.yml"
pull_request:
paths:
- "frontend/**"
- "capacitor/**"
- "package.json"
- "package-lock.json"
- "test/**"
- ".github/workflows/capacitor-android-ci.yml"
workflow_dispatch:

concurrency:
group: capacitor-android-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "24"
cache: npm
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install Android SDK 36
run: sdkmanager "platforms;android-36" "build-tools;36.0.0"
- name: Validate Gradle wrappers
uses: gradle/actions/wrapper-validation@v4
- name: Install dependencies
run: npm ci
- name: Run Node tests
run: npm test
- name: Test, lint and build Capacitor debug APK
run: npm run build:capacitor
- name: Upload Capacitor debug APK
uses: actions/upload-artifact@v4
with:
name: edgechat-capacitor-debug
path: capacitor/android/app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
node-version: "24"
cache: npm
- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
node-version: "24"
cache: npm
- name: Install dependencies
run: npm ci
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ android/local.properties
android/signing.properties
android/*.jks
android/*.keystore
capacitor/android/.gradle/
capacitor/android/.kotlin/
capacitor/android/**/build/
capacitor/android/local.properties
capacitor/android/signing.properties
capacitor/android/*.jks
capacitor/android/*.keystore
17 changes: 12 additions & 5 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Admins can bind any group in EdgeChat to a Telegram group. Once bound, messages
- Public groups, private groups, and direct message conversations
- [Two-way Telegram group bridge](#featured-feature-telegram-two-way-message-bridge) — one Bot connects members on both sides
- Real-time messaging, paginated history, Telegram-style voice messages, and file messages
- The web client supports Telegram-style replies, quoted-message navigation, and reply-aware direct-attention alerts
- Web and Android recording, waveform seeking, playback speed controls, and two-way Telegram voice/audio sync
- File uploads and avatar management
- Scheduled hard deletion of expired messages
Expand Down Expand Up @@ -161,14 +162,20 @@ GitHub Actions deployment is recommended first — it suits long-term maintenanc
- Quick start: <https://echat.azora.top/guide/getting-started.html>
- Detailed guide: <https://echat.azora.top/guide/actions-deploy.html>

### Native Android Client
### Android Clients

The repository's `android/` directory is an independent Kotlin + Jetpack Compose client for Android 8 / API 26 and newer. It depends only on the stable `/api/v1` contract and never packages Vue components or CSS. When signed out, enter the HTTPS server origin, username, and password on one screen, or use `edgechat://connect?server=https%3A%2F%2Fchat.example.com` to prefill the server. The app validates server capabilities before completing sign-in.
The primary Android release is now the `capacitor/` client. Its APK bundles the Vue Web UI, while a small Kotlin bridge handles system file selection, notifications, microphone permission, notification room opening, and external links. It uses the application ID `com.aozorae.edgechat.web`; users enter their own EdgeChat HTTPS origin on first sign-in, so the package is not tied to one deployment.

- Installation: download `edgechat-*.apk` from GitHub Releases and verify `SHA256SUMS.txt`
- CI: `.github/workflows/android-ci.yml` runs unit tests, Lint, and a Debug APK build
- Release: push an `android-v*` tag or run `Android Release` manually after configuring `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, and `ANDROID_KEY_PASSWORD`
- Limitation: the first release has no FCM. WebSockets close in the background and incremental sync catches up after returning to the foreground, so background instant notifications are not promised
- First use: enter the self-hosted EdgeChat HTTPS origin, username, and password on the sign-in screen
- Local build: install JDK 21 and Android SDK 36, then run `npm run build:capacitor`
- Debug APK: `capacitor/android/app/build/outputs/apk/debug/app-debug.apk`
- CI: `.github/workflows/capacitor-android-ci.yml` uploads `edgechat-capacitor-debug`
- Release: push an `android-v*` tag or run `Android Release`; the workflow uses the four `ANDROID_KEYSTORE_*` Secrets to build signed APK/AAB artifacts
- Server switching: sign out and edit the URL; changing instances clears the previous instance token
- Limitation: this client currently has no Room offline database, WorkManager outbox, or FCM, so instant background notifications are not guaranteed when the app stops receiving messages

The native Kotlin + Jetpack Compose client in `android/` is temporarily deprecated and is no longer the default release. Its source, API v1 contract, and separate CI remain available for historical verification and future evaluation; use the Capacitor build for new installations and routine updates.

Full guide: <https://echat.azora.top/en/guide/android.html>

Expand Down
17 changes: 12 additions & 5 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ EdgeChat は Cloudflare 上にデプロイするチーム向けチャットシ
- 公開グループ、プライベートグループ、ダイレクトメッセージの会話に対応
- [Telegram グループ双方向メッセージブリッジ](#注目機能telegram-双方向メッセージブリッジ):1 つの Bot で両側のメンバーをつなぐ
- リアルタイムメッセージ、履歴のページング、Telegram 風ボイスメッセージ、ファイルメッセージ
- Web では Telegram 風の返信、引用元へのジャンプ、返信を含む「メンション」優先通知に対応
- Web / Android の録音、波形シーク、倍速再生、Telegram voice/audio の双方向同期
- ファイルアップロードとアバター管理
- 期限切れメッセージの定期ハード削除に対応
Expand Down Expand Up @@ -161,14 +162,20 @@ GitHub Actions でのデプロイを優先的に推奨します。長期的な
- クイックスタート:<https://echat.azora.top/guide/getting-started.html>
- 詳細チュートリアル:<https://echat.azora.top/guide/actions-deploy.html>

### ネイティブ Android クライアント
### Android クライアント

リポジトリの `android/` は Android 8 / API 26 以降向けの独立した Kotlin + Jetpack Compose クライアントです。安定した `/api/v1` 契約だけを共有し、Vue コンポーネントや CSS は APK に含めません。未ログイン時は 1 つの画面で HTTPS サーバー URL、ユーザー名、パスワードを入力できます。`edgechat://connect?server=https%3A%2F%2Fchat.example.com` でサーバーを事前入力することもでき、送信後にサーバー機能を確認してからログインします。
現在の Android 向け主要リリースは `capacitor/` クライアントです。APK に Vue Web UI を直接同梱し、システムのファイル選択、通知、マイク権限、通知から会話を開く処理、外部リンクだけを小さな Kotlin ブリッジで実装します。Application ID は `com.aozorae.edgechat.web` で、初回ログイン時に利用者自身の EdgeChat HTTPS サーバー URL を入力するため、特定のデプロイ先には固定されません。

- インストール:GitHub Releases から `edgechat-*.apk` を取得し、`SHA256SUMS.txt` を確認
- CI:`.github/workflows/android-ci.yml` が単体テスト、Lint、Debug APK ビルドを実行
- リリース:`android-v*` タグ、または手動の `Android Release` を使用し、4 つの `ANDROID_KEYSTORE_*` Secret を設定
- 制限:初版は FCM 非対応です。バックグラウンドでは WebSocket を閉じ、フォアグラウンド復帰時に差分同期するため、バックグラウンド即時通知は保証しません
- 初回利用:ログイン画面で自分の EdgeChat HTTPS サーバー URL、ユーザー名、パスワードを入力
- ローカルビルド:JDK 21 と Android SDK 36 を用意して `npm run build:capacitor` を実行
- Debug APK:`capacitor/android/app/build/outputs/apk/debug/app-debug.apk`
- CI:`.github/workflows/capacitor-android-ci.yml` が `edgechat-capacitor-debug` をアップロード
- リリース:`android-v*` タグ、または手動の `Android Release` を使用し、4 つの `ANDROID_KEYSTORE_*` Secret から署名済み APK/AAB を生成
- サーバー切替:ログアウト後に URL を変更でき、別インスタンスへ切り替えると以前のトークンを削除します
- 制限:現時点では Room オフライン DB、WorkManager Outbox、FCM を含まないため、アプリがメッセージを受信できない間の即時通知は保証しません

`android/` の Kotlin + Jetpack Compose ネイティブクライアントは一時的に非推奨となり、既定のリリース対象ではありません。ソース、API v1 契約、独立 CI は過去の検証と将来の再評価のため残しますが、新規インストールと通常更新には Capacitor 版を使用してください。

詳細:<https://echat.azora.top/en/guide/android.html>

Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<a href="README.md"><b>中文</b></a> ·
<a href="README.en.md">English</a> ·
<a href="README.ja.md">日本語</a> ·
<a href="https://edgechat-demo.gdz66601.workers.dev">在线 Demo</a> ·
<a href="https://edgechat-demo.wcjxxgaq.workers.dev">在线 Demo</a> ·
<a href="https://echat.azora.top/">项目文档</a> ·
<a href="https://t.me/EdgeChatlounge">Telegram 社区</a>
</p>
Expand Down Expand Up @@ -117,6 +117,7 @@ EdgeChat 是一个部署在 Cloudflare 上的团队聊天系统:账号体系
- 支持公开群组、私有群组与私信会话
- [Telegram 群组双向消息桥接](#特色功能telegram-消息双向桥接),一个 Bot 打通两侧成员
- 实时消息、历史消息分页、Telegram 风格语音消息与文件消息
- 网页支持 Telegram 风格消息回复、引用跳转,以及将回复纳入「有人@我」优先提醒
- 网页和 Android 均支持录音、波形进度、倍速播放;Telegram voice/audio 可双向同步
- 文件上传与头像管理
- 支持定时硬删除过期消息
Expand Down Expand Up @@ -162,14 +163,20 @@ EdgeChat 是一个部署在 Cloudflare 上的团队聊天系统:账号体系
- 快速开始:<https://echat.azora.top/guide/getting-started.html>
- 详细教程:<https://echat.azora.top/guide/actions-deploy.html>

### 原生 Android 客户端
### Android 客户端

仓库内的 `android/` 是独立的 Kotlin + Jetpack Compose 客户端(Android 8 / API 26 起),只依赖稳定的 `/api/v1` 协议,不复用网页组件或 CSS。未登录时可在同一页输入 HTTPS 服务器地址、用户名和密码;也可以通过 `edgechat://connect?server=https%3A%2F%2Fchat.example.com` 预填服务器。提交后客户端会先校验服务器能力,再完成登录。
当前主要发行版是 `capacitor/` 客户端:APK 直接内置 Vue Web UI,以少量 Kotlin 对接系统文件选择、通知、麦克风权限、通知会话跳转和外部链接。它使用包名 `com.aozorae.edgechat.web`,首次登录时由用户填写自己的 EdgeChat HTTPS 服务地址,不绑定固定部署。

- 安装包:从 GitHub Releases 下载 `edgechat-*.apk` 并核对 `SHA256SUMS.txt`
- CI:`.github/workflows/android-ci.yml` 运行单元测试、Lint 和 Debug APK 构建
- 发布:推送 `android-v*` 标签或手动运行 `Android Release`,需要配置 `ANDROID_KEYSTORE_BASE64`、`ANDROID_KEYSTORE_PASSWORD`、`ANDROID_KEY_ALIAS`、`ANDROID_KEY_PASSWORD`
- 限制:首版不接入 FCM,应用进入后台后会关闭 WebSocket;恢复前台时通过增量同步补齐消息,不承诺后台即时通知
- 首次使用:登录页填写自己的 EdgeChat HTTPS 服务地址、账号和密码
- 本地构建:准备 JDK 21 与 Android SDK 36 后运行 `npm run build:capacitor`
- Debug APK:`capacitor/android/app/build/outputs/apk/debug/app-debug.apk`
- CI:`.github/workflows/capacitor-android-ci.yml` 上传 `edgechat-capacitor-debug`
- 发布:推送 `android-v*` 标签或手动运行 `Android Release`,使用四个 `ANDROID_KEYSTORE_*` Secrets 构建签名 APK/AAB
- 服务切换:退出登录后可修改地址;切换实例时自动清理旧实例令牌
- 限制:当前不包含 Room 离线数据库、WorkManager Outbox 或 FCM,应用停止接收消息时不承诺后台即时通知

原生 `android/` Kotlin + Jetpack Compose 客户端暂时弃用,不再作为默认发行版。源码、API v1 契约和独立 CI 暂时保留,供历史验证与后续评估;新安装与日常更新请使用 Capacitor 版本。

完整说明:<https://echat.azora.top/guide/android.html>

Expand Down
Loading
Loading