mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +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="format_min_password">Password must be at least %1$d characters long.</string>
|
||||||
<string name="enter_password">Enter your password:</string>
|
<string name="enter_password">Enter your password:</string>
|
||||||
<string name="try_again">Wrong password, try again</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="contact_list_button">Contacts</string>
|
||||||
<string name="messages_button">Messages</string>
|
<string name="messages_button">Messages</string>
|
||||||
<string name="groups_button">Groups</string>
|
<string name="groups_button">Groups</string>
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ import com.google.inject.Inject;
|
|||||||
|
|
||||||
public class HomeScreenActivity extends BriarActivity {
|
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 =
|
private static final Logger LOG =
|
||||||
Logger.getLogger(HomeScreenActivity.class.getName());
|
Logger.getLogger(HomeScreenActivity.class.getName());
|
||||||
|
|
||||||
@@ -99,7 +102,8 @@ public class HomeScreenActivity extends BriarActivity {
|
|||||||
LocalAuthor.class));
|
LocalAuthor.class));
|
||||||
} else if(databaseConfig.getEncryptionKey() == null) {
|
} else if(databaseConfig.getEncryptionKey() == null) {
|
||||||
// The activity was launched from the splash screen
|
// The activity was launched from the splash screen
|
||||||
showPasswordPrompt();
|
if(System.currentTimeMillis() < EXPIRY_DATE) showPasswordPrompt();
|
||||||
|
else showExpiryWarning();
|
||||||
} else {
|
} else {
|
||||||
// The activity has been launched before
|
// The activity has been launched before
|
||||||
showButtons();
|
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() {
|
private void showButtons() {
|
||||||
ListView.LayoutParams matchMatch =
|
ListView.LayoutParams matchMatch =
|
||||||
new ListView.LayoutParams(MATCH_PARENT, MATCH_PARENT);
|
new ListView.LayoutParams(MATCH_PARENT, MATCH_PARENT);
|
||||||
|
|||||||
Reference in New Issue
Block a user