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

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


package com.excelliance.kxqp.bitmap.ui.imp;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.bytedance.sdk.open.aweme.common.constants.ParamKeyConstants;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.bean.AppBuyBean;
import com.excelliance.kxqp.bitmap.bean.RequestCate;
import com.excelliance.kxqp.bitmap.bean.RequestList;
import com.excelliance.kxqp.bitmap.bean.RequestPreview;
import com.excelliance.kxqp.bitmap.bean.ResponseList;
import com.excelliance.kxqp.bitmap.bean.ResponsePreview;
import com.excelliance.kxqp.bitmap.model.AppCategory;
import com.excelliance.kxqp.bitmap.model.AppInfo;
import com.excelliance.kxqp.bitmap.model.ResponseData;
import com.excelliance.kxqp.bitmap.model.ThirdLink;
import com.excelliance.kxqp.gs.util.an;
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.bc;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.be;
import com.excelliance.kxqp.gs.util.bn;
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 java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONObject;

public class j {

    private static volatile j f3014a;

    private Context f3015b;
    private Gson c;
    private String d;

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

    private j(Context context) {
        this.f3015b = context;
        this.d = context.getString(R.string.server_wrong);
    }

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

    public ResponseData<List<ExcellianceAppInfo>> a(int i, int i2, String str, boolean z, String str2) {
        return a(i, i2, str, z, false, str2);
    }

    public ResponseData<List<ExcellianceAppInfo>> a(int i, int i2, String str, boolean z, boolean z2) {
        return a(i, i2, str, z, z2, "ranking");
    }

    public ResponseData<List<ExcellianceAppInfo>> a(int i, int i2, String str, boolean z, boolean z2, String str2) {
        RequestList requestList;
        try {
            requestList = (RequestList) b().a(cn.i(this.f3015b).toString(), new TypeToken<RequestList>() {
            }.getType());
        } catch (Exception e) {
            e.printStackTrace();
            Log.d("RankingRepository", "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(z ? 1 : 0);
            requestList.setSize(String.valueOf(i2));
            requestList.setAreas(1);
            if (com.excelliance.kxqp.util.d.b.c) {
                requestList.setSupportMulti(1);
            }
            requestList.setControlapi(1);
            if (com.excelliance.kxqp.gs.util.b.bh(this.f3015b)) {
                requestList.setIsFromDomestic(1);
            }
        }
        String a2 = b().a(requestList);
        String str3 = TextUtils.equals(str2, "mainPage") ? bc.f : "https://api.ourplay.com.cn/v1/rank/typelist";
        az.d("RankingRepository", " requestDataString" + a2);
        be e2 = bd.e(str3, a2, 10000, 10000);
        String str4 = e2 != null ? e2.c : null;
        if (z2 && str4 != null) {
            an.b(new File(bn.a(this.f3015b, i, i2, str, z)), str4);
        }
        ResponseData<List<ExcellianceAppInfo>> a3 = a(str4);
        if (a3 != null && a3.data == null && e2 != null) {
            a3.msg = as.a(this.f3015b, e2);
        }
        return a3;
    }

    public ResponseData<List<ExcellianceAppInfo>> a(String str) {
        ResponseData responseData;
        List list;
        ResponseList responseList;
        ResponseData<List<ExcellianceAppInfo>> responseData2 = new ResponseData<>();
        responseData2.code = 1;
        responseData2.msg = this.d;
        if (str == null) {
            return responseData2;
        }
        try {
            str = com.excelliance.kxqp.task.store.c.b(str);
        } catch (Exception unused) {
        }
        try {
            Log.d("RankingRepository", String.format("RankingRepository/getListResponseData:thread(%s) decryptResult(%s)", Thread.currentThread().getName(), str));
            cd.d("RankingRepository", str);
            responseData = (ResponseData) b().a(str, new TypeToken<ResponseData<List<ResponseList>>>() {
            }.getType());
        } catch (Exception e) {
            az.e("RankingRepository", "RankingRepository/getAppList:" + e.toString());
            responseData = null;
        }
        if (responseData == null || (list = (List) responseData.data) == null || list.size() <= 0 || (responseList = (ResponseList) list.get(0)) == null) {
            return responseData2;
        }
        au.b(this.f3015b, responseList.list);
        return a(this.f3015b, responseList.list);
    }

    public ResponseData<List<ResponsePreview>> a(List<String> list, List<String> list2, int i) {
        return a(list, list2, i, false);
    }

    public ResponseData<List<ResponsePreview>> a(List<String> list, List<String> list2, int i, boolean z) {
        RequestPreview requestPreview;
        String str;
        ResponseData<List<ResponsePreview>> responseData;
        ResponseData<List<ResponsePreview>> responseData2 = new ResponseData<>();
        responseData2.msg = this.d;
        responseData2.code = 1;
        JSONObject i2 = cn.i(this.f3015b);
        int a2 = com.excelliance.kxqp.gs.util.b.a(this.f3015b);
        try {
            requestPreview = (RequestPreview) b().a(i2.toString(), new TypeToken<RequestPreview>() {
            }.getType());
        } catch (Exception e) {
            e.printStackTrace();
            requestPreview = null;
        }
        if (requestPreview != null) {
            requestPreview.setField(list);
            requestPreview.setId(list2);
            requestPreview.setType("list");
            requestPreview.setPos(z ? 1 : 0);
            requestPreview.setAbtest(String.valueOf(a2));
            requestPreview.setPageSize(String.valueOf(i));
            requestPreview.setAreas(1);
            if (com.excelliance.kxqp.util.d.b.c) {
                requestPreview.setSupportMulti(1);
            }
        }
        String a3 = b().a(requestPreview);
        Log.d("RankingRepository", "getRankPreview requestPreview: " + requestPreview + " requestDataString: " + a3);
        be e2 = bd.e("https://api.ourplay.com.cn/v1/rank/typelist", a3, 10000, 10000);
        if (e2 != null) {
            str = e2.c;
            responseData2.msg = as.a(this.f3015b, e2);
        } else {
            str = null;
        }
        if (!TextUtils.isEmpty(str)) {
            try {
                responseData = (ResponseData) b().a(com.excelliance.kxqp.task.store.c.b(str), new TypeToken<ResponseData<List<ResponsePreview>>>() {
                }.getType());
            } catch (Exception e3) {
                az.e("RankingRepository", "RankingRepository/getRankPreview:" + e3.toString());
                responseData = null;
            }
            if (responseData != null) {
                return responseData;
            }
        }
        return responseData2;
    }

    public ResponseData<List<AppCategory>> a() {
        return a(false, "from_launch");
    }

    public ResponseData<List<AppCategory>> b(String str) {
        return a(false, str);
    }

    public ResponseData<List<AppCategory>> a(boolean z, String str) {
        RequestCate requestCate;
        String str2;
        ResponseData<List<AppCategory>> responseData;
        com.excelliance.kxqp.gs.util.b.a(this.f3015b);
        ResponseData<List<AppCategory>> responseData2 = new ResponseData<>();
        responseData2.code = 1;
        responseData2.msg = this.d;
        JSONObject i = cn.i(this.f3015b);
        try {
            if (!TextUtils.isEmpty(str) && str.equals("from_detail_activity")) {
                i.put(ParamKeyConstants.WebViewConstants.QUERY_FROM, str);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            requestCate = (RequestCate) b().a(i.toString(), new TypeToken<RequestCate>() {
            }.getType());
        } catch (Exception e2) {
            e2.printStackTrace();
            Log.d("RankingRepository", "ex: " + e2.getMessage());
            requestCate = null;
        }
        if (requestCate != null) {
            requestCate.setType("cat");
            requestCate.setPos(z ? 1 : 0);
            requestCate.controlapi = 1;
        }
        String a2 = b().a(requestCate);
        Log.d("RankingRepository", "getCategoryList requestDataString: " + a2);
        be e3 = bd.e("https://api.ourplay.com.cn/rank/type", a2, 10000, 10000);
        if (e3 != null) {
            str2 = e3.c;
            responseData2.msg = as.a(this.f3015b, e3);
        } else {
            str2 = null;
        }
        if (str2 != null) {
            try {
                String b2 = com.excelliance.kxqp.task.store.c.b(str2);
                az.d("RankingRepository", "getCategoryList: " + b2 + " showInLaunchPage:" + z);
                responseData = (ResponseData) b().a(b2, new TypeToken<ResponseData<List<AppCategory>>>() {
                }.getType());
            } catch (Exception e4) {
                e4.printStackTrace();
                responseData = null;
            }
            if (responseData != null) {
                return responseData;
            }
        }
        return responseData2;
    }

    public static ResponseData<List<ExcellianceAppInfo>> a(Context context, List<AppInfo> list) {
        HashMap hashMap = new HashMap();
        ResponseData<List<ExcellianceAppInfo>> responseData = new ResponseData<>();
        ?? arrayList = new ArrayList();
        for (ExcellianceAppInfo excellianceAppInfo : InitialData.a(context).a()) {
            hashMap.put(excellianceAppInfo.getAppPackageName(), excellianceAppInfo);
        }
        if (!s.a(list)) {
            j a2 = a(context);
            Iterator<AppInfo> it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(a2.a(hashMap, it.next()));
            }
        }
        responseData.data = arrayList;
        responseData.code = 0;
        return responseData;
    }

    public List<ExcellianceAppInfo> a(List<AppInfo> list) {
        HashMap hashMap = new HashMap();
        ArrayList arrayList = new ArrayList();
        for (ExcellianceAppInfo excellianceAppInfo : InitialData.a(this.f3015b).a()) {
            hashMap.put(excellianceAppInfo.getAppPackageName(), excellianceAppInfo);
        }
        if (!s.a(list)) {
            j a2 = a(this.f3015b);
            Iterator<AppInfo> it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(a2.a(hashMap, it.next()));
            }
        }
        return arrayList;
    }

    public ExcellianceAppInfo a(Map<String, ExcellianceAppInfo> map, AppInfo appInfo) {
        float f;
        int size;
        ExcellianceAppInfo excellianceAppInfo = map.get(appInfo.packageName);
        if (excellianceAppInfo == null) {
            Context context = this.f3015b;
            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 (!cd.a(appInfo.name)) {
            excellianceAppInfo.setAppName(appInfo.name);
        }
        if (excellianceAppInfo.getAppSize() == 0 && !TextUtils.isEmpty(appInfo.size)) {
            try {
                excellianceAppInfo.setAppSize(Long.valueOf(appInfo.size).longValue());
            } catch (Exception e) {
                az.d("RankingRepository", "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.apkFrom = appInfo.apkFrom;
        excellianceAppInfo.isWhite = 1;
        excellianceAppInfo.downloadButtonVisible = appInfo.downloadButtonVisible;
        excellianceAppInfo.market_isjump = appInfo.market_isjump;
        excellianceAppInfo.market_jumplink = appInfo.market_jumplink;
        excellianceAppInfo.market_strategy = appInfo.market_strategy;
        excellianceAppInfo.gif_image_url = appInfo.gif_image_url;
        excellianceAppInfo.market_show = appInfo.market_show;
        excellianceAppInfo.market_friendimg = appInfo.market_friendimg;
        excellianceAppInfo.market_install_local = appInfo.market_install_local;
        excellianceAppInfo.playCount = appInfo.playCount;
        excellianceAppInfo.thirdLink = appInfo.thirdLink;
        excellianceAppInfo.hasThirdDomin = appInfo.hasThirdDomin;
        excellianceAppInfo.appUpdateTime = appInfo.appUpdateTime;
        excellianceAppInfo.datafinder_game_id = appInfo.datafinder_game_id;
        excellianceAppInfo.serverVc = appInfo.apk_update_version;
        excellianceAppInfo.buttonText = appInfo.buttonText;
        excellianceAppInfo.buttonStatus = appInfo.buttonStatus;
        try {
            excellianceAppInfo.appId = Integer.parseInt(appInfo.id);
        } catch (Exception e7) {
            e7.printStackTrace();
        }
        excellianceAppInfo.subscribeState = appInfo.subscribeState;
        excellianceAppInfo.subscribe = appInfo.subscribe;
        if (excellianceAppInfo.thirdLink != null && excellianceAppInfo.thirdLink.size() > 0) {
            for (ThirdLink thirdLink : excellianceAppInfo.thirdLink) {
                if (thirdLink.isOurSelf == 1 && !cd.a(excellianceAppInfo.appPackageName) && !cd.a(thirdLink.url)) {
                    thirdLink.url += excellianceAppInfo.appPackageName;
                    thirdLink.pkgName = excellianceAppInfo.appPackageName;
                    thirdLink.sourceFromMarket = excellianceAppInfo.market_strategy == 1 ? 1 : 0;
                }
            }
        }
        if (com.excelliance.kxqp.gs.util.b.bh(this.f3015b)) {
            excellianceAppInfo.apkFrom = appInfo.apkFrom;
            excellianceAppInfo.price = f;
            AppBuyBean l = com.excelliance.kxqp.repository.a.a(this.f3015b).l(excellianceAppInfo.getAppPackageName());
            if (l != null) {
                l.initData();
                excellianceAppInfo.isBuy = l.isBuy(this.f3015b) ? 1 : 0;
            }
        }
        excellianceAppInfo.avatarFrame = appInfo.avatarFrame;
        excellianceAppInfo.tag = appInfo.tags;
        excellianceAppInfo.playGameTime = appInfo.playTime;
        az.d("RankingRepository", "getExcellAppInfo appInfo:" + excellianceAppInfo);
        return excellianceAppInfo;
    }
}