Skip to content

Commit

Permalink
Merge pull request #385 from auth0/include-proguard-rules
Browse files Browse the repository at this point in the history
Include updated Proguard rules in the packaged aar
  • Loading branch information
hzalaz authored Jan 2, 2017
2 parents 7695af4 + 010f44b commit c1cf3ec
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ startActivity(lock.newIntent(this));
```

##Proguard
In the [proguard directory](proguard) you can find the *Proguard* configuration for Lock and its dependencies.
The rules should be applied automatically if your application is using `minifyEnabled = true`. If you want to include them manually check the [proguard directory](proguard).
By default you should at least use the following files:
* `proguard-okio.pro`
* `proguard-gson.pro`
Expand Down
4 changes: 0 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ android {
}
release {
minifyEnabled true
proguardFile '../proguard/proguard-lock-2.pro'
proguardFile '../proguard/proguard-okio.pro'
proguardFile '../proguard/proguard-otto.pro'
proguardFile '../proguard/proguard-gson.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
Expand Down
7 changes: 1 addition & 6 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ android {
targetSdkVersion 24
versionCode 1
versionName semver.stringVersion
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
consumerProguardFiles '../proguard/proguard-gson.pro', '../proguard/proguard-otto.pro', '../proguard/proguard-lock-2.pro'
}
}

Expand Down
4 changes: 3 additions & 1 deletion proguard/proguard-gson.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Gson

-keepattributes Signature
-keepattributes *Annotation*
-keepattributes *Annotation*

-dontwarn com.google.gson.internal.UnsafeAllocator
8 changes: 7 additions & 1 deletion proguard/proguard-lock-2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
## Parcelables
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
}

## Descriptor classes
-keep public class com.auth0.android.lock.events.*
-keep public class com.auth0.android.lock.adapters.Country
-keep public interface com.auth0.android.lock.internal.configuration.OAuthConnection
-keep public interface com.auth0.android.lock.views.interfaces.IdentityListener
6 changes: 0 additions & 6 deletions proguard/proguard-okio.pro

This file was deleted.

1 change: 0 additions & 1 deletion proguard/proguard-otto.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
-keepattributes *Annotation*
-keepclassmembers class ** {
@com.squareup.otto.Subscribe public *;
@com.squareup.otto.Produce public *;
}

0 comments on commit c1cf3ec

Please sign in to comment.