Android: properly parse colon separated local libs in QtLoader

The 'load_local_libs' array  might contain lib names separated by
a colon that the new loader code didn't account for, that led to
attempting to load an invalid library path and thus crashing if
anthing depends on that library (in this case the Android plugin).

Amends 3a505a859a.

Task-number: QTBUG-115016
Change-Id: I864c7af7da7016721530c18a412befc5c6a5caa3
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
This commit is contained in:
Assam Boudjelthia 2023-10-30 11:16:50 +02:00
parent efb06499a7
commit 4f33c4a368

View File

@ -337,7 +337,11 @@ public abstract class QtLoader {
@SuppressLint("DiscouragedApi")
private ArrayList<String> getLocalLibrariesList() {
int id = m_resources.getIdentifier("load_local_libs", "array", m_packageName);
return preferredAbiLibs(m_resources.getStringArray(id));
ArrayList<String> localLibs = new ArrayList<>();
for (String arrayItem : preferredAbiLibs(m_resources.getStringArray(id))) {
Collections.addAll(localLibs, arrayItem.split(":"));
}
return localLibs;
}
@SuppressLint("DiscouragedApi")