diff --git a/app/build.gradle b/app/build.gradle index b541a491..0a231565 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { defaultConfig { minSdk 21 targetSdk 31 - versionCode 393 - versionName "3.0.2" + versionCode 394 + versionName "3.0.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } flavorDimensions "default" diff --git a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java index 93048628..e6559990 100644 --- a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java @@ -27,6 +27,9 @@ import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; import androidx.preference.PreferenceManager; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -252,9 +255,10 @@ public class CrossActionHelper { .connectTimeout(60, TimeUnit.SECONDS) .proxy(Helper.getProxy(context)) .build(); + Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss").create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://" + instance + "/api/v2/") - .addConverterFactory(GsonConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(gson)) .client(okHttpClient) .build(); return retrofit.create(MastodonSearchService.class); diff --git a/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java b/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java index 0fc8d260..29d5142c 100644 --- a/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java @@ -40,6 +40,8 @@ import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.transition.Transition; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import java.io.IOException; import java.util.ArrayList; @@ -140,10 +142,10 @@ public class NotificationsHelper { .connectTimeout(60, TimeUnit.SECONDS) .proxy(Helper.getProxy(context)) .build(); - + Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss").create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://" + instance + "/api/v1/") - .addConverterFactory(GsonConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(gson)) .client(okHttpClient) .build(); return retrofit.create(MastodonNotificationsService.class); diff --git a/app/src/main/java/app/fedilab/android/helper/PushNotifications.java b/app/src/main/java/app/fedilab/android/helper/PushNotifications.java index 7182285c..79becf4d 100644 --- a/app/src/main/java/app/fedilab/android/helper/PushNotifications.java +++ b/app/src/main/java/app/fedilab/android/helper/PushNotifications.java @@ -26,6 +26,9 @@ import android.os.Looper; import androidx.annotation.NonNull; import androidx.preference.PreferenceManager; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + import java.io.IOException; import java.util.Random; import java.util.concurrent.TimeUnit; @@ -134,9 +137,10 @@ public class PushNotifications { .connectTimeout(60, TimeUnit.SECONDS) .proxy(Helper.getProxy(context.getApplicationContext())) .build(); + Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss").create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://" + instance + "/api/v1/") - .addConverterFactory(GsonConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(gson)) .client(okHttpClient) .build(); return retrofit.create(MastodonNotificationsService.class); diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/394.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/394.txt new file mode 100644 index 00000000..b78c62cb --- /dev/null +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/394.txt @@ -0,0 +1 @@ +- Fix crashes for some pleroma instances \ No newline at end of file