BRXT v5.6.8版本的 MD5 值为:caa0615cd5f4a3ae4ac8e2f0f9e0bebe

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


package io.dcloud.f.b.e;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.text.TextUtils;
import android.util.Base64;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import io.dcloud.common.DHInterface.IApp;
import io.dcloud.common.DHInterface.IWebview;
import io.dcloud.common.adapter.util.AndroidResources;
import io.dcloud.common.adapter.util.DeviceInfo;
import io.dcloud.common.adapter.util.Logger;
import io.dcloud.common.adapter.util.MobilePhoneModel;
import io.dcloud.common.adapter.util.PlatformUtil;
import io.dcloud.common.adapter.util.SP;
import io.dcloud.common.constant.AbsoluteConst;
import io.dcloud.common.constant.DataInterface;
import io.dcloud.common.util.ADUtils;
import io.dcloud.common.util.AESUtil;
import io.dcloud.common.util.BaseInfo;
import io.dcloud.common.util.CreateShortResultReceiver;
import io.dcloud.common.util.IOUtil;
import io.dcloud.common.util.JSUtil;
import io.dcloud.common.util.LauncherUtil;
import io.dcloud.common.util.LoadAppUtils;
import io.dcloud.common.util.Md5Utils;
import io.dcloud.common.util.NetTool;
import io.dcloud.common.util.NetworkTypeUtil;
import io.dcloud.common.util.PdrUtil;
import io.dcloud.common.util.TelephonyUtil;
import io.dcloud.common.util.ThreadPool;
import io.dcloud.common.util.ZipUtils;
import io.dcloud.common.util.hostpicker.HostPicker;
import io.dcloud.common.util.net.NetWork;
import io.dcloud.feature.internal.sdk.SDK;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;
public class a {

    static class C0032a implements HostPicker.HostPickCallback {
        final String a;
        final HashMap b;

        C0032a(String str, HashMap hashMap) {
            this.a = str;
            this.b = hashMap;
        }

        @Override
        public boolean doRequest(HostPicker.Host host) {
            byte[] httpPost = NetTool.httpPost(host.getRealHost(), this.a, (HashMap<String, String>) this.b, false);
            if (httpPost != null) {
                JSONObject jSONObject = null;
                try {
                    jSONObject = new JSONObject(new String(httpPost, "utf-8"));
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                } catch (JSONException e2) {
                    e2.printStackTrace();
                }
                Logger.d("commitTid", jSONObject);
                return true;
            }
            return false;
        }

        @Override
        public void onNoOnePicked() {
        }

        @Override
        public void onOneSelected(HostPicker.Host host) {
        }
    }

    static class b implements Runnable {
        final Activity a;
        final IApp b;
        final HashMap c;

        b(Activity activity, IApp iApp, HashMap hashMap) {
            this.a = activity;
            this.b = iApp;
            this.c = hashMap;
        }

        @Override
        public void run() {
            String str;
            HashMap hashMap = new HashMap();
            hashMap.put(NetWork.CONTENT_TYPE, "application/x-www-form-urlencoded;charset=utf-8");
            HashMap<Object, Object> a = a.a(this.a, SP.getOrCreateBundle(this.a, AbsoluteConst.START_STATISTICS_DATA), this.b);
            if (PdrUtil.isEmpty("1.9.9.80686")) {
                BaseInfo.parseControl();
            }
            this.c.putAll(a);
            String str2 = null;
            if (TextUtils.isEmpty(BaseInfo.sChannel)) {
                try {
                    str = AndroidResources.getMetaValue("DCLOUD_STREAMAPP_CHANNEL");
                } catch (Exception e) {
                    e.printStackTrace();
                    str = null;
                }
                if (!TextUtils.isEmpty(str)) {
                    this.c.put("mc", str);
                } else {
                    this.c.put("mc", "");
                }
            } else {
                this.c.put("mc", BaseInfo.sChannel);
            }
            try {
                if (!BaseInfo.isChannelGooglePlay()) {
                    this.c.put("streamapps", PlatformUtil.getStartupSechemeList(this.a, "streamapp://"));
                }
                this.c.put("ps", Integer.valueOf(BaseInfo.existsStreamEnv() ? 1 : 0));
                this.c.put("psd", Integer.valueOf(BaseInfo.ISDEBUG ? 1 : 0));
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            if (this.c.size() != 0) {
                do {
                } while (this.c.values().remove(null));
                do {
                } while (this.c.values().remove("null"));
                this.c.remove("oaid");
                this.c.remove("imsi");
                try {
                    str2 = URLEncoder.encode(Base64.encodeToString(AESUtil.encrypt(io.dcloud.g.a.b(), io.dcloud.g.a.a(), ZipUtils.zipString(new JSONObject(this.c).toString())), 2), "utf-8");
                } catch (UnsupportedEncodingException e3) {
                    e3.printStackTrace();
                }
                String str3 = "edata=" + str2;
                ArrayList arrayList = new ArrayList();
                arrayList.add(new HostPicker.Host("YHx8eHsyJyd7OSZsa2RnfWwmZm18JmtmJ3hscg==", HostPicker.Host.PriorityEnum.FIRST));
                arrayList.add(new HostPicker.Host("YHx8eHsyJyd7OiZsa2RnfWwmZm18JmtmJ3hscg==", HostPicker.Host.PriorityEnum.NORMAL));
                arrayList.add(new HostPicker.Host("YHx8eHsyJydrO2k/Pzs7OCU7a207JTw5Pm0lMWowOSU9Pzk4aT9tbjhtaj8mant4aXh4JmtnZSdgfHx4J3hscg==", HostPicker.Host.PriorityEnum.BACKUP));
                NetTool.httpPost("https://service.dcloud.net.cn/pdz", str3, (HashMap<String, String>) hashMap, false, true);
            }
        }
    }

    public static HashMap<Object, Object> a(IApp iApp, SharedPreferences sharedPreferences) {
        HashMap<Object, Object> hashMap = new HashMap<>();
        try {
            String str = null;
            hashMap.putAll(DataInterface.getStartupUrlBaseData(iApp.getActivity(), iApp.obtainAppId(), BaseInfo.getLaunchType(iApp.getActivity().getIntent()), null));
            hashMap.put("st", Long.valueOf(BaseInfo.run5appEndTime));
            hashMap.put("pn", iApp.getActivity().getPackageName());
            hashMap.put(CreateShortResultReceiver.KEY_VERSIONNAME, iApp.obtainAppVersionName());
            hashMap.put("pv", AndroidResources.versionName);
            hashMap.put("uat", Integer.valueOf(BaseInfo.isUniAppAppid(iApp) ? 1 : 0));
            hashMap.put("name", iApp.obtainAppName());
            hashMap.put("it", Integer.valueOf(SDK.isUniMPSDK() ? 1 : 0));
            if (SDK.isUniMPSDK()) {
                boolean checkClass = PlatformUtil.checkClass(iApp.getConfusionMgr().getGDTClassName());
                boolean checkClass2 = PlatformUtil.checkClass(iApp.getConfusionMgr().getCSJClassName());
                boolean checkClass3 = PlatformUtil.checkClass(iApp.getConfusionMgr().getKSClassName());
                JSONObject jSONObject = new JSONObject();
                JSONObject jSONObject2 = new JSONObject();
                String str2 = "1";
                jSONObject2.put("r", checkClass2 ? "1" : "0");
                jSONObject.put("csj", jSONObject2);
                JSONObject jSONObject3 = new JSONObject();
                jSONObject3.put("r", checkClass ? "1" : "0");
                jSONObject.put("gdt", jSONObject3);
                JSONObject jSONObject4 = new JSONObject();
                if (!checkClass3) {
                    str2 = "0";
                }
                jSONObject4.put("r", str2);
                jSONObject.put("ks", jSONObject4);
                hashMap.put("cad", jSONObject.toString());
            } else {
                hashMap.put("psdk", 0);
            }
            String bundleData = SP.getBundleData(iApp.getActivity(), "pdr", SP.REPORT_UNI_VERIFY_GYUID);
            if (!TextUtils.isEmpty(bundleData)) {
                hashMap.put("uvs", bundleData);
            }
            if (PdrUtil.isSupportOaid()) {
                Object obj = DeviceInfo.oaids;
                if (obj == null) {
                    obj = "||";
                }
                hashMap.put("oaid", obj);
            }
            if (BaseInfo.isUniAppAppid(iApp)) {
                a(iApp, hashMap);
            }
            if (TextUtils.isEmpty(BaseInfo.sChannel)) {
                try {
                    str = AndroidResources.getMetaValue("DCLOUD_STREAMAPP_CHANNEL");
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (!TextUtils.isEmpty(str)) {
                    hashMap.put("mc", str);
                } else {
                    hashMap.put("mc", "");
                }
            } else {
                hashMap.put("mc", BaseInfo.sChannel);
            }
            if ((System.currentTimeMillis() - sharedPreferences.getLong(AbsoluteConst.COMMIT_APP_LIST_TIME, 0L)) / 100000 >= 26000) {
                if (!BaseInfo.isChannelGooglePlay()) {
                    if ((!Build.MANUFACTURER.equalsIgnoreCase(MobilePhoneModel.HUAWEI) || Build.VERSION.SDK_INT < 23 || PlatformUtil.checkGTAndYoumeng()) && (TextUtils.isEmpty(BaseInfo.sChannel) || !BaseInfo.sChannel.endsWith("|xiaomi"))) {
                        hashMap.put(AbsoluteConst.XML_APPS, a(iApp.getActivity()).toString());
                    }
                    JSONObject jSONObject5 = new JSONObject();
                    jSONObject5.put("pn", LauncherUtil.getLauncherPackageName(iApp.getActivity()));
                    hashMap.put("launcher", jSONObject5.toString());
                }
                hashMap.put("imsi", TelephonyUtil.getIMSI(iApp.getActivity()));
                if (!TextUtils.isEmpty(sharedPreferences.getString(AbsoluteConst.GEO_DATA, ""))) {
                    hashMap.put("pos", sharedPreferences.getString(AbsoluteConst.GEO_DATA, ""));
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        return hashMap;
    }

    private static void a(IApp iApp, HashMap<Object, Object> hashMap) {
        String str;
        JSONArray jSONArray;
        StringBuilder sb = new StringBuilder();
        try {
            str = IOUtil.toString(iApp.getActivity().getAssets().open("dcloud_uniplugins.json"));
        } catch (Exception unused) {
            str = null;
        }
        if (!PdrUtil.isEmpty(str)) {
            try {
                JSONArray jSONArray2 = JSON.parseObject(str).getJSONArray("nativePlugins");
                if (jSONArray2 != null && jSONArray2.size() > 0) {
                    for (int i = 0; i < jSONArray2.size(); i++) {
                        com.alibaba.fastjson.JSONObject jSONObject = jSONArray2.getJSONObject(i);
                        if (jSONObject != null && (jSONArray = jSONObject.getJSONArray("plugins")) != null && jSONArray.size() > 0) {
                            for (int i2 = 0; i2 < jSONArray.size(); i2++) {
                                com.alibaba.fastjson.JSONObject jSONObject2 = jSONArray.getJSONObject(i2);
                                if (jSONObject2 != null && jSONObject2.containsKey("name")) {
                                    sb.append(jSONObject2.getString("name")).append(JSUtil.COMMA);
                                }
                            }
                        }
                    }
                }
            } catch (Exception unused2) {
            }
        }
        if (sb.length() > 0) {
            sb.deleteCharAt(sb.length() - 1);
            hashMap.put("ups", sb.toString());
        }
    }

    private static org.json.JSONArray a(Context context) throws Exception {
        PackageManager packageManager = context.getPackageManager();
        List<PackageInfo> installedNonSystemApps = LoadAppUtils.getInstalledNonSystemApps(context, packageManager);
        org.json.JSONArray jSONArray = new org.json.JSONArray();
        for (PackageInfo packageInfo : installedNonSystemApps) {
            if (!context.getPackageName().equals(packageInfo.packageName)) {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("name", (String) packageManager.getApplicationLabel(packageInfo.applicationInfo));
                jSONObject.put("pn", packageInfo.packageName);
                jSONObject.put("ver", packageInfo.versionName);
                jSONArray.put(jSONObject);
            }
        }
        return jSONArray;
    }

    public static void a(Context context, String str, String str2, String str3, int i, String str4, String str5, JSONObject jSONObject, String str6, String str7, String str8, String str9) {
        String str10;
        String str11;
        String str12;
        try {
            str10 = URLEncoder.encode(Build.MODEL, "utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            str10 = "";
        }
        try {
            str11 = DeviceInfo.sApplicationContext.getPackageManager().getPackageInfo(DeviceInfo.sApplicationContext.getPackageName(), 0).versionName;
        } catch (Exception e2) {
            e2.printStackTrace();
            str11 = "";
        }
        String imei = TelephonyUtil.getIMEI(context, true, true);
        ArrayList arrayList = new ArrayList();
        if (i == 1) {
            arrayList.add(new HostPicker.Host("YHx8eHsyJyd8OSZsa2RnfWwmZm18JmtmJ2tnZGRta3wneGR9e2l4eCdpa3xhZ2Y=", HostPicker.Host.PriorityEnum.FIRST));
            arrayList.add(new HostPicker.Host("YHx8eHsyJyd8OiZsa2RnfWwmZm18JmtmJ2tnZGRta3wneGR9e2l4eCdpa3xhZ2Y=", HostPicker.Host.PriorityEnum.NORMAL));
            arrayList.add(new HostPicker.Host("YHx8eHsyJyc6OzswaTw6aiU7bWs7JTxtaz0lMDlrMCU6bm1rMTE/MDw/aTAmant4aXh4JmtnZSdgfHx4J2tpaQ==", HostPicker.Host.PriorityEnum.BACKUP));
        } else {
            arrayList.add(new HostPicker.Host("YHx8eHsyJydpezkmbGtkZ31sJmZtfCZrZidrZ2RkbWt8J3hkfXtpeHgnaWt8YWdm", HostPicker.Host.PriorityEnum.FIRST));
            arrayList.add(new HostPicker.Host("YHx8eHsyJydpezombGtkZ31sJmZtfCZrZidrZ2RkbWt8J3hkfXtpeHgnaWt8YWdm", HostPicker.Host.PriorityEnum.NORMAL));
            arrayList.add(new HostPicker.Host("YHx8eHsyJyc8bTFqOGowaSU4bDw8JTw6bmwlMTA7bCU6P2wxMTlsbGw6Ozomant4aXh4JmtnZSdgfHx4J2tpaQ==", HostPicker.Host.PriorityEnum.BACKUP));
        }
        HashMap hashMap = new HashMap();
        hashMap.put("p", "a");
        hashMap.put("appid", str);
        hashMap.put(CreateShortResultReceiver.KEY_VERSIONNAME, str11);
        hashMap.put("tid", str2);
        hashMap.put("at", Integer.valueOf(i));
        hashMap.put("os", Integer.valueOf(Build.VERSION.SDK_INT));
        hashMap.put("adpid", str8);
        if (imei.endsWith("&ie=1")) {
            imei = imei.replace("&ie=1", "");
            hashMap.put("ie", 1);
        } else if (imei.endsWith("&ie=0")) {
            imei = imei.replace("&ie=0", "");
            hashMap.put("ie", 0);
        }
        hashMap.put("imei", imei);
        hashMap.put("md", str10);
        hashMap.put("vd", Build.MANUFACTURER);
        hashMap.put("net", Integer.valueOf(NetworkTypeUtil.getNetworkType(DeviceInfo.sApplicationContext)));
        hashMap.put("vb", "1.9.9.80686");
        hashMap.put("t", Long.valueOf(System.currentTimeMillis()));
        String str13 = null;
        if (TextUtils.isEmpty(BaseInfo.sChannel)) {
            try {
                str12 = AndroidResources.getMetaValue("DCLOUD_STREAMAPP_CHANNEL");
            } catch (Exception e3) {
                e3.printStackTrace();
                str12 = null;
            }
            if (!TextUtils.isEmpty(str12)) {
                hashMap.put("mc", str12);
            } else {
                hashMap.put("mc", "");
            }
        } else {
            hashMap.put("mc", BaseInfo.sChannel);
        }
        hashMap.put("paid", str3);
        if (i == 32) {
            hashMap.put("dec", str4);
            hashMap.put("dem", str5);
        }
        if (i == 41 && jSONObject != null && str6 == null) {
            if (jSONObject.has("img")) {
                hashMap.put("img", Md5Utils.md5(jSONObject.optString("img")).toLowerCase());
            }
            if (jSONObject.has("dw")) {
                hashMap.put("dw", jSONObject.optString("dw"));
            }
            if (jSONObject.has("dh")) {
                hashMap.put("dh", jSONObject.optString("dh"));
            }
            if (jSONObject.has("click_coord")) {
                hashMap.put("click_coord", jSONObject.optJSONObject("click_coord").toString());
            }
        }
        if (str6 != null) {
            hashMap.put("mediaId", str6);
        }
        if (str7 != null) {
            hashMap.put("slotId", str7);
        }
        try {
            str13 = URLEncoder.encode(Base64.encodeToString(AESUtil.encrypt(io.dcloud.g.a.b(), io.dcloud.g.a.a(), ZipUtils.zipString(new JSONObject(hashMap).toString())), 2), "utf-8");
        } catch (UnsupportedEncodingException e4) {
            e4.printStackTrace();
        }
        String str14 = "edata=" + str13;
        try {
            HashMap hashMap2 = new HashMap();
            try {
                if (!PdrUtil.isEmpty(str9) && str9.equalsIgnoreCase("webview")) {
                    Object ADHandlerMethod = ADUtils.ADHandlerMethod("get", "ua-webview");
                    if (ADHandlerMethod instanceof String) {
                        hashMap2.put(IWebview.USER_AGENT, (String) ADHandlerMethod);
                    }
                }
            } catch (Exception unused) {
            }
            HostPicker.getInstance().pickSuitHost(context, arrayList, "CAA_" + i, new C0032a(str14, hashMap2));
        } catch (Exception e5) {
            Logger.p("CommitDataUtil", e5.getMessage());
        }
    }

    public static void a(Activity activity, IApp iApp) {
        ThreadPool.self().addThreadTask(new b(activity, iApp, new HashMap()));
    }

    private static boolean a(String str) {
        String str2;
        if (PdrUtil.isEmpty(str)) {
            return false;
        }
        if ("HBuilder".equals(str) && (str2 = BaseInfo.sCurrentAppOriginalAppid) != null) {
            str = str2;
        }
        return str.startsWith("__UNI__");
    }

    public static HashMap<Object, Object> a(Activity activity, SharedPreferences sharedPreferences, IApp iApp) {
        String str;
        HashMap<Object, Object> hashMap = new HashMap<>();
        try {
            if (iApp != null) {
                str = iApp.obtainAppId();
            } else {
                if (PdrUtil.isEmpty(BaseInfo.sDefaultBootApp)) {
                    BaseInfo.parseControl();
                }
                str = BaseInfo.sDefaultBootApp;
            }
            hashMap.putAll(DataInterface.getStartupUrlBaseData(activity, str, BaseInfo.getLaunchType(activity.getIntent()), null));
            hashMap.put("st", Long.valueOf(BaseInfo.run5appEndTime));
            hashMap.put("pn", activity.getPackageName());
            if (iApp != null) {
                hashMap.put("name", iApp.obtainAppName());
                hashMap.put(CreateShortResultReceiver.KEY_VERSIONNAME, iApp.obtainAppVersionName());
                hashMap.put("uat", Integer.valueOf(BaseInfo.isUniAppAppid(iApp) ? 1 : 0));
            } else {
                hashMap.put("uat", Integer.valueOf(a(BaseInfo.sDefaultBootApp) ? 1 : 0));
            }
            hashMap.put("pv", AndroidResources.versionName);
            if (PdrUtil.isSupportOaid()) {
                String str2 = DeviceInfo.oaids;
                if (str2 == null) {
                    str2 = "||";
                }
                hashMap.put("oaid", str2);
            }
            if ((System.currentTimeMillis() - sharedPreferences.getLong(AbsoluteConst.COMMIT_APP_LIST_TIME, 0L)) / 100000 >= 26000) {
                if (!BaseInfo.isChannelGooglePlay()) {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("pn", LauncherUtil.getLauncherPackageName(activity));
                    hashMap.put("launcher", jSONObject.toString());
                }
                hashMap.put("imsi", TelephonyUtil.getIMSI(activity));
            }
        } catch (Exception e) {
            Logger.p("CommitDataUtil", e.getMessage());
        }
        return hashMap;
    }

    public static void a(String str, String str2, String str3, String str4) {
        NetTool.httpGet("https://96f0e031-f37a-48ef-84c7-2023f6360c0a.bspapp.com/http/rewarded-video/report?p=a&t=" + str4 + "&a=" + str + "&c=" + str2 + "&m=" + PdrUtil.encodeURL(str3));
    }
}