-
Notifications
You must be signed in to change notification settings - Fork 103
Webdrop and AES encryption with PIN (optional) #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added complete Swedish translation with 203 strings across 11 XML files: - ui.xml (20 strings) - Main UI navigation - feat_stream.xml (21 strings) - Video player controls - feat_playlist.xml (13 strings) - Playlist management - feat_setting.xml (106 strings) - Settings - feat_foryou.xml (14 strings) - Home screen - feat_playlist_configuration.xml (9 strings) - data.xml (9 strings) - Notifications - app.xml (7 strings) - App-level resources - feat_favourite.xml (2 strings) - feat_console.xml (1 string) - feat_about.xml (1 string) Technical terms (M3U, EPG, IPTV, DLNA) preserved. All format placeholders and markdown formatting maintained.
Implements a new "WebDrop" data source that allows users to upload M3U playlists through a web browser on their local network, eliminating the need to type on TV remotes. Features: - Embedded Ktor CIO web server running on port 8080 - Responsive Material3 web UI with drag-and-drop support - Three upload methods: file upload (400MB max), URL import, Xtream codes - Real-time server status display with URL copy functionality - Automatic emulator detection (shows localhost for testing) - Full integration with existing M3U and Xtream parsers - Material3 Compose UI following existing design patterns - Multi-language support (11 locales) Technical implementation: - Repository pattern with WebServerRepository interface - StateFlow-based reactive state management - Ktor 3.3.1 CIO engine (Android-compatible, pure Kotlin) - ADB port forwarding support for emulator testing - CORS and content negotiation middleware - Integration with PlaylistRepository.m3uOrThrow() and xtreamOrThrow() Also removes broken French translations containing invalid unicode escape sequences.
This commit adds two major security and convenience features: ## USB Encryption Feature - Encrypt entire database using USB stick as physical key - Military-grade AES-256-GCM encryption with PBKDF2 key derivation - Supports both TV and smartphone apps - Lock screen when USB is removed - USB device monitoring and management - Warning dialogs for encryption enable/disable - Multi-language support for all USB encryption strings Files: - USBKeyRepository: Core USB device detection and encryption management - DatabaseMigrationHelper: Handles SQLCipher database encryption - SecuritySection (TV): Material3 TV-optimized UI - SecurityFragment (smartphone): Material Design UI - USBLockScreen: Full-screen lock when USB removed - USB permissions in AndroidManifest ## WebDrop Feature Integration - Server-side file upload handling (already implemented) - UI integration for WebDrop in settings - Multi-language support Dependencies: - SQLCipher for Android 4.6.1 - USB Host API support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…h enterprise-level improvements This commit introduces two major features along with critical bug fixes for production stability: ## 1. WebDrop Feature - Embedded Web Server for Playlist Management - Implemented Ktor-based embedded web server for remote playlist uploads - Web interface accessible at http://[device-ip]:8080 for easy file uploads - Three import methods supported: * File upload (M3U/M3U8 files up to 400MB) * URL import (remote M3U playlist URLs) * Xtream Codes API import (username/password authentication) - Enhanced upload.html with modern responsive UI - Real-time playlist status endpoint at /status - Automatic playlist parsing and channel import on upload ## 2. PIN-Based Database Encryption with SQLCipher - Full Room database encryption using SQLCipher 4.5.x - 6-digit PIN authentication system with unlock screen - Secure key derivation using Android Keystore (AES-256-GCM) - PBKDF2 with SHA-256 for PIN-to-key conversion (100,000 iterations) - UnlockManager for app-wide authentication state management - PIN unlock screen blocks app access until authentication succeeds - Encryption status dashboard showing health metrics - Database migration support for upgrading unencrypted to encrypted DBs - USB key storage for encryption keys ## 3. Enterprise-Level Network Timeout Fixes - Fixed SocketTimeoutException for large M3U playlist downloads - Configured OkHttp timeouts for slow M3U servers: * connectTimeout: 30 seconds (slow networks) * readTimeout: 90 seconds (critical for slow servers) * writeTimeout: 30 seconds (sufficient for GET requests) * callTimeout: 5 minutes (total max time for large downloads) - Comprehensive error handling with proper HTTP status codes (408, 503, 500) - Detailed error logging with timing metrics for debugging - Streaming-aware timeout configuration (readTimeout resets per data chunk) ## 4. Android TV Compatibility Fixes - Fixed ActivityNotFoundException crash on TV startup - Wrapped MANAGE_ALL_FILES_ACCESS_PERMISSION request in try-catch - TV devices skip this permission gracefully (not supported on Android TV) - App can still access cache/data directories without this permission ## 5. File Upload Path Fix - Fixed WebServerRepositoryImpl.kt file path handling - Changed from absolute path to proper file:// URI scheme - Ensures uploaded files are correctly recognized by playlist parser ## 6. Enhanced Logging and Debugging - Added comprehensive logging to M3UParserImpl for stream debugging - Enhanced PlaylistRepositoryImpl logging for input stream tracking - OkHttp interceptor logs request/response timing and payload sizes - Timber-based structured logging with component-specific tags ## Files Changed: - app/tv/MainActivity.kt: Added PIN unlock authentication gate - data/api/ApiModule.kt: Enterprise-level timeout configuration - data/database/DatabaseModule.kt: SQLCipher integration - data/repository/webserver/WebServerRepositoryImpl.kt: File URI fix - business/setting/UnlockManager.kt: Authentication state manager - data/security/PINKeyManager.kt: Secure key management with Android Keystore - app/tv/screens/security/PINUnlockScreen.kt: 6-digit PIN input UI - app/tv/screens/security/EncryptionStatusDashboard.kt: Health monitoring UI - data/repository/usbkey/USBKeyRepositoryImpl.kt: USB key storage
- Remove USB encryption initialization from M3UApplication startup - PIN unlock screen now displays correctly on app launch - Add ProGuard rules for Ktor and SQLCipher to prevent crashes - Fix rate limiting in PIN unlock (5 attempts max) - Improve PIN encryption UI flow and confirmation logic - Update launcher icons - Enhance database encryption with PIN-based key derivation Tested on emulator and Nvidia Shield - working correctly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WebDrop - LAN-based Playlist Upload
PIN Encryption (Optional Security Feature)
sources is more important than ever. Optional encryption ensures your data stays private on shared devices.
Updated App Icon
Optional Features
Both WebDrop and PIN encryption are completely optional:
Known Issues
database operations. This is a normal trade-off for the added security layer.
Technical Improvements
Tested on: Android TV Emulator and Nvidia Shield