Removed the relinker dependency from the project, since now we are loading the .so files on the libkiwix side. Enabled the loadICUData method, since now it is fixed on the libkiwix side. Search and server is now starting successfully, but need some refactoring, for that see next commit.

This commit is contained in:
MohitMaliFtechiz 2023-07-22 16:18:06 +05:30 committed by MohitMali
parent 26ee7fbf1a
commit 7a6447c5da
5 changed files with 12 additions and 21 deletions

View File

@ -100,6 +100,9 @@ play {
dependencies {
androidTestImplementation(Libs.leakcanary_android_instrumentation)
api(fileTree(mapOf("include" to "*.aar", "dir" to "libs")))
implementation("com.getkeepsafe.relinker:relinker:1.4.5")
implementation(files("C:\\Users\\aades\\OneDrive\\Documents/lib-debug.aar"))
}
task("generateVersionCodeAndName") {
val file = File("VERSION_INFO")

View File

@ -344,9 +344,4 @@ object Libs {
* https://developer.android.com/testing
*/
const val junit: String = "androidx.test.ext:junit:" + Versions.junit
/**
* https://github.com/KeepSafe/ReLinker
*/
const val relinker: String = "com.getkeepsafe.relinker:relinker:" + Versions.relinker
}

View File

@ -101,8 +101,6 @@ object Versions {
const val webkit: String = "1.3.0"
const val junit: String = "1.1.4"
const val relinker: String = "1.4.5"
}
/**

View File

@ -60,14 +60,15 @@ dependencies {
implementation(Libs.threetenabp)
// Get kiwixlib online if it is not populated locally
if (!shouldUseLocalVersion()) {
api(Libs.kiwixlib)
} else {
api(fileTree(mapOf("include" to "*.aar", "dir" to "libs")))
}
// if (!shouldUseLocalVersion()) {
// api(Libs.kiwixlib)
// } else {
// api(fileTree(mapOf("include" to "*.aar", "dir" to "libs")))
// }
// Relinker to load libkiwix
implementation(Libs.relinker)
api(fileTree(mapOf("include" to "*.aar", "dir" to "libs")))
implementation("com.getkeepsafe.relinker:relinker:1.4.5")
implementation(files("C:\\Users\\aades\\OneDrive\\Documents/lib-debug.aar"))
// Document File
implementation(Libs.select_folder_document_file)

View File

@ -19,7 +19,6 @@ package org.kiwix.kiwixmobile.core
import android.content.Context
import android.util.Log
import com.getkeepsafe.relinker.ReLinker
import org.kiwix.libkiwix.JNIKiwix
import org.kiwix.kiwixmobile.core.utils.TAG_KIWIX
import java.io.File
@ -28,12 +27,7 @@ import javax.inject.Inject
internal class JNIInitialiser @Inject constructor(context: Context, jniKiwix: JNIKiwix) {
init {
/* Load wrapper's .so files which we have missed to load in libkiwix
More information here https://github.com/kiwix/java-libkiwix/issues/39
*/
ReLinker.loadLibrary(context, "kiwix_wrapper")
ReLinker.loadLibrary(context, "zim_wrapper")
// loadICUData(context)?.let(jniKiwix::setDataDirectory)
loadICUData(context)?.let(jniKiwix::setDataDirectory)
}
private fun loadICUData(context: Context): String? {