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

Commit bc5a32b

Browse files
committed
Use self-compiled libcxx (https://github.com/topjohnwu/libcxx)
1 parent 60d951e commit bc5a32b

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

riru/build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ android {
3535
arguments "-DRIRU_VERSION_NAME:STRING=$versionNameShort",
3636
"-DRIRU_VERSION_CODE:STRING=$versionCode",
3737
"-DRIRU_API_VERSION=$apiVersion",
38-
"-DRIRU_MIN_API_VERSION=$minApiVersion"
38+
"-DRIRU_MIN_API_VERSION=$minApiVersion",
39+
"-DANDROID_STL=none"
3940
}
4041
}
4142
multiDexEnabled false
@@ -65,12 +66,13 @@ android {
6566
}
6667

6768
repositories {
68-
maven { url 'https://dl.bintray.com/rikkaw/Libraries' }
69+
mavenLocal()
6970
}
7071

7172
dependencies {
7273
implementation 'dev.rikka.ndk.thirdparty:xhook:1.2.0'
73-
implementation 'androidx.annotation:annotation:1.1.0'
74+
implementation 'dev.rikka.ndk.thirdparty:cxx:1.1.0'
75+
implementation 'androidx.annotation:annotation:1.2.0'
7476
compileOnly project(':stub')
7577
}
7678

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

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

96-
task ("zip${variantCapped}", type: Zip) {
98+
task("zip${variantCapped}", type: Zip) {
9799
dependsOn("assemble${variantCapped}")
98100
from magiskDir
99101
archiveName zipName
@@ -158,7 +160,7 @@ android.applicationVariants.all { variant ->
158160
task.finalizedBy("zip${variantCapped}")
159161
}
160162

161-
task ("push${variantCapped}", type: Exec) {
163+
task("push${variantCapped}", type: Exec) {
162164
dependsOn("assemble${variantCapped}")
163165
workingDir outDir
164166
def commands = [android.adbExecutable, "push",

riru/src/main/cpp/CMakeLists.txt

+7-5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
4343
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
4444

4545
find_package(xhook REQUIRED CONFIG)
46+
find_package(cxx REQUIRED CONFIG)
4647

4748
include_directories(include)
4849
include_directories(include_riru)
@@ -54,11 +55,12 @@ add_library(utils STATIC
5455
util/pmparser.c
5556
util/selinux.cpp
5657
util/socket.cpp
57-
util/tinynew.cpp
58+
#util/tinynew.cpp
5859
util/plt.c
5960
util/elf_util.cpp
6061
util/dl.cpp
6162
util/rirud.cpp)
63+
target_link_libraries(utils cxx::cxx)
6264

6365
add_library(riru SHARED
6466
entry.cpp
@@ -68,24 +70,24 @@ add_library(riru SHARED
6870
magisk.cpp
6971
daemon/daemon_utils.cpp)
7072
target_include_directories(riru PRIVATE ${CMAKE_SOURCE_DIR})
71-
target_link_libraries(riru log utils xhook::xhook)
73+
target_link_libraries(riru log utils xhook::xhook cxx::cxx)
7274

7375
add_library(riruhide SHARED hide/hide.cpp)
7476
target_include_directories(riruhide PRIVATE ${CMAKE_SOURCE_DIR})
75-
target_link_libraries(riruhide log utils)
77+
target_link_libraries(riruhide log utils cxx::cxx)
7678

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

8183
add_library(riruloader SHARED loader/loader.cpp)
82-
target_link_libraries(riruloader log utils)
84+
target_link_libraries(riruloader log utils cxx::cxx)
8385

8486
add_executable(librirud.so
8587
daemon/daemon.cpp
8688
daemon/setproctitle.c
8789
daemon/daemon_utils.cpp)
88-
target_link_libraries(librirud.so log utils)
90+
target_link_libraries(librirud.so log utils cxx::cxx)
8991

9092
if (CMAKE_BUILD_TYPE STREQUAL "Release")
9193
add_custom_command(TARGET riru POST_BUILD

0 commit comments

Comments
 (0)