mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Added an expiry date to prevent unsafe builds from being used long-term.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<string name="format_min_password">Password must be at least %1$d characters long.</string>
|
||||
<string name="enter_password">Enter your password:</string>
|
||||
<string name="try_again">Wrong password, try again</string>
|
||||
<string name="expiry_warning">This software has expired.\nPlease install a newer version.</string>
|
||||
<string name="contact_list_button">Contacts</string>
|
||||
<string name="messages_button">Messages</string>
|
||||
<string name="groups_button">Groups</string>
|
||||
|
||||
@@ -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