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

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


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

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.android.spush.util.WebActionRouter;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.bean.AppBuyBean;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.bitmap.model.AppInfo;
import com.excelliance.kxqp.bitmap.model.ThirdLink;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.newappstore.a.a;
import com.excelliance.kxqp.gs.service.ProxyDelayService;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bm;
import com.excelliance.kxqp.gs.util.bs;
import com.excelliance.kxqp.gs.util.cn;
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.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class c {

    private static volatile c f7750a;

    private Context f7751b;
    private Gson c;
    private String d;

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

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

    public Gson a() {
        if (this.c == null) {
            this.c = new Gson();
        }
        return this.c;
    }

    public ResponseData<List<a.d>> a(Context context, int i, int i2) {
        final Context context2 = this.f7751b;
        com.excelliance.kxqp.gs.discover.bbs.c cVar = new com.excelliance.kxqp.gs.discover.bbs.c(context2);
        JSONObject i3 = cn.i(context2);
        if (i == 0) {
            try {
                List<ExcellianceAppInfo> b2 = b(context2);
                JSONArray jSONArray = new JSONArray();
                if (b2 != null && b2.size() > 0) {
                    Iterator<ExcellianceAppInfo> it = b2.iterator();
                    while (it.hasNext()) {
                        jSONArray.put(it.next().getAppPackageName());
                    }
                }
                i3.put("installed_list", jSONArray);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        if (com.excelliance.kxqp.gs.util.b.bU(context2)) {
            i3.put("refreshCount", i2);
        }
        i3.put("page", i);
        i3.put("branch", com.excelliance.kxqp.gs.util.b.a(context2));
        i3.put("banner_update", 1);
        az.d("NewStoreRepository", " getapplist  requestParams:" + i3);
        return cVar.a(i3.toString(), "https://api.ourplay.com.cn/v1/goneload/discovery", new com.excelliance.kxqp.gs.discover.a.c<List<a.d>>() {
            @Override
            public ResponseData<List<a.d>> a(String str) {
                AppInfo appInfo;
                try {
                    ResponseData<List<a.d>> responseData = new ResponseData<>();
                    responseData.code = 1;
                    responseData.msg = "server error";
                    JSONObject jSONObject = new JSONObject(str);
                    ProxyDelayService.a("NewStoreRepository", "getStoreAppList response:" + str);
                    int optInt = jSONObject.optInt("code");
                    String optString = jSONObject.optString("msg");
                    responseData.code = optInt;
                    responseData.msg = optString;
                    JSONArray optJSONArray = jSONObject.optJSONArray("data");
                    if (optJSONArray != null && optJSONArray.length() != 0) {
                        ?? arrayList = new ArrayList();
                        responseData.data = arrayList;
                        for (int i4 = 0; i4 < optJSONArray.length(); i4++) {
                            JSONObject jSONObject2 = optJSONArray.getJSONObject(i4);
                            az.d("NewStoreRepository", "i:" + i4 + "   str:" + jSONObject2.toString());
                            a.d dVar = new a.d();
                            dVar.f7536b = jSONObject2.optString("id");
                            dVar.i = jSONObject2.optString("type");
                            dVar.h = jSONObject2.optString(RankingItem.KEY_VER);
                            try {
                                dVar.u = com.excelliance.kxqp.gs.newappstore.a.a.a(dVar.i);
                                az.d("NewStoreRepository", "i:" + i4 + "   type:" + dVar.u);
                            } catch (Exception e2) {
                                e2.printStackTrace();
                                az.d("NewStoreRepository", "ex:" + e2.getMessage());
                            }
                            dVar.f7535a = jSONObject2.optString("title");
                            dVar.c = jSONObject2.optString("idtype");
                            dVar.d = new ArrayList();
                            az.d("NewStoreRepository", "getStoreAppList/CategoryModel: " + dVar);
                            JSONArray optJSONArray2 = jSONObject2.optJSONArray("list");
                            if (optJSONArray2 != null && optJSONArray2.length() != 0 && (!com.excean.ab_builder.c.a.U(c.this.f7751b) || TextUtils.isEmpty(dVar.i) || !dVar.i.equals("banner_style_v2"))) {
                                for (int i5 = 0; i5 < optJSONArray2.length(); i5++) {
                                    JSONObject jSONObject3 = optJSONArray2.getJSONObject(i5);
                                    a.C0309a c0309a = new a.C0309a();
                                    c0309a.c = jSONObject3.optString("desc");
                                    c0309a.f7534b = jSONObject3.optString(RankingItem.KEY_ICON);
                                    c0309a.k = jSONObject3.optString("id");
                                    c0309a.f7533a = jSONObject3.optString("name");
                                    c0309a.d = jSONObject3.optString(WebActionRouter.KEY_PKG);
                                    c0309a.m = jSONObject3.optString("jumplink");
                                    c0309a.o = jSONObject3.optInt("type");
                                    c0309a.p = jSONObject3.optInt("compilationId");
                                    c0309a.l = dVar.h;
                                    c0309a.f = jSONObject3.optString("datafinder_game_id");
                                    c0309a.j = jSONObject3.optString("version_updatetime");
                                    c0309a.e = jSONObject3.optInt("apk_update_version");
                                    try {
                                        c0309a.q = jSONObject3.optInt("playable");
                                    } catch (Exception e3) {
                                        e3.printStackTrace();
                                    }
                                    try {
                                        c0309a.u = com.excelliance.kxqp.gs.newappstore.a.a.b(dVar.i);
                                        az.d("NewStoreRepository", "i:" + i4 + "   type:" + dVar.u + "  j:" + i5 + " itemtype:" + c0309a.u);
                                    } catch (Exception e4) {
                                        e4.printStackTrace();
                                        az.d("NewStoreRepository", "ex:" + e4.getMessage());
                                    }
                                    if (dVar.i.equals("app_grid")) {
                                        az.d("NewStoreRepository", "appObj:" + jSONObject3.toString());
                                        JSONObject optJSONObject = jSONObject3.optJSONObject("app_bean");
                                        if (optJSONObject != null) {
                                            az.d("NewStoreRepository", "app_bean_obj:" + optJSONObject.toString());
                                            AppInfo appInfo2 = (AppInfo) c.this.a().a(optJSONObject.toString(), new TypeToken<AppInfo>() {
                                            }.getType());
                                            if (appInfo2 != null) {
                                                az.d("NewStoreRepository", "appInfo:" + appInfo2);
                                                ExcellianceAppInfo a2 = c.a(context2, appInfo2);
                                                az.d("NewStoreRepository", "excellianceAppInfo:" + a2);
                                                c0309a.n = a2;
                                            }
                                        }
                                    }
                                    if ((dVar.i.equals("app_grid_new") || dVar.i.equals("video_list")) && (appInfo = (AppInfo) c.this.a().a(jSONObject3.toString(), new TypeToken<AppInfo>() {
                                    }.getType())) != null) {
                                        az.d("NewStoreRepository", "APP_GRID_NEW appInfo:" + appInfo);
                                        ExcellianceAppInfo a3 = c.a(context2, appInfo);
                                        az.d("NewStoreRepository", "APP_GRID_NEW excellianceAppInfo:" + a3);
                                        c0309a.n = a3;
                                    }
                                    if (dVar.i.equals("video_list")) {
                                        c0309a.r = jSONObject3.optString("videoUrl");
                                        c0309a.s = jSONObject3.optString("videoCoverUrl");
                                        c.this.a(c0309a);
                                    }
                                    az.d("NewStoreRepository", "getStoreAppList/appModel: " + c0309a);
                                    dVar.d.add(c0309a);
                                }
                                if (com.excean.ab_builder.c.a.U(c.this.f7751b) && !TextUtils.isEmpty(dVar.i) && dVar.i.equals("flag_list")) {
                                    a.C0309a c0309a2 = dVar.d.get(0);
                                    a.C0309a c0309a3 = new a.C0309a();
                                    c0309a3.f7534b = "more_flag";
                                    c0309a3.k = c0309a2.k;
                                    c0309a3.u = c0309a2.u;
                                    c0309a3.f7533a = c.this.f7751b.getResources().getString(R.string.more);
                                    dVar.d.add(c0309a3);
                                }
                                arrayList.add(dVar);
                            }
                        }
                        return responseData;
                    }
                    return responseData;
                } catch (JSONException e5) {
                    az.d("NewStoreRepository", "getStoreAppList/Exception: " + e5.getMessage());
                    return null;
                }
            }
        });
    }

    public static ResponseData<List<a.C0309a>> a(Context context, String str, String str2, int i, final String str3, String str4) {
        com.excelliance.kxqp.gs.discover.bbs.c cVar = new com.excelliance.kxqp.gs.discover.bbs.c(context);
        JSONObject i2 = cn.i(context);
        try {
            i2.put("id", str);
            i2.put("idtype", str2);
            i2.put("page", i);
            i2.put(RankingItem.KEY_VER, str4);
            i2.put("pageSize", 5);
            i2.put("branch", com.excelliance.kxqp.gs.util.b.a(context));
            List<ExcellianceAppInfo> b2 = b(context);
            JSONArray jSONArray = new JSONArray();
            if (str != null && str.equals(Constants.VIA_REPORT_TYPE_SHARE_TO_QZONE)) {
                if (b2 != null && b2.size() > 0) {
                    Iterator<ExcellianceAppInfo> it = b2.iterator();
                    while (it.hasNext()) {
                        jSONArray.put(it.next().getAppPackageName());
                    }
                }
                i2.put("installed_list", jSONArray);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return cVar.a(i2.toString(), "https://api.ourplay.com.cn/goneload/rightgetmore", new com.excelliance.kxqp.gs.discover.a.c<List<a.C0309a>>() {
            @Override
            public ResponseData<List<a.C0309a>> a(String str5) {
                Integer valueOf = Integer.valueOf(com.excelliance.kxqp.gs.newappstore.a.a.b(str3));
                try {
                    ResponseData<List<a.C0309a>> responseData = new ResponseData<>();
                    responseData.code = 1;
                    responseData.msg = "server error";
                    JSONObject jSONObject = new JSONObject(str5);
                    int optInt = jSONObject.optInt("code");
                    String optString = jSONObject.optString("msg");
                    responseData.code = optInt;
                    responseData.msg = optString;
                    responseData.data = new ArrayList();
                    JSONArray optJSONArray = jSONObject.optJSONArray("data");
                    if (optJSONArray != null && optJSONArray.length() != 0) {
                        for (int i3 = 0; i3 < optJSONArray.length(); i3++) {
                            JSONObject jSONObject2 = optJSONArray.getJSONObject(i3);
                            a.C0309a c0309a = new a.C0309a();
                            c0309a.c = jSONObject2.optString("desc");
                            c0309a.f7534b = jSONObject2.optString(RankingItem.KEY_ICON);
                            c0309a.k = jSONObject2.optString("id");
                            c0309a.f7533a = jSONObject2.optString("name");
                            c0309a.d = jSONObject2.optString(WebActionRouter.KEY_PKG);
                            c0309a.f = jSONObject2.optString("datafinder_game_id");
                            c0309a.j = jSONObject2.optString("game_update_time");
                            c0309a.e = jSONObject2.optInt("apk_update_version");
                            try {
                                c0309a.q = jSONObject2.optInt("playable");
                            } catch (Exception e2) {
                                e2.printStackTrace();
                            }
                            if (valueOf != null) {
                                c0309a.u = valueOf.intValue();
                            }
                            responseData.data.add(c0309a);
                        }
                        return responseData;
                    }
                    return responseData;
                } catch (JSONException e3) {
                    az.d("NewStoreRepository", "getStoreAppList/Exception: " + e3.getMessage());
                    return null;
                }
            }
        });
    }

    public static ExcellianceAppInfo a(Context context, AppInfo appInfo) {
        ExcellianceAppInfo b2 = com.excelliance.kxqp.repository.a.a(context).b(appInfo.packageName);
        if (appInfo != null) {
            return a(context).a(context, b2, appInfo);
        }
        return null;
    }

    public ExcellianceAppInfo a(Context context, ExcellianceAppInfo excellianceAppInfo, AppInfo appInfo) {
        float f;
        int size;
        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("NewStoreRepository", "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.setVersionName(appInfo.versionName);
        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;
        }
        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.hasThirdDomin = appInfo.hasThirdDomin;
        excellianceAppInfo.appUpdateTime = appInfo.appUpdateTime;
        excellianceAppInfo.datafinder_game_id = appInfo.datafinder_game_id;
        excellianceAppInfo.serverVc = appInfo.apk_update_version;
        if (com.excelliance.kxqp.gs.util.b.bh(this.f7751b)) {
            excellianceAppInfo.price = f;
            AppBuyBean l = com.excelliance.kxqp.repository.a.a(this.f7751b).l(excellianceAppInfo.getAppPackageName());
            if (l != null) {
                l.initData();
                excellianceAppInfo.isBuy = l.isBuy(this.f7751b) ? 1 : 0;
            }
        }
        excellianceAppInfo.thirdLink = appInfo.thirdLink;
        if (excellianceAppInfo.thirdLink != null) {
            for (ThirdLink thirdLink : excellianceAppInfo.thirdLink) {
                thirdLink.pkgName = excellianceAppInfo.appPackageName;
                thirdLink.sourceFromMarket = excellianceAppInfo.market_strategy == 1 ? 1 : 0;
            }
        }
        excellianceAppInfo.actUser = appInfo.actUser;
        return excellianceAppInfo;
    }

    public static List<ExcellianceAppInfo> b(Context context) {
        az.d("NewStoreRepository", "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("NewStoreRepository", "getNativeApplist: pkg" + next.getAppPackageName());
                boolean a3 = bm.a(next.getAppPackageName());
                if (bs.a(next.getAppPackageName()) == -1 && !a3 && next.isInstalled() && !bs.d(next.getAppPackageName())) {
                    az.d("NewStoreRepository", "getNativeApplist pkg:" + next.getAppPackageName());
                } else {
                    listIterator.remove();
                }
            }
        }
        return a2;
    }

    public void a(a.C0309a c0309a) {
        ExcellianceAppInfo b2 = com.excelliance.kxqp.repository.a.a(this.f7751b).b(c0309a.d);
        if (b2 == null || !b2.isInstalled()) {
            return;
        }
        c0309a.t = true;
    }
}