Magisk/native/jni/core/core.hpp

41 lines
980 B
C++
Raw Normal View History

2021-01-11 02:19:10 -08:00
#pragma once
#include <string>
#include <vector>
extern bool RECOVERY_MODE;
extern int DAEMON_STATE;
2022-05-28 22:39:44 -07:00
extern std::atomic<ino_t> pkg_xml_ino;
2021-09-16 05:27:34 -07:00
// Daemon state
enum : int {
STATE_NONE,
STATE_POST_FS_DATA,
STATE_POST_FS_DATA_DONE,
STATE_LATE_START_DONE,
STATE_BOOT_COMPLETE
};
2021-01-11 02:19:10 -08:00
void unlock_blocks();
void reboot();
2021-08-12 03:26:54 -07:00
void start_log_daemon();
2021-01-11 02:19:10 -08:00
void setup_logfile(bool reset);
2021-08-21 03:52:59 -07:00
void magisk_logging();
2022-06-17 16:36:03 -07:00
std::string read_certificate(int fd, int version = -1);
2021-01-11 02:19:10 -08:00
// Module stuffs
void handle_modules();
void magic_mount();
void disable_modules();
void remove_modules();
void exec_module_scripts(const char *stage);
// Scripting
void exec_script(const char *script);
void exec_common_scripts(const char *stage);
2021-10-13 04:52:02 -07:00
void exec_module_scripts(const char *stage, const std::vector<std::string_view> &modules);
2021-01-11 02:19:10 -08:00
void install_apk(const char *apk);
2022-05-20 04:37:37 -07:00
void uninstall_pkg(const char *pkg);
2022-05-24 05:21:36 -07:00
void clear_pkg(const char *pkg, int user_id);
2021-01-11 02:19:10 -08:00
[[noreturn]] void install_module(const char *file);