# unicorn369/hookeuicc architecture

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

- Interactive diagram: https://gitdiagram.com/unicorn369/hookeuicc
- Repository: https://github.com/unicorn369/hookeuicc

## Overview

#### Purpose and delivery

HookEuicc is an Android Xposed module that bypasses eSIM requirements imposed by other apps and can capture eSIM activation codes by copying them to the clipboard. It also provides an OMAPI bypass for Secure Element access where ARA/ARF rules would normally deny access.

The Android application primarily hosts module configuration; its runtime behavior is injected into other processes by the Xposed framework.

Paths: `app/src/main/AndroidManifest.xml`, `app/src/main/assets/xposed_init`, `app/build.gradle`

#### Entry points and process model

`xposed_init` registers the Xposed entry class. Xposed loads that class into selected target application or system processes, rather than invoking it through normal Android activity startup.

`XposedInit` is the module’s behavioral entry point and hook coordinator. It must distinguish loaded packages/processes and install the applicable eSIM or OMAPI hooks without making the host UI process responsible for interception.

Paths: `app/src/main/assets/xposed_init`, `app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java`

#### Configuration UI and persistence boundary

`SettingsActivity` is the user-facing Android entry point for enabling/configuring target behavior. Its preference screen defines persisted choices, including the package selection relevant to OMAPI bypass (`com.android.se` per README).

The settings UI writes Android preference-backed state; injected hook code reads that state when running in target processes. This is an important cross-process boundary, since the configuration app and hooked processes do not share normal in-memory state.

Paths: `app/src/main/java/cn/unicorn369/HookEuicc/SettingsActivity.java`, `app/src/main/res/xml/prefs.xml`, `app/src/main/res/layout/activity_settings.xml`

#### eSIM requirement bypass and code extraction

The module’s core hook stage intercepts eSIM-related checks in third-party software, altering or bypassing decisions that would otherwise require eSIM availability. A related interception path observes activation-code handling in apps that do not directly expose the code, then sends the extracted value to the Android clipboard.

This functionality depends on Xposed APIs and target-app implementation details; it is not an eSIM provisioning service and does not own carrier/network activation flows.

Paths: `app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java`, `app/src/main/assets/xposed_init`

#### OMAPI / Secure Element bypass

A separate system-facing hook path targets Android Secure Element infrastructure, specifically `com.android.se`. It bypasses access-control enforcement associated with ARA and ARF, enabling OMAPI access for cards lacking the required ARA configuration.

Operational activation requires selecting `com.android.se` and restarting the device or killing that service, so the process reloads and receives the hooks.

Paths: `app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java`, `app/src/main/res/xml/prefs.xml`

#### Runtime, platform, and localization

The project is a Gradle-built Android application packaged as an Xposed module. Material runtime dependencies are Android framework APIs, the Xposed/LSPosed-compatible injection runtime, target applications, Android clipboard services, and the system Secure Element service for OMAPI behavior.

Resource-driven preferences and strings support default, Simplified Chinese, and Japanese UI variants.

Paths: `build.gradle`, `app/build.gradle`, `app/src/main/res/values/strings.xml`, `app/src/main/res/values-zh-rCN/strings.xml`, `app/src/main/res/values-ja/strings.xml`

Main entry points: [`app/src/main/java/cn/unicorn369/HookEuicc/SettingsActivity.java`](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/SettingsActivity.java) (Settings activity), [`app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java`](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java) (XposedInit), [`app/src/main/AndroidManifest.xml`](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/AndroidManifest.xml) (Module manifest), [`app/src/main/res/xml/prefs.xml`](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/res/xml/prefs.xml) (Preference definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_module["Android Xposed Module"]
  node_gradle["Gradle build<br/>[build.gradle]"]
  node_manifest["Module manifest<br/>android manifest"]
  node_xposed_init["Xposed registration<br/>Xposed entry list"]
end

subgraph group_config["Configuration"]
  node_settings["Settings activity<br/>Android UI"]
  node_preferences_ui["Preference definitions<br/>Android resources<br/>[prefs.xml]"]
  node_preferences[("Preference-backed state<br/>cross-process configuration")]
  node_localized_strings["Localized UI strings<br/>Android resources<br/>[strings.xml]"]
end

subgraph group_hooks["Injected Hook Runtime"]
  node_xposed_runtime{{"Xposed / LSPosed<br/>injection runtime"}}
  node_hook_coordinator["XposedInit<br/>hook coordinator<br/>[XposedInit.java]"]
  node_esim_hooks["eSIM hooks<br/>target-app interception<br/>[XposedInit.java]"]
  node_omapi_hooks["OMAPI access hooks<br/>Secure Element interception<br/>[XposedInit.java]"]
end

node_target_apps["Target applications<br/>hooked processes"]
node_clipboard["Android clipboard<br/>platform service"]
node_se_service["Secure Element service<br/>system process: com.android.se"]
node_omapi_clients["OMAPI clients<br/>card access consumers"]

node_gradle -->|"packages"| node_manifest
node_manifest -->|"launches"| node_settings
node_xposed_init -->|"registers entry class"| node_xposed_runtime
node_xposed_runtime -->|"injects into loaded process"| node_hook_coordinator
node_settings -->|"renders"| node_preferences_ui
node_preferences_ui -->|"defines"| node_preferences
node_settings -->|"writes"| node_preferences
node_localized_strings -->|"localizes"| node_settings
node_preferences -.->|"reads across process boundary"| node_hook_coordinator
node_hook_coordinator -->|"installs for app processes"| node_esim_hooks
node_hook_coordinator -->|"installs for com.android.se"| node_omapi_hooks
node_esim_hooks -->|"intercepts checks and codes"| node_target_apps
node_esim_hooks -->|"copies activation code"| node_clipboard
node_omapi_hooks -->|"intercepts access control"| node_se_service
node_se_service -->|"serves OMAPI access"| node_omapi_clients

click node_gradle "https://github.com/unicorn369/hookeuicc/blob/main/app/build.gradle"
click node_manifest "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/AndroidManifest.xml"
click node_xposed_init "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/assets/xposed_init"
click node_settings "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/SettingsActivity.java"
click node_preferences_ui "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/res/xml/prefs.xml"
click node_localized_strings "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/res/values/strings.xml"
click node_hook_coordinator "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java"
click node_esim_hooks "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java"
click node_omapi_hooks "https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java"

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_gradle,node_manifest,node_xposed_init toneBlue
class node_settings,node_preferences_ui,node_preferences,node_localized_strings toneAmber
class node_xposed_runtime,node_hook_coordinator,node_esim_hooks,node_omapi_hooks toneMint
class node_target_apps,node_clipboard,node_se_service,node_omapi_clients toneNeutral
```

## Components

### Android Xposed Module

Packaged Android app and Xposed registration.

- [Gradle build](https://github.com/unicorn369/hookeuicc/blob/main/app/build.gradle): build · `app/build.gradle`
- [Module manifest](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/AndroidManifest.xml): android manifest · `app/src/main/AndroidManifest.xml`
- [Xposed registration](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/assets/xposed_init): Xposed entry list · `app/src/main/assets/xposed_init`

### Configuration

UI-owned preferences shared with injected runtimes.

- [Settings activity](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/SettingsActivity.java): Android UI · Configures module behavior in the host app process. · `app/src/main/java/cn/unicorn369/HookEuicc/SettingsActivity.java`
- [Preference definitions](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/res/xml/prefs.xml): Android resources · `app/src/main/res/xml/prefs.xml`
- **Preference-backed state**: cross-process configuration · Read by hooks after target processes load.
- [Localized UI strings](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/res/values/strings.xml): Android resources · Default, Simplified Chinese, and Japanese variants. · `app/src/main/res/values/strings.xml`

### Injected Hook Runtime

Runs inside selected target processes.

- **Xposed / LSPosed**: injection runtime · Loads the module entry class into target processes.
- [XposedInit](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java): hook coordinator · Selects process-specific eSIM and OMAPI hooks. · `app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java`
- [eSIM hooks](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java): target-app interception · Bypasses eSIM availability requirements and observes activation codes. · `app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java`
- [OMAPI access hooks](https://github.com/unicorn369/hookeuicc/blob/main/app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java): Secure Element interception · Bypasses ARA/ARF access-control enforcement. · `app/src/main/java/cn/unicorn369/HookEuicc/XposedInit.java`

### Other components

- **Target applications**: hooked processes
- **Android clipboard**: platform service · Receives extracted activation codes.
- **Secure Element service**: system process: com.android.se · Must reload after selection to receive OMAPI hooks.
- **OMAPI clients**: card access consumers

## Connections

- Gradle build → Module manifest: packages
- Module manifest → Settings activity: launches
- Xposed registration → Xposed / LSPosed: registers entry class
- Xposed / LSPosed → XposedInit: injects into loaded process
- Settings activity → Preference definitions: renders
- Preference definitions → Preference-backed state: defines
- Settings activity → Preference-backed state: writes
- Localized UI strings → Settings activity: localizes
- Preference-backed state → XposedInit: reads across process boundary
- XposedInit → eSIM hooks: installs for app processes
- XposedInit → OMAPI access hooks: installs for com.android.se
- eSIM hooks → Target applications: intercepts checks and codes
- eSIM hooks → Android clipboard: copies activation code
- OMAPI access hooks → Secure Element service: intercepts access control
- Secure Element service → OMAPI clients: serves OMAPI access
