Android 马甲包谷歌市场混淆技术解决方案

访客 217 0
  1. 指定 混淆字典

在应用程序的gradle文件中进行混淆字典的配置

使用外部字典进行混淆的参数为“-obfuscationdictionary dict.txt”。

使用类字典进行类混淆的命令为“-classobfuscationdictionary dict.txt”。

使用字典文件进行包混淆:-packageobfuscationdictionary dict.txt #包字典

dict.txt 文件的内容大致如下:

zguqnx

mvdmuyh

wmws

jwomtp

nhmhn

zvlogo

pomcwh

bhdnzul

osxbj

gojb

ctvkrg

srmar

sgkarnqi

byghdn

tvebtxw

uxdhno

qmjac

pgxasjnc

ezfb

tuoe

pzdo

我完成了一个任务。

/** * 生成字典任务 */ task geneDictTask { doFirst{ def dictPath = rootDir.getAbsolutePath() + '/app/dict.txt' def random = new Random() def lowercase = abcdefghijklmnopqrstuvwxyz def wordList = new HashSet() for (int i=0; i可以进行如下改写: xmlClassGuard {

p style="" /*/p p style=""请问您是否要查找约束布局的constraint_referenced_ids属性的值,并将其添加到AabResGuard的白名单中?/p p style=""如果为true,则需要在XmlClassGuard之前添加AabResGuard插件依赖;默认情况下为false。/p p style="" *//p p style=""// enable the identification of referenced IDs for constraints/p p style="" //用于增量混淆的 mapping 文件/p p style=""将下面这段话改写为更通俗易懂的语言: 将文件名为'xml-class-mapping.txt'的文件赋值给变量'mappingFile'/p p style=""修改manifest文件的package属性,即更改包名。/p p style="" packageChange = ["com.DOTLESS.gala": "com.DOTLESS.gala"]/p p style="" //移动目录/p p style=""修改后的文案如下: moveDir = {'com.DOTLESS.gala': 'com.DOTLESS.gala'}/p p style=""}/p ol start="3"li style="margin-left:1.4em;list-style-type:decimal;text-indent:0;"p批量修改文件名/p/li/ol pre class="kdocs-plaintext"```java ext { //需要批量重命名的Been路径 renameBeenPath = src/main/java/com/DOTLESS/gala/bean //Been对象名字以什么字符串结尾, 默认Been, 例如设为Beax, 则所有Been都会以Beax结尾, 如GoodsBeax.kt beenNameSuffix = Bear //Been名字的前缀, 例如KoGoodsBeen beenPrefix = Ko //Been对象 Been的前面加的字符串 KoGoodsFishBeen beenMidfix = Fish //特殊的被匹配文件列表,如[**/*Bean.kt, **/*Bean.java] specialBeensMatcher = [**/*Bean.kt, **/*Bean.java] } task renameBeenProcessor { doLast { FileTree beenTree = fileTree(renameBeePath) { include '**/*.java' include '**/*.kt' // include specialBeensMatcher } def start = System.currentTimeMillis() println(>>>>>> renameBeeProcessor start) beenTree.each { File beeFile -> def sname = beeFile.name def fileEx = sname.substring(sname.lastIndexOf(.)) sname.replace(fileEx, ) def tName if (sname.endsWith(Bee)) { tName += ${beenPrefix}${sname.replace(Bee, ${beenMidfix}${beenNameSuffix})} } else if (sname.endsWith(Bean)) { tName += ${beenPrefix}${sname.replace(Bean, ${beenMidfix}${beenNameSuffix})} } else { tName += ${beenPrefix}${sname}${beenMidfix}${beenNameSuffix} } beenFile.renameTo(beenFile.parentFile.path + File.separator + tName + fileEx) //生成一个文件树,替换import后面的路径 FileTree processTree = fileTree(src) { include '**/*.java' include '**/*.kt' include '' } } } } ```
androidJunkCode {    def config = {        packageBase = "com.dotless.xthv"        packageCount = 15        activityCountPerPackage = 3        excludeActivityJavaFile = false        otherCountPerPackage = 15        methodCountPerClass = 10        resPrefix = "xthv_"        drawableCount = 10        stringCount = 10    }    variantConfig {        devDebug config  //和productFlavors里的名字一样,注意不能是大写,不然会报错        devRelease config        publishDebug config        publishRelease config    }}

标签: 马甲包 字典 文件 名字

发表评论 (已有0条评论)

还木有评论哦,快来抢沙发吧~