# alok-yadav25/fake-bank-apk-detection architecture

> Architecture diagram of the GitHub repository alok-yadav25/fake-bank-apk-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alok-yadav25/fake-bank-apk-detection
- Repository: https://github.com/alok-yadav25/fake-bank-apk-detection

## Overview

Suraksha Setu is a Flask-based Android APK security-analysis platform. Users submit APKs for guarded upload and multi-signal static analysis; the application combines identity and certificate checks, optional VirusTotal intelligence, advisory ML, and explainable risk/verdict logic, then stores scan results for review and report export. The repository also contains a dataset-building and model-training workflow. Several app internals are only partially excerpted, so inferred integrations are marked dashed with no evidence path; unsampled UI and persistence details are not expanded.

Main entry points: [`app.py`](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/app.py) (Flask application), [`src/vt_client.py`](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/vt_client.py) (VirusTotal lookup), [`src/apk_analyzer.py`](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/apk_analyzer.py) (APK static analysis), [`src/ml_detector.py`](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/ml_detector.py) (ML inference and validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Application"]
  node_app["Flask application<br/>[app.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_security["Upload safeguards<br/>[security.py]"]
  node_results["Scan history and results<br/>[app.py]"]
  node_sqlite[("Scan database<br/>[database.py]")]
  node_pdf["PDF report generation"]
end

subgraph group_analysis["APK Analysis"]
  node_analyzer["APK static analysis<br/>[apk_analyzer.py]"]
  node_verdict["Risk scoring and verdict<br/>[verdict_engine.py]"]
end

subgraph group_intelligence["Threat Intelligence"]
  node_vt["VirusTotal lookup<br/>[vt_client.py]"]
end

subgraph group_modeling["ML Lifecycle"]
  node_ml["ML inference and validation<br/>[ml_detector.py]"]
  node_dataset["APK feature dataset<br/>[build_dataset.py]"]
  node_training["Model training<br/>[train_model.py]"]
end

node_user(("APK submitter"))
node_virustotal["VirusTotal service"]

node_user -->|"submits APK"| node_app
node_app -.->|"loads settings"| node_config
node_app -.->|"validates upload"| node_security
node_app -.->|"analyzes APK"| node_analyzer
node_app -.->|"requests lookup"| node_vt
node_vt -->|"queries hash"| node_virustotal
node_app -.->|"requests prediction"| node_ml
node_app -.->|"assesses risk"| node_verdict
node_app -->|"stores scan"| node_sqlite
node_app -.->|"serves scan views"| node_results
node_app -.->|"exports report"| node_pdf
node_dataset -->|"extracts features"| node_analyzer
node_training -.->|"trains model"| node_ml

click node_app "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/app.py"
click node_config "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/config.py"
click node_security "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/security.py"
click node_results "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/app.py"
click node_sqlite "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/database.py"
click node_pdf "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/report_generator.py"
click node_analyzer "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/apk_analyzer.py"
click node_verdict "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/verdict_engine.py"
click node_vt "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/vt_client.py"
click node_ml "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/ml_detector.py"
click node_dataset "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/scripts/build_dataset.py"
click node_training "https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/scripts/train_model.py"

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_app,node_config,node_security,node_results,node_sqlite,node_pdf toneBlue
class node_analyzer,node_verdict toneAmber
class node_vt toneMint
class node_ml,node_dataset,node_training toneRose
class node_user,node_virustotal toneIndigo
```

## Components

### Web Application

- [Flask application](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/app.py): `app.py`
- [Runtime configuration](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/config.py): `config.py`
- [Upload safeguards](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/security.py): `src/security.py`
- [Scan history and results](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/app.py): `app.py`
- [Scan database](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/database.py): `src/database.py`
- [PDF report generation](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/report_generator.py): `src/report_generator.py`

### APK Analysis

- [APK static analysis](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/apk_analyzer.py): `src/apk_analyzer.py`
- [Risk scoring and verdict](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/verdict_engine.py): `src/verdict_engine.py`

### Threat Intelligence

- [VirusTotal lookup](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/vt_client.py): `src/vt_client.py`

### ML Lifecycle

- [ML inference and validation](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/src/ml_detector.py): `src/ml_detector.py`
- [APK feature dataset](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/scripts/build_dataset.py): `scripts/build_dataset.py`
- [Model training](https://github.com/alok-yadav25/fake-bank-apk-detection/blob/main/scripts/train_model.py): `scripts/train_model.py`

### Other components

- **APK submitter**
- **VirusTotal service**

## Connections

- APK submitter → Flask application: submits APK (evidence: `README.md`)
- Flask application → Runtime configuration: loads settings (evidence: `app.py`)
- Flask application → Upload safeguards: validates upload (evidence: `app.py`)
- Flask application → APK static analysis: analyzes APK (evidence: `app.py`)
- Flask application → VirusTotal lookup: requests lookup (evidence: `app.py`)
- VirusTotal lookup → VirusTotal service: queries hash (evidence: `src/vt_client.py`)
- Flask application → ML inference and validation: requests prediction (evidence: `app.py`)
- Flask application → Risk scoring and verdict: assesses risk (evidence: `app.py`)
- Flask application → Scan database: stores scan (evidence: `app.py`)
- Flask application → Scan history and results: serves scan views (evidence: `app.py`)
- Flask application → PDF report generation: exports report (evidence: `app.py`)
- APK feature dataset → APK static analysis: extracts features (evidence: `scripts/build_dataset.py`)
- Model training → ML inference and validation: trains model (evidence: `scripts/train_model.py`)
