Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minified build crash #1529

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,26 @@
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**

# https://github.com/square/retrofit/issues/3751#issuecomment-1192043644
# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
# endregion

# region okio - https://square.github.io/okio/#r8-proguard
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# endregion

# arrow-integrations-retrofit-adapter - https://github.com/arrow-kt/arrow-integrations/issues/121
# `Either` class needs to exist after minification for Retrofit to know how to adapt the response to it
-keep,allowobfuscation,allowshrinking class arrow.core.Either

# Adyen dependencies - https://github.com/Adyen/adyen-android/issues/1172
-dontwarn org.slf4j.impl.StaticLoggerBinder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class ChatNotificationSender(

sendHedvigNotification(
context = context,
notificationSender = this::class.simpleName,
notificationSender = "ChatNotificationSender",
notificationId = CHAT_NOTIFICATION_ID,
notification = notification,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CrossSellNotificationSender(
)
sendHedvigNotification(
context = context,
notificationSender = this::class.simpleName,
notificationSender = "CrossSellNotificationSender",
notificationId = CROSS_SELL_NOTIFICATION_ID,
notification = notification,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GenericNotificationSender(

sendHedvigNotification(
context = context,
notificationSender = this::class.simpleName,
notificationSender = "GenericNotificationSender",
notificationId = id.getAndIncrement(),
notification = notification,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class PaymentNotificationSender(
private fun sendNotificationInner(id: Int, notification: Notification) {
sendHedvigNotification(
context = context,
notificationSender = this::class.simpleName,
notificationSender = "PaymentNotificationSender",
notificationId = id,
notification = notification,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ReferralsNotificationSender(
private fun sendNotificationInner(id: Int, notification: Notification) {
sendHedvigNotification(
context = context,
notificationSender = this::class.simpleName,
notificationSender = "ReferralsNotificationSender",
notificationId = id,
notification = notification,
)
Expand Down