add 32 bit support back & fix x86-64 support & fix jni hook restore (#59)

* Add back 32 bit support & some fix

* fix system server crash on android 10

* Refine code

---------

Co-authored-by: Nullptr <noreply@nullptr.icu>
This commit is contained in:
5ec1cff
2023-10-24 15:27:21 +08:00
committed by GitHub
parent a956dba77d
commit a2af28dc6f
18 changed files with 444 additions and 306 deletions
+7 -1
View File
@@ -5,7 +5,13 @@
#include <unistd.h>
#include <vector>
constexpr auto kCPSocketPath = "/dev/zygisk/cp.sock";
#if defined(__LP64__)
# define LP_SELECT(lp32, lp64) lp64
#else
# define LP_SELECT(lp32, lp64) lp32
#endif
constexpr auto kCPSocketPath = "/dev/zygisk/" LP_SELECT("cp32", "cp64") ".sock";
class UniqueFd {
using Fd = int;
+5 -9
View File
@@ -5,16 +5,13 @@
#include <string.h>
#ifndef LOG_TAG
#define LOG_TAG "zygisk-core"
#if defined(__LP64__)
# define LOG_TAG "zygisk-core64"
#else
# define LOG_TAG "zygisk-core32"
#endif
#endif
#ifdef LOG_DISABLED
#define LOGD(...)
#define LOGV(...)
#define LOGI(...)
#define LOGW(...)
#define LOGE(...)
#else
#ifndef NDEBUG
#define LOGD(...) logging::log(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGV(...) logging::log(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
@@ -27,7 +24,6 @@
#define LOGE(...) logging::log(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#define LOGF(...) logging::log(ANDROID_LOG_FATAL, LOG_TAG, __VA_ARGS__)
#define PLOGE(fmt, args...) LOGE(fmt " failed with %d: %s", ##args, errno, strerror(errno))
#endif
namespace logging {
void setfd(int fd);