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

Remove unnecessary -keep rule for AndroidDispatcherFactory, AndroidEx… #3263

Merged
merged 2 commits into from
May 18, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Update the comments in proguard files to reflect the new structure
dkhalanskyjb committed May 18, 2022
commit 0c8d8420f6f9923bc8ace98879ecab07db0c2447
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# When editing this file, update the following files as well:
# - META-INF/com.android.tools/r8-upto-1.6.0/coroutines.pro
# - META-INF/com.android.tools/r8-upto-3.0.0/coroutines.pro
# - META-INF/proguard/coroutines.pro

-keep class kotlinx.coroutines.android.AndroidDispatcherFactory {*;}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# When editing this file, update the following files as well for AGP 3.6.0+:
# - META-INF/com.android.tools/proguard/coroutines.pro
# - META-INF/proguard/coroutines.pro

# After R8 3.0.0 (or probably sometime before that), R8 learned how to optimize
# classes mentioned in META-INF/services files, and explicitly -keeping them
# disables these optimizations.
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

# When editing this file, update the following files as well for AGP 3.6.0+:
# - META-INF/com.android.tools/proguard/coroutines.pro
# - META-INF/com.android.tools/r8-upto-1.6.0/coroutines.pro
# - META-INF/com.android.tools/r8-upto-3.0.0/coroutines.pro

-keep class kotlinx.coroutines.android.AndroidDispatcherFactory {*;}
-keep class kotlinx.coroutines.android.AndroidExceptionPreHandler {*;}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change should also be in META-INF/com.android.tools/proguard/coroutines.pro.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Done.

Do you know why in r8-from-1.6.0 there is:

-assumenosideeffects class kotlinx.coroutines.internal.FastServiceLoaderKt {
    boolean ANDROID_DETECTED return true;
}

but in r8-upto-1.6.0 there is:

-assumenosideeffects class kotlinx.coroutines.internal.FastServiceLoader {
    boolean ANDROID_DETECTED return true;
}

E.g. Maybe R8 applied these rules in an odd way before 1.6, or maybe the rule is just wrong in the upto-1.6.0 file (and the file should be deleted).