16 Commits
Author SHA1 Message Date
caprain 05c09968bd fix:Share Intent无法二次分享 2026-06-28 17:29:55 +08:00
caprain 3df38030f2 fix:安卓端首次启动没有弹出通知权限申请 2026-06-27 18:53:57 +08:00
caprain d3f996b3f6 fix: 配置 ProGuard 保护规则 2026-06-27 18:34:51 +08:00
caprain 954236c6cd feat: Android SAF 原生文件选择器 (ACTION_OPEN_DOCUMENT + takePersistableUriPermission)
Kotlin 层:
   - registerForActivityResult(OpenDocument) 拉起系统 SAF 选择器
   - takePersistableUriPermission 持久化读取权限,跨进程/跨重启永久可读
   - 通过 external fun JNI 回调 Rust(URI / name / size)

   Rust 层:
   - APP_HANDLE 全局缓存,供 JNI 回调发射 Tauri 事件
   - AndroidFile::trigger_saf_picker_jni() 主动调 Kotlin
launchSafFilePicker
   - nativeOnSafFileSelected JNI 回调 → app.emit("saf-file-selected")

   JS 层:
   - attachFileBtn → Android 优先走 invoke("open_saf_picker")
   - saf-file-selected 事件监听 → URI 直接传给 apiSendFile

   降级: SAF 不支持持久化的极端情况 → FD 缓存兜底 (双保险)
2026-06-26 00:47:22 +08:00
caprain fdb24b5c56 feat: 系统通知 + 托盘图标闪烁 + 条件编译优化
系统通知(Closes #5)
- 桌面端:Windows PowerShell / Linux notify-send / macOS 原生通知
- Web 端:Notification API
- Android 端:tauri-plugin-notification 原生通知
- 通知开关:托盘菜单 CheckMenuItem + DB 持久化(仅桌面端)
- Android 通知点击导航(MainActivity.onNewIntent + localStorage)

托盘图标闪烁
- 500ms 间隔交替正常/空白图标(std::thread)
- 红点出现/消失时自动启停(updateTrayFlash)
- 左键/右键「显示窗口」跳转最新未读
- 多次点击逐个跳转未读用户(消费 pendingNotificationFromId + fallback)

Cargo 条件编译优化
- tauri-plugin-single-instance / opener 移入 desktop-only cfg
- tauri-plugin-notification 仅 macOS/Android 编译
- reqwest: Android 用 rustls-tls(避免 vendored OpenSSL 交叉编译失败)
- tokio/chrono 按需启用特性缩小体积
- 修复 TOML 表格结构导致全部依赖被吞入 cfg 区块的 bug
2026-06-20 23:10:57 +08:00
caprain d8c42db360 修复其他app分享文件崩溃 2026-05-13 19:27:01 +08:00
captain 5f2bb2a30e feat(android,security): Enable cleartext traffic and WebView debugging
- Enable cleartext traffic support in Android build configuration for local development
- Add WebView debugging to capture JavaScript console output in logcat
- Expand CSP policy to allow http://127.0.0.1:* for local media proxy service
- Add comprehensive debug logging for image loading and media token handling
- Improve image preview URL construction with detailed logging for Android content URIs
- Add image load success and error callbacks for better debugging visibility
2026-04-07 11:04:34 +08:00
captain 7080aef771 feat(android,file-transfer): Add instant transfer detection and improve share intent security
- Add ClipData to share intent to prevent SecurityException in system UI when accessing shared file URI
- Implement instant transfer (秒传) detection on receiver side to skip uploading when file already exists with matching size
- Add instant transfer response handling in upload command to stop transmission when receiver has complete file
- Refactor file naming negotiation logic to handle conflicts and .downloading file cleanup more robustly
- Add #[allow(unused_variables)] annotation to close_android_fd for non-Android builds
- Improve file conflict resolution with automatic renaming when size mismatch detected
- Create received file records immediately on instant transfer match and mark as accepted status
2026-04-05 17:37:13 +08:00
captain d5630cfb15 调整分享按钮位置、打开失败降级文件类型再次尝试 2026-04-05 00:01:15 +08:00
captain fb250964e1 feat(android): Add file opening and media token management
- Add openFile() method to MainActivity for opening files with native apps
- Implement open_file_in_android command to trigger file opening on Android
- Add get_media_token command for obtaining media proxy tokens
- Add close_android_fd command for closing Android file descriptors
- Enhance AndroidFile::from_content_uri() with exception handling for expired permissions
- Add query_content_uri_info() to retrieve file metadata (name, size) from content URIs
- Add get_media_token_from_uri() for generating media proxy tokens
- Add close_fd() method to properly close file descriptors
- Update Cargo.toml with tokio-util dependency for IO utilities
- Add new permissions to mobile.json capabilities
- Create android-share-out.toml with three new permission definitions
- Update README with new in-progress features for Android file handling and deduplication
- Improve error handling and logging throughout Android file operations
2026-04-04 22:32:57 +08:00
captain 564b97a0f0 fix:release代码的混淆导致安卓端文件消息分享无法生效 2026-03-10 00:16:17 +08:00
captain f5d3bcc7fd fix:安卓端冷启动分享文件无分享对话框 2026-03-09 21:27:52 +08:00
captain 3828a37aab fix+feature:LANChat安卓14无法弹出分享对话框、分享对话框动态刷新用户列表 2026-03-09 16:38:40 +08:00
captain 6e114b1096 feat(android): Add file sharing to other apps capability
- Add shareFile method to MainActivity for sharing files via FileProvider
- Implement share_file_to_other_app command with JNI integration for Android
- Add android-share-out.toml permission configuration for file sharing
- Update mobile.json capabilities to include allow-share-file-to-other-app
- Extend file_paths.xml with external and internal file path configurations
- Add originalUri parameter to send_file_from_fd command for URI preservation
- Update API and UI layers to support file sharing functionality
- Enable users to share received files to other applications on Android
2026-03-07 14:54:56 +08:00
captain 4126eb71bd feat(android): Add file sharing support via ShareActivity
- Add ShareActivity to handle incoming file shares from Android intent filters
- Implement JNI and NDK context dependencies for Android file descriptor handling
- Add android_fd.rs module for file descriptor operations
- Register broadcast receiver in MainActivity to detect shared files
- Add JavaScript interface to expose shared files to frontend
- Implement file URI to file descriptor conversion for efficient file transfer
- Add Android permissions for GET_TASKS and file sharing capabilities
- Update mobile.json capabilities with new file sharing and FD-based transfer permissions
- Add intent filters for SEND and SEND_MULTIPLE actions in AndroidManifest.xml
- Update frontend API and UI to support receiving and displaying shared files
- Add android-share.toml permission configuration file
2026-03-07 13:31:37 +08:00
captain 2bc6359779 支持安卓 2026-02-17 18:50:31 +08:00