deactivate screenshots in new PassphraseDialogActivity

This commit is contained in:
Dominik Schürmann 2014-09-13 21:17:19 +02:00
parent 3bc3bc6d58
commit a1323a1a14
2 changed files with 11 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import android.support.v4.app.FragmentActivity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
@ -64,6 +65,15 @@ public class PassphraseDialogActivity extends FragmentActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// do not allow screenshots of passphrase input
// to prevent "too easy" passphrase theft by root apps
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
);
}
// this activity itself has no content view (see manifest)
long keyId = getIntent().getLongExtra(EXTRA_SECRET_KEY_ID, 0);

View File

@ -15,3 +15,4 @@ include ':extern:KeybaseLib:Lib'
include ':extern:TokenAutoComplete:library'
include ':extern:openpgp-card-nfc-lib:library'
include ':extern:safeslinger-exchange'
include ':OpenKeychain-Test'