Skip to content

Commit

Permalink
Android: handle quotes in hard-coded namespace in build.gradle
Browse files Browse the repository at this point in the history
Remove quotes from the namespace values if they're set
directly to build.gradle.

Fixes: QTBUG-132150
Pick-to: 6.9 6.8
Change-Id: I7f5e132c2600bf5079850c99dc500b1dff7e6a96
Reviewed-by: Ivan Solovev <[email protected]>
  • Loading branch information
Issam-b committed Dec 13, 2024
1 parent 11518e9 commit 60f7821
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tools/androiddeployqt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,14 @@ GradleBuildConfigs gradleBuildConfigs(const QString &path)
if (trimmedLine.contains("compileSdkVersion androidCompileSdkVersion.toInteger()")) {
configs.usesIntegerCompileSdkVersion = true;
} else if (trimmedLine.contains("namespace")) {
configs.appNamespace = QString::fromUtf8(extractValue(trimmedLine));
const QString value = QString::fromUtf8(extractValue(trimmedLine));
const bool singleQuoted = value.startsWith(u'\'') && value.endsWith(u'\'');
const bool doubleQuoted = value.startsWith(u'\"') && value.endsWith(u'\"');

if (singleQuoted || doubleQuoted)
configs.appNamespace = value.mid(1, value.length() - 2);
else
configs.appNamespace = value;
}
}

Expand Down

0 comments on commit 60f7821

Please sign in to comment.