mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Prevent screenshots (including the Recents menu).
Thanks to the team that audited CryptoCat for this idea. :-)
This commit is contained in:
@@ -2,6 +2,7 @@ package org.briarproject.android;
|
||||
|
||||
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP;
|
||||
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
@@ -41,6 +42,7 @@ public class BriarActivity extends RoboActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle state) {
|
||||
super.onCreate(state);
|
||||
getWindow().setFlags(FLAG_SECURE, FLAG_SECURE);
|
||||
if(databaseConfig.getEncryptionKey() != null) startAndBindService();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.briarproject.android;
|
||||
|
||||
import static android.view.Gravity.CENTER;
|
||||
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||
import static org.briarproject.android.util.CommonLayoutParams.MATCH_MATCH;
|
||||
|
||||
import org.briarproject.R;
|
||||
@@ -17,6 +18,8 @@ public class ExpiredActivity extends Activity {
|
||||
public void onCreate(Bundle state) {
|
||||
super.onCreate(state);
|
||||
|
||||
getWindow().setFlags(FLAG_SECURE, FLAG_SECURE);
|
||||
|
||||
LinearLayout layout = new LinearLayout(this);
|
||||
layout.setLayoutParams(MATCH_MATCH);
|
||||
layout.setGravity(CENTER);
|
||||
|
||||
@@ -6,6 +6,7 @@ import static android.view.Gravity.CENTER;
|
||||
import static android.view.Gravity.CENTER_HORIZONTAL;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
|
||||
import static android.widget.LinearLayout.VERTICAL;
|
||||
import static org.briarproject.android.util.CommonLayoutParams.MATCH_MATCH;
|
||||
@@ -55,6 +56,8 @@ public class PasswordActivity extends RoboActivity {
|
||||
public void onCreate(Bundle state) {
|
||||
super.onCreate(state);
|
||||
|
||||
getWindow().setFlags(FLAG_SECURE, FLAG_SECURE);
|
||||
|
||||
SharedPreferences prefs = getSharedPreferences("db", MODE_PRIVATE);
|
||||
String hex = prefs.getString("key", null);
|
||||
if(hex == null || !databaseConfig.databaseExists()) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import static android.view.Gravity.CENTER_HORIZONTAL;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||
import static android.widget.LinearLayout.VERTICAL;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static org.briarproject.android.util.CommonLayoutParams.MATCH_MATCH;
|
||||
@@ -74,6 +75,8 @@ public class SetupActivity extends RoboActivity implements OnClickListener {
|
||||
public void onCreate(Bundle state) {
|
||||
super.onCreate(state);
|
||||
|
||||
getWindow().setFlags(FLAG_SECURE, FLAG_SECURE);
|
||||
|
||||
LinearLayout layout = new LinearLayout(this);
|
||||
layout.setLayoutParams(MATCH_MATCH);
|
||||
layout.setOrientation(VERTICAL);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.briarproject.android;
|
||||
|
||||
import static android.view.Gravity.CENTER;
|
||||
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static org.briarproject.android.util.CommonLayoutParams.MATCH_MATCH;
|
||||
|
||||
@@ -44,6 +45,8 @@ public class SplashScreenActivity extends RoboSplashActivity {
|
||||
public void onCreate(Bundle state) {
|
||||
super.onCreate(state);
|
||||
|
||||
getWindow().setFlags(FLAG_SECURE, FLAG_SECURE);
|
||||
|
||||
LinearLayout layout = new LinearLayout(this);
|
||||
layout.setLayoutParams(MATCH_MATCH);
|
||||
layout.setGravity(CENTER);
|
||||
|
||||
Reference in New Issue
Block a user