Skip to content

Commit 7d73a0a

Browse files
committed
💎 Bump version to 8.0.6
2 parents 6c1bc25 + 34e0e5b commit 7d73a0a

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public void setCrashReportingEnabled(boolean isEnabled) {
504504
private void sendJSCrashByReflection(String exceptionObject, boolean isHandled) {
505505
try {
506506
JSONObject newJSONObject = new JSONObject(exceptionObject);
507-
Method method = getMethod(Class.forName("com.instabug.crash.InstabugCrash"), "reportException");
507+
Method method = getMethod(Class.forName("com.instabug.crash.CrashReporting"), "reportException", JSONObject.class, boolean.class);
508508
if (method != null) {
509509
method.invoke(null, newJSONObject, isHandled);
510510
}
@@ -520,12 +520,22 @@ private void sendJSCrashByReflection(String exceptionObject, boolean isHandled)
520520

521521
}
522522

523-
public static Method getMethod(Class clazz, String methodName) {
523+
private static Method getMethod(Class clazz, String methodName, Class... parameterType) {
524524
final Method[] methods = clazz.getDeclaredMethods();
525+
525526
for (Method method : methods) {
526-
if (method.getName().equals(methodName)) {
527-
method.setAccessible(true);
528-
return method;
527+
if (method.getName().equals(methodName) && method.getParameterTypes().length ==
528+
parameterType.length) {
529+
for (int i = 0; i < 2; i++) {
530+
if (method.getParameterTypes()[i] == parameterType[i]) {
531+
if (i == method.getParameterTypes().length - 1) {
532+
method.setAccessible(true);
533+
return method;
534+
}
535+
} else {
536+
break;
537+
}
538+
}
529539
}
530540
}
531541
return null;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "instabug-reactnative",
3-
"version": "8.0.5",
3+
"version": "8.0.6",
44
"description": "React Native plugin for integrating the Instabug SDK",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)