Skip to content

Commit a452b01

Browse files
committed
feat: Initialized Project
0 parents  commit a452b01

31 files changed

+1724
-0
lines changed

.github/workflows/android.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Android CI/CD
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- "**.gradle"
8+
- "**.rs"
9+
- "**/Cargo.toml"
10+
- ".github/workflows/**"
11+
pull_request:
12+
branches: [ "main" ]
13+
paths:
14+
- "**.gradle"
15+
- "**.rs"
16+
- "**/Cargo.toml"
17+
- ".github/workflows/**"
18+
release:
19+
types: [ created ]
20+
21+
permissions:
22+
contents: write
23+
packages: write
24+
25+
jobs:
26+
build:
27+
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Set up JDK 17
33+
uses: actions/setup-java@v4
34+
with:
35+
java-version: '17'
36+
distribution: 'temurin'
37+
cache: 'gradle'
38+
- name: Setup | Rust
39+
uses: dtolnay/rust-toolchain@stable
40+
with:
41+
targets: 'armv7-linux-androideabi,i686-linux-android,aarch64-linux-android,x86_64-linux-android'
42+
- name: Setup Android SDK
43+
uses: android-actions/setup-android@v3
44+
with:
45+
packages: platform-tools build-tools;33.0.0 cmake;3.22.1 ndk;26.2.11394342
46+
env:
47+
SKIP_JDK_VERSION_CHECK: true
48+
- name: Grant execute permission for gradlew
49+
run: chmod +x gradlew
50+
- name: Build with Gradle
51+
run: ./gradlew :module:zipRelease -Prelease
52+
- name: Upload Artifacts
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: geoink-module-zip
56+
path: out/*.zip
57+
58+
deploy:
59+
needs: build
60+
runs-on: ubuntu-latest
61+
if: github.event_name == 'release' || github.ref == 'refs/heads/main'
62+
permissions:
63+
contents: write
64+
steps:
65+
- name: Download Artifacts
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: geoink-module-zip
69+
path: out/
70+
- name: Deploy to GitHub Releases
71+
uses: softprops/action-gh-release@v2
72+
if: github.event_name == 'release'
73+
with:
74+
files: out/*.zip
75+
draft: false
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
- name: Deploy to GitHub Releases (Draft)
79+
uses: softprops/action-gh-release@v2
80+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
81+
with:
82+
files: out/*.zip
83+
draft: true
84+
overwrite_files: true
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild
9+
.cxx
10+
local.properties
11+
out

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 HanSoBored
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# ⚡ Zygisk-Loader
2+
3+
![Language](https://img.shields.io/badge/Language-Rust-orange)
4+
![API](https://img.shields.io/badge/Zygisk-API%20v5-blue)
5+
6+
**Zygisk-Loader** is a lightweight, high-performance Zygisk module written in **Rust**. It acts as a universal "bridge" that dynamically loads external shared libraries (`.so`) into specific Android application processes at runtime (during the `postAppSpecialize` phase).
7+
8+
Unlike traditional Zygisk modules that require rebuilding and rebooting the device to update code, **Zygisk-Loader** enables a **"Hot-Swap" workflow**. You can recompile your instrumentation library, push it to the device, and simply restart the target app to apply changes instantly.
9+
10+
## Key Features
11+
12+
* **Dynamic Injection**: Inject any native library (`.so`) into any app without modifying the APK.
13+
* **No Reboot Required**: Update your payloads and target configurations instantly.
14+
* **Rust-Powered**: Built with safety and performance in mind using the `jni` and `libc` crates.
15+
* **Zygisk API v5**: Utilizes the latest Zygisk API for maximum compatibility with Magisk, KernelSU, and APatch.
16+
* **Config-Driven**: Target applications via a simple text file (`active_config.txt`).
17+
* **Stealthy**: Injection occurs early in the process memory (before `MainActivity`), making it ideal for bypassing SSL Pinning or anti-tamper mechanisms.
18+
19+
## Architecture
20+
21+
Zygisk-Loader separates the **Injector** (The Module) from the **Payload** (The Logic).
22+
23+
```mermaid
24+
flowchart TD
25+
%% Subgraph untuk File System (Host Side)
26+
subgraph Storage ["/data/adb/modules/geoink/"]
27+
style Storage fill:#f9f9f9,stroke:#333,stroke-width:2px
28+
Config["active_config.txt"]
29+
PayloadBin["payload.so (Rust/C++)"]
30+
end
31+
32+
%% Subgraph untuk Proses Aplikasi (Runtime)
33+
subgraph Runtime ["Android Application Process"]
34+
style Runtime fill:#e1f5fe,stroke:#0277bd,stroke-width:2px
35+
36+
AppStart((App Start)) --> ZygiskHook[Zygisk Framework]
37+
ZygiskHook --> Loader["Zygisk-Loader (Resident)"]
38+
39+
Loader -->|Read /proc/self/cmdline| CheckName{Is Target?}
40+
Loader -.->|Read| Config
41+
42+
CheckName -- No --> Ignore[Do Nothing / Exit]
43+
CheckName -- Yes --> Inject[dlopen / Inject]
44+
45+
Inject -->|Load Dynamic Lib| PayloadBin
46+
PayloadBin -.->|Map into Memory| RunningPayload["Running Payload\n(Hooks / SSL Unpinning)"]
47+
end
48+
49+
%% External Interaction
50+
Synapse[Synapse CLI / User] -->|1. Write Target| Config
51+
Synapse -->|2. Deploy Lib| PayloadBin
52+
Synapse -->|3. Restart App| AppStart
53+
54+
%% Styling
55+
style Loader fill:#dea,stroke:#869D05,stroke-width:2px
56+
style RunningPayload fill:#ffccbc,stroke:#bf360c,stroke-width:2px,stroke-dasharray: 5 5
57+
style Synapse fill:#333,stroke:#fff,color:#fff
58+
```
59+
60+
## Usage
61+
62+
### 1. Installation
63+
1. Download the latest release `.zip`.
64+
2. Flash via Magisk / KernelSU / APatch.
65+
3. Reboot device once.
66+
67+
### 2. Configuration & Deployment
68+
You don't need to touch the module anymore. Control everything via ADB or a shell manager (like **Synapse** [TODO]):
69+
70+
**A. Set Target:**
71+
Write the package name of the target application to the config file:
72+
```bash
73+
echo "com.target.application" > /data/adb/modules/zygisk-loader/active_config.txt
74+
```
75+
76+
**B. Deploy Payload:**
77+
Copy your compiled Rust/C++ library to the module folder:
78+
```bash
79+
cp libpayload.so /data/adb/modules/zygisk-loader/payload.so
80+
chmod 755 /data/adb/modules/zygisk-loader/payload.so
81+
```
82+
83+
**C. Apply:**
84+
Force stop the target application. The next time it launches, your payload will be loaded.
85+
```bash
86+
am force-stop com.target.application
87+
```
88+
89+
## Developing a Payload (Rust)
90+
91+
Your payload does not need to know about Zygisk. It just needs a constructor entry point. We recommend using the `ctor` crate.
92+
93+
`Cargo.toml`:
94+
```toml
95+
[lib]
96+
crate-type = ["cdylib"]
97+
98+
[dependencies]
99+
ctor = "0.2"
100+
android_logger = "0.13"
101+
log = "0.4"
102+
```
103+
104+
`src/lib.rs`:
105+
```rust
106+
use ctor::ctor;
107+
use log::LevelFilter;
108+
use android_logger::Config;
109+
110+
#[ctor]
111+
fn init() {
112+
android_logger::init_once(
113+
Config::default().with_max_level(LevelFilter::Info).with_tag("MyPayload")
114+
);
115+
log::info!("Hello from inside the target application!");
116+
117+
// Initialize your hooks (Dobby, Android-Mem-Kit) here...
118+
}
119+
```
120+
121+
## Disclaimer
122+
123+
This tool is for **educational purposes and security research only**. The author is not responsible for any misuse of this software, including game modification in violation of ToS or bypassing security controls on systems you do not own.
124+
125+
## License
126+
127+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
buildscript {
3+
repositories {
4+
google()
5+
mavenCentral()
6+
maven{
7+
url "https://plugins.gradle.org/m2/"
8+
}
9+
}
10+
dependencies {
11+
classpath "com.android.tools.build:gradle:7.4.2"
12+
// NOTE: Do not place your application dependencies here; they belong
13+
// in the individual module build.gradle files
14+
}
15+
}
16+
17+
plugins {
18+
id 'idea'
19+
}
20+
21+
idea.module {
22+
excludeDirs += file('out')
23+
resourceDirs += file('zygiskloader')
24+
resourceDirs += file('scripts')
25+
}
26+
27+
ext {
28+
min_sdk = 23
29+
target_sdk = 31
30+
31+
outDir = file("$rootDir/out")
32+
}
33+
34+
task clean(type: Delete) {
35+
delete rootProject.buildDir, outDir
36+
}

gradle.properties

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Project-wide Gradle settings.
2+
# IDE (e.g. Android Studio) users:
3+
# Gradle settings configured through the IDE *will override*
4+
# any settings specified in this file.
5+
# For more details on how to configure your build environment visit
6+
# http://www.gradle.org/docs/current/userguide/build_environment.html
7+
# Specifies the JVM arguments used for the daemon process.
8+
# The setting is particularly useful for tweaking memory settings.
9+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10+
# When configured, Gradle will run in incubating parallel mode.
11+
# This option should only be used with decoupled projects. More details, visit
12+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13+
# org.gradle.parallel=true
14+
# AndroidX package structure to make it clearer which packages are bundled with the
15+
# Android operating system, and which are packaged with your app"s APK
16+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
17+
android.useAndroidX=true
18+
# Automatically convert third-party libraries to use AndroidX
19+
android.enableJetifier=true

gradle/wrapper/gradle-wrapper.jar

57.8 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Apr 24 19:18:08 EEST 2024
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)