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

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


package com.excelliance.kxqp.gs.newappstore.f;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.excelliance.kxqp.bean.AppBuyBean;
import com.excelliance.kxqp.bean.AppExtraBean;
import com.excelliance.kxqp.bitmap.bean.RequestCate;
import com.excelliance.kxqp.bitmap.bean.RequestList;
import com.excelliance.kxqp.bitmap.bean.ResponseList;
import com.excelliance.kxqp.bitmap.model.AppInfo;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.l.i;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.au;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.be;
import com.excelliance.kxqp.gs.util.bm;
import com.excelliance.kxqp.gs.util.bs;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.gs.util.s;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.ui.InitialData;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.tencent.connect.common.Constants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;

public class b {

    private static volatile b f7744a;

    private Context f7745b;
    private Gson c;
    private String d;

    public static b a(Context context) {
        if (f7744a == null) {
            synchronized (b.class) {
                if (f7744a == null) {
                    f7744a = new b(context.getApplicationContext());
                }
            }
        }
        return f7744a;
    }

    private b(Context context) {
        this.f7745b = context;
        this.d = com.excelliance.kxqp.swipe.a.a.getString(this.f7745b, "server_wrong");
    }

    private Gson b() {
        if (this.c == null) {
            this.c = new Gson();
        }
        return this.c;
    }

    public ResponseData<List<com.excelliance.kxqp.gs.newappstore.Bean.a>> a() {
        RequestCate requestCate;
        String str;
        ResponseData<List<com.excelliance.kxqp.gs.newappstore.Bean.a>> responseData;
        ResponseData<List<com.excelliance.kxqp.gs.newappstore.Bean.a>> responseData2 = new ResponseData<>();
        responseData2.code = 1;
        responseData2.msg = this.d;
        try {
            requestCate = (RequestCate) b().a(cn.i(this.f7745b).toString(), new TypeToken<RequestCate>() {
            }.getType());
        } catch (Exception e) {
            e.printStackTrace();
            Log.d("NewStoreAppListRepository", "ex: " + e.getMessage());
            requestCate = null;
        }
        if (requestCate != null) {
            requestCate.setType("cat");
        }
        String a2 = b().a(requestCate);
        Log.d("NewStoreAppListRepository", "getCategoryList requestDataString: " + a2);
        be e2 = bd.e("https://api.ourplay.com.cn//goneload/catehotmap", a2, 10000, 10000);
        if (e2 != null) {
            str = e2.c;
            responseData2.msg = as.a(this.f7745b, e2);
        } else {
            str = null;
        }
        Log.d("NewStoreAppListRepository", "getCategoryList rawResponse: " + str);
        if (str == null) {
            return responseData2;
        }
        try {
            String a3 = cn.a(str);
            az.d("NewStoreAppListRepository", "getCategoryList: decryptResult" + a3);
            responseData = (ResponseData) b().a(a3, new TypeToken<ResponseData<List<com.excelliance.kxqp.gs.newappstore.Bean.a>>>() {
            }.getType());
        } catch (Exception e3) {
            e3.printStackTrace();
            responseData = null;
        }
        return responseData != null ? responseData : responseData2;
    }

    public com.excelliance.kxqp.bitmap.model.ResponseData<List<ExcellianceAppInfo>> a(int i, int i2, String str, String str2, int i3, int i4) {
        RequestList requestList;
        String str3;
        if (i3 == 3) {
            return i == 0 ? a(this.f7745b, com.excelliance.kxqp.gs.l.c.a().a(this.f7745b.getApplicationContext())) : new com.excelliance.kxqp.bitmap.model.ResponseData<>();
        }
        try {
            requestList = (RequestList) b().a(cn.i(this.f7745b).toString(), new TypeToken<RequestList>() {
            }.getType());
        } catch (Exception e) {
            e.printStackTrace();
            Log.d("NewStoreAppListRepository", "ex: " + e.getMessage());
            requestList = null;
        }
        if (requestList != null) {
            ArrayList arrayList = new ArrayList();
            arrayList.add("all");
            requestList.setField(arrayList);
            ArrayList arrayList2 = new ArrayList();
            arrayList2.add(str);
            requestList.setId(arrayList2);
            requestList.setPage(String.valueOf(i));
            requestList.setType("list");
            requestList.setPos(i3 == 2 ? 1 : 0);
            requestList.setSize(String.valueOf(i2));
            requestList.setAreas(1);
            requestList.setControlapi(1);
            if (com.excelliance.kxqp.util.d.b.c) {
                requestList.setSupportMulti(1);
            }
            if (com.excelliance.kxqp.gs.util.b.bh(this.f7745b)) {
                requestList.setIsFromDomestic(1);
            }
            requestList.setIsFromDomestic(1);
            if (str != null && str.equals(Constants.VIA_REPORT_TYPE_SHARE_TO_QZONE) && i3 == 1) {
                List<ExcellianceAppInfo> b2 = b(this.f7745b);
                ArrayList arrayList3 = new ArrayList();
                if (b2 != null && b2.size() > 0) {
                    Iterator<ExcellianceAppInfo> it = b2.iterator();
                    while (it.hasNext()) {
                        arrayList3.add(it.next().getAppPackageName());
                    }
                }
                requestList.setInstalled_list(arrayList3);
            }
            if (i3 == 1 || i3 == 6 || i3 == 8 || i3 == 9) {
                requestList.setIdtype(str);
            }
            if (i3 == 0 && i4 == 1) {
                requestList.setSource(1);
            }
            if (i3 == 5) {
                requestList.setSubCateid(str2);
            }
        }
        String a2 = b().a(requestList);
        az.d("NewStoreAppListRepository", "requestDataString:" + a2);
        if (i3 == 1 || i3 == 6 || i3 == 8 || i3 == 9) {
            str3 = "https://api.ourplay.com.cn/v1/goneload/getmore";
        } else if (i3 == 2) {
            str3 = "https://api.ourplay.com.cn/v1/rank/typelist";
        } else if (i3 == 4) {
            str3 = "https://api.ourplay.com.cn/goneload/getonlinepkg";
        } else {
            if (i3 == 7) {
                return a(this.f7745b, i.a().a(this.f7745b).data.list);
            }
            str3 = "https://api.ourplay.com.cn/v1/goneload/catelist";
        }
        be e2 = bd.e(str3, a2, 10000, 10000);
        com.excelliance.kxqp.bitmap.model.ResponseData<List<ExcellianceAppInfo>> a3 = a(e2 != null ? e2.c : null);
        if (a3 != null && a3.data == null && e2 != null) {
            a3.msg = as.a(this.f7745b, e2);
        }
        return a3;
    }

    public com.excelliance.kxqp.bitmap.model.ResponseData<List<ExcellianceAppInfo>> a(String str) {
        com.excelliance.kxqp.bitmap.model.ResponseData responseData;
        List list;
        ResponseList responseList;
        com.excelliance.kxqp.bitmap.model.ResponseData<List<ExcellianceAppInfo>> responseData2 = new com.excelliance.kxqp.bitmap.model.ResponseData<>();
        responseData2.code = 1;
        responseData2.msg = this.d;
        if (str == null) {
            return responseData2;
        }
        com.excelliance.kxqp.bitmap.model.ResponseData responseData3 = null;
        try {
            str = cn.a(str);
        } catch (Exception unused) {
        }
        try {
            Log.d("NewStoreAppListRepository", "getAppList: test");
            cd.d("NewStoreAppListRepository", str);
            responseData = (com.excelliance.kxqp.bitmap.model.ResponseData) b().a(str, new TypeToken<com.excelliance.kxqp.bitmap.model.ResponseData<List<ResponseList>>>() {
            }.getType());
            try {
                Log.d("NewStoreAppListRepository", "getListResponseData: " + responseData.data);
            } catch (Exception e) {
                responseData3 = responseData;
                e = e;
                az.e("NewStoreAppListRepository", "NewStoreAppListRepository/getAppList:" + e.toString());
                responseData = responseData3;
                return responseData != null ? responseData2 : responseData2;
            }
        } catch (Exception e2) {
            e = e2;
        }
        if (responseData != null || (list = (List) responseData.data) == null || list.size() <= 0 || (responseList = (ResponseList) list.get(0)) == null) {
            return responseData2;
        }
        au.b(this.f7745b, responseList.list);
        return a(this.f7745b, responseList.list);
    }

    public static com.excelliance.kxqp.bitmap.model.ResponseData<List<ExcellianceAppInfo>> a(Context context, List<AppInfo> list) {
        HashMap hashMap = new HashMap();
        HashMap hashMap2 = new HashMap();
        com.excelliance.kxqp.bitmap.model.ResponseData<List<ExcellianceAppInfo>> responseData = new com.excelliance.kxqp.bitmap.model.ResponseData<>();
        ?? arrayList = new ArrayList();
        ArrayList<ExcellianceAppInfo> a2 = InitialData.a(context).a();
        for (AppExtraBean appExtraBean : com.excelliance.kxqp.repository.a.a(context).e()) {
            hashMap2.put(appExtraBean.getPackageName(), appExtraBean);
        }
        for (ExcellianceAppInfo excellianceAppInfo : a2) {
            AppExtraBean appExtraBean2 = (AppExtraBean) hashMap2.get(excellianceAppInfo.getAppPackageName());
            if (appExtraBean2 != null && !cd.a(appExtraBean2.getApkname())) {
                excellianceAppInfo.setAppName(appExtraBean2.getApkname());
            }
            hashMap.put(excellianceAppInfo.getAppPackageName(), excellianceAppInfo);
        }
        if (!s.a(list)) {
            b a3 = a(context);
            Iterator<AppInfo> it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(a3.a(context, hashMap, it.next()));
            }
        }
        responseData.data = arrayList;
        responseData.code = 0;
        return responseData;
    }

    public ExcellianceAppInfo a(Context context, Map<String, ExcellianceAppInfo> map, AppInfo appInfo) {
        float f;
        int size;
        ExcellianceAppInfo excellianceAppInfo = map.get(appInfo.packageName);
        if (excellianceAppInfo == null) {
            String str = appInfo.packageName;
            String str2 = appInfo.name;
            StringBuilder sb = new StringBuilder();
            sb.append((appInfo.name + appInfo.packageName).hashCode());
            sb.append("");
            excellianceAppInfo = new ExcellianceAppInfo(context, str, str2, null, "", "", "", "7", sb.toString(), 0L);
        }
        if (excellianceAppInfo.getAppSize() == 0 && !TextUtils.isEmpty(appInfo.size)) {
            try {
                excellianceAppInfo.setAppSize(Long.valueOf(appInfo.size).longValue());
            } catch (Exception e) {
                az.d("NewStoreAppListRepository", "NumberFormatException:" + e.getMessage());
            }
        }
        if (!TextUtils.isEmpty(appInfo.star)) {
            double d = 0.0d;
            try {
                d = Double.valueOf(appInfo.star).doubleValue();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            excellianceAppInfo.setStar(d);
        }
        if (!TextUtils.isEmpty(appInfo.versionCode)) {
            excellianceAppInfo.setVersionCode(Integer.valueOf(appInfo.versionCode).intValue());
        }
        excellianceAppInfo.setIconDownloadPath(appInfo.icon);
        excellianceAppInfo.setDesc(appInfo.desc);
        excellianceAppInfo.setStream(appInfo.stream == 1);
        excellianceAppInfo.setVideo_url(appInfo.video_url);
        excellianceAppInfo.setScreenshots(appInfo.screenshots);
        try {
            if (!TextUtils.isEmpty(appInfo.online)) {
                excellianceAppInfo.setOnline(Integer.valueOf(appInfo.online).intValue());
            }
            if (!TextUtils.isEmpty(appInfo.lowgms)) {
                excellianceAppInfo.setLowGms(Integer.valueOf(appInfo.lowgms).intValue());
            }
        } catch (Exception e3) {
            e3.printStackTrace();
        }
        if (appInfo.area != null && (size = appInfo.area.size()) > 0) {
            excellianceAppInfo.areas = new String[size];
            for (int i = 0; i < size; i++) {
                excellianceAppInfo.areas[i] = appInfo.area.get(i);
            }
        }
        String str3 = appInfo.minsdk;
        if (!TextUtils.isEmpty(str3)) {
            try {
                int intValue = Integer.valueOf(str3).intValue();
                if (intValue > 0) {
                    excellianceAppInfo.minSdk = intValue;
                }
            } catch (Exception e4) {
                e4.printStackTrace();
            }
        }
        excellianceAppInfo.minSdkName = appInfo.minsdkName;
        String str4 = appInfo.gms;
        if (!TextUtils.isEmpty(str4)) {
            try {
                int intValue2 = Integer.valueOf(str4).intValue();
                if (intValue2 > 0) {
                    excellianceAppInfo.gms = intValue2 == 1;
                }
            } catch (Exception e5) {
                e5.printStackTrace();
            }
        }
        excellianceAppInfo.cpu = appInfo.cpu;
        try {
            f = Float.valueOf(appInfo.price).floatValue();
        } catch (Exception e6) {
            e6.printStackTrace();
            f = 0.0f;
        }
        try {
            excellianceAppInfo.appId = Integer.valueOf(appInfo.id).intValue();
        } catch (Exception e7) {
            e7.printStackTrace();
        }
        Log.d("System[", ": " + f + "]");
        excellianceAppInfo.free = f == 0.0f;
        excellianceAppInfo.downloadButtonVisible = appInfo.downloadButtonVisible;
        excellianceAppInfo.apkFrom = appInfo.apkFrom;
        excellianceAppInfo.isWhite = 1;
        excellianceAppInfo.subscribe = appInfo.subscribe;
        excellianceAppInfo.subscribeState = appInfo.subscribeState;
        excellianceAppInfo.hasThirdDomin = appInfo.hasThirdDomin;
        excellianceAppInfo.appUpdateTime = appInfo.appUpdateTime;
        excellianceAppInfo.datafinder_game_id = appInfo.datafinder_game_id;
        excellianceAppInfo.serverVc = appInfo.apk_update_version;
        excellianceAppInfo.buttonStatus = appInfo.buttonStatus;
        excellianceAppInfo.buttonText = appInfo.buttonText;
        excellianceAppInfo.versionName = appInfo.versionName;
        if (com.excelliance.kxqp.gs.util.b.bh(this.f7745b)) {
            excellianceAppInfo.price = f;
            AppBuyBean l = com.excelliance.kxqp.repository.a.a(this.f7745b).l(excellianceAppInfo.getAppPackageName());
            if (l != null) {
                l.initData();
                excellianceAppInfo.isBuy = l.isBuy(this.f7745b) ? 1 : 0;
            }
        }
        return excellianceAppInfo;
    }

    private List<ExcellianceAppInfo> b(Context context) {
        az.d("NewStoreAppListRepository", "getNativeApplist enter");
        ArrayList<ExcellianceAppInfo> a2 = InitialData.a(context).a();
        if (a2 != null && a2.size() > 0) {
            ListIterator<ExcellianceAppInfo> listIterator = a2.listIterator();
            while (listIterator.hasNext()) {
                ExcellianceAppInfo next = listIterator.next();
                Log.d("NewStoreAppListRepository", "getNativeApplist: pkg" + next.getAppPackageName());
                boolean a3 = bm.a(next.getAppPackageName());
                if (bs.a(next.getAppPackageName()) == -1 && !a3 && next.haveApkInstalled()) {
                    az.d("NewStoreAppListRepository", "getNativeApplist pkg:" + next.getAppPackageName());
                } else {
                    listIterator.remove();
                }
            }
        }
        return a2;
    }
}