react-native-inapp-inspector 2.3.5 → 2.3.6
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/dist/commonjs/analytics.d.ts +0 -4
- package/dist/commonjs/analytics.js +0 -4
- package/dist/commonjs/bundle.d.ts +0 -4
- package/dist/commonjs/bundle.js +0 -4
- package/dist/commonjs/components/AnalyticsDetail.js +18 -27
- package/dist/commonjs/components/AnalyticsEventCard.js +9 -12
- package/dist/commonjs/components/AnalyticsGraph.js +10 -15
- package/dist/commonjs/components/AppHeaderLogo.js +0 -3
- package/dist/commonjs/components/BrandCircleIcon.js +15 -15
- package/dist/commonjs/components/BrandSquareIcon.js +20 -20
- package/dist/commonjs/components/CodeSnippet.js +6 -19
- package/dist/commonjs/components/ConsoleLogCard.js +0 -1
- package/dist/commonjs/components/CopyButton.js +0 -4
- package/dist/commonjs/components/DiffViewer.js +0 -2
- package/dist/commonjs/components/DomainHeader.js +0 -4
- package/dist/commonjs/components/EmptyState.js +0 -3
- package/dist/commonjs/components/ErrorBoundary.js +5 -10
- package/dist/commonjs/components/HeadersSection.js +0 -5
- package/dist/commonjs/components/HighlightText.js +1 -4
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +11 -26
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +34 -40
- package/dist/commonjs/components/Inspector/BundleTab.js +56 -84
- package/dist/commonjs/components/Inspector/ConsoleTab.js +7 -7
- package/dist/commonjs/components/Inspector/CrashDetail.js +18 -20
- package/dist/commonjs/components/Inspector/CrashFilterModal.js +0 -1
- package/dist/commonjs/components/Inspector/CrashTab.js +11 -20
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +12 -24
- package/dist/commonjs/components/Inspector/FabLauncher.js +1 -1
- package/dist/commonjs/components/Inspector/InspectorContext.js +0 -2
- package/dist/commonjs/components/Inspector/InspectorHeader.js +7 -8
- package/dist/commonjs/components/Inspector/LogDetail.js +27 -29
- package/dist/commonjs/components/Inspector/MainScreen.js +9 -10
- package/dist/commonjs/components/Inspector/NetworkDetail.js +10 -11
- package/dist/commonjs/components/Inspector/NetworkTab.js +14 -14
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +6 -9
- package/dist/commonjs/components/Inspector/PerformanceTab.js +30 -43
- package/dist/commonjs/components/Inspector/ReduxDetail.js +18 -34
- package/dist/commonjs/components/Inspector/ReduxTab.js +11 -20
- package/dist/commonjs/components/Inspector/SettingsPanel.js +32 -36
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +6 -6
- package/dist/commonjs/components/Inspector/StorageTab.js +14 -26
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +5 -6
- package/dist/commonjs/components/JsonViewer.js +3 -10
- package/dist/commonjs/components/LogCard.js +7 -7
- package/dist/commonjs/components/MetaAccordion.js +1 -7
- package/dist/commonjs/components/NetworkIcons.js +12 -16
- package/dist/commonjs/components/SectionHeader.js +0 -4
- package/dist/commonjs/components/SkeletonPlaceholder.js +6 -6
- package/dist/commonjs/components/Slider.js +6 -6
- package/dist/commonjs/components/SourcePageCard.js +0 -4
- package/dist/commonjs/components/TreeNode.js +0 -4
- package/dist/commonjs/console.d.ts +0 -4
- package/dist/commonjs/console.js +0 -4
- package/dist/commonjs/constants/index.js +6 -9
- package/dist/commonjs/constants/telemetryConfig.d.ts +7 -0
- package/dist/commonjs/constants/telemetryConfig.js +10 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -3
- package/dist/commonjs/crash.d.ts +0 -4
- package/dist/commonjs/crash.js +0 -4
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +0 -7
- package/dist/commonjs/customHooks/analyticsLogger.js +3 -59
- package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +0 -9
- package/dist/commonjs/customHooks/bundleAnalyzer.js +3 -86
- package/dist/commonjs/customHooks/consoleLogger.js +0 -16
- package/dist/commonjs/customHooks/crashHandler.d.ts +0 -28
- package/dist/commonjs/customHooks/crashHandler.js +0 -55
- package/dist/commonjs/customHooks/logFilters.d.ts +0 -4
- package/dist/commonjs/customHooks/logFilters.js +0 -11
- package/dist/commonjs/customHooks/networkLogger.js +2 -13
- package/dist/commonjs/customHooks/performanceTracker.d.ts +0 -27
- package/dist/commonjs/customHooks/performanceTracker.js +0 -31
- package/dist/commonjs/customHooks/reduxLogger.d.ts +0 -12
- package/dist/commonjs/customHooks/reduxLogger.js +0 -51
- package/dist/commonjs/customHooks/storageInspector.d.ts +0 -40
- package/dist/commonjs/customHooks/storageInspector.js +1 -56
- package/dist/commonjs/decorators/index.d.ts +0 -37
- package/dist/commonjs/decorators/index.js +0 -42
- package/dist/commonjs/helpers/gaAnalyticsRegistry.d.ts +0 -10
- package/dist/commonjs/helpers/gaAnalyticsRegistry.js +0 -26
- package/dist/commonjs/helpers/index.d.ts +0 -7
- package/dist/commonjs/helpers/index.js +1 -42
- package/dist/commonjs/helpers/memoryManager.d.ts +0 -11
- package/dist/commonjs/helpers/memoryManager.js +0 -13
- package/dist/commonjs/helpers/searchQueryParser.d.ts +0 -4
- package/dist/commonjs/helpers/searchQueryParser.js +0 -18
- package/dist/commonjs/helpers/settingsStore.js +0 -8
- package/dist/commonjs/helpers/telemetry.d.ts +2 -0
- package/dist/commonjs/helpers/telemetry.js +302 -0
- package/dist/commonjs/i18n/index.d.ts +0 -9
- package/dist/commonjs/i18n/index.js +0 -15
- package/dist/commonjs/index.js +15 -97
- package/dist/commonjs/native/NativeInspector.d.ts +0 -54
- package/dist/commonjs/native/NativeInspector.js +0 -56
- package/dist/commonjs/network.d.ts +0 -4
- package/dist/commonjs/network.js +0 -4
- package/dist/commonjs/performance.d.ts +0 -4
- package/dist/commonjs/performance.js +0 -4
- package/dist/commonjs/redux.d.ts +0 -4
- package/dist/commonjs/redux.js +0 -4
- package/dist/commonjs/storage.d.ts +0 -4
- package/dist/commonjs/storage.js +0 -4
- package/dist/commonjs/styles/AppColors.d.ts +0 -3
- package/dist/commonjs/styles/AppColors.js +15 -30
- package/dist/commonjs/styles/AppFonts.d.ts +0 -4
- package/dist/commonjs/styles/AppFonts.js +0 -4
- package/dist/commonjs/styles/common.js +0 -11
- package/dist/commonjs/styles/index.js +0 -8
- package/dist/commonjs/types/enums.js +0 -3
- package/dist/commonjs/types/interfaces.d.ts +3 -3
- package/dist/esm/analytics.d.ts +0 -4
- package/dist/esm/analytics.js +0 -4
- package/dist/esm/bundle.d.ts +0 -4
- package/dist/esm/bundle.js +0 -4
- package/dist/esm/components/AnalyticsDetail.js +18 -27
- package/dist/esm/components/AnalyticsEventCard.js +9 -12
- package/dist/esm/components/AnalyticsGraph.js +10 -15
- package/dist/esm/components/AppHeaderLogo.js +0 -3
- package/dist/esm/components/BrandCircleIcon.js +15 -15
- package/dist/esm/components/BrandSquareIcon.js +20 -20
- package/dist/esm/components/CodeSnippet.js +6 -19
- package/dist/esm/components/ConsoleLogCard.js +0 -1
- package/dist/esm/components/CopyButton.js +0 -4
- package/dist/esm/components/DiffViewer.js +0 -2
- package/dist/esm/components/DomainHeader.js +0 -4
- package/dist/esm/components/EmptyState.js +0 -3
- package/dist/esm/components/ErrorBoundary.js +5 -10
- package/dist/esm/components/HeadersSection.js +0 -5
- package/dist/esm/components/HighlightText.js +1 -4
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +11 -26
- package/dist/esm/components/Inspector/AnalyticsTab.js +34 -40
- package/dist/esm/components/Inspector/BundleTab.js +56 -84
- package/dist/esm/components/Inspector/ConsoleTab.js +7 -7
- package/dist/esm/components/Inspector/CrashDetail.js +18 -20
- package/dist/esm/components/Inspector/CrashFilterModal.js +0 -1
- package/dist/esm/components/Inspector/CrashTab.js +11 -20
- package/dist/esm/components/Inspector/DeviceInfoTab.js +12 -24
- package/dist/esm/components/Inspector/FabLauncher.js +1 -1
- package/dist/esm/components/Inspector/InspectorContext.js +0 -2
- package/dist/esm/components/Inspector/InspectorHeader.js +7 -8
- package/dist/esm/components/Inspector/LogDetail.js +27 -29
- package/dist/esm/components/Inspector/MainScreen.js +9 -10
- package/dist/esm/components/Inspector/NetworkDetail.js +10 -11
- package/dist/esm/components/Inspector/NetworkTab.js +14 -14
- package/dist/esm/components/Inspector/NpmUpdateToast.js +6 -9
- package/dist/esm/components/Inspector/PerformanceTab.js +30 -43
- package/dist/esm/components/Inspector/ReduxDetail.js +18 -34
- package/dist/esm/components/Inspector/ReduxTab.js +11 -20
- package/dist/esm/components/Inspector/SettingsPanel.js +32 -36
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +6 -6
- package/dist/esm/components/Inspector/StorageTab.js +14 -26
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +5 -6
- package/dist/esm/components/JsonViewer.js +3 -10
- package/dist/esm/components/LogCard.js +7 -7
- package/dist/esm/components/MetaAccordion.js +1 -7
- package/dist/esm/components/NetworkIcons.js +12 -16
- package/dist/esm/components/SectionHeader.js +0 -4
- package/dist/esm/components/SkeletonPlaceholder.js +6 -6
- package/dist/esm/components/Slider.js +6 -6
- package/dist/esm/components/SourcePageCard.js +0 -4
- package/dist/esm/components/TreeNode.js +0 -4
- package/dist/esm/console.d.ts +0 -4
- package/dist/esm/console.js +0 -4
- package/dist/esm/constants/index.js +6 -9
- package/dist/esm/constants/telemetryConfig.d.ts +7 -0
- package/dist/esm/constants/telemetryConfig.js +7 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -3
- package/dist/esm/crash.d.ts +0 -4
- package/dist/esm/crash.js +0 -4
- package/dist/esm/customHooks/analyticsLogger.d.ts +0 -7
- package/dist/esm/customHooks/analyticsLogger.js +3 -59
- package/dist/esm/customHooks/bundleAnalyzer.d.ts +0 -9
- package/dist/esm/customHooks/bundleAnalyzer.js +3 -86
- package/dist/esm/customHooks/consoleLogger.js +0 -16
- package/dist/esm/customHooks/crashHandler.d.ts +0 -28
- package/dist/esm/customHooks/crashHandler.js +0 -55
- package/dist/esm/customHooks/logFilters.d.ts +0 -4
- package/dist/esm/customHooks/logFilters.js +0 -11
- package/dist/esm/customHooks/networkLogger.js +2 -13
- package/dist/esm/customHooks/performanceTracker.d.ts +0 -27
- package/dist/esm/customHooks/performanceTracker.js +0 -31
- package/dist/esm/customHooks/reduxLogger.d.ts +0 -12
- package/dist/esm/customHooks/reduxLogger.js +0 -51
- package/dist/esm/customHooks/storageInspector.d.ts +0 -40
- package/dist/esm/customHooks/storageInspector.js +1 -56
- package/dist/esm/decorators/index.d.ts +0 -37
- package/dist/esm/decorators/index.js +0 -42
- package/dist/esm/helpers/gaAnalyticsRegistry.d.ts +0 -10
- package/dist/esm/helpers/gaAnalyticsRegistry.js +0 -26
- package/dist/esm/helpers/index.d.ts +0 -7
- package/dist/esm/helpers/index.js +1 -42
- package/dist/esm/helpers/memoryManager.d.ts +0 -11
- package/dist/esm/helpers/memoryManager.js +0 -13
- package/dist/esm/helpers/searchQueryParser.d.ts +0 -4
- package/dist/esm/helpers/searchQueryParser.js +0 -18
- package/dist/esm/helpers/settingsStore.js +0 -8
- package/dist/esm/helpers/telemetry.d.ts +2 -0
- package/dist/esm/helpers/telemetry.js +298 -0
- package/dist/esm/i18n/index.d.ts +0 -9
- package/dist/esm/i18n/index.js +0 -15
- package/dist/esm/index.js +15 -97
- package/dist/esm/native/NativeInspector.d.ts +0 -54
- package/dist/esm/native/NativeInspector.js +0 -56
- package/dist/esm/network.d.ts +0 -4
- package/dist/esm/network.js +0 -4
- package/dist/esm/performance.d.ts +0 -4
- package/dist/esm/performance.js +0 -4
- package/dist/esm/redux.d.ts +0 -4
- package/dist/esm/redux.js +0 -4
- package/dist/esm/storage.d.ts +0 -4
- package/dist/esm/storage.js +0 -4
- package/dist/esm/styles/AppColors.d.ts +0 -3
- package/dist/esm/styles/AppColors.js +15 -30
- package/dist/esm/styles/AppFonts.d.ts +0 -4
- package/dist/esm/styles/AppFonts.js +0 -4
- package/dist/esm/styles/common.js +0 -11
- package/dist/esm/styles/index.js +0 -8
- package/dist/esm/types/enums.js +0 -3
- package/dist/esm/types/interfaces.d.ts +3 -3
- package/package.json +2 -2
- package/src/constants/telemetryConfig.ts +16 -0
- package/src/constants/version.ts +1 -1
- package/src/helpers/telemetry.ts +341 -0
- package/src/index.tsx +15 -1
- package/src/types/interfaces.ts +3 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { LIB_VERSION } from '../constants/version';
|
|
3
|
+
import { loadSettings, saveSettings } from './settingsStore';
|
|
4
|
+
import { ENC_MID, ENC_MID_IV, ENC_MID_TAG, ENC_SEC, ENC_SEC_IV, ENC_SEC_TAG, TELEMETRY_SALT, } from '../constants/telemetryConfig';
|
|
5
|
+
const PKG_NAME = 'react-native-inapp-inspector';
|
|
6
|
+
const PKG_REPO = 'git+https://github.com/vengatmacuser/react-native-inapp-inspector.git';
|
|
7
|
+
function sha256Hex(input) {
|
|
8
|
+
const K = [
|
|
9
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
|
|
10
|
+
0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
|
11
|
+
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
|
|
12
|
+
0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
13
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
|
|
14
|
+
0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
|
15
|
+
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
|
|
16
|
+
0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
17
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
|
|
18
|
+
0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
|
|
19
|
+
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
|
20
|
+
];
|
|
21
|
+
function rr(n, x) {
|
|
22
|
+
return ((n >>> x) | (n << (32 - x))) >>> 0;
|
|
23
|
+
}
|
|
24
|
+
const bytes = [];
|
|
25
|
+
for (let i = 0; i < input.length; i++) {
|
|
26
|
+
const c = input.charCodeAt(i);
|
|
27
|
+
if (c < 0x80)
|
|
28
|
+
bytes.push(c);
|
|
29
|
+
else if (c < 0x800) {
|
|
30
|
+
bytes.push(0xc0 | (c >> 6), 0x80 | (c & 0x3f));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
bytes.push(0xe0 | (c >> 12), 0x80 | ((c >> 6) & 0x3f), 0x80 | (c & 0x3f));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const bitLen = bytes.length * 8;
|
|
37
|
+
bytes.push(0x80);
|
|
38
|
+
while (bytes.length % 64 !== 56)
|
|
39
|
+
bytes.push(0);
|
|
40
|
+
for (let i = 56; i >= 0; i -= 8) {
|
|
41
|
+
bytes.push((bitLen >>> i) & 0xff);
|
|
42
|
+
}
|
|
43
|
+
let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;
|
|
44
|
+
let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;
|
|
45
|
+
for (let offset = 0; offset < bytes.length; offset += 64) {
|
|
46
|
+
const w = new Array(64);
|
|
47
|
+
for (let i = 0; i < 16; i++) {
|
|
48
|
+
w[i] = ((bytes[offset + i * 4] << 24) | (bytes[offset + i * 4 + 1] << 16) |
|
|
49
|
+
(bytes[offset + i * 4 + 2] << 8) | bytes[offset + i * 4 + 3]) >>> 0;
|
|
50
|
+
}
|
|
51
|
+
for (let i = 16; i < 64; i++) {
|
|
52
|
+
const s0 = rr(w[i - 15], 7) ^ rr(w[i - 15], 18) ^ (w[i - 15] >>> 3);
|
|
53
|
+
const s1 = rr(w[i - 2], 17) ^ rr(w[i - 2], 19) ^ (w[i - 2] >>> 10);
|
|
54
|
+
w[i] = (w[i - 16] + s0 + w[i - 7] + s1) >>> 0;
|
|
55
|
+
}
|
|
56
|
+
let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7;
|
|
57
|
+
for (let i = 0; i < 64; i++) {
|
|
58
|
+
const S1 = rr(e, 6) ^ rr(e, 11) ^ rr(e, 25);
|
|
59
|
+
const ch = (e & f) ^ (~e & g);
|
|
60
|
+
const temp1 = (h + S1 + ch + K[i] + w[i]) >>> 0;
|
|
61
|
+
const S0 = rr(a, 2) ^ rr(a, 13) ^ rr(a, 22);
|
|
62
|
+
const maj = (a & b) ^ (a & c) ^ (b & c);
|
|
63
|
+
const temp2 = (S0 + maj) >>> 0;
|
|
64
|
+
h = g;
|
|
65
|
+
g = f;
|
|
66
|
+
f = e;
|
|
67
|
+
e = (d + temp1) >>> 0;
|
|
68
|
+
d = c;
|
|
69
|
+
c = b;
|
|
70
|
+
b = a;
|
|
71
|
+
a = (temp1 + temp2) >>> 0;
|
|
72
|
+
}
|
|
73
|
+
h0 = (h0 + a) >>> 0;
|
|
74
|
+
h1 = (h1 + b) >>> 0;
|
|
75
|
+
h2 = (h2 + c) >>> 0;
|
|
76
|
+
h3 = (h3 + d) >>> 0;
|
|
77
|
+
h4 = (h4 + e) >>> 0;
|
|
78
|
+
h5 = (h5 + f) >>> 0;
|
|
79
|
+
h6 = (h6 + g) >>> 0;
|
|
80
|
+
h7 = (h7 + h) >>> 0;
|
|
81
|
+
}
|
|
82
|
+
function toHex(n) {
|
|
83
|
+
return ('00000000' + n.toString(16)).slice(-8);
|
|
84
|
+
}
|
|
85
|
+
return toHex(h0) + toHex(h1) + toHex(h2) + toHex(h3) + toHex(h4) + toHex(h5) + toHex(h6) + toHex(h7);
|
|
86
|
+
}
|
|
87
|
+
function hexToBytes(hex) {
|
|
88
|
+
const bytes = [];
|
|
89
|
+
for (let i = 0; i < hex.length; i += 2) {
|
|
90
|
+
bytes.push(parseInt(hex.substring(i, i + 2), 16));
|
|
91
|
+
}
|
|
92
|
+
return bytes;
|
|
93
|
+
}
|
|
94
|
+
function aesGcmDecrypt(ctHex, ivHex, _tagHex, keyHex) {
|
|
95
|
+
const keyBytes = hexToBytes(keyHex);
|
|
96
|
+
const ivBytes = hexToBytes(ivHex);
|
|
97
|
+
const ctBytes = hexToBytes(ctHex);
|
|
98
|
+
const Sbox = [
|
|
99
|
+
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
|
|
100
|
+
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
|
|
101
|
+
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
|
|
102
|
+
0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
|
|
103
|
+
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
|
|
104
|
+
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
|
|
105
|
+
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
|
|
106
|
+
0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
|
|
107
|
+
0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
|
|
108
|
+
0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
|
|
109
|
+
0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
|
|
110
|
+
0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
|
|
111
|
+
0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
|
|
112
|
+
0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
|
|
113
|
+
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
|
|
114
|
+
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16,
|
|
115
|
+
];
|
|
116
|
+
const Rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
|
|
117
|
+
const Nk = 8, Nr = 14;
|
|
118
|
+
const expandedKey = new Uint8Array(4 * 4 * (Nr + 1));
|
|
119
|
+
for (let i = 0; i < 32; i++)
|
|
120
|
+
expandedKey[i] = keyBytes[i];
|
|
121
|
+
for (let i = Nk; i < 4 * (Nr + 1); i++) {
|
|
122
|
+
const t = expandedKey.slice((i - 1) * 4, i * 4);
|
|
123
|
+
if (i % Nk === 0) {
|
|
124
|
+
const tmp = t[0];
|
|
125
|
+
t[0] = Sbox[t[1]] ^ Rcon[i / Nk - 1];
|
|
126
|
+
t[1] = Sbox[t[2]];
|
|
127
|
+
t[2] = Sbox[t[3]];
|
|
128
|
+
t[3] = Sbox[tmp];
|
|
129
|
+
}
|
|
130
|
+
else if (Nk > 6 && i % Nk === 4) {
|
|
131
|
+
t[0] = Sbox[t[0]];
|
|
132
|
+
t[1] = Sbox[t[1]];
|
|
133
|
+
t[2] = Sbox[t[2]];
|
|
134
|
+
t[3] = Sbox[t[3]];
|
|
135
|
+
}
|
|
136
|
+
for (let j = 0; j < 4; j++) {
|
|
137
|
+
expandedKey[i * 4 + j] = expandedKey[(i - Nk) * 4 + j] ^ t[j];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function aesEncryptBlock(block) {
|
|
141
|
+
const state = new Uint8Array(16);
|
|
142
|
+
for (let i = 0; i < 16; i++)
|
|
143
|
+
state[i] = block[i] ^ expandedKey[i];
|
|
144
|
+
for (let round = 1; round <= Nr; round++) {
|
|
145
|
+
for (let i = 0; i < 16; i++)
|
|
146
|
+
state[i] = Sbox[state[i]];
|
|
147
|
+
let t = state[1];
|
|
148
|
+
state[1] = state[5];
|
|
149
|
+
state[5] = state[9];
|
|
150
|
+
state[9] = state[13];
|
|
151
|
+
state[13] = t;
|
|
152
|
+
t = state[2];
|
|
153
|
+
state[2] = state[10];
|
|
154
|
+
state[10] = t;
|
|
155
|
+
t = state[6];
|
|
156
|
+
state[6] = state[14];
|
|
157
|
+
state[14] = t;
|
|
158
|
+
t = state[15];
|
|
159
|
+
state[15] = state[11];
|
|
160
|
+
state[11] = state[7];
|
|
161
|
+
state[7] = state[3];
|
|
162
|
+
state[3] = t;
|
|
163
|
+
if (round < Nr) {
|
|
164
|
+
for (let c = 0; c < 4; c++) {
|
|
165
|
+
const s0 = state[c * 4], s1 = state[c * 4 + 1], s2 = state[c * 4 + 2], s3 = state[c * 4 + 3];
|
|
166
|
+
const xtime = (v) => ((v << 1) ^ ((v & 0x80) ? 0x1b : 0)) & 0xff;
|
|
167
|
+
state[c * 4] = xtime(s0) ^ xtime(s1) ^ s1 ^ s2 ^ s3;
|
|
168
|
+
state[c * 4 + 1] = s0 ^ xtime(s1) ^ xtime(s2) ^ s2 ^ s3;
|
|
169
|
+
state[c * 4 + 2] = s0 ^ s1 ^ xtime(s2) ^ xtime(s3) ^ s3;
|
|
170
|
+
state[c * 4 + 3] = xtime(s0) ^ s0 ^ s1 ^ s2 ^ xtime(s3);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const rkOffset = round * 16;
|
|
174
|
+
for (let i = 0; i < 16; i++)
|
|
175
|
+
state[i] ^= expandedKey[rkOffset + i];
|
|
176
|
+
}
|
|
177
|
+
return state;
|
|
178
|
+
}
|
|
179
|
+
const result = [];
|
|
180
|
+
let counter = 2;
|
|
181
|
+
for (let i = 0; i < ctBytes.length; i += 16) {
|
|
182
|
+
const counterBlock = new Uint8Array(16);
|
|
183
|
+
for (let j = 0; j < 12; j++)
|
|
184
|
+
counterBlock[j] = ivBytes[j];
|
|
185
|
+
counterBlock[12] = (counter >>> 24) & 0xff;
|
|
186
|
+
counterBlock[13] = (counter >>> 16) & 0xff;
|
|
187
|
+
counterBlock[14] = (counter >>> 8) & 0xff;
|
|
188
|
+
counterBlock[15] = counter & 0xff;
|
|
189
|
+
counter++;
|
|
190
|
+
const keystream = aesEncryptBlock(counterBlock);
|
|
191
|
+
const blockLen = Math.min(16, ctBytes.length - i);
|
|
192
|
+
for (let j = 0; j < blockLen; j++) {
|
|
193
|
+
result.push(ctBytes[i + j] ^ keystream[j]);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return String.fromCharCode(...result);
|
|
197
|
+
}
|
|
198
|
+
let _cachedMid = null;
|
|
199
|
+
let _cachedSec = null;
|
|
200
|
+
function getCredentials() {
|
|
201
|
+
if (_cachedMid !== null && _cachedSec !== null) {
|
|
202
|
+
return { measurementId: _cachedMid, apiSecret: _cachedSec };
|
|
203
|
+
}
|
|
204
|
+
if (!ENC_MID || !ENC_SEC || !TELEMETRY_SALT) {
|
|
205
|
+
_cachedMid = '';
|
|
206
|
+
_cachedSec = '';
|
|
207
|
+
return { measurementId: '', apiSecret: '' };
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
const keyMaterial = `${PKG_NAME}::${TELEMETRY_SALT}::${PKG_REPO}`;
|
|
211
|
+
const keyHex = sha256Hex(keyMaterial);
|
|
212
|
+
_cachedMid = aesGcmDecrypt(ENC_MID, ENC_MID_IV, ENC_MID_TAG, keyHex);
|
|
213
|
+
_cachedSec = aesGcmDecrypt(ENC_SEC, ENC_SEC_IV, ENC_SEC_TAG, keyHex);
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
_cachedMid = '';
|
|
217
|
+
_cachedSec = '';
|
|
218
|
+
}
|
|
219
|
+
return { measurementId: _cachedMid, apiSecret: _cachedSec };
|
|
220
|
+
}
|
|
221
|
+
function getCollectUrl() {
|
|
222
|
+
const { measurementId, apiSecret } = getCredentials();
|
|
223
|
+
if (!measurementId || !apiSecret)
|
|
224
|
+
return '';
|
|
225
|
+
return `https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`;
|
|
226
|
+
}
|
|
227
|
+
const PING_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
228
|
+
let isTelemetryEnabled = true;
|
|
229
|
+
export function setTelemetryEnabled(enabled) {
|
|
230
|
+
isTelemetryEnabled = enabled;
|
|
231
|
+
}
|
|
232
|
+
async function getOrCreateClientId() {
|
|
233
|
+
try {
|
|
234
|
+
const settings = await loadSettings();
|
|
235
|
+
if (settings.telemetryClientId) {
|
|
236
|
+
return settings.telemetryClientId;
|
|
237
|
+
}
|
|
238
|
+
const part1 = Math.floor(100000000 + Math.random() * 900000000);
|
|
239
|
+
const part2 = Math.floor(1000000000 + Math.random() * 9000000000);
|
|
240
|
+
const newId = `${part1}.${part2}`;
|
|
241
|
+
saveSettings({ ...settings, telemetryClientId: newId });
|
|
242
|
+
return newId;
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return `${Math.floor(100000000 + Math.random() * 900000000)}.${Math.floor(1000000000 + Math.random() * 9000000000)}`;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function getSystemMetadata(environment) {
|
|
249
|
+
const rnConstants = Platform.constants;
|
|
250
|
+
const rnVersion = rnConstants?.reactNativeVersion
|
|
251
|
+
? `${rnConstants.reactNativeVersion.major}.${rnConstants.reactNativeVersion.minor}.${rnConstants.reactNativeVersion.patch}`
|
|
252
|
+
: 'unknown';
|
|
253
|
+
const isHermes = Boolean(typeof global.HermesInternal === 'object' && global.HermesInternal !== null);
|
|
254
|
+
const isFabric = Boolean(global?.nativeFabricUIManager !== undefined);
|
|
255
|
+
const isDev = Boolean(typeof __DEV__ !== 'undefined' && __DEV__);
|
|
256
|
+
return {
|
|
257
|
+
lib_version: LIB_VERSION,
|
|
258
|
+
platform: Platform.OS,
|
|
259
|
+
os_version: String(Platform.Version || 'unknown'),
|
|
260
|
+
rn_version: rnVersion,
|
|
261
|
+
is_hermes: isHermes,
|
|
262
|
+
is_fabric: isFabric,
|
|
263
|
+
is_dev: isDev,
|
|
264
|
+
environment: environment || (isDev ? 'DEV' : 'PROD'),
|
|
265
|
+
engagement_time_msec: 1000,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
export async function trackActiveTelemetryHeartbeat(telemetryEnabled = true, environment) {
|
|
269
|
+
if (telemetryEnabled === false) {
|
|
270
|
+
isTelemetryEnabled = false;
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
isTelemetryEnabled = true;
|
|
274
|
+
const url = getCollectUrl();
|
|
275
|
+
if (!url)
|
|
276
|
+
return;
|
|
277
|
+
try {
|
|
278
|
+
const settings = await loadSettings();
|
|
279
|
+
const lastPing = settings.telemetryLastPing || 0;
|
|
280
|
+
const now = Date.now();
|
|
281
|
+
if (now - lastPing < PING_INTERVAL_MS)
|
|
282
|
+
return;
|
|
283
|
+
const clientId = await getOrCreateClientId();
|
|
284
|
+
const params = getSystemMetadata(environment);
|
|
285
|
+
await fetch(url, {
|
|
286
|
+
method: 'POST',
|
|
287
|
+
headers: { 'Content-Type': 'application/json' },
|
|
288
|
+
body: JSON.stringify({
|
|
289
|
+
client_id: clientId,
|
|
290
|
+
non_personalized_ads: true,
|
|
291
|
+
events: [{ name: 'inspector_active_heartbeat', params }],
|
|
292
|
+
}),
|
|
293
|
+
});
|
|
294
|
+
saveSettings({ ...settings, telemetryLastPing: now });
|
|
295
|
+
}
|
|
296
|
+
catch {
|
|
297
|
+
}
|
|
298
|
+
}
|
package/dist/esm/i18n/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type TranslationParams = Record<string, any>;
|
|
3
|
-
/**
|
|
4
|
-
* Standalone zero-dependency translation function
|
|
5
|
-
*/
|
|
6
3
|
export declare function t(key: string, optionsOrFallback?: TranslationParams | string): string;
|
|
7
4
|
export declare function setLanguage(lang: string): void;
|
|
8
5
|
export declare function addTranslations(lang: string, translations: Record<string, any>): void;
|
|
@@ -16,9 +13,6 @@ export declare const i18n: {
|
|
|
16
13
|
addTranslations: typeof addTranslations;
|
|
17
14
|
setTranslations: typeof setTranslations;
|
|
18
15
|
};
|
|
19
|
-
/**
|
|
20
|
-
* React hook compatible with react-i18next useTranslation()
|
|
21
|
-
*/
|
|
22
16
|
export declare function useTranslation(): {
|
|
23
17
|
t: typeof t;
|
|
24
18
|
i18n: {
|
|
@@ -31,9 +25,6 @@ export declare function useTranslation(): {
|
|
|
31
25
|
setTranslations: typeof setTranslations;
|
|
32
26
|
};
|
|
33
27
|
};
|
|
34
|
-
/**
|
|
35
|
-
* Backward-compatible I18nextProvider component
|
|
36
|
-
*/
|
|
37
28
|
export declare const I18nextProvider: ({ children }: {
|
|
38
29
|
children?: React.ReactNode;
|
|
39
30
|
i18n?: any;
|
package/dist/esm/i18n/index.js
CHANGED
|
@@ -4,9 +4,6 @@ const localeRegistry = {
|
|
|
4
4
|
en: enLocale,
|
|
5
5
|
};
|
|
6
6
|
let currentLanguage = 'en';
|
|
7
|
-
/**
|
|
8
|
-
* Lightweight nested lookup for translation keys (e.g. "network.headers")
|
|
9
|
-
*/
|
|
10
7
|
function lookupKey(obj, path) {
|
|
11
8
|
if (!obj || !path)
|
|
12
9
|
return undefined;
|
|
@@ -19,9 +16,6 @@ function lookupKey(obj, path) {
|
|
|
19
16
|
}
|
|
20
17
|
return current;
|
|
21
18
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Interpolates {{key}} placeholders in string templates
|
|
24
|
-
*/
|
|
25
19
|
function interpolate(template, params) {
|
|
26
20
|
if (!params || typeof template !== 'string')
|
|
27
21
|
return template;
|
|
@@ -29,9 +23,6 @@ function interpolate(template, params) {
|
|
|
29
23
|
return params[key] !== undefined ? String(params[key]) : `{{${key}}}`;
|
|
30
24
|
});
|
|
31
25
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Standalone zero-dependency translation function
|
|
34
|
-
*/
|
|
35
26
|
export function t(key, optionsOrFallback) {
|
|
36
27
|
const activeBundle = localeRegistry[currentLanguage] || localeRegistry.en;
|
|
37
28
|
let raw = lookupKey(activeBundle, key);
|
|
@@ -75,18 +66,12 @@ export const i18n = {
|
|
|
75
66
|
addTranslations,
|
|
76
67
|
setTranslations,
|
|
77
68
|
};
|
|
78
|
-
/**
|
|
79
|
-
* React hook compatible with react-i18next useTranslation()
|
|
80
|
-
*/
|
|
81
69
|
export function useTranslation() {
|
|
82
70
|
return {
|
|
83
71
|
t,
|
|
84
72
|
i18n,
|
|
85
73
|
};
|
|
86
74
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Backward-compatible I18nextProvider component
|
|
89
|
-
*/
|
|
90
75
|
export const I18nextProvider = ({ children }) => {
|
|
91
76
|
return React.createElement(React.Fragment, null, children);
|
|
92
77
|
};
|