Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
Expand Down Expand Up @@ -73,6 +74,12 @@ public class CheckoutActivity extends BaseActivity

@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// SECURITY: Prevent screenshots and screen recording to protect sensitive payment data
// (CVV, card numbers) from overlay attacks, screen capture malware, and shoulder-surfing
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE);

setContentView(R.layout.activity_checkout);
setupViews();
createNetworkTokenPaymentMethodParameters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ private void populateEncryptedBlobs(){
if (paymentMethodToken != null) {
String tokenJSON = paymentMethodToken.getToken();
if (tokenJSON != null) {
Log.d("AndroidPay", "AndroidPay token before encode :" + tokenJSON);
// SECURITY: Do not log payment tokens — they contain encrypted card data
// that could be exposed via logcat, bug reports, or crash-reporting tools.
String blob = getBase64Blob(tokenJSON);
Log.d("AndroidPay", "AndroidPay Blob" + blob);

String anetBlob = createSecServiceJson(blob);
anetBlob = getBase64Blob(anetBlob);
Log.d("ANet OpaqueData Blob" , anetBlob);
androidPayBlobView.setText(anetBlob);
}
return;
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_accept.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@
android:layout_weight="1"
android:hint="@string/cvv"
android:imeOptions="actionNext"
android:inputType="number"
android:inputType="numberPassword"
android:importantForAutofill="no"
android:maxLength="3"
android:nextFocusDown="@+id/zip_code_view"
android:textSize="32sp"
Expand Down