diff --git a/native/src/Android.mk b/native/src/Android.mk index c3ee3866a..a954a5ce3 100644 --- a/native/src/Android.mk +++ b/native/src/Android.mk @@ -30,8 +30,8 @@ LOCAL_SRC_FILES := \ core/restorecon.cpp \ core/module.cpp \ core/thread.cpp \ - resetprop/persist.cpp \ - resetprop/resetprop.cpp \ + core/resetprop/persist.cpp \ + core/resetprop/resetprop.cpp \ su/su.cpp \ su/connect.cpp \ su/pts.cpp \ @@ -149,8 +149,8 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_SRC_FILES := \ core/applet_stub.cpp \ - resetprop/resetprop.cpp \ - resetprop/persist.cpp \ + core/resetprop/resetprop.cpp \ + core/resetprop/persist.cpp LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=resetprop_main include $(BUILD_EXECUTABLE) diff --git a/native/src/core/bootstages.cpp b/native/src/core/bootstages.cpp index d9e5554fb..d8bda11f0 100644 --- a/native/src/core/bootstages.cpp +++ b/native/src/core/bootstages.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include "core.hpp" diff --git a/native/src/core/core.hpp b/native/src/core/core.hpp index c90e3c07b..d1f0b530f 100644 --- a/native/src/core/core.hpp +++ b/native/src/core/core.hpp @@ -26,3 +26,9 @@ 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 +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/daemon.cpp b/native/src/core/daemon.cpp index 0a2fa0e9e..6dc38f4ff 100644 --- a/native/src/core/daemon.cpp +++ b/native/src/core/daemon.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/native/src/core/module.cpp b/native/src/core/module.cpp index aab25d854..2e2e91b59 100644 --- a/native/src/core/module.cpp +++ b/native/src/core/module.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include "core.hpp" #include "node.hpp" diff --git a/native/src/resetprop/persist.cpp b/native/src/core/resetprop/persist.cpp similarity index 99% rename from native/src/resetprop/persist.cpp rename to native/src/core/resetprop/persist.cpp index 5a1ee9fce..423e63ee4 100644 --- a/native/src/resetprop/persist.cpp +++ b/native/src/core/resetprop/persist.cpp @@ -4,7 +4,7 @@ #include -#include "prop.hpp" +#include "resetprop.hpp" using namespace std; diff --git a/native/src/resetprop/resetprop.cpp b/native/src/core/resetprop/resetprop.cpp similarity index 98% rename from native/src/resetprop/resetprop.cpp rename to native/src/core/resetprop/resetprop.cpp index 15ee36063..352b725d8 100644 --- a/native/src/resetprop/resetprop.cpp +++ b/native/src/core/resetprop/resetprop.cpp @@ -3,10 +3,10 @@ #include #include -#include #include -#include "prop.hpp" +#include "../core.hpp" +#include "resetprop.hpp" using namespace std; @@ -333,9 +333,9 @@ int resetprop_main(int argc, char *argv[]) { } } -/******************* - * High-level APIs - ********************/ +/*************** + * Public APIs + ****************/ string get_prop(const char *name, bool persist) { InitOnce(); diff --git a/native/src/resetprop/prop.hpp b/native/src/core/resetprop/resetprop.hpp similarity index 100% rename from native/src/resetprop/prop.hpp rename to native/src/core/resetprop/resetprop.hpp diff --git a/native/src/include/resetprop.hpp b/native/src/include/resetprop.hpp deleted file mode 100644 index b17dde57f..000000000 --- a/native/src/include/resetprop.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include -#include - -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);