Merge pull request #386 from schwedenmut/AuthenticationActivity-is-missing-secure-flag-and-can-be-screencaptured-#378
Authentication activity is missing secure flag and can be screencaptured #378
This commit is contained in:
commit
8ced5b9f14
3 changed files with 20 additions and 1 deletions
|
@ -56,7 +56,8 @@
|
|||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||
android:hardwareAccelerated="true"
|
||||
android:screenOrientation="fullSensor"
|
||||
tools:replace="screenOrientation"/>
|
||||
tools:replace="screenOrientation" />
|
||||
<activity android:name=".Activities.SecureCaptureActivity" />
|
||||
<activity
|
||||
android:name=".Activities.PanicResponderActivity"
|
||||
android:launchMode="singleInstance"
|
||||
|
|
|
@ -105,6 +105,7 @@ public class MainActivity extends BaseActivity
|
|||
new IntentIntegrator(MainActivity.this)
|
||||
.setOrientationLocked(false)
|
||||
.setBeepEnabled(false)
|
||||
.setCaptureActivity(SecureCaptureActivity.class)
|
||||
.initiateScan();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue