Authentication activity is missing secure flag and can be screencaptured #378
This commit is contained in:
Jakob Nixdorf 2019-09-20 06:48:15 +02:00 committed by GitHub
commit 8ced5b9f14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View file

@ -57,6 +57,7 @@
android:hardwareAccelerated="true"
android:screenOrientation="fullSensor"
tools:replace="screenOrientation" />
<activity android:name=".Activities.SecureCaptureActivity" />
<activity
android:name=".Activities.PanicResponderActivity"
android:launchMode="singleInstance"

View file

@ -105,6 +105,7 @@ public class MainActivity extends BaseActivity
new IntentIntegrator(MainActivity.this)
.setOrientationLocked(false)
.setBeepEnabled(false)
.setCaptureActivity(SecureCaptureActivity.class)
.initiateScan();
}

View file

@ -0,0 +1,17 @@
package org.shadowice.flocke.andotp.Activities;
import android.view.WindowManager;
import com.journeyapps.barcodescanner.CaptureActivity;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import org.shadowice.flocke.andotp.Utilities.Settings;
public class SecureCaptureActivity extends CaptureActivity {
@Override
protected DecoratedBarcodeView initializeContent() {
Settings settings = new Settings(this);
if (!settings.getScreenshotsEnabled())
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
return super.initializeContent();
}
}