TP-33179 | Load navi-lib using SplitInstallHelper
This commit is contained in:
@@ -46,6 +46,8 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation libs.android.play.core.ktx
|
||||
|
||||
implementation libs.androidx.room.ktx
|
||||
implementation libs.androidx.room.runtime
|
||||
implementation libs.androidx.security.crypto.ktx
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package com.navi.base.security.interceptor
|
||||
|
||||
import android.content.Context
|
||||
import com.google.android.play.core.splitinstall.SplitInstallHelper
|
||||
import com.navi.base.network.util.ApiConstants.API_CODE_ERROR
|
||||
import com.navi.base.security.AlgorithmKeyEnum
|
||||
import com.navi.base.security.AppKeyHelper
|
||||
@@ -29,7 +30,17 @@ import okio.Buffer
|
||||
class EncryptionHashInterceptor(private val context: Context) : Interceptor {
|
||||
|
||||
init {
|
||||
System.loadLibrary("navi-lib")
|
||||
val naviNativeLibraryName = "navi-lib"
|
||||
|
||||
try {
|
||||
System.loadLibrary(naviNativeLibraryName)
|
||||
} catch (_: Exception) {
|
||||
try {
|
||||
SplitInstallHelper.loadLibrary(context, naviNativeLibraryName)
|
||||
} catch (_: Exception) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
|
||||
Reference in New Issue
Block a user