增加资源混淆

This commit is contained in:
zu
2023-11-29 10:02:54 +08:00
parent ef1c12d14b
commit 03a101d8f7
4 changed files with 27 additions and 12 deletions

View File

View File

@@ -3,6 +3,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'com.tencent.vasdolly'
apply from: '../project.gradle'
apply plugin: "com.bytedance.android.aabResGuard"
apply plugin: "xml-class-guard"
android {
@@ -317,21 +318,30 @@ channel {
lowMemory = false
}
aabResGuard {
mappingFile = file("aab-res-guard-mapping.txt").toPath() // Mapping file used for incremental obfuscation
whiteList = [ // White list rules
"*.R.raw.*",
"*.R.drawable.icon"
]
obfuscatedBundleFileName = "duplicated-app.aab" // Obfuscated file name, must end with '.aab'
mergeDuplicatedRes = true // Whether to allow the merge of duplicate resources
enableFilterFiles = true // Whether to allow filter files
filterList = [ // file filter rules
"*/arm64-v8a/*",
"META-INF/*"
]
enableFilterStrings = false // switch of filter strings
unusedStringPath = file("unused.txt").toPath() // strings will be filtered in this file
languageWhiteList = ["en", "zh"] // keep en,en-xx,zh,zh-xx etc. remove others.
}
//以下均为非必须
xmlClassGuard {
/*
* 是否查找约束布局的constraint_referenced_ids属性的值并添加到AabResGuard的白名单中
* 是的话要求你在XmlClassGuard前依赖AabResGuard插件默认false
*/
findAabConstraintReferencedIds = false
/*
* 是否查找约束布局的constraint_referenced_ids属性的值并添加到AndResGuard的白名单中
* 是的话要求你在XmlClassGuard前依赖AndResGuard插件默认false
*/
findAndConstraintReferencedIds = false
findAabConstraintReferencedIds = true
//用于增量混淆的 mapping 文件
mappingFile = file("xml-class-mapping.txt")
//更改manifest文件的package属性即包名
packageChange = ["com.chwl.app": "com.chwl.app"]
packageChange = ["com.chwl.app": "co.ch.a"]
}

View File

@@ -0,0 +1,2 @@
class mapping:
baaabaffdafcee.BaseZoomableImageView -> q.UII

View File

@@ -10,10 +10,12 @@ buildscript {
repositories {
mavenCentral()
jcenter()
google()
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://jitpack.io' }
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://raw.githubusercontent.com/martinloren/AabResGuard/mvn-repo' }
}
dependencies {
@@ -26,6 +28,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.tencent.vasdolly:plugin:3.0.3'
classpath "com.bytedance.android:aabresguard-plugin:0.1.10"
classpath "com.github.liujingxing:XmlClassGuard:1.2.6"
}
}