一款分析Dex文件的Gradle插件,在APK打包结束后,输出APK包中的dex文件相关信息: 方法数等。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// 添加依赖
classpath 'com.ximsfei:dexhelper:0.0.1'
}
}
apply plugin: 'com.android.application'
// 应用插件
apply plugin: 'com.ximsfei.dexhelper'
$ ./gradlew assemble -q
DexHelper: apk file -> app-debug.apk
DexHelper: dex file -> classes.dex
DexHelper: method size -> 27022
DexHelper: apk file -> app-release-unsigned.apk
DexHelper: dex file -> classes.dex
DexHelper: method size -> 27021
注: 默认assemble*为assembleDebug或assembleRelease