Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Droid Commander Production Android Build, Signing & Security Scanning

permissions:
contents: read

on:
pull_request:
types: [opened, synchronize, reopened]
Expand Down Expand Up @@ -90,3 +93,98 @@ jobs:

- name: Run Jest Test Suite
run: npm test -- --passWithNoTests

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Create temporary debug signing keystore
run: |
keytool -genkeypair -v \
-keystore android/app/debug.keystore \
-storepass android \
-alias androiddebugkey \
-keypass android \
-keyalg RSA -keysize 2048 -validity 10000 \
-dname "CN=Android Debug,O=Android,C=US" \
-noprompt

- name: Build debug APK
run: |
chmod +x android/gradlew
cd android
./gradlew --no-daemon assembleDebug

- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: droid-commander-debug-apk
path: android/app/build/outputs/apk/debug/*.apk
if-no-files-found: error
retention-days: 14

build-release-apk:
name: Build signed production release APK
needs: sast-static-analysis
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout Codebase
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'zulu'

- name: Set up Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Configure release signing
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEYSTORE_PATH: ${{ runner.temp }}/droid-commander-release.keystore
run: |
set -euo pipefail
for name in ANDROID_KEYSTORE_BASE64 ANDROID_KEYSTORE_PASSWORD ANDROID_KEY_ALIAS ANDROID_KEY_PASSWORD; do
if [ -z "${!name}" ]; then
echo "::error::Missing required GitHub Actions secret: $name"
exit 1
fi
done
printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 --decode > "$ANDROID_KEYSTORE_PATH"
chmod 600 "$ANDROID_KEYSTORE_PATH"
echo "ANDROID_KEYSTORE_PATH=$ANDROID_KEYSTORE_PATH" >> "$GITHUB_ENV"
echo "ANDROID_KEYSTORE_PASSWORD=$ANDROID_KEYSTORE_PASSWORD" >> "$GITHUB_ENV"
echo "ANDROID_KEY_ALIAS=$ANDROID_KEY_ALIAS" >> "$GITHUB_ENV"
echo "ANDROID_KEY_PASSWORD=$ANDROID_KEY_PASSWORD" >> "$GITHUB_ENV"

- name: Build signed release APK
env:
ANDROID_VERSION_CODE: ${{ github.run_number }}
ANDROID_VERSION_NAME: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || format('manual-{0}', github.run_number) }}
run: |
chmod +x android/gradlew
cd android
./gradlew --no-daemon assembleRelease

- name: Upload signed release APK
uses: actions/upload-artifact@v4
with:
name: droid-commander-release-apk
path: android/app/build/outputs/apk/release/*.apk
if-no-files-found: error
retention-days: 30
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
4 changes: 3 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ react {
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
// Package the JavaScript bundle in BOTH debug and release APKs. This makes the CI debug APK installable without Metro.
// Keep this empty: the default ["debug"] skips JS bundling for debug builds.
debuggableVariants = []

/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
Expand Down
2 changes: 1 addition & 1 deletion app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Tabs } from "expo-router";
import { useSafeAreaInsets } from "react-native-safe-area-context";

import { HapticTab } from "../../components/HapticTab";
import { HapticTab } from "../../components/haptic-tab";
import { IconSymbol } from "@/components/ui/icon-symbol";
import { palette } from "@/constants/commander";
import { Platform } from "react-native";
Expand Down
13 changes: 0 additions & 13 deletions app/(tabs)/wireless-diagnostics-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,6 @@ export default function WirelessDiagnosticsScreen() {
)}
</View>

<View style={styles.card}>
<Text style={styles.cardTitle}>Wi-Fi Networks ({wifiNetworks.length})</Text>
{wifiNetworks.map((net, idx) => (
<View key={idx} style={styles.listItem}>
<View>
<Text style={styles.itemTitle}>{net.ssid} {net.isConnected ? "(Connected)" : ""}</Text>
4Text style={styles.itemSub}>BSSID: {net.bssid} | {net.security}</Text>
</View>
<Text style={styles.rssiText}>{net.rssi} dBm</Text>
</View>
))}
</View>

<View style={styles.card}>
<Text style={styles.cardTitle}>Wi-Fi Networks ({wifiNetworks.length})</Text>
{wifiNetworks.map((net, idx) => (
Expand Down
85 changes: 79 additions & 6 deletions app//vulnerability-scanner-screen-v3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function VulnerabilityScannerScreenV3() {
<ScrollView style={styles.container} contentContainerStyle={styles.content}>
{/* Header */}
<View style={styles.header}>
<Text style={styles.title}>Live Host Uulnerability Scanner v2</Text>
<Text style={styles.title}>Live Host Vulnerability Scanner v2</Text>
<Text style={styles.subtitle}>
Offline Multi-Gate CVE Correlation & Firmware Risk Engine
</Text>
Expand All @@ -127,8 +127,7 @@ export default function VulnerabilityScannerScreenV3() {

{/* Device Telemetry Snapshot */}
<View style={styles.card}>
<Text style={styles.cardTitle}>Collecte
‰eyË^t Host Telemetry</Text>
<Text style={styles.cardTitle}>Collected Host Telemetry</Text>
<View style={styles.metaGrid}>
<View style={styles.metaItem}>
<Text style={styles.metaLabel}>Device ID:</Text>
Expand Down Expand Up @@ -183,10 +182,10 @@ export default function VulnerabilityScannerScreenV3() {
>
{report.overallRiskScore.toFixed(1)} / 10.0
</Text>
pText style={styles.scoreLabel}>CVSS v3.1 Composite Risk Score</Text>
<Text style={styles.scoreLabel}>CVSS v3.1 Composite Risk Score</Text>
</View>

<View style={styles.summary.BadgeRow}>
<View style={styles.summaryBadgeRow}>
<View style={[styles.badge, { backgroundColor: "#EF444420", borderColor: "#EF4444" }]}>
<Text style={[styles.badgeText, { color: "#EF4444" }]}>
{report.summary.criticalCount} Critical
Expand Down Expand Up @@ -258,4 +257,78 @@ export default function VulnerabilityScannerScreenV3() {
<View style={styles.remediationBox}>
<Text style={styles.remediationHeader}>Automated Remediation Playbook:</Text>
<Text style={styles.remediationText}>
{item.signature.remediationAction&jÚâ
{item.signature.remediationAction}
</Text>
</View>
</View>
))
)}
</View>
</>
)}
</ScrollView>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: "#0A0E17" },
content: { padding: 16 },
header: { marginBottom: 16 },
title: { fontSize: 20, fontWeight: "bold", color: "#F8FAFC" },
subtitle: { fontSize: 13, color: "#94A3B8", marginTop: 2 },
card: {
backgroundColor: "#1E293B",
borderRadius: 12,
padding: 16,
marginBottom: 16,
borderWidth: 1,
borderColor: "#334155",
},
cardTitle: { fontSize: 16, fontWeight: "600", color: "#38BDF8", marginBottom: 12 },
primaryButton: {
backgroundColor: "#0284C7",
paddingVertical: 12,
borderRadius: 8,
alignItems: "center",
},
buttonText: { color: "#FFFFFF", fontWeight: "600", fontSize: 14 },
metaGrid: { flexDirection: "row", flexWrap: "wrap", justifyContent: "space-between" },
metaItem: { width: "48%", marginBottom: 10 },
metaLabel: { fontSize: 12, color: "#64748B" },
metaValue: { fontSize: 13, fontWeight: "600", color: "#F1F5F9", marginTop: 2 },
metaValueSmall: { fontSize: 11, fontWeight: "500", color: "#CBD5E1", marginTop: 2 },
scoreContainer: { alignItems: "center", marginVertical: 12 },
scoreValue: { fontSize: 32, fontWeight: "bold" },
scoreLabel: { fontSize: 12, color: "#94A3B8", marginTop: 2 },
summaryBadgeRow: { flexDirection: "row", justifyContent: "space-around", marginTop: 8 },
badge: { paddingHorizontal: 10, paddingVertical: 4, borderRadius: 16, borderWidth: 1 },
badgeText: { fontSize: 12, fontWeight: "bold" },
cleanStateText: { color: "#10B981", fontSize: 14, fontWeight: "500", textAlign: "center", marginVertical: 12 },
cveCard: {
backgroundColor: "#0F172A",
borderRadius: 8,
padding: 12,
marginBottom: 12,
borderLeftWidth: 4,
borderLeftColor: "#38BDF8",
},
cveHeader: { flexDirection: "row", justifyContent: "space-between", alignItems: "center" },
cveId: { fontSize: 14, fontWeight: "bold", color: "#38BDF8" },
badgeGroup: { flexDirection: "row", gap: 6 },
miniBadge: { paddingHorizontal: 6, paddingVertical: 2, borderRadius: 4 },
miniBadgeText: { color: "#FFFFFF", fontSize: 10, fontWeight: "bold" },
cveTitle: { fontSize: 13, fontWeight: "600", color: "#F8FAFC", marginTop: 6 },
cveDesc: { fontSize: 12, color: "#94A3B8", marginTop: 4 },
sectionHeader: { fontSize: 12, fontWeight: "600", color: "#CBD5E1", marginTop: 8 },
reasonText: { fontSize: 11, color: "#94A3B8", marginLeft: 4, marginTop: 2 },
remediationBox: {
backgroundColor: "#1E293B",
borderRadius: 6,
padding: 8,
marginTop: 10,
borderWidth: 1,
borderColor: "#334155",
},
remediationHeader: { fontSize: 11, fontWeight: "bold", color: "#38BDF8" },
remediationText: { fontSize: 11, color: "#E2E8F0", marginTop: 2 },
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Intent
import android.os.Build
import android.provider.Settings
import android.util.Base64
import java.util.zip.CRC32
import expo.modules.kotlin.modules.Module
import expo.modules.kotlin.modules.ModuleDefinition

Expand Down Expand Up @@ -155,5 +156,4 @@ class DroidCommanderUsbHostModule : Module() {
}
}

import java.util.zip.CRC32
// FAIL_CLOSED ENFORCE_EXECUTION_GATES
5 changes: 1 addition & 4 deletions privileged-action-ledger-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,4 @@ CREATE TABLE IF NOT EXISTS \`used_nonces\` (
);
`;

export class PrivilegedActionLedger {
static recordAction(...args: any[]): any { return {}; }
static record(...args: any[]): any { return {}; }
}

8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
"skipLibCheck": true,
"noImplicitAny": false,
"strict": false,
"esModuleInterop": true
"esModuleInterop": true,
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": [
"/*.ts",
Expand All @@ -18,4 +22,4 @@
"**/*.jsx",
"global.d.ts"
]
}
}
Loading