@infilectorg/infiviz-shots-react-sdk 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,9 @@
5
5
  Following are the versions for **React Native SDK**
6
6
 
7
7
 
8
+ - **V 1.0.11** <br/>
9
+ 1. [Fixed startCamera not returning sessionId in android]
10
+
8
11
  - **V 1.0.6** <br/>
9
12
  1. [Adding broadcast receiver functionality in React Native SDK For Android](https://infilect.atlassian.net/browse/ISS-4865)
10
13
  Added broadcast receiver for IOS
@@ -64,6 +64,10 @@ android {
64
64
 
65
65
  buildTypes {
66
66
  release {
67
+ minifyEnabled true
68
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
69
+ }
70
+ debug {
67
71
  minifyEnabled false
68
72
  }
69
73
  }
@@ -99,7 +103,7 @@ dependencies {
99
103
  implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
100
104
 
101
105
 
102
- implementation 'com.infilect:infivizshots-sdk:RN-1.0.0'
106
+ implementation 'com.infilect:infivizshots-sdk:RN-1.0.1'
103
107
 
104
108
  testImplementation 'junit:junit:4.13.2'
105
109
  implementation 'com.github.bumptech.glide:glide:4.14.2'
@@ -1,6 +1,17 @@
1
1
  InfivizShotsReactSdk_kotlinVersion=2.0.21
2
2
  InfivizShotsReactSdk_minSdkVersion=26
3
- InfivizShotsReactSdk_targetSdkVersion=34
4
- InfivizShotsReactSdk_compileSdkVersion=35
3
+ InfivizShotsReactSdk_targetSdkVersion=35
4
+ InfivizShotsReactSdk_compileSdkVersion=34
5
5
  InfivizShotsReactSdk_ndkVersion=27.1.12297006
6
6
  android.useAndroidX=true
7
+ android.enableJetifier=true
8
+
9
+ # JVM heap size (increased for R8 compilation)
10
+ org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
11
+
12
+ # Gradle configuration for better performance
13
+ org.gradle.daemon=true
14
+ org.gradle.parallel=true
15
+ org.gradle.configureondemand=true
16
+
17
+ # R8 configuration
@@ -0,0 +1,146 @@
1
+ # Add project specific ProGuard rules here.
2
+ # You can control the set of applied configuration files using the
3
+ # proguardFiles setting in build.gradle.
4
+
5
+ # Keep React Native classes
6
+ -keep class com.facebook.react.** { *; }
7
+ -keep class com.facebook.hermes.** { *; }
8
+ -keep class com.facebook.jni.** { *; }
9
+
10
+ # Keep our SDK classes
11
+ -keep class com.infilect.infivizshotsreactsdk.** { *; }
12
+ -keep class infilect.infiviz.** { *; }
13
+ -keep class com.infilect.** { *; }
14
+
15
+ # Keep Kotlin classes
16
+ -keep class kotlin.** { *; }
17
+ -keep class kotlin.Metadata { *; }
18
+ -dontwarn kotlin.**
19
+
20
+ # Keep Gson classes
21
+ -keepattributes Signature
22
+ -keepattributes *Annotation*
23
+ -keep class com.google.gson.** { *; }
24
+ -keep class * implements com.google.gson.TypeAdapterFactory
25
+ -keep class * implements com.google.gson.JsonSerializer
26
+ -keep class * implements com.google.gson.JsonDeserializer
27
+
28
+ # Keep Hilt classes
29
+ -keep class dagger.hilt.** { *; }
30
+ -keep class * extends dagger.hilt.android.internal.managers.ViewComponentManager { *; }
31
+
32
+ # Keep Glide classes
33
+ -keep public class * implements com.bumptech.glide.module.GlideModule
34
+ -keep class * extends com.bumptech.glide.module.AppGlideModule {
35
+ <init>(...);
36
+ }
37
+ -keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
38
+ **[] $VALUES;
39
+ public *;
40
+ }
41
+
42
+ # Fix for StringConcatFactory issue
43
+ -dontwarn java.lang.invoke.StringConcatFactory
44
+ -keep class java.lang.invoke.StringConcatFactory { *; }
45
+
46
+ # Keep native methods
47
+ -keepclasseswithmembernames class * {
48
+ native <methods>;
49
+ }
50
+
51
+ # Keep enum values
52
+ -keepclassmembers enum * {
53
+ public static **[] values();
54
+ public static ** valueOf(java.lang.String);
55
+ }
56
+
57
+ # Keep Parcelable classes
58
+ -keep class * implements android.os.Parcelable {
59
+ public static final android.os.Parcelable$Creator *;
60
+ }
61
+
62
+ # Keep Serializable classes
63
+ -keepclassmembers class * implements java.io.Serializable {
64
+ static final long serialVersionUID;
65
+ private static final java.io.ObjectStreamField[] serialPersistentFields;
66
+ private void writeObject(java.io.ObjectOutputStream);
67
+ private void readObject(java.io.ObjectInputStream);
68
+ java.lang.Object writeReplace();
69
+ java.lang.Object readResolve();
70
+ }
71
+
72
+ # Keep R8 rules
73
+ -keepattributes SourceFile,LineNumberTable
74
+ -renamesourcefileattribute SourceFile
75
+
76
+ # Keep callback interfaces
77
+ -keep interface com.infilect.** { *; }
78
+ -keep interface infilect.infiviz.** { *; }
79
+
80
+ # Keep broadcast receivers
81
+ -keep class * extends android.content.BroadcastReceiver { *; }
82
+
83
+ # Keep activity event listeners
84
+ -keep class * implements com.facebook.react.bridge.ActivityEventListener { *; }
85
+
86
+ # Keep React Native bridge classes
87
+ -keep class com.facebook.react.bridge.** { *; }
88
+ -keep class com.facebook.react.modules.** { *; }
89
+
90
+ # Keep JSON classes
91
+ -keep class * {
92
+ @com.google.gson.annotations.SerializedName <fields>;
93
+ }
94
+
95
+ # Memory optimization - reduce optimization passes
96
+ -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
97
+ -optimizationpasses 3
98
+ -allowaccessmodification
99
+
100
+ # Keep debug information
101
+ -keepattributes *Annotation*,InnerClasses
102
+ -dontnote
103
+ -dontwarn
104
+
105
+ # Keep string constants
106
+ -keepclassmembers class * {
107
+ @android.webkit.JavascriptInterface <methods>;
108
+ }
109
+
110
+ # Keep webview classes if used
111
+ -keepclassmembers class * {
112
+ @android.webkit.JavascriptInterface <methods>;
113
+ }
114
+
115
+ # Keep all classes in the infivizshots package
116
+ -keep class com.infilect.infivizshotsreactsdk.** {
117
+ *;
118
+ }
119
+
120
+ # Keep all classes in the infiviz package
121
+ -keep class infilect.infiviz.** {
122
+ *;
123
+ }
124
+
125
+ # Keep all classes in the infilect package
126
+ -keep class com.infilect.** {
127
+ *;
128
+ }
129
+
130
+ # Additional memory optimization rules
131
+ -dontusemixedcaseclassnames
132
+ -dontskipnonpubliclibraryclasses
133
+ -verbose
134
+
135
+ # Keep data binding classes if enabled
136
+ -keep class * extends androidx.databinding.ViewDataBinding {
137
+ public static * inflate(...);
138
+ public static * inflate(android.view.LayoutInflater, android.view.ViewGroup, boolean);
139
+ public static * inflate(android.view.LayoutInflater, android.view.ViewGroup, boolean, Object);
140
+ }
141
+
142
+ # Keep view binding classes if enabled
143
+ -keep class * implements androidx.viewbinding.ViewBinding {
144
+ public static * inflate(android.view.LayoutInflater);
145
+ public static * inflate(android.view.LayoutInflater, android.view.ViewGroup, boolean);
146
+ }
@@ -41,6 +41,7 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
41
41
  }
42
42
 
43
43
  private lateinit var irResultCallback: IRResultAndActionsCallback
44
+ private var startCameraCallback: ((String) -> Unit)? = null
44
45
 
45
46
  private val syncCallbackBroadcast = object : BroadcastReceiver() {
46
47
  override fun onReceive(context: Context?, intent: Intent?) {
@@ -90,7 +91,6 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
90
91
  return NAME
91
92
  }
92
93
 
93
-
94
94
  @ReactMethod
95
95
  fun initialize(
96
96
  appID: String,
@@ -151,6 +151,9 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
151
151
  maxPhotoOneGo: Double,
152
152
  promise: Promise
153
153
  ) {
154
+ startCameraCallback = {
155
+ promise.resolve(it)
156
+ }
154
157
  InfiVizShotsSDK.startCamera(
155
158
  currentActivity!!,
156
159
  taskName,
@@ -163,7 +166,7 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
163
166
  22,
164
167
  object : SDKCallback<String> {
165
168
  override fun onSuccess(response: String) {
166
- promise.resolve(response)
169
+ // No Op
167
170
  }
168
171
 
169
172
  override fun onError(e: SDKExceptions) {
@@ -443,14 +446,14 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
443
446
  ) {
444
447
  if (requestCode == 22 && resultCode == Activity.RESULT_OK) {
445
448
  val tempSessionId = data!!.getStringExtra(IntentConstants.TEMP_SESSION_ID)
446
- sendEventToReact(SDKEvent.CAMERA_EVENT, tempSessionId!!)
449
+ startCameraCallback?.invoke(tempSessionId!!)
450
+ startCameraCallback = null
447
451
  }
448
452
  }
449
453
 
450
454
  override fun onNewIntent(p0: Intent?) {
451
455
  }
452
456
 
453
-
454
457
  companion object {
455
458
  const val NAME = "InfivizShotsReactSdk"
456
459
  }
@@ -4,6 +4,5 @@ package com.infilect.infivizshotsreactsdk
4
4
  sealed class SDKEvent(val name: String) {
5
5
  object SYNC_EVENT : SDKEvent("SyncEvent")
6
6
  object SESSION_RESULT_EVENT: SDKEvent("SessionRealTimeResultEvent")
7
- object CAMERA_EVENT: SDKEvent("CameraEvent")
8
7
  object ACTION_GENERATED_EVENT: SDKEvent("ActionsGeneratedEvent")
9
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infilectorg/infiviz-shots-react-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "React Native package for native libraries",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",