diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 59196523..2757ce4b 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -95,11 +95,14 @@ android { "-ffixed-x18", "-Qunused-arguments", "-fno-rtti", "-fno-exceptions", + "-fno-stack-protector", "-fomit-frame-pointer", "-fpie", "-fPIC", + "-Wno-builtin-macro-redefined", "-DRIRU_MODULE", "-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion", "-DRIRU_MODULE_VERSION=$verCode", + "-D__FILE__=__FILE_NAME__", """-DRIRU_MODULE_VERSION_NAME=\"$verName\"""", """-DMODULE_NAME=\"$riruModuleId\"""" ) @@ -148,7 +151,8 @@ android { "-fdata-sections", "-Wl,--gc-sections", "-Wl,--strip-all", - "-fno-unwind-tables" + "-fno-unwind-tables", + "-fno-asynchronous-unwind-tables" ) cppFlags.addAll(flags) cFlags.addAll(flags) diff --git a/core/src/main/cpp/main/CMakeLists.txt b/core/src/main/cpp/main/CMakeLists.txt index c204d92b..a9086a6f 100644 --- a/core/src/main/cpp/main/CMakeLists.txt +++ b/core/src/main/cpp/main/CMakeLists.txt @@ -25,8 +25,11 @@ aux_source_directory(src/jni SRC_JNI_LIST) include_directories(include src) add_executable(lspd ${SRC_LIST} ${SRC_JNI_LIST}) -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamic-list=${CMAKE_SOURCE_DIR}/dynamic_list") +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamic-list=${CMAKE_SOURCE_DIR}/dynamic_list") 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 "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lspd")