409 Commits

Author SHA1 Message Date
Lucky Kiddos
e56cc85948 add: Indonesian README.md (#108)
This commit adds Indonesian translation for README.

Signed-off-by: Lucky Kiddos <95188840+GuitarHeroStyles@users.noreply.github.com>
2025-01-11 06:37:27 -03:00
ThePedroo
d8034b7bde add: Magisk Kitsune SuList support
This commit adds support for the Kitsune SuList, a denylist in whitelist mode.
2025-01-11 06:37:26 -03:00
Pedro.js
3605857d84 improve: companion handler fd closing; fix: PIPE signal handling (#103)
This commit improves how we decide to close the fd that connects the injected module with the companion, avoiding both double close and fd leaks.
2025-01-11 06:37:25 -03:00
ThePedroo
b0a296fc29 add: support for magic mount in KSU and APatch
This commit allows ReZygisk to u(n)mount mounted paths in KSU and APatch environments using magic mount.
2025-01-11 06:37:24 -03:00
ThePedroo
7a892e0d62 improve: companion.c, dl.c and utils.c code
This commit improves the code for multiple files by making "read_string" function already make the string NULL-terminated, avoiding code duplication. Also for "companion.c" fixes an "if" where it would read "client_fd" and check if "fd" is equal to "-1", instead of "client_fd", also does some overall code improvements there like detaching the thread, avoiding memory leaks in the exit, of the thread itself.
2025-01-11 06:37:22 -03:00
ThePedroo
6b0b71a690 fix: Zygiskd remote read types
This commit fixes the mismatch between types sent by lizygisk.so and read by Zygiskd, causing issues.
2025-01-11 06:37:21 -03:00
ThePedroo
95073d9f4a fix: checking malloc against non NULL not NULL
This commit fixes an issue where one of the "malloc", a libc function to allocate dynamic memory, "if"s were checking its return against non-NULL instead of NULL, making it seem to have failed when it didn't.
2024-12-18 13:07:06 -03:00
Pedro.js
4b7618ddf9 merge: Clean up injection traces of ReZygisk (#101)
This merge commit merges the Pull Request by JingMatrix that cleans up the rest of detection points of ReZygisk in non-KSU environments.
2024-12-18 03:26:41 -03:00
JingMatrix
0671f2e497 improve: reset linker module counters
Two counters for module loading and unloading are introduced in the commit a2e83ab348. To remove linker traces of libzygisk.so and Zygisk modules, we should reset them properly.
2024-12-18 07:21:03 +01:00
JingMatrix
5e072bd919 improve: cache scanned virtual maps
Reading the file `/proc/self/maps` is detectable by the target process.
Hence, we should cache scanned virtual maps after `libart.so` is loaded for later plt hooks in the target process.
2024-12-18 07:21:03 +01:00
JingMatrix
2814aaf67f remove: unnecessary memory mapping renaming
Note that it is impossible to hide injecting trace of virtual memory maps from the hooked target process.
ReZygisk will only focus on removing its trace for approcess that are not hooked by modules.
2024-12-18 07:19:41 +01:00
JingMatrix
b7138d6353 add: drop soinfo for libzygisk.so
1. fix typo vsdo -> vdso and allow this symbol to be not found, which is the case for the 32bit linkers on some devices
2. use soinfo_free to fully remove the soinfo record of libzygisk.so
3. set `soinfo.size = 0` to avoid the library being unmapped while removing its soinfo record
4. add more debug logs for troubleshooting
2024-12-15 16:28:49 +01:00
JingMatrix
5e43e4a71b improve: hook pthread_attr_setstacksize
Relying on dlclose to unload libzygisk.so will block us to clean its trace in the solist.
This commit allows us to unmap libzygisk.so without using dlclose.
To call munmap, we use the function pthread_attr_setstacksize instead of pthread_attr_destroy, so that tail-call can still be applied here since it has the same signature as munmap.
2024-12-15 16:25:06 +01:00
ThePedroo
8fb5d9197a fix: magisk file detection
This commit fixes the detection for the "magisk" file which can be in 2 different folders, with 3 possible different names.
2024-12-13 13:56:27 -03:00
Md Arif
060a1f3cf9 add: GrapheneOS support (#53)
This commit adds support for devices that run GrapheneOS by hooking on JNI methods they renamed.

Signed-off-by: Md Arif <111168803+sabamdarif@users.noreply.github.com>
2024-12-07 19:03:22 +00:00
Pedro.js
6cb8f305bc merge: Improve SoList hiding (#95, #96)
This commit merges the pull request by JingMatrix that includes improvements for clangd users, fixes for devices which have llvm suffix in SoList related symbols, and improved hiding related to the SoList.
2024-12-05 20:07:50 -03:00
JingMatrix
6c41a8188d improve: drop soinfo records of loaded modules
In Bionic linker, the `soinfo` structure has a field `next`, which points to the next loaded library in a linked list consisting of all loaded libraries.
Hence, an injected process can easily find all loaded libraries.
Previously in ReZygisk, module library records are hidden by setting the `pathname` field to be empty, which is futile but easier to detect.
Current idea of dropping record can be found in the following commit:
5d635e8c66
2024-12-06 00:02:29 +01:00
JingMatrix
3d79939d7b fix: linker64 static symbols lookup with suffix
On Android 15+ in some devices, the symbol names of some static variables such as `solist`, has a `llvm` suffix in its exported name.
Current commit handles this case and close #63 as fixed.
2024-12-06 00:02:26 +01:00
JingMatrix
9bcbec91aa improve: turn on CMAKE_EXPORT_COMPILE_COMMANDS
To make `clangd` work properly, one needs to make symbolic links
```
ln -sf $PWD/loader/build/tools/debug/arm64-v8a/compile_commands.json loader/build
```
2024-11-26 18:10:31 +01:00
JingMatrix
d498a9ab01 fix: trigger Zygisk modules service.sh in parallel (#91)
This commit fixes 2 issues:
- service.sh of files were not being executed in parallel, a behavior described in: https://github.com/topjohnwu/Magisk/blob/master/docs/guides.md#boot-scripts . This was fixed by using "&" in the end of the command to execute the module's service.sh, telling the shell to not block.
- Gradle wrapper used in ReZygisk was old, causing failing CIs.

It also updates the NDK version to ensure we'll be operating smoothly.
2024-11-24 15:18:50 -03:00
Fyphen
b5b5c2f9d8 add: ja_JP README (#88)
* Create README_ja-JP.md

Signed-off-by: Fyphen <fyphensub@gmail.com>

* Update README_ja-JP.md

Signed-off-by: Fyphen <fyphensub@gmail.com>

---------

Signed-off-by: Fyphen <fyphensub@gmail.com>
2024-11-23 20:39:46 +07:00
何意挽秋風
5d9276e9e0 add: README_zh-TW.md translation (#84)
This commit adds Traditional Chinese translation for README.

Signed-off-by: 何意挽秋風 <94283631+RejectVanity@users.noreply.github.com>
2024-11-16 13:32:22 -03:00
Keeperorowner
7da7b8bd07 improve: Simplified Chinese README translation (#80)
This commit improves translations in the Simplified Chinese README.

Signed-off-by: Keeperorowner <qingfong0731@outlook.com>
2024-11-14 19:16:23 -03:00
ThePedroo
f4af759aab fix: free in garbage data pointer; fix: Zygiskd wrong message length
This commit fixes the issue where "free" would be executed in a pointer which has garbage data, leading to crashes. This was fixed by setting to NULL, so that it's clean.
It also fixes the issue where Zygiskd messages for "DAEMON_SET_INFO" would not count the NULL-terminator, causing crashes.
2024-11-12 20:38:28 -03:00
SheepChef
21325ec409 fix: WebUI branch URL in READMEs (#77)
This commit fixes the URL of the new WebUI branch in the READMEs.

Signed-off-by: SheepChef <50871867+SheepChef@users.noreply.github.com>
2024-11-12 14:47:08 -03:00
echo
0e9307bfd6 remove: Rust dependencies information from README.md (#74)
This commit removes information about Rust dependencies used in previous Zygiskd from "README.md" file.
2024-11-12 13:34:03 -03:00
何意挽秋風
47566a81af update: project licensing state in Chinese README (#71)
This commit updates the state of the license of the project, which is now AGPL-3.

Signed-off-by: 何意挽秋風 <94283631+RejectVanity@users.noreply.github.com>
2024-11-11 10:52:51 -03:00
ThePedroo
f35680837e remove: non-working info in zygisk-ptraceXX info response
This commit removes information given in the response of info command of "zygisk-ptrace64" or "zygisk-ptrace32" that leads to failing builds, as it is not exported from monitor.cpp.
v1.0.0-rc.1
2024-11-10 23:28:33 -03:00
ThePedroo
b1d118d120 fix: missing pid and running in zygote_info structure
This commit fixes the issue where the commit that added "pid" (pid_t) and "running" (bool) members to the "zygote_info" structure, a structure that stores the response given by Zygiskd about its state, wasn't added, leading to failing buildings.
2024-11-10 23:19:21 -03:00
ThePedroo
97af7fe2da merge: add/zygiskd-c99 branch
This commit merges the Zygiskd C99 branch, which not only adds the re-written Zygisk daemon, but also implement fixes in the ptrace command.
2024-11-10 23:14:05 -03:00
ThePedroo
519d1db6a0 fix: space indentation in macros
This commit fixes the space indentation done in the "ASSURE_*" macros.
2024-11-10 23:11:50 -03:00
ThePedroo
ba7d044611 fix: additional new line in some logs
This commit fixes the issue where some loggings would add an additional new line.
2024-11-10 23:11:49 -03:00
ThePedroo
2c74ee3877 improve: module.prop parsing code; fix: deferecing a NULL pointer
This commit both improves the code that parses "module.prop" file of ReZygisk, reducing its complexity greatly and also making it smaller, and also fixes an issue where ReZygisk would deference a NULL pointer, leading to crashes in Zygiskd crash.
2024-11-10 23:11:46 -03:00
ThePedroo
66e98cf007 fix: possible out-of-bounds write; remove: unnecessary logging
This commit both fixes a possible out-of-bounds write by using "snprintf" over "sprintf" and also removes a unnecessary logging which was meant to be removed commits ago.
2024-11-10 23:09:51 -03:00
ThePedroo
47d46e305c fix: fd leak and out-of-bounds access in exec_command
This commit fixes both fd leak and out-of-bounds access in the "exec_command" function, which can happen when execution of the command fails, leading to crashes on Magisk-rooted devices, and possibly APatch-rooted devices too.
2024-11-10 23:09:50 -03:00
ThePedroo
8892eca4a7 fix: wrong longest root implementation name macro value
This commit fixes the value of the macro that defines the size of the longest root implementation name, leading to Zygiskd crashes on Magisk Official.
2024-11-10 23:09:49 -03:00
ThePedroo
a6124a6a5e improve: Zygiskd Magisk code
This commit improves the Zygiskd Magisk code by avoiding redundant code and reducing complexity.
2024-11-10 23:09:47 -03:00
ThePedroo
3265bcb581 fix: module name in Zygiskd log
This commit fixes the module name in Zygiskd log which would only show a letter.
2024-11-10 23:09:46 -03:00
ThePedroo
c4ab77ed9e fix: memory leak and use-after-free in APatch Zygiskd code
This commit fixes a memory leak and a user-after-free vulnerability in APatch code of Zygiskd.
2024-11-10 23:09:45 -03:00
ThePedroo
135ebbb9ba add: Magisk variant status; improve: KSU detection
This commit adds the Magisk variant to module description, and also improves KernelSU detection by requiring the userspace part of it to be installed, AKA "ksud".
2024-11-10 23:09:44 -03:00
ThePedroo
380ef011a1 improve: status description spacing
This commit improves the spacing of the module status description.
2024-11-10 23:09:42 -03:00
ThePedroo
e0d0bd0d76 fix: Zygiskd C99 not properly detecting Magisk DenyList
This commit fixes the Magisk part of Zygiskd C99 which used to mark all apps as outside DenyList.
2024-11-10 23:09:41 -03:00
ThePedroo
e23d1a53d0 remove: debug log
This commit removes logging used in development, which is not needed anymore.
2024-11-10 23:09:39 -03:00
ThePedroo
182c0293ca fix: compiling errors
This commit fixes compiling errors from missing declaration of variables and missing macros.
2024-11-10 23:09:38 -03:00
ThePedroo
ab7de49e4c improve: code robustness
This commit improves the robustness of the code by removing debug logs, fixing a memory leak, and adding missing error handling.
2024-11-10 23:09:36 -03:00
ThePedroo
980bf2ab4c improve: Zygiskd build.gradle.kts
This commit improves Zygisk's build gradle file by avoiding the repetition of compiler flags.
2024-11-10 23:09:35 -03:00
ThePedroo
0352d9378b fix: few UBs; fix: missing error handler for malloc
This commit fixes some few UBs (Undefined Behaviors) based on numerous sanitizers, and also adds the missing error handling for a "malloc" call.
2024-11-10 23:09:33 -03:00
ThePedroo
e11db94002 remove: logging to zygiskd.log file
This commit removes the logging made to the zygiskd.log file.
2024-11-10 23:09:32 -03:00
ThePedroo
d4ce0916f6 update: Zygiskd C99 LICENSE
This commit updates the LICENSE for Zygiskd C99, using a LICENSE that doesn't allow the code to be used for closed source projects, and with more restrictions while allowing other people to fork, modify as much as wanted as long as it remains open source.
2024-11-10 23:09:31 -03:00
ThePedroo
6ca4b72762 improve: zygisk-ptrace speed by modifying compiler flags
This commit improves the "zygisk-ptrace" command speed by changing the compiler flags to use more brutal optimizations.
2024-11-10 23:08:41 -03:00