├── Demo ├── demo-normal.apk ├── demo-ollvm.apk └── release.md ├── README.md ├── README_en.md ├── image.webp ├── image2.webp └── termux-ndk.sh /Demo/demo-normal.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Party233/DexVMP/ce8d72ac38f93dfa4db3d5fa0872f98dc0d125a8/Demo/demo-normal.apk -------------------------------------------------------------------------------- /Demo/demo-ollvm.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Party233/DexVMP/ce8d72ac38f93dfa4db3d5fa0872f98dc0d125a8/Demo/demo-ollvm.apk -------------------------------------------------------------------------------- /Demo/release.md: -------------------------------------------------------------------------------- 1 | The above two samples 2 | -normal random string encryption 3 | -ollvm added ollvm obfuscation -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DexVMP 2 | 3 | [English](README_en.md) 4 | 5 | 基于dex-vm运行dalvik字节码从而对dex进行保护,增加反编译难度。 6 | 7 | ## 修改说明: 8 | 9 | 以下是一些简单的修改说明(没啥特别的主要方便): 10 | 11 | ### 1. 合并vm库 12 | 13 | ### 2. 添加ollvm混淆 14 | 15 | ### 3. 随机字符串加密 16 | 17 | ### 4. 自定义vm类名 18 | 19 | ### 5. 自定义vm库名 20 | 21 | ### 6. 自定义vm注册名 22 | 23 | ### 7. 支持synthetic方法保护 24 | 25 | ### Termux一键安装NDK(支持ollvm)[r25c](https://github.com/Party233/DexVMP/releases/tag/android-ndk-r25c-ollvm): 26 | ``` 27 | cd && pkg upgrade && pkg install wget && wget https://github.com/Party233/DexVMP/raw/master/termux-ndk.sh --no-verbose --show-progress -N && chmod +x termux-ndk.sh && bash termux-ndk.sh 28 | ``` 29 | 30 | ### 设置NDK和环境变量(可自行配置) 31 | 32 | ```bash 33 | export SDK_PATH=/data/user/0/com.termux/files/home/android-sdk 34 | export NDK_PATH=/data/user/0/com.termux/files/home/android-sdk/ndk/25.2.9519653 35 | export CMAKE_PATH=/data/user/0/com.termux/files/home/android-sdk/cmake/3.22.1 36 | ``` 37 | 38 | ### 运行脚本(Termux) 39 | ![](image.webp) 40 | ``` bash 41 | bash start-vm.sh 42 | ``` 43 | ![](image2.webp) 44 | ### 手动执行 45 | 46 | ``` bash 47 | java -jar vm-protect.jar apk input.apk convertRules.txt mapping.txt 48 | ``` 49 | 50 | ## 项目来源 51 | 52 | 本项目源自[nmmp](https://github.com/maoabc/nmmp) 53 | 54 | --- 55 | -------------------------------------------------------------------------------- /README_en.md: -------------------------------------------------------------------------------- 1 | # DexVMP 2 | 3 | Run dalvik bytecode based on dex-vm to protect dex 4 | 5 | ## Modification Instructions 6 | 7 | Below are the steps to modify and enhance the DexVMP: 8 | 9 | ### 1. Merge VM Library 10 | Combine the VM library. 11 | 12 | ### 2. Random String Encryption 13 | Apply random string encryption to obfuscate the code. 14 | 15 | ### 3. Custom VM Class Name 16 | Specify a custom class name for the VM. 17 | 18 | ### 4. Custom VM Library Name 19 | Define a custom name for the VM library. 20 | 21 | ### 5. Customized VM Registration Name 22 | Set a custom registration name for the VM. 23 | 24 | ### 6. Support Synthetic Method Protection 25 | Enable protection for synthetic methods. 26 | 27 | ## Configuration 28 | 29 | ### Termux command Install NDK [r25c](https://github.com/Party233/DexVMP/releases/tag/android-ndk-r25c-ollvm): 30 | ``` 31 | cd && pkg upgrade && pkg install wget && wget https://github.com/Party233/DexVMP/raw/master/termux-ndk.sh --no-verbose --show-progress -N && chmod +x termux-ndk.sh && bash termux-ndk.sh 32 | ``` 33 | 34 | ### Set up NDK and Environment Variables 35 | 36 | ```bash 37 | export SDK_PATH=/data/user/0/com.termux/files/home/android-sdk 38 | export NDK_PATH=/data/user/0/com.termux/files/home/android-sdk/ndk/25.2.9519653 39 | export CMAKE_PATH=/data/user/0/com.termux/files/home/android-sdk/cmake/3.22.1 40 | ``` 41 | 42 | ### Start VM Protection(Termux) 43 | ![](image.webp) 44 | ``` bash 45 | bash start-vm.sh 46 | ``` 47 | ![](image2.webp) 48 | ### Console execution. 49 | 50 | ``` bash 51 | java -jar vm-protect.jar apk input.apk convertRules.txt mapping.txt 52 | ``` 53 | 54 | ## Project Source 55 | 56 | This project is forked from [nmmp](https://github.com/maoabc/nmmp) 57 | 58 | --- 59 | -------------------------------------------------------------------------------- /image.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Party233/DexVMP/ce8d72ac38f93dfa4db3d5fa0872f98dc0d125a8/image.webp -------------------------------------------------------------------------------- /image2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Party233/DexVMP/ce8d72ac38f93dfa4db3d5fa0872f98dc0d125a8/image2.webp -------------------------------------------------------------------------------- /termux-ndk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | install_dir=$HOME 4 | sdk_dir=$install_dir/android-sdk 5 | cmake_dir=$sdk_dir/cmake 6 | ndk_dir="$sdk_dir/ndk" 7 | ndk_file_name="ollvm_ndk_r25c.tar.xz" 8 | ndk_url="https://ghproxy.net/https://github.com/Party233/DexVMP/releases/download/android-ndk-r25c-ollvm/$ndk_file_name" 9 | ndk_installed=false 10 | cmake_installed=false 11 | 12 | run_install_cmake() { 13 | download_cmake 3.10.2 14 | download_cmake 3.18.1 15 | download_cmake 3.22.1 16 | download_cmake 3.25.1 17 | } 18 | 19 | download_cmake() { 20 | cmake_version=$1 21 | cmake_path="$cmake_dir/$cmake_version" 22 | 23 | if [ -d "$cmake_path" ]; then 24 | echo "CMake $cmake_version 已存在,正在删除旧版本..." 25 | rm -rf "$cmake_path" 26 | fi 27 | 28 | echo "正在下载 CMake $cmake_version..." 29 | wget https://ghproxy.net/https://github.com/MrIkso/AndroidIDE-NDK/releases/download/cmake/cmake-"$cmake_version"-android-aarch64.zip --no-verbose --show-progress -N 30 | installing_cmake "$cmake_version" 31 | } 32 | 33 | installing_cmake() { 34 | cmake_version=$1 35 | cmake_file=cmake-"$cmake_version"-android-aarch64.zip 36 | 37 | if [ -f "$cmake_file" ]; then 38 | echo "正在解压 CMake $cmake_version..." 39 | unzip -qq "$cmake_file" -d "$cmake_dir" 40 | rm "$cmake_file" 41 | chmod -R +x "$cmake_dir"/"$cmake_version"/bin 42 | cmake_installed=true 43 | echo "CMake $cmake_version 安装完成!" 44 | else 45 | echo "错误: 找不到 $cmake_file 文件" 46 | fi 47 | } 48 | 49 | install_ndk() { 50 | echo "正在下载 NDK..." 51 | wget "$ndk_url" --no-verbose --show-progress -N 52 | 53 | if [ -f "$ndk_file_name" ]; then 54 | echo "正在解压 NDK..." 55 | mkdir -p "$ndk_dir" 56 | tar -xf "$ndk_file_name" -C "$ndk_dir" 57 | rm "$ndk_file_name" 58 | ndk_installed=true 59 | echo "NDK 安装完成!" 60 | else 61 | echo "错误: 下载 $ndk_file_name 失败" 62 | fi 63 | } 64 | 65 | echo "开始安装 NDK 和 CMake..." 66 | install_ndk 67 | 68 | if [ -d "$cmake_dir" ]; then 69 | cd "$cmake_dir" 70 | run_install_cmake 71 | else 72 | mkdir -p "$cmake_dir" 73 | cd "$cmake_dir" 74 | run_install_cmake 75 | fi 76 | 77 | if [[ $ndk_installed == true && $cmake_installed == true ]]; then 78 | echo '安装成功完成!' 79 | else 80 | echo '安装失败: NDK 或 CMake 安装未完成' 81 | if [ $ndk_installed == false ]; then 82 | echo " - NDK 安装失败" 83 | fi 84 | if [ $cmake_installed == false ]; then 85 | echo " - CMake 安装失败" 86 | fi 87 | fi --------------------------------------------------------------------------------