Mobile & Financial Engineering v1.0.0 · 100% On-Device Android 10+ (Airgapped)

GanjiPal (PesaTrack)

Offline-first M-Pesa expense tracking and financial intelligence engine for Android built with Flutter, Dart, SQLite, and native Kotlin. Features 100% on-device privacy, zero internet permissions, integer minor units math, and deterministic SHA-256 deduplication.

GanjiPal — Mobile Application UI & Real-Time Dashboard
GanjiPal modern Flutter mobile interface preview
GanjiPal — M-Pesa Ingestion & Verification Pipeline
Active Ingestion Pipeline 100% AIRGAPPED · 0 INTERNET PERMISSIONS
01. INGEST SmsReceiver.kt Priority 999 Intent
→
02. PARSE pesatrack_core Strategy Engine
→
03. DEDUP SHA-256 Hash Composite Key
→
04. STORE SQLite (sqflite) Integer Minor Units
Precision Arithmetic Integer Cents (100 = 1 KES)
Security & Privacy Audit No Cloud APIs · 0 Telemetry SDKs

Overview & Problem Statement

In Kenya, M-Pesa is the primary medium for personal and commercial financial transactions. However, tracking cash flow traditionally requires either manual record-keeping or connecting to third-party fintech applications that upload personal SMS records and financial statements to remote cloud servers.

This model poses acute privacy and security risks. GanjiPal was engineered under a strict zero-leak mandate: a personal financial tool that provides automated expense aggregation, budget warnings, and cash flow analysis while remaining 100% on-device, with zero cloud telemetry and zero internet access permissions.

Key Implemented Features

  • Automated Receipt Parsing: Ingests M-Pesa SMS confirmation receipts, accurately separating transaction fees from principal amounts across PayBill, Buy Goods, P2P Transfers, and Cash Withdrawals.
  • Integer Minor Units Math: All calculations execute with integers (100 cents = 1 KES), completely eliminating IEEE-754 floating-point rounding drift across running balances and budget forecasts.
  • Airgapped Privacy Guarantee: The Android manifest omits android.permission.INTERNET, ensuring personal financial receipts can never leave the physical device.
  • Deterministic SHA-256 Deduplication: Prevents duplicate records across multiple import passes by fingerprinting transactions using official confirmation codes or composite hashes backed by SQLite UNIQUE constraints.
  • Protected Data Portability: Generates RFC 4180 CSV exports shielded against formula injection (sanitizing =, +, -, @) and encrypted local JSON backups.

My Work & Engineering Contributions

I designed and developed the entire GanjiPal Android application and core domain parser:

  • Executive Mobile Product Design: Engineered the complete Flutter design system with a warm ivory and deep forest green palette, featuring frosted hero balances, period cash-flow toggles (Today / Week / Month), and animated spending donut breakdowns.
  • Core Domain Parser: Authored the independent pesatrack_core pure Dart package, implementing strategy pattern regex parsers for Kenyan mobile money formats.
  • Native Telephony Bridge: Wrote the Android Kotlin BroadcastReceiver and TelephonyProvider cursor bridge communicating across a typed MethodChannel.
  • Offline Persistence Layer: Engineered the SQLite database helper, indexing transactions, categories, and monthly budget limits with ACID compliance.
  • Mobile User Interface: Built the responsive Flutter UI utilizing Material 3, custom spending curves, and interactive category analytics with fl_chart.

Technical Implementation & Architecture

The project is structured according to Clean Architecture principles, ensuring domain business logic remains fully decoupled from UI frameworks:

  • Pure Dart Domain Layer: pesatrack_core contains no Flutter or Android dependencies, allowing comprehensive unit test coverage with fast execution.
  • Repository Pattern: Abstract repositories manage data transactions between SQLite (sqflite) and UI presentation states.
  • Batch Telephony Processing: Historical inbox imports process in chunked cursor batches, preventing UI thread jank or out-of-memory errors on devices with thousands of messages.

Engineering Challenges & Solutions

  • Challenge: Transaction Variation in SMS Formats: Safaricom M-Pesa receipts differ significantly between PayBill, Till numbers, reversals, and agent withdrawals.
    Solution: Developed a strategy pattern parser evaluating regex patterns in priority sequence, with a continuous regression test suite verifying real transaction receipts.
  • Challenge: Formula Injection in Financial Exports: Exporting raw transaction names (e.g. =cmd|' /C calc'!A0) into CSV files could trigger remote code execution when opened in spreadsheet software.
    Solution: Implemented RFC 4180 sanitization that prefixes unsafe leading formula characters with an apostrophe ('), neutralizing execution threats.