mirror of
https://github.com/bitwarden/android.git
synced 2026-04-28 20:08:27 -05:00
[BWA-110] Retrofit ProGuard missing rule (#291)
This commit is contained in:
@@ -162,7 +162,6 @@ dependencies {
|
||||
ksp(libs.google.hilt.compiler)
|
||||
implementation(libs.google.guava)
|
||||
implementation(libs.google.protobuf.javalite)
|
||||
implementation(libs.jakewharton.retrofit.kotlinx.serialization)
|
||||
implementation(libs.kotlinx.collections.immutable)
|
||||
implementation(libs.kotlinx.coroutines.android)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
|
||||
27
app/proguard-rules.pro
vendored
27
app/proguard-rules.pro
vendored
@@ -74,6 +74,33 @@
|
||||
@com.sun.jna.* *;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Okhttp/Retrofit https://square.github.io/okhttp/ & https://square.github.io/retrofit/
|
||||
################################################################################
|
||||
|
||||
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
|
||||
# EnclosingMethod is required to use InnerClasses.
|
||||
-keepattributes Signature, InnerClasses, EnclosingMethod
|
||||
|
||||
# Retrofit does reflection on method and parameter annotations.
|
||||
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
|
||||
|
||||
# https://github.com/square/okhttp/blob/339732e3a1b78be5d792860109047f68a011b5eb/okhttp/src/jvmMain/resources/META-INF/proguard/okhttp3.pro#L11-L14
|
||||
-dontwarn okhttp3.internal.platform.**
|
||||
-dontwarn org.bouncycastle.**
|
||||
# Related to this issue on https://github.com/square/retrofit/issues/3880
|
||||
# Check https://github.com/square/retrofit/tags for new versions
|
||||
-keep,allowobfuscation,allowshrinking class kotlin.Result
|
||||
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
|
||||
-keep,allowobfuscation,allowshrinking class retrofit2.Response
|
||||
# This solves this issue https://github.com/square/retrofit/issues/3880
|
||||
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
|
||||
|
||||
# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
|
||||
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
|
||||
-if interface * { @retrofit2.http.* <methods>; }
|
||||
-keep,allowobfuscation interface <1>
|
||||
|
||||
################################################################################
|
||||
# ZXing
|
||||
################################################################################
|
||||
|
||||
@@ -4,11 +4,11 @@ import com.bitwarden.authenticator.data.platform.datasource.network.core.ResultC
|
||||
import com.bitwarden.authenticator.data.platform.datasource.network.interceptor.BaseUrlInterceptor
|
||||
import com.bitwarden.authenticator.data.platform.datasource.network.interceptor.BaseUrlInterceptors
|
||||
import com.bitwarden.authenticator.data.platform.datasource.network.interceptor.HeadersInterceptor
|
||||
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
|
||||
import kotlinx.serialization.json.Json
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.OkHttpClient
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.converter.kotlinx.serialization.asConverterFactory
|
||||
|
||||
/**
|
||||
* Primary implementation of [Retrofits].
|
||||
|
||||
Reference in New Issue
Block a user