Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5.0 Crash: SystemSoLoader.loadLibrary; java.lang.UnsatisfiedLinkError - dlopen failed: library "libargon2jni.so" not found #25

Open
NickMelnykIronvest opened this issue Sep 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@NickMelnykIronvest
Copy link

NickMelnykIronvest commented Sep 12, 2024

SystemSoLoader.loadLibrary
java.lang.UnsatisfiedLinkError - dlopen failed: library "libargon2jni.so" not found
com.lambdapioneer.argon2kt
SoLoader.kt:13

v 1.5.0

Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.hidden-HIDDEN==/base.apk"],nativeLibraryDirectories=[/data/app/com.hidden-HIDDEN==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]]] couldn't find "libargon2jni.so"
       at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
       at java.lang.System.loadLibrary(System.java:1660)
       at com.lambdapioneer.argon2kt.SystemSoLoader.loadLibrary(SoLoader.kt:13)
       at com.lambdapioneer.argon2kt.Argon2Jni.<init>(Argon2Jni.kt:15)
       at com.lambdapioneer.argon2kt.Argon2Kt.<init>(Argon2Kt.kt:61)
       at com.lambdapioneer.argon2kt.Argon2Kt.<init>(Argon2Kt.kt:60)

second variant:

Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "libargon2jni.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:1656)
       at com.lambdapioneer.argon2kt.SystemSoLoader.loadLibrary(SoLoader.kt:13)
       at com.lambdapioneer.argon2kt.Argon2Jni.<init>(Argon2Jni.kt:15)
       at com.lambdapioneer.argon2kt.Argon2Kt.<init>(Argon2Kt.kt:61)
       at com.lambdapioneer.argon2kt.Argon2Kt.<init>(Argon2Kt.kt:60)

Devices:
86% Transsion - Unisoc
14% Huawei

Operating systems:
86% Android 12
14% Android 8

P.S. have not tried newer version 1.6.0. Thus I am not sure whether it is applicable to versions above 1.5.0.

@lambdapioneer
Copy link
Owner

lambdapioneer commented Sep 12, 2024

Hey, thanks for raising the issue.

The underlying reason is likely that the system's SoLoader on those devices is behaving a bit weirdly. That's a known issue with native libraries on Android with some devices (often from smaller brands). There should be no difference between version 1.6.0 and 1.5.0 of Argon2Kt.

The Argon2Kt() method allows providing a custom SoLoader for exactly this reason: Argon2Kt(soLoader: SoLoaderShim). Using the SoLoader from Facebook (also used by React Native) is a good choice: https://github.com/facebook/SoLoader/tree/main

On your part, you'd need to include that dependency and then implement com.lambdapioneer.argon2kt.SoLoaderShim (just one method) for the com.facebook.soloader.SoLoader. You probably just create a new class FacebookSoLoaderShim. Then you initialize that new object and pass it into the Argon2Kt constructor.

Let me know if you get stuck or like some more specific sample code.

@lambdapioneer lambdapioneer self-assigned this Sep 12, 2024
@lambdapioneer lambdapioneer added the bug Something isn't working label Sep 20, 2024
@lambdapioneer
Copy link
Owner

HI @NickMelnykIronvest, just wanted to quickly check if you had a chance to test the mitigation and whether it had any effect. If you have questions, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants