VegeFruits v7.1版本的 MD5 值为:2ff167dfba698c783e879938fe00b9ce

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


package com.ironsource.mediationsdk.server;

import android.text.TextUtils;
import android.util.Pair;
import com.ironsource.mediationsdk.config.ConfigFile;
import com.ironsource.mediationsdk.utils.IronSourceAES;
import com.ironsource.mediationsdk.utils.IronSourceUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.Vector;

public class ServerURL {
    private static final String AMPERSAND = "&";
    private static final String ANDROID = "android";
    private static final String APPLICATION_KEY = "applicationKey";
    private static final String APPLICATION_USER_ID = "applicationUserId";
    private static String BASE_URL_PREFIX = "https://init.supersonicads.com/sdk/v";
    private static String BASE_URL_SUFFIX = "?request=";
    private static final String EQUAL = "=";
    private static final String GAID = "advId";
    private static final String IMPRESSION = "impression";
    private static final String PLACEMENT = "placementId";
    private static final String PLATFORM_KEY = "platform";
    private static final String PLUGIN_FW_VERSION = "plugin_fw_v";
    private static final String PLUGIN_TYPE = "pluginType";
    private static final String PLUGIN_VERSION = "pluginVersion";
    private static final String SDK_VERSION = "sdkVersion";
    private static final String SERR = "serr";

    public static String getCPVProvidersURL(String applicationKey, String applicationUserId, String gaid) throws UnsupportedEncodingException {
        Vector<Pair<String, String>> array = new Vector<>();
        array.add(new Pair<>("platform", "android"));
        array.add(new Pair<>("applicationKey", applicationKey));
        array.add(new Pair<>("applicationUserId", applicationUserId));
        array.add(new Pair<>("sdkVersion", IronSourceUtils.getSDKVersion()));
        if (IronSourceUtils.getSerr() == 0) {
            array.add(new Pair<>(SERR, String.valueOf(IronSourceUtils.getSerr())));
        }
        if (!TextUtils.isEmpty(ConfigFile.getConfigFile().getPluginType())) {
            array.add(new Pair<>(PLUGIN_TYPE, ConfigFile.getConfigFile().getPluginType()));
        }
        if (!TextUtils.isEmpty(ConfigFile.getConfigFile().getPluginVersion())) {
            array.add(new Pair<>(PLUGIN_VERSION, ConfigFile.getConfigFile().getPluginVersion()));
        }
        if (!TextUtils.isEmpty(ConfigFile.getConfigFile().getPluginFrameworkVersion())) {
            array.add(new Pair<>(PLUGIN_FW_VERSION, ConfigFile.getConfigFile().getPluginFrameworkVersion()));
        }
        if (!TextUtils.isEmpty(gaid)) {
            array.add(new Pair<>(GAID, gaid));
        }
        String params = createURLParams(array);
        String encryptedParams = IronSourceAES.encode(IronSourceUtils.KEY, params);
        String encodedEncryptedParams = URLEncoder.encode(encryptedParams, "UTF-8");
        return getBaseUrl(IronSourceUtils.getSDKVersion()) + encodedEncryptedParams;
    }

    public static String getRequestURL(String requestUrl, boolean hit, int placementId) throws UnsupportedEncodingException {
        Vector<Pair<String, String>> array = new Vector<>();
        array.add(new Pair<>("impression", Boolean.toString(hit)));
        array.add(new Pair<>("placementId", Integer.toString(placementId)));
        String params = createURLParams(array);
        return requestUrl + "&" + params;
    }

    private static String createURLParams(Vector<Pair<String, String>> array) throws UnsupportedEncodingException {
        String str = "";
        Iterator<Pair<String, String>> it = array.iterator();
        while (it.hasNext()) {
            Pair<String, String> pair = it.next();
            if (str.length() > 0) {
                str = str + "&";
            }
            str = str + ((String) pair.first) + "=" + URLEncoder.encode((String) pair.second, "UTF-8");
        }
        return str;
    }

    private static String getBaseUrl(String sdkVersion) {
        return BASE_URL_PREFIX + sdkVersion + BASE_URL_SUFFIX;
    }
}