导航菜单

页面标题

页面副标题

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

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

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


package com.payu.otpassist.utils;

import android.util.Base64;
import com.payu.otpassist.models.e;
import com.payu.otpassist.models.f;
import com.payu.otpassist.models.j;
import com.payu.otpassist.models.k;
import com.payu.otpassist.models.n;
import com.payu.otpassist.models.o;
import com.payu.otpassist.models.p;
import com.payu.ui.model.utils.SdkUiConstants;
import java.util.HashMap;
import java.util.List;
import java.util.StringTokenizer;
import kotlin.NoWhenBranchMatchedException;
import kotlin.collections.h;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
import kotlin.text.StringsKt__StringsKt;
import kotlin.text.m;
import org.json.JSONObject;

public final class c {
    public static final c a = new c();

    public class a {
        public static final int[] a;
        public static final int[] b;

        static {
            com.payu.otpassist.models.a.values();
            a = new int[]{1, 0};
            p.values();
            b = new int[]{2, 1};
        }
    }

    public final String a(String str) {
        String str2;
        List H0;
        try {
            str2 = new String(Base64.decode(str, 0), Charsets.b);
        } catch (IllegalArgumentException unused) {
            str2 = null;
        }
        List H02 = str2 != null ? StringsKt__StringsKt.H0(str2, new String[]{"action=\""}, false, 0, 6, null) : null;
        if (H02 == null) {
            H02 = h.k();
        }
        if (H02.size() <= 1) {
            return "";
        }
        H0 = StringsKt__StringsKt.H0((CharSequence) H02.get(1), new String[]{"\""}, false, 0, 6, null);
        return (String) H0.get(0);
    }

    public final String b(String str, double d) {
        int c;
        String K;
        c = kotlin.math.b.c(d * 255);
        String hexString = Long.toHexString(c);
        if (hexString.length() == 1) {
            hexString = Intrinsics.j("0", hexString);
        }
        K = m.K(str, SdkUiConstants.HASH, Intrinsics.j(SdkUiConstants.HASH, hexString), false, 4, null);
        return K;
    }

    public final String c(HashMap hashMap) {
        StringBuilder sb = new StringBuilder();
        if (hashMap.size() <= 0) {
            return "";
        }
        for (String str : hashMap.keySet()) {
            sb.append(str);
            sb.append(Constants.EQUALS);
            sb.append((String) hashMap.get(str));
            sb.append(Constants.AMPERSAND);
        }
        return sb.toString().substring(0, sb.lastIndexOf(Constants.AMPERSAND));
    }

    public final String d(boolean z, com.payu.otpassist.models.a aVar, p pVar) {
        String j;
        String str;
        if (z) {
            j = Intrinsics.j("", a.a[aVar.ordinal()] == 1 ? Constants.PROD_BASE_SECURE_URL : Constants.PROD_BASE_INFO_URL);
        } else {
            int i = a.a[aVar.ordinal()];
            j = Intrinsics.j("", "https://test.payu.in/");
        }
        int ordinal = pVar.ordinal();
        if (ordinal == 0) {
            str = Constants.PAYMENT_URL_PATH;
        } else {
            if (ordinal != 1) {
                throw new NoWhenBranchMatchedException();
            }
            str = Constants.CHECK_SECURE_TXN_PATH;
        }
        return Intrinsics.j(j, str);
    }

    public final HashMap e(String str) {
        List H0;
        String str2;
        HashMap hashMap = new HashMap();
        if (str != null) {
            StringTokenizer stringTokenizer = new StringTokenizer(str, Constants.AMPERSAND);
            while (stringTokenizer.hasMoreTokens()) {
                H0 = StringsKt__StringsKt.H0(stringTokenizer.nextToken(), new String[]{Constants.EQUALS}, false, 0, 6, null);
                String[] strArr = (String[]) H0.toArray(new String[0]);
                if ((!(strArr.length == 0)) && (str2 = strArr[0]) != null) {
                    hashMap.put(str2, strArr.length > 1 ? strArr[1] : "");
                }
            }
        }
        return hashMap;
    }

    public final com.payu.otpassist.models.h f(java.lang.String r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.payu.otpassist.utils.c.f(java.lang.String):com.payu.otpassist.models.h");
    }

    public final k g(String str) {
        j jVar;
        JSONObject jSONObject = new JSONObject(str);
        f fVar = null;
        if (jSONObject.has(Constants.META_DATA)) {
            JSONObject optJSONObject = jSONObject.optJSONObject(Constants.META_DATA);
            JSONObject optJSONObject2 = optJSONObject == null ? null : optJSONObject.optJSONObject(Constants.RESEND_OTP_WITHOUT_UNDERSCORE);
            JSONObject optJSONObject3 = optJSONObject == null ? null : optJSONObject.optJSONObject(Constants.SUBMIT_OTP_WITHOUT_UNDERSCORE);
            if (optJSONObject2 != null && optJSONObject2.has(Constants.ATTEMPTS_LEFT)) {
                jVar = new j(optJSONObject2.optString("status"), Integer.valueOf(optJSONObject2.optInt(Constants.ATTEMPTS_LEFT)));
            } else if (optJSONObject3 == null || !optJSONObject3.has(Constants.RETRY_ATTEMPT_COUNT)) {
                jVar = null;
            } else {
                String optString = optJSONObject3.optString("status");
                if (Intrinsics.d(optString, Constants.IN_PROGRESS)) {
                    optString = "failed";
                }
                jVar = new j(optString, Integer.valueOf(optJSONObject3.optInt(Constants.RETRY_ATTEMPT_COUNT)));
            }
            fVar = new f(optJSONObject == null ? null : optJSONObject.optString("message"), optJSONObject == null ? null : optJSONObject.optString(Constants.REFERENCE_ID), optJSONObject == null ? null : optJSONObject.optString(Constants.STATUS_CODE), jVar, optJSONObject == null ? null : optJSONObject.optString("txnid"), optJSONObject != null ? optJSONObject.optString(Constants.UNMAPPED_STATUS) : null);
        }
        return new k(fVar);
    }

    public final o h(String str) {
        n nVar;
        n nVar2;
        JSONObject jSONObject = new JSONObject(str);
        e eVar = null;
        if (jSONObject.has(Constants.META_DATA)) {
            JSONObject optJSONObject = jSONObject.optJSONObject(Constants.META_DATA);
            if (optJSONObject == null || !optJSONObject.has(Constants.SUBMIT_OTP_WITHOUT_UNDERSCORE)) {
                nVar = null;
            } else {
                JSONObject jSONObject2 = optJSONObject.getJSONObject(Constants.SUBMIT_OTP_WITHOUT_UNDERSCORE);
                if (jSONObject2.has(Constants.RETRY_ATTEMPT_COUNT)) {
                    String optString = jSONObject2.optString("status");
                    if (Intrinsics.d(optString, Constants.IN_PROGRESS)) {
                        optString = "failed";
                    }
                    nVar2 = new n(optString, Integer.valueOf(jSONObject2.optInt(Constants.RETRY_ATTEMPT_COUNT)));
                } else {
                    JSONObject optJSONObject2 = optJSONObject.optJSONObject(Constants.SUBMIT_OTP_WITHOUT_UNDERSCORE);
                    nVar2 = new n(optJSONObject2 == null ? null : optJSONObject2.optString("status"), optJSONObject2 == null ? null : Integer.valueOf(optJSONObject2.optInt(Constants.ATTEMPTS_LEFT)));
                }
                nVar = nVar2;
            }
            eVar = new e(optJSONObject == null ? null : optJSONObject.optString("message"), optJSONObject == null ? null : optJSONObject.optString(Constants.REFERENCE_ID), optJSONObject == null ? null : optJSONObject.optString(Constants.STATUS_CODE), nVar, optJSONObject == null ? null : optJSONObject.optString("txnid"), optJSONObject != null ? optJSONObject.optString(Constants.UNMAPPED_STATUS) : null);
        }
        return new o(eVar);
    }
}