导航菜单

页面标题

页面副标题

OLX India v19.42.007 - PayUOtpAssistActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 PayUOtpAssistActivity.java JAVA 源代码文件

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


package com.payu.otpassist;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import com.payu.otpassist.javascriptinterface.PayUOtpAssistWebInterface;
import com.payu.otpassist.utils.Constants;
import com.payu.payuanalytics.analytics.factory.AnalyticsFactory;
import com.payu.payuanalytics.analytics.model.AnalyticsType;
import com.payu.payuanalytics.analytics.model.PayUAnalytics;
import kotlin.Metadata;
import kotlin.text.Charsets;

@Metadata
public final class PayUOtpAssistActivity extends androidx.appcompat.app.d {
    public WebView Q;
    public com.payu.otpassist.viewmodel.d R;
    public d S;
    public boolean T;
    public PayUAnalytics U;
    public AlertDialog V;
    public String W;

    public static final void h2(PayUOtpAssistActivity payUOtpAssistActivity, DialogInterface dialogInterface, int i) {
        com.payu.otpassist.viewmodel.d dVar;
        if (i == -2) {
            dialogInterface.dismiss();
        } else if (i == -1 && (dVar = payUOtpAssistActivity.R) != null) {
            dVar.z0(true);
        }
    }

    public static final void i2(PayUOtpAssistActivity payUOtpAssistActivity, Boolean bool) {
        if (bool.booleanValue()) {
            Object systemService = payUOtpAssistActivity.getSystemService("input_method");
            if (systemService == null) {
                throw new NullPointerException("null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
            }
            InputMethodManager inputMethodManager = (InputMethodManager) systemService;
            View currentFocus = payUOtpAssistActivity.getCurrentFocus();
            if (currentFocus == null) {
                currentFocus = new View(payUOtpAssistActivity);
            }
            inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
            d dVar = payUOtpAssistActivity.S;
            if (dVar == null) {
                return;
            }
            dVar.dismiss();
        }
    }

    public static final void j2(PayUOtpAssistActivity payUOtpAssistActivity, String str) {
        payUOtpAssistActivity.W = str;
    }

    public static final void m2(PayUOtpAssistActivity payUOtpAssistActivity, Boolean bool) {
        if (bool.booleanValue()) {
            Object systemService = payUOtpAssistActivity.getSystemService("input_method");
            if (systemService == null) {
                throw new NullPointerException("null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
            }
            InputMethodManager inputMethodManager = (InputMethodManager) systemService;
            View currentFocus = payUOtpAssistActivity.getCurrentFocus();
            if (currentFocus == null) {
                currentFocus = new View(payUOtpAssistActivity);
            }
            inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
            d dVar = payUOtpAssistActivity.S;
            if (dVar != null) {
                dVar.dismiss();
            }
            payUOtpAssistActivity.finish();
        }
    }

    public static final void n2(PayUOtpAssistActivity payUOtpAssistActivity, String str) {
        payUOtpAssistActivity.T = true;
        payUOtpAssistActivity.getWindow().setLayout(-1, -1);
        payUOtpAssistActivity.setTheme(b0.PayU_Otp_Assist_Opaque_Screen);
        WebView webView = payUOtpAssistActivity.Q;
        if (webView != null) {
            webView.setVisibility(0);
            WebView webView2 = payUOtpAssistActivity.Q;
            if (webView2 == null) {
                return;
            }
            String str2 = payUOtpAssistActivity.W;
            webView2.postUrl(str, str2 == null ? null : str2.getBytes(Charsets.b));
        }
    }

    public static final void o2(PayUOtpAssistActivity payUOtpAssistActivity, String str) {
        payUOtpAssistActivity.T = true;
        payUOtpAssistActivity.getWindow().setLayout(-1, -1);
        payUOtpAssistActivity.setTheme(b0.PayU_Otp_Assist_Opaque_Screen);
        WebView webView = payUOtpAssistActivity.Q;
        if (webView != null) {
            webView.setVisibility(0);
            WebView webView2 = payUOtpAssistActivity.Q;
            if (webView2 == null) {
                return;
            }
            webView2.loadData(str, "text/html; charset=utf-8", "UTF-8");
        }
    }

    public static final void p2(PayUOtpAssistActivity payUOtpAssistActivity, String str) {
        com.payu.otpassist.viewmodel.d dVar = payUOtpAssistActivity.R;
        if (dVar == null) {
            return;
        }
        dVar.C0(Constants.UN_EXPECTED_RESPONSE_ERROR_CODE, str, Constants.ERROR_REPONSE_VIEW_MODEL);
    }

    public final void a() {
        MutableLiveData mutableLiveData;
        MutableLiveData mutableLiveData2;
        MutableLiveData mutableLiveData3;
        MutableLiveData mutableLiveData4;
        MutableLiveData mutableLiveData5;
        MutableLiveData mutableLiveData6;
        com.payu.otpassist.viewmodel.d dVar = this.R;
        if (dVar != null && (mutableLiveData6 = dVar.d) != null) {
            mutableLiveData6.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    PayUOtpAssistActivity.j2(PayUOtpAssistActivity.this, (String) obj);
                }
            });
        }
        com.payu.otpassist.viewmodel.d dVar2 = this.R;
        if (dVar2 != null && (mutableLiveData5 = dVar2.c) != null) {
            mutableLiveData5.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    PayUOtpAssistActivity.n2(PayUOtpAssistActivity.this, (String) obj);
                }
            });
        }
        com.payu.otpassist.viewmodel.d dVar3 = this.R;
        if (dVar3 != null && (mutableLiveData4 = dVar3.n) != null) {
            mutableLiveData4.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    PayUOtpAssistActivity.o2(PayUOtpAssistActivity.this, (String) obj);
                }
            });
        }
        com.payu.otpassist.viewmodel.d dVar4 = this.R;
        if (dVar4 != null && (mutableLiveData3 = dVar4.b) != null) {
            mutableLiveData3.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    PayUOtpAssistActivity.p2(PayUOtpAssistActivity.this, (String) obj);
                }
            });
        }
        com.payu.otpassist.viewmodel.d dVar5 = this.R;
        if (dVar5 != null && (mutableLiveData2 = dVar5.p) != null) {
            mutableLiveData2.observe(this, new Observer() {
                public final void onChanged(Object obj) {
                    PayUOtpAssistActivity.i2(PayUOtpAssistActivity.this, (Boolean) obj);
                }
            });
        }
        com.payu.otpassist.viewmodel.d dVar6 = this.R;
        if (dVar6 == null || (mutableLiveData = dVar6.g) == null) {
            return;
        }
        mutableLiveData.observe(this, new Observer() {
            public final void onChanged(Object obj) {
                PayUOtpAssistActivity.m2(PayUOtpAssistActivity.this, (Boolean) obj);
            }
        });
    }

    public final void k2() {
        DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                PayUOtpAssistActivity.h2(PayUOtpAssistActivity.this, dialogInterface, i);
            }
        };
        if (isFinishing() || isDestroyed()) {
            return;
        }
        String string = getString(a0.payu_yes);
        String string2 = getString(a0.payu_no);
        String string3 = getString(a0.payu_do_you_really_want_to_cancel_the_payment);
        AlertDialog.Builder builder = new AlertDialog.Builder(this, b0.PayU_Otp_Acs_Cancel_Dialog);
        if (string3 != null) {
            builder.setMessage(string3);
        }
        if (string != null) {
            builder.setPositiveButton(string, onClickListener);
        }
        if (string2 != null) {
            builder.setNegativeButton(string2, onClickListener);
        }
        AlertDialog create = builder.create();
        this.V = create;
        if (create == null) {
            return;
        }
        create.show();
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        super/*androidx.fragment.app.r*/.onActivityResult(i, i2, intent);
        for (Fragment fragment : getSupportFragmentManager().F0()) {
            if (fragment != null && (fragment instanceof d)) {
                fragment.onActivityResult(i, i2, intent);
            }
        }
    }

    public void onBackPressed() {
        if (this.T) {
            k2();
            return;
        }
        Object systemService = getSystemService("input_method");
        if (systemService == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
        }
        InputMethodManager inputMethodManager = (InputMethodManager) systemService;
        View currentFocus = getCurrentFocus();
        if (currentFocus == null) {
            currentFocus = new View(this);
        }
        inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
        com.payu.otpassist.viewmodel.d dVar = d.o1;
        if (dVar == null || dVar == null) {
            dVar = null;
        }
        if (dVar == null) {
            return;
        }
        dVar.F0();
    }

    public void onCreate(Bundle bundle) {
        Bundle extras;
        Bundle extras2;
        super/*androidx.fragment.app.r*/.onCreate(bundle);
        setContentView(z.activity_pay_u_otp_assist);
        Object obj = null;
        if (getIntent() != null) {
            Intent intent = getIntent();
            if ((intent == null ? null : intent.getExtras()) != null) {
                Intent intent2 = getIntent();
                if (((intent2 == null || (extras2 = intent2.getExtras()) == null) ? null : extras2.get("post_data")) != null) {
                    this.U = (PayUAnalytics) new AnalyticsFactory(getApplicationContext(), null, 2, null).getAnalyticsClass(AnalyticsType.PAYU_ANALYTICS);
                    com.payu.otpassist.viewmodel.d dVar = new com.payu.otpassist.viewmodel.d(getApplication(), this.U);
                    this.R = dVar;
                    Intent intent3 = getIntent();
                    dVar.G0((intent3 == null || (extras = intent3.getExtras()) == null) ? null : extras.getString("post_data"));
                    a();
                    d.o1 = this.R;
                    d dVar2 = new d();
                    this.S = dVar2;
                    dVar2.setCancelable(false);
                    d dVar3 = this.S;
                    if (dVar3 != null) {
                        dVar3.show(getSupportFragmentManager(), "OtpAssistBottomSheet");
                    }
                }
            }
        }
        Object systemService = getSystemService("input_method");
        if (systemService == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
        }
        InputMethodManager inputMethodManager = (InputMethodManager) systemService;
        View currentFocus = getCurrentFocus();
        if (currentFocus == null) {
            currentFocus = new View(this);
        }
        inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
        PayUOtpAssistConfig payUOtpAssistConfig = e0.c;
        if (payUOtpAssistConfig != null ? payUOtpAssistConfig.isProtectedScreen() : false) {
            getWindow().setFlags(8192, 8192);
        } else {
            getWindow().clearFlags(8192);
        }
        WebView webView = (WebView) findViewById(y.otpAssistWebView);
        this.Q = webView;
        if (webView != null) {
            WebSettings settings = webView.getSettings();
            if (settings != null) {
                settings.setJavaScriptEnabled(true);
            }
            PayUOtpAssistConfig payUOtpAssistConfig2 = e0.c;
            if (payUOtpAssistConfig2 == null || payUOtpAssistConfig2.getWebInterface() == null) {
                PayUOtpAssistWebInterface payUOtpAssistWebInterface = new PayUOtpAssistWebInterface();
                payUOtpAssistWebInterface.setViewModel(this.R);
                payUOtpAssistWebInterface.setActivity(this);
                WebView webView2 = this.Q;
                if (webView2 != null) {
                    webView2.addJavascriptInterface(payUOtpAssistWebInterface, "PayU");
                }
            } else {
                PayUOtpAssistConfig payUOtpAssistConfig3 = e0.c;
                if ((payUOtpAssistConfig3 == null ? null : payUOtpAssistConfig3.getWebInterface()) instanceof PayUOtpAssistWebInterface) {
                    PayUOtpAssistConfig payUOtpAssistConfig4 = e0.c;
                    Object webInterface = payUOtpAssistConfig4 != null ? payUOtpAssistConfig4.getWebInterface() : null;
                    if (webInterface == null) {
                        throw new NullPointerException("null cannot be cast to non-null type com.payu.otpassist.javascriptinterface.PayUOtpAssistWebInterface");
                    }
                    PayUOtpAssistWebInterface payUOtpAssistWebInterface2 = (PayUOtpAssistWebInterface) webInterface;
                    payUOtpAssistWebInterface2.setActivity(this);
                    obj = payUOtpAssistWebInterface2;
                } else {
                    PayUOtpAssistConfig payUOtpAssistConfig5 = e0.c;
                    if (payUOtpAssistConfig5 != null) {
                        obj = payUOtpAssistConfig5.getWebInterface();
                    }
                }
                WebView webView3 = this.Q;
                if (webView3 != null) {
                    webView3.addJavascriptInterface(obj, "PayU");
                }
            }
            WebView webView4 = this.Q;
            if (webView4 != null) {
                webView4.setVisibility(8);
            }
            WebView webView5 = this.Q;
            if (webView5 == null) {
                return;
            }
            webView5.setWebViewClient(new d0(this));
        }
    }

    public void onDestroy() {
        super.onDestroy();
        getWindow().clearFlags(8192);
    }

    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super/*androidx.fragment.app.r*/.onRequestPermissionsResult(i, strArr, iArr);
        for (Fragment fragment : getSupportFragmentManager().F0()) {
            if (fragment != null && (fragment instanceof d)) {
                fragment.onRequestPermissionsResult(i, strArr, iArr);
            }
        }
    }
}