react-native-inapp-inspector 1.1.28 → 1.1.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.
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +29 -80
- package/dist/commonjs/components/AnalyticsDetail.js +668 -108
- package/dist/commonjs/components/AppHeaderLogo.js +15 -15
- package/dist/commonjs/components/ConsoleLogCard.js +112 -66
- package/dist/commonjs/components/CopyButton.js +15 -1
- package/dist/commonjs/components/DomainHeader.js +64 -32
- package/dist/commonjs/components/HighlightText.js +7 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +332 -221
- package/dist/commonjs/components/Inspector/ConsoleTab.js +162 -56
- package/dist/commonjs/components/Inspector/InspectorHeader.js +70 -119
- package/dist/commonjs/components/Inspector/LogDetail.js +53 -17
- package/dist/commonjs/components/Inspector/MainScreen.js +4 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.js +24 -24
- package/dist/commonjs/components/Inspector/NetworkTab.js +4 -1
- package/dist/commonjs/components/Inspector/ReduxDetail.js +237 -42
- package/dist/commonjs/components/Inspector/ReduxTab.js +456 -35
- package/dist/commonjs/components/JsonViewer.js +26 -4
- package/dist/commonjs/components/LogCard.js +103 -11
- package/dist/commonjs/components/NetworkIcons.js +19 -10
- package/dist/commonjs/components/Toast.d.ts +3 -0
- package/dist/commonjs/components/Toast.js +152 -0
- package/dist/commonjs/components/TouchableScale.d.ts +1 -0
- package/dist/commonjs/components/TouchableScale.js +3 -3
- package/dist/commonjs/components/TreeNode.js +12 -2
- package/dist/commonjs/constants/index.js +6 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/reduxLogger.js +128 -5
- package/dist/commonjs/helpers/index.d.ts +4 -0
- package/dist/commonjs/helpers/index.js +107 -92
- package/dist/commonjs/helpers/toast.d.ts +4 -0
- package/dist/commonjs/helpers/toast.js +20 -0
- package/dist/commonjs/i18n/locales/en.json +49 -3
- package/dist/commonjs/styles/AppColors.d.ts +6 -0
- package/dist/commonjs/styles/AppColors.js +6 -0
- package/dist/commonjs/styles/index.d.ts +82 -15
- package/dist/commonjs/styles/index.js +92 -26
- package/dist/commonjs/types/interfaces.d.ts +7 -0
- package/dist/esm/components/AnalyticsDetail.js +670 -110
- package/dist/esm/components/AppHeaderLogo.js +15 -15
- package/dist/esm/components/ConsoleLogCard.js +114 -68
- package/dist/esm/components/CopyButton.js +15 -1
- package/dist/esm/components/DomainHeader.js +64 -32
- package/dist/esm/components/HighlightText.js +7 -1
- package/dist/esm/components/Inspector/AnalyticsTab.js +334 -223
- package/dist/esm/components/Inspector/ConsoleTab.js +163 -57
- package/dist/esm/components/Inspector/InspectorHeader.js +71 -120
- package/dist/esm/components/Inspector/LogDetail.js +55 -19
- package/dist/esm/components/Inspector/MainScreen.js +4 -0
- package/dist/esm/components/Inspector/NetworkDetail.js +25 -25
- package/dist/esm/components/Inspector/NetworkTab.js +4 -1
- package/dist/esm/components/Inspector/ReduxDetail.js +239 -44
- package/dist/esm/components/Inspector/ReduxTab.js +458 -37
- package/dist/esm/components/JsonViewer.js +26 -4
- package/dist/esm/components/LogCard.js +105 -13
- package/dist/esm/components/NetworkIcons.js +19 -10
- package/dist/esm/components/Toast.d.ts +3 -0
- package/dist/esm/components/Toast.js +117 -0
- package/dist/esm/components/TouchableScale.d.ts +1 -0
- package/dist/esm/components/TouchableScale.js +3 -3
- package/dist/esm/components/TreeNode.js +12 -2
- package/dist/esm/constants/index.js +6 -6
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/reduxLogger.js +128 -5
- package/dist/esm/helpers/index.d.ts +4 -0
- package/dist/esm/helpers/index.js +102 -92
- package/dist/esm/helpers/toast.d.ts +4 -0
- package/dist/esm/helpers/toast.js +15 -0
- package/dist/esm/i18n/locales/en.json +49 -3
- package/dist/esm/styles/AppColors.d.ts +6 -0
- package/dist/esm/styles/AppColors.js +6 -0
- package/dist/esm/styles/index.d.ts +82 -15
- package/dist/esm/styles/index.js +92 -26
- package/dist/esm/types/interfaces.d.ts +7 -0
- package/ios/NetworkInspectorModule.m +0 -10
- package/package.json +13 -10
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
package com.inappinspector;
|
|
2
2
|
|
|
3
|
-
import android.content.ClipData;
|
|
4
|
-
import android.content.ClipboardManager;
|
|
5
|
-
import android.content.Context;
|
|
6
3
|
import android.os.Handler;
|
|
7
4
|
import android.os.Looper;
|
|
8
5
|
import android.util.Log;
|
|
@@ -31,7 +28,6 @@ public class NetworkInspectorModule extends ReactContextBaseJavaModule {
|
|
|
31
28
|
public NetworkInspectorModule(ReactApplicationContext reactContext) {
|
|
32
29
|
super(reactContext);
|
|
33
30
|
this.reactContext = reactContext;
|
|
34
|
-
setupNativeCrashProtection();
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
@NonNull
|
|
@@ -41,55 +37,39 @@ public class NetworkInspectorModule extends ReactContextBaseJavaModule {
|
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
private void setupNativeCrashProtection() {
|
|
44
|
-
if (isProtectionEnabled)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
|
|
49
|
-
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
|
50
|
-
@Override
|
|
51
|
-
public void uncaughtException(@NonNull Thread thread, @NonNull Throwable throwable) {
|
|
52
|
-
try {
|
|
53
|
-
StringWriter sw = new StringWriter();
|
|
54
|
-
PrintWriter pw = new PrintWriter(sw);
|
|
55
|
-
throwable.printStackTrace(pw);
|
|
56
|
-
String stackTrace = sw.toString();
|
|
57
|
-
String message = throwable.getMessage() != null ? throwable.getMessage() : throwable.toString();
|
|
58
|
-
|
|
59
|
-
Log.e(TAG, "Intercepted Android Native Crash: " + message, throwable);
|
|
60
|
-
|
|
61
|
-
sendCrashEventToJS(message, stackTrace, thread.getName());
|
|
62
|
-
} catch (Exception e) {
|
|
63
|
-
Log.e(TAG, "Failed to dispatch native crash event", e);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Keep main looper processing to prevent instant process exit
|
|
67
|
-
if (Looper.myLooper() != null) {
|
|
68
|
-
while (true) {
|
|
69
|
-
try {
|
|
70
|
-
Looper.loop();
|
|
71
|
-
} catch (Throwable inner) {
|
|
72
|
-
Log.e(TAG, "Caught inner loop exception", inner);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
} catch (Exception e) {
|
|
79
|
-
Log.e(TAG, "Error installing uncaught exception handler", e);
|
|
40
|
+
if (isProtectionEnabled) {
|
|
41
|
+
return;
|
|
80
42
|
}
|
|
43
|
+
defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
|
|
44
|
+
Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> {
|
|
45
|
+
try {
|
|
46
|
+
handleNativeCrash(thread, throwable);
|
|
47
|
+
} catch (Exception e) {
|
|
48
|
+
Log.e(TAG, "Error in native crash handler", e);
|
|
49
|
+
} finally {
|
|
50
|
+
if (defaultHandler != null) {
|
|
51
|
+
defaultHandler.uncaughtException(thread, throwable);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
isProtectionEnabled = true;
|
|
56
|
+
Log.i(TAG, "Native crash protection enabled");
|
|
81
57
|
}
|
|
82
58
|
|
|
83
|
-
private void
|
|
59
|
+
private void handleNativeCrash(Thread thread, Throwable throwable) {
|
|
84
60
|
try {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
61
|
+
StringWriter sw = new StringWriter();
|
|
62
|
+
PrintWriter pw = new PrintWriter(sw);
|
|
63
|
+
throwable.printStackTrace(pw);
|
|
64
|
+
String stackTrace = sw.toString();
|
|
65
|
+
|
|
66
|
+
WritableMap params = Arguments.createMap();
|
|
67
|
+
params.putString("error", throwable.getMessage() != null ? throwable.getMessage() : "Unknown native crash");
|
|
68
|
+
params.putString("name", throwable.getClass().getName());
|
|
69
|
+
params.putString("stack", stackTrace);
|
|
70
|
+
params.putDouble("timestamp", System.currentTimeMillis());
|
|
71
|
+
|
|
72
|
+
if (reactContext.hasActiveReactInstance()) {
|
|
93
73
|
reactContext
|
|
94
74
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
95
75
|
.emit("onNativeCrash", params);
|
|
@@ -105,37 +85,6 @@ public class NetworkInspectorModule extends ReactContextBaseJavaModule {
|
|
|
105
85
|
promise.resolve(true);
|
|
106
86
|
}
|
|
107
87
|
|
|
108
|
-
@ReactMethod
|
|
109
|
-
public void copyToClipboard(String text, Promise promise) {
|
|
110
|
-
try {
|
|
111
|
-
Handler mainHandler = new Handler(Looper.getMainLooper());
|
|
112
|
-
mainHandler.post(() -> {
|
|
113
|
-
try {
|
|
114
|
-
ClipboardManager clipboard = (ClipboardManager) reactContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
115
|
-
if (clipboard != null) {
|
|
116
|
-
ClipData clip = ClipData.newPlainText("NetworkInspector", text != null ? text : "");
|
|
117
|
-
clipboard.setPrimaryClip(clip);
|
|
118
|
-
if (promise != null) {
|
|
119
|
-
promise.resolve(true);
|
|
120
|
-
}
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (promise != null) {
|
|
124
|
-
promise.resolve(false);
|
|
125
|
-
}
|
|
126
|
-
} catch (Exception e) {
|
|
127
|
-
if (promise != null) {
|
|
128
|
-
promise.reject("CLIPBOARD_ERROR", e.getMessage(), e);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
} catch (Exception e) {
|
|
133
|
-
if (promise != null) {
|
|
134
|
-
promise.reject("CLIPBOARD_ERROR", e.getMessage(), e);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
88
|
@ReactMethod
|
|
140
89
|
public void addListener(String eventName) {
|
|
141
90
|
// Required for RN built-in Event Emitter
|