Skip to content

xiaoyvyv/android-dx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

android-dx

Android build-tools中dx.jar的源码,版本v1.16。已修改,可以直接引入Adnroid Studio Project用来在Android上面编译dex文件。

安装

Download Jar File

示例

        // class文件夹,或者单个class文件,或者jar
        String classFolder = "/storage/emulated/0/Android/data/com.xiaoyv.myapplication/files/build/";
        
        // 转换命令
        String[] dexCmd = new String[]{
                "--dex",
                "--verbose",
                "--no-strict",
                "--no-files",
                "--min-sdk-version=26",
                "--output=/storage/emulated/0/Android/data/com.xiaoyv.myapplication/files/dex/",
                classFolder
        };

        // 开始转换dex
        try {
            com.xiaoyv.dx.command.Main.main(dexCmd);
        } catch (Exception e) {
            e.printStackTrace();
        }

反馈

QQEmail:[email protected]