ShieldAuto

Additional

Language
Java
Version
N/A
Created
Jan 24, 2018
Updated
Jan 30, 2018
Owner
Jimmy Kim (wotomas)
Contributor
Jimmy Kim (wotomas)
1
Activity
Badge
Generate
Download
Source code

Show card

Disclaimer

  • This project is meant for a proof of concept, to check if it is feasible to have a single magic solution for Proguard configurations
  • Currently its a 0.0.X version. Please don't use it in a real environment. Its terrible.
  • Basically googled and copied the first result for each proguard. The point I wanted to convey was that a single source, when crowdsourced enough, could bring value. (And also that most of google’s first result when used without knowledge is valueless)
  • My imagination of a real case usage in the future would be something like this:
shieldConfig {  //inside build.config
   libraries {
       ...
       picasso {
           enableDownloader true
           useOkhttp3 true
           ...
       }
   }
}

ShieldAuto

We were tired of searching for proguard configs for every library that needed to be included in release APK. By using ShieldAuto developers don't have to worry about checking proguard config file to check if setup is correct for each imported libraries.

ShieldAuto checks your dependencies extension defined in the build.gradle file to check for matching proguard and to generate a simple proguard config file. In short, ShieldAuto is a Java based Gradle plugin to manage proguard config for release build.

This is still a premature version and any helps are welcome. Test cases, refactoring, optimization, bug fixes and adding any libraries are welcome. Current State diagram is as following:

State Diagram

How to use?

// modify project level build.gradle
buildscript {
    repositories {
        ... 
        maven {
            url  "https://dl.bintray.com/wotomas/maven"
        }
    }
    dependencies {
        ...
        classpath 'info.kimjihyok:ShieldAuto:0.0.4'
    }
}
// add ShieldAuto plugin below application plugin 'com.android.application' plugin
apply plugin: 'info.kimjihyok.ShieldAuto'

android {
    ...  
    buildTypes {
        release {
            // apply sheidlAuto.auto() to proguardFiles configuration
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', shieldAuto.auto()
        }
    }

Note

Currently ShieldAuto is able to check for libraries imported only through compile configuration (which is deprecated and should be replaced with implementation, but direct access is not allowed right now). I would love for additional help with this issue.

Supported Libraries

Request for additional libraries could be submitted through issues. Pull requests are always welcome.

License

Copyright (C) 2018 Kim Jihyok

See the file License

Development and Contribution

We are open for any contributions. Please use the issue tickets for communication before sending pull requests.

Thanks to

Icons made by Maxim Basinski from www.flaticon.com is licensed by CC 3.0 BY