diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2021-04-20 15:29:18 +0300 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2021-05-12 12:49:45 +0000 |
commit | 531d12edaf3f5163dd1c16978b85b0631a70baf4 (patch) | |
tree | 08d632cf09740dab7c62d858f31b6fe79a3f2d38 /src | |
parent | d85794c231dba314889cc2941014c422d22871db (diff) |
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 <andy.shaw@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/androiddeployqt/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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; + } } } } |