# xgj236/xtcrotatefix architecture

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

- Interactive diagram: https://gitdiagram.com/xgj236/xtcrotatefix
- Repository: https://github.com/xgj236/xtcrotatefix

## Overview

XTCRotateFix is an LSPosed module that restores screen rotation on supported XTC w5100 watches without modifying ROM files. The user workflow is to enable the module for the Android system framework, then use its companion app to toggle automatic rotation, choose a fixed orientation, or set the default. The hook operates inside system_server, patches rotation behavior, and receives app control commands. README-documented installation and device scope are included; the hook excerpt is partial, so unsampled internal relationships are omitted.

Main entry points: [`lspmod/java/com/xgj/rotatefix/RotateFixHook.java`](https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/java/com/xgj/rotatefix/RotateFixHook.java) (Rotation hooks), [`lspmod/java/com/xgj/rotatefix/MainActivity.java`](https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/java/com/xgj/rotatefix/MainActivity.java) (Rotation controls), [`lspmod/XTCRotateFix.apk`](https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/XTCRotateFix.apk) (Module APK)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Control app"]
  node_activity["Rotation controls<br/>[MainActivity.java]"]
end

subgraph group_runtime["System hook"]
  node_hook["Rotation hooks<br/>[RotateFixHook.java]"]
end

subgraph group_framework["Rotation framework"]
  node_settings[("System settings")]
  node_rotation["Display rotation"]
end

node_user(("Watch user"))
node_system["Android system"]
node_lsposed["LSPosed manager"]
node_install["Module APK<br/>[XTCRotateFix.apk]"]

node_user -->|"controls"| node_activity
node_activity -->|"reads and writes"| node_settings
node_activity -->|"broadcasts commands"| node_hook
node_system -->|"loads in framework"| node_hook
node_hook -->|"writes settings"| node_settings
node_hook -->|"patches behavior"| node_rotation
node_lsposed -->|"installs and enables"| node_install

click node_activity "https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/java/com/xgj/rotatefix/MainActivity.java"
click node_hook "https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/java/com/xgj/rotatefix/RotateFixHook.java"
click node_install "https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/XTCRotateFix.apk"

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_activity,node_user toneBlue
class node_hook toneAmber
class node_settings,node_rotation toneMint
class node_system,node_lsposed toneIndigo
class node_install toneTeal
```

## Components

### Control app

- [Rotation controls](https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/java/com/xgj/rotatefix/MainActivity.java): `lspmod/java/com/xgj/rotatefix/MainActivity.java`

### System hook

- [Rotation hooks](https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/java/com/xgj/rotatefix/RotateFixHook.java): `lspmod/java/com/xgj/rotatefix/RotateFixHook.java`

### Rotation framework

- **System settings**
- **Display rotation**

### Other components

- **Watch user**
- **Android system**
- **LSPosed manager**
- [Module APK](https://github.com/xgj236/xtcrotatefix/blob/main/lspmod/XTCRotateFix.apk): `lspmod/XTCRotateFix.apk`

## Connections

- Watch user → Rotation controls: controls (evidence: `lspmod/java/com/xgj/rotatefix/MainActivity.java`)
- Rotation controls → System settings: reads and writes (evidence: `lspmod/java/com/xgj/rotatefix/MainActivity.java`)
- Rotation controls → Rotation hooks: broadcasts commands (evidence: `lspmod/java/com/xgj/rotatefix/MainActivity.java`)
- Android system → Rotation hooks: loads in framework (evidence: `lspmod/java/com/xgj/rotatefix/RotateFixHook.java`)
- Rotation hooks → System settings: writes settings (evidence: `lspmod/java/com/xgj/rotatefix/RotateFixHook.java`)
- Rotation hooks → Display rotation: patches behavior (evidence: `lspmod/java/com/xgj/rotatefix/RotateFixHook.java`)
- LSPosed manager → Module APK: installs and enables (evidence: `README.md`)
