Aftermarket seat memory functionality for BYD Dolphin Plus vehicles sold in Brazil
This project creates seat memory functionality for BYD vehicles through comprehensive reverse engineering and BYD Hardware Abstraction Layer (HAL) integration.
The BYD Dolphin Plus sold in Brazil lacks built-in seat memory functionality. The "Electro" app by Brazilian developer Rory provides this feature, but this project aims to create an open-source alternative through proper reverse engineering and documentation of BYD's vehicle integration methods.
- Electro APK Analysis: Full decompilation and protocol analysis
- BYD HAL Discovery: Found BYD's proprietary Hardware Abstraction Layer
- Communication Protocol: Documented Socket.IO + JNI + Native Library architecture
- Database Schema: Reverse engineered seat position storage system
- 150+ page HAL development guide with complete API reference
- Production-ready code examples with error handling
- Testing strategies for both emulator and real hardware
- Troubleshooting guides with common issues and solutions
- Method 1: Direct BYD HAL integration (recommended)
- Method 2: Electro app Socket.IO integration (fallback)
- Safety features: Speed checks, position validation, error recovery
βββ docs/ # π Comprehensive Documentation
β βββ BYD_HAL_COMPLETE_GUIDE.md # Complete HAL development guide
β βββ BYD_HAL_QUICK_REFERENCE.md # Quick reference for developers
β βββ REFERENCE_APP_ANALYSIS.md # Reference APK reverse engineering
β βββ PROTOCOL_ANALYSIS.md # Communication protocol details
β βββ IMPLEMENTATION_POC.md # Proof-of-concept implementation
β βββ ... # Additional technical documentation
βββ decompiled_reference/ # π Reference APK Analysis Results
β βββ sources/ # Decompiled Java source code
β βββ resources/ # APK resources and native libraries
βββ reference.apk # π± Original APK for reference
βββ CLAUDE.md # π€ Development guide for AI assistants
βββ .gitignore # Git ignore rules
// BYD provides official hardware abstraction classes
android.hardware.bydauto.bodywork.BYDAutoBodyworkDevice // Seat control
android.hardware.bydauto.setting.BYDAutoSettingDevice // Settings/profiles
android.hardware.bydauto.speed.BYDAutoSpeedDevice // Safety validation// Direct HAL access (recommended approach)
BYDAutoBodyworkDevice bodywork = BYDAutoBodyworkDevice.getInstance(context);
bodywork.setDriverComfortStage(1); // 5 positions: -2 to +2
bodywork.setPassengerComfortStage(-1);
// Safety validation
BYDAutoSpeedDevice speed = BYDAutoSpeedDevice.getInstance(context);
if (speed.isSafeForSeatAdjustment()) {
// Proceed with adjustment
}- Advantages: Official BYD APIs, type-safe, future-compatible
- Requirements: BYD vehicle with DiLink 3.0+, system-level permissions
- Status: Fully documented with production-ready code examples
- Advantages: Works with existing Electro installation
- Method: Socket.IO communication on localhost (127.0.0.1)
- Status: Reverse engineered protocol documented
- Primary: BYD Dolphin Plus (Brazilian market)
- Potential: Other BYD vehicles with DiLink Android system
- Android 7.1+ (API level 25+)
- BYD DiLink infotainment system
- Firmware version β€2307 (for easy sideloading)
- Range: 5 discrete positions (-2, -1, 0, +1, +2)
- Description: "Comfort stages" rather than precise positioning
- Storage: SQLite database with validation constraints
-
Read the documentation:
# Start with the quick reference docs/BYD_HAL_QUICK_REFERENCE.md # Then the complete guide docs/BYD_HAL_COMPLETE_GUIDE.md
-
Check HAL availability:
boolean halAvailable = BYDHardwareDetector.isBYDHALAvailable(context);
-
Implement seat control:
BYDSeatMemoryManager manager = new BYDSeatMemoryManager(context); manager.setDriverSeatPosition(1); // Forward position
- Installation: See
docs/INSTALLATION_GUIDE.md - Firmware: Check compatibility with your DiLink version
- Permissions: May require system-level app signing
- BYD HAL Framework: Complete hardware abstraction layer discovered
- Communication Architecture: Socket.IO β JNI β Native Library β CAN Bus
- Native Libraries: Critical logic in
libelectropkg.so(ARM64) - Security Model: Signature-level permissions with custom broadcast receivers
βββββββββββββββββββββββββββ
β Android Application β
βββββββββββββββββββββββββββ€
β Socket.IO (127.0.0.1)β
βββββββββββββββββββββββββββ€
β JNI Layer β
βββββββββββββββββββββββββββ€
β Native Library (.so) β
βββββββββββββββββββββββββββ€
β BYD HAL Layer β
βββββββββββββββββββββββββββ€
β Vehicle CAN Bus β
βββββββββββββββββββββββββββ
- Unit Tests: HAL method validation and error handling
- Integration Tests: Full workflow on BYD hardware
- Mock Testing: Emulator testing with HAL mocks
- Safety Testing: Speed interlock and position limits
# APK decompilation
jadx -d decompiled_electro Electro.apk
# Native library analysis
strings libelectropkg.so | grep seat
# HAL method discovery
adb logcat | grep BYD_HAL- Speed interlock: Prevents adjustment while vehicle moving
- Position limits: Software constraints prevent mechanical damage
- Error recovery: Comprehensive error handling with fallbacks
- Manual override: Always maintains manual seat controls
- Not affiliated with or endorsed by BYD Auto
- Use at your own risk - may void warranty
- Always prioritize safety and follow local regulations
- Ensure compliance with vehicle modification laws
- Documentation: Improve guides, add translations
- Testing: Test on different BYD models/firmware versions
- Development: Implement features from the roadmap
- Research: Further reverse engineering of BYD systems
- Testing on BYD vehicles other than Dolphin Plus
- UI/UX design for the Android application
- Translation to Portuguese and Spanish
- Integration with other BYD aftermarket apps
- Electro APK reverse engineering
- BYD HAL framework discovery
- Communication protocol analysis
- Complete documentation suite
- Proof-of-concept implementation
- Testing strategies and validation
- Android application development
- BYD HAL method discovery through testing
- Real hardware validation
- User interface design
- Multi-language support (Portuguese, Spanish)
- Support for additional BYD models
- Integration with other vehicle functions
- Professional UI/UX design
- BYD HAL Complete Guide - Comprehensive development guide
- Quick Reference - Developer quick start
- Reference App Analysis - Reverse engineering findings
- Installation Guide - User installation instructions
- Protocol Analysis - Communication protocols
- Implementation POC - Proof-of-concept code
- Development Roadmap - Project timeline
This project is licensed under the MIT License - see the LICENSE file for details.
- Original developers - Reference implementation that made this analysis possible
- BYD Auto - For creating the Hardware Abstraction Layer framework
- Brazilian BYD community - For identifying the need for this functionality
- Reverse engineering community - For tools and methodologies
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: All guides available in
/docsfolder
β‘ Made for BYD Dolphin Plus owners who want seat memory functionality
This project demonstrates the power of reverse engineering for creating aftermarket vehicle features while respecting intellectual property and safety considerations.