Commit 67ff313c authored by Pawel Polanski's avatar Pawel Polanski
Browse files

Added support for not signing packages for Symbian OS

Reviewed-by: Tobias Hunger
parent cb99adfb
......@@ -176,8 +176,14 @@ bool S60CreatePackageStep::init()
m_environment = qt4BuildConfiguration()->environment();
m_args.clear();
if (m_createSmartInstaller)
m_args << QLatin1String("installer_sis");
if (m_createSmartInstaller) {
if(signingMode() == NotSigned)
m_args << QLatin1String("unsigned_installer_sis");
else
m_args << QLatin1String("installer_sis");
} else if (signingMode() == NotSigned)
m_args << QLatin1String("unsigned_sis");
else
m_args << QLatin1String("sis");
if (signingMode() == SignCustom) {
......@@ -645,6 +651,8 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack
this, SLOT(updateFromUi()));
connect(m_ui.selfSignedButton, SIGNAL(clicked()),
this, SLOT(updateFromUi()));
connect(m_ui.notSignedButton, SIGNAL(clicked()),
this, SLOT(updateFromUi()));
connect(m_ui.signaturePath, SIGNAL(changed(QString)),
this, SLOT(updateFromUi()));
connect(m_ui.keyFilePath, SIGNAL(changed(QString)),
......@@ -657,11 +665,27 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack
void S60CreatePackageStepConfigWidget::updateUi()
{
bool selfSigned = m_signStep->signingMode() == S60CreatePackageStep::SignSelf;
m_ui.selfSignedButton->setChecked(selfSigned);
m_ui.customCertificateButton->setChecked(!selfSigned);
m_ui.signaturePath->setEnabled(!selfSigned);
m_ui.keyFilePath->setEnabled(!selfSigned);
switch(m_signStep->signingMode()) {
case S60CreatePackageStep::SignCustom:
m_ui.selfSignedButton->setChecked(false);
m_ui.customCertificateButton->setChecked(true);
m_ui.notSignedButton->setChecked(false);
break;
case S60CreatePackageStep::NotSigned:
m_ui.selfSignedButton->setChecked(false);
m_ui.customCertificateButton->setChecked(false);
m_ui.notSignedButton->setChecked(true);
break;
default:
m_ui.selfSignedButton->setChecked(true);
m_ui.customCertificateButton->setChecked(false);
m_ui.notSignedButton->setChecked(false);
break;
}
bool customSigned = m_signStep->signingMode() == S60CreatePackageStep::SignCustom;
m_ui.signaturePath->setEnabled(customSigned);
m_ui.keyFilePath->setEnabled(customSigned);
m_ui.signaturePath->setPath(m_signStep->customSignaturePath());
m_ui.keyFilePath->setPath(m_signStep->customKeyPath());
m_ui.smartInstaller->setChecked(m_signStep->createsSmartInstaller());
......@@ -670,9 +694,15 @@ void S60CreatePackageStepConfigWidget::updateUi()
void S60CreatePackageStepConfigWidget::updateFromUi()
{
bool selfSigned = m_ui.selfSignedButton->isChecked();
m_signStep->setSigningMode(selfSigned ? S60CreatePackageStep::SignSelf
: S60CreatePackageStep::SignCustom);
S60CreatePackageStep::SigningMode signingMode(S60CreatePackageStep::SignSelf);
if (m_ui.selfSignedButton->isChecked())
signingMode = S60CreatePackageStep::SignSelf;
else if (m_ui.customCertificateButton->isChecked())
signingMode = S60CreatePackageStep::SignCustom;
else if (m_ui.notSignedButton->isChecked())
signingMode = S60CreatePackageStep::NotSigned;
m_signStep->setSigningMode(signingMode);
m_signStep->setCustomSignaturePath(m_ui.signaturePath->path());
m_signStep->setCustomKeyPath(m_ui.keyFilePath->path());
m_signStep->setCreatesSmartInstaller(m_ui.smartInstaller->isChecked());
......@@ -691,11 +721,17 @@ void S60CreatePackageStepConfigWidget::resetPassphrases()
QString S60CreatePackageStepConfigWidget::summaryText() const
{
QString text;
if (m_signStep->signingMode() == S60CreatePackageStep::SignSelf) {
text = tr("self-signed");
} else {
switch(m_signStep->signingMode()) {
case S60CreatePackageStep::SignCustom:
text = tr("signed with certificate %1 and key file %2")
.arg(m_signStep->customSignaturePath(), m_signStep->customKeyPath());
break;
case S60CreatePackageStep::NotSigned:
text = tr("not signed");
break;
default:
text = tr("self-signed");
break;
}
if (m_signStep->createsSmartInstaller())
return tr("<b>Create SIS Package:</b> %1, using Smart Installer").arg(text);
......
......@@ -74,7 +74,8 @@ class S60CreatePackageStep : public ProjectExplorer::BuildStep
public:
enum SigningMode {
SignSelf = 0,
SignCustom = 1
SignCustom = 1,
NotSigned = 2
};
explicit S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl);
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>517</width>
<height>108</height>
<height>135</height>
</rect>
</property>
<property name="windowTitle">
......@@ -15,7 +15,31 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0" columnstretch="0,0" rowminimumheight="0,0" columnminimumwidth="0,0">
<item row="1" column="0">
<widget class="QRadioButton" name="notSignedButton">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="notSignedLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Not signed</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0" columnminimumwidth="0,0">
<item row="0" column="0">
<widget class="QRadioButton" name="selfSignedButton">
<property name="text">
......
......@@ -147,13 +147,20 @@ QStringList S60DeployConfiguration::signedPackages() const
continue;
TargetInformation ti = node->targetInformation();
if (ti.valid)
result << ti.buildDir + QLatin1Char('/') + ti.target
+ (runSmartInstaller() ? QLatin1String("_installer") : QLatin1String(""))
+ QLatin1String(".sis");
result << ti.buildDir + QLatin1Char('/') + createPackageName(ti.target);
}
return result;
}
QString S60DeployConfiguration::createPackageName(const QString &baseName) const
{
QString name(baseName);
name += isSigned() ? QLatin1String("") : QLatin1String("_unsigned");
name += runSmartInstaller() ? QLatin1String("_installer") : QLatin1String("");
name += QLatin1String(".sis");
return name;
}
QStringList S60DeployConfiguration::packageFileNamesWithTargetInfo() const
{
QList<Qt4ProFileNode *> leafs = qt4Target()->qt4Project()->leafProFiles();
......@@ -216,6 +223,21 @@ bool S60DeployConfiguration::runSmartInstaller() const
return false;
}
bool S60DeployConfiguration::isSigned() const
{
DeployConfiguration *dc = target()->activeDeployConfiguration();
QTC_ASSERT(dc, return false);
BuildStepList *bsl = dc->stepList();
QTC_ASSERT(bsl, return false);
QList<BuildStep *> steps = bsl->steps();
foreach (const BuildStep *step, steps) {
if (const S60CreatePackageStep *packageStep = qobject_cast<const S60CreatePackageStep *>(step)) {
return packageStep->signingMode() != S60CreatePackageStep::NotSigned;
}
}
return false;
}
ProjectExplorer::ToolChain::ToolChainType S60DeployConfiguration::toolChainType() const
{
if (Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()))
......
......@@ -93,8 +93,10 @@ protected:
private:
void ctor();
bool runSmartInstaller() const;
bool isSigned() const;
QString symbianPlatform() const;
QString symbianTarget() const;
QString createPackageName(const QString &baseName) const;
bool isDebug() const;
bool isStaticLibrary(const Qt4ProFileNode &projectNode) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment