# rompelhd/termuxrootmods architecture

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

- Interactive diagram: https://gitdiagram.com/rompelhd/termuxrootmods
- Repository: https://github.com/rompelhd/termuxrootmods

## Overview

##### Project type and purpose
- This is an open‑source Magisk module (“TermuxRootMods”) that injects custom scripts and binaries into a rooted Android device to enhance the Termux shell environment.
- It packages shell replacements, monitoring and cleaning utilities, plus user‑configurable aliases and prompts.

##### File structure
- Top‑level packaging:
– META‑INF/com/google/android/update-binary & updater-script: Magisk installer hooks
– module.prop: module metadata
– update.json, LICENSE, changelog.md, README.md
- Custom folder:
– .aliases, .trm, customize.sh – user‑facing prompt and alias configuration deployed (e.g. to /sdcard/)
- System folder (overlay):
– etc/arch/all/*.sh (cleaner.sh, fsu.sh) – architecture‑independent shell scripts
– etc/arch/{armhf,arm64,x86_64}/*.cpp – C++ sources compiled into binaries: servistatus, temps, shell replacement, termuxrootmods

##### README for insights
- Confirms core features:
– Root shell replacement (bash)
– PS1 prompt customization via .aliases
– Service monitoring (servistatus)
– Temperature monitoring (temps)
– Cache cleaner (cleaner.sh)
- Intended execution context: Termux on rooted Android w/ Magisk v20.4+

##### Thoroughness
- Directory’s role in the module’s lifecycle (install vs. runtime)
- Distinguish architecture‑independent vs. architecture‑specific resources

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Packaging Layer
    subgraph "Packaging Layer"
        MM["Magisk Manager"] 
        UB["update-binary"] 
        US["updater-script"]
        MP["module.prop"]
        UJ["update.json"]
        LIC["LICENSE"]
        CL["changelog.md"]
        RD["README.md"]
    end

    %% System Overlay Layer
    subgraph "System Overlay" 
        subgraph "Arch-Independent Utilities"
            CLEAN["cleaner.sh"]
            FSU["fsu.sh"]
        end
        subgraph "Arch-Specific Binaries"
            subgraph "ARMHF"
                SS_A["servistatus.cpp"]
                T_A["temps.cpp"]
                SH_A["shell.cpp"]
                TR_A["termuxrootmods.cpp"]
            end
            subgraph "ARM64"
                SS_B["servistatus.cpp"]
                T_B["temps.cpp"]
                SH_B["shell.cpp"]
                TR_B["termuxrootmods.cpp"]
            end
            subgraph "x86_64"
                SS_C["servistatus.cpp"]
                T_C["temps.cpp"]
                SH_C["shell.cpp"]
                TR_C["termuxrootmods.cpp"]
            end
        end
        MK["mkshrc"]
    end

    %% User Configuration Layer
    subgraph "User Config"
        ALA[".aliases"]
        TRM[".trm"]
        CUS["customize.sh"]
    end

    %% Runtime Layer
    subgraph "Runtime Environment"
        TERM["Termux Shell Session"]
        SR["Shell Replacement Binary"]
        CONF["Load .aliases/.trm"]
        INV_CLEAN["Invoke cleaner.sh/fsu.sh"]
        INV_SS["Invoke servistatus"]
        INV_TM["Invoke temps"]
    end

    %% External Android OS
    subgraph "Android OS"
        SM["Service Manager"]
        SSYS["Sensor Sysfs"]
    end

    %% Connections
    MM --> UB
    MM --> US
    UB -->|"deploys module"| CLEAN
    US -->|"deploys module"| CLEAN
    CLEAN --> FSU
    FSU --> SS_A
    FSU --> SS_B
    FSU --> SS_C
    SS_A --> SR
    SS_B --> SR
    SS_C --> SR
    MK --> TERM
    TERM --> SR
    TERM --> CONF
    CONF --> ALA
    CONF --> TRM
    TERM --> INV_SS
    TERM --> INV_TM
    TERM --> INV_CLEAN
    INV_SS --> SM
    INV_TM --> SSYS
    INV_CLEAN --> CLEAN

    %% Click Events for Packaging
    click UB "https://github.com/rompelhd/termuxrootmods/tree/main/META-INF/com/google/android/update-binary"
    click US "https://github.com/rompelhd/termuxrootmods/tree/main/META-INF/com/google/android/updater-script"
    click MP "https://github.com/rompelhd/termuxrootmods/blob/main/module.prop"
    click UJ "https://github.com/rompelhd/termuxrootmods/blob/main/update.json"
    click LIC "https://github.com/rompelhd/termuxrootmods/tree/main/LICENSE"
    click CL "https://github.com/rompelhd/termuxrootmods/blob/main/changelog.md"
    click RD "https://github.com/rompelhd/termuxrootmods/blob/main/README.md"

    %% Click Events for User Config
    click ALA "https://github.com/rompelhd/termuxrootmods/blob/main/custom/.aliases"
    click TRM "https://github.com/rompelhd/termuxrootmods/blob/main/custom/.trm"
    click CUS "https://github.com/rompelhd/termuxrootmods/blob/main/customize.sh"

    %% Click Events for Overlay Shell Utilities
    click CLEAN "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/all/cleaner.sh"
    click FSU "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/all/fsu.sh"

    %% Click Events for Arch-Specific Binaries
    click SS_A "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/armhf/servistatus.cpp"
    click T_A "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/armhf/temps.cpp"
    click SH_A "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/armhf/shell.cpp"
    click TR_A "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/armhf/termuxrootmods.cpp"
    click SS_B "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/arm64/servistatus.cpp"
    click T_B "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/arm64/temps.cpp"
    click SH_B "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/arm64/shell.cpp"
    click TR_B "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/arm64/termuxrootmods.cpp"
    click SS_C "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/x86_64/servistatus.cpp"
    click T_C "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/x86_64/temps.cpp"
    click SH_C "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/x86_64/shell.cpp"
    click TR_C "https://github.com/rompelhd/termuxrootmods/blob/main/system/etc/arch/x86_64/termuxrootmods.cpp"

    %% Click Event for mkshrc
    click MK "https://github.com/rompelhd/termuxrootmods/tree/main/system/etc/mkshrc"

    %% Styles
    classDef packaging fill:#dddddd,stroke:#000,stroke-width:1px;
    classDef overlay fill:#bbddff,stroke:#000,stroke-width:1px;
    classDef user fill:#ddffdd,stroke:#000,stroke-width:1px;
    classDef runtime fill:#ffdd88,stroke:#000,stroke-width:1px;
    classDef external fill:#ffbbbb,stroke:#000,stroke-width:1px;

    class MM,UB,US,MP,UJ,LIC,CL,RD packaging;
    class CLEAN,FSU,SS_A,T_A,SH_A,TR_A,SS_B,T_B,SH_B,TR_B,SS_C,T_C,SH_C,TR_C,MK overlay;
    class ALA,TRM,CUS user;
    class TERM,SR,CONF,INV_CLEAN,INV_SS,INV_TM runtime;
    class SM,SSYS external;
```
