talsec / Free-RASP-Flutter

Flutter library for improving app security and threat monitoring on Android and iOS mobile devices.
https://github.com/talsec/Free-RASP-Community
MIT License
194 stars 20 forks source link

libpolarssl.so not found #49

Closed BenjaCristi closed 1 year ago

BenjaCristi commented 1 year ago

Describe the bug When I try to run my app with freerasp 4.0.0 in a android with api 28-30 It crash

To Reproduce Configure a app with freerasp and run in android api 30

Please complete the following information:

Additional context Logs

E/AndroidRuntime( 5054): java.lang.UnsatisfiedLinkError: dlopen failed: library "libpolarssl.so" not found E/AndroidRuntime( 5054): at java.lang.Runtime.loadLibrary0(Runtime.java:1087) E/AndroidRuntime( 5054): at java.lang.Runtime.loadLibrary0(Runtime.java:1008) E/AndroidRuntime( 5054): at java.lang.System.loadLibrary(System.java:1664) E/AndroidRuntime( 5054): at com.aheaditec.talsec.security.z1.(SourceFile:1) E/AndroidRuntime( 5054): at com.aheaditec.talsec.security.y1.(SourceFile:5) E/AndroidRuntime( 5054): at com.aheaditec.talsec.security.y1.a(SourceFile:4) E/AndroidRuntime( 5054): at com.aheaditec.talsec_security.security.api.Talsec.start(SourceFile:1) E/AndroidRuntime( 5054): at com.aheaditec.freerasp.TalsecApp.init(TalsecApp.kt:27) E/AndroidRuntime( 5054): at com.aheaditec.freerasp.MethodCallHandlerImpl.init(MethodCallHandlerImpl.kt:54) E/AndroidRuntime( 5054): at com.aheaditec.freerasp.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:21) E/AndroidRuntime( 5054): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) E/AndroidRuntime( 5054): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/AndroidRuntime( 5054): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/AndroidRuntime( 5054): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/AndroidRuntime( 5054): at android.os.Handler.handleCallback(Handler.java:938) E/AndroidRuntime( 5054): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5054): at android.os.Looper.loop(Looper.java:223) E/AndroidRuntime( 5054): at android.app.ActivityThread.main(ActivityThread.java:7656) E/AndroidRuntime( 5054): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 5054): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/AndroidRuntime( 5054): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

msikyna commented 1 year ago

Hello @BenjaConomy ,

thank you for reporting the issue. We will look at it.

Kind regards, Matúš, Talsec dev

xprikryl2 commented 1 year ago

Hello @BenjaConomy,

This error implies that the native library libpolarssl.so is missing. Android library of the Talsec for Flutter supports three architectures, arm64-v8a, armeabi-v7a, and x86_64. Published artifact contains all necessary native libraries for all three architectures.

image

This issue may be connected to the supported ABIs in your application setting. Could you check that all native libraries are also present in your built APK? You can do so by opening the app (archive) using zip and reviewing the content of the lib folder on the top level, as described in the picture below.

image

Best regards, Ondřej, Talsec dev

BenjaCristi commented 1 year ago

Hi Ondřej,

Thanks for the quick response, with the information you gave us we can solve it in the following way

we add a Filter on ours flavors

ndk { abiFilter 'armeabi-v7a', 'x86_64', 'arm64-v8a' }

and when we split the bundle in release

buildTypes {
    release {
        signingConfig signingConfigs.release        
        minifyEnabled true
        shrinkResources true
        ndk.abiFilters 'armeabi-v7a', 'x86_64', 'arm64-v8a'
    }
}

Finally we update the OS from Android R api 30 x86 to x86_64

Thank u, have a nice day.