https://github.com/Tencent/matrix/wiki/Matrix-Android-ApkChecker
jar包下载地址:
https://jcenter.bintray.com/com/tencent/matrix/matrix-apk-canary/0.6.5/matrix-apk-canary-0.6.5.jar
创建检测报告的文件位置
其中 --apk , – output ,–rTxt包括清单文件需要替换你自己的;
这是一种没有代码侵入的检测apk包的方式,只需要使用jar包就行。
{ "--apk": "D:/matrix/app-debug.apk", "--mappingTxt": "", "--output": "D:/matrix/result", "--format": "mm.html,mm.json", "--formatConfig": [ { "name": "-countMethod", "group": [ { "name": "Android System", "package": "android" }, { "name": "java system", "package": "java" }, { "name": "com.tencent.test.$", "package": "com.tencent.test.$" } ] } ], "options": [ { "name": "-manifest" }, { "name": "-fileSize", "--min": "5", "--order": "desc", "--suffix": "png, jpg, jpeg, gif, arsc" }, { "name": "-countMethod", "--group": "package" }, { "name": "-checkResProguard" }, { "name": "-findNonAlphaPng", "--min": "5" }, { "name": "-checkMultiLibrary" }, { "name": "-uncompressedFile", "--suffix": "png, jpg, jpeg, gif, arsc" }, { "name": "-countR" }, { "name": "-duplicatedFile" }, { "name": "-unusedResources", "--rTxt": "D:/build/intermediates/compile_symbol_list/debug/R.txt", "--ignoreResources": ["R.raw.*", "R.style.*", "R.attr.*", "R.id.*", "R.string.ignore_*" ] }, { "name": "-unusedAssets", "--ignoreAssets": [ "*.so" ] } ] } 执行检测命令 java -jar D:/matrix/matrix-apk-canary-0.6.5.jar --config D:/matrix/test/apk_config.json