Dex2C-Android — springmusk.dev

README.md files (69)

// project

Dex2C-Android

Dex2C Android is the client application for the Dex2C ecosystem

25 stars 17 forks Watching: 25 Open issues: 0
  • Kotlin
  • Updated Oct 9, 2025

Built for learning and research.

Open on GitHub

Dex2C Android

Transform Android APKs into C++ code with advanced compilation techniques

Android Kotlin Compose License

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

Features

Core Functionality

  • 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

Developer Experience

  • 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

Architecture

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      │
└─────────────────┘    └─────────────────┘    └─────────────────┘

Tech Stack

  • 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

Getting Started

Prerequisites

  • Android Studio Hedgehog (2023.1.1) or later
  • JDK 11 or later
  • Android SDK 24+ (Android 7.0+)
  • Kotlin 2.0.21+

Installation

  1. Clone the repository

    git clone https://github.com/springmusk026/dex2c-android.git
    cd dex2c-android
  2. Open in Android Studio

    # Android Studio will automatically sync the project
    # Ensure you have the latest Android SDK and build tools
  3. Configure API Endpoint

    // app/src/main/java/com/musk/dex2c/di/NetworkModule.kt
    private const val BASE_URL = "https://your-api-endpoint.com/"
  4. Build and Run

    ./gradlew assembleDebug
    # Or use Android Studio's Run button

Development Setup

# Install dependencies
./gradlew build

# Run tests
./gradlew test

# Generate APK
./gradlew assembleRelease

Configuration

API Configuration

The app connects to a Dex2C processing service. Update the base URL in NetworkModule.kt:

private const val BASE_URL = "https://yourweburl.com/"

Processing Options

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
)

Usage

Basic Workflow

  1. Select APK File

    • Tap "Select APK File" to choose your Android application
    • Supported formats: .apk files
  2. Configure Processing Options

    • Enable/disable obfuscation and compilation options
    • Set custom loader classes and output directories
    • Configure advanced processing parameters
  3. 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
  4. Process APK

    • Tap "Process APK" to start the conversion
    • Monitor real-time progress and status updates
    • Download results when processing completes

Advanced Features

Filter Builder

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

APK Analysis

  • 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

Processing History

  • 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

Testing

Unit Tests

./gradlew test

UI Tests

./gradlew connectedAndroidTest

Test Coverage

./gradlew jacocoTestReport
# View report: app/build/reports/jacoco/jacocoTestReport/html/index.html

Dependencies

Core Dependencies

// 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")

Security

Permissions

<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" />

Data Protection

  • 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

Performance

Optimizations

  • 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

Benchmarks

  • 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

Contributing

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!

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Code Style

Bug Reports

Found a bug? Please report it! I appreciate constructive feedback and help in fixing issues. Remember, we're all learning and improving together.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • 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

Support

Related Projects


Built with ❤️ by [Basanta Sapkota](https://github.com/springmusk026)

⬆️ Back to Top

main Kotlin 25 Updated Oct 9, 2025 Built for learning and research.

AndroidScreenshot

A simple project to capture screehshot

  • Kotlin

Jetpack-Compose-BottomNavigation

This Jetpack Compose Bottom Navigation project demonstrates the implementation of a modern and intuitive bottom navigation bar for Android apps

  • Kotlin

vApp-Inject

vApp-Inject is a Virtual Box application project designed to provide users with the ability to run Android games and apps independently within it. It offers a seamless environment for running Android applications on various platforms.

  • Kotlin
26 13 project