You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
improve: port ptracer to C
This commit ports the C++ to C99 from zygisk-ptracer code, allowing a ~3x size reduce in its binary.
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#ifndef DAEMON_H
|
||||
#define DAEMON_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __LP64__
|
||||
@@ -51,9 +54,11 @@ enum mount_namespace_state {
|
||||
Module
|
||||
};
|
||||
|
||||
void rezygiskd_init(const char *path);
|
||||
#define TMP_PATH "/data/adb/rezygisk"
|
||||
|
||||
void rezygiskd_get_path(char *buf, size_t buf_size);
|
||||
static inline const char *rezygiskd_get_path() {
|
||||
return TMP_PATH;
|
||||
}
|
||||
|
||||
int rezygiskd_connect(uint8_t retry);
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <android/api-level.h>
|
||||
#include <cstdint>
|
||||
|
||||
template<unsigned>
|
||||
struct NativeBridgeCallbacks;
|
||||
|
||||
template<>
|
||||
struct NativeBridgeCallbacks<__ANDROID_API_Q__> {
|
||||
[[maybe_unused]] uint32_t version;
|
||||
[[maybe_unused]] void *initialize;
|
||||
[[maybe_unused]] void *loadLibrary;
|
||||
[[maybe_unused]] void *getTrampoline;
|
||||
[[maybe_unused]] void *isSupported;
|
||||
[[maybe_unused]] void *getAppEnv;
|
||||
[[maybe_unused]] void *isCompatibleWith;
|
||||
[[maybe_unused]] void *getSignalHandler;
|
||||
[[maybe_unused]] void *unloadLibrary;
|
||||
[[maybe_unused]] void *getError;
|
||||
[[maybe_unused]] void *isPathSupported;
|
||||
[[maybe_unused]] void *initAnonymousNamespace;
|
||||
[[maybe_unused]] void *createNamespace;
|
||||
[[maybe_unused]] void *linkNamespaces;
|
||||
[[maybe_unused]] void *loadLibraryExt;
|
||||
[[maybe_unused]] void *getVendorNamespace;
|
||||
[[maybe_unused]] void *getExportedNamespace;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct NativeBridgeCallbacks<__ANDROID_API_R__> : NativeBridgeCallbacks<__ANDROID_API_Q__> {
|
||||
[[maybe_unused]] void *preZygoteFork;
|
||||
};
|
||||
Reference in New Issue
Block a user