Migrate magiskinit selinux.cpp to Rust

This commit is contained in:
topjohnwu
2025-04-08 02:33:52 -07:00
committed by John Wu
parent 83e66767ff
commit d4a0286e13
10 changed files with 361 additions and 260 deletions
+20
View File
@@ -11,10 +11,30 @@
#include <base.hpp>
#include <stream.hpp>
#include <sepolicy.hpp>
#include "init-rs.hpp"
int magisk_proxy_main(int, char *argv[]);
rust::Utf8CStr backup_init();
// Expose some constants to Rust
static inline rust::Utf8CStr split_plat_cil() {
return SPLIT_PLAT_CIL;
};
static inline rust::Utf8CStr preload_lib() {
return PRELOAD_LIB;
}
static inline rust::Utf8CStr preload_policy() {
return PRELOAD_POLICY;
}
static inline rust::Utf8CStr preload_ack() {
return PRELOAD_ACK;
}
#endif