From 531d12edaf3f5163dd1c16978b85b0631a70baf4 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 20 Apr 2021 15:29:18 +0300 Subject: Android: check that app's lib_name value doesn't contain spaces android.app.lib_name is used for the app's lib that contains the main() function, *.so lib files usually have non-spaced names, thus to avoid wrong changes done to the manifest file, it's better to throw an error in this case. Change-Id: I4d4f0235612b308c78fd06a77690604c5c69f8ff Reviewed-by: Andy Shaw --- src/tools/androiddeployqt/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 4a476cd065..462315fcf1 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1506,6 +1506,15 @@ bool updateAndroidManifest(Options &options) reader.attributes().hasAttribute(QLatin1String("android:label")) && reader.attributes().value(QLatin1String("android:label")) == QLatin1String("@string/app_name")) { checkOldAndroidLabelString = true; + } else if (reader.name() == QLatin1String("meta-data")) { + const auto name = reader.attributes().value(QLatin1String("android:name")); + const auto value = reader.attributes().value(QLatin1String("android:value")); + if (name == QLatin1String("android.app.lib_name") + && value.contains(QLatin1Char(' '))) { + fprintf(stderr, "The Activity's android.app.lib_name should not contain" + " spaces.\n"); + return false; + } } } } -- cgit v1.2.3