nativekeel 0.1.14 → 0.1.15
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 +37 -27
- package/package.json +1 -1
- package/src/plan.js +1 -1
- package/src/project.js +32 -0
- package/src/report-html.js +1 -1
package/README.md
CHANGED
|
@@ -6,36 +6,46 @@ Health check for React Native and Expo apps. One command, no install, no account
|
|
|
6
6
|
npx nativekeel
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
**What's new in 0.1.14:** secrets in Expo config (`extra`, `EXPO_PUBLIC_`, `eas.json`) and imports of APIs removed from React Native core.
|
|
10
|
-
|
|
11
|
-
It answers the questions that decide whether your app can still ship:
|
|
12
|
-
|
|
13
|
-
- **Is your React Native / Expo version still supported?** React Native supports the latest minor and the two before it.
|
|
14
|
-
- **Can you upgrade at all?** The legacy architecture was removed in 0.82. If the New Architecture is off, you are stuck at 0.81.
|
|
15
|
-
- **Which packages block the upgrade?** Native modules without New Architecture support, unmaintained or with no release in years, with known alternatives. Outdated "unmaintained" flags are cross-checked against the latest npm release.
|
|
16
|
-
- **What can you simply delete?** Packages that are installed but never imported, referenced natively or required by another package. Every one you remove is one you never upgrade.
|
|
17
|
-
- **Will the stores accept your next build?** Google Play `targetSdk` and 16 KB page size (it opens your built APK/AAB and checks the alignment of every native library), and the iOS privacy manifest.
|
|
18
|
-
- **Are secrets shipped inside your app?** AWS, Stripe, OpenAI, Anthropic, GitHub, Slack, SendGrid, Twilio, Shopify, Google OAuth keys, private keys and Supabase `service_role` keys (anon keys are fine), plus `.env` values that `react-native-config` or `EXPO_PUBLIC_` compile into the bundle, and secrets in Expo `extra` or `eas.json`. Server-side folders are reported separately.
|
|
19
|
-
- **Is transport security off?** Cleartext HTTP or `debuggable` in the release Android manifest, `NSAllowsArbitraryLoads` on iOS.
|
|
20
|
-
- **Do you ship known vulnerabilities?** Advisories from the GitHub Advisory Database for the exact versions in your lockfile or `node_modules`. Advisories that only affect Node.js servers are kept, at low severity.
|
|
21
|
-
- **Can someone break in?** Grouped by OWASP MASVS: Firebase Realtime Database/Firestore/Storage rules open to anyone (or in test mode), TLS certificate checks turned off in native code, hardcoded encryption keys, MD5/SHA-1 on passwords, ECB mode, `Math.random` for nonces and salts. These are static checks: they catch the common, detectable mistakes, not everything a penetration test of the running app would.
|
|
22
|
-
- **Can someone read your users' data?** Passwords that flow into crash reports, analytics, remote databases or plain AsyncStorage (followed through intermediate variables), WebViews that let page scripts read local files or load HTTP into HTTPS, Android backups that copy tokens, Android components any app can start, API calls over plain HTTP, auth tokens in unencrypted storage.
|
|
23
|
-
- **Is it slow or heavy?** A FlatList inside a ScrollView (no virtualization), animations with `useNativeDriver: false`, `console.log` left in release builds, whole-library `lodash`/`moment` imports, images over 500 KB that the app requires. Static signs to measure on a device, not a profiler.
|
|
24
|
-
- **Can it be taken apart?** Source maps packaged into the app, Hermes or R8 off in release (OWASP MASVS-RESILIENCE). Obfuscation only slows an attacker down; keep secrets and checks on the server.
|
|
25
|
-
- **Will it crash at runtime?** Reanimated without its Babel plugin or `react-native-worklets`, mixed `@react-native-firebase/*` or `@react-navigation/*` majors, a second copy of React or React Native inside a dependency, Kotlin modules that cannot load through the New Architecture interop layer, AppDelegate setups that crash in Release, camera/photos/location access without the Info.plist description iOS requires, imports of APIs removed from React Native core (`AsyncStorage`, `Picker`, `ViewPropTypes`, …).
|
|
26
|
-
- **Leftovers from old templates?** Flipper, JavaScriptCore instead of Hermes.
|
|
9
|
+
**What's new in 0.1.15:** run it at a monorepo root and it lists the app folders to scan. **0.1.14:** secrets in Expo config (`extra`, `EXPO_PUBLIC_`, `eas.json`) and imports of APIs removed from React Native core. Recent releases added a *Start here* list in every report, hacking risks mapped to OWASP MASVS, crash and performance checks. Every check is tuned on 280+ open-source React Native and Expo apps to keep false alarms out. [All releases →](https://nativekeel.com/changelog)
|
|
27
10
|
|
|
28
11
|
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Likely upgrade blocker. Alternatives: expo-image.
|
|
12
|
+
Summary 4 critical · 5 high · 4 medium · 6 low
|
|
13
|
+
Security (OWASP MASVS) crypto 1 · network 1 · 7 groups checked
|
|
14
|
+
|
|
15
|
+
Start here
|
|
16
|
+
1. Revoke the AWS access key ID in src/App.js:6 at the provider today.
|
|
17
|
+
2. Set targetSdkVersion = 36 and compileSdkVersion = 36 in android/build.gradle.
|
|
18
|
+
3. Run pod install, commit the generated PrivacyInfo.xcprivacy, and add your data types.
|
|
37
19
|
```
|
|
38
20
|
|
|
21
|
+
## What it checks
|
|
22
|
+
|
|
23
|
+
**Upgrade**
|
|
24
|
+
- **Is your React Native / Expo version still supported?** React Native supports the latest three minors; in Expo projects React Native moves with the SDK.
|
|
25
|
+
- **Can you upgrade at all?** The legacy architecture was removed in 0.82. If the New Architecture is off (it is off by default before 0.76), you are stuck at 0.81.
|
|
26
|
+
- **Which packages block the upgrade?** Native modules without New Architecture support (cross-checked with the package's own codegen spec), unmaintained or with no release in years, with verified alternatives and renamed packages. Library versions for each step come from the libraries' own compatibility tables.
|
|
27
|
+
- **What can you simply delete?** Installed packages that nothing imports, references natively, requires or patches.
|
|
28
|
+
|
|
29
|
+
**Store**
|
|
30
|
+
- **Will Google Play and the App Store accept your next build?** `targetSdk`, 16 KB memory pages (it also opens your built APK/AAB and checks every native library), the iOS privacy manifest, and missing Info.plist usage descriptions.
|
|
31
|
+
|
|
32
|
+
**Crashes**
|
|
33
|
+
- **Will it crash at runtime?** Reanimated without its Babel plugin or `react-native-worklets`, mixed `@react-native-firebase/*` or `@react-navigation/*` majors, a second copy of React or React Native inside a dependency, Kotlin modules that cannot load through the New Architecture interop layer, AppDelegate setups that crash in Release, camera/photos/location access without the Info.plist text iOS requires, imports of APIs removed from React Native core (`AsyncStorage`, `Picker`, `ViewPropTypes`, …), and traps learned from real upgrades.
|
|
34
|
+
|
|
35
|
+
**Security, grouped by OWASP MASVS**
|
|
36
|
+
- **Secrets in the app or the repo:** AWS, Stripe, OpenAI, Anthropic, GitHub, Slack, SendGrid, Twilio, Shopify, Google OAuth and Supabase `service_role` keys, private keys, `.env` values compiled into the bundle, Expo `extra`/`EXPO_PUBLIC_`/`eas.json` secrets, signing keys and passwords.
|
|
37
|
+
- **Data on the device:** passwords that flow into crash reports, analytics, databases or plain AsyncStorage (followed through variables), auth tokens in unencrypted storage, Android backups that copy them.
|
|
38
|
+
- **Network:** TLS certificate checks turned off in native code, cleartext HTTP, `NSAllowsArbitraryLoads`, plain-HTTP API calls, user-installed CAs in release.
|
|
39
|
+
- **Backend rules:** Firebase Realtime Database, Firestore and Storage rules open to anyone or in test mode.
|
|
40
|
+
- **Cryptography:** hardcoded encryption keys, MD5/SHA-1 on passwords, ECB mode, `Math.random` for nonces and salts.
|
|
41
|
+
- **Platform:** WebViews that read local files or load HTTP into HTTPS, Android components any app can start.
|
|
42
|
+
- **Dependencies and reverse engineering:** known vulnerabilities in the exact versions you ship (GitHub Advisory Database), source maps in the app, Hermes or R8 off.
|
|
43
|
+
|
|
44
|
+
These are static checks: they catch the common, detectable mistakes, not everything a penetration test of the running app and backend would.
|
|
45
|
+
|
|
46
|
+
**Performance**
|
|
47
|
+
- **Is it slow or heavy?** A FlatList inside a ScrollView (no virtualization), animations with `useNativeDriver: false`, `console.log` left in release builds, whole-library `lodash`/`moment` imports, images over 500 KB that the app requires.
|
|
48
|
+
|
|
39
49
|
## Usage
|
|
40
50
|
|
|
41
51
|
```sh
|
|
@@ -54,7 +64,7 @@ Everything is free. The scan exits with code `1` when it finds a critical issue,
|
|
|
54
64
|
|
|
55
65
|
### Upgrade plan
|
|
56
66
|
|
|
57
|
-
`nativekeel plan` turns the report into ordered work: stop leaks
|
|
67
|
+
`nativekeel plan` turns the report into ordered work: stop leaks, set up a safety net of UI flows, fix crash risks, meet store deadlines, close security gaps, replace blocking packages, switch on the New Architecture at the right point, then upgrade React Native (or the Expo SDK) in small, reviewable hops with links to the Upgrade Helper diffs and the library versions each hop needs. Performance fixes and routine updates come last.
|
|
58
68
|
|
|
59
69
|
### GitHub Action
|
|
60
70
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nativekeel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Health check for React Native and Expo apps: upgrade blockers, store deadlines, crash risks, vulnerable dependencies and leaked secrets, with a step-by-step upgrade plan.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/plan.js
CHANGED
|
@@ -586,7 +586,7 @@ export function buildPlan(result) {
|
|
|
586
586
|
export function planToMarkdown(result, plan) {
|
|
587
587
|
const p = result.project;
|
|
588
588
|
const lines = [
|
|
589
|
-
`# Upgrade plan: ${p.name || 'your app'}`,
|
|
589
|
+
`# ${plan.phases.some((ph) => /^Upgrade (React Native|Expo SDK)/.test(ph.title)) ? 'Upgrade plan' : 'Action plan'}: ${p.name || 'your app'}`,
|
|
590
590
|
'',
|
|
591
591
|
`Generated by NativeKeel on ${result.scannedAt.slice(0, 10)}. `,
|
|
592
592
|
`React Native ${p.reactNative || '-'}${p.expo ? ` · Expo ${p.expo}` : ''} → latest ${result.latest.reactNative || '-'}. `,
|
package/src/project.js
CHANGED
|
@@ -126,6 +126,10 @@ export function loadProject(root) {
|
|
|
126
126
|
const devDeps = resolveCatalogRefs({ ...(pkg.devDependencies || {}) }, catalogs);
|
|
127
127
|
const declared = (name) => deps[name] || devDeps[name];
|
|
128
128
|
if (!declared('react-native') && !declared('expo')) {
|
|
129
|
+
const apps = findAppFolders(root);
|
|
130
|
+
if (apps.length) {
|
|
131
|
+
throw new Error(`This folder is not a React Native app, but it contains ${apps.length === 1 ? 'one' : apps.length}:\n${apps.slice(0, 8).map((a) => ` npx nativekeel ${a}`).join('\n')}${apps.length > 8 ? '\n …' : ''}`);
|
|
132
|
+
}
|
|
129
133
|
throw new Error('This does not look like a React Native app (no react-native or expo dependency). Run it inside your app folder.');
|
|
130
134
|
}
|
|
131
135
|
|
|
@@ -193,3 +197,31 @@ function detectAndroid(root) {
|
|
|
193
197
|
};
|
|
194
198
|
return { targetSdk: num('targetSdk'), compileSdk: num('compileSdk'), minSdk: num('minSdk') };
|
|
195
199
|
}
|
|
200
|
+
|
|
201
|
+
// React Native / Expo app folders below `root` (monorepos: apps/mobile, packages/app, …), as
|
|
202
|
+
// relative paths. Libraries (react-native as a peer) are left out.
|
|
203
|
+
export function findAppFolders(root, maxDepth = 3) {
|
|
204
|
+
const out = [];
|
|
205
|
+
const skip = new Set(['node_modules', '.git', 'Pods', 'build', 'dist', '.expo', 'android', 'ios', 'vendor', 'example', 'examples', 'docs', 'website', 'e2e', 'test', 'tests']);
|
|
206
|
+
const visit = (dir, depth) => {
|
|
207
|
+
if (depth > maxDepth) return;
|
|
208
|
+
let entries = [];
|
|
209
|
+
try {
|
|
210
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
211
|
+
} catch {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
for (const e of entries) {
|
|
215
|
+
if (!e.isDirectory() || skip.has(e.name) || e.name.startsWith('.')) continue;
|
|
216
|
+
const sub = path.join(dir, e.name);
|
|
217
|
+
const pkg = readJson(path.join(sub, 'package.json'));
|
|
218
|
+
const deps = pkg ? { ...pkg.dependencies, ...pkg.devDependencies } : {};
|
|
219
|
+
const isApp = pkg && (deps['react-native'] || deps.expo) && !(pkg.peerDependencies && pkg.peerDependencies['react-native']) &&
|
|
220
|
+
['android', 'ios', 'app.json', 'app.config.js', 'app.config.ts'].some((f) => fs.existsSync(path.join(sub, f)));
|
|
221
|
+
if (isApp) out.push(path.relative(root, sub));
|
|
222
|
+
else visit(sub, depth + 1);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
visit(root, 1);
|
|
226
|
+
return out.sort();
|
|
227
|
+
}
|
package/src/report-html.js
CHANGED
|
@@ -32,7 +32,7 @@ export function htmlReport(result, { brand = null, plan = null } = {}) {
|
|
|
32
32
|
: '';
|
|
33
33
|
|
|
34
34
|
const planHtml = plan
|
|
35
|
-
? `<section><h2
|
|
35
|
+
? `<section><h2>${plan.phases.some((ph) => /^Upgrade (React Native|Expo SDK)/.test(ph.title)) ? 'Upgrade plan' : 'Action plan'} <small>scope: ${esc(plan.complexity.size)}</small></h2>${plan.phases
|
|
36
36
|
.map((ph, i) => `<h3>${i + 1}. ${esc(ph.title)}</h3><p class="why">${esc(ph.why)}</p><ul>${ph.steps.map((s) => `<li>${rich(s)}</li>`).join('')}</ul>`)
|
|
37
37
|
.join('')}</section>`
|
|
38
38
|
: '';
|