Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include updated Proguard rules in the packaged aar #385

Merged
merged 1 commit into from
Jan 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 *;
}