react-native-inapp-inspector 2.3.11 → 2.3.13
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/components/HeadersSection.js +3 -2
- package/dist/commonjs/components/Inspector/BundleTab.js +4 -4
- package/dist/commonjs/components/Inspector/DebuggingTab.js +29 -16
- package/dist/commonjs/components/Inspector/NetworkDetail.js +2 -2
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +18 -12
- package/dist/commonjs/components/Inspector/StorageTab.js +10 -4
- package/dist/commonjs/components/JsonViewer.js +3 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +4 -1
- package/dist/commonjs/components/NetworkIcons.js +26 -3
- package/dist/commonjs/components/QRCodeView.js +15 -12
- package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
- package/dist/commonjs/constants/telemetryConfig.js +3 -3
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/qrGenerator.js +31 -157
- package/dist/esm/components/HeadersSection.js +3 -2
- package/dist/esm/components/Inspector/BundleTab.js +5 -5
- package/dist/esm/components/Inspector/DebuggingTab.js +30 -17
- package/dist/esm/components/Inspector/NetworkDetail.js +2 -2
- package/dist/esm/components/Inspector/NetworkFilterModal.js +19 -13
- package/dist/esm/components/Inspector/StorageTab.js +11 -5
- package/dist/esm/components/JsonViewer.js +4 -3
- package/dist/esm/components/NetworkIcons.d.ts +4 -1
- package/dist/esm/components/NetworkIcons.js +22 -2
- package/dist/esm/components/QRCodeView.js +15 -12
- package/dist/esm/constants/telemetryConfig.d.ts +3 -3
- package/dist/esm/constants/telemetryConfig.js +3 -3
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/qrGenerator.js +28 -157
- package/package.json +4 -2
- package/src/components/HeadersSection.tsx +7 -2
- package/src/components/Inspector/BundleTab.tsx +9 -4
- package/src/components/Inspector/DebuggingTab.tsx +37 -17
- package/src/components/Inspector/NetworkDetail.tsx +2 -2
- package/src/components/Inspector/NetworkFilterModal.tsx +32 -12
- package/src/components/Inspector/StorageTab.tsx +15 -4
- package/src/components/JsonViewer.tsx +8 -3
- package/src/components/NetworkIcons.tsx +71 -1
- package/src/components/QRCodeView.tsx +21 -17
- package/src/constants/telemetryConfig.ts +3 -5
- package/src/constants/version.ts +1 -1
- package/src/helpers/qrGenerator.ts +34 -169
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build/reports/problems/problems-report.html +0 -659
|
@@ -13,25 +13,29 @@ interface QRCodeViewProps {
|
|
|
13
13
|
|
|
14
14
|
export const QRCodeView: React.FC<QRCodeViewProps> = ({
|
|
15
15
|
value,
|
|
16
|
-
size =
|
|
17
|
-
color =
|
|
18
|
-
backgroundColor =
|
|
16
|
+
size = 200,
|
|
17
|
+
color = '#000000',
|
|
18
|
+
backgroundColor = '#FFFFFF',
|
|
19
19
|
}) => {
|
|
20
|
-
const matrix = useMemo(() => generateQRMatrix(value), [value]);
|
|
21
|
-
const numCells = matrix.length;
|
|
22
|
-
|
|
20
|
+
const matrix = useMemo(() => generateQRMatrix(value || 'http://localhost:8081'), [value]);
|
|
21
|
+
const numCells = matrix.length || 21;
|
|
22
|
+
// Add a 3-module quiet zone (white border) required by QR scanners
|
|
23
|
+
const margin = 3;
|
|
24
|
+
const totalCells = numCells + margin * 2;
|
|
25
|
+
const cellSize = size / totalCells;
|
|
23
26
|
|
|
24
27
|
return (
|
|
25
28
|
<View
|
|
26
29
|
style={[
|
|
27
30
|
styles.container,
|
|
28
31
|
{
|
|
29
|
-
width: size +
|
|
30
|
-
height: size +
|
|
32
|
+
width: size + 20,
|
|
33
|
+
height: size + 20,
|
|
31
34
|
backgroundColor,
|
|
32
35
|
},
|
|
33
36
|
]}>
|
|
34
37
|
<Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
|
|
38
|
+
<Rect width={size} height={size} fill={backgroundColor} />
|
|
35
39
|
<G>
|
|
36
40
|
{matrix.map((row, r) =>
|
|
37
41
|
row.map((cell, c) => {
|
|
@@ -39,10 +43,10 @@ export const QRCodeView: React.FC<QRCodeViewProps> = ({
|
|
|
39
43
|
return (
|
|
40
44
|
<Rect
|
|
41
45
|
key={`${r}-${c}`}
|
|
42
|
-
x={c * cellSize}
|
|
43
|
-
y={r * cellSize}
|
|
44
|
-
width={cellSize + 0.
|
|
45
|
-
height={cellSize + 0.
|
|
46
|
+
x={(c + margin) * cellSize}
|
|
47
|
+
y={(r + margin) * cellSize}
|
|
48
|
+
width={cellSize + 0.3}
|
|
49
|
+
height={cellSize + 0.3}
|
|
46
50
|
fill={color}
|
|
47
51
|
/>
|
|
48
52
|
);
|
|
@@ -56,15 +60,15 @@ export const QRCodeView: React.FC<QRCodeViewProps> = ({
|
|
|
56
60
|
|
|
57
61
|
const styles = StyleSheet.create({
|
|
58
62
|
container: {
|
|
59
|
-
padding:
|
|
63
|
+
padding: 10,
|
|
60
64
|
borderRadius: 14,
|
|
61
65
|
alignItems: 'center',
|
|
62
66
|
justifyContent: 'center',
|
|
63
67
|
shadowColor: AppColors.black,
|
|
64
|
-
shadowOffset: {width: 0, height:
|
|
65
|
-
shadowOpacity: 0.
|
|
66
|
-
shadowRadius:
|
|
67
|
-
elevation:
|
|
68
|
+
shadowOffset: {width: 0, height: 3},
|
|
69
|
+
shadowOpacity: 0.15,
|
|
70
|
+
shadowRadius: 8,
|
|
71
|
+
elevation: 4,
|
|
68
72
|
},
|
|
69
73
|
});
|
|
70
74
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// AUTO-GENERATED FILE — do not edit by hand.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const
|
|
5
|
-
export const ENC_SEC = 'db93cb0186b1f7bb0ba63a0d0a64997586849455ce37';
|
|
6
|
-
export const TELEMETRY_SALT = 'rn-inapp-inspector-telemetry-v1';
|
|
2
|
+
export const ENC_MID = '';
|
|
3
|
+
export const ENC_SEC = '';
|
|
4
|
+
export const TELEMETRY_SALT = '';
|
package/src/constants/version.ts
CHANGED
|
@@ -1,184 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* ISO/IEC 18004 Standard QR Code Matrix Generator
|
|
3
|
+
* Uses industry-standard qrcode-generator with full Reed-Solomon Error Correction
|
|
4
|
+
* and BCH format encoding for 100% instant phone camera / Google Lens recognition.
|
|
4
5
|
*/
|
|
6
|
+
import qrcode from 'qrcode-generator';
|
|
5
7
|
|
|
6
|
-
// Error correction levels: L (7%), M (15%), Q (25%), H (30%)
|
|
7
8
|
export type QRECC = 'L' | 'M' | 'Q' | 'H';
|
|
8
9
|
|
|
9
|
-
// QR Code generation helper (using compact byte-mode QR encoder)
|
|
10
10
|
export function generateQRMatrix(text: string, ecc: QRECC = 'M'): boolean[][] {
|
|
11
11
|
try {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let version = 1;
|
|
25
|
-
if (length > 14) version = 2;
|
|
26
|
-
if (length > 26) version = 3;
|
|
27
|
-
if (length > 42) version = 4;
|
|
28
|
-
if (length > 62) version = 5;
|
|
29
|
-
if (length > 84) version = 6;
|
|
30
|
-
if (length > 106) version = 7;
|
|
31
|
-
if (length > 122) version = 8;
|
|
32
|
-
if (length > 152) version = 9;
|
|
33
|
-
if (length > 180) version = 10;
|
|
34
|
-
|
|
35
|
-
const size = version * 4 + 17;
|
|
36
|
-
const matrix: (boolean | null)[][] = Array(size)
|
|
37
|
-
.fill(null)
|
|
38
|
-
.map(() => Array(size).fill(null));
|
|
39
|
-
|
|
40
|
-
// 1. Position finder patterns (top-left, top-right, bottom-left)
|
|
41
|
-
addFinderPattern(matrix, 0, 0);
|
|
42
|
-
addFinderPattern(matrix, size - 7, 0);
|
|
43
|
-
addFinderPattern(matrix, 0, size - 7);
|
|
44
|
-
|
|
45
|
-
// 2. Timing patterns (horizontal and vertical alternating lines)
|
|
46
|
-
for (let i = 8; i < size - 8; i++) {
|
|
47
|
-
const val = i % 2 === 0;
|
|
48
|
-
if (matrix[6][i] === null) matrix[6][i] = val;
|
|
49
|
-
if (matrix[i][6] === null) matrix[i][6] = val;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// 3. Alignment patterns for version >= 2
|
|
53
|
-
if (version >= 2) {
|
|
54
|
-
const pos = getAlignmentPositions(version);
|
|
55
|
-
for (const r of pos) {
|
|
56
|
-
for (const c of pos) {
|
|
57
|
-
if (matrix[r][c] === null) {
|
|
58
|
-
addAlignmentPattern(matrix, r - 2, c - 2);
|
|
59
|
-
}
|
|
12
|
+
// Type 0 = auto detect smallest valid QR version
|
|
13
|
+
const qr = qrcode(0, ecc);
|
|
14
|
+
qr.addData(text);
|
|
15
|
+
qr.make();
|
|
16
|
+
|
|
17
|
+
const count = qr.getModuleCount();
|
|
18
|
+
const matrix: boolean[][] = [];
|
|
19
|
+
|
|
20
|
+
for (let row = 0; row < count; row++) {
|
|
21
|
+
const rowData: boolean[] = [];
|
|
22
|
+
for (let col = 0; col < count; col++) {
|
|
23
|
+
rowData.push(qr.isDark(row, col));
|
|
60
24
|
}
|
|
25
|
+
matrix.push(rowData);
|
|
61
26
|
}
|
|
62
|
-
}
|
|
63
27
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// Terminator
|
|
80
|
-
for (let i = 0; i < 4 && bits.length % 8 !== 0; i++) {
|
|
81
|
-
bits.push(false);
|
|
82
|
-
}
|
|
83
|
-
while (bits.length % 8 !== 0) {
|
|
84
|
-
bits.push(false);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Add padding bytes (0xEC, 0x11)
|
|
88
|
-
const padBytes = [0xec, 0x11];
|
|
89
|
-
let padIdx = 0;
|
|
90
|
-
const totalDataBits = size * size * 0.6; // approx capacity
|
|
91
|
-
while (bits.length < totalDataBits) {
|
|
92
|
-
const b = padBytes[padIdx % 2];
|
|
93
|
-
padIdx++;
|
|
94
|
-
for (let bit = 7; bit >= 0; bit--) {
|
|
95
|
-
bits.push(((b >> bit) & 1) === 1);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// 5. Place data bits in matrix (right to left, zig-zag)
|
|
100
|
-
let bitIdx = 0;
|
|
101
|
-
let upwards = true;
|
|
102
|
-
for (let col = size - 1; col > 0; col -= 2) {
|
|
103
|
-
if (col === 6) col--; // Skip vertical timing column
|
|
104
|
-
const rows = upwards
|
|
105
|
-
? Array.from({length: size}, (_, i) => size - 1 - i)
|
|
106
|
-
: Array.from({length: size}, (_, i) => i);
|
|
107
|
-
|
|
108
|
-
for (const row of rows) {
|
|
109
|
-
for (const c of [col, col - 1]) {
|
|
110
|
-
if (matrix[row][c] === null) {
|
|
111
|
-
const bit = bitIdx < bits.length ? bits[bitIdx++] : false;
|
|
112
|
-
// Apply mask pattern 0 ((row + col) % 2 === 0)
|
|
113
|
-
const mask = (row + c) % 2 === 0;
|
|
114
|
-
matrix[row][c] = bit !== mask;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
upwards = !upwards;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Replace remaining nulls with false
|
|
122
|
-
return matrix.map(row => row.map(cell => cell ?? false));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function addFinderPattern(matrix: (boolean | null)[][], row: number, col: number) {
|
|
126
|
-
for (let r = -1; r <= 7; r++) {
|
|
127
|
-
for (let c = -1; c <= 7; c++) {
|
|
128
|
-
const mr = row + r;
|
|
129
|
-
const mc = col + c;
|
|
130
|
-
if (mr >= 0 && mr < matrix.length && mc >= 0 && mc < matrix.length) {
|
|
131
|
-
if (
|
|
132
|
-
(r >= 0 && r <= 6 && (c === 0 || c === 6)) ||
|
|
133
|
-
(c >= 0 && c <= 6 && (r === 0 || r === 6)) ||
|
|
134
|
-
(r >= 2 && r <= 4 && c >= 2 && c <= 4)
|
|
135
|
-
) {
|
|
136
|
-
matrix[mr][mc] = true;
|
|
137
|
-
} else if (r >= 0 && r <= 6 && c >= 0 && c <= 6) {
|
|
138
|
-
matrix[mr][mc] = false;
|
|
139
|
-
} else {
|
|
140
|
-
matrix[mr][mc] = false; // separator
|
|
28
|
+
return matrix;
|
|
29
|
+
} catch (err) {
|
|
30
|
+
// Fallback: higher version if auto-detect fails
|
|
31
|
+
try {
|
|
32
|
+
const qr = qrcode(10, ecc);
|
|
33
|
+
qr.addData(text);
|
|
34
|
+
qr.make();
|
|
35
|
+
const count = qr.getModuleCount();
|
|
36
|
+
const matrix: boolean[][] = [];
|
|
37
|
+
for (let row = 0; row < count; row++) {
|
|
38
|
+
const rowData: boolean[] = [];
|
|
39
|
+
for (let col = 0; col < count; col++) {
|
|
40
|
+
rowData.push(qr.isDark(row, col));
|
|
141
41
|
}
|
|
42
|
+
matrix.push(rowData);
|
|
142
43
|
}
|
|
44
|
+
return matrix;
|
|
45
|
+
} catch {
|
|
46
|
+
return [];
|
|
143
47
|
}
|
|
144
48
|
}
|
|
145
49
|
}
|
|
146
|
-
|
|
147
|
-
function addAlignmentPattern(matrix: (boolean | null)[][], row: number, col: number) {
|
|
148
|
-
for (let r = 0; r < 5; r++) {
|
|
149
|
-
for (let c = 0; c < 5; c++) {
|
|
150
|
-
const isOuter = r === 0 || r === 4 || c === 0 || c === 4;
|
|
151
|
-
const isCenter = r === 2 && c === 2;
|
|
152
|
-
matrix[row + r][col + c] = isOuter || isCenter;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function getAlignmentPositions(version: number): number[] {
|
|
158
|
-
if (version === 1) return [];
|
|
159
|
-
if (version === 2) return [6, 18];
|
|
160
|
-
if (version === 3) return [6, 22];
|
|
161
|
-
if (version === 4) return [6, 26];
|
|
162
|
-
if (version === 5) return [6, 30];
|
|
163
|
-
if (version === 6) return [6, 34];
|
|
164
|
-
if (version === 7) return [6, 22, 38];
|
|
165
|
-
if (version === 8) return [6, 24, 42];
|
|
166
|
-
if (version === 9) return [6, 26, 46];
|
|
167
|
-
return [6, 28, 50];
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function createFallbackMatrix(text: string): boolean[][] {
|
|
171
|
-
const size = 25;
|
|
172
|
-
const matrix: boolean[][] = Array(size)
|
|
173
|
-
.fill(false)
|
|
174
|
-
.map(() => Array(size).fill(false));
|
|
175
|
-
addFinderPattern(matrix as any, 0, 0);
|
|
176
|
-
addFinderPattern(matrix as any, size - 7, 0);
|
|
177
|
-
addFinderPattern(matrix as any, 0, size - 7);
|
|
178
|
-
for (let i = 0; i < text.length; i++) {
|
|
179
|
-
const r = (i * 3) % (size - 10) + 8;
|
|
180
|
-
const c = (i * 7) % (size - 10) + 8;
|
|
181
|
-
matrix[r][c] = true;
|
|
182
|
-
}
|
|
183
|
-
return matrix;
|
|
184
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|