- Changed MAX_FRAGMENT_SIZE from 500 to 150 bytes to match iOS/Rust
- Fixed fragment ID generation to use 8 random bytes instead of string
- Implemented automatic fragmentation in BluetoothConnectionManager
- Added 20ms delay between fragments to match iOS/Rust implementation
- Updated fragment calculation to account for full packet overhead (34 bytes)
This ensures Android-generated fragments fit within iOS's default 185-byte BLE MTU,
fixing issues with commands like ?ls -la and ?ifconfig failing on iOS devices.
This commit introduces the Gradle version catalog (`libs.versions.toml`) to manage dependencies and plugin versions centrally.
Key changes:
- Added `gradle/libs.versions.toml` defining versions, libraries, plugins, and bundles.
- Updated `app/build.gradle.kts` to reference dependencies and plugins from the version catalog.
- Updated project-level `build.gradle.kts` to use plugin aliases from the version catalog.
- Created MeshDelegateHandler.kt to handle all BluetoothMeshDelegate callbacks
- Created ChatViewModelUtils.kt for utility functions like haptic feedback
- ChatViewModel now delegates all mesh events to MeshDelegateHandler
- Final ChatViewModel size: 337 lines (down from 1000+ original)
This completes the refactoring while maintaining 100% functionality.
- Created ChatState.kt for centralized state management
- Created DataManager.kt for persistence operations
- Created MessageManager.kt for message handling and deduplication
- Created ChannelManager.kt for channel operations and encryption
- Created PrivateChatManager.kt for private chat functionality
- Created CommandProcessor.kt for IRC-style command processing
ChatViewModel.kt reduced from 1000+ lines to ~300 lines while maintaining 100% functionality.
All existing functionality preserved, just better organized.