Skip to content

Commit 1af8410

Browse files
committed
Renamed crypto and ssl libraries + Bump JNI versions
1 parent eb61c8f commit 1af8410

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

‎app/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ android {
158158
Config.SUPPORTED_ABI.forEach { abi ->
159159
jniLibs.pickFirsts.let { set ->
160160
set.add("lib/$abi/libc++_shared.so")
161-
set.add("tdlib/openssl/$abi/lib/libcrypto.so")
162-
set.add("tdlib/openssl/$abi/lib/libssl.so")
161+
set.add("tdlib/openssl/$abi/lib/libcryptox.so")
162+
set.add("tdlib/openssl/$abi/lib/libsslx.so")
163163
set.add("tdlib/src/main/libs/$abi/libtdjni.so")
164164
}
165165
}

‎app/jni/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ADD_LINKER_FLAGS}"
105105

106106
add_library(crypto SHARED IMPORTED)
107107
set_target_properties(crypto PROPERTIES IMPORTED_LOCATION
108-
${TDLIB_DIR}/openssl/${ANDROID_ABI}/lib/libcrypto.so
108+
${TDLIB_DIR}/openssl/${ANDROID_ABI}/lib/libcryptox.so
109109
)
110110
add_library(ssl SHARED IMPORTED)
111111
set_target_properties(ssl PROPERTIES IMPORTED_LOCATION
112-
${TDLIB_DIR}/openssl/${ANDROID_ABI}/lib/libssl.so
112+
${TDLIB_DIR}/openssl/${ANDROID_ABI}/lib/libsslx.so
113113
)
114114
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.11.0")
115115
target_include_directories(crypto INTERFACE
@@ -124,6 +124,7 @@ add_library(tdjni SHARED IMPORTED)
124124
set_target_properties(tdjni PROPERTIES IMPORTED_LOCATION
125125
${TDLIB_DIR}/src/main/libs/${ANDROID_ABI}/libtdjni.so
126126
)
127+
target_link_libraries(tdjni INTERFACE ssl crypto)
127128

128129
# flac
129130
include("${CMAKE_HOME_DIRECTORY}/BuildFlac.cmake")

‎app/src/main/java/org/thunderdog/challegram/unsorted/NLoader.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ public static synchronized boolean loadLibrary () {
6868
try {
6969
ReLinkerInstance reLinker = ReLinker.recursively().log(NLoader.instance());
7070
loadLibraryImpl(reLinker, "c++_shared", BuildConfig.NDK_VERSION);
71-
loadLibraryImpl(reLinker, "crypto", BuildConfig.OPENSSL_VERSION);
72-
loadLibraryImpl(reLinker, "ssl", BuildConfig.OPENSSL_VERSION);
71+
loadLibraryImpl(reLinker, "cryptox", BuildConfig.OPENSSL_VERSION);
72+
loadLibraryImpl(reLinker, "sslx", BuildConfig.OPENSSL_VERSION);
7373
loadLibraryImpl(reLinker, "tdjni", BuildConfig.TDLIB_VERSION);
7474
loadLibraryImpl(reLinker, "leveldbjni", BuildConfig.LEVELDB_VERSION);
75-
loadLibraryImpl(reLinker, "tgcallsjni", "1.0.0" /*FIXME*/);
75+
loadLibraryImpl(reLinker, "tgcallsjni", BuildConfig.JNI_VERSION /*TODO: separate variable?*/);
7676
loadLibraryImpl(reLinker, "tgxjni", BuildConfig.JNI_VERSION);
7777
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
7878
OpusLibrary.setLibraries(C.CRYPTO_TYPE_UNSUPPORTED);

‎buildSrc/src/main/kotlin/me/vkryl/plugin/ModulePlugin.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ open class ModulePlugin : Plugin<Project> {
172172
}
173173

174174
var openSslVersion: String = ""
175+
var openSslVersionFull: String = ""
175176
val openSslVersionFile = File(project.rootDir.absoluteFile, "tdlib/source/openssl/include/openssl/opensslv.h")
176177
openSslVersionFile.bufferedReader().use { reader ->
177178
val regex = Regex("^#\\s*define OPENSSL_VERSION_NUMBER\\s*((?:0x)[0-9a-fAF]+)L?\$")
@@ -194,7 +195,8 @@ open class ModulePlugin : Plugin<Project> {
194195
if (status != 0xf) {
195196
error("Using non-stable OpenSSL version: $rawVersion (status = ${status.toString(16)})")
196197
}
197-
openSslVersion = "${major}.${minor}.${fix}${('a'.code - 1 + patch).toChar()}"
198+
openSslVersion = "${major}.${minor}"
199+
openSslVersionFull = "${major}.${minor}.${fix}${('a'.code - 1 + patch).toChar()}"
198200
break
199201
}
200202
}
@@ -278,6 +280,7 @@ open class ModulePlugin : Plugin<Project> {
278280
buildConfigString("DOWNLOAD_URL", appDownloadUrl)
279281

280282
buildConfigString("OPENSSL_VERSION", openSslVersion)
283+
buildConfigString("OPENSSL_VERSION_FULL", openSslVersionFull)
281284
buildConfigString("TDLIB_VERSION", tdlibVersion)
282285

283286
buildConfigString("REMOTE_URL", remoteUrl)

‎version.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version.major=0
44
# Anchor date point in app versioning
55
version.creation=873642600564
66
# Native bundle (/app/jni)
7-
version.jni=224.0.0
7+
version.jni=224.0.1
88
# LevelDB (/vkryl/leveldb)
99
version.leveldb=5.0.0
1010
# Emoji (/app/src/main/assets/emoji)

0 commit comments

Comments
 (0)