rwadurian/backend/mpc-system/services/service-party-android
hailin ecd7a2a2dc fix(android): clear pendingSessionId in resetSessionStatus to fix stale session matching
The resetSessionStatus() function was not clearing pendingSessionId,
causing events from new sessions to be ignored because pendingSessionId
still held the old session ID.

Added:
- Clear pendingSessionId = null in resetSessionStatus()
- Clear _currentSession.value = null in resetSessionStatus()
- Added debug logging for session state clearing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 21:11:24 -08:00
..
app fix(android): clear pendingSessionId in resetSessionStatus to fix stale session matching 2026-01-01 21:11:24 -08:00
gradle/wrapper feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
tsslib fix(android): simplify build-apk.bat with official gomobile setup 2026-01-01 00:53:04 -08:00
.gitignore feat(android): strengthen gRPC connection reliability 2026-01-01 06:44:42 -08:00
README.md feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
build-apk.bat fix(android): simplify build-apk.bat with official gomobile setup 2026-01-01 00:53:04 -08:00
build.gradle.kts feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
gradle.properties feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
gradlew feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
gradlew.bat feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
settings.gradle.kts feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00

README.md

TSS Party Android

Android 版本的 TSS (Threshold Signature Scheme) Party 应用,用于多方共管钱包的密钥生成和签名。

项目结构

service-party-android/
├── app/                          # Android 应用模块
│   ├── src/main/
│   │   ├── java/com/durian/tssparty/
│   │   │   ├── data/             # 数据层
│   │   │   │   ├── local/        # 本地存储 (Room, TSS Bridge)
│   │   │   │   ├── remote/       # 远程通信 (gRPC)
│   │   │   │   └── repository/   # 数据仓库
│   │   │   ├── domain/model/     # 领域模型
│   │   │   ├── presentation/     # UI 层
│   │   │   │   ├── screens/      # Compose 屏幕
│   │   │   │   └── viewmodel/    # ViewModels
│   │   │   ├── di/               # Hilt 依赖注入
│   │   │   ├── ui/theme/         # Material Theme
│   │   │   └── util/             # 工具类
│   │   ├── proto/                # gRPC Proto 文件
│   │   └── res/                  # Android 资源
│   └── libs/                     # TSS 原生库 (.aar)
├── tsslib/                       # Go TSS 库源码
│   ├── tsslib.go                 # gomobile 绑定
│   ├── go.mod
│   ├── build.sh                  # Linux/macOS 构建脚本
│   └── build.bat                 # Windows 构建脚本
└── gradle/                       # Gradle Wrapper

技术栈

  • UI: Jetpack Compose + Material 3
  • 架构: MVVM + Repository Pattern
  • 依赖注入: Hilt
  • 数据库: Room
  • 网络: gRPC (protobuf-lite)
  • TSS 核心: Go + gomobile (BnB Chain tss-lib v2)

构建步骤

1. 构建 TSS 原生库 (可选,需要 Go 环境)

# 安装 gomobile
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init

# 构建 Android AAR
cd tsslib
./build.sh  # Linux/macOS
# 或
build.bat   # Windows

这将在 app/libs/ 生成 tsslib.aar

注意: 当前版本使用 Kotlin stub 实现,无需编译 Go 库即可构建 APK。 实际运行需要真正的 tsslib.aar

2. 构建 APK

# Debug 版本
./gradlew assembleDebug

# Release 版本 (需要签名配置)
./gradlew assembleRelease

APK 输出路径: app/build/outputs/apk/debug/app-debug.apk

功能

  1. 加入 Keygen 会话 - 扫描/输入邀请码,参与多方密钥生成
  2. 查看钱包 - 显示已创建的共管钱包列表
  3. 签名交易 - 使用密钥份额参与多方签名
  4. 设置 - 配置 Message Router 服务器地址

配置

默认服务器配置:

  • Message Router: localhost:50051
  • Kava RPC: https://evm.kava.io

与 Electron 版本的对应关系

Electron 版本 Android 版本
electron/main.ts TssNativeBridge.kt + GrpcClient.kt
electron/preload.ts TssRepository.kt
src/pages/*.tsx presentation/screens/*.kt
tss-party/ (Go 子进程) tsslib/ (gomobile .aar)
sql.js Room Database

许可证

MIT