Skip to content
Open
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
25 changes: 24 additions & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,30 @@ If you are using Gradle, add this to your dependencies:
compile 'com.google.http-client:google-http-client:[VERSION]'
```

## ProGuard

The library uses reflection to access generic types and fields annotated with `@Key`. Add the
following rules to your ProGuard configuration:

```
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault

-keepclassmembers class * {
@com.google.api.client.util.Key <fields>;
}

-keepclasseswithmembers,allowobfuscation class * {
@com.google.api.client.util.Key <fields>;
public <init>();
}
```

When using `google-http-client-android`, also add:

```
-dontwarn com.google.api.client.extensions.android.**
```

## Download the library with dependencies

Download the latest assembly zip file from Maven Central and extract it on your computer. This zip
Expand All @@ -85,4 +109,3 @@ the dependencies folder. For more details about the contents of the download, se




7 changes: 7 additions & 0 deletions google-http-client-assembly/proguard-google-http-client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
@com.google.api.client.util.Key <fields>;
}

# Needed to keep public no-argument constructors used to instantiate data models via reflection

-keepclasseswithmembers,allowobfuscation class * {
@com.google.api.client.util.Key <fields>;
public <init>();
}

# Needed by google-http-client-android when linking against an older platform version

-dontwarn com.google.api.client.extensions.android.**
Loading