Extended zxing-android-embedded CaptureActivity to secure 2FA QR Codes
This commit is contained in:
parent
491a600f9b
commit
7bdd2f444c
3 changed files with 19 additions and 0 deletions
|
@ -56,6 +56,7 @@
|
|||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||
android:screenOrientation="fullSensor"
|
||||
tools:replace="screenOrientation" />
|
||||
<activity android:name=".Activities.SecureCaptureActivity" />
|
||||
<activity
|
||||
android:name=".Activities.PanicResponderActivity"
|
||||
android:launchMode="singleInstance"
|
||||
|
|
|
@ -104,6 +104,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