# skidfuscatordev/skidfuscator-java-obfuscator architecture

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

- Interactive diagram: https://gitdiagram.com/skidfuscatordev/skidfuscator-java-obfuscator
- Repository: https://github.com/skidfuscatordev/skidfuscator-java-obfuscator

## Overview

##### Project’s Overall Purpose and Type
- Skidfuscator is a sophisticated Java bytecode obfuscator. It is both a command‐line (and sometimes GUI) tool and a modular framework that uses SSA (Static Single Assignment) form and CFG (Control Flow Graph) transformations to perform complex optimizations and obfuscations.
- The README highlights many features – automatic dependency downloading, smart recovery, flow obfuscation (3rd generation), advanced renaming, and encryption obfuscation – meaning that multiple transformation “passes” and analysis engines have a central role.

##### Main Components of the System
- User Interface Layer:
– CLI entry point (from the “dev.skidfuscator.client.standalone” module) that also integrates a GUI (all the panels in the “gui” package).
- Configuration and Dependency Management:
– The automatic dependency downloading and auto configuration features are likely implemented in libraries found in “dev.skidfuscator.commons” and in client configuration files (such as the skidfuscator-config.conf).
- Core Obfuscation Engine:
– This is where the transformation logic is implemented. It has multiple submodules:
▸ The “dev.skidfuscator.obfuscator” module, which appears to be the heart of the engine where obfuscation passes are chained (look at the “transform”, “obfuscator”, “exempt”, “skidfuscator” packages).
▸ Additional modules for pure analysis (“obfuscator.pureanalysis”) and dependency analysis (“obfuscator.dependanalysis”) are separate so they can feed analysis results to the engine.
- Intermediate Representations and Code Flow Management:
– The use of SSA and CFG is visible through packages like “frame”, “flowgraph”, “skidasm/creator” and “skidasm/cfg”. This is where IR (Intermediate Representations) and control-flow transformations are managed.
- Additional Supporting Components:
– Event system and logging (modules in “obfuscator/event” and “commons/logger”).
– Modules for advanced transformation techniques (for example, the “transform/impl” packages covering string, flow, number, and opaque predicate transformers).
- Integration and Extension Frameworks:
– The “org.mapleir.parent” directory – including packages such as “org.mapleir.app-services”, “org.mapleir.dot4j”, “org.mapleir.flowgraph”, “org.mapleir.ir”, “org.mapleir.main”, etc. – indicate that Skidfuscator leverages external/multi-purpose IR, graph, and service modules that underpin some of the obfuscation techniques.
– The “dev.skidfuscator.sdk” serves as another layer (or API) to expose certain obfuscation functionalities to external users.

##### Relationships and Interactions
- The Core Obfuscation Engine then breaks the input into an IR and triggers a series of transformation/obfuscation passes. Each pass (flow obfuscation, renaming, encryption, etc.) is modular, and many are defined in distinct transformation packages.
- In parallel or sequentially, the analysis modules (dependency and pure analysis) build the IR graphs (SSA, Control Flow Graph) and provide feedback to the transformer passes.
- A configuration handler is responsible for auto-configuring settings and downloading necessary libraries. This mechanism is supported by modules from “commons” and additional scripts.
- Logging, event propagation, and error-handling (smart recovery) run as cross-cutting concerns, ensuring that failures are recovered and errors are logged.
- The integration modules from “org.mapleir.parent” provide low-level operations and graph algorithms that are utilized by the IR and transformation components.
- Finally, after successful transformation, an output generator (e.g. in the IO or workspace packages) writes the obfuscated JAR.

##### Architectural Patterns and Principles to Emphasize
- Modular and Layered Design: The project’s separation into modules (client, core obfuscator, dependency/pure analysis, SDK, external integrations) is ideal for illustrating a layered architecture.
- Pipelines of Transformation Passes: Represent the engine as a pipeline through which the IR is transformed via successive obfuscation passes.
- Separation of Concerns: Distinguish between UI, configuration, analysis, transformation, and IO.
- Event-Driven and Recovery: Highlight the event bus and smart recovery modules that help handle errors and propagate events.

##### Relevant Technologies and Frameworks
- Java: The primary language used.
- Gradle: The build system, as seen in multiple “build.gradle” files.
- ASM: For bytecode manipulation.
- Graph algorithms and IR-related libraries (as indicated by the “org.mapleir.*” modules).
- External tools: Integration with Homebrew, shell scripts, etc., though they play more of an installation role than internal architecture.

- Clear labels for:
▸ “CLI/GUI Frontend”
▸ “Configuration & Dependency Manager”
▸ “Core Obfuscation Engine” – subdivided into “IR Builder”, “Analysis Modules”, “Transformation Pipeline” (with sub-passes like Flow, Encryption, Renaming)
▸ “Event Bus & Logging”
▸ “Output Generation”
▸ “External Integration Modules (org.mapleir.parent)”

## Diagram (Mermaid)

```mermaid
graph TD
    A["CLI/GUI Frontend"]:::ui
    B["Configuration & Dependency Manager"]:::config

    subgraph "Core Obfuscation Engine"
        E0["Engine Main"]:::core
        E1["IR Builder"]:::core
        E2["Analysis Modules"]:::core
        E3["Transformation Pipeline"]:::core
    end

    I["Intermediate Representations & Code Flow Management"]:::ir
    J["Advanced Transformation Techniques"]:::core_transform
    K["Event Bus & Logging"]:::event
    L["Output Generation"]:::output
    M["External Integration Modules (org.mapleir.parent)"]:::integration
    N["External SDK/API"]:::sdk

    A -->|"initiates"| E0
    B -->|"configures"| E0
    E0 -->|"delegates_to"| E1
    E0 -->|"delegates_to"| E2
    E0 -->|"delegates_to"| E3
    E1 -->|"builds"| I
    E2 -->|"analyzes"| I
    E3 -->|"applies"| J
    E0 -->|"orchestrates"| K
    E0 -->|"sends_output"| L
    M -->|"supports"| E0
    E0 -->|"exposes"| N

    click A "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/blob/master/dev/skidfuscator/client/standalone/SkidfuscatorMain.java"
    click A "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator/client/standalone/src/main/java/dev/skidfuscator/obfuscator/gui"

    click B "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/blob/master/dev/skidfuscator.client.standalone/skidfuscator-config.conf"
    click B "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.commons/src/main/java/dev/skidfuscator/config"
    click B "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.commons/src/main/java/dev/skidfuscator/builder"

    click E0 "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator/obfuscator"

    click I "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.obfuscator/skidasm/cfg"
    click I "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.obfuscator/skidasm/expr"
    click I "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.obfuscator/skidasm/stmt"
    click I "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.obfuscator/src/main/java/dev/skidfuscator/obfuscator/frame"
    click I "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator/obfuscator/frame_V2"

    click K "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.obfuscator/src/main/java/dev/skidfuscator/obfuscator/event"
    click K "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.commons/src/main/java/dev/skidfuscator/logger"

    click J "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.obfuscator/src/main/java/dev/skidfuscator/obfuscator/transform/impl"

    click M "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/blob/master/org/mapleir.parent"

    click N "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/tree/master/dev/skidfuscator.sdk/src/main/java/sdk"

    classDef ui fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef config fill:#FAD7A0,stroke:#7D6608,stroke-width:2px;
    classDef core fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef ir fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
    classDef core_transform fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef event fill:#F5CBA7,stroke:#A04000,stroke-width:2px;
    classDef output fill:#E6B0AA,stroke:#943126,stroke-width:2px;
    classDef integration fill:#D5F5E3,stroke:#117864,stroke-width:2px;
    classDef sdk fill:#FCF3CF,stroke:#B7950B,stroke-width:2px;
```
