Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Use self-compiled libcxx (https://github.com/topjohnwu/libcxx)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaW committed Mar 29, 2021
1 parent 60d951e commit bc5a32b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions riru/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ android {
arguments "-DRIRU_VERSION_NAME:STRING=$versionNameShort",
"-DRIRU_VERSION_CODE:STRING=$versionCode",
"-DRIRU_API_VERSION=$apiVersion",
"-DRIRU_MIN_API_VERSION=$minApiVersion"
"-DRIRU_MIN_API_VERSION=$minApiVersion",
"-DANDROID_STL=none"
}
}
multiDexEnabled false
Expand Down Expand Up @@ -65,12 +66,13 @@ android {
}

repositories {
maven { url 'https://dl.bintray.com/rikkaw/Libraries' }
mavenLocal()
}

dependencies {
implementation 'dev.rikka.ndk.thirdparty:xhook:1.2.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'dev.rikka.ndk.thirdparty:cxx:1.1.0'
implementation 'androidx.annotation:annotation:1.2.0'
compileOnly project(':stub')
}

Expand All @@ -93,7 +95,7 @@ android.applicationVariants.all { variant ->

def is_windows = OperatingSystem.current().isWindows()

task ("zip${variantCapped}", type: Zip) {
task("zip${variantCapped}", type: Zip) {
dependsOn("assemble${variantCapped}")
from magiskDir
archiveName zipName
Expand Down Expand Up @@ -158,7 +160,7 @@ android.applicationVariants.all { variant ->
task.finalizedBy("zip${variantCapped}")
}

task ("push${variantCapped}", type: Exec) {
task("push${variantCapped}", type: Exec) {
dependsOn("assemble${variantCapped}")
workingDir outDir
def commands = [android.adbExecutable, "push",
Expand Down
12 changes: 7 additions & 5 deletions riru/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")

find_package(xhook REQUIRED CONFIG)
find_package(cxx REQUIRED CONFIG)

include_directories(include)
include_directories(include_riru)
Expand All @@ -54,11 +55,12 @@ add_library(utils STATIC
util/pmparser.c
util/selinux.cpp
util/socket.cpp
util/tinynew.cpp
#util/tinynew.cpp
util/plt.c
util/elf_util.cpp
util/dl.cpp
util/rirud.cpp)
target_link_libraries(utils cxx::cxx)

add_library(riru SHARED
entry.cpp
Expand All @@ -68,24 +70,24 @@ add_library(riru SHARED
magisk.cpp
daemon/daemon_utils.cpp)
target_include_directories(riru PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(riru log utils xhook::xhook)
target_link_libraries(riru log utils xhook::xhook cxx::cxx)

add_library(riruhide SHARED hide/hide.cpp)
target_include_directories(riruhide PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(riruhide log utils)
target_link_libraries(riruhide log utils cxx::cxx)

if ("${ANDROID_ABI}" STREQUAL "x86" OR "${ANDROID_ABI}" STREQUAL "x86_64")
add_definitions(-DHAS_NATIVE_BRIDGE)
endif ()

add_library(riruloader SHARED loader/loader.cpp)
target_link_libraries(riruloader log utils)
target_link_libraries(riruloader log utils cxx::cxx)

add_executable(librirud.so
daemon/daemon.cpp
daemon/setproctitle.c
daemon/daemon_utils.cpp)
target_link_libraries(librirud.so log utils)
target_link_libraries(librirud.so log utils cxx::cxx)

if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET riru POST_BUILD
Expand Down

0 comments on commit bc5a32b

Please sign in to comment.