[core] No sepolicy is required for Zygisk flavor (#1303)

This commit is contained in:
LoveSy 2021-10-17 20:46:47 +08:00 committed by GitHub
parent b52f3a58eb
commit c166163885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 13 deletions

View File

@ -261,7 +261,7 @@ androidComponents.onVariants { v ->
into(magiskDir)
from("${rootProject.projectDir}/README.md")
from("$projectDir/magisk_module") {
exclude("riru.sh", "module.prop", "customize.sh")
exclude("riru.sh", "module.prop", "customize.sh", "sepolicy.rule")
}
from("$projectDir/magisk_module") {
include("module.prop")
@ -287,7 +287,7 @@ androidComponents.onVariants { v ->
}
if (flavorLowered == "riru") {
from("${projectDir}/magisk_module") {
include("riru.sh")
include("riru.sh", "sepolicy.rule")
val tokens = mapOf(
"RIRU_MODULE_LIB_NAME" to "lspd",
"RIRU_MODULE_API_VERSION" to moduleMaxRiruApiVersion.toString(),

View File

@ -80,7 +80,6 @@ ui_print "- Extracting module files"
extract "$ZIPFILE" 'module.prop' "$MODPATH"
extract "$ZIPFILE" 'system.prop' "$MODPATH"
extract "$ZIPFILE" 'sepolicy.rule' "$MODPATH"
extract "$ZIPFILE" 'post-fs-data.sh' "$MODPATH"
extract "$ZIPFILE" 'service.sh' "$MODPATH"
extract "$ZIPFILE" 'uninstall.sh' "$MODPATH"
@ -110,6 +109,7 @@ if [ "$FLAVOR" == "zygisk" ]; then
extract "$ZIPFILE" "lib/x86/liblspd.so" "$MODPATH/zygisk" true
mv "$MODPATH/zygisk/liblspd.so" "$MODPATH/zygisk/x86.so"
elif [ "$FLAVOR" == "riru" ]; then
extract "$ZIPFILE" 'sepolicy.rule' "$MODPATH"
mkdir "$MODPATH/riru"
mkdir "$MODPATH/riru/lib"
mkdir "$MODPATH/riru/lib64"

View File

@ -1,4 +1 @@
allow system_server system_server process execmem
# Used to load dex and should be removed after companion is ready
allow zygote adb_data_file dir search

View File

@ -175,11 +175,6 @@ namespace lspd {
env_ = env;
Context::GetInstance()->Init();
// === workaround without companion ===
using namespace std::string_literals;
Context::GetInstance()->PreLoadDex("/data/adb/modules/"s + moduleName + "/framework/lspd.dex");
// === end workaround ===
auto companion = api->connectCompanion();
if (companion == -1) {
LOGE("Failed to connect to companion");
@ -216,8 +211,6 @@ namespace lspd {
}
};
#define quote(s) #s
bool InitCompanion() {
LOGD("onModuleLoaded: welcome to LSPosed!");
LOGD("onModuleLoaded: version v%s (%d)", versionName, versionCode);