Proguard 在 android Studio 中开箱即用?这是啥意思?

Posted

技术标签:

【中文标题】Proguard 在 android Studio 中开箱即用?这是啥意思?【英文标题】:Proguard comes out of the box in android Studio? What does it means?Proguard 在 android Studio 中开箱即用?这是什么意思? 【发布时间】:2022-01-19 05:36:44 【问题描述】:

我正在阅读一篇关于 android Studio 中 Proguard 的文章,它们是一行

Proguard 在 android Studio 中开箱即用

谁能给我解释一下?如果您有兴趣阅读完整的文章,我会将链接放在下面。

Article Link

【问题讨论】:

https://en.wikipedia.org/wiki/Out_of_the_box_(feature) 【参考方案1】:

这意味着proguard与你的默认android项目捆绑在一起,你不需要通过gradle或maven从外部下载它

android 
    buildTypes 
        release 
            // Enables code shrinking, obfuscation, and optimization for only
            // your project's release build type.
            minifyEnabled true// Enables resource shrinking, which is performed by the
            // Android Gradle plugin.
            shrinkResources true// Includes the default ProGuard rules files that are packaged with
            // the Android Gradle plugin. To learn more, go to the section about
            // R8 configuration files.
            proguardFiles getDefaultProguardFile(
                    'proguard-android.txt'),
                    'proguard-rules.pro'
        
    
    ...

参考:More on proguard usage in android

【讨论】:

以上是关于Proguard 在 android Studio 中开箱即用?这是啥意思?的主要内容,如果未能解决你的问题,请参考以下文章

Proguard 在 android Studio 中开箱即用?这是啥意思?

在 android studio 中找不到 proguard-project.txt

使用 Android Studio 签署 APK 时出现 Proguard 错误

如何在 android studio gradle 中降级 proguard 版本?

Android Studio - Proguard“保留”规则被忽略?

Android Studio中的proguard映射文件在哪里[重复]