java.lang.UnsatisfiedLinkError dlopen failed: library "libsecurity.so" not found
Describe the bug Since integrating the freeRASP 9.6.0-NO_DB library, we have encountered several crashes associated with the native library not initializing freeRASP properly:
- dlopen failed: library "libsecurity.so" not found
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "libsecurity.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
at java.lang.Runtime.loadLibrary0(Runtime.java:998)
at java.lang.System.loadLibrary(System.java:1657)
at com.aheaditec.talsec.security.j2.<clinit>(SourceFile:1)
at com.aheaditec.talsec.security.i2.<init>(SourceFile:6)
at com.aheaditec.talsec.security.i2.a(i2.java:4)
at com.aheaditec.talsec_security.security.api.Talsec.start(Talsec.java:4)
at com.myapp.lib.security.presentation.SecurityDetectionHelper.initSecurityDetection(SecurityDetectionHelper.java:157)
at com.myapp.lib.main.presentation.MainActivity.onCreate(SourceFile:157)
at android.app.Activity.performCreate(Activity.java:8419)
at android.app.Activity.performCreate(Activity.java:8391)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1343)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4285)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4517)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:111)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2692)
at android.os.Handler.dispatchMessage(Handler.java:109)
at android.os.Looper.loopOnce(Looper.java:206)
at android.os.Looper.loop(Looper.java:296)
at android.app.ActivityThread.main(ActivityThread.java:9024)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:976)
- Fatal Exception: java.lang.UnsatisfiedLinkError dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.myapp--ne9fyBui933CEnery3gcg==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp--ne9fyBui933CEnery3gcg==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libsecurity.so"
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.myapp--ne9fyBui933CEnery3gcg==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp--ne9fyBui933CEnery3gcg==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libsecurity.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at com.aheaditec.talsec.security.j2.<clinit>(SourceFile:1)
at com.aheaditec.talsec.security.i2.<init>(SourceFile:6)
at com.aheaditec.talsec.security.i2.a(i2.java:4)
at com.aheaditec.talsec_security.security.api.Talsec.start(Talsec.java:4)
at com.myapp.lib.security.presentation.SecurityDetectionHelper.initSecurityDetection(SecurityDetectionHelper.java:157)
at com.myapp.lib.main.presentation.MainActivity.onCreate(SourceFile:157)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Screenshots If applicable, add screenshots to help explain your problem.
Please complete the following information:
- Device:
- Google Nexus 5X - Android 8.1.0
- Honor JLH-AN00 - Android 12
- Version of freeRASP:
9.6.0-NO_DB
Additional context Is the workaround still relevant https://github.com/talsec/Free-RASP-Android/issues/18 ?
Hello @YMonnier,
We've done some research regarding similar issues in the past, and we've concluded that this error is caused by the Android architecture design. Google Play nowadays works with the Android App Bundles (AAB), a specific format that includes all your app's compiled code and resources. When someone downloads the app from the Google Play Store, only device-specific code and resources are downloaded.
If an app is downloaded from the Google Play Store on one device and then extracted and transferred to another device with a different ABI, the missing platform-specific resources and libraries may cause crashes. The same issue may be present in some alternative stores, which usually use automatic scraping tools to download apps from the Google Play Store (mirror stores).
In your stack trace, the app is trying to load libsecurity.so file and it's looking into the x86 directory, so this stacktrace is related to some emulator. Some emulators may not come with the Google services and Google Play Store, and the APK downloaded from another source may not contain platform-specific resources for a given device.
If you are not seeing a large number of these issues, it may not be something that requires immediate action. If you have any additional questions, please let us know.
Best regards, Ondřej from Talsec
Hi Talsec team,
We are facing this issue in the production environment Please check this on priority basis
Attached is the Firebase recorded log
Device:
-
OS version: Android 13 Model:OnePlus 11R 5G
-
OS version: Android 14 Model: Realme C53
Version of freeRASP: TalsecSecurity-Community:13.2.0
@xprikryl2