Skip to content

Commit

Permalink
fix: Add @Keep annotation to prevent minifier from deleting java funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jul 7, 2021
1 parent 7a5e879 commit 3007cd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

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();
Expand Down

0 comments on commit 3007cd9

Please sign in to comment.