Skip to content

Commit 1535cd4

Browse files
committed
feat(docs): update LICENSE, and Globalization The Commentary
1 parent 3a6028d commit 1535cd4

File tree

5 files changed

+47
-22
lines changed

5 files changed

+47
-22
lines changed

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.

module/src/main/c/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
cmake_minimum_required(VERSION 3.22.1)
22
project(zygisk-loader)
33

4-
# Mengatur agar biner yang dihasilkan kecil & teroptimasi
4+
# Set the resulting binary to be small & optimized
55
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wall -Wextra -Os -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables")
66

77
add_library(${MODULE_NAME} SHARED main.c)
88

9-
# Log dan Android dlfcn & jni
9+
# Log and Android dlfcn & jni
1010
target_link_libraries(${MODULE_NAME} log dl android)

module/src/main/c/main.c

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <android/log.h>
1111
#include "zygisk.h"
1212

13-
// --- KONFIGURASI ---
13+
// --- CONFIGURATION ---
1414
#define LOG_TAG "Zygisk_Loader"
1515
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
1616
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
@@ -28,14 +28,13 @@ static bool g_target_app_detected = false;
2828

2929
// --- UTILITY FUNCTIONS ---
3030

31-
// Pengganti rand_int()
3231
static uint32_t rand_int() {
3332
struct timespec ts;
3433
clock_gettime(CLOCK_MONOTONIC, &ts);
3534
return (uint32_t)(ts.tv_nsec ^ ts.tv_sec);
3635
}
3736

38-
// Menulis buffer ke file
37+
// Write buffer to file
3938
static bool write_file(const char *path, const uint8_t *data, size_t size) {
4039
FILE *f = fopen(path, "wb");
4140
if (!f) return false;
@@ -46,7 +45,7 @@ static bool write_file(const char *path, const uint8_t *data, size_t size) {
4645
return written == size;
4746
}
4847

49-
// Membaca file utuh ke memori (RAM Buffer)
48+
// Reading the entire file into memory (RAM Buffer)
5049
static bool read_file_to_memory(const char *path, uint8_t **out_buffer, size_t *out_size) {
5150
FILE *f = fopen(path, "rb");
5251
if (!f) return false;
@@ -79,19 +78,18 @@ static bool read_file_to_memory(const char *path, uint8_t **out_buffer, size_t *
7978
return true;
8079
}
8180

82-
// Membaca file konfigurasi (Mendapatkan Target)
81+
// Reading configuration file (Get Target)
8382
static void read_target_config() {
8483
FILE *f = fopen(CONFIG_PATH, "r");
8584
if (f) {
8685
if (fgets(g_target_package, sizeof(g_target_package), f)) {
87-
// Hilangkan karakter newline / spasi di akhir
8886
g_target_package[strcspn(g_target_package, "\r\n")] = 0;
8987
}
9088
fclose(f);
9189
}
9290
}
9391

94-
// Helper untuk membaca jstring ke buffer C yang aman
92+
// Helper for reading jstrings into a safe C buffer
9593
static void get_jstring_utf(JNIEnv *env, jstring *jstr_ptr, char *out_buf, size_t buf_size) {
9694
out_buf[0] = '\0';
9795
if (jstr_ptr && *jstr_ptr) {
@@ -117,7 +115,7 @@ static void onLoad(struct zygisk_api *api, JNIEnv *env) {
117115
static void preAppSpecialize(void *impl, struct zygisk_app_specialize_args *args) {
118116
(void)impl;
119117

120-
// 1. Baca Konfigurasi Target (Sebagai Root/Zygote)
118+
// 1. Read Target Configuration (As Root/Zygote)
121119
read_target_config();
122120

123121
if (strlen(g_target_package) == 0) return;
@@ -126,10 +124,10 @@ static void preAppSpecialize(void *impl, struct zygisk_app_specialize_args *args
126124
if (g_jvm && (*g_jvm)->GetEnv(g_jvm, (void**)&env, JNI_VERSION_1_6) == JNI_OK) {
127125
char process_name[256] = {0};
128126

129-
// Coba dapatkan dari nice_name (Fast-path)
127+
// Try getting from nice_name (Fast-path)
130128
get_jstring_utf(env, args->nice_name, process_name, sizeof(process_name));
131129

132-
// Jika kosong, ekstrak dari app_data_dir (Fallback untuk isolated process)
130+
// If empty, extract from app_data_dir (Fallback for isolated processes)
133131
if (strlen(process_name) == 0) {
134132
char app_data_dir[256] = {0};
135133
get_jstring_utf(env, args->app_data_dir, app_data_dir, sizeof(app_data_dir));
@@ -139,12 +137,12 @@ static void preAppSpecialize(void *impl, struct zygisk_app_specialize_args *args
139137
}
140138
}
141139

142-
// Cek apakah target sesuai dengan konfigurasi
140+
// Check if the target matches the configuration
143141
if (strstr(process_name, g_target_package) != NULL) {
144142
LOGI("Target Detected: %s", process_name);
145143
g_target_app_detected = true;
146144

147-
// 2. Baca file Payload .so ke dalam RAM
145+
// 2. Read the .so Payload file into RAM
148146
if (read_file_to_memory(SOURCE_PAYLOAD_PATH, &g_payload_buffer, &g_payload_size)) {
149147
LOGI("Payload buffered to RAM: %zu bytes", g_payload_size);
150148
} else {
@@ -157,7 +155,7 @@ static void preAppSpecialize(void *impl, struct zygisk_app_specialize_args *args
157155
static void postAppSpecialize(void *impl, const struct zygisk_app_specialize_args *args) {
158156
(void)impl;
159157

160-
// Cegah eksekusi di aplikasi yang bukan target atau jika gagal load buffer
158+
// Prevent execution in non-target applications or if buffer load fails
161159
if (!g_target_app_detected || !g_payload_buffer) return;
162160

163161
JNIEnv *env = NULL;
@@ -171,18 +169,18 @@ static void postAppSpecialize(void *impl, const struct zygisk_app_specialize_arg
171169
goto cleanup;
172170
}
173171

174-
// Generate nama file random /cache/.res_[rand].so
172+
// Generate random file name /cache/.res_[rand].so
175173
char file_name[1024];
176174
snprintf(file_name, sizeof(file_name), "%s/cache/.res_%u.so", app_data_dir, rand_int());
177175

178176
LOGI("Attempting injection to: %s", file_name);
179177

180-
// Tulis buffer ke Cache -> Dlopen -> Unlink
178+
// Write buffer to Cache -> Dlopen -> Unlink
181179
if (write_file(file_name, g_payload_buffer, g_payload_size)) {
182180

183181
void *handle = dlopen(file_name, RTLD_NOW);
184182

185-
// Hapus file secara instan untuk stealth
183+
// Delete files instantly for stealth
186184
unlink(file_name);
187185

188186
if (!handle) {
@@ -196,15 +194,15 @@ static void postAppSpecialize(void *impl, const struct zygisk_app_specialize_arg
196194
}
197195

198196
cleanup:
199-
// Hapus memori buffer agar tidak menjadi memory leak di sisi target aplikasi
197+
// Clear the buffer memory so that it does not become a memory leak on the target application side.
200198
if (g_payload_buffer) {
201199
free(g_payload_buffer);
202200
g_payload_buffer = NULL;
203201
g_payload_size = 0;
204202
}
205203
}
206204

207-
// Kita tidak membutuhkan method server
205+
// We don't need server method
208206
static void preServerSpecialize(void *impl, struct zygisk_server_specialize_args *args) { (void)impl; (void)args; }
209207
static void postServerSpecialize(void *impl, const struct zygisk_server_specialize_args *args) { (void)impl; (void)args; }
210208

@@ -226,6 +224,6 @@ void zygisk_module_entry(struct zygisk_api *api, JNIEnv *env) {
226224

227225
__attribute__((visibility("default")))
228226
void zygisk_companion_entry(int client) {
229-
// Companion tidak digunakan, cukup di-close
227+
// Companion is not used, just close it
230228
close(client);
231229
}

module/template/module.prop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ version=${versionName}
44
versionCode=${versionCode}
55
author=HanSoBored
66
description=Zygisk-Loader is a dynamic payload injection module
7-
#updateJson=
7+
https://raw.githubusercontent.com/HanSoBored/Zygisk-Loader/main/update.json

update.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "v1.0.0",
3+
"versionCode": 11,
4+
"zipUrl": "https://github.com/HanSoBored/Zygisk-Loader/releases/download/v1.0.0/zygisk-loader-v1.0.0-release.zip",
5+
"changelog": "feat(init): ReWrite in C"
6+
}

0 commit comments

Comments
 (0)