apply plugin: "com.bytedance.android.aabResGuard"
aabResGuard {
    enableObfuscate = true
    mappingFile = file("mapping.txt").toPath() // 用于增量混淆的 mapping 文件
    whiteList = [
            // keep resource file
            "*/res/raw*",

            // Google Service
            "*.R.string.google_app_id",
            "*.R.string.gcm_defaultSenderId",
            "*.R.string.default_web_client_id",
            "*.R.string.ga_trackingId",
            "*.R.string.firebase_database_url",
            "*.R.string.google_storage_bucket",
            "*.R.string.google_api_key",
            "*.R.string.google_crash_reporting_api_key",
            "*.R.string.fcm_fallback_notification_channel",

            // firebase
            "*.R.string.project_id",

            // app relative with getIdentifier
            "*.R.dimen.navigation_bar_height",
            "*.R.raw.youtube_auth_config",
            "*.R.dimen.status_bar_height_large",
            "*.R.dimen.status_bar_height",
            "*.R.style.BaseSkinTheme.*",
            "*.R.style.DefaultSkinTheme.*",
            "*.R.attr.*",

            "*.R.bool.config_showNavigationBar",
            "*.R.string.config_mainBuiltInDisplayCutout",
            "*.R.drawable.config_mainBuiltInDisplayCutout",
            "*.R.string.com.twitter.sdk.android.CONSUMER_KEY",
            "*.R.string.com.twitter.sdk.android.CONSUMER_SECRET",
            "*.R.integer.com_vk_sdk_AppId",
            "*.R.string.com_vk_sdk_ApiVersion",

            "*.R.bool.*",
            //国家
            "*.R.string.[A-Z][A-Z]",

            "*.R.raw.*",

            //避免获取View的id的名称不正确
            "*.R.id.*",
    ]
    obfuscatedBundleFileName = "duplicated-app.aab" // 混淆后的文件名称，必须以 `.aab` 结尾
    mergeDuplicatedRes = true // 开启去除重复资源
    enableFilterFiles = false // 关闭过滤文件
    filterList = [ // 文件过滤规则
//                   "*/arm64-v8a/*",
//                   "META-INF/*"
    ]
    enableFilterStrings = false // 过滤文案
    unusedStringPath = file("unused.txt").toPath() // 过滤文案列表路径 默认在mapping同目录查找
//    languageWhiteList = ["en", "zh"] // 关闭语言白名单
}

