talsec / Free-RASP-Android

Library for improving app security and threat monitoring on Android mobile devices.
https://github.com/talsec/Free-RASP-Community
MIT License
150 stars 12 forks source link

java.lang.UnsatisfiedLinkError dlopen failed: library "libsecurity.so" not found #40

Closed YMonnier closed 1 month ago

YMonnier commented 2 months ago

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:



**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 ?
xprikryl2 commented 2 months ago

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