Closed grote closed 11 months ago
This exception is thrown when the library isn't found in the native lib dir and we can't extract it ourselves because SDK_INT >= 29
.
If I remember right, the fallback of extracting the library ourselves was copied from Chromium without ever knowing what circumstances would cause the library to be missing from the native lib dir.
I can't see anything special about the phones that would give us a clue - for example they're a mixture of API levels.
By any chance, is the path logged for the FileNotFoundException? Maybe that would give us a clue.
Unfortunately, Google Play crash reports don't give us exception messages nor log lines.
Ok, so I tried this with a test phone and the google play AAB download and get the same crash. The path there is:
java.io.FileNotFoundException: /data/app/~~CTpaghYtQJOw73fD_uSJEA==/org.onionshare.android-hlQUGSC6tIN-pdXvOMKZyg==/lib/arm64/libtor.so
at org.briarproject.onionwrapper.AndroidTorWrapper.installExecutable(AndroidTorWrapper.java:247)
at org.briarproject.onionwrapper.AndroidTorWrapper.installTorExecutable(AndroidTorWrapper.java:15)
at org.briarproject.onionwrapper.AbstractTorWrapper.start(AbstractTorWrapper.java:91)
at org.onionshare.android.tor.TorManager$start$2.invokeSuspend(TorManager.kt:104)
at org.onionshare.android.tor.TorManager$start$2.invoke(TorManager.kt:2)
at org.onionshare.android.tor.TorManager$start$2.invoke(TorManager.kt:1)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:5)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:72)
at org.onionshare.android.tor.TorManager.start(TorManager.kt:9)
at org.onionshare.android.ShareManager$startSharing$2$1$torTask$1.invokeSuspend(ShareManager.kt:33)
I am afraid that this is an app bundle issue maybe affecting all users of the official release.
Yikes. Can we revert to APK releases until we solve it?
You can choose to revert to the original APK behaviour, and this can be done by adding the flag
android.bundle.enableUncompressedNativeLibs=false
in your gradle.properties file.
I downloaded the AAB from Google Play and there's a libtor.so
in /base/lib/arm64-v8a/
.
If the native libraries are loaded by a third party library you're depending on, consider filing a bug for them to address this issue so they follow the same logic as the platform.
;)
So should we call System.loadLibrary
in Onionwrapper?
We don't want to load the executable as a library, so let's try the enableUncompressedNativeLibs
approach.
Feel free to file a bug against OnionWrapper, although I suggest we don't fix it before arti. ;-)
Looks like the gradle property is deprecated and now we need to do:
android {
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
Trying a release with this now.
Feel free to file a bug against OnionWrapper, although I suggest we don't fix it before arti. ;-)
Should we add least add this to the README?
It appears that you can't really test this before Google hasn't published the release. While I can download a signed universal APK, this one doesn't exhibit the problem found in production. The AAB itself can't get installed. The individual APK splits that Google is installing in production can't be downloaded. At least, I didn't find where.
Ok Google is fast these days. This fixed the issue.
So far 4 users affected on Android 12 and 13.