apply plugin: 'AndResGuard'

andResGuard {
    // mappingFile = file("./resource_mapping.txt")
    mappingFile = null
    //不使用7zip
    use7zip = false
    //使用签名
    useSign = true
    // keep住所有资源的原始路径，只混淆资源的名字，不混淆路径
    keepRoot = true

    whiteList = [
            // your icon
            "R.drawable.icon",
            // for fabric
            "R.string.com.crashlytics.*",
            //FireBase
            "R.string.project_id",
            // for google-services
            "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_api_key",
            "R.string.google_crash_reporting_api_key"
    ]
    compressFilePattern = [
            "*.png",
            "*.jpg",
            "*.jpeg",
            "*.gif",
    ]

    //因为不使用sevenzip 所以该处注释
//    sevenzip {
//        artifact = 'com.tencent.mm:SevenZip:1.2.13'
//        //path = "/usr/local/bin/7za"
//    }
    /**
     * Optional: if finalApkBackupPath is null, AndResGuard will overwrite final apk
     * to the path which assemble[Task] write to
     **/
    // finalApkBackupPath = "${project.rootDir}/final.apk"
    android.applicationVariants.all { variant ->
        variant.outputs.all {
            finalApkBackupPath = "${project.rootDir}/resGuardApks/${project.rootProject.name}_${variant.buildType.name}.apk"
        }
    }

    /**
     * Optional: Specifies the name of the message digest algorithm to user when digesting the entries of JAR file
     * Only works in V1signing, default value is "SHA-1"
     **/
    // digestalg = "SHA-256"
}