# dineshshetty/android-insecurebankv2 architecture

> Architecture diagram of the GitHub repository dineshshetty/android-insecurebankv2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dineshshetty/android-insecurebankv2
- Repository: https://github.com/dineshshetty/android-insecurebankv2

## Overview

1. This repository is a deliberately vulnerable Android banking lab, not a single app. The main product is the InsecureBankv2 mobile client plus a Python backend server, with additional exploit/demo apps and walkthrough documents bundled alongside.

2. The central runtime boundary is:
   - Android client app in `InsecureBankv2/`
   - Python server in `AndroLabServer/`
   - Local backend data stored in the server’s SQLite database file `mydb.db`

3. The Android app is built as a multi-activity app. Key screens/components include login, post-login, transfer, password change, statement viewing, and a failure screen. The app source is organized by feature-like activities rather than a layered domain model, which matches its training-lab purpose.

4. The app’s main security-relevant surfaces are explicit Android components:
   - `MyBroadCastReceiver` for broadcast-based entry
   - `TrackUserContentProvider` for content-provider access
   - `MyWebViewClient` for web content handling
   - `FilePrefActivity` for preference/file storage behavior
   These are the main IPC and data-access boundaries an attacker or tester would target.

5. `CryptoClass` and related code indicate local encryption/cryptography behaviors inside the app. The README says these are intentionally weak, so the architecture includes both server-side authentication/data and client-side “security” logic that is expected to be bypassable.

6. The backend server in `AndroLabServer/` is the authoritative application service for bank data and authentication. Its code split (`app.py`, `database.py`, `models.py`) suggests a small Python web/API application with a persistence layer and data model layer, backed by the included SQLite database.

7. The primary data flow is user credentials and banking actions moving from the Android app to the server, then to the database, and results flowing back to the app for login success/failure, statements, transfers, and password updates. The README’s hardcoded sample credentials show that authentication is part of the lab scenario.

8. Network communication is an important boundary. The README explicitly warns about insecure HTTP connections and network access requirements, so the app depends on reachable local network/host connectivity to the Python server rather than on-device-only logic.

9. The repository also contains prebuilt APKs and build artifacts (`InsecureBankv2.apk`, `app-debug.apk`, `app-release.apk`). These are distribution/testing outputs, not separate subsystems, but they show the lab is intended to be used both from source and as installable binaries.

10. `wip-attackercode/` is a separate set of attacker/demo Android projects, not part of the banking app itself:
    - `ExploitAES` for cryptography-related exploitation
    - `SniffIntents` for intent interception/sniffing
    - `insecurebankRootBypass.js` for runtime/root-detection bypass work
    These likely interact with the InsecureBankv2 app as an external adversary layer.

11. The `Walkthroughs/` and `Usage Guide.pdf` folders are documentation assets that explain exploit paths and testing scenarios. They do not change runtime architecture, but they are part of the repo’s “training environment” boundary.

12. For an architecture diagram, the core shape is: user -> Android client -> Python backend -> SQLite DB, with several vulnerable Android IPC/storage/UI surfaces inside the client and separate exploit tooling/documentation outside the trusted system boundary.

Main entry points: [`InsecureBankv2`](https://github.com/dineshshetty/android-insecurebankv2/tree/master/InsecureBankv2) (InsecureBankv2), [`AndroLabServer/app.py`](https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/app.py) (Server App), [`InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoLogin.java`](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoLogin.java) (Do Login), [`InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java`](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java) (Post Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Android client"]
  node_client_app["InsecureBankv2<br/>android app"]
  node_login["Login<br/>activity<br/>[LoginActivity.java]"]
  node_do_login["Do Login<br/>activity<br/>[DoLogin.java]"]
  node_post_login["Post Login<br/>activity<br/>[PostLogin.java]"]
  node_transfer["Transfer<br/>activity<br/>[DoTransfer.java]"]
  node_change_password["Change Password<br/>activity"]
  node_statement["Statement<br/>activity<br/>[ViewStatement.java]"]
  node_wrong_login["Wrong Login<br/>activity<br/>[WrongLogin.java]"]
  node_crypto["Crypto Class<br/>client crypto<br/>[CryptoClass.java]"]
  node_broadcast["Broadcast Rx<br/>ipc receiver"]
  node_content_provider["Content Provider<br/>ipc provider"]
  node_webview["WebView Client<br/>web handler"]
  node_file_prefs["File Prefs<br/>storage activity"]
end

subgraph group_server["Backend server"]
  node_server_app["Server App<br/>python web app<br/>[app.py]"]
  node_server_db[("Database Layer<br/>persistence<br/>[database.py]")]
  node_server_models["Models<br/>data model<br/>[models.py]"]
  node_sqlite[("mydb.db<br/>sqlite db<br/>[mydb.db]")]
end

subgraph group_external["External assets"]
  node_apk_bundle["APK builds<br/>distribution artifacts<br/>[app-debug.apk]"]
  node_walkthroughs["Walkthroughs<br/>training docs"]
  node_attacker_apps["Attacker Tools<br/>exploit apps"]
  node_root_bypass["Root Bypass JS<br/>bypass script"]
end

node_user(("User<br/>actor"))

node_user -->|"uses"| node_client_app
node_client_app -->|"starts at"| node_login
node_login -->|"submits"| node_do_login
node_do_login -->|"auth request"| node_server_app
node_server_app -->|"reads/writes"| node_server_db
node_server_db -->|"persists"| node_sqlite
node_server_app -->|"returns result"| node_client_app
node_do_login -->|"on failure"| node_wrong_login
node_do_login -->|"on success"| node_post_login
node_post_login -->|"navigates"| node_transfer
node_post_login -->|"navigates"| node_change_password
node_post_login -->|"navigates"| node_statement
node_transfer -->|"transfer API"| node_server_app
node_change_password -->|"password API"| node_server_app
node_statement -->|"statement API"| node_server_app
node_crypto -->|"protects weakly"| node_client_app
node_broadcast -->|"exposes"| node_client_app
node_content_provider -->|"exposes"| node_client_app
node_webview -->|"handles"| node_client_app
node_file_prefs -->|"stores"| node_client_app
node_attacker_apps -.->|"targets"| node_client_app
node_root_bypass -.->|"supports"| node_attacker_apps
node_walkthroughs -.->|"documents"| node_attacker_apps
node_apk_bundle -.->|"builds"| node_client_app

click node_client_app "https://github.com/dineshshetty/android-insecurebankv2/tree/master/InsecureBankv2"
click node_login "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java"
click node_do_login "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoLogin.java"
click node_post_login "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java"
click node_transfer "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoTransfer.java"
click node_change_password "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ChangePassword.java"
click node_statement "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ViewStatement.java"
click node_wrong_login "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/WrongLogin.java"
click node_crypto "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/CryptoClass.java"
click node_broadcast "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyBroadCastReceiver.java"
click node_content_provider "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/TrackUserContentProvider.java"
click node_webview "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyWebViewClient.java"
click node_file_prefs "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/FilePrefActivity.java"
click node_server_app "https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/app.py"
click node_server_db "https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/database.py"
click node_server_models "https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/models.py"
click node_sqlite "https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/mydb.db"
click node_apk_bundle "https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/app-debug.apk"
click node_walkthroughs "https://github.com/dineshshetty/android-insecurebankv2/tree/master/Walkthroughs"
click node_attacker_apps "https://github.com/dineshshetty/android-insecurebankv2/tree/master/wip-attackercode"
click node_root_bypass "https://github.com/dineshshetty/android-insecurebankv2/blob/master/wip-attackercode/insecurebankRootBypass.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_app,node_login,node_do_login,node_post_login,node_transfer,node_change_password,node_statement,node_wrong_login,node_crypto,node_broadcast,node_content_provider,node_webview,node_file_prefs toneBlue
class node_server_app,node_server_db,node_server_models,node_sqlite toneAmber
class node_apk_bundle,node_walkthroughs,node_attacker_apps,node_root_bypass toneMint
class node_user toneNeutral
```

## Components

### Android client

InsecureBankv2 vulnerable mobile app and its internal feature/security surfaces.

- [InsecureBankv2](https://github.com/dineshshetty/android-insecurebankv2/tree/master/InsecureBankv2): android app · Main Android banking client used for login, transfers, statements, and password changes. · `InsecureBankv2`
- [Login](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java): activity · Entry screen for credentials and authentication. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/LoginActivity.java`
- [Do Login](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoLogin.java): activity · Login request handler and authentication flow coordination. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoLogin.java`
- [Post Login](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java): activity · Main authenticated hub after successful sign-in. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/PostLogin.java`
- [Transfer](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoTransfer.java): activity · Funds transfer screen and request flow. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/DoTransfer.java`
- [Change Password](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ChangePassword.java): activity · Password update screen and submission flow. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ChangePassword.java`
- [Statement](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ViewStatement.java): activity · Account statement viewing screen. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ViewStatement.java`
- [Wrong Login](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/WrongLogin.java): activity · Failure screen shown for invalid authentication attempts. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/WrongLogin.java`
- [Crypto Class](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/CryptoClass.java): client crypto · Local cryptography and obfuscation logic that is intentionally weak. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/CryptoClass.java`
- [Broadcast Rx](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyBroadCastReceiver.java): ipc receiver · Broadcast-based entry point and attack surface. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyBroadCastReceiver.java`
- [Content Provider](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/TrackUserContentProvider.java): ipc provider · Content-provider boundary for track/user data access. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/TrackUserContentProvider.java`
- [WebView Client](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyWebViewClient.java): web handler · Web content handling boundary inside the app. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/MyWebViewClient.java`
- [File Prefs](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/src/main/java/com/android/insecurebankv2/FilePrefActivity.java): storage activity · Preference and file-storage behavior exposed by the app. · `InsecureBankv2/app/src/main/java/com/android/insecurebankv2/FilePrefActivity.java`

### Backend server

Python service and database backing banking/authentication flows.

- [Server App](https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/app.py): python web app · Backend application entrypoint serving banking and authentication logic. · `AndroLabServer/app.py`
- [Database Layer](https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/database.py): persistence · Database access and connection handling for the backend. · `AndroLabServer/database.py`
- [Models](https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/models.py): data model · Backend data model definitions for users and banking entities. · `AndroLabServer/models.py`
- [mydb.db](https://github.com/dineshshetty/android-insecurebankv2/blob/master/AndroLabServer/mydb.db): sqlite db · Local SQLite database storing authoritative lab data. · `AndroLabServer/mydb.db`

### External assets

Exploit tooling, walkthroughs, and packaged binaries around the lab.

- [APK builds](https://github.com/dineshshetty/android-insecurebankv2/blob/master/InsecureBankv2/app/app-debug.apk): distribution artifacts · Prebuilt APKs and build outputs for installing or testing the lab. · `InsecureBankv2/app/app-debug.apk`
- [Walkthroughs](https://github.com/dineshshetty/android-insecurebankv2/tree/master/Walkthroughs): training docs · Exploit and lab walkthrough documents describing attack paths. · `Walkthroughs`
- [Attacker Tools](https://github.com/dineshshetty/android-insecurebankv2/tree/master/wip-attackercode): exploit apps · Separate demo/exploit Android projects used against the lab. · `wip-attackercode`
- [Root Bypass JS](https://github.com/dineshshetty/android-insecurebankv2/blob/master/wip-attackercode/insecurebankRootBypass.js): bypass script · Runtime/root-detection bypass helper for adversarial testing. · `wip-attackercode/insecurebankRootBypass.js`

### Other components

- **User**: actor · Person using the lab app and entering credentials or banking actions.

## Connections

- User → InsecureBankv2: uses · User interacts with the banking client.
- InsecureBankv2 → Login: starts at · Launches into the login flow.
- Login → Do Login: submits · Credentials are handed to the authentication handler.
- Do Login → Server App: auth request · Client sends login data to the backend over the network.
- Server App → Database Layer: reads/writes · Backend resolves accounts and authentication state through the data layer.
- Database Layer → mydb.db: persists · Database operations hit the bundled SQLite file.
- Server App → InsecureBankv2: returns result · Backend response drives success or failure in the app.
- Do Login → Wrong Login: on failure · Failed auth routes to the failure screen.
- Do Login → Post Login: on success · Successful auth opens the authenticated hub.
- Post Login → Transfer: navigates · Authenticated user can initiate transfers.
- Post Login → Change Password: navigates · Authenticated user can change password.
- Post Login → Statement: navigates · Authenticated user can view statements.
- Transfer → Server App: transfer API · Transfer requests are sent to the backend service.
- Change Password → Server App: password API · Password changes are submitted to the backend.
- Statement → Server App: statement API · Statement data is fetched from the backend.
- Crypto Class → InsecureBankv2: protects weakly · Client-side crypto influences stored or transmitted data but is intended to be bypassable.
- Broadcast Rx → InsecureBankv2: exposes · Broadcast receiver is an external entry surface into the app.
- Content Provider → InsecureBankv2: exposes · Content provider exposes app data through IPC.
- WebView Client → InsecureBankv2: handles · WebView client mediates loaded web content.
- File Prefs → InsecureBankv2: stores · Preference/file behavior affects local app state.
- Attacker Tools → InsecureBankv2: targets · External exploit apps interact with the vulnerable client.
- Root Bypass JS → Attacker Tools: supports · Bypass script assists attacker workflows.
- Walkthroughs → Attacker Tools: documents · Training material explains exploit scenarios and tooling.
- APK builds → InsecureBankv2: builds · Packaged APK artifacts correspond to the main client.
