@bits-innovate/react-native-vstarcam 1.0.29 → 1.0.31

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.
@@ -218,7 +218,16 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
218
218
  // Log JNIApi methods to find hidden functionality (Sound Wave, SmartConfig, etc.)
219
219
  Log.d(TAG, "=== JNIApi Methods ===");
220
220
  for (Method m : jniApiClass.getDeclaredMethods()) {
221
- Log.d(TAG, " -> " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
221
+ StringBuilder sb = new StringBuilder();
222
+ sb.append(" -> ").append(m.getReturnType().getSimpleName()).append(" ");
223
+ sb.append(m.getName()).append("(");
224
+ Class<?>[] params = m.getParameterTypes();
225
+ for (int i = 0; i < params.length; i++) {
226
+ sb.append(params[i].getName());
227
+ if (i < params.length - 1) sb.append(", ");
228
+ }
229
+ sb.append(")");
230
+ Log.d(TAG, sb.toString());
222
231
  }
223
232
  Log.d(TAG, "======================");
224
233
 
@@ -231,15 +240,15 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
231
240
  // Log all methods on each listener for debugging
232
241
  Log.d(TAG, "ClientStateListener methods:");
233
242
  for (Method m : stateListenerClass.getDeclaredMethods()) {
234
- Log.d(TAG, " -> " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
243
+ Log.d(TAG, " -> " + m.getReturnType().getSimpleName() + " " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
235
244
  }
236
245
  Log.d(TAG, "ClientCommandListener methods:");
237
246
  for (Method m : commandListenerClass.getDeclaredMethods()) {
238
- Log.d(TAG, " -> " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
247
+ Log.d(TAG, " -> " + m.getReturnType().getSimpleName() + " " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
239
248
  }
240
249
  Log.d(TAG, "ClientReleaseListener methods:");
241
250
  for (Method m : releaseListenerClass.getDeclaredMethods()) {
242
- Log.d(TAG, " -> " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
251
+ Log.d(TAG, " -> " + m.getReturnType().getSimpleName() + " " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
243
252
  }
244
253
 
245
254
  // Initialize P2P system with listeners
@@ -289,10 +298,14 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
289
298
  Log.e(TAG, "Error in stateListener callback", e);
290
299
  }
291
300
 
292
- // Handle return type
301
+ // Robust return type handling to prevent JNI signature mismatch crash
293
302
  Class<?> returnType = method.getReturnType();
294
303
  if (returnType.equals(int.class) || returnType.equals(Integer.class)) {
295
304
  return 0;
305
+ } else if (returnType.equals(long.class) || returnType.equals(Long.class)) {
306
+ return 0L;
307
+ } else if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
308
+ return true; // Default to true for success indicators
296
309
  }
297
310
  return null;
298
311
  }
@@ -328,10 +341,14 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
328
341
  Log.e(TAG, "Error in commandListener callback", e);
329
342
  }
330
343
 
331
- // Handle return type
344
+ // Robust return type handling to prevent JNI signature mismatch crash
332
345
  Class<?> returnType = method.getReturnType();
333
346
  if (returnType.equals(int.class) || returnType.equals(Integer.class)) {
334
347
  return 0;
348
+ } else if (returnType.equals(long.class) || returnType.equals(Long.class)) {
349
+ return 0L;
350
+ } else if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
351
+ return true;
335
352
  }
336
353
  return null;
337
354
  }
@@ -351,10 +368,14 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
351
368
  Log.e(TAG, "Error in releaseListener callback", e);
352
369
  }
353
370
 
354
- // Handle return type
371
+ // Robust return type handling to prevent JNI signature mismatch crash
355
372
  Class<?> returnType = method.getReturnType();
356
373
  if (returnType.equals(int.class) || returnType.equals(Integer.class)) {
357
374
  return 0;
375
+ } else if (returnType.equals(long.class) || returnType.equals(Long.class)) {
376
+ return 0L;
377
+ } else if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
378
+ return true;
358
379
  }
359
380
  return null;
360
381
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",