# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /opt/android-ly.img.android.sdk-update-manager/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
# -keepattributes *Annotation*

# Keep Renderscript classes
-keep class android.support.v8.renderscript.** { *; }
-keep class androidx.renderscript.** { *; }

# Keep names for Event class, otherwise the processor cant referance the classes
-keepclasseswithmembers,allowshrinking class * { @ly.img.sdk.android.annotations.StateEvents *; }

# Keep names for Event methods, otherwise the processor can't referance the methods
-keepclassmembers class * { ly.img.android.pesdk.annotations.OnEvent <methods>; }

# Keep Annotaion, because of an issue with multiple processor rounds
-keep class ly.img.android.pesdk.annotations.OnEvent { *; }

# Keep classes created by reflactions using Class.forName(classNameString)
-keep public class * extends ly.img.android.pesdk.backend.operator.export.Operation
-keep public class * extends ly.img.android.pesdk.backend.operator.preview.GlOperation
-keep public class * extends ly.img.android.pesdk.backend.model.state.manager.StateObservable

# Decoder created by Reflection
-keep class ly.img.android.pesdk.backend.decoder.** { *; }
-keepnames class ly.img.android.pesdk.backend.decoder.** { *; }

# Keep ThreadUtils class because of some issues, needs tests
-keep class ly.img.android.pesdk.utils.ThreadUtils.** { *; }

# Keep reflection accessed annotaion
-keep class ly.img.android.pesdk.backend.model.constant.RevertStrategy { *; }

# Access over reflections
-keepclasseswithmembernames class * { @ly.img.android.PESDKInit *; }

 # -----------------------------------------------------------------------------#
# --- We need this roules to workaround a memory issue, by using reflections. ---#
 # -----------------------------------------------------------------------------#
-keep class android.support.graphics.drawable.VectorDrawableCompat {
    private android.support.graphics.drawable.VectorDrawableCompat$VectorDrawableCompatState mVectorState;
}
-keep class android.support.graphics.drawable.VectorDrawableCompat$VectorDrawableCompatState {
    android.graphics.Bitmap mCachedBitmap;
}


-keepclassmembers @ly.img.android.pesdk.annotations.EventDispatcher public class * {
    public *;
}
-keep @ly.img.android.pesdk.annotations.EventDispatcher public class *

-keepnames @ly.img.android.pesdk.annotations.EventDispatcher public class *
