OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

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


package com.excelliance.kxqp.util;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import com.excean.bytedancebi.manager.BiManager;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.avds.AvdSplashCallBackImp;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cn;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;

public class ap {

    private static boolean f14979a = false;

    private static boolean f14980b = true;
    private static SharedPreferences c;
    private static ap d;
    private static boolean e;

    private ap() {
    }

    public static ap a() {
        if (d == null) {
            synchronized (ap.class) {
                if (d == null) {
                    d = new ap();
                }
            }
        }
        return d;
    }

    public static JSONObject a(Context context) {
        JSONObject jSONObject = new JSONObject();
        try {
            try {
                jSONObject.put(BiManager.UQID, GameUtil.G(context));
                jSONObject.put(BiManager.ANDROID_ID, com.excelliance.kxqp.info.a.e(context));
                try {
                    com.excelliance.kxqp.info.a.c(context);
                    if (c == null) {
                        c = context.getSharedPreferences("sp_device_info_cache", Build.VERSION.SDK_INT < 11 ? 0 : 4);
                    }
                    String string = c.getString("sp_info_device_id", null);
                    if (string == null) {
                        string = com.excelliance.kxqp.info.a.c(context);
                        if (string == null) {
                            string = "";
                        }
                        c.edit().putString("sp_info_device_id", string).commit();
                    }
                    jSONObject.put("imei", string);
                } catch (Exception e2) {
                    if (f14979a) {
                        Log.d("ToutiaoUploadUtil", "getParams: " + e2.getMessage());
                    }
                }
                try {
                    jSONObject.put("imeis", d(context));
                } catch (Exception e3) {
                    if (f14979a) {
                        Log.d("ToutiaoUploadUtil", "getParams: " + e3.getMessage());
                    }
                }
                try {
                    jSONObject.put("mac", c(context));
                } catch (Exception e4) {
                    if (f14979a) {
                        Log.d("ToutiaoUploadUtil", "getParams: " + e4.getMessage());
                    }
                }
                jSONObject.put(com.umeng.analytics.pro.am.x, "0");
                jSONObject.put(com.alipay.sdk.tid.b.f, System.currentTimeMillis());
                jSONObject.put("ua", b());
                jSONObject.put("brand", com.excelliance.kxqp.info.a.d());
                jSONObject.put("model", com.excelliance.kxqp.info.a.a());
                jSONObject.put("apiLevel", Build.VERSION.SDK_INT);
                jSONObject.put("release", Build.VERSION.RELEASE);
                jSONObject.put("mainChId", GameUtil.b(context));
                jSONObject.put("subChId", GameUtil.c(context));
                jSONObject.put(AvdSplashCallBackImp.KEY_OAID, com.excelliance.kxqp.gs.router.a.a.e.getOaid(context));
                String a2 = bx.a().a(context);
                if (!cd.a(a2)) {
                    jSONObject.put("rid", a2);
                }
                String string2 = context.getSharedPreferences("userInfo", 0).getString("uid", "");
                if (!cd.a(string2)) {
                    jSONObject.put("uid", string2);
                }
            } catch (JSONException e5) {
                e5.printStackTrace();
            }
        } catch (Exception e6) {
            e6.printStackTrace();
        }
        return jSONObject;
    }

    private boolean e(Context context) {
        if (f14979a) {
            Log.d("ToutiaoUploadUtil", "checkNeedPush enter");
        }
        return f14980b;
    }

    public synchronized boolean b(final Context context) {
        if (f14979a) {
            Log.d("ToutiaoUploadUtil", "handleActiveApp : enter");
        }
        if (!e(context)) {
            return true;
        }
        if (!by.a(context, "sp_total_info").b("sp_tou_tiao_action_is_upload", false).booleanValue()) {
            final JSONObject a2 = a(context);
            if (f14979a) {
                Log.d("ToutiaoUploadUtil", "handleActiveApp : data:" + a2.toString());
            }
            if (TextUtils.isEmpty(a2.optString(BiManager.UQID))) {
                return false;
            }
            if (e) {
                return true;
            }
            e = true;
            tp.f(new Runnable() {
                @Override
                public void run() {
                    String b2 = bd.b("http://3rd.multiopen.cn/project/controller/tou/ReportDo.php", a2.toString(), 10000, 10000);
                    if (ap.f14979a) {
                        Log.d("ToutiaoUploadUtil", "handleActiveApp : result:" + b2);
                    }
                    if (b2 != null) {
                        String a3 = cn.a(b2);
                        if (ap.f14979a) {
                            Log.d("ToutiaoUploadUtil", "handleActiveApp : decrypt=" + a3);
                        }
                        if (!TextUtils.isEmpty(a3)) {
                            try {
                                int optInt = new JSONObject(a3).optInt("code");
                                if (optInt == 1 || optInt == 0) {
                                    by.a(context, "sp_total_info").a("sp_tou_tiao_action_is_upload", true);
                                }
                            } catch (JSONException e2) {
                                e2.printStackTrace();
                            } catch (Exception e3) {
                                e3.printStackTrace();
                            }
                        }
                    }
                    boolean unused = ap.e = false;
                }
            });
        }
        return true;
    }

    public static String b() {
        return System.getProperty("http.agent");
    }

    public static String c(Context context) {
        if (c == null) {
            c = context.getSharedPreferences("sp_device_info_cache", Build.VERSION.SDK_INT < 11 ? 0 : 4);
        }
        String string = c.getString("sp_wifi_info_mac", null);
        if (string == null) {
            try {
                string = ((WifiManager) context.getSystemService("wifi")).getConnectionInfo().getMacAddress();
            } catch (Exception e2) {
                e2.printStackTrace();
                c.edit().putString("sp_wifi_info_mac", "").commit();
                return "";
            }
        }
        if (TextUtils.equals("02:00:00:00:00:00", string)) {
            string = f(context);
        }
        if (string == null) {
            string = "";
        }
        c.edit().putString("sp_wifi_info_mac", string).commit();
        return string;
    }

    private static String f(Context context) {
        try {
            return GameUtil.J(context);
        } catch (Exception e2) {
            e2.printStackTrace();
            if (!f14979a) {
                return "";
            }
            Log.d("ToutiaoUploadUtil", "getNewMac fail e:" + e2.getMessage());
            return "";
        }
    }

    private static int g(Context context) {
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            int parseInt = Integer.parseInt(Class.forName(telephonyManager.getClass().getName()).getMethod("getPhoneCount", new Class[0]).invoke(telephonyManager, new Object[0]).toString());
            if (parseInt > 4) {
                return 4;
            }
            return parseInt;
        } catch (Exception unused) {
            return 2;
        }
    }

    @SuppressLint({"MissingPermission"})
    public static List<String> d(Context context) {
        g(context);
        ArrayList arrayList = new ArrayList();
        String c2 = com.excelliance.kxqp.util.a.b.c(context);
        if (!TextUtils.isEmpty(c2)) {
            arrayList.add(c2);
        }
        List<String> n = com.excelliance.kxqp.util.a.b.n(context);
        if (n != null && n.size() > 0) {
            for (int i = 0; i < n.size(); i++) {
                String str = n.get(i);
                if (!TextUtils.isEmpty(str)) {
                    a(str, arrayList);
                }
            }
        }
        return arrayList;
    }

    private static List<String> a(String str, List<String> list) {
        if (!TextUtils.isEmpty(str)) {
            boolean z = false;
            Iterator<String> it = list.iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                if (str.trim().equals(it.next().trim())) {
                    z = true;
                    break;
                }
            }
            if (z) {
                return list;
            }
            list.add(str);
        }
        return list;
    }
}