导航菜单

页面标题

页面副标题

Hyouka private v5.8.9 - e.java 源代码

正在查看: Hyouka private v5.8.9 应用的 e.java JAVA 源代码文件

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


package aa;

import aa.c;
import android.os.Build;
import com.beint.project.core.utils.Constants;
import com.beint.project.core.utils.ZangiFileUtils;
import com.stripe.android.exception.APIConnectionException;
import com.stripe.android.exception.APIException;
import com.stripe.android.exception.AuthenticationException;
import com.stripe.android.exception.CardException;
import com.stripe.android.exception.InvalidRequestException;
import com.stripe.android.exception.PermissionException;
import com.stripe.android.exception.RateLimitException;
import com.stripe.android.exception.StripeException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Scanner;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
import org.json.JSONException;
import org.json.JSONObject;

public class e {

    private static final SSLSocketFactory f88a = new g();

    public interface a {
        void a(StripeException stripeException);

        boolean b();

        void c(f fVar);
    }

    private static final class b {

        public final String f89a;

        public final String f90b;

        public b(String str, String str2) {
            this.f89a = str;
            this.f90b = str2;
        }
    }

    private static HttpURLConnection a(String str, String str2, d dVar) throws IOException {
        HttpURLConnection d2 = d(j(str, str2), dVar);
        d2.setRequestMethod("GET");
        return d2;
    }

    private static HttpURLConnection b(String str, String str2, d dVar) throws IOException {
        OutputStream outputStream;
        HttpURLConnection d2 = d(str, dVar);
        d2.setDoOutput(true);
        d2.setRequestMethod("POST");
        d2.setRequestProperty("Content-Type", String.format("application/x-www-form-urlencoded;charset=%s", "UTF-8"));
        try {
            outputStream = d2.getOutputStream();
        } catch (Throwable th) {
            th = th;
            outputStream = null;
        }
        try {
            outputStream.write(str2.getBytes("UTF-8"));
            outputStream.close();
            return d2;
        } catch (Throwable th2) {
            th = th2;
            if (outputStream != null) {
                outputStream.close();
            }
            throw th;
        }
    }

    static String c(Map<String, Object> map) throws UnsupportedEncodingException, InvalidRequestException {
        StringBuilder sb = new StringBuilder();
        for (b bVar : f(map)) {
            if (sb.length() > 0) {
                sb.append("&");
            }
            sb.append(u(bVar.f89a, bVar.f90b));
        }
        return sb.toString();
    }

    private static HttpURLConnection d(String str, d dVar) throws IOException {
        HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
        httpURLConnection.setConnectTimeout(ZangiFileUtils.THUMBNAIL_FIXED_FOR_MSGINFO_ALLOWED_BYTES);
        httpURLConnection.setReadTimeout(80000);
        httpURLConnection.setUseCaches(false);
        for (Map.Entry<String, String> entry : l(dVar).entrySet()) {
            httpURLConnection.setRequestProperty(entry.getKey(), entry.getValue());
        }
        if (httpURLConnection instanceof HttpsURLConnection) {
            ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(f88a);
        }
        return httpURLConnection;
    }

    public static z9.c e(Map<String, Object> map, d dVar, a aVar) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException {
        if (map.containsKey("product_usage")) {
            try {
                String d2 = dVar.d();
                if (ca.f.g(d2)) {
                    return null;
                }
                List list = (List) map.get("product_usage");
                map.remove("product_usage");
                p(ca.c.e(list, d2), dVar, aVar);
            } catch (ClassCastException unused) {
                map.remove("product_usage");
            }
        }
        return s("POST", k(), map, dVar);
    }

    private static List<b> f(Map<String, Object> map) throws InvalidRequestException {
        return h(map, null);
    }

    private static List<b> g(List<Object> list, String str) throws InvalidRequestException {
        LinkedList linkedList = new LinkedList();
        Iterator<Object> it = list.iterator();
        String format = String.format("%s[]", str);
        if (list.isEmpty()) {
            linkedList.add(new b(str, ""));
        } else {
            while (it.hasNext()) {
                linkedList.addAll(i(it.next(), format));
            }
        }
        return linkedList;
    }

    private static List<b> h(Map<String, Object> map, String str) throws InvalidRequestException {
        LinkedList linkedList = new LinkedList();
        if (map == null) {
            return linkedList;
        }
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();
            if (str != null) {
                key = String.format("%s[%s]", str, key);
            }
            linkedList.addAll(i(value, key));
        }
        return linkedList;
    }

    private static List<b> i(Object obj, String str) throws InvalidRequestException {
        if (obj instanceof Map) {
            return h((Map) obj, str);
        }
        if (obj instanceof List) {
            return g((List) obj, str);
        }
        if ("".equals(obj)) {
            throw new InvalidRequestException("You cannot set '" + str + "' to an empty string. We interpret empty strings as null in requests. You may set '" + str + "' to null to delete the property.", str, null, 0, null);
        }
        if (obj == null) {
            LinkedList linkedList = new LinkedList();
            linkedList.add(new b(str, ""));
            return linkedList;
        }
        LinkedList linkedList2 = new LinkedList();
        linkedList2.add(new b(str, obj.toString()));
        return linkedList2;
    }

    private static String j(String str, String str2) {
        if (str2 == null || str2.isEmpty()) {
            return str;
        }
        return String.format("%s%s%s", str, str.contains("?") ? "&" : "?", str2);
    }

    static String k() {
        return String.format(Locale.ENGLISH, "%s/v1/%s", "https://api.stripe.com", "tokens");
    }

    static Map<String, String> l(d dVar) {
        HashMap hashMap = new HashMap();
        String b2 = dVar.b();
        hashMap.put("Accept-Charset", "UTF-8");
        hashMap.put("Accept", "application/json");
        hashMap.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", "4.0.1"));
        hashMap.put("Authorization", String.format("Bearer %s", dVar.d()));
        HashMap hashMap2 = new HashMap();
        hashMap2.put("java.version", System.getProperty("java.version"));
        hashMap2.put("os.name", "android");
        hashMap2.put("os.version", String.valueOf(Build.VERSION.SDK_INT));
        hashMap2.put("bindings.version", "4.0.1");
        hashMap2.put("lang", "Java");
        hashMap2.put("publisher", "Stripe");
        hashMap.put("X-Stripe-Client-User-Agent", new JSONObject(hashMap2).toString());
        if (b2 != null) {
            hashMap.put("Stripe-Version", b2);
        }
        if (dVar.c() != null) {
            hashMap.put("Idempotency-Key", dVar.c());
        }
        return hashMap;
    }

    private static String m(InputStream inputStream) throws IOException {
        String next = new Scanner(inputStream, "UTF-8").useDelimiter("\\A").next();
        inputStream.close();
        return next;
    }

    private static f n(String str, String str2, Map<String, Object> map, d dVar) throws InvalidRequestException, APIConnectionException, APIException {
        try {
            return q(str, str2, c(map), dVar);
        } catch (UnsupportedEncodingException e2) {
            throw new InvalidRequestException("Unable to encode parameters to UTF-8. Please contact [email protected] for assistance.", null, null, 0, e2);
        }
    }

    private static void o(String str, int i2, String str2) throws InvalidRequestException, AuthenticationException, CardException, APIException {
        c.a a2 = c.a(str);
        if (i2 == 429) {
            throw new RateLimitException(a2.f77b, a2.f79d, str2, Integer.valueOf(i2), null);
        }
        switch (i2) {
            case Constants.simple_link_checked_size:
                throw new InvalidRequestException(a2.f77b, a2.f79d, str2, Integer.valueOf(i2), null);
            case 401:
                throw new AuthenticationException(a2.f77b, str2, Integer.valueOf(i2));
            case 402:
                throw new CardException(a2.f77b, str2, a2.f78c, a2.f79d, a2.f80e, a2.f81f, Integer.valueOf(i2), null);
            case 403:
                throw new PermissionException(a2.f77b, str2, Integer.valueOf(i2));
            case 404:
                throw new InvalidRequestException(a2.f77b, a2.f79d, str2, Integer.valueOf(i2), null);
            default:
                throw new APIException(a2.f77b, str2, Integer.valueOf(i2), null);
        }
    }

    private static void p(java.util.Map<java.lang.String, java.lang.Object> r6, aa.d r7, aa.e.a r8) {
        throw new UnsupportedOperationException("Method not decompiled: aa.e.p(java.util.Map, aa.d, aa.e$a):void");
    }

    private static aa.f q(java.lang.String r5, java.lang.String r6, java.lang.String r7, aa.d r8) throws com.stripe.android.exception.APIConnectionException {
        throw new UnsupportedOperationException("Method not decompiled: aa.e.q(java.lang.String, java.lang.String, java.lang.String, aa.d):aa.f");
    }

    private static java.lang.String r(java.lang.String r6, java.lang.String r7, java.util.Map<java.lang.String, java.lang.Object> r8, aa.d r9) throws com.stripe.android.exception.AuthenticationException, com.stripe.android.exception.InvalidRequestException, com.stripe.android.exception.APIConnectionException, com.stripe.android.exception.CardException, com.stripe.android.exception.APIException {
        throw new UnsupportedOperationException("Method not decompiled: aa.e.r(java.lang.String, java.lang.String, java.util.Map, aa.d):java.lang.String");
    }

    private static z9.c s(String str, String str2, Map<String, Object> map, d dVar) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException {
        try {
            return h.a(r(str, str2, map, dVar));
        } catch (JSONException unused) {
            return null;
        }
    }

    private static String t(String str) throws UnsupportedEncodingException {
        if (str == null) {
            return null;
        }
        return URLEncoder.encode(str, "UTF-8");
    }

    private static String u(String str, String str2) throws UnsupportedEncodingException {
        return String.format("%s=%s", t(str), t(str2));
    }
}