A calculator app that hides personal safety features behind secret codes. Designed for women and vulnerable individuals who need a discreet way to call for help in dangerous situations.
Built for HackViolet 2026.
CalcGuard looks and functions exactly like a standard iOS calculator. However, when the user types a specific numeric code followed by =, it silently triggers a safety action in the background — no visible change on screen, no alerts, no notifications.
| Code | Action | Description |
|---|---|---|
100= |
Open Settings | Opens the hidden settings dashboard (fixed, cannot be changed) |
911= |
Emergency Alert | Sends email with GPS location to all emergency contacts |
200= |
Directions | Voice-activated navigation via Gemini AI |
300= |
Start Recording | Begins background audio recording |
400= |
Fake Call | Triggers a fake incoming call with AI-generated voice |
500= |
Safe Check-in | Sends "I'm safe" email to contacts |
600= |
Fake Shutdown | Screen goes completely black (triple-tap to exit) |
700= |
Stop All | Stops recording and uploads saved audio |
All codes except 100= (settings) are fully customizable by the user.
- Open the app — you see a normal calculator
- Type
100=— the hidden settings dashboard opens - Add emergency contacts (name + email)
- Customize your secret codes if desired
- Tap Save — all codes become active
- You're back on the calculator, ready to use
- React Native with Expo SDK 54 (TypeScript)
- Firebase — Cloud Functions, Cloud Storage, Firestore
- Nodemailer + Gmail — Silent email delivery via Firebase Cloud Functions
- Google Gemini 2.0 Flash — AI-generated emergency messages and voice-activated directions
- ElevenLabs — AI voice synthesis for fake incoming calls
- expo-location — GPS coordinates for emergency alerts and directions
- expo-av — Audio recording and voice input
- expo-secure-store — Encrypted local storage for contacts and codes
Sends an email to all emergency contacts containing:
- A custom or AI-generated message
- A Google Maps link with the user's current GPS coordinates
When AI messages are enabled, Gemini generates natural-sounding texts like "Hey can you come pick me up? I'm at [location]" instead of obvious emergency alerts — important if someone dangerous is watching the phone screen.
Speak a destination and get turn-by-turn directions displayed on the calculator screen:
- Type
200=— countdown (5, 4, 3, 2, 1) while recording your voice - Speak your destination (e.g., "How do I get to 555 Main Street?")
- Gemini processes the audio + your GPS location
- Directions appear as short steps:
R 200ft,L 0.3mi,STR 500ft,DEST - Press
=to cycle through steps,ACto exit
Silently starts recording audio in the background. Recordings are saved locally and uploaded to Firebase Cloud Storage for safekeeping. View and play back recordings from the settings dashboard.
Displays a realistic incoming call screen with:
- Customizable caller name (default: "Mom")
- Phone vibration pattern
- Answer/Decline buttons
- AI-generated voice conversation (via ElevenLabs) when answered
- Call timer display
Sends a simple "I'm safe. Just checking in." email to all contacts.
Screen goes completely black, making it appear the phone has shut off. The status bar is hidden. Background recording continues to run. Triple-tap anywhere to exit back to the calculator.
Immediately stops all active recording. Uploads any recorded audio to Firebase Storage.
- Node.js 18+
- Expo CLI
- Firebase CLI
- API keys for: Firebase, Google Gemini, ElevenLabs
- Copy the example keys file:
cp src/config/keys.example.ts src/config/keys.ts
- Fill in your API keys in
src/config/keys.ts
- Copy the example env file:
cp firebase/functions/.env.example firebase/functions/.env
- Fill in your Gmail credentials in
firebase/functions/.env
# Install dependencies
npm install
# Start the Expo dev server
npx expo start
# Run tests
npx jest --verbosecd firebase/functions
npm install
firebase login
firebase deploy --only functionsJCM/
App.tsx # Root component, screen routing, code detection
app.json # Expo config with permissions
firebase.json # Firebase deployment config
firebase/
functions/
index.ts # Cloud Functions (sendEmergencyAlert, sendLocationUpdate)
.env # Gmail credentials (gitignored)
.env.example # Template for .env
src/
config/
keys.ts # API keys (gitignored)
keys.example.ts # Template for keys.ts
screens/
CalculatorScreen.tsx # Main calculator UI
DashboardScreen.tsx # Hidden settings (contacts, codes, messages)
RecordingsScreen.tsx # Audio recordings viewer with playback
FakeCallScreen.tsx # Fake incoming call with ElevenLabs voice
FakeShutdownScreen.tsx # Black screen with triple-tap exit
components/
calculator/
Button.tsx # iOS-style round calculator button
Display.tsx # Auto-shrinking number display
Keypad.tsx # Standard calculator layout
dashboard/
ContactCard.tsx # Emergency contact editor
CodeEditor.tsx # Secret code editor row
services/
calculator.ts # Calculator engine with input buffer for code detection
codeDetection.ts # Code matching (first-launch map vs full map)
storage.ts # Encrypted storage (expo-secure-store)
firebase.ts # Firebase init, recording upload
sms.ts # Email alerts via Firebase Cloud Functions
emergency.ts # Orchestrates all safety actions
gemini.ts # Gemini AI (messages, directions, transcription)
elevenlabs.ts # ElevenLabs voice synthesis
location.ts # GPS location
recording.ts # Audio recording (expo-av)
hooks/
useCalculator.ts # Calculator state management hook
constants/
codes.ts # Default codes and fixed settings code
config.ts # App configuration
theme.ts # Calculator and dashboard themes
types/
index.ts # TypeScript type definitions
__tests__/
calculator.test.ts # 31 calculator engine tests
codeDetection.test.ts # 24 code detection tests
- The settings code
100=is always active, even before first setup. - On first launch, only
100=works. All other codes activate after saving settings. - The calculator functions normally for math at all times.