Check whether system clock is reasonable at startup.

This commit is contained in:
akwizgran
2021-06-23 16:32:32 +01:00
committed by Torsten Grote
parent 80749fec09
commit 802f64e309
5 changed files with 75 additions and 10 deletions

View File

@@ -51,26 +51,27 @@ public class StartupFailureActivity extends BaseActivity implements
}
// show proper error message
String errorMsg;
int errorRes;
switch (result) {
case CLOCK_ERROR:
errorRes = R.string.startup_failed_clock_error;
break;
case DATA_TOO_OLD_ERROR:
errorMsg =
getString(R.string.startup_failed_data_too_old_error);
errorRes = R.string.startup_failed_data_too_old_error;
break;
case DATA_TOO_NEW_ERROR:
errorMsg =
getString(R.string.startup_failed_data_too_new_error);
errorRes = R.string.startup_failed_data_too_new_error;
break;
case DB_ERROR:
errorMsg = getString(R.string.startup_failed_db_error);
errorRes = R.string.startup_failed_db_error;
break;
case SERVICE_ERROR:
errorMsg = getString(R.string.startup_failed_service_error);
errorRes = R.string.startup_failed_service_error;
break;
default:
throw new IllegalArgumentException();
}
showInitialFragment(ErrorFragment.newInstance(errorMsg));
showInitialFragment(ErrorFragment.newInstance(getString(errorRes)));
}
@Override

View File

@@ -49,6 +49,7 @@
<string name="startup_failed_notification_title">Briar could not start</string>
<string name="startup_failed_notification_text">Tap for more information.</string>
<string name="startup_failed_activity_title">Briar Startup Failure</string>
<string name="startup_failed_clock_error">Briar was unable to start because your device\'s clock is wrong. Please set your device\'s clock to the right time and try again.</string>
<string name="startup_failed_db_error">For some reason, your Briar database is corrupted beyond repair. Your account, your data and all your contacts are lost. Unfortunately, you need to reinstall Briar or set up a new account by choosing \'I have forgotten my password\' at the password prompt.</string>
<string name="startup_failed_data_too_old_error">Your account was created with an old version of this app and cannot be opened with this version. You must either reinstall the old version or set up a new account by choosing \'I have forgotten my password\' at the password prompt.</string>
<string name="startup_failed_data_too_new_error">This version of the app is too old. Please upgrade to the latest version and try again.</string>