Skip to content

Commit 5f69f90

Browse files
authored
Fix incorrect ProGuard rules that allowed shrinking volatile felds (#2453)
* Fix incorrect ProGuard rules that allowed shrinking volatile felds Fixes #1564 * Modify ProGuard rules to only affect `kotlinx.coroutines.**` Before, some rules were applied to a wide range of libraries for no good reason. Now, they are limited to this library.
1 parent fa30140 commit 5f69f90

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
44

55
# Most of volatile fields are updated with AFU and should not be mangled
6-
-keepclassmembernames class kotlinx.** {
6+
-keepclassmembers class kotlinx.coroutines.** {
77
volatile <fields>;
88
}
99

1010
# Same story for the standard library's SafeContinuation that also uses AtomicReferenceFieldUpdater
11-
-keepclassmembernames class kotlin.coroutines.SafeContinuation {
11+
-keepclassmembers class kotlin.coroutines.SafeContinuation {
1212
volatile <fields>;
1313
}
1414

kotlinx-coroutines-test/resources/META-INF/proguard/coroutines.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}
55

66
# Most of volatile fields are updated with AFU and should not be mangled
7-
-keepclassmembernames class kotlinx.** {
7+
-keepclassmembers class kotlinx.coroutines.** {
88
volatile <fields>;
99
}

0 commit comments

Comments
 (0)