整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3

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


package com.bytedance.sdk.openadsdk.api.plugin;

import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Pair;
import com.baidu.mobads.sdk.internal.bk;
import com.bytedance.sdk.openadsdk.AdConfig;
import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.bytedance.sdk.openadsdk.TTAppContextHolder;
import com.bytedance.sdk.openadsdk.TTCustomController;
import com.ss.android.socialbase.downloader.setting.DownloadSettingKeys;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
final class zc {
    private static SharedPreferences zc;
    private static final List<Pair<String, JSONObject>> i = new CopyOnWriteArrayList();
    static final Map<String, String> g = new HashMap();

    public static JSONObject fy(String str, JSONObject jSONObject) {
        String str2 = "5.8.0.7";
        JSONObject jSONObject2 = new JSONObject();
        try {
            int i2 = Build.VERSION.SDK_INT;
            jSONObject.put("os_api", i2);
            jSONObject.put("support_abi", Arrays.toString(i2 >= 21 ? Build.SUPPORTED_ABIS : new String[]{Build.CPU_ABI, Build.CPU_ABI2}));
            jSONObject2.put("ad_sdk_version", "5.8.0.7");
            String g2 = ql.g("com.byted.pangle.m");
            if (!TextUtils.isEmpty(g2)) {
                str2 = g2;
            }
            jSONObject2.put(PluginConstants.KEY_PLUGIN_VERSION, str2);
            jSONObject2.put("timestamp", System.currentTimeMillis() / 1000);
            jSONObject2.put("is_plugin", true);
            Map<String, String> map = g;
            jSONObject.put("appid", map.get("appid"));
            jSONObject2.put("event_extra", jSONObject != null ? jSONObject.toString() : "");
            jSONObject2.put(DownloadSettingKeys.AhPlans.KEY_AH_PLAN_TYPE, str);
            JSONObject jSONObject3 = new JSONObject();
            jSONObject3.put(bk.i, Build.MODEL);
            jSONObject3.put("vendor", Build.MANUFACTURER);
            jSONObject3.put("imei", map.get("imei"));
            jSONObject3.put("oaid", map.get("oaid"));
            jSONObject2.put("device_info", jSONObject3);
        } catch (JSONException unused) {
        }
        return jSONObject2;
    }

    private static void ql(String str, JSONObject jSONObject) {
        if (jSONObject == null) {
            return;
        }
        TTAdManager adManager = TTAdSdk.getAdManager();
        if (adManager != null) {
            Bundle bundle = new Bundle();
            bundle.putInt("action", 1);
            bundle.putString("event_name", str);
            bundle.putString("event_extra", jSONObject.toString());
            adManager.getExtra(Bundle.class, bundle);
            return;
        }
        r(str, jSONObject);
    }

    private static void r(final String str, final JSONObject jSONObject) {
        com.bytedance.sdk.openadsdk.r.g.g().zc(new Runnable() {
            @Override
            public void run() {
                ArrayList arrayList = new ArrayList();
                arrayList.add(zc.fy(str, jSONObject));
                zc.zc(arrayList);
            }
        });
    }

    public static void zc(String str, JSONObject jSONObject) {
        i.add(new Pair<>(str, jSONObject));
    }

    public static void g(int i2, String str, long j) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.putOpt("duration", Long.valueOf(j));
            jSONObject.putOpt(PluginConstants.KEY_ERROR_CODE, Integer.valueOf(i2));
            jSONObject.putOpt("message", str);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        r("plugin_load_failed", jSONObject);
    }

    public static void zc(List<JSONObject> list) {
        if (list == null) {
            return;
        }
        if (zc == null) {
            zc = TTAppContextHolder.getContext().getSharedPreferences("tt_sdk_settings_other", 0);
        }
        String format = String.format("https://%s%s", zc.getString("url_alog", "api-access.pangolin-sdk-toutiao.com"), "/api/ad/union/sdk/stats/batch/");
        JSONObject jSONObject = new JSONObject();
        try {
            List<Pair<String, JSONObject>> list2 = i;
            if (list2.size() > 0) {
                for (Pair<String, JSONObject> pair : list2) {
                    list.add(fy((String) pair.first, (JSONObject) pair.second));
                }
                i.clear();
            }
            jSONObject.put("stats_list", new JSONArray((Collection) list));
        } catch (Exception unused) {
        }
        com.bytedance.sdk.openadsdk.api.plugin.zc.i.g().g(true, format, com.bytedance.sdk.openadsdk.api.plugin.i.zc.g(jSONObject).toString().getBytes());
    }

    public static void g(String str, JSONObject jSONObject) {
        ql("zeus_".concat(String.valueOf(str)), jSONObject);
    }

    public static void g() {
        List<Pair<String, JSONObject>> list = i;
        if (list.size() <= 0) {
            return;
        }
        try {
            for (Pair<String, JSONObject> pair : list) {
                if (pair != null) {
                    ql((String) pair.first, (JSONObject) pair.second);
                }
            }
            i.clear();
        } catch (Exception unused) {
        }
    }

    public static void g(AdConfig adConfig) {
        if (adConfig == null) {
            return;
        }
        Map<String, String> map = g;
        map.put("appid", adConfig.getAppId());
        int pluginUpdateConfig = adConfig.getPluginUpdateConfig();
        map.put("plugin_update_conf", pluginUpdateConfig != 0 ? String.valueOf(pluginUpdateConfig) : "2");
        TTCustomController customController = adConfig.getCustomController();
        if (customController != null) {
            try {
                map.put("oaid", customController.getDevOaid());
                map.put("imei", customController.getDevImei());
            } catch (Exception unused) {
            }
        }
    }
}