I was searching everywhere for answer, but did not find any.
The main problem is that eveyone says about proguard configuration file, but there is none, IntelliJ / Android Studio does not generate such a file, there is none in SDK dir, so how do I generate valid configuration file for proguard obfuscation?
I know i'm bit late in answering but here is the answer This blog contains all the stuff you need from the scratch step by step with images.
minifyEnable false
to
minifyEnable true
These are steps to enable the proguard. If you want advance view then you can visit following link.
You have android-sdk\\tools\\proguard\\proguard-android.txt and proguard-android-optimize.txt. Make sure you have "Android SDK Tools" installed with SDK Manager. I think IntelliJ usually generates proguard-project.txt in the project directory. If not, it's just a text file, so you can just add it to your project. You set your custom rules in that file.
You can even check the "Run ProGuard when building debug APK" in Project Structure window (F4):
In Andoird Studio we cant see the proguard-rules.pro
file in the Project tab by default. to change this you can do the following:
proguard-rules.pro
file inside yourproject/app/proguard-rules.pro . (see screenshot) The rest of the proguard configuration is traditional and you can find plenty of info by googling it. :)
Hope it helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.