导航菜单

页面标题

页面副标题

Clash Legends v0.0.1 - c.java 源代码

正在查看: Clash Legends v0.0.1 应用的 c.java JAVA 源代码文件

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


package com.payu.custombrowser.util;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.telephony.CellInfo;
import android.telephony.CellInfoCdma;
import android.telephony.CellInfoGsm;
import android.telephony.CellInfoLte;
import android.telephony.CellInfoWcdma;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.WebView;
import com.onesignal.core.internal.config.InfluenceConfigModel;
import com.payu.custombrowser.R;
import com.payu.custombrowser.bean.CustomBrowserConfig;
import com.payu.india.Payu.PayuConstants;
import com.payu.otpassist.utils.Constants;
import com.payu.upisdk.util.UpiConstant;
import io.card.payment.CreditCard;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Timer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;
import javax.net.ssl.HttpsURLConnection;
import kotlinx.coroutines.internal.LockFreeTaskQueueCore;
import kotlinx.coroutines.scheduling.WorkQueueKt;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class c {
    private static SharedPreferences a;

    public static String a() {
        try {
            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis()));
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    public static HttpsURLConnection e(String str) {
        try {
            HttpsURLConnection httpsURLConnection = (HttpsURLConnection) new URL(str).openConnection();
            httpsURLConnection.setRequestMethod(PayuConstants.REQUEST_METHOD_GET);
            httpsURLConnection.setSSLSocketFactory(new h());
            httpsURLConnection.setRequestProperty("Accept-Charset", "UTF-8");
            return httpsURLConnection;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public static boolean g(Context context) {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
        return activeNetworkInfo != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.isConnected();
    }

    public static String i(String str) {
        try {
            if (!str.contains(b.CB_DELIMITER)) {
                return str.length() > 128 ? str.substring(0, WorkQueueKt.MASK) : str;
            }
            StringTokenizer stringTokenizer = new StringTokenizer(str, b.CB_DELIMITER);
            String nextToken = stringTokenizer.nextToken();
            String nextToken2 = stringTokenizer.nextToken();
            if (nextToken.length() > 128) {
                nextToken = nextToken.substring(0, 125);
            }
            if (nextToken2.length() > 128) {
                nextToken2 = nextToken2.substring(0, 125);
            }
            return nextToken + b.CB_DELIMITER + nextToken2;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    public NetworkInfo b(Context context) {
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
        NetworkInfo networkInfo = null;
        for (Network network : connectivityManager.getAllNetworks()) {
            NetworkInfo networkInfo2 = connectivityManager.getNetworkInfo(network);
            if (networkInfo2.getState().equals(NetworkInfo.State.CONNECTED)) {
                networkInfo = networkInfo2;
            }
        }
        return networkInfo;
    }

    public String c(Context context) {
        if (context != null) {
            try {
                NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
                if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) {
                    if (activeNetworkInfo.getType() == 1) {
                        return "WIFI";
                    }
                    if (activeNetworkInfo.getType() == 0) {
                        switch (activeNetworkInfo.getSubtype()) {
                            case 1:
                                return "GPRS";
                            case 2:
                                return "EDGE";
                            case 3:
                            case 5:
                            case 6:
                            case 8:
                            case 9:
                            case InfluenceConfigModel.DEFAULT_NOTIFICATION_LIMIT:
                                return "HSPA";
                            case 4:
                                return "CDMA";
                            case 7:
                            case 11:
                                return "2G";
                            case 12:
                            case 14:
                            case CreditCard.EXPIRY_MAX_FUTURE_YEARS:
                                return "3G";
                            case 13:
                                return "4G";
                            default:
                                return "?";
                        }
                    }
                }
                return "Not connected";
            } catch (Exception e) {
            }
        }
        return "?";
    }

    public int d(Context context) {
        NetworkInfo b = b(context);
        if (b != null) {
            if (b.getTypeName().equalsIgnoreCase("MOBILE")) {
                return a(context, b);
            }
            if (b.getTypeName().equalsIgnoreCase("wifi") && d(context, "android.permission.ACCESS_WIFI_STATE")) {
                try {
                    WifiInfo connectionInfo = ((WifiManager) context.getSystemService("wifi")).getConnectionInfo();
                    if (connectionInfo != null) {
                        return WifiManager.calculateSignalLevel(connectionInfo.getRssi(), 5);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        return 0;
    }

    public void f(Context context, String str) {
        SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser.js", 0).edit();
        edit.remove(str);
        edit.apply();
    }

    public SnoozeConfigMap h(Context context, String str) {
        SnoozeConfigMap snoozeConfigMap = new SnoozeConfigMap();
        try {
            JSONObject jSONObject = new JSONObject(str);
            g.b(context, b.SNOOZE_SHARED_PREF);
            SnoozeConfigMap a2 = a(context, jSONObject.getJSONArray("default"), snoozeConfigMap);
            jSONObject.remove("default");
            Iterator<String> keys = jSONObject.keys();
            return keys.hasNext() ? a(context, jSONObject.getJSONArray(keys.next()), a2) : a2;
        } catch (JSONException e) {
            e.printStackTrace();
            return snoozeConfigMap;
        }
    }

    public PaymentOption g(String str) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        String a2 = a(str, "bankcode");
        if (TextUtils.isEmpty(a2)) {
            return null;
        }
        for (PaymentOption paymentOption : PaymentOption.values()) {
            if (paymentOption.getPaymentName().equalsIgnoreCase(a2)) {
                return paymentOption;
            }
        }
        return null;
    }

    public static String f(String str) {
        Matcher matcher = Pattern.compile("((?<=[?&]id=)[^&]+)").matcher(str);
        if (matcher.find()) {
            return matcher.group(1);
        }
        return null;
    }

    public static String a(Context context, String str, String str2, String str3, String str4, String str5, String str6) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("payu_id", b(b.PAYUID, context));
            jSONObject.put("txnid", str5);
            jSONObject.put("merchant_key", str4);
            if (str6 == null) {
                str6 = "";
            }
            jSONObject.put("page_type", str6);
            jSONObject.put("event_key", str);
            jSONObject.put("event_value", URLEncoder.encode(str2, "UTF-8"));
            if (str3 == null) {
                str3 = "";
            }
            jSONObject.put("bank", str3);
            jSONObject.put(Constants.PACKAGE_NAME, context.getPackageName());
            jSONObject.put("ts", a());
            jSONObject.put("application_version", e(context));
            jSONObject.put(UpiConstant.CB_VERSION_NAME, "7.8.0");
            return jSONObject.toString();
        } catch (Exception e) {
            e.printStackTrace();
            return "{}";
        }
    }

    public static String f(Context context) {
        return g.b(context, "com.payu.custombrowser.payucustombrowser", b.WEBVIEW_VERSION, "");
    }

    public static void g(Context context, String str) {
        if (str != null) {
            g.a(context, "com.payu.custombrowser.payucustombrowser", b.WEBVIEW_VERSION, str);
        }
    }

    public String c(Context context, String str) {
        return context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0).getString(str, "");
    }

    public void e(Context context, String str, String str2) {
        SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0).edit();
        edit.putString(str, str2);
        edit.apply();
    }

    public void c(Context context, String str, String str2) {
        SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0).edit();
        edit.putString(str, str2);
        edit.commit();
    }

    public void e(Context context, String str) {
        SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0).edit();
        edit.remove(str);
        edit.apply();
    }

    public HashMap<String, String> c(String str) {
        String str2;
        HashMap<String, String> hashMap = new HashMap<>();
        if (str != null) {
            StringTokenizer stringTokenizer = new StringTokenizer(str, "&");
            while (stringTokenizer.hasMoreTokens()) {
                String[] split = stringTokenizer.nextToken().split("=");
                if (split != null && split.length > 0 && (str2 = split[0]) != null) {
                    hashMap.put(str2, split.length > 1 ? split[1] : "");
                }
            }
        }
        return hashMap;
    }

    private boolean d(Context context, String str) {
        return context.checkCallingOrSelfPermission(str) == 0;
    }

    public void b(Context context, String str, String str2) {
        SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser.js", 0).edit();
        edit.putString(str, str2);
        edit.commit();
    }

    private static String e(Context context) {
        try {
            return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            return "";
        }
    }

    public void d(Context context, String str, String str2) {
        String c = c(context, str);
        if (!c.equalsIgnoreCase("")) {
            if (!c.contains(b.CB_DELIMITER)) {
                str2 = c + b.CB_DELIMITER + str2;
            } else {
                StringTokenizer stringTokenizer = new StringTokenizer(c, b.CB_DELIMITER);
                stringTokenizer.nextToken();
                str2 = stringTokenizer.nextToken() + b.CB_DELIMITER + str2;
            }
        }
        e(context, str, str2);
    }

    public static boolean h(String str) {
        return str.startsWith(b.PLAY_STORE_URL) || str.startsWith(b.PLAY_STORE_MARKET_URI);
    }

    public void b(CustomBrowserConfig customBrowserConfig) {
        a(customBrowserConfig);
    }

    public String b(Context context, String str) {
        String str2 = "";
        try {
            String cookie = CookieManager.getInstance().getCookie(str);
            if (cookie != null) {
                for (String str3 : cookie.split(";")) {
                    String[] split = str3.split("=");
                    str2 = str2 + split[0] + "=" + split[1] + ";";
                }
            }
            return str2.length() > 0 ? str2.substring(0, str2.length() - 1) : str2;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    public static String a(FileInputStream fileInputStream) {
        StringBuilder sb = new StringBuilder();
        int i = 0;
        while (true) {
            try {
                int read = fileInputStream.read();
                if (read == -1) {
                    break;
                }
                if (i % 2 == 0) {
                    sb.append((char) (read - ((i % 5) + 1)));
                } else {
                    sb.append((char) (read + (i % 5) + 1));
                }
                i++;
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        fileInputStream.close();
        return sb.toString();
    }

    public static String d(String str) {
        if (str != null) {
            try {
                URL url = new URL(str);
                String protocol = url.getProtocol();
                String host = url.getHost();
                int port = url.getPort();
                return port == -1 ? String.format("%s://%s", protocol, host) : String.format("%s://%s:%d", protocol, host, Integer.valueOf(port));
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    public static String b(String str, Context context) {
        String str2 = "";
        try {
            String cookie = CookieManager.getInstance().getCookie(b.PAYU_DOMAIN);
            if (cookie != null) {
                for (String str3 : cookie.split(";")) {
                    if (str3.contains(str)) {
                        str2 = str3.split("=")[1];
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return str2;
    }

    public static void a(float f, View view) {
        view.setAlpha(f);
    }

    public static void a(String str, String str2, String str3) {
        if (str2 != null) {
            try {
                if (str2.trim().equals("")) {
                    return;
                }
                Field declaredField = Class.forName(str).getDeclaredField(str3);
                declaredField.setAccessible(true);
                declaredField.set(null, str2);
                declaredField.setAccessible(false);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public HttpsURLConnection a(String str, String str2, int i, String str3) {
        try {
            HttpsURLConnection httpsURLConnection = (HttpsURLConnection) new URL(str).openConnection();
            httpsURLConnection.setRequestMethod("POST");
            if (i != -1) {
                httpsURLConnection.setConnectTimeout(i);
            }
            httpsURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            if (str2 != null) {
                httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(str2.length()));
            }
            if (str3 != null) {
                httpsURLConnection.setRequestProperty("Cookie", str3);
            }
            httpsURLConnection.setSSLSocketFactory(new h());
            httpsURLConnection.setDoOutput(true);
            if (str2 != null) {
                httpsURLConnection.getOutputStream().write(str2.getBytes());
            }
            return httpsURLConnection;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public String b(String str, String str2) throws JSONException {
        JSONObject jSONObject = new JSONObject(str);
        if (jSONObject.has(str2)) {
            return jSONObject.get(str2).toString();
        }
        throw new JSONException("Key not found");
    }

    public static void b(Activity activity) {
        try {
            boolean z = activity.getPackageManager().getApplicationInfo(activity.getPackageName(), WorkQueueKt.BUFFER_CAPACITY).metaData.getBoolean(activity.getString(R.string.payu_debug_mode_enabled), false);
            e.b("Debug Enabled " + z);
            com.payu.custombrowser.a.DEBUG = z;
        } catch (PackageManager.NameNotFoundException e) {
            e.a("Exception metadata " + e.getMessage());
            e.printStackTrace();
        }
    }

    public String b(String str) {
        String str2;
        JSONArray jSONArray;
        HashMap<String, String> c = c(str);
        if (!c.containsKey("sdk_platform")) {
            str2 = "";
        } else {
            str2 = c.get("sdk_platform");
        }
        try {
            if (!TextUtils.isEmpty(str2)) {
                jSONArray = new JSONArray(str2);
            } else {
                jSONArray = new JSONArray();
            }
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("platform", "android");
            jSONObject.put("name", b.NAME_VALUE);
            jSONObject.put("version", "7.8.0");
            jSONArray.put(jSONObject);
            c.put("sdk_platform", jSONArray.toString());
            return a(c);
        } catch (JSONException e) {
            return a(c);
        }
    }

    public static StringBuffer a(InputStream inputStream) {
        try {
            StringBuffer stringBuffer = new StringBuffer();
            byte[] bArr = new byte[LockFreeTaskQueueCore.MIN_ADD_SPIN_CAPACITY];
            while (true) {
                int read = inputStream.read(bArr);
                if (read != -1) {
                    stringBuffer.append(new String(bArr, 0, read));
                } else {
                    e.b("CbUtil Cb Response:  " + String.valueOf(stringBuffer));
                    return stringBuffer;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public void a(CustomBrowserConfig customBrowserConfig) {
        CookieManager cookieManager = CookieManager.getInstance();
        com.payu.custombrowser.bean.b bVar = com.payu.custombrowser.bean.b.SINGLETON;
        if (bVar.getDomainListofSession() != null && bVar.getDomainListofSession().size() > 0 && customBrowserConfig.getDomainUrlListToUnclear().size() > 0) {
            for (String str : bVar.getDomainListofSession()) {
                if (customBrowserConfig.getDomainUrlListToUnclear().isEmpty() || !customBrowserConfig.getDomainUrlListToUnclear().contains(str)) {
                    if (str != null) {
                        a(str);
                    }
                }
            }
            return;
        }
        if (customBrowserConfig.getDomainUrlListToUnclear().isEmpty()) {
            cookieManager.removeSessionCookies(null);
        }
    }

    public boolean a(String str, Context context) {
        SharedPreferences sharedPreferences = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0);
        a = sharedPreferences;
        return sharedPreferences.getBoolean(str, true);
    }

    public void a(String str, boolean z, Context context) {
        SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0).edit();
        edit.putBoolean(str, z);
        edit.apply();
    }

    public String a(Activity activity) {
        DisplayMetrics displayMetrics = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
        return displayMetrics.densityDpi + "";
    }

    private int a(Context context, NetworkInfo networkInfo) {
        try {
            int i = 0;
            for (CellInfo cellInfo : ((TelephonyManager) context.getSystemService("phone")).getAllCellInfo()) {
                if (cellInfo.isRegistered()) {
                    if (cellInfo instanceof CellInfoGsm) {
                        i = ((CellInfoGsm) cellInfo).getCellSignalStrength().getDbm();
                    } else if (cellInfo instanceof CellInfoCdma) {
                        i = ((CellInfoCdma) cellInfo).getCellSignalStrength().getDbm();
                    } else if (cellInfo instanceof CellInfoLte) {
                        i = ((CellInfoLte) cellInfo).getCellSignalStrength().getDbm();
                    } else if (cellInfo instanceof CellInfoWcdma) {
                        i = ((CellInfoWcdma) cellInfo).getCellSignalStrength().getDbm();
                    }
                }
            }
            return i;
        } catch (Exception e) {
            return 0;
        }
    }

    public String a(Context context, String str, boolean z) {
        if (z) {
            return context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0).getString(str, b.UNDEFINED);
        }
        return context.getSharedPreferences("com.payu.custombrowser.payucustombrowser.js", 0).getString(str, b.UNDEFINED);
    }

    public void a(Context context) {
        SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser.js", 0).edit();
        edit.clear();
        edit.apply();
    }

    public void a(Context context, String str) {
        try {
            SharedPreferences.Editor edit = context.getSharedPreferences("com.payu.custombrowser.payucustombrowser", 0).edit();
            edit.remove(str);
            edit.apply();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public Drawable a(Context context, int i) {
        return context.getResources().getDrawable(i, context.getTheme());
    }

    public void a(Timer timer) {
        if (timer != null) {
            timer.cancel();
            timer.purge();
        }
    }

    public void a(InputStream inputStream, Context context, String str, int i) {
        try {
            GZIPInputStream gZIPInputStream = new GZIPInputStream(inputStream);
            byte[] bArr = new byte[LockFreeTaskQueueCore.MIN_ADD_SPIN_CAPACITY];
            FileOutputStream openFileOutput = context.openFileOutput(str, i);
            while (true) {
                int read = gZIPInputStream.read(bArr);
                if (read > 0) {
                    openFileOutput.write(bArr, 0, read);
                } else {
                    gZIPInputStream.close();
                    openFileOutput.close();
                    return;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    @Deprecated
    public String a(String str, String str2) {
        for (String str3 : str.split("&")) {
            String[] split = str3.split("=");
            if (split.length >= 2 && split[0].equalsIgnoreCase(str2)) {
                return split[1];
            }
        }
        return "";
    }

    private SnoozeConfigMap a(Context context, JSONArray jSONArray, SnoozeConfigMap snoozeConfigMap) {
        String str = b.DISABLE_SP_FOR;
        try {
            int length = jSONArray.length();
            int i = 0;
            for (int i2 = 0; i2 < length; i2++) {
                JSONObject jSONObject = jSONArray.getJSONObject(i2);
                String obj = jSONObject.get("url").toString();
                String obj2 = jSONObject.get(b.PROGRESS_PERCENT).toString();
                String obj3 = jSONObject.get(b.TIME_OUT).toString();
                if (jSONObject.has(str)) {
                    try {
                        i = a(jSONObject.getJSONObject(str));
                    } catch (JSONException e) {
                        e = e;
                        e.printStackTrace();
                        return snoozeConfigMap;
                    }
                }
                StringTokenizer stringTokenizer = new StringTokenizer(obj, b.CB_DELIMITER);
                while (stringTokenizer.hasMoreTokens()) {
                    String nextToken = stringTokenizer.nextToken();
                    String str2 = str;
                    g.a(context, b.SNOOZE_SHARED_PREF, nextToken.contentEquals(b.DEFAULT_PAYMENT_URLS) ? b.DEFAULT_PAYMENT_URLS : nextToken.trim(), obj2.trim() + b.CB_DELIMITER + obj3.trim() + b.CB_DELIMITER + i);
                    snoozeConfigMap.put(nextToken.contentEquals(b.DEFAULT_PAYMENT_URLS) ? b.DEFAULT_PAYMENT_URLS : nextToken.trim(), obj2.trim() + b.CB_DELIMITER + obj3.trim() + b.CB_DELIMITER + i);
                    str = str2;
                }
            }
        } catch (JSONException e2) {
            e = e2;
        }
        return snoozeConfigMap;
    }

    public SnoozeConfigMap a(Map<String, ?> map) {
        SnoozeConfigMap snoozeConfigMap = new SnoozeConfigMap();
        for (Map.Entry<String, ?> entry : map.entrySet()) {
            snoozeConfigMap.put(entry.getKey(), entry.getValue());
        }
        return snoozeConfigMap;
    }

    private int a(JSONObject jSONObject) {
        try {
            if (jSONObject.has(b.WARN) && jSONObject.getBoolean(b.WARN) && jSONObject.has(b.FAIL) && jSONObject.getBoolean(b.FAIL)) {
                return 3;
            }
            if (jSONObject.has(b.FAIL) && jSONObject.getBoolean(b.FAIL)) {
                return 2;
            }
            if (jSONObject.has(b.WARN)) {
                if (jSONObject.getBoolean(b.WARN)) {
                    return 1;
                }
            }
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return 0;
        }
    }

    public int a(SnoozeConfigMap snoozeConfigMap, String str) {
        if (snoozeConfigMap == null || str == null) {
            return 0;
        }
        for (Object obj : snoozeConfigMap.keySet()) {
            if (str.startsWith(obj.toString())) {
                return snoozeConfigMap.getPercentageAndTimeout(obj.toString())[2];
            }
        }
        return snoozeConfigMap.getPercentageAndTimeout(b.DEFAULT_PAYMENT_URLS)[2];
    }

    public static void a(Context context, String str, String str2) {
        String f = f(str);
        String str3 = f == null ? "" : "details?id=" + f;
        g(context, str2);
        try {
            context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(b.PLAY_STORE_MARKET_URI + str3)));
        } catch (ActivityNotFoundException e) {
            context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/" + str3)));
        }
    }

    public static String a(WebView webView) {
        Matcher matcher = Pattern.compile("(Chrome\\/(.*?)\\s)").matcher(webView.getSettings().getUserAgentString());
        if (matcher.find()) {
            return matcher.group(2);
        }
        return null;
    }

    public static boolean a(PaymentOption paymentOption) {
        try {
            c.class.getClassLoader().loadClass(paymentOption.getClassName());
            return true;
        } catch (ClassNotFoundException e) {
            Log.e("CBUtil", "Please import " + paymentOption.getPackageName().toLowerCase() + " to make Payment by " + paymentOption.toString());
            return false;
        }
    }

    public static void a(String str) {
        int indexOf;
        CookieManager cookieManager = CookieManager.getInstance();
        String cookie = cookieManager.getCookie(str);
        if (!TextUtils.isEmpty(cookie)) {
            for (String str2 : cookie.split("; ")) {
                if (!TextUtils.isEmpty(str2) && (indexOf = str2.indexOf(61)) != -1) {
                    cookieManager.setCookie(str, str2.substring(0, indexOf) + "=; ");
                    com.payu.custombrowser.bean.b.SINGLETON.removeDomain(str);
                }
            }
        } else {
            com.payu.custombrowser.bean.b.SINGLETON.removeDomain(str);
        }
        e.b("List Saved: " + com.payu.custombrowser.bean.b.SINGLETON.getDomainListofSession());
    }

    private String a(HashMap<String, String> hashMap) {
        StringBuilder sb = new StringBuilder();
        for (String str : hashMap.keySet()) {
            sb.append(str);
            sb.append("=");
            sb.append(hashMap.get(str));
            sb.append("&");
        }
        return sb.toString().substring(0, sb.lastIndexOf("&"));
    }
}