增加资源混淆
This commit is contained in:
0
app/aab-res-guard-mapping.txt
Normal file
0
app/aab-res-guard-mapping.txt
Normal 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"]
|
||||
}
|
2
app/xml-class-mapping.txt
Normal file
2
app/xml-class-mapping.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
class mapping:
|
||||
baaabaffdafcee.BaseZoomableImageView -> q.UII
|
@@ -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"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user