Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.9.29'
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Oct 4, 2019
2 parents 3c0261b + db9824e commit f3475f8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Changes to Matrix Android SDK in 0.9.29 (2019-10-04)
=======================================================

Corrective release

Bugfix:
- Fix / Keysbackup not working (failed to get version)

Changes to Matrix Android SDK in 0.9.28 (2019-10-03)
=======================================================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public enum EndPointServer {
private OkHttpClient mOkHttpClient;

public RestClient(HomeServerConnectionConfig hsConfig, Class<T> type, String uriPrefix) {
this(hsConfig, type, uriPrefix, GsonProvider.provideGson(), EndPointServer.HOME_SERVER);
this(hsConfig, type, uriPrefix, GsonProvider.provideKotlinGson(), EndPointServer.HOME_SERVER);
}

public RestClient(HomeServerConnectionConfig hsConfig, Class<T> type, String uriPrefix, Gson gson) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ public static Gson provideGson() {
return gson;
}

// Can serialize/deserialise kt objects without the need to add @JVMField
private static final Gson kotlinGson = new GsonBuilder()
.registerTypeAdapter(boolean.class, new BooleanDeserializer(false))
.registerTypeAdapter(Boolean.class, new BooleanDeserializer(true))
.create();

public static Gson provideKotlinGson() {
return kotlinGson;
}


}
4 changes: 2 additions & 2 deletions matrix-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 928
versionName "0.9.28"
versionCode 929
versionName "0.9.29"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// Enable multi dex for test
Expand Down
14 changes: 0 additions & 14 deletions matrix-sdk/src/main/java/org/matrix/androidsdk/core/JsonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ public class JsonUtils {

private static final Gson basicGson = new Gson();

private static final Gson kotlinGson = new GsonBuilder()
.registerTypeAdapter(boolean.class, new BooleanDeserializer(false))
.registerTypeAdapter(Boolean.class, new BooleanDeserializer(true))
.create();

private static final Gson gson = new GsonBuilder()
.setFieldNamingStrategy(new MatrixFieldNamingStrategy())
.excludeFieldsWithModifiers(Modifier.PRIVATE, Modifier.STATIC)
Expand Down Expand Up @@ -104,15 +99,6 @@ public static Gson getBasicGson() {
return basicGson;
}

/**
* Provides the JSON parser for Kotlin.
*
* @return the kotlin JSON parser
*/
public static Gson getKotlinGson() {
return kotlinGson;
}

/**
* Provides the JSON parser.
*
Expand Down

0 comments on commit f3475f8

Please sign in to comment.