react-native-inapp-inspector 2.3.19 → 2.3.21
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 +14 -14
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +67 -0
- package/dist/commonjs/analytics.js +1 -24
- package/dist/commonjs/bundle.js +1 -16
- package/dist/commonjs/capture.js +1 -35
- package/dist/commonjs/components/AnalyticsDetail.js +92 -623
- package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
- package/dist/commonjs/components/AnalyticsGraph.js +70 -370
- package/dist/commonjs/components/AnimatedEntrance.js +1 -11
- package/dist/commonjs/components/AppHeaderLogo.js +7 -134
- package/dist/commonjs/components/BrandCircleIcon.js +73 -118
- package/dist/commonjs/components/BrandSquareIcon.js +63 -108
- package/dist/commonjs/components/CodeSnippet.js +48 -623
- package/dist/commonjs/components/ConsoleLogCard.js +63 -537
- package/dist/commonjs/components/CopyButton.js +3 -89
- package/dist/commonjs/components/DiffViewer.js +19 -83
- package/dist/commonjs/components/DomainHeader.js +27 -127
- package/dist/commonjs/components/EmptyState.js +10 -87
- package/dist/commonjs/components/EndOfListFooter.js +7 -81
- package/dist/commonjs/components/ErrorBoundary.js +72 -566
- package/dist/commonjs/components/HeadersSection.js +31 -110
- package/dist/commonjs/components/HighlightText.js +17 -58
- package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/commonjs/components/Inspector/AboutModal.js +243 -0
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
- package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
- package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
- package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
- package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
- package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
- package/dist/commonjs/components/Inspector/DebuggingTab.js +74 -875
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
- package/dist/commonjs/components/Inspector/FabLauncher.js +42 -466
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
- package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
- package/dist/commonjs/components/Inspector/InspectorHeader.js +191 -1110
- package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
- package/dist/commonjs/components/Inspector/MainScreen.js +52 -335
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +97 -644
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +90 -605
- package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
- package/dist/commonjs/components/Inspector/NetworkDetail.js +89 -411
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
- package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +18 -434
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
- package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
- package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
- package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
- package/dist/commonjs/components/Inspector/SettingsPanel.js +427 -3807
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
- package/dist/commonjs/components/Inspector/TabBar.js +36 -334
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +37 -412
- package/dist/commonjs/components/JsonViewer.js +168 -381
- package/dist/commonjs/components/LogCard.js +57 -567
- package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
- package/dist/commonjs/components/MetaAccordion.js +69 -238
- package/dist/commonjs/components/MiniBarChart.js +3 -56
- package/dist/commonjs/components/MiniLineChart.js +3 -58
- package/dist/commonjs/components/NetworkIcons.d.ts +13 -0
- package/dist/commonjs/components/NetworkIcons.js +521 -1022
- package/dist/commonjs/components/QRCodeView.js +5 -79
- package/dist/commonjs/components/SectionHeader.js +15 -37
- package/dist/commonjs/components/SegmentedTabs.js +7 -62
- package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Slider.js +15 -243
- package/dist/commonjs/components/SourcePageCard.js +30 -89
- package/dist/commonjs/components/Toast.js +5 -147
- package/dist/commonjs/components/TouchableScale.js +3 -24
- package/dist/commonjs/components/TreeNode.js +55 -130
- package/dist/commonjs/console.js +1 -16
- package/dist/commonjs/constants/index.js +1 -32
- package/dist/commonjs/constants/telemetryConfig.js +1 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -4
- package/dist/commonjs/crash.js +1 -23
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
- package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
- package/dist/commonjs/customHooks/consoleLogger.js +6 -445
- package/dist/commonjs/customHooks/crashHandler.js +7 -656
- package/dist/commonjs/customHooks/logFilters.js +1 -23
- package/dist/commonjs/customHooks/networkLogger.js +2 -536
- package/dist/commonjs/customHooks/performanceTracker.js +63 -750
- package/dist/commonjs/customHooks/reduxLogger.js +2 -313
- package/dist/commonjs/customHooks/storageInspector.js +1 -435
- package/dist/commonjs/customHooks/useAccordion.js +1 -18
- package/dist/commonjs/decorators/index.js +1 -100
- package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +8 -921
- package/dist/commonjs/helpers/memoryManager.js +1 -99
- package/dist/commonjs/helpers/qrGenerator.js +1 -367
- package/dist/commonjs/helpers/remoteConfig.js +1 -165
- package/dist/commonjs/helpers/searchQueryParser.js +1 -62
- package/dist/commonjs/helpers/settingsStore.js +1 -144
- package/dist/commonjs/helpers/telemetry.js +1 -501
- package/dist/commonjs/helpers/toast.js +1 -20
- package/dist/commonjs/i18n/index.js +1 -90
- package/dist/commonjs/i18n/locales/en.json +1 -1140
- package/dist/commonjs/index.js +5 -2168
- package/dist/commonjs/metro.js +6 -468
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/native/NativeInspector.js +1 -415
- package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
- package/dist/commonjs/network.js +1 -13
- package/dist/commonjs/performance.js +1 -29
- package/dist/commonjs/redux.js +1 -20
- package/dist/commonjs/storage.js +1 -14
- package/dist/commonjs/styles/AppColors.js +1 -423
- package/dist/commonjs/styles/AppFonts.js +1 -17
- package/dist/commonjs/styles/common.js +1 -190
- package/dist/commonjs/styles/index.d.ts +6 -0
- package/dist/commonjs/styles/index.js +1 -1589
- package/dist/commonjs/types/enums.d.ts +0 -1
- package/dist/commonjs/types/enums.js +1 -152
- package/dist/commonjs/types/index.js +1 -18
- package/dist/commonjs/types/interfaces.d.ts +2 -2
- package/dist/commonjs/types/interfaces.js +1 -2
- package/dist/esm/analytics.js +1 -2
- package/dist/esm/bundle.js +1 -2
- package/dist/esm/capture.js +1 -32
- package/dist/esm/components/AnalyticsDetail.js +171 -664
- package/dist/esm/components/AnalyticsEventCard.js +77 -335
- package/dist/esm/components/AnalyticsGraph.js +95 -357
- package/dist/esm/components/AnimatedEntrance.js +1 -6
- package/dist/esm/components/AppHeaderLogo.js +7 -94
- package/dist/esm/components/BrandCircleIcon.js +114 -119
- package/dist/esm/components/BrandSquareIcon.js +73 -78
- package/dist/esm/components/CodeSnippet.js +58 -595
- package/dist/esm/components/ConsoleLogCard.js +91 -526
- package/dist/esm/components/CopyButton.js +3 -51
- package/dist/esm/components/DiffViewer.js +22 -48
- package/dist/esm/components/DomainHeader.js +43 -138
- package/dist/esm/components/EmptyState.js +17 -56
- package/dist/esm/components/EndOfListFooter.js +15 -83
- package/dist/esm/components/ErrorBoundary.js +125 -582
- package/dist/esm/components/HeadersSection.js +52 -93
- package/dist/esm/components/HighlightText.js +17 -53
- package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/esm/components/Inspector/AboutModal.js +243 -0
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
- package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
- package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
- package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
- package/dist/esm/components/Inspector/CrashDetail.js +236 -747
- package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
- package/dist/esm/components/Inspector/CrashTab.js +177 -711
- package/dist/esm/components/Inspector/DebuggingTab.js +164 -925
- package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
- package/dist/esm/components/Inspector/FabLauncher.js +68 -454
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
- package/dist/esm/components/Inspector/InspectorContext.js +1 -12
- package/dist/esm/components/Inspector/InspectorHeader.js +282 -1163
- package/dist/esm/components/Inspector/LogDetail.js +235 -1023
- package/dist/esm/components/Inspector/MainScreen.js +78 -323
- package/dist/esm/components/Inspector/MediaGalleryTab.js +143 -650
- package/dist/esm/components/Inspector/MediaPreviewModal.js +138 -613
- package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
- package/dist/esm/components/Inspector/NetworkDetail.js +138 -455
- package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
- package/dist/esm/components/Inspector/NetworkTab.js +125 -517
- package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
- package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
- package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
- package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
- package/dist/esm/components/Inspector/ReduxTab.js +144 -722
- package/dist/esm/components/Inspector/SettingsPanel.js +643 -3985
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Inspector/StorageTab.js +172 -866
- package/dist/esm/components/Inspector/TabBar.js +45 -305
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +80 -418
- package/dist/esm/components/JsonViewer.js +179 -354
- package/dist/esm/components/LogCard.js +93 -565
- package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
- package/dist/esm/components/MetaAccordion.js +136 -267
- package/dist/esm/components/MiniBarChart.js +3 -18
- package/dist/esm/components/MiniLineChart.js +3 -20
- package/dist/esm/components/NetworkIcons.d.ts +13 -0
- package/dist/esm/components/NetworkIcons.js +523 -838
- package/dist/esm/components/QRCodeView.js +8 -45
- package/dist/esm/components/SectionHeader.js +22 -39
- package/dist/esm/components/SegmentedTabs.js +8 -58
- package/dist/esm/components/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Slider.js +24 -213
- package/dist/esm/components/SourcePageCard.js +65 -86
- package/dist/esm/components/Toast.js +10 -117
- package/dist/esm/components/TouchableScale.js +3 -19
- package/dist/esm/components/TreeNode.js +58 -95
- package/dist/esm/console.js +1 -2
- package/dist/esm/constants/index.js +1 -28
- package/dist/esm/constants/telemetryConfig.js +1 -3
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/crash.js +1 -2
- package/dist/esm/customHooks/analyticsLogger.js +1 -230
- package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
- package/dist/esm/customHooks/consoleLogger.js +6 -432
- package/dist/esm/customHooks/crashHandler.js +7 -630
- package/dist/esm/customHooks/logFilters.js +1 -20
- package/dist/esm/customHooks/networkLogger.js +2 -519
- package/dist/esm/customHooks/performanceTracker.js +63 -723
- package/dist/esm/customHooks/reduxLogger.js +2 -293
- package/dist/esm/customHooks/storageInspector.js +1 -418
- package/dist/esm/customHooks/useAccordion.js +1 -16
- package/dist/esm/decorators/index.js +1 -95
- package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +8 -861
- package/dist/esm/helpers/memoryManager.js +1 -91
- package/dist/esm/helpers/qrGenerator.js +1 -364
- package/dist/esm/helpers/remoteConfig.js +1 -160
- package/dist/esm/helpers/searchQueryParser.js +1 -59
- package/dist/esm/helpers/settingsStore.js +1 -134
- package/dist/esm/helpers/telemetry.js +1 -489
- package/dist/esm/helpers/toast.js +1 -15
- package/dist/esm/i18n/index.js +1 -78
- package/dist/esm/i18n/locales/en.json +1 -1140
- package/dist/esm/index.js +7 -1982
- package/dist/esm/metro.js +6 -459
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/native/NativeInspector.js +1 -382
- package/dist/esm/native/NativeNetworkInspector.js +1 -2
- package/dist/esm/network.js +1 -1
- package/dist/esm/performance.js +1 -2
- package/dist/esm/redux.js +1 -1
- package/dist/esm/storage.js +1 -1
- package/dist/esm/styles/AppColors.js +1 -417
- package/dist/esm/styles/AppFonts.js +1 -13
- package/dist/esm/styles/common.js +1 -186
- package/dist/esm/styles/index.d.ts +6 -0
- package/dist/esm/styles/index.js +1 -1551
- package/dist/esm/types/enums.d.ts +0 -1
- package/dist/esm/types/enums.js +1 -149
- package/dist/esm/types/index.js +1 -2
- package/dist/esm/types/interfaces.d.ts +2 -2
- package/dist/esm/types/interfaces.js +1 -1
- package/ios/NetworkInspectorModule.mm +60 -12
- package/package.json +5 -3
- package/src/native/NativeInspector.ts +18 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +0 -7
- package/dist/commonjs/components/Inspector/FeedbackModal.js +0 -552
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +0 -7
- package/dist/esm/components/Inspector/FeedbackModal.js +0 -515
- package/src/analytics.ts +0 -35
- package/src/bundle.ts +0 -25
- package/src/capture.ts +0 -109
- package/src/components/AnalyticsDetail.tsx +0 -870
- package/src/components/AnalyticsEventCard.tsx +0 -444
- package/src/components/AnalyticsGraph.tsx +0 -583
- package/src/components/AnimatedEntrance.tsx +0 -20
- package/src/components/AppHeaderLogo.tsx +0 -143
- package/src/components/BrandCircleIcon.tsx +0 -144
- package/src/components/BrandSquareIcon.tsx +0 -184
- package/src/components/CodeSnippet.tsx +0 -725
- package/src/components/ConsoleLogCard.tsx +0 -679
- package/src/components/CopyButton.tsx +0 -87
- package/src/components/DiffViewer.tsx +0 -82
- package/src/components/DomainHeader.tsx +0 -224
- package/src/components/EmptyState.tsx +0 -97
- package/src/components/EndOfListFooter.tsx +0 -100
- package/src/components/ErrorBoundary.tsx +0 -688
- package/src/components/HeadersSection.tsx +0 -172
- package/src/components/HighlightText.tsx +0 -100
- package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
- package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
- package/src/components/Inspector/BundleTab.tsx +0 -4768
- package/src/components/Inspector/ConsoleTab.tsx +0 -726
- package/src/components/Inspector/CrashDetail.tsx +0 -997
- package/src/components/Inspector/CrashFilterModal.tsx +0 -721
- package/src/components/Inspector/CrashTab.tsx +0 -933
- package/src/components/Inspector/DebuggingTab.tsx +0 -1103
- package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
- package/src/components/Inspector/FabLauncher.tsx +0 -590
- package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
- package/src/components/Inspector/FeedbackModal.tsx +0 -626
- package/src/components/Inspector/InspectorContext.tsx +0 -28
- package/src/components/Inspector/InspectorHeader.tsx +0 -1583
- package/src/components/Inspector/LogDetail.tsx +0 -1431
- package/src/components/Inspector/MainScreen.tsx +0 -460
- package/src/components/Inspector/MediaGalleryTab.tsx +0 -829
- package/src/components/Inspector/MediaPreviewModal.tsx +0 -783
- package/src/components/Inspector/NavigationTracker.tsx +0 -13
- package/src/components/Inspector/NetworkDetail.tsx +0 -778
- package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
- package/src/components/Inspector/NetworkTab.tsx +0 -820
- package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
- package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
- package/src/components/Inspector/PerformanceTab.tsx +0 -1967
- package/src/components/Inspector/ReduxDetail.tsx +0 -1651
- package/src/components/Inspector/ReduxTab.tsx +0 -987
- package/src/components/Inspector/SettingsPanel.tsx +0 -5136
- package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Inspector/StorageTab.tsx +0 -1159
- package/src/components/Inspector/TabBar.tsx +0 -431
- package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
- package/src/components/JsonViewer.tsx +0 -549
- package/src/components/LogCard.tsx +0 -694
- package/src/components/LogSyntaxHighlighter.tsx +0 -178
- package/src/components/MetaAccordion.tsx +0 -355
- package/src/components/MiniBarChart.tsx +0 -42
- package/src/components/MiniLineChart.tsx +0 -33
- package/src/components/NetworkIcons.tsx +0 -2655
- package/src/components/QRCodeView.tsx +0 -75
- package/src/components/SectionHeader.tsx +0 -101
- package/src/components/SegmentedTabs.tsx +0 -84
- package/src/components/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Slider.tsx +0 -300
- package/src/components/SourcePageCard.tsx +0 -150
- package/src/components/Toast.tsx +0 -131
- package/src/components/TouchableScale.tsx +0 -61
- package/src/components/TreeNode.tsx +0 -171
- package/src/console.ts +0 -24
- package/src/constants/index.ts +0 -41
- package/src/constants/telemetryConfig.ts +0 -4
- package/src/constants/version.ts +0 -3
- package/src/crash.ts +0 -32
- package/src/customHooks/analyticsLogger.ts +0 -336
- package/src/customHooks/bundleAnalyzer.ts +0 -1256
- package/src/customHooks/consoleLogger.ts +0 -530
- package/src/customHooks/crashHandler.ts +0 -944
- package/src/customHooks/logFilters.ts +0 -32
- package/src/customHooks/networkLogger.ts +0 -624
- package/src/customHooks/performanceTracker.ts +0 -1014
- package/src/customHooks/reduxLogger.ts +0 -406
- package/src/customHooks/storageInspector.ts +0 -513
- package/src/customHooks/useAccordion.tsx +0 -27
- package/src/decorators/index.ts +0 -184
- package/src/helpers/gaAnalyticsRegistry.ts +0 -204
- package/src/helpers/index.ts +0 -1092
- package/src/helpers/memoryManager.ts +0 -138
- package/src/helpers/qrGenerator.ts +0 -430
- package/src/helpers/remoteConfig.ts +0 -212
- package/src/helpers/searchQueryParser.ts +0 -84
- package/src/helpers/settingsStore.ts +0 -171
- package/src/helpers/telemetry.ts +0 -568
- package/src/helpers/toast.ts +0 -17
- package/src/i18n/index.ts +0 -104
- package/src/i18n/locales/en.json +0 -1141
- package/src/index.tsx +0 -2650
- package/src/metro.ts +0 -598
- package/src/network.ts +0 -22
- package/src/performance.ts +0 -38
- package/src/redux.ts +0 -23
- package/src/storage.ts +0 -18
- package/src/styles/AppColors.ts +0 -455
- package/src/styles/AppFonts.ts +0 -26
- package/src/styles/common.ts +0 -209
- package/src/styles/index.ts +0 -1606
- package/src/types/enums.ts +0 -210
- package/src/types/index.ts +0 -34
- package/src/types/interfaces.ts +0 -535
|
@@ -1,91 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { pruneNetworkLogs } from '../customHooks/networkLogger';
|
|
3
|
-
import { pruneConsoleLogs } from '../customHooks/consoleLogger';
|
|
4
|
-
import { pruneReduxHistory } from '../customHooks/reduxLogger';
|
|
5
|
-
import { pruneAnalyticsLogs } from '../customHooks/analyticsLogger';
|
|
6
|
-
import { pruneCrashRecords, addCrashBreadcrumb } from '../customHooks/crashHandler';
|
|
7
|
-
import { prunePerformanceEvents } from '../customHooks/performanceTracker';
|
|
8
|
-
import { showToast } from './toast';
|
|
9
|
-
const memoryListeners = new Set();
|
|
10
|
-
let appStateSubscription = null;
|
|
11
|
-
let isMemoryWarningHandlerActive = false;
|
|
12
|
-
let lastPruneTimestamp = 0;
|
|
13
|
-
export const pruneAllLogs = (triggeredBy = 'manual', targetRetentionPct = 0.5) => {
|
|
14
|
-
const targetPct = Math.max(0.1, Math.min(1.0, targetRetentionPct));
|
|
15
|
-
const prunedNetwork = pruneNetworkLogs(undefined);
|
|
16
|
-
const prunedConsole = pruneConsoleLogs(undefined);
|
|
17
|
-
const prunedRedux = pruneReduxHistory(undefined);
|
|
18
|
-
const prunedAnalytics = pruneAnalyticsLogs(undefined);
|
|
19
|
-
const prunedCrashes = pruneCrashRecords(undefined);
|
|
20
|
-
const prunedPerformance = prunePerformanceEvents(undefined);
|
|
21
|
-
const totalPruned = prunedNetwork +
|
|
22
|
-
prunedConsole +
|
|
23
|
-
prunedRedux +
|
|
24
|
-
prunedAnalytics +
|
|
25
|
-
prunedCrashes +
|
|
26
|
-
prunedPerformance;
|
|
27
|
-
lastPruneTimestamp = Date.now();
|
|
28
|
-
if (typeof globalThis.gc === 'function') {
|
|
29
|
-
try {
|
|
30
|
-
globalThis.gc();
|
|
31
|
-
}
|
|
32
|
-
catch { }
|
|
33
|
-
}
|
|
34
|
-
const summary = {
|
|
35
|
-
timestamp: lastPruneTimestamp,
|
|
36
|
-
prunedNetwork,
|
|
37
|
-
prunedConsole,
|
|
38
|
-
prunedRedux,
|
|
39
|
-
prunedAnalytics,
|
|
40
|
-
prunedCrashes,
|
|
41
|
-
prunedPerformance,
|
|
42
|
-
totalPruned,
|
|
43
|
-
triggeredBy,
|
|
44
|
-
};
|
|
45
|
-
try {
|
|
46
|
-
addCrashBreadcrumb('system', `[MemoryManager] Low memory auto-prune executed (${triggeredBy}). Freed ${totalPruned} log records.`, summary);
|
|
47
|
-
}
|
|
48
|
-
catch { }
|
|
49
|
-
memoryListeners.forEach(listener => {
|
|
50
|
-
try {
|
|
51
|
-
listener(summary);
|
|
52
|
-
}
|
|
53
|
-
catch { }
|
|
54
|
-
});
|
|
55
|
-
return summary;
|
|
56
|
-
};
|
|
57
|
-
export const setupMemoryWarningHandler = () => {
|
|
58
|
-
if (isMemoryWarningHandlerActive) {
|
|
59
|
-
return () => { };
|
|
60
|
-
}
|
|
61
|
-
isMemoryWarningHandlerActive = true;
|
|
62
|
-
try {
|
|
63
|
-
appStateSubscription = AppState.addEventListener('memoryWarning', (state) => {
|
|
64
|
-
const summary = pruneAllLogs('memory-warning', 0.5);
|
|
65
|
-
try {
|
|
66
|
-
showToast(`Memory Warning: Auto-pruned ${summary.totalPruned} inspector logs`);
|
|
67
|
-
}
|
|
68
|
-
catch { }
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
}
|
|
73
|
-
return () => {
|
|
74
|
-
if (appStateSubscription) {
|
|
75
|
-
try {
|
|
76
|
-
appStateSubscription.remove();
|
|
77
|
-
}
|
|
78
|
-
catch { }
|
|
79
|
-
appStateSubscription = null;
|
|
80
|
-
}
|
|
81
|
-
isMemoryWarningHandlerActive = false;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
export const subscribeMemoryWarning = (listener) => {
|
|
85
|
-
memoryListeners.add(listener);
|
|
86
|
-
return () => {
|
|
87
|
-
memoryListeners.delete(listener);
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
export const getLastPruneTimestamp = () => lastPruneTimestamp;
|
|
91
|
-
export const isMemoryHandlerActive = () => isMemoryWarningHandlerActive;
|
|
1
|
+
import{AppState as y}from"react-native";import{pruneNetworkLogs as g}from"../customHooks/networkLogger";import{pruneConsoleLogs as h}from"../customHooks/consoleLogger";import{pruneReduxHistory as x}from"../customHooks/reduxLogger";import{pruneAnalyticsLogs as M}from"../customHooks/analyticsLogger";import{pruneCrashRecords as L,addCrashBreadcrumb as w}from"../customHooks/crashHandler";import{prunePerformanceEvents as A}from"../customHooks/performanceTracker";import{showToast as P}from"./toast";const s=new Set;let r=null,t=!1,a=0;export const pruneAllLogs=(e="manual",n=.5)=>{const b=Math.max(.1,Math.min(1,n)),m=g(void 0),c=h(void 0),u=x(void 0),i=M(void 0),p=L(void 0),d=A(void 0),l=m+c+u+i+p+d;if(a=Date.now(),typeof globalThis.gc=="function")try{globalThis.gc()}catch{}const o={timestamp:a,prunedNetwork:m,prunedConsole:c,prunedRedux:u,prunedAnalytics:i,prunedCrashes:p,prunedPerformance:d,totalPruned:l,triggeredBy:e};try{w("system",`[MemoryManager] Low memory auto-prune executed (${e}). Freed ${l} log records.`,o)}catch{}return s.forEach(f=>{try{f(o)}catch{}}),o},setupMemoryWarningHandler=()=>{if(t)return()=>{};t=!0;try{r=y.addEventListener("memoryWarning",e=>{const n=pruneAllLogs("memory-warning",.5);try{P(`Memory Warning: Auto-pruned ${n.totalPruned} inspector logs`)}catch{}})}catch{}return()=>{if(r){try{r.remove()}catch{}r=null}t=!1}},subscribeMemoryWarning=e=>(s.add(e),()=>{s.delete(e)}),getLastPruneTimestamp=()=>a,isMemoryHandlerActive=()=>t;
|
|
@@ -1,364 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
L: 1,
|
|
3
|
-
M: 0,
|
|
4
|
-
Q: 3,
|
|
5
|
-
H: 2,
|
|
6
|
-
};
|
|
7
|
-
const EXP_TABLE = new Uint8Array(256);
|
|
8
|
-
const LOG_TABLE = new Uint8Array(256);
|
|
9
|
-
(function initGaloisField() {
|
|
10
|
-
let x = 1;
|
|
11
|
-
for (let i = 0; i < 255; i++) {
|
|
12
|
-
EXP_TABLE[i] = x;
|
|
13
|
-
LOG_TABLE[x] = i;
|
|
14
|
-
x <<= 1;
|
|
15
|
-
if (x & 0x100) {
|
|
16
|
-
x ^= 0x11d;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
EXP_TABLE[255] = EXP_TABLE[0];
|
|
20
|
-
})();
|
|
21
|
-
function glog(n) {
|
|
22
|
-
if (n < 1)
|
|
23
|
-
throw new Error(`glog(${n})`);
|
|
24
|
-
return LOG_TABLE[n];
|
|
25
|
-
}
|
|
26
|
-
function gexp(n) {
|
|
27
|
-
while (n < 0)
|
|
28
|
-
n += 255;
|
|
29
|
-
while (n >= 256)
|
|
30
|
-
n -= 255;
|
|
31
|
-
return EXP_TABLE[n];
|
|
32
|
-
}
|
|
33
|
-
class Polynomial {
|
|
34
|
-
constructor(num, shift = 0) {
|
|
35
|
-
let offset = 0;
|
|
36
|
-
while (offset < num.length && num[offset] === 0) {
|
|
37
|
-
offset++;
|
|
38
|
-
}
|
|
39
|
-
this.num = new Array(num.length - offset + shift);
|
|
40
|
-
for (let i = 0; i < num.length - offset; i++) {
|
|
41
|
-
this.num[i] = num[i + offset];
|
|
42
|
-
}
|
|
43
|
-
for (let i = num.length - offset; i < this.num.length; i++) {
|
|
44
|
-
this.num[i] = 0;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
get(index) {
|
|
48
|
-
return this.num[index] || 0;
|
|
49
|
-
}
|
|
50
|
-
getLength() {
|
|
51
|
-
return this.num.length;
|
|
52
|
-
}
|
|
53
|
-
multiply(e) {
|
|
54
|
-
const num = new Array(this.getLength() + e.getLength() - 1).fill(0);
|
|
55
|
-
for (let i = 0; i < this.getLength(); i++) {
|
|
56
|
-
for (let j = 0; j < e.getLength(); j++) {
|
|
57
|
-
num[i + j] ^= gexp(glog(this.get(i)) + glog(e.get(j)));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return new Polynomial(num);
|
|
61
|
-
}
|
|
62
|
-
mod(e) {
|
|
63
|
-
if (this.getLength() - e.getLength() < 0) {
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
const ratio = glog(this.get(0)) - glog(e.get(0));
|
|
67
|
-
const num = new Array(this.getLength());
|
|
68
|
-
for (let i = 0; i < this.getLength(); i++) {
|
|
69
|
-
num[i] = this.get(i);
|
|
70
|
-
}
|
|
71
|
-
for (let i = 0; i < e.getLength(); i++) {
|
|
72
|
-
num[i] ^= gexp(glog(e.get(i)) + ratio);
|
|
73
|
-
}
|
|
74
|
-
return new Polynomial(num).mod(e);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const RS_BLOCK_TABLE = [
|
|
78
|
-
[[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9]],
|
|
79
|
-
[[1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16]],
|
|
80
|
-
[[1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13]],
|
|
81
|
-
[[1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9]],
|
|
82
|
-
[[1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12]],
|
|
83
|
-
[[2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15]],
|
|
84
|
-
[[2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14]],
|
|
85
|
-
[[2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15]],
|
|
86
|
-
[[2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13]],
|
|
87
|
-
[[2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16]],
|
|
88
|
-
];
|
|
89
|
-
const PATTERN_POSITION_TABLE = [
|
|
90
|
-
[],
|
|
91
|
-
[6, 18],
|
|
92
|
-
[6, 22],
|
|
93
|
-
[6, 26],
|
|
94
|
-
[6, 30],
|
|
95
|
-
[6, 34],
|
|
96
|
-
[6, 22, 38],
|
|
97
|
-
[6, 24, 42],
|
|
98
|
-
[6, 26, 46],
|
|
99
|
-
[6, 28, 50],
|
|
100
|
-
];
|
|
101
|
-
const G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0);
|
|
102
|
-
const G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1);
|
|
103
|
-
function getBCHTypeInfo(data) {
|
|
104
|
-
let d = data << 10;
|
|
105
|
-
while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
|
|
106
|
-
d ^= G15 << (getBCHDigit(d) - getBCHDigit(G15));
|
|
107
|
-
}
|
|
108
|
-
return ((data << 10) | d) ^ G15_MASK;
|
|
109
|
-
}
|
|
110
|
-
function getBCHDigit(data) {
|
|
111
|
-
let digit = 0;
|
|
112
|
-
while (data !== 0) {
|
|
113
|
-
digit++;
|
|
114
|
-
data >>>= 1;
|
|
115
|
-
}
|
|
116
|
-
return digit;
|
|
117
|
-
}
|
|
118
|
-
function getMask(maskPattern, i, j) {
|
|
119
|
-
switch (maskPattern) {
|
|
120
|
-
case 0: return (i + j) % 2 === 0;
|
|
121
|
-
case 1: return i % 2 === 0;
|
|
122
|
-
case 2: return j % 3 === 0;
|
|
123
|
-
case 3: return (i + j) % 3 === 0;
|
|
124
|
-
case 4: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0;
|
|
125
|
-
case 5: return ((i * j) % 2) + ((i * j) % 3) === 0;
|
|
126
|
-
case 6: return (((i * j) % 2) + ((i * j) % 3)) % 2 === 0;
|
|
127
|
-
case 7: return (((i * j) % 3) + ((i + j) % 2)) % 2 === 0;
|
|
128
|
-
default: return false;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
class BitBuffer {
|
|
132
|
-
constructor() {
|
|
133
|
-
this.buffer = [];
|
|
134
|
-
this.length = 0;
|
|
135
|
-
}
|
|
136
|
-
get(index) {
|
|
137
|
-
const bufIndex = Math.floor(index / 8);
|
|
138
|
-
return ((this.buffer[bufIndex] >>> (7 - (index % 8))) & 1) === 1;
|
|
139
|
-
}
|
|
140
|
-
put(num, length) {
|
|
141
|
-
for (let i = 0; i < length; i++) {
|
|
142
|
-
this.putBit(((num >>> (length - i - 1)) & 1) === 1);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
putBit(bit) {
|
|
146
|
-
const bufIndex = Math.floor(this.length / 8);
|
|
147
|
-
if (this.buffer.length <= bufIndex) {
|
|
148
|
-
this.buffer.push(0);
|
|
149
|
-
}
|
|
150
|
-
if (bit) {
|
|
151
|
-
this.buffer[bufIndex] |= 0x80 >>> (this.length % 8);
|
|
152
|
-
}
|
|
153
|
-
this.length++;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function getErrorCorrectionPolynomial(errorCorrectionLength) {
|
|
157
|
-
let a = new Polynomial([1], 0);
|
|
158
|
-
for (let i = 0; i < errorCorrectionLength; i++) {
|
|
159
|
-
a = a.multiply(new Polynomial([1, gexp(i)], 0));
|
|
160
|
-
}
|
|
161
|
-
return a;
|
|
162
|
-
}
|
|
163
|
-
export function generateQRMatrix(text, ecc = 'M') {
|
|
164
|
-
const eccLevel = QR_ECC_LEVEL[ecc] ?? 0;
|
|
165
|
-
const utf8Bytes = [];
|
|
166
|
-
for (let i = 0; i < text.length; i++) {
|
|
167
|
-
let c = text.charCodeAt(i);
|
|
168
|
-
if (c < 128) {
|
|
169
|
-
utf8Bytes.push(c);
|
|
170
|
-
}
|
|
171
|
-
else if (c < 2048) {
|
|
172
|
-
utf8Bytes.push((c >> 6) | 192);
|
|
173
|
-
utf8Bytes.push((c & 63) | 128);
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
utf8Bytes.push((c >> 12) | 224);
|
|
177
|
-
utf8Bytes.push(((c >> 6) & 63) | 128);
|
|
178
|
-
utf8Bytes.push((c & 63) | 128);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
let version = 1;
|
|
182
|
-
for (let v = 1; v <= 10; v++) {
|
|
183
|
-
const blockList = RS_BLOCK_TABLE[v - 1][eccLevel];
|
|
184
|
-
let totalDataCount = 0;
|
|
185
|
-
for (let i = 0; i < blockList.length; i += 3) {
|
|
186
|
-
totalDataCount += blockList[i] * blockList[i + 2];
|
|
187
|
-
}
|
|
188
|
-
if (utf8Bytes.length + 2 <= totalDataCount) {
|
|
189
|
-
version = v;
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
version = v;
|
|
193
|
-
}
|
|
194
|
-
const moduleCount = version * 4 + 17;
|
|
195
|
-
const modules = Array.from({ length: moduleCount }, () => Array(moduleCount).fill(null));
|
|
196
|
-
function setupPositionProbePattern(row, col) {
|
|
197
|
-
for (let r = -1; r <= 7; r++) {
|
|
198
|
-
if (row + r <= -1 || moduleCount <= row + r)
|
|
199
|
-
continue;
|
|
200
|
-
for (let c = -1; c <= 7; c++) {
|
|
201
|
-
if (col + c <= -1 || moduleCount <= col + c)
|
|
202
|
-
continue;
|
|
203
|
-
if ((0 <= r && r <= 6 && (c === 0 || c === 6)) ||
|
|
204
|
-
(0 <= c && c <= 6 && (r === 0 || r === 6)) ||
|
|
205
|
-
(2 <= r && r <= 4 && 2 <= c && c <= 4)) {
|
|
206
|
-
modules[row + r][col + c] = true;
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
modules[row + r][col + c] = false;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
setupPositionProbePattern(0, 0);
|
|
215
|
-
setupPositionProbePattern(moduleCount - 7, 0);
|
|
216
|
-
setupPositionProbePattern(0, moduleCount - 7);
|
|
217
|
-
const pos = PATTERN_POSITION_TABLE[version - 1] || [];
|
|
218
|
-
for (let i = 0; i < pos.length; i++) {
|
|
219
|
-
for (let j = 0; j < pos.length; j++) {
|
|
220
|
-
const row = pos[i];
|
|
221
|
-
const col = pos[j];
|
|
222
|
-
if (modules[row][col] !== null)
|
|
223
|
-
continue;
|
|
224
|
-
for (let r = -2; r <= 2; r++) {
|
|
225
|
-
for (let c = -2; c <= 2; c++) {
|
|
226
|
-
if (r === -2 || r === 2 || c === -2 || c === 2 || (r === 0 && c === 0)) {
|
|
227
|
-
modules[row + r][col + c] = true;
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
modules[row + r][col + c] = false;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
for (let r = 8; r < moduleCount - 8; r++) {
|
|
237
|
-
if (modules[r][6] === null)
|
|
238
|
-
modules[r][6] = r % 2 === 0;
|
|
239
|
-
}
|
|
240
|
-
for (let c = 8; c < moduleCount - 8; c++) {
|
|
241
|
-
if (modules[6][c] === null)
|
|
242
|
-
modules[6][c] = c % 2 === 0;
|
|
243
|
-
}
|
|
244
|
-
const buffer = new BitBuffer();
|
|
245
|
-
buffer.put(4, 4);
|
|
246
|
-
buffer.put(utf8Bytes.length, 8);
|
|
247
|
-
for (let i = 0; i < utf8Bytes.length; i++) {
|
|
248
|
-
buffer.put(utf8Bytes[i], 8);
|
|
249
|
-
}
|
|
250
|
-
const rsBlocks = RS_BLOCK_TABLE[version - 1][eccLevel];
|
|
251
|
-
let totalDataCount = 0;
|
|
252
|
-
for (let i = 0; i < rsBlocks.length; i += 3) {
|
|
253
|
-
totalDataCount += rsBlocks[i] * rsBlocks[i + 2];
|
|
254
|
-
}
|
|
255
|
-
if (buffer.length + 4 <= totalDataCount * 8) {
|
|
256
|
-
buffer.put(0, 4);
|
|
257
|
-
}
|
|
258
|
-
while (buffer.length % 8 !== 0) {
|
|
259
|
-
buffer.putBit(false);
|
|
260
|
-
}
|
|
261
|
-
while (buffer.length < totalDataCount * 8) {
|
|
262
|
-
buffer.put(0xec, 8);
|
|
263
|
-
if (buffer.length < totalDataCount * 8) {
|
|
264
|
-
buffer.put(0x11, 8);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
const dataBytes = buffer.buffer;
|
|
268
|
-
let offset = 0;
|
|
269
|
-
const dcData = [];
|
|
270
|
-
const ecData = [];
|
|
271
|
-
for (let i = 0; i < rsBlocks.length; i += 3) {
|
|
272
|
-
const numBlocks = rsBlocks[i];
|
|
273
|
-
const totalCount = rsBlocks[i + 1];
|
|
274
|
-
const dataCount = rsBlocks[i + 2];
|
|
275
|
-
const ecCount = totalCount - dataCount;
|
|
276
|
-
const rsPoly = getErrorCorrectionPolynomial(ecCount);
|
|
277
|
-
for (let b = 0; b < numBlocks; b++) {
|
|
278
|
-
const rawDc = dataBytes.slice(offset, offset + dataCount);
|
|
279
|
-
offset += dataCount;
|
|
280
|
-
dcData.push(rawDc);
|
|
281
|
-
const rawPoly = new Polynomial(rawDc, rsPoly.getLength() - 1);
|
|
282
|
-
const modPoly = rawPoly.mod(rsPoly);
|
|
283
|
-
const ec = new Array(rsPoly.getLength() - 1).fill(0);
|
|
284
|
-
for (let k = 0; k < ec.length; k++) {
|
|
285
|
-
const modIndex = k + modPoly.getLength() - ec.length;
|
|
286
|
-
ec[k] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
|
|
287
|
-
}
|
|
288
|
-
ecData.push(ec);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
const finalCodewords = [];
|
|
292
|
-
let maxDcCount = 0;
|
|
293
|
-
for (const block of dcData)
|
|
294
|
-
maxDcCount = Math.max(maxDcCount, block.length);
|
|
295
|
-
for (let i = 0; i < maxDcCount; i++) {
|
|
296
|
-
for (const block of dcData) {
|
|
297
|
-
if (i < block.length)
|
|
298
|
-
finalCodewords.push(block[i]);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
let maxEcCount = 0;
|
|
302
|
-
for (const block of ecData)
|
|
303
|
-
maxEcCount = Math.max(maxEcCount, block.length);
|
|
304
|
-
for (let i = 0; i < maxEcCount; i++) {
|
|
305
|
-
for (const block of ecData) {
|
|
306
|
-
if (i < block.length)
|
|
307
|
-
finalCodewords.push(block[i]);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
let inc = -1;
|
|
311
|
-
let row = moduleCount - 1;
|
|
312
|
-
let bitIndex = 0;
|
|
313
|
-
const maskPattern = 0;
|
|
314
|
-
for (let col = moduleCount - 1; col > 0; col -= 2) {
|
|
315
|
-
if (col === 6)
|
|
316
|
-
col--;
|
|
317
|
-
while (true) {
|
|
318
|
-
for (let c = 0; c < 2; c++) {
|
|
319
|
-
if (modules[row][col - c] === null) {
|
|
320
|
-
let dark = false;
|
|
321
|
-
if (bitIndex < finalCodewords.length * 8) {
|
|
322
|
-
const byte = finalCodewords[Math.floor(bitIndex / 8)];
|
|
323
|
-
dark = ((byte >>> (7 - (bitIndex % 8))) & 1) === 1;
|
|
324
|
-
bitIndex++;
|
|
325
|
-
}
|
|
326
|
-
const mask = getMask(maskPattern, row, col - c);
|
|
327
|
-
modules[row][col - c] = mask ? !dark : dark;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
row += inc;
|
|
331
|
-
if (row < 0 || moduleCount <= row) {
|
|
332
|
-
row -= inc;
|
|
333
|
-
inc = -inc;
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
const typeData = (eccLevel << 3) | maskPattern;
|
|
339
|
-
const bits = getBCHTypeInfo(typeData);
|
|
340
|
-
for (let i = 0; i < 15; i++) {
|
|
341
|
-
const mod = ((bits >> i) & 1) === 1;
|
|
342
|
-
if (i < 6) {
|
|
343
|
-
modules[i][8] = mod;
|
|
344
|
-
}
|
|
345
|
-
else if (i < 8) {
|
|
346
|
-
modules[i + 1][8] = mod;
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
modules[moduleCount - 15 + i][8] = mod;
|
|
350
|
-
}
|
|
351
|
-
if (i < 8) {
|
|
352
|
-
modules[8][moduleCount - i - 1] = mod;
|
|
353
|
-
}
|
|
354
|
-
else if (i < 9) {
|
|
355
|
-
modules[8][15 - i - 1 + 1] = mod;
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
modules[8][15 - i - 1] = mod;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
modules[moduleCount - 8][8] = true;
|
|
362
|
-
return modules.map(r => r.map(cell => cell === true));
|
|
363
|
-
}
|
|
364
|
-
export default generateQRMatrix;
|
|
1
|
+
const X={L:1,M:0,Q:3,H:2},k=new Uint8Array(256),K=new Uint8Array(256);(function(){let e=1;for(let o=0;o<255;o++)k[o]=e,K[e]=o,e<<=1,e&256&&(e^=285);k[255]=k[0]})();function m(i){if(i<1)throw new Error(`glog(${i})`);return K[i]}function G(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return k[i]}class L{constructor(e,o=0){let l=0;for(;l<e.length&&e[l]===0;)l++;this.num=new Array(e.length-l+o);for(let r=0;r<e.length-l;r++)this.num[r]=e[r+l];for(let r=e.length-l;r<this.num.length;r++)this.num[r]=0}get(e){return this.num[e]||0}getLength(){return this.num.length}multiply(e){const o=new Array(this.getLength()+e.getLength()-1).fill(0);for(let l=0;l<this.getLength();l++)for(let r=0;r<e.getLength();r++)o[l+r]^=G(m(this.get(l))+m(e.get(r)));return new L(o)}mod(e){if(this.getLength()-e.getLength()<0)return this;const o=m(this.get(0))-m(e.get(0)),l=new Array(this.getLength());for(let r=0;r<this.getLength();r++)l[r]=this.get(r);for(let r=0;r<e.getLength();r++)l[r]^=G(m(e.get(r))+o);return new L(l).mod(e)}}const N=[[[1,26,19],[1,26,16],[1,26,13],[1,26,9]],[[1,44,34],[1,44,28],[1,44,22],[1,44,16]],[[1,70,55],[1,70,44],[2,35,17],[2,35,13]],[[1,100,80],[2,50,32],[2,50,24],[4,25,9]],[[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12]],[[2,86,68],[4,43,27],[4,43,19],[4,43,15]],[[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14]],[[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15]],[[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13]],[[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16]]],$=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50]],O=1335,q=21522;function z(i){let e=i<<10;for(;E(e)-E(O)>=0;)e^=O<<E(e)-E(O);return(i<<10|e)^q}function E(i){let e=0;for(;i!==0;)e++,i>>>=1;return e}function J(i,e,o){switch(i){case 0:return(e+o)%2===0;case 1:return e%2===0;case 2:return o%3===0;case 3:return(e+o)%3===0;case 4:return(Math.floor(e/2)+Math.floor(o/3))%2===0;case 5:return e*o%2+e*o%3===0;case 6:return(e*o%2+e*o%3)%2===0;case 7:return(e*o%3+(e+o)%2)%2===0;default:return!1}}class W{constructor(){this.buffer=[],this.length=0}get(e){const o=Math.floor(e/8);return(this.buffer[o]>>>7-e%8&1)===1}put(e,o){for(let l=0;l<o;l++)this.putBit((e>>>o-l-1&1)===1)}putBit(e){const o=Math.floor(this.length/8);this.buffer.length<=o&&this.buffer.push(0),e&&(this.buffer[o]|=128>>>this.length%8),this.length++}}function Y(i){let e=new L([1],0);for(let o=0;o<i;o++)e=e.multiply(new L([1,G(o)],0));return e}export function generateQRMatrix(i,e="M"){const o=X[e]??0,l=[];for(let t=0;t<i.length;t++){let n=i.charCodeAt(t);n<128?l.push(n):n<2048?(l.push(n>>6|192),l.push(n&63|128)):(l.push(n>>12|224),l.push(n>>6&63|128),l.push(n&63|128))}let r=1;for(let t=1;t<=10;t++){const n=N[t-1][o];let f=0;for(let s=0;s<n.length;s+=3)f+=n[s]*n[s+2];if(l.length+2<=f){r=t;break}r=t}const h=r*4+17,c=Array.from({length:h},()=>Array(h).fill(null));function M(t,n){for(let f=-1;f<=7;f++)if(!(t+f<=-1||h<=t+f))for(let s=-1;s<=7;s++)n+s<=-1||h<=n+s||(0<=f&&f<=6&&(s===0||s===6)||0<=s&&s<=6&&(f===0||f===6)||2<=f&&f<=4&&2<=s&&s<=4?c[t+f][n+s]=!0:c[t+f][n+s]=!1)}M(0,0),M(h-7,0),M(0,h-7);const b=$[r-1]||[];for(let t=0;t<b.length;t++)for(let n=0;n<b.length;n++){const f=b[t],s=b[n];if(c[f][s]===null)for(let a=-2;a<=2;a++)for(let g=-2;g<=2;g++)a===-2||a===2||g===-2||g===2||a===0&&g===0?c[f+a][s+g]=!0:c[f+a][s+g]=!1}for(let t=8;t<h-8;t++)c[t][6]===null&&(c[t][6]=t%2===0);for(let t=8;t<h-8;t++)c[6][t]===null&&(c[6][t]=t%2===0);const u=new W;u.put(4,4),u.put(l.length,8);for(let t=0;t<l.length;t++)u.put(l[t],8);const p=N[r-1][o];let d=0;for(let t=0;t<p.length;t+=3)d+=p[t]*p[t+2];for(u.length+4<=d*8&&u.put(0,4);u.length%8!==0;)u.putBit(!1);for(;u.length<d*8;)u.put(236,8),u.length<d*8&&u.put(17,8);const U=u.buffer;let P=0;const D=[],T=[];for(let t=0;t<p.length;t+=3){const n=p[t],f=p[t+1],s=p[t+2],a=f-s,g=Y(a);for(let v=0;v<n;v++){const H=U.slice(P,P+s);P+=s,D.push(H);const Q=new L(H,g.getLength()-1).mod(g),C=new Array(g.getLength()-1).fill(0);for(let A=0;A<C.length;A++){const S=A+Q.getLength()-C.length;C[A]=S>=0?Q.get(S):0}T.push(C)}}const y=[];let I=0;for(const t of D)I=Math.max(I,t.length);for(let t=0;t<I;t++)for(const n of D)t<n.length&&y.push(n[t]);let _=0;for(const t of T)_=Math.max(_,t.length);for(let t=0;t<_;t++)for(const n of T)t<n.length&&y.push(n[t]);let x=-1,w=h-1,B=0;const R=0;for(let t=h-1;t>0;t-=2)for(t===6&&t--;;){for(let n=0;n<2;n++)if(c[w][t-n]===null){let f=!1;B<y.length*8&&(f=(y[Math.floor(B/8)]>>>7-B%8&1)===1,B++);const s=J(R,w,t-n);c[w][t-n]=s?!f:f}if(w+=x,w<0||h<=w){w-=x,x=-x;break}}const F=o<<3|R,V=z(F);for(let t=0;t<15;t++){const n=(V>>t&1)===1;t<6?c[t][8]=n:t<8?c[t+1][8]=n:c[h-15+t][8]=n,t<8?c[8][h-t-1]=n:t<9?c[8][15-t-1+1]=n:c[8][15-t-1]=n}return c[h-8][8]=!0,c.map(t=>t.map(n=>n===!0))}export default generateQRMatrix;
|
|
@@ -1,160 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
'apis',
|
|
3
|
-
'logs',
|
|
4
|
-
'analytics',
|
|
5
|
-
'redux',
|
|
6
|
-
'storage',
|
|
7
|
-
'device',
|
|
8
|
-
'crash',
|
|
9
|
-
'bundle',
|
|
10
|
-
'performance',
|
|
11
|
-
'debugging',
|
|
12
|
-
];
|
|
13
|
-
let cachedRemoteConfigInstance = null;
|
|
14
|
-
export function getFirebaseRemoteConfig(customInstance) {
|
|
15
|
-
if (customInstance && typeof customInstance === 'object') {
|
|
16
|
-
cachedRemoteConfigInstance = customInstance;
|
|
17
|
-
return customInstance;
|
|
18
|
-
}
|
|
19
|
-
if (cachedRemoteConfigInstance) {
|
|
20
|
-
return cachedRemoteConfigInstance;
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
const rcModule = require('@react-native-firebase/remote-config');
|
|
24
|
-
const instance = typeof rcModule.default === 'function'
|
|
25
|
-
? rcModule.default()
|
|
26
|
-
: typeof rcModule === 'function'
|
|
27
|
-
? rcModule()
|
|
28
|
-
: rcModule;
|
|
29
|
-
cachedRemoteConfigInstance = instance;
|
|
30
|
-
return instance;
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export function isFirebaseRemoteConfigAvailable(customInstance) {
|
|
37
|
-
return Boolean(getFirebaseRemoteConfig(customInstance));
|
|
38
|
-
}
|
|
39
|
-
function extractValue(val) {
|
|
40
|
-
if (val === null || val === undefined)
|
|
41
|
-
return undefined;
|
|
42
|
-
if (typeof val === 'boolean')
|
|
43
|
-
return val;
|
|
44
|
-
if (typeof val === 'number')
|
|
45
|
-
return val !== 0;
|
|
46
|
-
if (typeof val === 'string') {
|
|
47
|
-
const lower = val.trim().toLowerCase();
|
|
48
|
-
if (lower === 'true' || lower === '1' || lower === 'enabled' || lower === 'on')
|
|
49
|
-
return true;
|
|
50
|
-
if (lower === 'false' || lower === '0' || lower === 'disabled' || lower === 'off')
|
|
51
|
-
return false;
|
|
52
|
-
try {
|
|
53
|
-
return JSON.parse(val);
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (typeof val.asBoolean === 'function') {
|
|
60
|
-
return val.asBoolean();
|
|
61
|
-
}
|
|
62
|
-
if (typeof val.asString === 'function') {
|
|
63
|
-
const str = val.asString();
|
|
64
|
-
const lower = str.trim().toLowerCase();
|
|
65
|
-
if (lower === 'true' || lower === '1' || lower === 'enabled' || lower === 'on')
|
|
66
|
-
return true;
|
|
67
|
-
if (lower === 'false' || lower === '0' || lower === 'disabled' || lower === 'off')
|
|
68
|
-
return false;
|
|
69
|
-
try {
|
|
70
|
-
return JSON.parse(str);
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return undefined;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return undefined;
|
|
77
|
-
}
|
|
78
|
-
export async function fetchRemoteConfigModuleStatus(customInstance, fetchTimeoutMs = 8000) {
|
|
79
|
-
const rc = getFirebaseRemoteConfig(customInstance);
|
|
80
|
-
if (!rc) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
try {
|
|
84
|
-
const fetchPromise = (async () => {
|
|
85
|
-
if (typeof rc.fetchAndActivate === 'function') {
|
|
86
|
-
await rc.fetchAndActivate();
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
if (typeof rc.fetch === 'function') {
|
|
90
|
-
await rc.fetch();
|
|
91
|
-
}
|
|
92
|
-
if (typeof rc.activate === 'function') {
|
|
93
|
-
await rc.activate();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
})();
|
|
97
|
-
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Remote Config fetch timeout')), fetchTimeoutMs));
|
|
98
|
-
await Promise.race([fetchPromise, timeoutPromise]).catch(() => {
|
|
99
|
-
});
|
|
100
|
-
const result = {};
|
|
101
|
-
const jsonKeys = [
|
|
102
|
-
'inspector_modules',
|
|
103
|
-
'inapp_inspector_modules',
|
|
104
|
-
'react_native_inapp_inspector_modules',
|
|
105
|
-
];
|
|
106
|
-
for (const jKey of jsonKeys) {
|
|
107
|
-
let rawVal;
|
|
108
|
-
if (typeof rc.getValue === 'function') {
|
|
109
|
-
try {
|
|
110
|
-
rawVal = rc.getValue(jKey);
|
|
111
|
-
}
|
|
112
|
-
catch { }
|
|
113
|
-
}
|
|
114
|
-
else if (rc[jKey] !== undefined) {
|
|
115
|
-
rawVal = rc[jKey];
|
|
116
|
-
}
|
|
117
|
-
const parsed = extractValue(rawVal);
|
|
118
|
-
if (parsed && typeof parsed === 'object') {
|
|
119
|
-
for (const modKey of MODULE_KEYS) {
|
|
120
|
-
if (typeof parsed[modKey] === 'boolean') {
|
|
121
|
-
result[modKey] = parsed[modKey];
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
for (const modKey of MODULE_KEYS) {
|
|
127
|
-
const paramKeys = [
|
|
128
|
-
`inspector_module_${modKey}`,
|
|
129
|
-
`inapp_inspector_${modKey}`,
|
|
130
|
-
`inspector_${modKey}`,
|
|
131
|
-
`inapp_inspector_module_${modKey}`,
|
|
132
|
-
`rn_inspector_${modKey}`,
|
|
133
|
-
];
|
|
134
|
-
for (const pKey of paramKeys) {
|
|
135
|
-
let rawVal;
|
|
136
|
-
if (typeof rc.getValue === 'function') {
|
|
137
|
-
try {
|
|
138
|
-
rawVal = rc.getValue(pKey);
|
|
139
|
-
}
|
|
140
|
-
catch { }
|
|
141
|
-
}
|
|
142
|
-
else if (rc[pKey] !== undefined) {
|
|
143
|
-
rawVal = rc[pKey];
|
|
144
|
-
}
|
|
145
|
-
const boolVal = extractValue(rawVal);
|
|
146
|
-
if (typeof boolVal === 'boolean') {
|
|
147
|
-
result[modKey] = boolVal;
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (result.apis === undefined) {
|
|
153
|
-
result.apis = true;
|
|
154
|
-
}
|
|
155
|
-
return Object.keys(result).length > 0 ? result : null;
|
|
156
|
-
}
|
|
157
|
-
catch (error) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
1
|
+
const l=["apis","logs","analytics","redux","storage","device","crash","bundle","performance","debugging"];let u=null;export function getFirebaseRemoteConfig(t){if(t&&typeof t=="object")return u=t,t;if(u)return u;try{const n=require("@react-native-firebase/remote-config"),e=typeof n.default=="function"?n.default():typeof n=="function"?n():n;return u=e,e}catch{return null}}export function isFirebaseRemoteConfigAvailable(t){return!!getFirebaseRemoteConfig(t)}function p(t){if(t!=null){if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){const n=t.trim().toLowerCase();if(n==="true"||n==="1"||n==="enabled"||n==="on")return!0;if(n==="false"||n==="0"||n==="disabled"||n==="off")return!1;try{return JSON.parse(t)}catch{return}}if(typeof t.asBoolean=="function")return t.asBoolean();if(typeof t.asString=="function"){const n=t.asString(),e=n.trim().toLowerCase();if(e==="true"||e==="1"||e==="enabled"||e==="on")return!0;if(e==="false"||e==="0"||e==="disabled"||e==="off")return!1;try{return JSON.parse(n)}catch{return}}}}export async function fetchRemoteConfigModuleStatus(t,n=8e3){const e=getFirebaseRemoteConfig(t);if(!e)return null;try{const a=(async()=>{typeof e.fetchAndActivate=="function"?await e.fetchAndActivate():(typeof e.fetch=="function"&&await e.fetch(),typeof e.activate=="function"&&await e.activate())})(),d=new Promise((o,i)=>setTimeout(()=>i(new Error("Remote Config fetch timeout")),n));await Promise.race([a,d]).catch(()=>{});const c={},y=["inspector_modules","inapp_inspector_modules","react_native_inapp_inspector_modules"];for(const o of y){let i;if(typeof e.getValue=="function")try{i=e.getValue(o)}catch{}else e[o]!==void 0&&(i=e[o]);const r=p(i);if(r&&typeof r=="object")for(const f of l)typeof r[f]=="boolean"&&(c[f]=r[f])}for(const o of l){const i=[`inspector_module_${o}`,`inapp_inspector_${o}`,`inspector_${o}`,`inapp_inspector_module_${o}`,`rn_inspector_${o}`];for(const r of i){let f;if(typeof e.getValue=="function")try{f=e.getValue(r)}catch{}else e[r]!==void 0&&(f=e[r]);const s=p(f);if(typeof s=="boolean"){c[o]=s;break}}}return c.apis===void 0&&(c.apis=!0),Object.keys(c).length>0?c:null}catch{return null}}
|
|
@@ -1,59 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export function matchNetworkLogQuery(log, searchQuery, routePath, _options) {
|
|
3
|
-
if (!searchQuery || searchQuery.trim().length === 0)
|
|
4
|
-
return true;
|
|
5
|
-
markSearchFilterUsed();
|
|
6
|
-
const rawTokens = searchQuery.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
7
|
-
if (rawTokens.length === 0)
|
|
8
|
-
return true;
|
|
9
|
-
const methodRaw = (log.method || '').toLowerCase();
|
|
10
|
-
const urlRaw = (log.url || '').toLowerCase();
|
|
11
|
-
const statusStr = log.status != null ? String(log.status).toLowerCase() : 'pending';
|
|
12
|
-
const statusNum = typeof log.status === 'number'
|
|
13
|
-
? log.status
|
|
14
|
-
: log.status != null
|
|
15
|
-
? parseInt(String(log.status), 10)
|
|
16
|
-
: null;
|
|
17
|
-
const clientRaw = (log.client || '').toLowerCase();
|
|
18
|
-
const callerRaw = (log.caller || '').toLowerCase();
|
|
19
|
-
const pathRaw = (routePath || log?.routeInfo?.path || '').toLowerCase();
|
|
20
|
-
const reqRaw = typeof log.request === 'string'
|
|
21
|
-
? log.request.toLowerCase()
|
|
22
|
-
: log.request != null
|
|
23
|
-
? JSON.stringify(log.request).toLowerCase()
|
|
24
|
-
: '';
|
|
25
|
-
const resRaw = typeof log.response === 'string'
|
|
26
|
-
? log.response.toLowerCase()
|
|
27
|
-
: log.response != null
|
|
28
|
-
? JSON.stringify(log.response).toLowerCase()
|
|
29
|
-
: '';
|
|
30
|
-
const reqHeadersRaw = log.requestHeaders
|
|
31
|
-
? JSON.stringify(log.requestHeaders).toLowerCase()
|
|
32
|
-
: '';
|
|
33
|
-
const resHeadersRaw = log.responseHeaders
|
|
34
|
-
? JSON.stringify(log.responseHeaders).toLowerCase()
|
|
35
|
-
: '';
|
|
36
|
-
const corpus = [
|
|
37
|
-
methodRaw,
|
|
38
|
-
urlRaw,
|
|
39
|
-
statusStr,
|
|
40
|
-
pathRaw,
|
|
41
|
-
callerRaw,
|
|
42
|
-
clientRaw,
|
|
43
|
-
reqRaw,
|
|
44
|
-
resRaw,
|
|
45
|
-
reqHeadersRaw,
|
|
46
|
-
resHeadersRaw,
|
|
47
|
-
].join(' ');
|
|
48
|
-
return rawTokens.every(token => {
|
|
49
|
-
if (corpus.includes(token))
|
|
50
|
-
return true;
|
|
51
|
-
if (token === 'error' || token === 'failed' || token === 'err' || token === 'fail') {
|
|
52
|
-
return log.status === 0 || (statusNum !== null && statusNum >= 400);
|
|
53
|
-
}
|
|
54
|
-
if (token === 'success' || token === 'ok' || token === '2xx') {
|
|
55
|
-
return statusNum !== null && statusNum >= 200 && statusNum < 300;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
1
|
+
import{markSearchFilterUsed as l}from"./telemetry";export function matchNetworkLogQuery(e,r,a,R){if(!r||r.trim().length===0)return!0;l();const n=r.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return!0;const u=(e.method||"").toLowerCase(),o=(e.url||"").toLowerCase(),i=e.status!=null?String(e.status).toLowerCase():"pending",t=typeof e.status=="number"?e.status:e.status!=null?parseInt(String(e.status),10):null,w=(e.client||"").toLowerCase(),c=(e.caller||"").toLowerCase(),f=(a||e?.routeInfo?.path||"").toLowerCase(),p=typeof e.request=="string"?e.request.toLowerCase():e.request!=null?JSON.stringify(e.request).toLowerCase():"",L=typeof e.response=="string"?e.response.toLowerCase():e.response!=null?JSON.stringify(e.response).toLowerCase():"",C=e.requestHeaders?JSON.stringify(e.requestHeaders).toLowerCase():"",d=e.responseHeaders?JSON.stringify(e.responseHeaders).toLowerCase():"",m=[u,o,i,f,c,w,p,L,C,d].join(" ");return n.every(s=>m.includes(s)?!0:s==="error"||s==="failed"||s==="err"||s==="fail"?e.status===0||t!==null&&t>=400:s==="success"||s==="ok"||s==="2xx"?t!==null&&t>=200&&t<300:!1)}
|