duguyihou / react-native-turbo-image

Performant image component for React Native
https://www.npmjs.com/package/react-native-turbo-image
MIT License
165 stars 8 forks source link

feature: Proguard configuration for turbo image #346

Closed Gautham495 closed 2 months ago

Gautham495 commented 2 months ago

What feature or enhancement are you suggesting?

I have successfully integrated turbo image and it works properly and a perfect stand in replacement for fast image with new architecture support.

Can you add proguard support if there is one to the readme so i can use it for my project.

Thanks!

What Platforms whould this feature/enhancement affect?

Android

Alternatives/Workarounds

-

duguyihou commented 2 months ago

@Gautham495

According to coil's docs, Coil is compatible with R8 obfuscation, you don’t need to add other rules. If you need to obfuscate the code, you may need to add the corresponding obfuscation rules: Coroutines, OkHttp.

image

Then I saw okhttp docs

R8 / ProGuard

If you use OkHttp as a dependency in an Android project which uses R8 as a default compiler you don't have to do anything. The specific rules are already bundled into the JAR which can be interpreted by R8 automatically. If you, however, don't use R8 you have to apply the rules from this file. You might also need rules from Okio which is a dependency of this library.

The Coil's docs in English version does not mention Proguard. I think we don't need Proguard configuration for Coil.

duguyihou commented 2 months ago

https://developer.android.com/build/shrink-code

When you build your project using Android Gradle plugin 3.4.0 or higher, the plugin no longer uses ProGuard to perform compile-time code optimization. Instead, the plugin works with the R8 compiler to handle the following compile-time tasks:

duguyihou commented 2 months ago

Closing it since no need to add ProGuard.