Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Community creation' warning #1244

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
458 changes: 234 additions & 224 deletions lang/mc_br.ts

Large diffs are not rendered by default.

459 changes: 235 additions & 224 deletions lang/mc_de.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_fr.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_hu.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_ja.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_ko.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_nl.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_pt.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_ru.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_sv.ts

Large diffs are not rendered by default.

458 changes: 234 additions & 224 deletions lang/mc_tr.ts

Large diffs are not rendered by default.

27 changes: 22 additions & 5 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ MainWindow::MainWindow(WSClient *client, DbMasterController *mc, QWidget *parent
ui->labelAboutMainMCU->setText(tr("Main MCU version:"));

ui->widgetNotFlashedWarning->hide();
ui->labelIsCommunityBuild->hide();
ui->labelNotFlashedWarningIcon->setPixmap(AppGui::qtAwesome()->icon(fa::warning).pixmap(QSize(20, 20)));
ui->labelSerialNumberIncorrect->setStyleSheet("QLabel {color: blue;}");
connect(ui->labelSerialNumberIncorrect, &ClickableLabel::clicked, this, &MainWindow::onIncorrectSerialNumberClicked);
Expand Down Expand Up @@ -999,14 +1000,22 @@ void MainWindow::updateSerialInfos() {
ui->label_UserManual->setText(MANUAL_STRING.arg(wsClient->isMPBLE() ? BLE_MANUAL_URL : MINI_MANUAL_URL));
ui->label_UserManual->show();
if (wsClient->isMPBLE() && wsClient->get_hwSerial() > STARTING_NOT_FLASHED_SERIAL &&
wsClient->get_hwSerial() == wsClient->get_platformSerial())
wsClient->get_hwSerial() == wsClient->get_platformSerial() &&
wsClient->get_hwSerial() < STARTING_COMMUNITY_SERIAL)
{
ui->widgetNotFlashedWarning->show();
}
else
{
ui->widgetNotFlashedWarning->hide();
}
if (wsClient->get_hwSerial() >= STARTING_COMMUNITY_SERIAL) {
ui->labelIsCommunityBuild->show();
ui->groupBoxSecurityChallenge->setEnabled(false);
} else {
ui->labelIsCommunityBuild->hide();
ui->groupBoxSecurityChallenge->setEnabled(true);
}
}
else
{
Expand Down Expand Up @@ -1677,10 +1686,18 @@ void MainWindow::setUIDRequestInstructionsWithId(const QString & id)

void MainWindow::setSecurityChallengeText(const QString &id, const QString &bundleVersion)
{
ui->labelSecurityChallenge->setText(tr("To be sure that no one has tampered with your device, you can request a challenge string and enter it below.<ol>"
"<li>Get the serial number from the back of your device.</li>"
"<li>&shy;<a href=\"mailto:[email protected]?subject=Security Challenge Token and Response Request&body=My serial number is %1, my bundle number is %2 and my order number is: FILL ME\">Send us an email</a> with the serial number and your order number, requesting the challenge string.</li>"
"<li>Enter the string you received from us</li></ol>").arg(id).arg(bundleVersion));
if (id.toInt() < STARTING_COMMUNITY_SERIAL) {
ui->labelSecurityChallenge->setText(tr("To be sure that no one has tampered with your device, you can request a challenge string and enter it below.<ol>"
"<li>Get the serial number from the back of your device.</li>"
"<li>&shy;<a href=\"mailto:[email protected]?subject=Security Challenge Token and Response Request&body=My serial number is %1, my bundle number is %2 and my order number is: FILL ME\">Send us an email</a> with the serial number and your order number, requesting the challenge string.</li>"
"<li>Enter the string you received from us</li></ol>").arg(id).arg(bundleVersion));
} else {
ui->labelSecurityChallenge->setText(tr("Your device (serial number %1) is a community-made device in no way affiliated with the original mooltipass team!<ol>"
"<li>Mooltipass is open-source and open-hardware, so anyone with enough skill can make one;</li>"
"<li>There's no way we can do a security challenge for your device, since we haven't made it and don't have the required data;</li>"
"<li>This menu is disabled to avoid any frustration and erroneous emails;</li>"
"</ol>").arg(id));
}
}

void MainWindow::enableCredentialsManagement(bool enable)
Expand Down
1 change: 1 addition & 0 deletions src/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ private slots:
static constexpr int MAC_DEFAULT_HEIGHT = 500;
#endif
static constexpr int STARTING_NOT_FLASHED_SERIAL = 2000;
static constexpr int STARTING_COMMUNITY_SERIAL = 100000;
};

#endif // MAINWINDOW_H
18 changes: 17 additions & 1 deletion src/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ QWidget {background-color: #EFEFEF;}</string>
<enum>Qt::LeftToRight</enum>
</property>
<property name="currentIndex">
<number>9</number>
<number>8</number>
</property>
<widget class="QWidget" name="pageNoDaemon">
<layout class="QHBoxLayout" name="horizontalLayout_noDaemon1">
Expand Down Expand Up @@ -3371,6 +3371,22 @@ Hint: keep your mouse positioned over an option to get more details.</string>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="labelIsCommunityBuild">
<property name="enabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<bold>true</bold>
<underline>true</underline>
</font>
</property>
<property name="text">
<string>Community Creation</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_62">
<property name="orientation">
Expand Down