GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Alphaguyasa/Mezgeb: Mobile money reconciliation for Android. Kotlin, Compose, Hilt, Room, with a pure-JVM parser module.

BranchesTags
Open more actions menu

Latest commit

 

History

138 Commits
138 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
app
app
 
 
docs
docs
 
 
gradle
gradle
 
 
parser
parser
 
 
tools
tools
 
 
.gitignore
.gitignore
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
CONVENTIONS.md
CONVENTIONS.md
 
 
CORPUS.md
CORPUS.md
 
 
LICENSE
LICENSE
 
 
NOTES.md
NOTES.md
 
 
README.md
README.md
 
 
ROADMAP.md
ROADMAP.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

Mezgeb (መዝገብ)

An offline Android app that reads mobile-money payment notifications, parses them into a ledger, tracks who owes the shop money, and reconciles the two — built for small shops in Ethiopia, with no network permission and no account to sign up for.

Teach-a-rule flow

Teaching a rule from an unrecognised bank message: highlight the amount, label what it is, and Mezgeb reads that sender from then on — the message clears the review queue. Captured on-device from the demo shop.

Read-only with respect to money. The app never initiates, sends, or authorizes a payment.


Screenshots

Today

The day's captured payments, in and out
Ledger

Every Transaction, grouped and filterable
Customers

Who owes the shop, and for how long
Reports

Totals by channel and category
Review queue

Messages no rule could read yet
Teach a rule

Rule induction from a real message

Taken from the built-in demo shop (Settings → Demo mode), which seeds a 90-day ledger — no real payment data is shown. The shipping app is FLAG_SECURE, so it blocks screenshots and the recents thumbnail; these were captured from a debug build with that flag lifted for the purpose.


The Play Store constraint

The obvious way to build this is to read the SMS inbox. Google Play will not let you.

READ_SMS and RECEIVE_SMS are restricted permissions: Play grants them only to apps whose core purpose requires being the device's default SMS handler. A finance app that wants to read payment confirmations is explicitly not an eligible use case, and the policy covers placeholder declarations too — you cannot ship the permission dormant and switch it on later. An app that declares it without qualifying gets rejected, and the rejection is a policy strike, not a bug report.

So Mezgeb captures payments a second way. A NotificationListenerService reads the notifications that telebirr, CBE Birr and bank apps post when money moves. That needs no restricted permission — the user grants notification access in system settings, sees exactly what they granted, and can revoke it in the same place. It works on both flavors.

The trade-off is real and worth stating: notification capture only sees a payment while the notification exists, so it cannot backfill history the way an inbox read can. That is why there are two flavors:

play direct
Distribution Play Store Sideloaded APK
Live capture Notification listener Notification listener
Historical backfill — One-time SMS inbox import
SMS permissions None READ_SMS only

direct declares READ_SMS and nothing else. RECEIVE_SMS was carried for several sessions and then removed: live capture goes through the notification listener in both flavors, so no broadcast receiver ever existed to need it, and device verification confirmed it stayed ungranted for a whole session while the import worked. A restricted permission an app does not use still has to be justified — to a reviewer, or to whoever reads the install prompt — and "we asked for it in case" is not a justification.

The SMS permission exists in exactly one file, app/src/direct/AndroidManifest.xml, and nothing in src/main mentions it — not in code, not in a comment, not as placeholder text. The merged play release manifest is checked to contain zero SMS permissions:

$ ./gradlew :app:assemblePlayRelease
$ grep -c 'permission.INTERNET\|SMS' \
    app/build/intermediates/merged_manifest/playRelease/*/AndroidManifest.xml
0

The adaptive parser

Payment messages are not a documented format. They change without notice, they differ per bank, and a hardcoded regex is a maintenance liability from the day it ships.

:parser is a rule engine: versioned, JSON-defined patterns compiled at runtime, with field extraction and normalization for amounts, phone numbers and dates. When no rule matches, the message lands in a review queue instead of being dropped. The user highlights the amount and the sender in the message body, and the app induces a new rule from those spans — generalising the highlighted values while anchoring the literal text around them. The next message from that sender parses on its own.

Accuracy: 100.00% on the holdout (23/23), 100.00% on train + noise (95/95) — zero false positives, zero wrong values, across a corpus of 84 financial and 34 noise messages from 3 senders.

That figure is worth less than it looks, and CORPUS.md says so at length. The holdout holds out samples, not templates: both splits come from the same 3 senders and 13 message templates, from one person's account, with no Amharic transaction messages. It measures resistance to overfitting on values, not generalisation to an unseen provider — which is what a reader assumes a holdout number means. The corpus falls short of its own targets of 150 samples and 4 senders. The number becomes meaningful when those are met.

A wrong value is treated as fatal and fails the build. A missed message is not: it goes to the review queue, where the user fixes it. Those are different failures and the project does not average them together.

Architecture

flowchart TD
    N[Notification listener] --> C
    S["SMS import worker<br/>(direct flavor only)"] --> C
    C[CaptureCoordinator<br/>dedup · privacy filter] --> R[(RawMessage)]
    R --> P{":parser<br/>rule engine"}
    P -->|matched| T[(Transaction)]
    P -->|no rule| Q[Review queue]
    Q -->|user highlights spans| I[Rule induction]
    I -->|new ParserRule| P
    T --> L[Ledger · Today · Reports]
    T --> RC[Reconciliation]
    CR[(CreditEntry)] --> RC
    RC --> SESS[(Reconciliation session)]
Loading

Every captured message passes one funnel, CaptureCoordinator, which applies the sender allowlist and the credential filter before anything is written. Messages from people are never stored; messages stating a PIN or one-time code are never stored. One policy, one place for it to be wrong.

Modules

:app       Android application — Compose UI, Room, capture services, DI
:parser    Pure Kotlin/JVM — rule engine, normalization, rule induction.
           Zero Android dependencies, so it tests in plain JUnit against the corpus.

Stack — Kotlin 2.x / JDK 17 · Jetpack Compose + Material 3 · single Activity · Navigation Compose · Room + KSP · Hilt · WorkManager · DataStore · kotlinx.serialization · MVVM with unidirectional data flow

Testing — 375 unit tests on play, 382 on direct, 83 on :parser. DAOs tested against in-memory Room, ViewModels with Turbine, migrations against the committed schema JSON rather than hand-copied DDL. Coverage is 36.1% instruction / 46.1% line, reported rather than gated — ./gradlew :app:jacocoPlayDebugReport. The Compose screen bodies are the bulk of what is uncovered, deliberately. See NOTES.md for the three least-tested areas that should be covered, and why two of the others cannot be.

Privacy

  • No android.permission.INTERNET, in either flavor. Not a policy, a build fact — verified against the merged release manifest. The app has no network stack, no analytics SDK and no crash reporter; a stack trace is something you read off the screen.
  • Raw message bodies never leave the device and are never logged. Amount and sender may appear in debug output; the body may not.
  • Backups are AES-256-GCM with a PBKDF2-derived key. The passphrase is never stored.
  • The app lock holds a PIN behind PBKDF2 in a Keystore-backed EncryptedSharedPreferences.
  • Corpus: collected from the author's own device, filtered to financial and promotional shortcodes before any body text was read. 15 messages from personal numbers were discarded unread. Names, phone numbers, account numbers and transaction references are redacted with length and character class preserved — the properties the parser learns. 19 messages containing one-time codes were excluded entirely rather than redacted, because a redacted credential is still a credential in a git history. CorpusValidationTest fails the build on anything resembling an unredacted number. Full method in CORPUS.md.

Build

Requires JDK 17 and the Android SDK. No keys or secrets are needed for a debug build.

# Play-compliant build — no SMS permissions
./gradlew :app:assemblePlayDebug

# Sideload build — adds the one-time SMS inbox import
./gradlew :app:assembleDirectDebug

# Everything: both flavors, all unit tests, lint
./gradlew build

# Parser accuracy against the fixture corpus
./gradlew :parser:test --tests '*CorpusAccuracyTest*'

Install: adb install app/build/outputs/apk/play/debug/app-play-debug.apk

On first launch the app asks for notification access. Settings → Demo mode seeds a 90-day shop — transactions, customers carrying credit, a filled review queue and a closed reconciliation period — so the app can be evaluated in ten seconds without waiting for a real payment to arrive. Disabling it points the app back at the real ledger, untouched.

Release builds

Release builds are R8-minified and signed from a gitignored keystore.properties at the repository root:

storeFile=mezgeb-release.jks
storePassword=…
keyAlias=mezgeb
keyPassword=…

Without that file the release build still compiles and stays unsigned, rather than falling back to the debug key — a debug-signed APK installs and runs and looks exactly like a release, signed with a key every Android SDK on earth has the private half of.

Release APK size is 3.07 MB for both flavors.

License

MIT © 2026 Alphaguyasa

About

Mobile money reconciliation for Android. Kotlin, Compose, Hilt, Room, with a pure-JVM parser module.

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.