Retrofit 2.10.0 (#4330)

https://github.com/square/retrofit/releases/tag/2.10.0
This commit is contained in:
Zongle Wang 2024-03-19 15:32:14 +08:00 committed by GitHub
parent be8140d628
commit 83cbbe9ada
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 22 deletions

View File

@ -67,15 +67,6 @@
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken -keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
# Retain generic signatures of classes used in MastodonApi so Retrofit works
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class kotlin.collections.List
-keep,allowobfuscation,allowshrinking class kotlin.collections.Map
-keep,allowobfuscation,allowshrinking class retrofit2.Call
# https://github.com/square/retrofit/pull/3563
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
# preserve line numbers for crash reporting # preserve line numbers for crash reporting
-keepattributes SourceFile,LineNumberTable -keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile -renamesourcefileattribute SourceFile

View File

@ -49,7 +49,6 @@ import com.keylesspalace.tusky.entity.Translation
import com.keylesspalace.tusky.entity.TrendingTag import com.keylesspalace.tusky.entity.TrendingTag
import okhttp3.MultipartBody import okhttp3.MultipartBody
import okhttp3.RequestBody import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.Call import retrofit2.Call
import retrofit2.Response import retrofit2.Response
import retrofit2.http.Body import retrofit2.http.Body
@ -177,7 +176,7 @@ interface MastodonApi {
): Response<List<Notification>> ): Response<List<Notification>>
@POST("api/v1/notifications/clear") @POST("api/v1/notifications/clear")
suspend fun clearNotifications(): NetworkResult<ResponseBody> suspend fun clearNotifications(): NetworkResult<Unit>
@FormUrlEncoded @FormUrlEncoded
@PUT("api/v1/media/{mediaId}") @PUT("api/v1/media/{mediaId}")
@ -273,7 +272,7 @@ interface MastodonApi {
@DELETE("api/v1/scheduled_statuses/{id}") @DELETE("api/v1/scheduled_statuses/{id}")
suspend fun deleteScheduledStatus( suspend fun deleteScheduledStatus(
@Path("id") scheduledStatusId: String @Path("id") scheduledStatusId: String
): NetworkResult<ResponseBody> ): NetworkResult<Unit>
@GET("api/v1/accounts/verify_credentials") @GET("api/v1/accounts/verify_credentials")
suspend fun accountVerifyCredentials( suspend fun accountVerifyCredentials(
@ -543,7 +542,7 @@ interface MastodonApi {
): NetworkResult<FilterV1> ): NetworkResult<FilterV1>
@DELETE("api/v1/filters/{id}") @DELETE("api/v1/filters/{id}")
suspend fun deleteFilterV1(@Path("id") id: String): NetworkResult<ResponseBody> suspend fun deleteFilterV1(@Path("id") id: String): NetworkResult<Unit>
@FormUrlEncoded @FormUrlEncoded
@POST("api/v2/filters") @POST("api/v2/filters")
@ -565,7 +564,7 @@ interface MastodonApi {
): NetworkResult<Filter> ): NetworkResult<Filter>
@DELETE("api/v2/filters/{id}") @DELETE("api/v2/filters/{id}")
suspend fun deleteFilter(@Path("id") id: String): NetworkResult<ResponseBody> suspend fun deleteFilter(@Path("id") id: String): NetworkResult<Unit>
@FormUrlEncoded @FormUrlEncoded
@POST("api/v2/filters/{filterId}/keywords") @POST("api/v2/filters/{filterId}/keywords")
@ -586,7 +585,7 @@ interface MastodonApi {
@DELETE("api/v2/filters/keywords/{keywordId}") @DELETE("api/v2/filters/keywords/{keywordId}")
suspend fun deleteFilterKeyword( suspend fun deleteFilterKeyword(
@Path("keywordId") keywordId: String @Path("keywordId") keywordId: String
): NetworkResult<ResponseBody> ): NetworkResult<Unit>
@FormUrlEncoded @FormUrlEncoded
@POST("api/v1/polls/{id}/votes") @POST("api/v1/polls/{id}/votes")
@ -601,19 +600,19 @@ interface MastodonApi {
): NetworkResult<List<Announcement>> ): NetworkResult<List<Announcement>>
@POST("api/v1/announcements/{id}/dismiss") @POST("api/v1/announcements/{id}/dismiss")
suspend fun dismissAnnouncement(@Path("id") announcementId: String): NetworkResult<ResponseBody> suspend fun dismissAnnouncement(@Path("id") announcementId: String): NetworkResult<Unit>
@PUT("api/v1/announcements/{id}/reactions/{name}") @PUT("api/v1/announcements/{id}/reactions/{name}")
suspend fun addAnnouncementReaction( suspend fun addAnnouncementReaction(
@Path("id") announcementId: String, @Path("id") announcementId: String,
@Path("name") name: String @Path("name") name: String
): NetworkResult<ResponseBody> ): NetworkResult<Unit>
@DELETE("api/v1/announcements/{id}/reactions/{name}") @DELETE("api/v1/announcements/{id}/reactions/{name}")
suspend fun removeAnnouncementReaction( suspend fun removeAnnouncementReaction(
@Path("id") announcementId: String, @Path("id") announcementId: String,
@Path("name") name: String @Path("name") name: String
): NetworkResult<ResponseBody> ): NetworkResult<Unit>
@FormUrlEncoded @FormUrlEncoded
@POST("api/v1/reports") @POST("api/v1/reports")
@ -677,7 +676,7 @@ interface MastodonApi {
suspend fun unsubscribePushNotifications( suspend fun unsubscribePushNotifications(
@Header("Authorization") auth: String, @Header("Authorization") auth: String,
@Header(DOMAIN_HEADER) domain: String @Header(DOMAIN_HEADER) domain: String
): NetworkResult<ResponseBody> ): NetworkResult<Unit>
@GET("api/v1/tags/{name}") @GET("api/v1/tags/{name}")
suspend fun tag(@Path("name") name: String): NetworkResult<HashTag> suspend fun tag(@Path("name") name: String): NetworkResult<HashTag>

View File

@ -39,7 +39,6 @@ import com.keylesspalace.tusky.util.Single
import com.keylesspalace.tusky.util.getServerErrorMessage import com.keylesspalace.tusky.util.getServerErrorMessage
import java.util.Locale import java.util.Locale
import javax.inject.Inject import javax.inject.Inject
import okhttp3.ResponseBody
import retrofit2.Response import retrofit2.Response
/** /**
@ -182,7 +181,7 @@ class TimelineCases @Inject constructor(
return Single { runCatching { mastodonApi.notifications(maxId, sinceId, limit, excludes) } } return Single { runCatching { mastodonApi.notifications(maxId, sinceId, limit, excludes) } }
} }
fun clearNotificationsOld(): Single<ResponseBody> { fun clearNotificationsOld(): Single<Unit> {
return Single { mastodonApi.clearNotifications() } return Single { mastodonApi.clearNotifications() }
} }

View File

@ -42,7 +42,7 @@ mockito-inline = "5.2.0"
mockito-kotlin = "5.2.1" mockito-kotlin = "5.2.1"
networkresult-calladapter = "1.1.0" networkresult-calladapter = "1.1.0"
okhttp = "4.12.0" okhttp = "4.12.0"
retrofit = "2.9.0" retrofit = "2.10.0"
robolectric = "4.11.1" robolectric = "4.11.1"
sparkbutton = "4.2.0" sparkbutton = "4.2.0"
touchimageview = "3.6" touchimageview = "3.6"