FlowStable serves as an asynchronous, offline-tolerant payment orchestration layer, architected to bridge modern IP-based Unified Payments Interface (UPI) rails with legacy GSM signaling channels (specifically the *99# USSD gateway). It leverages an injected AccessibilityService vector to programmatically intercept, parse, and respond to Session-Oriented Unstructured Supplementary Service Data streams, effectively creating a "Headless Browser" for cellular telephony menus.
The system operates on a Finite State Automaton (FSA) model, enforcing deterministic state transitions during the payment handshake.
graph TD
A["Idle State"] -->|SigInt: *99#| B("USSD Gateway Handshake")
B -->|ACK: 200 OK| C{"Data Stream Analysis"}
C -->|Regex Match: 'Send Money'| D["MenuItem Selection Vector"]
C -->|Regex Match: 'Enter UPI'| E["VPA Injection Protocol"]
E -->|Payload: VPA| F["Amount Serialization Phase"]
F -->|Payload: Int64| G["Security Challenge (PIN)"]
G -->|Manual Input| H["Transaction Finality"]
- Namespace:
com.flowstable.upi.ussd.USSDService - Function: Operates as a background daemon with
BIND_ACCESSIBILITY_SERVICEpermission. - Logic: Monitoring
TYPE_WINDOW_STATE_CHANGEDevents to scrapeAccessibilityNodeInfotrees. Uses heuristic parsing to identify GSM operator-specific dialects (Airtel vs Jio vs Vi variants).
- Engine: Google ML Kit (On-device Vision API).
- Protocol: Real-time extraction of
pa(Payment Address),pn(Payee Name), andam(Amount) parameters from high-density QR matrices (ISO/IEC 18004).
A singleton-based State Machine implementing the State pattern.
- States:
IDLE,MENU_MAIN,ENTER_UPI,ENTER_AMOUNT,CONFIRM. - Transition Logic: Deterministic routing based on string tokenization of the incoming USSD buffer.
The project utilizes a GitHub Actions workflows for compilation and distribution.
- VM:
ubuntu-latest - JDK: OpenJDK 17 (Temurin Distribution)
- Build System: Gradle 8.2 (Daemonized)
- Artifact Delivery: Curl-based
POSTrequest to Telegram Bot API (sendDocumentendpoint) for instant binary distribution.
To build the APK artifact from source, ensure your environment meets the strict minSdk=26 requirement.
# Clone the repository
git clone https://github.com/FlowStablee/flowstable-UPI.git
# Initialize the Gradle Wrapper Daemon
./gradlew --no-daemon
# Compile Debug Build Variant
./gradlew assembleDebug- PIN Entry: The system intentionally halts automation at the
CONFIRMstate (MPIN entry) to maintain a Zero-Trust architecture regarding sensitive user credentials. TheAccessibilityServiceis programmed to yield control to the Human Interface Device (HID) layer at this specific interrupt.
FLowStble All Rights Reserved.