AndResGuard 集成

 1.在app的build.gradle中 添加

apply plugin: 'AndResGuard'
andResGuard {
    mappingFile = null
    use7zip = true
    useSign = true
    // It will keep the origin path of your resources when it's true
    keepRoot = false
    // It will merge the duplicated resources, but don't rely on this feature too much.
    // it's always better to remove duplicated resource from repo
    mergeDuplicatedRes = true
    whiteList = [
            // your icon
            "R.drawable.icon",
            // for fabric
            "R.string.com.crashlytics.*",
            // 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",
            "resources.arsc"
    ]
    sevenzip {
        artifact = 'com.tencent.mm:SevenZip:1.2.16'
    }
}

 

2.在project下的build.gradle中添加

classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.16'

3.最重要的一步,双击运行 

 

然后打出个包就ok了:

 

最后,https://github.com/shwenzhang/AndResGuard


版权声明:本文为user_86原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。