How Proguard works in Intellij Idea?

梦想的初衷 提交于 2019-12-05 09:27:08

After spending two days trying to work Proguard 4.7 with IntelliJ Idea, I have following points to conclude

  1. It does not make any difference if you uncomment the line proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt in file project.properties.
  2. I not sure if IntelliJ reads the proguard-android.txt file located at android-sdk/tools/proguard
  3. IntelliJ idea reads the file proguard-project.txt files located in the project so suggestion is edit and place all your proguard configuration in this file.
  4. I am still not clear what does Include system proguard file checkbox option do.

As per this google documentation http://developer.android.com/tools/help/proguard.html#enabling-gradle you need to change minifyEnabled false to minifyEnabled true in the projects build.gradle file.

...\app\proguard-rules.pro can be edited to add new rules if you need them. The default rules will probably do all you need, such as protect the names of methods that look like they might be invoked because of a layout xml onClick attribute. The document cited above also contains instructions for more complicated changes.

You will need to keep the mapping.txt file, which can be found under ...\app\build\outputs\mapping\release

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!