mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Added an expiry date to prevent unsafe builds from being used long-term.
This commit is contained in:
@@ -60,6 +60,9 @@ import com.google.inject.Inject;
|
||||
|
||||
public class HomeScreenActivity extends BriarActivity {
|
||||
|
||||
// This build expires at the beginning of May 2013
|
||||
private static final long EXPIRY_DATE = 1367366400000L;
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(HomeScreenActivity.class.getName());
|
||||
|
||||
@@ -99,7 +102,8 @@ public class HomeScreenActivity extends BriarActivity {
|
||||
LocalAuthor.class));
|
||||
} else if(databaseConfig.getEncryptionKey() == null) {
|
||||
// The activity was launched from the splash screen
|
||||
showPasswordPrompt();
|
||||
if(System.currentTimeMillis() < EXPIRY_DATE) showPasswordPrompt();
|
||||
else showExpiryWarning();
|
||||
} else {
|
||||
// The activity has been launched before
|
||||
showButtons();
|
||||
@@ -283,6 +287,19 @@ public class HomeScreenActivity extends BriarActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private void showExpiryWarning() {
|
||||
LinearLayout layout = new LinearLayout(this);
|
||||
layout.setLayoutParams(MATCH_MATCH);
|
||||
layout.setGravity(CENTER);
|
||||
TextView warning = new TextView(this);
|
||||
warning.setGravity(CENTER);
|
||||
warning.setTextSize(18);
|
||||
warning.setPadding(10, 10, 10, 10);
|
||||
warning.setText(R.string.expiry_warning);
|
||||
layout.addView(warning);
|
||||
setContentView(layout);
|
||||
}
|
||||
|
||||
private void showButtons() {
|
||||
ListView.LayoutParams matchMatch =
|
||||
new ListView.LayoutParams(MATCH_PARENT, MATCH_PARENT);
|
||||
|
||||
Reference in New Issue
Block a user