Skip to content

Commit

Permalink
Use self compiled libcxx
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaW committed Mar 29, 2021
1 parent 5863e5a commit c2d6cc6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
20 changes: 8 additions & 12 deletions manager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
resValue "string", "versionName", "${rootProject.ext.versionName}"
externalNativeBuild {
cmake {
arguments '-DANDROID_STL=c++_static'
arguments '-DANDROID_STL=none'
}
}
}
Expand Down Expand Up @@ -127,12 +127,6 @@ repositories {
includeGroup('com.github.topjohnwu.libsu')
}
}
maven {
url 'https://dl.bintray.com/rikkaw/Libraries'
content {
includeGroupByRegex('rikka.*')
}
}
}

dependencies {
Expand All @@ -153,23 +147,25 @@ dependencies {

implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.fragment:fragment-ktx:1.3.1'
implementation 'androidx.fragment:fragment-ktx:1.3.2'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.preference:preference-ktx:1.1.1'

implementation 'com.github.topjohnwu.libsu:core:3.1.1'

implementation 'dev.rikka.rikkax.appcompat:appcompat:1.2.0-rc01'
implementation 'dev.rikka.rikkax.core:core:1.3.2'
implementation 'dev.rikka.rikkax.material:material:1.6.1'
implementation 'dev.rikka.rikkax.material:material:1.6.4'
implementation 'dev.rikka.rikkax.html:html-ktx:1.1.2'
implementation 'dev.rikka.rikkax.recyclerview:recyclerview-adapter:1.2.0'
implementation 'dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.2.0'
implementation 'dev.rikka.rikkax.widget:borderview:1.0.1'
implementation 'dev.rikka.rikkax.preference:simplemenu-preference:1.0.2'
implementation 'rikka.ndk.thirdparty:boringssl:20200911'

implementation 'io.github.vvb2060.ndk:boringssl:2.1'
implementation 'dev.rikka.ndk.thirdparty:cxx:1.1.0'

implementation 'moe.shizuku.fontprovider:api:10'

Expand Down
11 changes: 7 additions & 4 deletions manager/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
cmake_minimum_required(VERSION 3.4.1)

set(CMAKE_CXX_STANDARD 17)

set(C_FLAGS "-Werror=format -fdata-sections -ffunction-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics")
set(LINKER_FLAGS "-Wl,--hash-style=both")
set(C_FLAGS "-Werror=format")

if (CMAKE_BUILD_TYPE STREQUAL "Release")
message("Builing Release...")

set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-exclude-libs,ALL -Wl,--gc-sections")
set(C_FLAGS "${C_FLAGS} -O2 -fvisibility=hidden -fvisibility-inlines-hidden")
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-exclude-libs,ALL -Wl,--gc-sections")
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Builing Debug...")

Expand All @@ -22,19 +24,20 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")

find_library(log-lib log)
find_package(boringssl REQUIRED CONFIG)
find_package(cxx REQUIRED CONFIG)

add_executable(libshizuku.so
starter.cpp misc.cpp selinux.cpp cgroup.cpp android.cpp)

target_link_libraries(libshizuku.so ${log-lib})
target_link_libraries(libshizuku.so ${log-lib} cxx::cxx)

add_custom_command(TARGET libshizuku.so POST_BUILD
COMMAND ${CMAKE_STRIP} --remove-section=.comment "libshizuku.so")

add_library(adb SHARED
adb_pairing.cpp bypass.cpp misc.cpp pmparser.c)

target_link_libraries(adb ${log-lib} boringssl::crypto)
target_link_libraries(adb ${log-lib} boringssl::crypto_static cxx::cxx)

add_custom_command(TARGET adb POST_BUILD
COMMAND ${CMAKE_STRIP} --remove-section=.comment "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libadb.so")

0 comments on commit c2d6cc6

Please sign in to comment.