# huangzhuorui/locationspoofer architecture

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

- Interactive diagram: https://gitdiagram.com/huangzhuorui/locationspoofer
- Repository: https://github.com/huangzhuorui/locationspoofer

## Overview

LocationSpoofer is an Android system-level location and wireless-environment spoofing framework. Users configure a location, route, realism options, and environment data in the Compose app; the app persists configuration, while the foreground service supports ongoing control and the LSPosed module applies spoofed responses inside selected apps. The graph also preserves route/motion computation, map-engine choices, environment collection and storage, and anti-detection capabilities documented in the README. Several feature implementations were not sampled, so their internal call links are omitted rather than inferred.

Main entry points: [`xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/LocationHooker.kt`](https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/LocationHooker.kt) (Hook entry), [`app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt`](https://github.com/huangzhuorui/locationspoofer/blob/main/app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt) (App ViewModel), [`core-data/src/main/java/com/vincenthzr/locationspoofer/data/motion/MotionController.kt`](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/motion/MotionController.kt) (Motion controller), [`core-data/src/main/java/com/vincenthzr/locationspoofer/utils/EnvironmentScanner.kt`](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/utils/EnvironmentScanner.kt) (Environment scan)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and controls"]
  node_main["Android entry<br/>[MainActivity.kt]"]
  node_ui["Compose screens"]
  node_maps["Map engines"]
  node_viewmodel["App ViewModel<br/>[MainViewModel.kt]"]
end

subgraph group_domain["Location and data"]
  node_settings["Settings storage"]
  node_config["Shared config<br/>[ConfigManager.kt]"]
  node_environment["Environment scan"]
  node_envdb[("Environment records<br/>[EnvironmentDao.kt]")]
  node_database[("Room database<br/>[AppDatabase.kt]")]
end

subgraph group_background["Background control"]
  node_servicecontroller["Service bridge"]
  node_service["Spoofing service<br/>[SpoofingService.kt]"]
  node_joystick["Floating joystick"]
end

subgraph group_injection["System injection"]
  node_hookentry["Hook entry<br/>[LocationHooker.kt]"]
  node_locationhooks["Location hooks"]
  node_wifihooks["Wireless hooks"]
  node_gnss["GNSS simulation"]
  node_routenengine["Hook route engine<br/>[RouteEngine.kt]"]
  node_antidetect["Anti-detection hooks"]
end

subgraph group_geo["Geometry and realism"]
  node_motion["Motion controller"]
  node_route["Route geometry<br/>[RoutePath.kt]"]
  node_realism["Motion realism<br/>[MotionRealism.kt]"]
end

node_user(("User"))
node_targetapps["Target apps"]
node_android["Android system APIs"]
node_cloud["WiGLE / OpenCellID"]

node_user -.->|"opens app"| node_main
node_main -->|"renders"| node_ui
node_ui -.->|"uses state"| node_viewmodel
node_viewmodel -->|"uses scanner"| node_environment
node_viewmodel -->|"queries records"| node_envdb
node_viewmodel -.->|"reads settings"| node_settings
node_maps -->|"configures map"| node_viewmodel
node_environment -.->|"stores scans"| node_envdb
node_database -->|"provides DAO"| node_envdb
node_viewmodel -.->|"controls motion"| node_motion
node_motion -->|"uses geometry"| node_route
node_motion -->|"uses realism"| node_realism
node_servicecontroller -->|"starts and stops"| node_service
node_servicecontroller -->|"controls visibility"| node_joystick
node_joystick -->|"reads state"| node_motion
node_hookentry -->|"registers hooks"| node_locationhooks
node_hookentry -->|"registers hooks"| node_wifihooks
node_hookentry -->|"initializes"| node_gnss
node_hookentry -->|"uses route engine"| node_routenengine
node_hookentry -.->|"applies defenses"| node_antidetect
node_routenengine -->|"uses geometry"| node_route
node_routenengine -->|"uses realism"| node_realism
node_hookentry -.->|"reads config"| node_config
node_config -.->|"shares settings"| node_targetapps
node_environment -.->|"imports records"| node_cloud
node_locationhooks -.->|"intercepts APIs"| node_android
node_wifihooks -.->|"intercepts APIs"| node_android
node_gnss -.->|"simulates satellites"| node_android
node_antidetect -.->|"hides hook traces"| node_targetapps
node_android -.->|"returns spoofed data"| node_targetapps

click node_main "https://github.com/huangzhuorui/locationspoofer/blob/main/app/src/main/java/com/vincenthzr/locationspoofer/MainActivity.kt"
click node_ui "https://github.com/huangzhuorui/locationspoofer/blob/main/app-ui/src/main/java/com/vincenthzr/locationspoofer/ui/screen/MainScaffoldScreen.kt"
click node_maps "https://github.com/huangzhuorui/locationspoofer/blob/main/app-ui/src/main/java/com/vincenthzr/locationspoofer/ui/components/map/AMapEngineAdapter.kt"
click node_viewmodel "https://github.com/huangzhuorui/locationspoofer/blob/main/app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt"
click node_settings "https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/repository/SettingsRepository.kt"
click node_config "https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/utils/ConfigManager.kt"
click node_environment "https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/utils/EnvironmentScanner.kt"
click node_envdb "https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/db/EnvironmentDao.kt"
click node_database "https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/db/AppDatabase.kt"
click node_motion "https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/motion/MotionController.kt"
click node_route "https://github.com/huangzhuorui/locationspoofer/blob/main/core-geo/src/main/kotlin/com/vincenthzr/locationspoofer/utils/RoutePath.kt"
click node_realism "https://github.com/huangzhuorui/locationspoofer/blob/main/core-geo/src/main/kotlin/com/vincenthzr/locationspoofer/utils/MotionRealism.kt"
click node_servicecontroller "https://github.com/huangzhuorui/locationspoofer/blob/main/service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingServiceControllerImpl.kt"
click node_service "https://github.com/huangzhuorui/locationspoofer/blob/main/service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingService.kt"
click node_joystick "https://github.com/huangzhuorui/locationspoofer/blob/main/service/src/main/java/com/vincenthzr/locationspoofer/service/FloatingJoystickService.kt"
click node_hookentry "https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/LocationHooker.kt"
click node_locationhooks "https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemLocationServiceHooker.kt"
click node_wifihooks "https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemWifiServiceHooker.kt"
click node_gnss "https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/GnssFastMockEngine.kt"
click node_routenengine "https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/utils/RouteEngine.kt"
click node_antidetect "https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/AntiDetectionHooker.kt"

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_main,node_ui,node_maps,node_viewmodel,node_user toneBlue
class node_settings,node_config,node_environment,node_envdb,node_database toneAmber
class node_servicecontroller,node_service,node_joystick,node_android toneMint
class node_hookentry,node_locationhooks,node_wifihooks,node_gnss,node_routenengine,node_antidetect toneRose
class node_motion,node_route,node_realism,node_targetapps,node_cloud toneIndigo
```

## Components

### App and controls

- [Android entry](https://github.com/huangzhuorui/locationspoofer/blob/main/app/src/main/java/com/vincenthzr/locationspoofer/MainActivity.kt): `app/src/main/java/com/vincenthzr/locationspoofer/MainActivity.kt`
- [Compose screens](https://github.com/huangzhuorui/locationspoofer/blob/main/app-ui/src/main/java/com/vincenthzr/locationspoofer/ui/screen/MainScaffoldScreen.kt): `app-ui/src/main/java/com/vincenthzr/locationspoofer/ui/screen/MainScaffoldScreen.kt`
- [Map engines](https://github.com/huangzhuorui/locationspoofer/blob/main/app-ui/src/main/java/com/vincenthzr/locationspoofer/ui/components/map/AMapEngineAdapter.kt): `app-ui/src/main/java/com/vincenthzr/locationspoofer/ui/components/map/AMapEngineAdapter.kt`
- [App ViewModel](https://github.com/huangzhuorui/locationspoofer/blob/main/app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt): `app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt`

### Location and data

- [Settings storage](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/repository/SettingsRepository.kt): `core-data/src/main/java/com/vincenthzr/locationspoofer/data/repository/SettingsRepository.kt`
- [Shared config](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/utils/ConfigManager.kt): `core-data/src/main/java/com/vincenthzr/locationspoofer/utils/ConfigManager.kt`
- [Environment scan](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/utils/EnvironmentScanner.kt): `core-data/src/main/java/com/vincenthzr/locationspoofer/utils/EnvironmentScanner.kt`
- [Environment records](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/db/EnvironmentDao.kt): `core-data/src/main/java/com/vincenthzr/locationspoofer/data/db/EnvironmentDao.kt`
- [Room database](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/db/AppDatabase.kt): `core-data/src/main/java/com/vincenthzr/locationspoofer/data/db/AppDatabase.kt`

### Background control

- [Service bridge](https://github.com/huangzhuorui/locationspoofer/blob/main/service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingServiceControllerImpl.kt): `service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingServiceControllerImpl.kt`
- [Spoofing service](https://github.com/huangzhuorui/locationspoofer/blob/main/service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingService.kt): `service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingService.kt`
- [Floating joystick](https://github.com/huangzhuorui/locationspoofer/blob/main/service/src/main/java/com/vincenthzr/locationspoofer/service/FloatingJoystickService.kt): `service/src/main/java/com/vincenthzr/locationspoofer/service/FloatingJoystickService.kt`

### System injection

- [Hook entry](https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/LocationHooker.kt): `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/LocationHooker.kt`
- [Location hooks](https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemLocationServiceHooker.kt): `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemLocationServiceHooker.kt`
- [Wireless hooks](https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemWifiServiceHooker.kt): `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemWifiServiceHooker.kt`
- [GNSS simulation](https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/GnssFastMockEngine.kt): `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/GnssFastMockEngine.kt`
- [Hook route engine](https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/utils/RouteEngine.kt): `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/utils/RouteEngine.kt`
- [Anti-detection hooks](https://github.com/huangzhuorui/locationspoofer/blob/main/xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/AntiDetectionHooker.kt): `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/AntiDetectionHooker.kt`

### Geometry and realism

- [Motion controller](https://github.com/huangzhuorui/locationspoofer/blob/main/core-data/src/main/java/com/vincenthzr/locationspoofer/data/motion/MotionController.kt): `core-data/src/main/java/com/vincenthzr/locationspoofer/data/motion/MotionController.kt`
- [Route geometry](https://github.com/huangzhuorui/locationspoofer/blob/main/core-geo/src/main/kotlin/com/vincenthzr/locationspoofer/utils/RoutePath.kt): `core-geo/src/main/kotlin/com/vincenthzr/locationspoofer/utils/RoutePath.kt`
- [Motion realism](https://github.com/huangzhuorui/locationspoofer/blob/main/core-geo/src/main/kotlin/com/vincenthzr/locationspoofer/utils/MotionRealism.kt): `core-geo/src/main/kotlin/com/vincenthzr/locationspoofer/utils/MotionRealism.kt`

### Other components

- **User**
- **Target apps**
- **Android system APIs**
- **WiGLE / OpenCellID**

## Connections

- User → Android entry: opens app
- Android entry → Compose screens: renders (evidence: `app/src/main/java/com/vincenthzr/locationspoofer/MainActivity.kt`)
- Compose screens → App ViewModel: uses state (evidence: `app-ui/src/main/java/com/vincenthzr/locationspoofer/ui/screen/MainScaffoldScreen.kt`)
- App ViewModel → Environment scan: uses scanner (evidence: `app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt`)
- App ViewModel → Environment records: queries records (evidence: `app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt`)
- App ViewModel → Settings storage: reads settings (evidence: `app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt`)
- Map engines → App ViewModel: configures map
- Environment scan → Environment records: stores scans
- Room database → Environment records: provides DAO (evidence: `core-data/src/main/java/com/vincenthzr/locationspoofer/data/db/AppDatabase.kt`)
- App ViewModel → Motion controller: controls motion (evidence: `app-ui/src/main/java/com/vincenthzr/locationspoofer/viewmodel/MainViewModel.kt`)
- Motion controller → Route geometry: uses geometry (evidence: `core-data/src/main/java/com/vincenthzr/locationspoofer/data/motion/MotionController.kt`)
- Motion controller → Motion realism: uses realism (evidence: `core-data/src/main/java/com/vincenthzr/locationspoofer/data/motion/MotionController.kt`)
- Service bridge → Spoofing service: starts and stops (evidence: `service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingServiceControllerImpl.kt`)
- Service bridge → Floating joystick: controls visibility (evidence: `service/src/main/java/com/vincenthzr/locationspoofer/service/SpoofingServiceControllerImpl.kt`)
- Floating joystick → Motion controller: reads state (evidence: `service/src/main/java/com/vincenthzr/locationspoofer/service/FloatingJoystickService.kt`)
- Hook entry → Location hooks: registers hooks (evidence: `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemLocationServiceHooker.kt`)
- Hook entry → Wireless hooks: registers hooks (evidence: `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/hooks/SystemWifiServiceHooker.kt`)
- Hook entry → GNSS simulation: initializes (evidence: `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/LocationHooker.kt`)
- Hook entry → Hook route engine: uses route engine (evidence: `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/LocationHooker.kt`)
- Hook entry → Anti-detection hooks: applies defenses
- Hook route engine → Route geometry: uses geometry (evidence: `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/utils/RouteEngine.kt`)
- Hook route engine → Motion realism: uses realism (evidence: `xposed/src/main/java/com/vincenthzr/locationspoofer/xposed/utils/RouteEngine.kt`)
- Hook entry → Shared config: reads config
- Shared config → Target apps: shares settings
- Environment scan → WiGLE / OpenCellID: imports records
- Location hooks → Android system APIs: intercepts APIs
- Wireless hooks → Android system APIs: intercepts APIs
- GNSS simulation → Android system APIs: simulates satellites
- Anti-detection hooks → Target apps: hides hook traces
- Android system APIs → Target apps: returns spoofed data
