fix: Add @Keep annotation to prevent minifier from deleting java funcs

This commit is contained in:
Marc Rousavy 2021-07-07 13:18:38 +02:00
parent 7a5e879b92
commit 3007cd9430
2 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.mrousavy.camera.frameprocessor
import android.util.Log
import androidx.annotation.Keep
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.react.bridge.ReactApplicationContext
@ -55,6 +56,8 @@ class FrameProcessorRuntimeManager(context: ReactApplicationContext) {
mHybridData?.resetNative()
}
@DoNotStrip
@Keep
fun findCameraViewById(viewId: Int): CameraView {
Log.d(TAG, "finding view $viewId...")
val view = mContext?.get()?.currentActivity?.findViewById<CameraView>(viewId)

View File

@ -2,12 +2,17 @@ package com.mrousavy.camera.frameprocessor;
import android.annotation.SuppressLint;
import android.media.Image;
import androidx.annotation.Keep;
import androidx.camera.core.ImageProxy;
import com.facebook.proguard.annotations.DoNotStrip;
@DoNotStrip
@Keep
public class ImageProxyUtils {
@SuppressLint("UnsafeOptInUsageError")
@DoNotStrip
@Keep
public static boolean isImageProxyValid(ImageProxy imageProxy) {
try {
Image image = imageProxy.getImage();