ProguardConfig

Proguard Configurations For Android Developer.

License

License

Categories

Categories

config Application Layer Libs Configuration
GroupId

GroupId

com.hwangjr.proguard
ArtifactId

ArtifactId

proguardconfig
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

ProguardConfig
Proguard Configurations For Android Developer.
Project URL

Project URL

https://github.com/AndroidKnife/proguard-config
Source Code Management

Source Code Management

https://github.com/AndroidKnife/proguard-config

Download proguardconfig

How to add to project

<!-- https://jarcasting.com/artifacts/com.hwangjr.proguard/proguardconfig/ -->
<dependency>
    <groupId>com.hwangjr.proguard</groupId>
    <artifactId>proguardconfig</artifactId>
    <version>1.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.hwangjr.proguard/proguardconfig/
implementation 'com.hwangjr.proguard:proguardconfig:1.0.1'
// https://jarcasting.com/artifacts/com.hwangjr.proguard/proguardconfig/
implementation ("com.hwangjr.proguard:proguardconfig:1.0.1")
'com.hwangjr.proguard:proguardconfig:aar:1.0.1'
<dependency org="com.hwangjr.proguard" name="proguardconfig" rev="1.0.1">
  <artifact name="proguardconfig" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.hwangjr.proguard', module='proguardconfig', version='1.0.1')
)
libraryDependencies += "com.hwangjr.proguard" % "proguardconfig" % "1.0.1"
[com.hwangjr.proguard/proguardconfig "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Proguard-Config

Common library proguard configuration for android develop ! This is a common proguard config for android developers.

I'm tired of the proguard configuration for so much libraries, Now it's a library.

It use the new gradle build system which is consumerProguardFiles, i just package the proguard file under proguardlib/proguards in aar, you can use it by add to build.gradle or just copy *.pro to your application.

Here is the consumerProguardFiles definition:

  • ProGuard rule files to be included in the published AAR.
  • These proguard rule files will then be used by any application project that consumes the AAR (if ProGuard is enabled).
  • This allows AAR to specify shrinking or obfuscation exclude rules.
  • This is only valid for Library project. This is ignored in Application project.

More info: BuildType - Android Plugin 1.5.0 DSL Reference

Most of the proguard file is from krschultz/android-proguard-snippets.

Usage

Two usage is supported:

Usage 1 (Suggested)

Checkout the library and add the specific library proguard file:

android {
    buildTypes {
        release {
            minifyEnabled true
            zipAlignEnabled true
            shrinkResources true
            
            // specific proguard files
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-gson.pro'
            proguardFile 'proguard-square-okio.pro'
            ...
            
            // As of Gradle Android plugin 1.1.0, the test APK has a separate config
            testProguardFile 'proguard-rules-test.pro'
        }
    }
}

Or just add the .pro file to the proguards folder:

android {
    buildTypes {
        release {
            minifyEnabled true
            zipAlignEnabled true
            shrinkResources true
            
            // specific proguard files
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', fileTree(dir: 'proguards', include: '*.pro')
        }
    }
}

Usage 2 (May break your app proguard)

Add the aar to your dependencies:

dependencies {
    ...
    compile 'com.hwangjr.proguard:proguardconfig:1.0.1@aar'
}

Because of the so many proguard files, it may make your application not to be obfuscated completely.

Ref

BuildType - Android Plugin 1.5.0 DSL Reference

krschultz/android-proguard-snippets

License

Copyright 2015 HwangJR

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
com.hwangjr.proguard
Make Android Develop Better!

Versions

Version
1.0.1
1.0.0