Android: use the correct ABI folder to load uncompressed libs

It's possible that the first ABI from Build.SUPPORTED_ABIS would return
an ABI that's not packaged in the APK, for example if an armeabi-v7a APK
is run under the device supporting arm64-v8a, in that case the returned
path would be that of an arm64-v8a while it's not actually packaged
inside the APK.

Fixes: QTBUG-132155
Change-Id: I0f311accee246fa2d1d0b8aaf424d034b4b2d04c
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit a5f80b4732d33dd36414a6ffbd49a9efc7c87a0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Assam Boudjelthia 2025-01-13 16:38:59 +02:00 committed by Qt Cherry-pick Bot
parent d968aacde1
commit c465681a86

View File

@ -375,7 +375,12 @@ abstract class QtLoader {
**/
private String getApkNativeLibrariesDir()
{
return QtApkFileEngine.getAppApkFilePath() + "!/lib/" + Build.SUPPORTED_ABIS[0] + "/";
if (m_preferredAbi == null) {
// Workaround: getLocalLibrariesList() will call preferredAbiLibs()
// with valid library names which will assign m_preferredAbi.
getLocalLibrariesList();
}
return QtApkFileEngine.getAppApkFilePath() + "!/lib/" + m_preferredAbi + "/";
}
/**