forked from qt-creator/qt-creator
Added support for not signing packages for Symbian OS
Reviewed-by: Tobias Hunger
This commit is contained in:
@@ -176,8 +176,14 @@ bool S60CreatePackageStep::init()
|
|||||||
m_environment = qt4BuildConfiguration()->environment();
|
m_environment = qt4BuildConfiguration()->environment();
|
||||||
|
|
||||||
m_args.clear();
|
m_args.clear();
|
||||||
if (m_createSmartInstaller)
|
if (m_createSmartInstaller) {
|
||||||
m_args << QLatin1String("installer_sis");
|
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
|
else
|
||||||
m_args << QLatin1String("sis");
|
m_args << QLatin1String("sis");
|
||||||
if (signingMode() == SignCustom) {
|
if (signingMode() == SignCustom) {
|
||||||
@@ -645,6 +651,8 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack
|
|||||||
this, SLOT(updateFromUi()));
|
this, SLOT(updateFromUi()));
|
||||||
connect(m_ui.selfSignedButton, SIGNAL(clicked()),
|
connect(m_ui.selfSignedButton, SIGNAL(clicked()),
|
||||||
this, SLOT(updateFromUi()));
|
this, SLOT(updateFromUi()));
|
||||||
|
connect(m_ui.notSignedButton, SIGNAL(clicked()),
|
||||||
|
this, SLOT(updateFromUi()));
|
||||||
connect(m_ui.signaturePath, SIGNAL(changed(QString)),
|
connect(m_ui.signaturePath, SIGNAL(changed(QString)),
|
||||||
this, SLOT(updateFromUi()));
|
this, SLOT(updateFromUi()));
|
||||||
connect(m_ui.keyFilePath, SIGNAL(changed(QString)),
|
connect(m_ui.keyFilePath, SIGNAL(changed(QString)),
|
||||||
@@ -657,11 +665,27 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack
|
|||||||
|
|
||||||
void S60CreatePackageStepConfigWidget::updateUi()
|
void S60CreatePackageStepConfigWidget::updateUi()
|
||||||
{
|
{
|
||||||
bool selfSigned = m_signStep->signingMode() == S60CreatePackageStep::SignSelf;
|
|
||||||
m_ui.selfSignedButton->setChecked(selfSigned);
|
switch(m_signStep->signingMode()) {
|
||||||
m_ui.customCertificateButton->setChecked(!selfSigned);
|
case S60CreatePackageStep::SignCustom:
|
||||||
m_ui.signaturePath->setEnabled(!selfSigned);
|
m_ui.selfSignedButton->setChecked(false);
|
||||||
m_ui.keyFilePath->setEnabled(!selfSigned);
|
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.signaturePath->setPath(m_signStep->customSignaturePath());
|
||||||
m_ui.keyFilePath->setPath(m_signStep->customKeyPath());
|
m_ui.keyFilePath->setPath(m_signStep->customKeyPath());
|
||||||
m_ui.smartInstaller->setChecked(m_signStep->createsSmartInstaller());
|
m_ui.smartInstaller->setChecked(m_signStep->createsSmartInstaller());
|
||||||
@@ -670,9 +694,15 @@ void S60CreatePackageStepConfigWidget::updateUi()
|
|||||||
|
|
||||||
void S60CreatePackageStepConfigWidget::updateFromUi()
|
void S60CreatePackageStepConfigWidget::updateFromUi()
|
||||||
{
|
{
|
||||||
bool selfSigned = m_ui.selfSignedButton->isChecked();
|
S60CreatePackageStep::SigningMode signingMode(S60CreatePackageStep::SignSelf);
|
||||||
m_signStep->setSigningMode(selfSigned ? S60CreatePackageStep::SignSelf
|
if (m_ui.selfSignedButton->isChecked())
|
||||||
: S60CreatePackageStep::SignCustom);
|
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->setCustomSignaturePath(m_ui.signaturePath->path());
|
||||||
m_signStep->setCustomKeyPath(m_ui.keyFilePath->path());
|
m_signStep->setCustomKeyPath(m_ui.keyFilePath->path());
|
||||||
m_signStep->setCreatesSmartInstaller(m_ui.smartInstaller->isChecked());
|
m_signStep->setCreatesSmartInstaller(m_ui.smartInstaller->isChecked());
|
||||||
@@ -691,11 +721,17 @@ void S60CreatePackageStepConfigWidget::resetPassphrases()
|
|||||||
QString S60CreatePackageStepConfigWidget::summaryText() const
|
QString S60CreatePackageStepConfigWidget::summaryText() const
|
||||||
{
|
{
|
||||||
QString text;
|
QString text;
|
||||||
if (m_signStep->signingMode() == S60CreatePackageStep::SignSelf) {
|
switch(m_signStep->signingMode()) {
|
||||||
text = tr("self-signed");
|
case S60CreatePackageStep::SignCustom:
|
||||||
} else {
|
|
||||||
text = tr("signed with certificate %1 and key file %2")
|
text = tr("signed with certificate %1 and key file %2")
|
||||||
.arg(m_signStep->customSignaturePath(), m_signStep->customKeyPath());
|
.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())
|
if (m_signStep->createsSmartInstaller())
|
||||||
return tr("<b>Create SIS Package:</b> %1, using Smart Installer").arg(text);
|
return tr("<b>Create SIS Package:</b> %1, using Smart Installer").arg(text);
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ class S60CreatePackageStep : public ProjectExplorer::BuildStep
|
|||||||
public:
|
public:
|
||||||
enum SigningMode {
|
enum SigningMode {
|
||||||
SignSelf = 0,
|
SignSelf = 0,
|
||||||
SignCustom = 1
|
SignCustom = 1,
|
||||||
|
NotSigned = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl);
|
explicit S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>517</width>
|
<width>517</width>
|
||||||
<height>108</height>
|
<height>135</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -15,7 +15,31 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<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">
|
<item row="0" column="0">
|
||||||
<widget class="QRadioButton" name="selfSignedButton">
|
<widget class="QRadioButton" name="selfSignedButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
@@ -147,13 +147,20 @@ QStringList S60DeployConfiguration::signedPackages() const
|
|||||||
continue;
|
continue;
|
||||||
TargetInformation ti = node->targetInformation();
|
TargetInformation ti = node->targetInformation();
|
||||||
if (ti.valid)
|
if (ti.valid)
|
||||||
result << ti.buildDir + QLatin1Char('/') + ti.target
|
result << ti.buildDir + QLatin1Char('/') + createPackageName(ti.target);
|
||||||
+ (runSmartInstaller() ? QLatin1String("_installer") : QLatin1String(""))
|
|
||||||
+ QLatin1String(".sis");
|
|
||||||
}
|
}
|
||||||
return result;
|
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
|
QStringList S60DeployConfiguration::packageFileNamesWithTargetInfo() const
|
||||||
{
|
{
|
||||||
QList<Qt4ProFileNode *> leafs = qt4Target()->qt4Project()->leafProFiles();
|
QList<Qt4ProFileNode *> leafs = qt4Target()->qt4Project()->leafProFiles();
|
||||||
@@ -216,6 +223,21 @@ bool S60DeployConfiguration::runSmartInstaller() const
|
|||||||
return false;
|
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
|
ProjectExplorer::ToolChain::ToolChainType S60DeployConfiguration::toolChainType() const
|
||||||
{
|
{
|
||||||
if (Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()))
|
if (Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()))
|
||||||
|
|||||||
@@ -93,8 +93,10 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void ctor();
|
void ctor();
|
||||||
bool runSmartInstaller() const;
|
bool runSmartInstaller() const;
|
||||||
|
bool isSigned() const;
|
||||||
QString symbianPlatform() const;
|
QString symbianPlatform() const;
|
||||||
QString symbianTarget() const;
|
QString symbianTarget() const;
|
||||||
|
QString createPackageName(const QString &baseName) const;
|
||||||
bool isDebug() const;
|
bool isDebug() const;
|
||||||
bool isStaticLibrary(const Qt4ProFileNode &projectNode) const;
|
bool isStaticLibrary(const Qt4ProFileNode &projectNode) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user