Transform Android APKs into C++ code with advanced compilation techniques
Dex2C Android is the client application for the Dex2C ecosystem. This powerful Android app bridges the gap between Android development and native C++ compilation. Built with modern Android architecture principles, it provides developers with an intuitive interface to convert APK files into optimized C++ code using advanced obfuscation and compilation techniques.
Note: This is the Android client part of the Dex2C project. The backend service is available in a separate repository: dex2c-backend
- APK to C++ Conversion: Transform Android applications into native C++ code
- Advanced Obfuscation: String obfuscation, method protection, and code transformation
- Intelligent Filtering: Create custom protection rules with visual filter builder
- APK Analysis: Deep analysis of DEX files with hierarchical package/class/method exploration
- Processing History: Track all conversion jobs with detailed status monitoring
- Modern UI: Material 3 design with smooth animations and responsive layout
- Real-time Processing: Live status updates and progress tracking
- Batch Operations: Process multiple APKs with consistent settings
- Export Options: Flexible output configuration for different use cases
Dex2C follows Clean Architecture principles with a focus on maintainability and testability:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Presentation │ │ Domain │ │ Data │
│ │ │ │ │ │
│ • Compose UI │◄──►│ • Use Cases │◄──►│ • Repository │
│ • ViewModels │ │ • Business Logic│ │ • API Service │
│ • Navigation │ │ • Entities │ │ • Local DB │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Language: 100% Kotlin
- UI: Jetpack Compose + Material 3
- Architecture: MVVM + Clean Architecture
- DI: Hilt (Dagger)
- Database: Room (SQLite)
- Networking: Retrofit + OkHttp
- Navigation: Navigation Compose
- Background: Work Manager
- Android Studio Hedgehog (2023.1.1) or later
- JDK 11 or later
- Android SDK 24+ (Android 7.0+)
- Kotlin 2.0.21+
-
Clone the repository
git clone https://github.com/springmusk026/dex2c-android.git cd dex2c-android -
Open in Android Studio
# Android Studio will automatically sync the project # Ensure you have the latest Android SDK and build tools
-
Configure API Endpoint
// app/src/main/java/com/musk/dex2c/di/NetworkModule.kt private const val BASE_URL = "https://your-api-endpoint.com/"
-
Build and Run
./gradlew assembleDebug # Or use Android Studio's Run button
# Install dependencies
./gradlew build
# Run tests
./gradlew test
# Generate APK
./gradlew assembleReleaseThe app connects to a Dex2C processing service. Update the base URL in NetworkModule.kt:
private const val BASE_URL = "https://yourweburl.com/"Configure default processing options in ProcessingOptions.kt:
data class ProcessingOptions(
val obfuscate: Boolean? = false, // String obfuscation
val dynamicRegister: Boolean? = false, // Dynamic register natives
val skipSynthetic: Boolean? = false, // Skip synthetic methods
val noBuild: Boolean? = false, // Disable build process
val forceKeepLibs: Boolean? = false, // Force keep libraries
val disableSigning: Boolean? = false // Disable APK signing
)-
Select APK File
- Tap "Select APK File" to choose your Android application
- Supported formats:
.apkfiles
-
Configure Processing Options
- Enable/disable obfuscation and compilation options
- Set custom loader classes and output directories
- Configure advanced processing parameters
-
Build Protection Filters (Optional)
- Use the Filter Builder to create custom protection rules
- Analyze APK contents to identify critical methods
- Set up whitelist/blacklist rules for specific protection
-
Process APK
- Tap "Process APK" to start the conversion
- Monitor real-time progress and status updates
- Download results when processing completes
Create sophisticated protection rules:
// Example filter rules
"com.example.app/MainActivity;onCreate" // Protect specific method
"com.example.app/.*;.*" // Protect entire package
".*;onCreate" // Protect method across all classes- Hierarchical View: Package → Class → Method tree structure
- Method Signatures: Full method signature analysis
- Selection Tools: Multi-select packages, classes, and methods
- Filter Generation: Automatic filter rule generation from selections
- Job Tracking: Complete history of all processing jobs
- Status Monitoring: Real-time status updates (PENDING → PROCESSING → COMPLETED)
- File Management: Track input/output file sizes and processing time
- Error Handling: Detailed error reporting and retry mechanisms
./gradlew test./gradlew connectedAndroidTest./gradlew jacocoTestReport
# View report: app/build/reports/jacoco/jacocoTestReport/html/index.html// Compose
implementation(platform("androidx.compose:compose-bom:2024.09.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
// Architecture
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.4")
implementation("androidx.navigation:navigation-compose:2.8.0")
// Dependency Injection
implementation("com.google.dagger:hilt-android:2.51")
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
// Networking
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
// Database
implementation("androidx.room:room-runtime:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")
// APK Analysis
implementation("org.smali:dexlib2:2.5.2")<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />- Secure File Handling: Temporary files are automatically cleaned up
- Input Validation: Comprehensive validation for uploaded files
- Error Handling: Secure error messages without exposing sensitive data
- Network Security: HTTPS-only communication with proper certificate validation
- Memory Management: Efficient image loading and state management
- Network Optimization: Extended timeouts for large file processing (up to 20 minutes)
- UI Performance: Lazy loading and smooth animations
- Background Processing: Work Manager for reliable background operations
- APK Processing: Supports APKs up to 500MB
- Filter Analysis: Handles 10,000+ methods efficiently
- Memory Usage: Optimized for devices with 2GB+ RAM
- Battery Life: Efficient background processing with minimal battery impact
We welcome contributions! I'm not a super developer, so bugs and problems can always be there. If you find something, please help to fix it and don't be an asshole about it. Let's build this together!
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow Kotlin Coding Conventions
- Use ktlint for code formatting
- Write comprehensive tests for new features
- Update documentation for API changes
Found a bug? Please report it! I appreciate constructive feedback and help in fixing issues. Remember, we're all learning and improving together.
This project is licensed under the MIT License - see the LICENSE file for details.
- Android Team for the amazing Jetpack Compose framework
- Material Design team for the beautiful Material 3 design system
- Dexlib2 contributors for the excellent DEX file analysis library
- Open Source Community for the incredible tools and libraries
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Developer Channel: Telegram - Layout_musk
- Developer Profile: GitHub - springmusk026
- Backend Service: dex2c-backend
- Developer Portfolio: Basanta Sapkota