Dex2C-Tool — springmusk.dev

README.md files (2)

// project

Dex2C-Tool

Convert Android DEX bytecode to native C/C++ — protect your app's logic from reverse engineering.

12 stars 0 forks Watching: 12 Open issues: 0

Built for learning and research.

Open on GitHub

Dex2C Tool

An Android application for converting DEX bytecode to native C/C++ code, providing binary-level protection against reverse engineering. Built on top of the dex2c and dcc open-source protection engines.

Overview

Dex2C Tool runs the full DEX-to-native compilation pipeline on-device via an embedded Termux environment. No desktop toolchain is required — setup, compilation, and APK re-signing are handled automatically within the app.

Features

  • DEX → Native compilation — Converts selected methods to native C code compiled with the Android NDK.
  • APK browser — Parses APK files and displays packages, classes, and methods in a navigable trie structure.
  • Race-safe APK parsing — Selecting a new APK cancels any in-flight parse so the class browser never shows stale results.
  • Robust APK import — Case-insensitive .apk extension handling (e.g. .APK) and clearer errors when the selected file cannot be opened.
  • Filter rule builder — Whitelist or blacklist specific classes and packages using pattern-based rules.
  • Advanced build options — String obfuscation, dynamic JNI registration, synthetic method skipping, custom loaders (defaults to com.musk.Security), and project archives.
  • Offline-friendly dependency checks — Verifies required Python imports before attempting pip install.
  • NDK + Java detection — Correct NDK root detection and accepts both java and java17.
  • Graceful cancellation + cleanup — Cancelling a run stops underlying processes and is not persisted as a failed history entry.
  • Output hygiene — Deletes any existing output target before running and only records an output path if the output APK exists.
  • Deterministic environment — Sets locale defaults (LANG/LC_ALL) for consistent tooling behavior.
  • Resource monitor — Real-time CPU, RAM, and disk usage during protection runs.
  • Protection history — Persistent log of all prior protection runs with detailed output.
  • Theming — Dark, light, and AMOLED modes with six accent colors. Preferences persist across sessions.
  • Remote configuration — Feature flags, version management, announcements, maintenance mode, and in-app self-update, controlled via a hosted JSON configuration file.
  • In-app self-update — Downloads and installs updates directly within the app with progress tracking.
  • Rate limiting — Configurable daily operation limits controlled remotely.
  • Kill switch — Remote version-level app disabling for deprecated releases.
  • Integrity protection — Runtime signing certificate verification and obfuscated configuration URL to prevent tampering.

Requirements

  • Android 7.0 (API 24) or higher
  • Approximately 500 MB of storage for the toolchain (Python, NDK, dependencies)

Installation

  1. Launch Dex2C Tool and follow the setup flow. The app bootstraps the built-in Termux environment, installs Python, the Android NDK, and all required dependencies automatically.
  2. Once setup completes, the main protection screen is available.

No manual terminal commands are required.

Usage

  1. Navigate to the Protect screen.
  2. Select an APK file.
  3. Optionally configure filter rules to target specific classes or packages.
  4. Optionally adjust advanced build options.
  5. Tap Protect APK to begin the conversion.
  6. Share or export the protected APK from the result card.

Filter Rule Syntax

Pattern Description
com/example/app;.* Protect all methods in a class
com/example/.*;.* Protect all classes in a package
.*;onCreate(.* Protect onCreate in every class
!com/example/;.* Exclude a class from protection

Architecture

  • Language: Kotlin
  • UI: Jetpack Compose with Material 3
  • Dependency injection: Hilt
  • Database: Room
  • Navigation: Navigation Compose
  • Preferences: DataStore
  • Image loading: Coil
  • JSON parsing: Gson
  • APK analysis: apk-parser

Remote Configuration

The app fetches a JSON configuration file from a remote endpoint on each launch. This enables:

  • Version checks and forced update enforcement
  • Maintenance mode activation
  • Feature flag toggling
  • Announcement banners and launch sheets
  • Device-level and version-level blocking
  • Daily rate limiting for protection operations
  • In-app changelog, tips, promo banners, feedback prompts, and surveys

See data.json for the configuration schema.

Open Source Acknowledgements

This project depends on the following open-source libraries:

Library License
dex2c Apache 2.0
dcc Apache 2.0
androguard Apache 2.0
Jetpack Compose Apache 2.0
Hilt Apache 2.0
Room Apache 2.0
Navigation Compose Apache 2.0
DataStore Apache 2.0
Coil Apache 2.0
Gson Apache 2.0
apk-parser BSD 2-Clause
Kotlin Apache 2.0
Kotlin Coroutines Apache 2.0
Material Icons Extended Apache 2.0

Full license details are available in the app under Settings → Open Source Licenses.

Developer

GitHub @springmusk026
Telegram @springmusk
Channel @Layout_musk

License

Copyright 2026 Spring Musk

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
main 12 Updated Mar 26, 2026 Built for learning and research.

UnityRenderer

Educational project demonstrating IL2CPP runtime interaction from native C++ on Android

  • C++
10 5 project

AntiBloater

Antibloater is an Android application designed to streamline the process of removing bloatware apps from your device. It establishes a local ADB connection to execute commands selected by users for removing unwanted pre-installed apps.

  • Kotlin

Open-Monitor-YT

Open Monitor YT is a self-hostable, fully open-source YouTube competitive intelligence platform

  • TypeScript