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
9 changes: 9 additions & 0 deletions docs/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ public void onCreate(Bundle savedInstanceState) {
Begin by reading the [Android development instructions][http-client-android] for
the Google HTTP Client Library for Java.

## R8 and ProGuard

The `google-api-client` artifact includes consumer rules required by the
library. If your build does not automatically consume rules from dependency
JARs, include the rules from
[`google-api-client.pro`][google-api-client-proguard] in your R8 or ProGuard
configuration.

## Authentication

As described in the [Android development instructions][http-client-android], the
Expand Down Expand Up @@ -75,5 +83,6 @@ if (files == null || files.isEmpty()) {
[play-services]: https://developer.android.com/google/play-services/index.html
[account-manager]: http://developer.android.com/reference/android/accounts/AccountManager.html
[http-client-android]: https://github.com/googleapis/google-http-java-client/wiki/Android
[google-api-client-proguard]: https://github.com/googleapis/google-api-java-client/blob/main/google-api-client/src/main/resources/META-INF/proguard/google-api-client.pro
[oauth2-android]: https://github.com/googleapis/google-api-java-client#oauth2-android
[quickstart]: https://developers.google.com/drive/api/v3/quickstart/java
7 changes: 7 additions & 0 deletions google-api-client-assembly/proguard-google-api-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>;
}

# Data's magic null values rely on reference identity. Keep R8 from replacing
# wrapper instances with canonical values such as Boolean.TRUE.

-keepclassmembers class com.google.api.client.util.Data {
public static final *** NULL_*;
}

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

-dontwarn com.google.api.client.extensions.android.**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# https://github.com/googleapis/google-api-java-client/issues/1450
-keep public class com.google.api.client.googleapis.GoogleUtils

# Data's magic null values rely on reference identity. Keep R8 from replacing
# wrapper instances with canonical values such as Boolean.TRUE.
# https://github.com/googleapis/google-api-java-client/issues/2603
-keepclassmembers class com.google.api.client.util.Data {
public static final *** NULL_*;
}
Loading