同步hiyoo混淆配置:增加aabResGuard与xml-class-guard依赖

This commit is contained in:
Max
2024-01-07 10:14:19 +08:00
parent f4811c9fe5
commit 463d9ec4b4
4 changed files with 35 additions and 1 deletions

View File

View File

@@ -4,7 +4,8 @@ apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-android'
apply plugin: 'com.tencent.vasdolly'
apply from: '../mob.gradle'
apply plugin: "com.bytedance.android.aabResGuard"
apply plugin: "xml-class-guard"
def onlyArm64 = Boolean.parseBoolean(only_arm64)
android {
@@ -319,3 +320,31 @@ channel {
//低内存模式仅针对V2签名默认为false只把签名块、中央目录和EOCD读取到内存不把最大头的内容块读取到内存在手机上合成APK时可以使用该模式
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 = false // 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 {
findAabConstraintReferencedIds = true
//用于增量混淆的 mapping 文件
mappingFile = file("xml-class-mapping.txt")
//更改manifest文件的package属性即包名
packageChange = ["com.yizhuan.erban": "com.c.r"]
}

View File

@@ -10,11 +10,13 @@ buildscript {
repositories {
mavenCentral()
jcenter()
google()
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://jitpack.io' }
maven { url "https://mvn.mob.com/android" }
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://raw.githubusercontent.com/martinloren/AabResGuard/mvn-repo' }
}
dependencies {
@@ -27,6 +29,8 @@ buildscript {
classpath "com.mob.sdk:MobSDK:2018.0319.1724"
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath "com.bytedance.android:aabresguard-plugin:0.1.10"
classpath "com.github.liujingxing:XmlClassGuard:1.2.6"
}
}

1
xml-class-mapping.txt Normal file
View File

@@ -0,0 +1 @@
class mapping: