[core] No more PIE

This commit is contained in:
LoveSy 2021-04-06 14:32:36 +08:00 committed by LoveSy
parent 0109da15d8
commit 8ed46a0c18
4 changed files with 7 additions and 20 deletions

View File

@ -97,8 +97,8 @@ android {
"-fno-rtti", "-fno-exceptions",
"-fno-stack-protector",
"-fomit-frame-pointer",
"-fpie", "-fPIC",
"-Wno-builtin-macro-redefined",
"-Wl,--exclude-libs,ALL",
"-D__FILE__=__FILE_NAME__",
"-DRIRU_MODULE",
"-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion",
@ -298,26 +298,22 @@ afterEvaluate {
)
}
copy {
include("lspd")
rename("lspd", "liblspd.so")
include("liblspd.so")
from("$libPathRelease/armeabi-v7a")
into("$zipPathMagiskReleasePath/riru/lib")
}
copy {
include("lspd")
rename("lspd", "liblspd.so")
include("liblspd.so")
from("$libPathRelease/arm64-v8a")
into("$zipPathMagiskReleasePath/riru/lib64")
}
copy {
include("lspd")
rename("lspd", "liblspd.so")
include("liblspd.so")
from("$libPathRelease/x86")
into("$zipPathMagiskReleasePath/riru_x86/lib")
}
copy {
include("lspd")
rename("lspd", "liblspd.so")
include("liblspd.so")
from("$libPathRelease/x86_64")
into("$zipPathMagiskReleasePath/riru_x86/lib64")
}

View File

@ -1,3 +0,0 @@
{
init;
};

View File

@ -26,14 +26,11 @@ aux_source_directory(src SRC_LIST)
aux_source_directory(src/jni SRC_JNI_LIST)
include_directories(include src)
add_executable(lspd ${SRC_LIST} ${SRC_JNI_LIST} ${CMAKE_CURRENT_BINARY_DIR}/src/config.cpp)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamic-list=${CMAKE_SOURCE_DIR}/dynamic_list")
add_library(lspd SHARED ${SRC_LIST} ${SRC_JNI_LIST} ${CMAKE_CURRENT_BINARY_DIR}/src/config.cpp)
find_package(riru REQUIRED CONFIG)
find_library(log-lib log)
target_link_libraries(lspd yahfa riru::riru android dobby dex_builder libcxx ${log-lib})
add_custom_command(TARGET lspd POST_BUILD
COMMAND ${CMAKE_STRIP} --remove-section=.preinit_array --remove-section=.comment
-g "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lspd")
COMMAND ${CMAKE_STRIP} --remove-section=.comment -g "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/liblspd.so")

View File

@ -126,6 +126,3 @@ RIRU_EXPORT RiruVersionedModuleInfo *init(Riru *riru) {
lspd::allowUnload = riru->allowUnload;
return &lspd::module;
}
int main() {
}