feat: 移除 andResGuard
This commit is contained in:
@ -44,5 +44,4 @@
|
|||||||
|
|
||||||
### 混淆配置
|
### 混淆配置
|
||||||
|
|
||||||
* 本项目使用了微信的 [AndResGuard](https://github.com/shwenzhang/AndResGuard) 作为资源混淆压缩方案,新增需要使用 `getIdentifier` 获取的资源文件时需要添加至白名单
|
|
||||||
* 本项目默认使用 R8 作为混淆工具,往 proguard-rules.txt 添加 proguard 新配置项时请检查可用性(如语法等)
|
* 本项目默认使用 R8 作为混淆工具,往 proguard-rules.txt 添加 proguard 新配置项时请检查可用性(如语法等)
|
||||||
|
|||||||
117
app/build.gradle
117
app/build.gradle
@ -3,7 +3,6 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: 'kotlin-android' // kotlin
|
apply plugin: 'kotlin-android' // kotlin
|
||||||
apply plugin: 'kotlin-parcelize'
|
apply plugin: 'kotlin-parcelize'
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
apply plugin: 'AndResGuard'
|
|
||||||
|
|
||||||
import groovy.xml.XmlUtil
|
import groovy.xml.XmlUtil
|
||||||
|
|
||||||
@ -529,122 +528,6 @@ if (propFile.exists()) {
|
|||||||
// }.each { t -> t.dependsOn generateMetaJson }
|
// }.each { t -> t.dependsOn generateMetaJson }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
andResGuard {
|
|
||||||
mappingFile = null
|
|
||||||
use7zip = true
|
|
||||||
useSign = true
|
|
||||||
// 打开这个开关,会keep住所有资源的原始路径,只混淆资源的名字
|
|
||||||
keepRoot = false
|
|
||||||
// 设置这个值,会把arsc name列混淆成相同的名字,减少string常量池的大小
|
|
||||||
fixedResName = "arg"
|
|
||||||
// 打开这个开关会合并所有哈希值相同的资源,但请不要过度依赖这个功能去除去冗余资源
|
|
||||||
mergeDuplicatedRes = true
|
|
||||||
whiteList = [
|
|
||||||
"R.xml.jpush*",
|
|
||||||
"R.drawable.jpush*",
|
|
||||||
"R.layout.jpush*",
|
|
||||||
"R.layout.push*",
|
|
||||||
"R.string.jg*",
|
|
||||||
"R.style.MyDialogStyle",
|
|
||||||
"R.style.JPushTheme",
|
|
||||||
"R.drawable.icon",
|
|
||||||
"R.drawable.ic_bar_back",
|
|
||||||
"R.drawable.toolbar_search_icon",
|
|
||||||
"R.drawable.bg_notification_answer_style_1",
|
|
||||||
"R.drawable.bg_notification_answer_style_2",
|
|
||||||
"R.drawable.bg_notification_article_style_1",
|
|
||||||
"R.drawable.bg_notification_article_style_2",
|
|
||||||
"R.drawable.bg_notification_feedback_style_1",
|
|
||||||
"R.drawable.bg_notification_feedback_style_2",
|
|
||||||
"R.drawable.bg_notification_gift_style_1",
|
|
||||||
"R.drawable.bg_notification_gift_style_2",
|
|
||||||
"R.drawable.bg_notification_login_style_1",
|
|
||||||
"R.drawable.bg_notification_login_style_2",
|
|
||||||
"R.drawable.bg_notification_question_style_1",
|
|
||||||
"R.drawable.bg_notification_question_style_2",
|
|
||||||
"R.drawable.bg_notification_rating_style_1",
|
|
||||||
"R.drawable.bg_notification_rating_style_2",
|
|
||||||
"R.drawable.bg_notification_reserve_game_style_1",
|
|
||||||
"R.drawable.bg_notification_reserve_game_style_2",
|
|
||||||
"R.drawable.bg_notification_video_style_1",
|
|
||||||
"R.drawable.bg_notification_video_style_2",
|
|
||||||
"R.drawable.ic_recommend_activity",
|
|
||||||
"R.drawable.ic_recommend_discount",
|
|
||||||
"R.drawable.ic_recommend_function",
|
|
||||||
"R.drawable.ic_recommend_gift",
|
|
||||||
"R.drawable.ic_recommend_role",
|
|
||||||
"R.drawable.download_button_normal_style",
|
|
||||||
"R.drawable.ic_selector_selected",
|
|
||||||
"R.drawable.ic_selector_default",
|
|
||||||
"R.id.download_speed",
|
|
||||||
"R.id.download_percentage",
|
|
||||||
"R.id.comment",
|
|
||||||
"R.id.vote",
|
|
||||||
"R.id.watermark_hint",
|
|
||||||
"R.id.watermark_sb",
|
|
||||||
"R.id.bottomShareIv",
|
|
||||||
"R.id.bottomShareTv",
|
|
||||||
"R.id.recommendStarPref",
|
|
||||||
"R.id.recommendStar",
|
|
||||||
"R.id.iv_vmode_badge",
|
|
||||||
"R.id.tv_vmode",
|
|
||||||
"R.id.iv_vmode",
|
|
||||||
"R.drawable.help_search_delete",
|
|
||||||
"R.drawable.suggest_type_normal",
|
|
||||||
"R.drawable.suggest_type_crash",
|
|
||||||
"R.drawable.suggest_type_game_question",
|
|
||||||
"R.drawable.suggest_type_game_collect",
|
|
||||||
"R.drawable.suggest_type_function_suggest",
|
|
||||||
"R.drawable.suggest_type_article_collect",
|
|
||||||
"R.drawable.suggest_type_copyright",
|
|
||||||
"R.drawable.news_comment_detail_read",
|
|
||||||
"R.drawable.news_comment_detail_comment",
|
|
||||||
"R.drawable.news_comment_detail_share",
|
|
||||||
"R.drawable.ic_libao",
|
|
||||||
"R.drawable.ic_link",
|
|
||||||
"R.drawable.concern_message_icon",
|
|
||||||
"R.drawable.reuse_blank_hint",
|
|
||||||
"R.drawable.ic_concern",
|
|
||||||
"R.drawable.concern_down",
|
|
||||||
"R.drawable.concern_up",
|
|
||||||
"R.drawable.ic_libao_more",
|
|
||||||
"R.drawable.ic_libao_delete",
|
|
||||||
"R.drawable.ic_dialog_close",
|
|
||||||
"R.drawable.occupy2",
|
|
||||||
"R.drawable.kc_checkbox_unselect",
|
|
||||||
"R.drawable.kc_checkbox_select",
|
|
||||||
"R.drawable.ic_type_unselect",
|
|
||||||
"R.drawable.ic_type_selected",
|
|
||||||
"R.drawable.suggest_add_pic_icon",
|
|
||||||
"R.drawable.icon_pic_add",
|
|
||||||
"R.drawable.ask_search_input_delete",
|
|
||||||
"R.drawable.suggest_pic_delete",
|
|
||||||
"R.id.cardIv",
|
|
||||||
"R.id.cardMask",
|
|
||||||
"R.id.cardGradientMask",
|
|
||||||
"R.id.gameIconIv",
|
|
||||||
"R.id.titleContainer",
|
|
||||||
"R.id.v_login_background",
|
|
||||||
"R.id.tv_login_tips",
|
|
||||||
"R.id.tv_login",
|
|
||||||
"R.id.v_code_background",
|
|
||||||
"R.id.tv_code_tips",
|
|
||||||
"R.id.tv_code",
|
|
||||||
"R.id.tv_copy",
|
|
||||||
"R.id.v_indicator_background",
|
|
||||||
"R.id.v_indicator"
|
|
||||||
]
|
|
||||||
compressFilePattern = [
|
|
||||||
"*.png",
|
|
||||||
"*.jpg",
|
|
||||||
"*.jpeg",
|
|
||||||
"*.gif",
|
|
||||||
]
|
|
||||||
sevenzip {
|
|
||||||
artifact = 'io.github.leon406:SevenZip:1.2.22.5'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project.afterEvaluate {
|
project.afterEvaluate {
|
||||||
def variants = null
|
def variants = null
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -24,8 +24,6 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
classpath "com.android.tools.build:gradle:7.1.3"
|
classpath "com.android.tools.build:gradle:7.1.3"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
// 使用了 1.2.21 在蓝叠模拟器上无法进入首页? 但是不使用又会出现触发 V3 签名...
|
|
||||||
classpath 'io.github.leon406:AndResGuard-gradle-plugin:1.2.23'
|
|
||||||
classpath 'com.sensorsdata.analytics.android:android-gradle-plugin2:3.5.3'
|
classpath 'com.sensorsdata.analytics.android:android-gradle-plugin2:3.5.3'
|
||||||
classpath "com.lg.shadow.core:gradle-plugin:$shadow_version"
|
classpath "com.lg.shadow.core:gradle-plugin:$shadow_version"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
./gradlew resguardInternal${BUILD_VARIANT_REGION^}Release -I ${post_init_script} -PBUILD_PUSH_TYPE=${BUILD_PUSH_TYPE}
|
./gradlew assembleInternal${BUILD_VARIANT_REGION^}Release -I ${post_init_script} -PBUILD_PUSH_TYPE=${BUILD_PUSH_TYPE}
|
||||||
mv app/build/outputs/apk/internal${BUILD_VARIANT_REGION^}/release/app-internal-${BUILD_VARIANT_REGION}-release.apk app/build/tmp/${version}-${versionCode}-test-${build_time}.apk
|
mv app/build/outputs/apk/internal${BUILD_VARIANT_REGION^}/release/app-internal-${BUILD_VARIANT_REGION}-release.apk app/build/tmp/${version}-${versionCode}-test-${build_time}.apk
|
||||||
|
|
||||||
git checkout app/build.gradle
|
git checkout app/build.gradle
|
||||||
|
|||||||
Reference in New Issue
Block a user