You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Add public Zygisk API
Still WIP
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include <flags.h>
|
||||
#include <daemon.hpp>
|
||||
|
||||
#include "inject.hpp"
|
||||
#include "zygisk.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "api.hpp"
|
||||
|
||||
@@ -29,6 +29,50 @@ enum {
|
||||
FLAG_MAX
|
||||
};
|
||||
|
||||
struct AppSpecializeArgsImpl {
|
||||
jint &uid;
|
||||
jint &gid;
|
||||
jintArray &gids;
|
||||
jint &runtime_flags;
|
||||
jint &mount_external;
|
||||
jstring &se_info;
|
||||
jstring &nice_name;
|
||||
jstring &instruction_set;
|
||||
jstring &app_data_dir;
|
||||
|
||||
/* Optional */
|
||||
jboolean *is_child_zygote = nullptr;
|
||||
jboolean *is_top_app = nullptr;
|
||||
jobjectArray *pkg_data_info_list = nullptr;
|
||||
jobjectArray *whitelisted_data_info_list = nullptr;
|
||||
jboolean *mount_data_dirs = nullptr;
|
||||
jboolean *mount_storage_dirs = nullptr;
|
||||
|
||||
AppSpecializeArgsImpl(
|
||||
jint &uid, jint &gid, jintArray &gids, jint &runtime_flags,
|
||||
jint &mount_external, jstring &se_info, jstring &nice_name,
|
||||
jstring &instruction_set, jstring &app_data_dir) :
|
||||
uid(uid), gid(gid), gids(gids), runtime_flags(runtime_flags),
|
||||
mount_external(mount_external), se_info(se_info), nice_name(nice_name),
|
||||
instruction_set(instruction_set), app_data_dir(app_data_dir) {}
|
||||
};
|
||||
|
||||
struct ServerSpecializeArgsImpl {
|
||||
jint &uid;
|
||||
jint &gid;
|
||||
jintArray &gids;
|
||||
jint &runtime_flags;
|
||||
jlong &permitted_capabilities;
|
||||
jlong &effective_capabilities;
|
||||
|
||||
ServerSpecializeArgsImpl(
|
||||
jint &uid, jint &gid, jintArray &gids, jint &runtime_flags,
|
||||
jlong &permitted_capabilities, jlong &effective_capabilities) :
|
||||
uid(uid), gid(gid), gids(gids), runtime_flags(runtime_flags),
|
||||
permitted_capabilities(permitted_capabilities),
|
||||
effective_capabilities(effective_capabilities) {}
|
||||
};
|
||||
|
||||
#define DCL_PRE_POST(name) \
|
||||
void name##_pre(); \
|
||||
void name##_post();
|
||||
@@ -36,8 +80,8 @@ void name##_post();
|
||||
struct HookContext {
|
||||
JNIEnv *env;
|
||||
union {
|
||||
SpecializeAppProcessArgs *args;
|
||||
ForkSystemServerArgs *server_args;
|
||||
AppSpecializeArgsImpl *args;
|
||||
ServerSpecializeArgsImpl *server_args;
|
||||
void *raw_args;
|
||||
};
|
||||
const char *process;
|
||||
|
||||
Reference in New Issue
Block a user