indraq_cli 2.8.0 → 2.13.2
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 +185 -2
- package/cloud-api/.env.example +9 -0
- package/cloud-api/README.md +34 -1
- package/cloud-api/dist/index.js +1396 -68
- package/cloud-api/dist/index.js.map +1 -1
- package/cloud-api/dist/ota-device-enrollment.js +41 -0
- package/cloud-api/dist/ota-device-enrollment.js.map +1 -0
- package/cloud-api/dist/ota-enrollment-pages.js +67 -0
- package/cloud-api/dist/ota-enrollment-pages.js.map +1 -0
- package/cloud-api/dist/ota-recovery-content.js +36 -0
- package/cloud-api/dist/ota-recovery-content.js.map +1 -0
- package/cloud-api/dist/ota-recovery-protocol.js +16 -0
- package/cloud-api/dist/ota-release-policy.js +25 -0
- package/cloud-api/dist/ota-release-policy.js.map +1 -0
- package/cloud-api/package.json +1 -1
- package/cloud-api/public/indraq-logo.png +0 -0
- package/cloud-api/sql/015_ota_device_registry_and_withdrawal.sql +23 -0
- package/cloud-api/sql/016_ota_verified_tester_devices.sql +19 -0
- package/cloud-api/sql/017_ota_device_app_access_grants.sql +18 -0
- package/cloud-api/sql/018_ota_android_tester_agent.sql +24 -0
- package/cloud-api/sql/019_ota_android_scoped_testers.sql +9 -0
- package/cloud-api/sql/020_ota_recovery_and_retention.sql +21 -0
- package/cloud-api/sql/021_ota_device_profile_consolidation.sql +14 -0
- package/cloud-api/src/index.ts +1078 -82
- package/cloud-api/src/index.ts.backup-before-extra-params-2026-11-20T19-41-35-684Z +3189 -0
- package/cloud-api/src/ota-device-enrollment.ts +30 -0
- package/cloud-api/src/ota-enrollment-pages.ts +71 -0
- package/cloud-api/src/ota-recovery-content.ts +45 -0
- package/cloud-api/src/ota-recovery-protocol.ts +16 -0
- package/cloud-api/src/ota-release-policy.ts +28 -0
- package/dist/cli/help-content.d.ts.map +1 -1
- package/dist/cli/help-content.js +34 -10
- package/dist/cli/help-content.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/mobile/commands/build-mobile.command.d.ts +3 -1
- package/dist/modules/mobile/commands/build-mobile.command.d.ts.map +1 -1
- package/dist/modules/mobile/commands/build-mobile.command.js +216 -41
- package/dist/modules/mobile/commands/build-mobile.command.js.map +1 -1
- package/dist/modules/mobile/commands/mobile-build-wizard.command.d.ts +3 -1
- package/dist/modules/mobile/commands/mobile-build-wizard.command.d.ts.map +1 -1
- package/dist/modules/mobile/commands/mobile-build-wizard.command.js +23 -16
- package/dist/modules/mobile/commands/mobile-build-wizard.command.js.map +1 -1
- package/dist/modules/mobile/commands/mobile-prebuild.command.d.ts +2 -0
- package/dist/modules/mobile/commands/mobile-prebuild.command.d.ts.map +1 -1
- package/dist/modules/mobile/commands/mobile-prebuild.command.js +61 -2
- package/dist/modules/mobile/commands/mobile-prebuild.command.js.map +1 -1
- package/dist/modules/mobile/commands/ota.command.d.ts +9 -0
- package/dist/modules/mobile/commands/ota.command.d.ts.map +1 -1
- package/dist/modules/mobile/commands/ota.command.js +271 -103
- package/dist/modules/mobile/commands/ota.command.js.map +1 -1
- package/dist/modules/mobile/commands/testers.command.d.ts +11 -0
- package/dist/modules/mobile/commands/testers.command.d.ts.map +1 -1
- package/dist/modules/mobile/commands/testers.command.js +236 -5
- package/dist/modules/mobile/commands/testers.command.js.map +1 -1
- package/dist/modules/mobile/config/mobile-config.d.ts +3 -0
- package/dist/modules/mobile/config/mobile-config.d.ts.map +1 -1
- package/dist/modules/mobile/config/mobile-config.js.map +1 -1
- package/dist/modules/mobile/index.d.ts.map +1 -1
- package/dist/modules/mobile/index.js +49 -6
- package/dist/modules/mobile/index.js.map +1 -1
- package/dist/modules/mobile/services/mobile-cloud.service.d.ts +85 -1
- package/dist/modules/mobile/services/mobile-cloud.service.d.ts.map +1 -1
- package/dist/modules/mobile/services/mobile-cloud.service.js +27 -1
- package/dist/modules/mobile/services/mobile-cloud.service.js.map +1 -1
- package/dist/modules/mobile/services/mobile-native-integration.service.d.ts +12 -0
- package/dist/modules/mobile/services/mobile-native-integration.service.d.ts.map +1 -0
- package/dist/modules/mobile/services/mobile-native-integration.service.js +394 -0
- package/dist/modules/mobile/services/mobile-native-integration.service.js.map +1 -0
- package/dist/modules/mobile/services/ota-apk-validator.service.d.ts +22 -0
- package/dist/modules/mobile/services/ota-apk-validator.service.d.ts.map +1 -0
- package/dist/modules/mobile/services/ota-apk-validator.service.js +227 -0
- package/dist/modules/mobile/services/ota-apk-validator.service.js.map +1 -0
- package/dist/modules/mobile/services/ota-native-compatibility.service.d.ts +18 -0
- package/dist/modules/mobile/services/ota-native-compatibility.service.d.ts.map +1 -0
- package/dist/modules/mobile/services/ota-native-compatibility.service.js +21 -0
- package/dist/modules/mobile/services/ota-native-compatibility.service.js.map +1 -0
- package/dist/modules/mobile/services/ota-setup.service.d.ts +4 -0
- package/dist/modules/mobile/services/ota-setup.service.d.ts.map +1 -1
- package/dist/modules/mobile/services/ota-setup.service.js +240 -48
- package/dist/modules/mobile/services/ota-setup.service.js.map +1 -1
- package/dist/modules/mobile/services/tester-reconnect-policy.d.ts +9 -0
- package/dist/modules/mobile/services/tester-reconnect-policy.d.ts.map +1 -0
- package/dist/modules/mobile/services/tester-reconnect-policy.js +12 -0
- package/dist/modules/mobile/services/tester-reconnect-policy.js.map +1 -0
- package/dist/modules/mobile/services/tester-reconnect-probe.service.d.ts +5 -0
- package/dist/modules/mobile/services/tester-reconnect-probe.service.d.ts.map +1 -0
- package/dist/modules/mobile/services/tester-reconnect-probe.service.js +41 -0
- package/dist/modules/mobile/services/tester-reconnect-probe.service.js.map +1 -0
- package/dist/modules/scaffold/commands/init.command.d.ts.map +1 -1
- package/dist/modules/scaffold/commands/init.command.js +8 -2
- package/dist/modules/scaffold/commands/init.command.js.map +1 -1
- package/package.json +61 -4
- package/src/modules/mobile/services/android-agent-bridge/IIndraQTesterAgent.aidl +2 -0
- package/src/modules/mobile/services/android-agent-bridge/IndraQTesterModule.java +67 -0
- package/src/modules/mobile/services/android-agent-bridge/IndraQTesterPackage.java +15 -0
- package/src/modules/mobile/services/android-identity-bridge/IndraQDeviceIdentityModule.java +31 -0
- package/src/modules/mobile/services/android-identity-bridge/IndraQDeviceIdentityPackage.java +16 -0
- package/src/modules/mobile/services/expo-android-identity-plugin.cjs +44 -0
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareReactNativeOtaProject = exports.installAndroidScopedIdentityBridge = exports.installAndroidTesterAgentBridge = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Safe, repeatable native setup for bare React Native applications.
|
|
6
|
+
* No React Native Gradle plugin files in node_modules are ever modified.
|
|
7
|
+
*/
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const expo_app_json_service_1 = require("./expo-app-json.service");
|
|
11
|
+
const read = (path) => (0, node_fs_1.readFileSync)(path, 'utf8');
|
|
12
|
+
const saveIfChanged = (root, file, content) => {
|
|
13
|
+
const prior = (0, node_fs_1.existsSync)(file) ? read(file) : '';
|
|
14
|
+
if (prior === content)
|
|
15
|
+
return false;
|
|
16
|
+
// A single stable original backup; repeat prebuilds do not accumulate copies.
|
|
17
|
+
const backup = (0, node_path_1.join)(root, '.indraq', 'backups', 'mobile-native', (0, node_path_1.relative)(root, file) + '.original');
|
|
18
|
+
if ((0, node_fs_1.existsSync)(file) && !(0, node_fs_1.existsSync)(backup)) {
|
|
19
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(backup), { recursive: true });
|
|
20
|
+
(0, node_fs_1.writeFileSync)(backup, prior, { encoding: 'utf8', mode: 0o600, flag: 'wx' });
|
|
21
|
+
}
|
|
22
|
+
(0, node_fs_1.writeFileSync)(file, content, 'utf8');
|
|
23
|
+
return true;
|
|
24
|
+
};
|
|
25
|
+
const nativeScheme = (value) => {
|
|
26
|
+
const scheme = String(value || '').trim().toLowerCase();
|
|
27
|
+
if (!/^[a-z][a-z0-9+.-]{1,39}$/.test(scheme))
|
|
28
|
+
throw new Error(`Invalid native enrollment scheme: ${scheme}`);
|
|
29
|
+
return scheme;
|
|
30
|
+
};
|
|
31
|
+
const addAndroidDeepLink = (root, scheme) => {
|
|
32
|
+
const file = (0, node_path_1.join)(root, 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
|
|
33
|
+
if (!(0, node_fs_1.existsSync)(file))
|
|
34
|
+
throw new Error(`Missing ${(0, node_path_1.relative)(root, file)}. Native QR enrollment cannot be set up.`);
|
|
35
|
+
let xml = read(file);
|
|
36
|
+
const schemeTag = `android:scheme="${scheme}"`;
|
|
37
|
+
if (xml.includes(schemeTag) && xml.includes('android:host="indraq-enroll"'))
|
|
38
|
+
return false;
|
|
39
|
+
const activity = /<activity\b[^>]*android:name=["'](?:\.MainActivity|[^"']+\.MainActivity)["'][^>]*>/m.exec(xml);
|
|
40
|
+
if (!activity)
|
|
41
|
+
throw new Error('Cannot locate the Android MainActivity element. No deep link was added; custom manifests require review.');
|
|
42
|
+
const openingIndex = (activity.index || 0) + activity[0].length;
|
|
43
|
+
const closeIndex = xml.indexOf('</activity>', openingIndex);
|
|
44
|
+
if (closeIndex < 0)
|
|
45
|
+
throw new Error('MainActivity must have a closing </activity> element.');
|
|
46
|
+
// Android 12+ requires an exported activity for externally launched app links.
|
|
47
|
+
if (!/android:exported=["']true["']/.test(activity[0]))
|
|
48
|
+
throw new Error('MainActivity must declare android:exported="true" to receive QR enrollment links.');
|
|
49
|
+
const filter = `\n <!-- IndraQ OTA: safe to rerun prebuild; QR tester enrollment -->\n <intent-filter>\n <action android:name="android.intent.action.VIEW"/>\n <category android:name="android.intent.category.DEFAULT"/>\n <category android:name="android.intent.category.BROWSABLE"/>\n <data android:scheme="${scheme}" android:host="indraq-enroll"/>\n </intent-filter>\n`;
|
|
50
|
+
xml = xml.slice(0, closeIndex) + filter + xml.slice(closeIndex);
|
|
51
|
+
return saveIfChanged(root, file, xml);
|
|
52
|
+
};
|
|
53
|
+
const addIosDeepLink = (root, scheme) => {
|
|
54
|
+
const ios = (0, node_path_1.join)(root, 'ios');
|
|
55
|
+
if (!(0, node_fs_1.existsSync)(ios))
|
|
56
|
+
return false;
|
|
57
|
+
const { readdirSync } = require('node:fs');
|
|
58
|
+
const files = [];
|
|
59
|
+
const walk = (directory, depth) => {
|
|
60
|
+
if (depth > 3)
|
|
61
|
+
return;
|
|
62
|
+
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
63
|
+
if (['Pods', 'build', '.git'].includes(entry.name))
|
|
64
|
+
continue;
|
|
65
|
+
const next = (0, node_path_1.join)(directory, entry.name);
|
|
66
|
+
if (entry.isDirectory())
|
|
67
|
+
walk(next, depth + 1);
|
|
68
|
+
else if (entry.name === 'Info.plist')
|
|
69
|
+
files.push(next);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
walk(ios, 0);
|
|
73
|
+
if (files.length === 0)
|
|
74
|
+
throw new Error('iOS native folder exists but Info.plist was not found; check iOS deep-link setup manually.');
|
|
75
|
+
// Avoid editing extension or test target Info.plist. Select the main app plist by path.
|
|
76
|
+
const appPlist = files.find(f => f.replace(/\\/g, '/').includes('/ios/' + require('node:path').basename(root) + '/Info.plist')) || (files.length === 1 ? files[0] : null);
|
|
77
|
+
if (!appPlist)
|
|
78
|
+
throw new Error('Multiple iOS Info.plist files found; please choose the app target explicitly. Nothing modified.');
|
|
79
|
+
let text = read(appPlist);
|
|
80
|
+
if (text.includes(`<string>${scheme}</string>`))
|
|
81
|
+
return false;
|
|
82
|
+
if (!text.includes('</dict>'))
|
|
83
|
+
throw new Error('iOS app Info.plist does not contain a closing dictionary.');
|
|
84
|
+
const xml = `\n <!-- IndraQ OTA QR enrollment -->\n <key>CFBundleURLTypes</key>\n <array><dict><key>CFBundleURLName</key><string>indraq.ota.enroll</string><key>CFBundleURLSchemes</key><array><string>${scheme}</string></array></dict></array>\n`;
|
|
85
|
+
// Existing CFBundleURLTypes could contain OAuth schemes. Never overwrite them.
|
|
86
|
+
if (text.includes('<key>CFBundleURLTypes</key>')) {
|
|
87
|
+
const from = text.indexOf('<key>CFBundleURLTypes</key>');
|
|
88
|
+
const start = text.indexOf('<array>', from);
|
|
89
|
+
if (start < 0)
|
|
90
|
+
throw new Error('Cannot safely extend iOS CFBundleURLTypes.');
|
|
91
|
+
// CFBundleURLTypes contains nested CFBundleURLSchemes arrays. Insert into the
|
|
92
|
+
// OUTER array, not the first inner </array> (which would corrupt the plist).
|
|
93
|
+
const tags = /<\/?array>/g;
|
|
94
|
+
tags.lastIndex = start;
|
|
95
|
+
let depth = 0, end = -1, tag;
|
|
96
|
+
while ((tag = tags.exec(text)) !== null) {
|
|
97
|
+
depth += tag[0] === '<array>' ? 1 : -1;
|
|
98
|
+
if (depth === 0) {
|
|
99
|
+
end = tag.index;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (end < 0)
|
|
104
|
+
throw new Error('Cannot find the matching CFBundleURLTypes </array>.');
|
|
105
|
+
text = text.slice(0, end) + `<dict><key>CFBundleURLName</key><string>indraq.ota.enroll</string><key>CFBundleURLSchemes</key><array><string>${scheme}</string></array></dict>` + text.slice(end);
|
|
106
|
+
}
|
|
107
|
+
else
|
|
108
|
+
text = text.replace('</dict>', xml + '</dict>');
|
|
109
|
+
return saveIfChanged(root, appPlist, text);
|
|
110
|
+
};
|
|
111
|
+
const expoCliResolver = String.raw `def indraqCliProbe = ["node", "-e", "const fs=require('fs'),p=require('path');const root=p.dirname(require.resolve('expo/package.json'));for(const name of ['@expo/cli/build/bin/cli','@expo/cli','expo/bin/cli']){try{const f=require.resolve(name,{paths:[root]});if(fs.statSync(f).isFile()){process.stdout.write(f);process.exit(0)}}catch(e){}}process.stderr.write('Expo CLI file not found');process.exit(2)"].execute(null, rootDir)
|
|
112
|
+
def indraqCliPath = indraqCliProbe.text.trim()
|
|
113
|
+
if (indraqCliProbe.waitFor() != 0 || !indraqCliPath || !file(indraqCliPath).isFile()) {
|
|
114
|
+
throw new GradleException("IndraQ: Expo CLI could not be resolved. Check npm ci and expo version.")
|
|
115
|
+
}
|
|
116
|
+
cliFile = file(indraqCliPath)`;
|
|
117
|
+
const configureReactGradle = (root) => {
|
|
118
|
+
const file = (0, node_path_1.join)(root, 'android', 'app', 'build.gradle');
|
|
119
|
+
if (!(0, node_fs_1.existsSync)(file)) {
|
|
120
|
+
if ((0, node_fs_1.existsSync)(file + '.kts'))
|
|
121
|
+
throw new Error('Kotlin DSL build.gradle.kts requires a version-specific IndraQ adapter; refusing an unsafe Groovy patch.');
|
|
122
|
+
throw new Error('Missing android/app/build.gradle for React Native CLI setup.');
|
|
123
|
+
}
|
|
124
|
+
let src = read(file);
|
|
125
|
+
if (src.includes('INDRAQ_NATIVE_SETUP_V1'))
|
|
126
|
+
return false;
|
|
127
|
+
const react = /\breact\s*\{/g.exec(src);
|
|
128
|
+
if (!react)
|
|
129
|
+
throw new Error('Cannot find react { } in android/app/build.gradle. Unsupported template.');
|
|
130
|
+
const open = src.indexOf('{', react.index);
|
|
131
|
+
let depth = 1, end = -1, inSingle = false, inDouble = false, escaped = false;
|
|
132
|
+
for (let i = open + 1; i < src.length; i++) {
|
|
133
|
+
const c = src[i];
|
|
134
|
+
if (escaped) {
|
|
135
|
+
escaped = false;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (c === '\\') {
|
|
139
|
+
escaped = true;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (!inDouble && c === "'") {
|
|
143
|
+
inSingle = !inSingle;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (!inSingle && c === '"') {
|
|
147
|
+
inDouble = !inDouble;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (inSingle || inDouble)
|
|
151
|
+
continue;
|
|
152
|
+
if (c === '{')
|
|
153
|
+
depth++;
|
|
154
|
+
if (c === '}' && --depth === 0) {
|
|
155
|
+
end = i;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
if (c !== '}')
|
|
159
|
+
depth = Math.max(1, depth);
|
|
160
|
+
}
|
|
161
|
+
if (end < 0)
|
|
162
|
+
throw new Error('Unbalanced react { } in Android Gradle file; no modifications made.');
|
|
163
|
+
const entry = (0, node_fs_1.existsSync)((0, node_path_1.join)(root, 'index.js')) ? 'index.js' : (0, node_fs_1.existsSync)((0, node_path_1.join)(root, 'index.ts')) ? 'index.ts' : (0, node_fs_1.existsSync)((0, node_path_1.join)(root, 'index.tsx')) ? 'index.tsx' : null;
|
|
164
|
+
if (!entry)
|
|
165
|
+
throw new Error('Native app needs an index.js, index.ts, or index.tsx entry point.');
|
|
166
|
+
// Override after any template defaults; validated real paths, never file("")/android/app.
|
|
167
|
+
const patch = `\n // INDRAQ_NATIVE_SETUP_V1: validated files, no React Native plugin source hacks.\n def indraqValidatedEntry = file("../../${entry}")\n if (!indraqValidatedEntry.isFile()) throw new GradleException("IndraQ: entry file missing: ${entry}")\n entryFile = indraqValidatedEntry\n ${expoCliResolver}\n bundleCommand = "export:embed"\n`;
|
|
168
|
+
src = src.slice(0, end) + patch + src.slice(end);
|
|
169
|
+
return saveIfChanged(root, file, src);
|
|
170
|
+
};
|
|
171
|
+
/** Align the native app key and JS registration without overriding custom JS imports. */
|
|
172
|
+
const configureRegistration = (root, appName) => {
|
|
173
|
+
const appJson = (0, node_path_1.join)(root, 'app.json');
|
|
174
|
+
const doc = (0, node_fs_1.existsSync)(appJson) ? (0, expo_app_json_service_1.readExpoAppJson)(appJson).doc : { expo: { name: appName } };
|
|
175
|
+
const expo = doc.expo || doc;
|
|
176
|
+
if (!expo.name)
|
|
177
|
+
expo.name = appName;
|
|
178
|
+
const mainFiles = [(0, node_path_1.join)(root, 'android', 'app', 'src', 'main', 'java'), (0, node_path_1.join)(root, 'android', 'app', 'src', 'main', 'kotlin')];
|
|
179
|
+
const { readdirSync } = require('node:fs');
|
|
180
|
+
let nativeName = '';
|
|
181
|
+
let mainActivityFile = '';
|
|
182
|
+
const scan = (dir) => {
|
|
183
|
+
if (!(0, node_fs_1.existsSync)(dir))
|
|
184
|
+
return;
|
|
185
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
186
|
+
const target = (0, node_path_1.join)(dir, entry.name);
|
|
187
|
+
if (entry.isDirectory())
|
|
188
|
+
scan(target);
|
|
189
|
+
else if (/^MainActivity\.(kt|java)$/.test(entry.name)) {
|
|
190
|
+
const match = read(target).match(/getMainComponentName\s*\([^)]*\)\s*(?::\s*String\s*)?(?:=|\{\s*return)\s*["']([^"']+)["']/);
|
|
191
|
+
if (match?.[1]) {
|
|
192
|
+
nativeName = match[1];
|
|
193
|
+
mainActivityFile = target;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
for (const dir of mainFiles)
|
|
199
|
+
scan(dir);
|
|
200
|
+
if (!nativeName)
|
|
201
|
+
throw new Error('Cannot safely determine Android MainActivity.getMainComponentName(). Review app registration; no files rewritten.');
|
|
202
|
+
const entry = ['index.js', 'index.ts', 'index.tsx'].map(f => (0, node_path_1.join)(root, f)).find(node_fs_1.existsSync);
|
|
203
|
+
if (!entry)
|
|
204
|
+
throw new Error('Native app has no recognized JS entry file.');
|
|
205
|
+
const js = read(entry);
|
|
206
|
+
let changed = false;
|
|
207
|
+
if (/\bregisterRootComponent\s*\(/.test(js)) {
|
|
208
|
+
if (nativeName !== 'main') {
|
|
209
|
+
const activity = read(mainActivityFile);
|
|
210
|
+
const updated = activity.replace(/(getMainComponentName\s*\([^)]*\)\s*(?::\s*String\s*)?(?:=|\{\s*return)\s*)["'][^"']+["']/, '$1"main"');
|
|
211
|
+
if (updated === activity)
|
|
212
|
+
throw new Error('Cannot safely align MainActivity with Expo main registration.');
|
|
213
|
+
changed = saveIfChanged(root, mainActivityFile, updated) || changed;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else if (/\bAppRegistry\.registerComponent\s*\(\s*appName\b/.test(js) && /\bimport\s*\{\s*name\s+as\s+appName\s*\}\s*from\s*["']\.\/app\.json["']/.test(js)) {
|
|
217
|
+
if (doc.name && doc.name !== nativeName)
|
|
218
|
+
throw new Error(`app.json root name (${doc.name}) conflicts with Android (${nativeName}).`);
|
|
219
|
+
if (doc.name !== nativeName) {
|
|
220
|
+
doc.name = nativeName;
|
|
221
|
+
changed = true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else if (/\bAppRegistry\.registerComponent\s*\(\s*["']/.test(js)) {
|
|
225
|
+
const registration = js.match(/\bAppRegistry\.registerComponent\s*\(\s*["']([^"']+)["']/)?.[1];
|
|
226
|
+
if (registration !== nativeName)
|
|
227
|
+
throw new Error(`JS registers ${registration}, Android asks for ${nativeName}. Align manually.`);
|
|
228
|
+
}
|
|
229
|
+
else
|
|
230
|
+
throw new Error('Unknown JavaScript app registration template. IndraQ will not overwrite a custom entrypoint.');
|
|
231
|
+
if (!doc.expo)
|
|
232
|
+
doc.expo = expo;
|
|
233
|
+
if (changed)
|
|
234
|
+
(0, expo_app_json_service_1.writeExpoAppJson)(appJson, doc);
|
|
235
|
+
return changed;
|
|
236
|
+
};
|
|
237
|
+
/** Native Android device identity bridge; optional Tester Agent support remains for compatibility.
|
|
238
|
+
* Android scoped identity requires no separate agent, only Android 8+ and a stable signing certificate.
|
|
239
|
+
* Scoped Android ID is an identifier hint, NOT a cryptographic proof or secret.
|
|
240
|
+
*/
|
|
241
|
+
const installAndroidTesterAgentBridge = (root) => {
|
|
242
|
+
const app = (0, node_path_1.join)(root, 'android', 'app', 'src', 'main');
|
|
243
|
+
const java = (0, node_path_1.join)(app, 'java', 'com', 'indraq', 'ota');
|
|
244
|
+
const aidl = (0, node_path_1.join)(app, 'aidl', 'com', 'indraq', 'tester');
|
|
245
|
+
const sourceRoot = (0, node_path_1.join)(__dirname, '..', '..', '..', '..', 'src', 'modules', 'mobile', 'services', 'android-agent-bridge');
|
|
246
|
+
if (!(0, node_fs_1.existsSync)(sourceRoot))
|
|
247
|
+
throw new Error('IndraQ CLI distribution is missing the Android Tester Agent native bridge. Reinstall CLI from the complete package.');
|
|
248
|
+
(0, node_fs_1.mkdirSync)(java, { recursive: true });
|
|
249
|
+
(0, node_fs_1.mkdirSync)(aidl, { recursive: true });
|
|
250
|
+
let changed = false;
|
|
251
|
+
for (const name of ['IndraQTesterPackage.java', 'IndraQTesterModule.java']) {
|
|
252
|
+
const target = (0, node_path_1.join)(java, name);
|
|
253
|
+
changed = saveIfChanged(root, target, read((0, node_path_1.join)(sourceRoot, name))) || changed;
|
|
254
|
+
}
|
|
255
|
+
changed = saveIfChanged(root, (0, node_path_1.join)(aidl, 'IIndraQTesterAgent.aidl'), read((0, node_path_1.join)(sourceRoot, 'IIndraQTesterAgent.aidl'))) || changed;
|
|
256
|
+
// AGP 8+ disables AIDL generation by default; explicitly enable for the agent binder.
|
|
257
|
+
const gradle = (0, node_path_1.join)(root, 'android', 'app', 'build.gradle');
|
|
258
|
+
if (!(0, node_fs_1.existsSync)(gradle))
|
|
259
|
+
throw new Error('Android Tester Agent bridge needs android/app/build.gradle (Groovy).');
|
|
260
|
+
let gradleText = read(gradle);
|
|
261
|
+
if (!gradleText.includes('INDRAQ_AGENT_AIDL')) {
|
|
262
|
+
const androidBlock = /\bandroid\s*\{/g.exec(gradleText);
|
|
263
|
+
if (!androidBlock)
|
|
264
|
+
throw new Error('Could not locate Android build.gradle android block.');
|
|
265
|
+
const at = androidBlock.index + androidBlock[0].length;
|
|
266
|
+
gradleText = gradleText.slice(0, at) + '\n // INDRAQ_AGENT_AIDL\n buildFeatures { aidl true }\n' + gradleText.slice(at);
|
|
267
|
+
changed = saveIfChanged(root, gradle, gradleText) || changed;
|
|
268
|
+
}
|
|
269
|
+
const manifest = (0, node_path_1.join)(app, 'AndroidManifest.xml');
|
|
270
|
+
let xml = read(manifest);
|
|
271
|
+
if (!xml.includes('com.indraq.tester.permission.SIGN')) {
|
|
272
|
+
if (!xml.includes('</manifest>'))
|
|
273
|
+
throw new Error('Invalid AndroidManifest.xml (closing manifest missing).');
|
|
274
|
+
// Package visibility for the explicit service target on Android 11+.
|
|
275
|
+
const info = ` <uses-permission android:name="com.indraq.tester.permission.SIGN"/>\n <queries><package android:name="com.indraq.tester"/></queries>\n`;
|
|
276
|
+
xml = xml.replace('</manifest>', info + '</manifest>');
|
|
277
|
+
changed = saveIfChanged(root, manifest, xml) || changed;
|
|
278
|
+
}
|
|
279
|
+
// Never modify dependency or framework source. Register a single native package
|
|
280
|
+
// in the app MainApplication, using supported RN Kotlin/Java templates only.
|
|
281
|
+
const srcRoot = (0, node_path_1.join)(app, 'java');
|
|
282
|
+
const { readdirSync } = require('node:fs');
|
|
283
|
+
const mainApps = [];
|
|
284
|
+
const walk = (dir, depth) => {
|
|
285
|
+
if (depth > 12 || !(0, node_fs_1.existsSync)(dir))
|
|
286
|
+
return;
|
|
287
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
288
|
+
const full = (0, node_path_1.join)(dir, entry.name);
|
|
289
|
+
if (entry.isDirectory())
|
|
290
|
+
walk(full, depth + 1);
|
|
291
|
+
else if (/^MainApplication\.(kt|java)$/.test(entry.name))
|
|
292
|
+
mainApps.push(full);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
walk(srcRoot, 0);
|
|
296
|
+
const kotlin = (0, node_path_1.join)(app, 'kotlin');
|
|
297
|
+
if ((0, node_fs_1.existsSync)(kotlin))
|
|
298
|
+
walk(kotlin, 0);
|
|
299
|
+
if (mainApps.length !== 1)
|
|
300
|
+
throw new Error('Cannot safely locate a single MainApplication.java/.kt. Install the Tester Agent native bridge manually.');
|
|
301
|
+
const main = mainApps[0];
|
|
302
|
+
let code = read(main);
|
|
303
|
+
if (!code.includes('IndraQTesterPackage')) {
|
|
304
|
+
if (main.endsWith('.kt')) {
|
|
305
|
+
if (/PackageList\(this\)\.packages\.apply\s*\{/.test(code)) {
|
|
306
|
+
code = code.replace(/PackageList\(this\)\.packages\.apply\s*\{/, (v) => v + '\n add(com.indraq.ota.IndraQTesterPackage())');
|
|
307
|
+
}
|
|
308
|
+
else if (/PackageList\(this\)\.packages\b/.test(code)) {
|
|
309
|
+
code = code.replace(/PackageList\(this\)\.packages\b/, 'PackageList(this).packages.apply { add(com.indraq.ota.IndraQTesterPackage()) }');
|
|
310
|
+
}
|
|
311
|
+
else
|
|
312
|
+
throw new Error('Unsupported Kotlin React Native packages template; manual agent bridge registration required.');
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
const pattern = /(List<ReactPackage>\s+packages\s*=\s*new PackageList\(this\)\.getPackages\(\)\s*;)/;
|
|
316
|
+
if (pattern.test(code))
|
|
317
|
+
code = code.replace(pattern, '$1\n packages.add(new com.indraq.ota.IndraQTesterPackage());');
|
|
318
|
+
else
|
|
319
|
+
throw new Error('Unsupported Java React Native packages template; manual agent bridge registration required.');
|
|
320
|
+
}
|
|
321
|
+
changed = saveIfChanged(root, main, code) || changed;
|
|
322
|
+
}
|
|
323
|
+
return changed;
|
|
324
|
+
};
|
|
325
|
+
exports.installAndroidTesterAgentBridge = installAndroidTesterAgentBridge;
|
|
326
|
+
/** Lean React Native bridge for Android 8+ signing-key-scoped identity.
|
|
327
|
+
* No additional app, binder service, manifest permission or AIDL required.
|
|
328
|
+
* This is an identification hint for explicitly trusted internal testing only.
|
|
329
|
+
*/
|
|
330
|
+
const installAndroidScopedIdentityBridge = (root) => {
|
|
331
|
+
const mainRoot = (0, node_path_1.join)(root, 'android', 'app', 'src', 'main');
|
|
332
|
+
const java = (0, node_path_1.join)(mainRoot, 'java', 'com', 'indraq', 'ota');
|
|
333
|
+
const sourceRoot = (0, node_path_1.join)(__dirname, '..', '..', '..', '..', 'src', 'modules', 'mobile', 'services', 'android-identity-bridge');
|
|
334
|
+
if (!(0, node_fs_1.existsSync)(sourceRoot))
|
|
335
|
+
throw new Error('IndraQ CLI is missing the native Android identity bridge sources. Reinstall the full CLI.');
|
|
336
|
+
(0, node_fs_1.mkdirSync)(java, { recursive: true });
|
|
337
|
+
let changed = false;
|
|
338
|
+
for (const name of ['IndraQDeviceIdentityModule.java', 'IndraQDeviceIdentityPackage.java'])
|
|
339
|
+
changed = saveIfChanged(root, (0, node_path_1.join)(java, name), read((0, node_path_1.join)(sourceRoot, name))) || changed;
|
|
340
|
+
const { readdirSync } = require('node:fs');
|
|
341
|
+
const matches = [];
|
|
342
|
+
const walk = (dir, depth) => {
|
|
343
|
+
if (!(0, node_fs_1.existsSync)(dir) || depth > 12)
|
|
344
|
+
return;
|
|
345
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
346
|
+
const full = (0, node_path_1.join)(dir, entry.name);
|
|
347
|
+
if (entry.isDirectory())
|
|
348
|
+
walk(full, depth + 1);
|
|
349
|
+
else if (/^MainApplication\.(kt|java)$/.test(entry.name))
|
|
350
|
+
matches.push(full);
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
walk((0, node_path_1.join)(mainRoot, 'java'), 0);
|
|
354
|
+
walk((0, node_path_1.join)(mainRoot, 'kotlin'), 0);
|
|
355
|
+
if (matches.length !== 1)
|
|
356
|
+
throw new Error('Cannot locate a single React Native MainApplication.java/.kt; native identity bridge needs manual integration.');
|
|
357
|
+
const main = matches[0];
|
|
358
|
+
let code = read(main);
|
|
359
|
+
if (!code.includes('IndraQDeviceIdentityPackage')) {
|
|
360
|
+
if (main.endsWith('.kt')) {
|
|
361
|
+
if (/PackageList\(this\)\.packages\.apply\s*\{/.test(code)) {
|
|
362
|
+
code = code.replace(/PackageList\(this\)\.packages\.apply\s*\{/, v => v + '\n add(com.indraq.ota.IndraQDeviceIdentityPackage())');
|
|
363
|
+
}
|
|
364
|
+
else if (/PackageList\(this\)\.packages\b/.test(code)) {
|
|
365
|
+
code = code.replace(/PackageList\(this\)\.packages\b/, 'PackageList(this).packages.apply { add(com.indraq.ota.IndraQDeviceIdentityPackage()) }');
|
|
366
|
+
}
|
|
367
|
+
else
|
|
368
|
+
throw new Error('Unsupported Kotlin React Native packages template for scoped Android identity.');
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
const pattern = /(List<ReactPackage>\s+packages\s*=\s*new PackageList\(this\)\.getPackages\(\)\s*;)/;
|
|
372
|
+
if (!pattern.test(code))
|
|
373
|
+
throw new Error('Unsupported Java React Native packages template for scoped Android identity.');
|
|
374
|
+
code = code.replace(pattern, '$1\n packages.add(new com.indraq.ota.IndraQDeviceIdentityPackage());');
|
|
375
|
+
}
|
|
376
|
+
changed = saveIfChanged(root, main, code) || changed;
|
|
377
|
+
}
|
|
378
|
+
return changed;
|
|
379
|
+
};
|
|
380
|
+
exports.installAndroidScopedIdentityBridge = installAndroidScopedIdentityBridge;
|
|
381
|
+
const prepareReactNativeOtaProject = (root, appName, scheme) => {
|
|
382
|
+
const changes = [];
|
|
383
|
+
if (configureRegistration(root, appName))
|
|
384
|
+
changes.push('app registration');
|
|
385
|
+
if (configureReactGradle(root))
|
|
386
|
+
changes.push('React Native Gradle entry and Expo CLI');
|
|
387
|
+
if (addAndroidDeepLink(root, nativeScheme(scheme)))
|
|
388
|
+
changes.push('Android QR deep link');
|
|
389
|
+
if (addIosDeepLink(root, nativeScheme(scheme)))
|
|
390
|
+
changes.push('iOS QR deep link');
|
|
391
|
+
return changes;
|
|
392
|
+
};
|
|
393
|
+
exports.prepareReactNativeOtaProject = prepareReactNativeOtaProject;
|
|
394
|
+
//# sourceMappingURL=mobile-native-integration.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile-native-integration.service.js","sourceRoot":"","sources":["../../../../src/modules/mobile/services/mobile-native-integration.service.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,qCAA6E;AAC7E,yCAAoD;AACpD,mEAA4E;AAE5E,MAAM,IAAI,GAAG,CAAC,IAAW,EAAS,EAAE,CAAC,IAAA,sBAAY,EAAC,IAAI,EAAC,MAAM,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Aa,EAAW,EAAE;IAChG,MAAM,OAAO,GAAU,EAAE,CAAC;IAC1B,IAAG,qBAAqB,CAAC,IAAI,EAAC,OAAO,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACxE,IAAG,oBAAoB,CAAC,IAAI,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACrF,IAAG,kBAAkB,CAAC,IAAI,EAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACtF,IAAG,cAAc,CAAC,IAAI,EAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC9E,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAPW,QAAA,4BAA4B,gCAOvC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ApkPreflight {
|
|
2
|
+
apkPath: string;
|
|
3
|
+
updateId: string;
|
|
4
|
+
commitTime: number;
|
|
5
|
+
assetCount: number;
|
|
6
|
+
bundleBytes: number;
|
|
7
|
+
manifestBytes: number;
|
|
8
|
+
archiveEntries: number;
|
|
9
|
+
warnings: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function inspectOtaApk(path: string): ApkPreflight;
|
|
12
|
+
/** Replaces an APK without deleting the Android app sandbox. Do not "fix" signing
|
|
13
|
+
* incompatibility by uninstalling: that destroys the already approved OTA ID. */
|
|
14
|
+
export declare function safeInstallOtaApkInPlace(adb: (args: string[], label: string, timeout?: number) => string, packageName: string, apkPath: string): boolean;
|
|
15
|
+
export interface VerifyApkOptions {
|
|
16
|
+
device?: string;
|
|
17
|
+
packageName?: string;
|
|
18
|
+
install?: boolean;
|
|
19
|
+
smokeTest?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function verifyOtaApk(path: string, options?: VerifyApkOptions): Promise<void>;
|
|
22
|
+
//# sourceMappingURL=ota-apk-validator.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ota-apk-validator.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/mobile/services/ota-apk-validator.service.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAiDD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAiCxD;AAkBD;iFACiF;AACjF,wBAAgB,wBAAwB,CACtC,GAAG,EAAC,CAAC,IAAI,EAAC,MAAM,EAAE,EAAE,KAAK,EAAC,MAAM,EAAE,OAAO,CAAC,EAAC,MAAM,KAAG,MAAM,EAC1D,WAAW,EAAC,MAAM,EAClB,OAAO,EAAC,MAAM,GACd,OAAO,CAYR;AAED,MAAM,WAAW,gBAAgB;IAAG,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAAE;AACpH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+D9F"}
|