Luno v7.28.0版本的 MD5 值为:08d81b3b88ef7df48c89cb5d56dc11a2

以下内容为反编译后的 d.java 源代码,内容仅作参考


package com.onfido.segment.analytics;

import android.util.Base64;
import com.facebook.internal.security.CertificateUtil;
import com.leanplum.internal.RequestBuilder;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public class d {
    private static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 15000;
    private static final int DEFAULT_READ_TIMEOUT_MILLIS = 20000;

    private String authorizationHeader(String str) {
        return "Basic " + Base64.encodeToString((str + CertificateUtil.DELIMITER).getBytes(), 2);
    }

    public HttpURLConnection attribution(String str) throws IOException {
        HttpURLConnection openConnection = openConnection("https://mobile-service.segment.com/v1/attribution");
        openConnection.setRequestProperty("Authorization", authorizationHeader(str));
        openConnection.setRequestMethod(RequestBuilder.POST);
        openConnection.setDoOutput(true);
        return openConnection;
    }

    public HttpURLConnection openConnection(String str) throws IOException {
        HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
        httpURLConnection.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT_MILLIS);
        httpURLConnection.setReadTimeout(DEFAULT_READ_TIMEOUT_MILLIS);
        httpURLConnection.setRequestProperty("Content-Type", "application/json");
        httpURLConnection.setDoInput(true);
        return httpURLConnection;
    }

    public HttpURLConnection projectSettings(String str) throws IOException {
        return openConnection("https://cdn-settings.segment.com/v1/projects/" + str + "/settings");
    }

    public HttpURLConnection upload(String str) throws IOException {
        HttpURLConnection openConnection = openConnection("https://api.segment.io/v1/import");
        openConnection.setRequestProperty("Authorization", authorizationHeader(str));
        openConnection.setRequestProperty("Content-Encoding", "gzip");
        openConnection.setDoOutput(true);
        openConnection.setChunkedStreamingMode(0);
        return openConnection;
    }
}