Magisk/native/src/core/core.hpp

32 lines
817 B
C++
Raw Normal View History

2021-01-11 10:19:10 +00:00
#pragma once
#include <string>
#include <vector>
2023-05-23 04:36:15 +00:00
#include "core-rs.hpp"
#include "resetprop/resetprop.hpp"
2021-01-11 10:19:10 +00:00
extern bool RECOVERY_MODE;
2022-05-29 05:39:44 +00:00
extern std::atomic<ino_t> pkg_xml_ino;
2021-09-16 12:27:34 +00:00
2023-03-16 13:37:29 +00:00
std::string find_preinit_device();
2021-01-11 10:19:10 +00:00
void unlock_blocks();
void reboot();
2022-06-17 23:36:03 +00:00
std::string read_certificate(int fd, int version = -1);
2021-01-11 10:19:10 +00:00
// Module stuffs
void handle_modules();
void load_modules();
2021-01-11 10:19:10 +00:00
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 11:52:02 +00:00
void exec_module_scripts(const char *stage, const std::vector<std::string_view> &modules);
2021-01-11 10:19:10 +00:00
void install_apk(const char *apk);
2022-05-20 11:37:37 +00:00
void uninstall_pkg(const char *pkg);
2022-05-24 12:21:36 +00:00
void clear_pkg(const char *pkg, int user_id);
2021-01-11 10:19:10 +00:00
[[noreturn]] void install_module(const char *file);