From 0f666de5e6ef4fab3f011b1a8ded412755937324 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 22 May 2023 21:36:15 -0700 Subject: [PATCH] Organize headers --- native/src/core/core.hpp | 11 +++-------- native/src/core/lib.rs | 2 +- native/src/core/resetprop/resetprop.cpp | 1 - native/src/core/resetprop/resetprop.hpp | 8 ++++++++ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/native/src/core/core.hpp b/native/src/core/core.hpp index 4fa8be7f4..5ab3fb998 100644 --- a/native/src/core/core.hpp +++ b/native/src/core/core.hpp @@ -2,7 +2,9 @@ #include #include -#include + +#include "core-rs.hpp" +#include "resetprop/resetprop.hpp" extern bool RECOVERY_MODE; extern std::atomic pkg_xml_ino; @@ -27,10 +29,3 @@ void install_apk(const char *apk); void uninstall_pkg(const char *pkg); void clear_pkg(const char *pkg, int user_id); [[noreturn]] void install_module(const char *file); - -// System properties -rust::String get_prop_rs(const char *name, bool persist); -std::string get_prop(const char *name, bool persist = false); -int delete_prop(const char *name, bool persist = false); -int set_prop(const char *name, const char *value, bool skip_svc = false); -void load_prop_file(const char *filename, bool skip_svc = false); diff --git a/native/src/core/lib.rs b/native/src/core/lib.rs index 84eeb26b0..25ff2d486 100644 --- a/native/src/core/lib.rs +++ b/native/src/core/lib.rs @@ -9,7 +9,7 @@ mod logging; #[cxx::bridge] pub mod ffi { extern "C++" { - include!("core.hpp"); + include!("resetprop/resetprop.hpp"); unsafe fn get_prop_rs(name: *const c_char, persist: bool) -> String; } diff --git a/native/src/core/resetprop/resetprop.cpp b/native/src/core/resetprop/resetprop.cpp index bc8c7045b..9685cac4c 100644 --- a/native/src/core/resetprop/resetprop.cpp +++ b/native/src/core/resetprop/resetprop.cpp @@ -5,7 +5,6 @@ #include -#include "../core.hpp" #include "resetprop.hpp" using namespace std; diff --git a/native/src/core/resetprop/resetprop.hpp b/native/src/core/resetprop/resetprop.hpp index 9a78c4b3e..f5c421485 100644 --- a/native/src/core/resetprop/resetprop.hpp +++ b/native/src/core/resetprop/resetprop.hpp @@ -2,6 +2,7 @@ #include #include +#include #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include @@ -21,6 +22,13 @@ private: prop_list &list; }; +// System properties +rust::String get_prop_rs(const char *name, bool persist); +std::string get_prop(const char *name, bool persist = false); +int delete_prop(const char *name, bool persist = false); +int set_prop(const char *name, const char *value, bool skip_svc = false); +void load_prop_file(const char *filename, bool skip_svc = false); + void persist_get_prop(const char *name, prop_cb *prop_cb); void persist_get_props(prop_cb *prop_cb); bool persist_delete_prop(const char *name);