Skip to content

Commit

Permalink
2.0.3 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Rieb committed May 7, 2016
1 parent 8594e8f commit 49d6acf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---------------------------------------------
2.0.3 (2016-05-07)
- Fix Bad JSON error on ProGuard optimized APKs when deserializing error responses.
- All 2.0.x versions before 2.0.3 are affected and should be upgraded immediately.
- Only affects Android apps that enable ProGuard.
- Affected apps may crash when deserializing an error response from Dropbox servers.

---------------------------------------------
2.0.2 (2016-04-28)
- Update to latest API specs:
Expand Down
6 changes: 4 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you're using Maven, then edit your project's "pom.xml" and add this to the `<
<dependency>
<groupId>com.dropbox.core</groupId>
<artifactId>dropbox-core-sdk</artifactId>
<version>2.0.2</version>
<version>2.0.3</version>
</dependency>
```

Expand All @@ -23,7 +23,7 @@ If you are using Gradle, then edit your project's "build.gradle" and add this to
```groovy
dependencies {
// ...
compile 'com.dropbox.core:dropbox-core-sdk:2.0.2'
compile 'com.dropbox.core:dropbox-core-sdk:2.0.3'
}
```

Expand Down Expand Up @@ -183,3 +183,5 @@ Jackson Databind makes use of reflection and annotations to map Java objects to
-dontwarn com.fasterxml.jackson.databind.**
-adaptresourcefilenames com/dropbox/core/http/trusted-certs.raw
```

**IMPORTANT: If you are running version 2.0.x before 2.0.3, you should update to the latest Dropbox SDK version to avoid a deserialization bug that can cause Android apps that use ProGuard to crash.**
10 changes: 6 additions & 4 deletions examples/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.dropbox.core.examples.android"
Expand All @@ -34,12 +34,14 @@ android {
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
// to debug ProGuard rules
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -57,8 +59,8 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.4'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.4'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.4.0'
}
7 changes: 7 additions & 0 deletions src/main/java/com/dropbox/core/DbxRequestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ public static ErrorWrapper fromResponse(Type errType, HttpRequestor.Response res
);
ApiErrorResponse<?> apiResponse = JSON.readValue(response.getBody(), type);

// ProGuard/Dex hack: prevent ProGuard/Dex from optimizing away our @JsonCreator
// constructor. We add this code here instead of updating our rules to allow developers
// to easily fix their broken apps by updating the SDK version (see T94429).
if (errType == null) {
new ApiErrorResponse<Object>("impossible", new LocalizedText("impossible", "en_US"));
}

return new ErrorWrapper(apiResponse.getError(), requestId, apiResponse.getUserMessage());
}

Expand Down

0 comments on commit 49d6acf

Please sign in to comment.