|
|
|
@ -56,6 +56,8 @@ bool get_features(Features *resp) {
|
|
|
|
|
resp->has_flags = config_getFlags(&(resp->flags));
|
|
|
|
|
resp->has_model = true;
|
|
|
|
|
strlcpy(resp->model, "1", sizeof(resp->model));
|
|
|
|
|
resp->has_safety_checks = true;
|
|
|
|
|
resp->safety_checks = config_getSafetyCheckLevel();
|
|
|
|
|
if (session_isUnlocked()) {
|
|
|
|
|
resp->has_wipe_code_protection = true;
|
|
|
|
|
resp->wipe_code_protection = config_hasWipeCode();
|
|
|
|
@ -363,7 +365,8 @@ void fsm_msgApplySettings(const ApplySettings *msg) {
|
|
|
|
|
_("This firmware is incapable of passphrase entry on the device."));
|
|
|
|
|
|
|
|
|
|
CHECK_PARAM(msg->has_label || msg->has_language || msg->has_use_passphrase ||
|
|
|
|
|
msg->has_homescreen || msg->has_auto_lock_delay_ms,
|
|
|
|
|
msg->has_homescreen || msg->has_auto_lock_delay_ms ||
|
|
|
|
|
msg->has_safety_checks,
|
|
|
|
|
_("No setting provided"));
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
@ -432,6 +435,23 @@ void fsm_msgApplySettings(const ApplySettings *msg) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (msg->has_safety_checks) {
|
|
|
|
|
if (msg->safety_checks == SafetyCheckLevel_Strict ||
|
|
|
|
|
msg->safety_checks == SafetyCheckLevel_PromptTemporarily) {
|
|
|
|
|
layoutConfirmSafetyChecks(msg->safety_checks);
|
|
|
|
|
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
|
|
|
|
|
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
|
|
|
|
layoutHome();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
fsm_sendFailure(FailureType_Failure_ProcessError,
|
|
|
|
|
_("Unsupported safety-checks setting"));
|
|
|
|
|
layoutHome();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (msg->has_label) {
|
|
|
|
|
config_setLabel(msg->label);
|
|
|
|
|
}
|
|
|
|
@ -447,6 +467,9 @@ void fsm_msgApplySettings(const ApplySettings *msg) {
|
|
|
|
|
if (msg->has_auto_lock_delay_ms) {
|
|
|
|
|
config_setAutoLockDelayMs(msg->auto_lock_delay_ms);
|
|
|
|
|
}
|
|
|
|
|
if (msg->has_safety_checks) {
|
|
|
|
|
config_setSafetyCheckLevel(msg->safety_checks);
|
|
|
|
|
}
|
|
|
|
|
fsm_sendSuccess(_("Settings applied"));
|
|
|
|
|
layoutHome();
|
|
|
|
|
}
|
|
|
|
|