diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 07a037cc..2c6d4fc7 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -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(), diff --git a/core/magisk_module/customize.sh b/core/magisk_module/customize.sh index daa40c56..27d56fec 100644 --- a/core/magisk_module/customize.sh +++ b/core/magisk_module/customize.sh @@ -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" diff --git a/core/magisk_module/sepolicy.rule b/core/magisk_module/sepolicy.rule index f61a0bdf..c7efd94a 100644 --- a/core/magisk_module/sepolicy.rule +++ b/core/magisk_module/sepolicy.rule @@ -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 diff --git a/core/src/main/cpp/main/api/zygisk_main.cpp b/core/src/main/cpp/main/api/zygisk_main.cpp index d1c69d5b..d6091120 100644 --- a/core/src/main/cpp/main/api/zygisk_main.cpp +++ b/core/src/main/cpp/main/api/zygisk_main.cpp @@ -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);