翰林优商.apk(点击下载) / a.java


package com.qq.e.comm.net;

import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import com.baidu.idl.face.platform.FaceEnvironment;
import com.baidu.mobads.sdk.api.IAdInterListener;
import com.qq.e.comm.managers.GDTADManager;
import com.qq.e.comm.managers.plugin.PM;
import com.qq.e.comm.managers.status.APPStatus;
import com.qq.e.comm.managers.status.DeviceStatus;
import com.qq.e.comm.managers.status.SDKStatus;
import com.qq.e.comm.util.StringUtil;
import com.umeng.analytics.pro.am;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;

public class a {
    public static JSONObject a(PM pm) throws JSONException {
        JSONObject jSONObject = new JSONObject();
        jSONObject.putOpt("sdkv", SDKStatus.getSDKVersion());
        jSONObject.putOpt("pv", Integer.valueOf(pm.getPluginVersion()));
        jSONObject.putOpt("sdk_st", 1);
        jSONObject.putOpt("sdk_cnl", 1);
        if (!TextUtils.isEmpty("")) {
            jSONObject.putOpt("sdk_ex1", "");
        }
        if (!TextUtils.isEmpty("")) {
            jSONObject.putOpt("sdk_ex2", "");
        }
        return jSONObject;
    }

    public static JSONObject a(APPStatus aPPStatus) throws JSONException {
        JSONObject jSONObject = new JSONObject();
        if (aPPStatus != null) {
            jSONObject.putOpt("an", aPPStatus.getAPPName());
            jSONObject.putOpt("appkey", aPPStatus.getAPPID());
            jSONObject.putOpt("appv", aPPStatus.getAPPVersion());
            jSONObject.putOpt("appn", aPPStatus.getAPPRealName());
        }
        return jSONObject;
    }

    /* JADX WARNING: Removed duplicated region for block: B:13:0x005a  */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x0071 A[LOOP:0: B:15:0x006b->B:17:0x0071, LOOP_END] */
    public static JSONObject a(DeviceStatus deviceStatus) throws JSONException {
        String str;
        JSONObject jSONObject = new JSONObject();
        if (deviceStatus != null) {
            jSONObject.putOpt("so", deviceStatus.getScreenOrientation());
            jSONObject.putOpt("dn", deviceStatus.getDataNet());
            Context appContext = GDTADManager.getInstance().getAppContext();
            try {
                NetworkInfo activeNetworkInfo = ((ConnectivityManager) appContext.getSystemService("connectivity")).getActiveNetworkInfo();
                if (activeNetworkInfo != null && activeNetworkInfo.getType() == 0) {
                    str = "" + ((TelephonyManager) appContext.getSystemService("phone")).getNetworkType();
                    if (!StringUtil.isEmpty(str)) {
                        jSONObject.putOpt("cell_native", str);
                    }
                    for (Map.Entry<String, String> entry : deviceStatus.getLacAndCeilId().entrySet()) {
                        jSONObject.putOpt(entry.getKey(), entry.getValue());
                    }
                }
            } catch (Exception unused) {
            }
            str = null;
            if (!StringUtil.isEmpty(str)) {
            }
            while (r4.hasNext()) {
            }
        }
        return jSONObject;
    }

    public static JSONObject b(DeviceStatus deviceStatus) throws JSONException {
        JSONObject jSONObject = new JSONObject();
        if (deviceStatus != null) {
            jSONObject.putOpt("did", deviceStatus.getDeviceId());
            jSONObject.putOpt("md", deviceStatus.model);
            jSONObject.putOpt("lg", deviceStatus.getLanguage());
            jSONObject.putOpt(IAdInterListener.AdReqParam.WIDTH, Integer.valueOf(deviceStatus.getDeviceWidth()));
            jSONObject.putOpt("h", Integer.valueOf(deviceStatus.getDeviceHeight()));
            jSONObject.putOpt("dd", Integer.valueOf(deviceStatus.getDeviceDensity()));
            jSONObject.putOpt("apil", Integer.valueOf(deviceStatus.getVersion()));
            jSONObject.putOpt(am.x, FaceEnvironment.OS);
            jSONObject.putOpt("op", deviceStatus.getOperator());
            jSONObject.putOpt("mf", Build.MANUFACTURER);
            SharedPreferences sharedPreferences = GDTADManager.getInstance().getAppContext().getSharedPreferences("com.qq.e.sdkconfig", 0);
            if (sharedPreferences != null) {
                String string = sharedPreferences.getString("ltd", null);
                String string2 = sharedPreferences.getString("lod", null);
                if (!TextUtils.isEmpty(string)) {
                    jSONObject.putOpt("td", string);
                }
                if (!TextUtils.isEmpty(string2)) {
                    jSONObject.putOpt("od", string2);
                }
            }
        }
        return jSONObject;
    }
}