导航菜单

页面标题

页面副标题

Zepto v25.1.4 - GetCredential.java 源代码

正在查看: Zepto v25.1.4 应用的 GetCredential.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.npci.upi.security.pinactivitycomponent;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.KeyguardManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;
import android.graphics.drawable.TransitionDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.telephony.SmsMessage;
import android.text.TextUtils;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import java.lang.Thread;
import java.security.cert.CertificateException;
import java.util.Date;
import java.util.Locale;
import java.util.WeakHashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.npci.upi.security.pinactivitycomponent.Keypad;

public class GetCredential extends AppCompatActivity {
    private static final String TAG = "GetCredential";
    private static GetCredential _instance;
    public static String callbackFromApp;
    private ImageView bankImage;
    private Bitmap bitmap;
    private org.npci.upi.security.pinactivitycomponent.a bitmapPicture;
    private e credBlockBuilder;
    private String credType;
    private Fragment fragment;
    private String imageUrl;
    private o lite;
    private int mActivityHeight;
    private ImageView mTransactionBarArrow;
    private View mTransactionDetailScroller;
    private View mTransactionDetailSpace;
    private TransitionDrawable mTransitionDrawable;
    private Boolean showFragment;
    private a smsReceiver;
    private Boolean urlChecker;
    private Boolean verifiedMerchant;
    private final Context context = this;
    private s currentFragment = null;
    private boolean doubleBackToExitPressedOnce = false;
    private int numDigitsOfOTP = 0;
    private Thread.UncaughtExceptionHandler defaultHandler = null;

    public class a extends BroadcastReceiver {
        private a() {
        }

        private void a(Intent intent) {
            Bundle extras = intent.getExtras();
            if (extras != null) {
                Object[] objArr = (Object[]) extras.get("pdus");
                int length = objArr.length;
                SmsMessage[] smsMessageArr = new SmsMessage[length];
                for (int i2 = 0; i2 < length; i2++) {
                    SmsMessage createFromPdu = SmsMessage.createFromPdu((byte[]) objArr[i2]);
                    smsMessageArr[i2] = createFromPdu;
                    String upperCase = createFromPdu.getOriginatingAddress().toUpperCase();
                    String upperCase2 = smsMessageArr[i2].getMessageBody().toUpperCase();
                    new Date(smsMessageArr[i2].getTimestampMillis());
                    t a = new u(GetCredential.this.context).a(GetCredential.this.numDigitsOfOTP, upperCase, upperCase2);
                    if (a != null) {
                        GetCredential.this.currentFragment.b(a);
                    }
                }
            }
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            try {
                if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) {
                    a(intent);
                }
            } catch (Exception e2) {
                q.a(GetCredential.TAG, e2);
            }
        }
    }

    public GetCredential() {
        Boolean bool = Boolean.FALSE;
        this.showFragment = bool;
        this.imageUrl = "";
        this.urlChecker = bool;
        this.bitmap = null;
        this.verifiedMerchant = bool;
        this.credType = null;
        _instance = this;
    }

    public static GetCredential _getInstance() {
        return _instance;
    }

    private static Bitmap decodeBase64(String str) {
        byte[] decode = Base64.decode(str, 0);
        return BitmapFactory.decodeByteArray(decode, 0, decode.length);
    }

    private DisplayMetrics getDisplayMetrics() {
        return getResources().getDisplayMetrics();
    }

    public void goBack() {
        this.credBlockBuilder.g().c().send(0, androidx.room.util.a.i("error", CLConstants.OUTPUT_ERROR_MESSAGE));
        finish();
    }

    private Boolean hasDeviceLock() {
        KeyguardManager keyguardManager = (KeyguardManager) this.context.getSystemService("keyguard");
        if (!keyguardManager.isKeyguardSecure()) {
            startActivity(new Intent((Context) this, (Class<?>) UserAuthInfoActivity.class));
        }
        return Boolean.valueOf(keyguardManager.isKeyguardSecure());
    }

    private void headLessFlow() {
        try {
            String string = this.credBlockBuilder.p().getJSONObject(0).getString(CLConstants.FIELD_SUBTYPE);
            JSONObject c = this.credBlockBuilder.c();
            if (!string.equals(CLConstants.CREDTYPE_IDENTITY)) {
                if (string.equals(CLConstants.CREDTYPE_SIGNATURE)) {
                    this.lite.e();
                    return;
                }
                return;
            }
            Boolean bool = Boolean.TRUE;
            if (c != null) {
                bool = Boolean.valueOf(Boolean.parseBoolean(c.optString(CLConstants.FIELD_ENABLE_USER_AUTH, "true")));
            }
            if (bool.booleanValue()) {
                hasDeviceLock();
            }
            o oVar = new o(this.context, this.credBlockBuilder.d(), this.credBlockBuilder.p(), c);
            this.lite = oVar;
            oVar.b(bool);
        } catch (Exception e2) {
            q.a(TAG, e2);
            ((GetCredential) this.context).showError(CLConstants.ERROR_TECHNICAL_ERROR);
        }
    }

    public boolean isTransactionDetailsExpanded() {
        return this.mTransactionDetailScroller.getVisibility() == 0;
    }

    private int pix(float f2) {
        return (int) (f2 * (getResources().getDisplayMetrics().densityDpi / 160));
    }

    private void readUIArguments() {
        try {
            if (this.credBlockBuilder.c().has(CLConstants.INPUT_BANK_IMAGE_URL)) {
                this.imageUrl = this.credBlockBuilder.c().getString(CLConstants.INPUT_BANK_IMAGE_URL);
                this.urlChecker = Boolean.TRUE;
            }
            if (this.credBlockBuilder.c().has(CLConstants.INPUT_BANK_IMAGE)) {
                this.bitmap = decodeBase64(this.credBlockBuilder.c().getString(CLConstants.INPUT_BANK_IMAGE));
            }
            if (this.credBlockBuilder.c().has(CLConstants.INPUT_VERIFIED_MERCHANT)) {
                this.verifiedMerchant = Boolean.valueOf(this.credBlockBuilder.c().getBoolean(CLConstants.INPUT_VERIFIED_MERCHANT));
            }
            String[] split = this.credBlockBuilder.b().split("_");
            Locale locale = new Locale(this.credBlockBuilder.b());
            if (split.length == 2) {
                locale = new Locale(split[0], split[1]);
            }
            Locale.setDefault(locale);
            Configuration configuration = new Configuration();
            configuration.locale = locale;
            getBaseContext().getResources().updateConfiguration(configuration, getBaseContext().getResources().getDisplayMetrics());
        } catch (Exception e2) {
            q.a(TAG, e2);
        }
    }

    private void registerSMSReceiver() {
        IntentFilter intentFilter = new IntentFilter();
        try {
            intentFilter.addAction("android.provider.Telephony.SMS_RECEIVED");
            intentFilter.setPriority(999);
            registerReceiver(this.smsReceiver, intentFilter);
        } catch (Throwable unused) {
            q.a(TAG, "Failed to register SMS broadcast receiver (Ignoring)");
        }
    }

    private Keypad setupKeyboard() {
        Keypad keypad = (Keypad) findViewById(R.id.fragmentTelKeyboard);
        if (keypad != null) {
            keypad.setOnKeyPressCallback(new Keypad.a() {
                @Override
                public void a(View view, int i2) {
                    GetCredential.this.dispatchKeyEvent(new KeyEvent(0, i2));
                    if (i2 == 66) {
                        if (GetCredential.this.currentFragment != null) {
                            GetCredential.this.currentFragment.a();
                        }
                    } else if (i2 == 67) {
                        GetCredential.this.currentFragment.b();
                    }
                }
            });
        }
        return keypad;
    }

    public void toggleTransactionDetails(final boolean z) {
        ImageView imageView = this.mTransactionBarArrow;
        if (z) {
            rotateView(0.0f, 180.0f, 300, imageView);
        } else {
            rotateView(180.0f, 0.0f, 300, imageView);
        }
        final int height = this.mTransactionDetailScroller.getHeight();
        if (height == 0) {
            height = this.mActivityHeight;
        }
        this.mTransactionDetailScroller.clearAnimation();
        this.mTransactionDetailScroller.animate().y(z ? 0.0f : height * (-1.0f)).alpha(z ? 1.0f : 0.0f).setDuration(300L).setInterpolator(new AccelerateInterpolator()).setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animator) {
                super.onAnimationEnd(animator);
                if (z) {
                    return;
                }
                GetCredential.this.mTransactionDetailScroller.setVisibility(8);
                GetCredential.this.mTransactionDetailSpace.setVisibility(8);
                GetCredential.this.mTransitionDrawable.resetTransition();
            }

            @Override
            @TargetApi(17)
            public void onAnimationStart(Animator animator) {
                super.onAnimationStart(animator);
                if (!z) {
                    GetCredential.this.mTransitionDrawable.reverseTransition(300);
                    return;
                }
                GetCredential.this.mTransitionDrawable.startTransition(300);
                GetCredential.this.mTransactionDetailScroller.setVisibility(0);
                GetCredential.this.mTransactionDetailSpace.setVisibility(0);
                GetCredential.this.mTransactionDetailSpace.setLayoutDirection(0);
                View view = GetCredential.this.mTransactionDetailScroller;
                WeakHashMap weakHashMap = ViewCompat.a;
                if (view.getY() == 0.0f) {
                    GetCredential.this.mTransactionDetailScroller.setY(height * (-1));
                }
            }
        });
    }

    private void unregisterSMSReceiver() {
        try {
            a aVar = this.smsReceiver;
            if (aVar != null) {
                unregisterReceiver(aVar);
                this.smsReceiver = null;
            }
        } catch (Throwable unused) {
            q.a(TAG, "Failed to unregister SMS receiver (Ignoring)");
        }
    }

    private Boolean validateLiteRequest() {
        GetCredential getCredential;
        String str;
        Boolean bool = Boolean.FALSE;
        try {
            this.lite = new o(this.context, this.credBlockBuilder.d(), this.credBlockBuilder.p(), this.credBlockBuilder.c());
            bool = Boolean.valueOf(this.credBlockBuilder.f().booleanValue() ? this.lite.a(CLConstants.FIELD_LOAD_MONEY_FLOW) : this.lite.a(CLConstants.FIELD_LITE_PAY_FLOW));
            return bool;
        } catch (Exception e2) {
            q.a(TAG, e2);
            if (e2 instanceof IllegalStateException) {
                getCredential = (GetCredential) this.context;
                str = CLConstants.ERROR_SYNC_REQUIRED;
            } else if (e2 instanceof IllegalArgumentException) {
                getCredential = (GetCredential) this.context;
                str = CLConstants.ERROR_INVALID_REQUEST;
            } else if (e2 instanceof CertificateException) {
                getCredential = (GetCredential) this.context;
                str = CLConstants.ERROR_LITE_KEYS_ROTATION_NEEDED;
            } else {
                getCredential = (GetCredential) this.context;
                str = CLConstants.ERROR_TECHNICAL_ERROR;
            }
            getCredential.showError(str);
            return bool;
        }
    }

    public void attachBaseContext(Context context) {
        super.attachBaseContext(p.a(context, new n(context).b(CLConstants.SHARED_PREFERENCE_ITEM_LANG_PREF, CLConstants.DEFAULT_LANGUAGE_PREFERENCE)));
    }

    public boolean checkSMSReadPermission() {
        return checkCallingOrSelfPermission("android.permission.READ_SMS") == 0;
    }

    public boolean checkSMSReceivePermission() {
        return checkCallingOrSelfPermission("android.permission.RECEIVE_SMS") == 0;
    }

    public e getCredBlockBuilder() {
        return this.credBlockBuilder;
    }

    public o getLiteInstace() {
        return this.lite;
    }

    public void loadFragment(s sVar, Bundle bundle, boolean z) {
        try {
            FragmentManager supportFragmentManager = getSupportFragmentManager();
            if (bundle != null) {
                sVar.setArguments(bundle);
            }
            FragmentTransaction d2 = supportFragmentManager.d();
            int i2 = R.id.main_inner_layout;
            if (i2 == 0) {
                throw new IllegalArgumentException("Must use non-zero containerViewId");
            }
            d2.j(i2, sVar, (String) null, 2);
            if (z) {
                d2.c(sVar.getClass().getSimpleName());
            }
            d2.e();
            setCurrentFragment(sVar);
        } catch (Exception unused) {
            q.a("CommonLibrary", "Exception while loading Fragment");
        }
    }

    public void onActivityResult(int i2, int i3, Intent intent) {
        super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(i2, i3, intent);
        if (i3 == -1) {
            try {
                if (i2 == CLConstants.FIELD_LOAD_MONEY_FLOW.intValue()) {
                    this.lite.d();
                } else if (i2 == CLConstants.FIELD_LITE_PAY_FLOW.intValue()) {
                    this.lite.e();
                }
            } catch (Exception e2) {
                q.a(TAG, e2);
                ((GetCredential) this.context).showError(CLConstants.ERROR_TECHNICAL_ERROR);
            }
        }
    }

    public void onBackPressed() {
        if (!this.doubleBackToExitPressedOnce) {
            this.doubleBackToExitPressedOnce = true;
            Toast.makeText((Context) this, (CharSequence) getString(R.string.back_button_exit_message), 0).show();
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    GetCredential.this.doubleBackToExitPressedOnce = false;
                }
            }, 2000L);
        } else {
            this.credBlockBuilder.g().c().send(0, androidx.room.util.a.i("error", CLConstants.OUTPUT_ERROR_MESSAGE));
            Fragment fragment = this.fragment;
            if (fragment != null) {
                ((w) fragment).f();
            }
            super/*androidx.activity.ComponentActivity*/.onBackPressed();
        }
    }

    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
    }

    public void onCreate(Bundle bundle) {
        int i2;
        int i3;
        getWindow().setFlags(8192, 8192);
        super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
        this.defaultHandler = Thread.currentThread().getUncaughtExceptionHandler();
        Thread.currentThread().setUncaughtExceptionHandler(new j());
        e eVar = new e(getIntent().getExtras());
        this.credBlockBuilder = eVar;
        try {
            eVar.a((Context) this);
            readUIArguments();
            if (!this.credBlockBuilder.p().toString().contains(CLConstants.CREDTYPE_SIGNATURE) || validateLiteRequest().booleanValue()) {
                if (this.credBlockBuilder.s()) {
                    headLessFlow();
                    return;
                }
                setContentView(R.layout.activity_pin_activity_component);
                if (this.urlChecker.booleanValue()) {
                    org.npci.upi.security.pinactivitycomponent.a aVar = new org.npci.upi.security.pinactivitycomponent.a(this, this.imageUrl);
                    this.bitmapPicture = aVar;
                    aVar.execute(new String[0]);
                }
                ImageView imageView = (ImageView) findViewById(R.id.bank_image);
                this.bankImage = imageView;
                Bitmap bitmap = this.bitmap;
                if (bitmap != null) {
                    imageView.setImageBitmap(bitmap);
                }
                renderTransactionBar();
                renderTransactionDetails();
                Keypad keypad = setupKeyboard();
                ((LinearLayout) findViewById(R.id.toolBar)).setPadding(0, 10, 0, 0);
                FrameLayout frameLayout = (FrameLayout) findViewById(R.id.main_inner_layout);
                DisplayMetrics displayMetrics = getDisplayMetrics();
                if (displayMetrics.densityDpi > 320 || (i3 = displayMetrics.heightPixels) > 1184) {
                    i2 = 50;
                } else {
                    if (i3 <= 800) {
                        ViewGroup.LayoutParams layoutParams = keypad.getLayoutParams();
                        layoutParams.height = 280;
                        keypad.setLayoutParams(layoutParams);
                    }
                    i2 = 0;
                }
                frameLayout.setPadding(0, i2, 0, 0);
                w wVar = new w();
                this.fragment = wVar;
                loadFragment(wVar, getIntent().getExtras(), false);
                TextView textView = (TextView) findViewById(R.id.go_back);
                if (textView != null) {
                    textView.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            GetCredential.this.goBack();
                        }
                    });
                }
            }
        } catch (Exception unused) {
        }
    }

    public void onDestroy() {
        super.onDestroy();
        if (_instance != null) {
            _instance = null;
        }
        Thread.currentThread().setUncaughtExceptionHandler(this.defaultHandler);
    }

    public void onPause() {
        super/*androidx.fragment.app.FragmentActivity*/.onPause();
        unregisterSMSReceiver();
    }

    public void onResume() {
        super/*androidx.fragment.app.FragmentActivity*/.onResume();
        if (!checkSMSReceivePermission()) {
            q.a(TAG, "RECEIVE_SMS permission not provided by the App. This will affect Auto OTP detection feature of Common Library");
        } else {
            this.smsReceiver = new a();
            registerSMSReceiver();
        }
    }

    public void renderTransactionBar() {
        String str;
        String str2;
        String str3;
        JSONObject jSONObject;
        String optString;
        String optString2 = this.credBlockBuilder.c() != null ? this.credBlockBuilder.c().optString("payerBankName") : "";
        JSONObject d2 = this.credBlockBuilder.d();
        JSONArray e2 = this.credBlockBuilder.e();
        if (d2 == null) {
            new c(this, "l12", CLConstants.ERROR_MSG_SALT_MISSING);
            return;
        }
        String optString3 = d2.optString("txnAmount");
        try {
            this.credBlockBuilder.a(d2.getJSONArray(CLConstants.OUTPUT_CRED_TYPE));
            for (int i2 = 0; i2 < this.credBlockBuilder.n().length(); i2++) {
                if (this.credBlockBuilder.n().getString(i2).equals(CLConstants.CRED_TYPE_MANDATE)) {
                    this.credType = this.credBlockBuilder.n().getString(i2);
                }
            }
        } catch (JSONException e3) {
            e3.printStackTrace();
        }
        String str4 = "";
        for (int i3 = 0; i3 < e2.length(); i3++) {
            try {
            } catch (Exception e4) {
                q.a(TAG, e4);
            }
            if (((JSONObject) e2.get(i3)).optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_ACCOUNT)) {
                String optString4 = ((JSONObject) e2.get(i3)).optString(CLConstants.FIELD_PAY_INFO_VALUE, "");
                str4 = CLConstants.MASK_CHARACTER + optString4.substring(optString4.length() - 4, optString4.length());
            } else if (((JSONObject) e2.get(i3)).optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals("payeeVpa")) {
                str4 = ((JSONObject) e2.get(i3)).optString(CLConstants.FIELD_PAY_INFO_VALUE, "");
            } else {
                continue;
            }
        }
        for (int i4 = 0; i4 < e2.length(); i4++) {
            try {
            } catch (Exception e5) {
                q.a(TAG, e5);
            }
            if (((JSONObject) e2.get(i4)).optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_PAYEE_NAME)) {
                jSONObject = (JSONObject) e2.get(i4);
            } else if (((JSONObject) e2.get(i4)).optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_ACCOUNT)) {
                jSONObject = (JSONObject) e2.get(i4);
            } else {
                if (((JSONObject) e2.get(i4)).optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals("mobileNumber")) {
                    optString = ((JSONObject) e2.get(i4)).optString("mobileNumber", "");
                    str = optString;
                    break;
                }
            }
            optString = jSONObject.optString(CLConstants.FIELD_PAY_INFO_VALUE, "");
            str = optString;
        }
        str = "";
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.transaction_bar_root);
        TextView textView = (TextView) findViewById(R.id.tv_acc_or_payee);
        TextView textView2 = (TextView) findViewById(R.id.tv_acc_or_payee_name);
        TextView textView3 = (TextView) findViewById(R.id.transaction_payee_label);
        TextView textView4 = (TextView) findViewById(R.id.transaction_payee_value);
        TextView textView5 = (TextView) findViewById(R.id.transaction_amount_title);
        TextView textView6 = (TextView) findViewById(R.id.transaction_amount_value);
        String str5 = CLConstants.FIELD_PAY_INFO_VALUE;
        this.mTransactionBarArrow = (ImageView) findViewById(R.id.transaction_bar_arrow);
        textView2.setText(str4);
        if (!optString2.equals("")) {
            textView.setText(optString2);
        }
        if (optString3.equals("") || optString3.equalsIgnoreCase("null") || Double.parseDouble(optString3) <= 0.0d) {
            textView5.setText("");
            textView3.setText("");
            textView6.setText("");
            textView4.setText("");
            int i5 = 0;
            while (i5 < e2.length()) {
                try {
                } catch (Exception e6) {
                    e = e6;
                    str2 = str5;
                }
                if (((JSONObject) e2.get(i5)).optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_NOTE)) {
                    str2 = str5;
                    try {
                        str = ((JSONObject) e2.get(i5)).optString(str2, "");
                        break;
                    } catch (Exception e7) {
                        e = e7;
                        q.a(TAG, e);
                        i5++;
                        str5 = str2;
                    }
                } else {
                    str2 = str5;
                    i5++;
                    str5 = str2;
                }
            }
            textView5.setText(str);
            textView5.setEllipsize(TextUtils.TruncateAt.END);
            textView5.setSingleLine(true);
        } else {
            String concat = CLConstants.RUPEES_SYMBOL.concat(optString3);
            String str6 = this.credType;
            if (str6 == null || !str6.equals(CLConstants.CRED_TYPE_MANDATE)) {
                textView5.setText(CLConstants.SENDING_AMOUNT_TITLE);
                str3 = CLConstants.SENDING_TO_TITLE;
            } else {
                textView5.setText(CLConstants.SENDING_MANDATE_AMOUNT_TITLE);
                str3 = CLConstants.SENDING_MANDATE_TO_TITLE;
            }
            textView3.setText(str3);
            textView6.setText(concat);
            textView4.setText(str);
        }
        Display defaultDisplay = getWindowManager().getDefaultDisplay();
        Point point = new Point();
        defaultDisplay.getSize(point);
        this.mActivityHeight = point.y;
        linearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                GetCredential.this.toggleTransactionDetails(!r2.isTransactionDetailsExpanded());
            }
        });
        this.mTransactionDetailScroller = findViewById(R.id.transaction_details_scroller);
        this.mTransactionDetailSpace = findViewById(R.id.transaction_details_expanded_space);
        this.mTransactionDetailScroller.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                if (view.getId() != R.id.transaction_details_scroller || motionEvent.getAction() != 1 || !GetCredential.this.isTransactionDetailsExpanded()) {
                    return false;
                }
                GetCredential.this.toggleTransactionDetails(false);
                return true;
            }
        });
        View view = this.mTransactionDetailSpace;
        if (view != null) {
            view.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View view2, MotionEvent motionEvent) {
                    if (motionEvent.getAction() != 1 || !GetCredential.this.isTransactionDetailsExpanded()) {
                        return false;
                    }
                    GetCredential.this.toggleTransactionDetails(false);
                    return true;
                }
            });
        }
        TransitionDrawable transitionDrawable = (TransitionDrawable) findViewById(R.id.transaction_info_root).getBackground();
        this.mTransitionDrawable = transitionDrawable;
        transitionDrawable.setCrossFadeEnabled(true);
    }

    public void renderTransactionDetails() {
        String str;
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.transaction_details_root);
        JSONArray e2 = this.credBlockBuilder.e();
        for (int i2 = 0; i2 < e2.length(); i2++) {
            ViewGroup viewGroup = (ViewGroup) LayoutInflater.from(this).inflate(R.layout.layout_transaction_details_item, (ViewGroup) linearLayout, false);
            TextView textView = (TextView) viewGroup.findViewById(R.id.transaction_details_item_name);
            TextView textView2 = (TextView) viewGroup.findViewById(R.id.transaction_details_item_value);
            TextView textView3 = (TextView) viewGroup.findViewById(R.id.verified);
            LinearLayout linearLayout2 = (LinearLayout) viewGroup.findViewById(R.id.verified_merchant);
            JSONObject optJSONObject = e2.optJSONObject(i2);
            if (optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_PAYEE_NAME)) {
                String str2 = this.credType;
                textView.setText(((str2 == null || !str2.equals(CLConstants.CRED_TYPE_MANDATE)) ? CLConstants.DROP_LIST_PAYING_TO_LABEL : CLConstants.DROP_LIST_PAYING_MANDATE_TO_LABEL).toUpperCase());
                textView2.setText(optJSONObject.optString(CLConstants.FIELD_PAY_INFO_VALUE));
                textView3.setText(CLConstants.DROP_LIST_VERIFIED);
                if (this.verifiedMerchant.booleanValue()) {
                    linearLayout2.setVisibility(0);
                }
            } else {
                if (optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals("txnAmount") || optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_TXN_AMOUNT_ALTR)) {
                    String str3 = this.credType;
                    textView.setText(((str3 == null || !str3.equals(CLConstants.CRED_TYPE_MANDATE)) ? CLConstants.DROP_LIST_AMOUNT_LABEL : CLConstants.DROP_LIST_AMOUNT_MANDATE_LABEL).toUpperCase());
                    str = CLConstants.RUPEES_SYMBOL + optJSONObject.optString(CLConstants.FIELD_PAY_INFO_VALUE);
                } else {
                    textView.setText((optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_NOTE) ? CLConstants.DROP_LIST_DETAILS_LABEL : optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals("mobileNumber") ? CLConstants.DROP_LIST_MOBILE_LABEL : optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_REF_URL) ? CLConstants.DROP_LIST_REFURL_LABEL : optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_REF_ID) ? CLConstants.DROP_LIST_REFID_LABEL : optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME, "").equals(CLConstants.LABEL_MANDATE_TXN_SUBTYPE) ? CLConstants.DROP_LIST_MANDATE_SUBYPE_LABEL : optJSONObject.optString(CLConstants.FIELD_PAY_INFO_NAME)).toUpperCase());
                    str = optJSONObject.optString(CLConstants.FIELD_PAY_INFO_VALUE);
                }
                textView2.setText(str);
            }
            linearLayout.addView(viewGroup);
        }
        View view = new View(this);
        view.setLayoutParams(new LinearLayout.LayoutParams(-1, pix(3.0f)));
        view.setBackgroundColor(-16777216);
        WeakHashMap weakHashMap = ViewCompat.a;
        view.setAlpha(0.33f);
        linearLayout.addView(view);
    }

    public void rotateView(float f2, float f3, int i2, View view) {
        RotateAnimation rotateAnimation = new RotateAnimation(f2, f3, 1, 0.5f, 1, 0.5f);
        rotateAnimation.setInterpolator(new LinearInterpolator());
        rotateAnimation.setDuration(i2);
        rotateAnimation.setFillEnabled(true);
        rotateAnimation.setFillAfter(true);
        view.startAnimation(rotateAnimation);
    }

    public void setCurrentFragment(s sVar) {
        this.currentFragment = sVar;
    }

    public void setNumDigitsOfOTP(int i2) {
        this.numDigitsOfOTP = i2;
    }

    public void showError(String str) {
        this.credBlockBuilder.g().c().send(0, androidx.room.util.a.i("error", str));
        finish();
    }

    public void triggredOTPResponse(String str) {
        ((w) this.fragment).a(str);
    }

    public void showError(String str, String str2) {
        Bundle bundle = new Bundle();
        bundle.putString(CLConstants.FIELD_ERROR_CODE, str);
        bundle.putString("error", str2);
        this.credBlockBuilder.g().c().send(0, bundle);
        finish();
    }
}