Skip to content

Commit e4c81e8

Browse files
authored
Merge pull request #8 from MySkeletonHurts/fix/sso-generic-signature-r8
fix: keep SSO library classes and generic signatures in release builds
2 parents 1e58622 + 7f8c57c commit e4c81e8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎app/proguard-rules.pro‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# The Nextcloud SSO library's NextcloudRetrofitServiceMethod inspects generic return types
2+
# reflectively (method.getGenericReturnType()) to decide how to deserialize responses. Without
3+
# this attribute R8 erases that generic signature, the type check silently falls back to a
4+
# different code path, and every SSO-relayed request breaks in release builds only.
5+
-keepattributes Signature
6+
7+
# Android-SingleSignOn 1.3.4 ships consumer proguard rules of its own (including the
8+
# -keepattributes Signature above), but they don't keep NextcloudRetrofitServiceMethod or
9+
# ParsedResponse themselves, so R8 full mode is still free to rename/optimize them — which
10+
# corrupts the nested generic Signature (Observable<ParsedResponse<OcsResponse>> loses its
11+
# inner <OcsResponse> argument) when it remaps the Signature attribute string. Keep just the
12+
# two classes proven necessary rather than the whole com.nextcloud.android.sso namespace.
13+
-keep class com.nextcloud.android.sso.api.NextcloudRetrofitServiceMethod { *; }
14+
-keep class com.nextcloud.android.sso.api.ParsedResponse { *; }
15+
116
# Retrofit and Gson access Nextcloud API contracts and payloads reflectively.
217
-keep,allowoptimization interface org.qownnotes.mobile.backend.nextcloud.**Api { *; }
318
-keep,allowoptimization class org.qownnotes.mobile.backend.nextcloud.**Dto { *; }

0 commit comments

Comments
 (0)