QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

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


package com.tencent.mtt.ad.live;

import com.tencent.common.http.HttpHeader;
import com.tencent.common.task.QBTask;
import com.tencent.common.utils.QADID;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.ad.live.protocol.NowLiveInfo;
import com.tencent.mtt.ad.live.protocol.NowRspInfo;
import com.tencent.mtt.base.utils.NetworkUtils;
import com.tencent.mtt.base.wup.GUIDManager;
import com.tencent.mtt.network.QBUrl;
import com.tencent.mtt.qbinfo.QUAUtils;
import com.tencent.mtt.qbinfo.UserAgentUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.concurrent.Callable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class RecomLiveManager {

    public static boolean f31090a;

    private static volatile RecomLiveManager f31091b;

    private boolean f31092c = false;

    private RecomLiveManager() {
    }

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

    public NowRspInfo b(String str) {
        JSONObject jSONObject;
        JSONObject jSONObject2;
        NowRspInfo nowRspInfo = new NowRspInfo();
        try {
            jSONObject = new JSONObject(str);
            nowRspInfo.f31099a = jSONObject.getInt("retcode");
            nowRspInfo.f31100b = jSONObject.getString("retmsg");
        } catch (JSONException unused) {
        }
        if (nowRspInfo.f31099a != 0 || (jSONObject2 = jSONObject.getJSONObject("result")) == null) {
            return nowRspInfo;
        }
        nowRspInfo.f31101c = jSONObject2.getString("more_txt");
        nowRspInfo.f31102d = jSONObject2.getString("more_url");
        JSONArray jSONArray = jSONObject2.getJSONArray("live_list");
        if (jSONArray != null) {
            nowRspInfo.e = new ArrayList();
            for (int i = 0; i < jSONArray.length(); i++) {
                JSONObject jSONObject3 = jSONArray.getJSONObject(i);
                if (jSONObject3 != null) {
                    NowLiveInfo nowLiveInfo = new NowLiveInfo();
                    nowLiveInfo.f31096b = jSONObject3.getString("nick_name");
                    nowLiveInfo.f31097c = jSONObject3.getString("icon_url");
                    nowLiveInfo.f31098d = jSONObject3.getString("cover_url");
                    nowLiveInfo.e = jSONObject3.getString("title");
                    nowLiveInfo.f = jSONObject3.getString("tag");
                    nowLiveInfo.g = jSONObject3.getString("jump_url");
                    nowLiveInfo.h = jSONObject3.getInt("distance");
                    nowLiveInfo.i = jSONObject3.getString("roomid");
                    nowLiveInfo.j = jSONObject3.getString("uid");
                    nowLiveInfo.k = jSONObject3.getInt("now_id");
                    nowLiveInfo.l = jSONObject3.getInt("online_num");
                    nowRspInfo.e.add(nowLiveInfo);
                }
            }
        }
        return nowRspInfo;
    }

    public QBTask<NowRspInfo> a(final String str) {
        return QBTask.a(new Callable<NowRspInfo>() {
            @Override
            public NowRspInfo call() throws Exception {
                InputStream inputStream;
                HttpURLConnection httpURLConnection;
                InputStream inputStream2;
                HttpURLConnection httpURLConnection2;
                BufferedReader bufferedReader;
                NowRspInfo nowRspInfo;
                HttpURLConnection httpURLConnection3;
                if (RecomLiveManager.f31090a) {
                    return RecomLiveManager.this.b("{\"retcode\":0,\"retmsg\":\"ok\",\"result\":{\"live_list\":[{\"nick_name\":\"思思🎤武汉❤️加油❤️\",\"icon_url\":\"https://pic.url.cn/hy_personal/5253d6b3ee9d5d00344ff93f69e5ea8c6f0cf31dcf4cf7f785e9b2830e2c3b35/\",\"cover_url\":\"https://nowpic.gtimg.com/hy_personal_room/1341229136/13412291361577451072/640\",\"title\":\"笑起来真好看\",\"tag\":\"美女\",\"jump_url\":\"https://now.qq.com/h5/index.html?roomid=1341229136&fromid=3111&client_type=16231&_bid=2336&_wv=16778245&_cf=1799\",\"distance\":0,\"roomid\":\"1341229136\",\"uid\":\"283820867\",\"now_id\":656020673,\"online_num\":67},{\"nick_name\":\"九尾白狐\",\"icon_url\":\"https://pic.url.cn/hy_personal/4376ae1e0cf0ccce5ce785f77be9469c5bdbdf2d41610dd64e99de76df1f9dee25b0044c8e6addf7c9633273a1f60d86/\",\"cover_url\":\"https://nowpic.gtimg.com/hy_personal_room/1218375629/12183756291576864541/640\",\"title\":\"这个主播看多会醉\",\"tag\":\"美女\",\"jump_url\":\"https://now.qq.com/h5/index.html?roomid=1218375629&fromid=3111&client_type=16231&_bid=2336&_wv=16778245&_cf=1799\",\"distance\":0,\"roomid\":\"1218375629\",\"uid\":\"1007209370\",\"now_id\":249744300,\"online_num\":334},{\"nick_name\":\"❀ YJ雅雅\",\"icon_url\":\"https://nowpic.gtimg.com/hy_personal/02ae7e9485dbf4128f875c1a5e333f40ba8976ae62db034c77a8e87e3c91bbd9/\",\"cover_url\":\"https://nowpic.gtimg.com/hy_personal_room/1211093746/12110937461568742710/640\",\"title\":\"来咯~\",\"tag\":\"美女\",\"jump_url\":\"https://now.qq.com/h5/index.html?roomid=1211093746&fromid=3111&client_type=16231&_bid=2336&_wv=16778245&_cf=1799\",\"distance\":0,\"roomid\":\"1211093746\",\"uid\":\"710995360\",\"now_id\":186929327,\"online_num\":288},{\"nick_name\":\"0度🎤人美歌甜❤️\",\"icon_url\":\"https://nowpic.gtimg.com/hy_personal/c56062adbf175c5ec5e4fc8c6bff2466eef5da8c9aeb945c1c7a34bdea2604c5/\",\"cover_url\":\"https://nowpic.gtimg.com/hy_personal_room/1300880963/13008809631571990925/640\",\"title\":\"你的女孩❤️\",\"tag\":\"美女\",\"jump_url\":\"https://now.qq.com/h5/index.html?roomid=1300880963&fromid=3111&client_type=16231&_bid=2336&_wv=16778245&_cf=1799\",\"distance\":0,\"roomid\":\"1300880963\",\"uid\":\"2114209086\",\"now_id\":580622517,\"online_num\":329}],\"more_txt\":\"更多热门直播\",\"more_url\":\"qb://home/feeds?tabId=110016&fromid=3111&refresh=1\"}}");
                }
                BufferedReader bufferedReader2 = null;
                try {
                    httpURLConnection2 = (HttpURLConnection) new QBUrl("https://ilive.html5.qq.com/api/lives/recomm?fromid=" + str + "&timestamp=" + System.currentTimeMillis()).a(false).e();
                    try {
                        httpURLConnection2.setRequestProperty("Cache-Control", "no-cache");
                        httpURLConnection2.setRequestProperty(HttpHeader.REQ.QGUID, GUIDManager.a().f());
                        httpURLConnection2.setRequestProperty(HttpHeader.REQ.QUA2, QUAUtils.a());
                        httpURLConnection2.setRequestProperty("x-forwarded-for", NetworkUtils.b(ContextHolder.getAppContext()));
                        httpURLConnection2.setRequestProperty("User-agent", UserAgentUtils.a(0));
                        httpURLConnection2.addRequestProperty("QAID", QADID.a());
                        httpURLConnection2.addRequestProperty("Origin", "https://ilive.html5.qq.com");
                        httpURLConnection2.addRequestProperty("Referer", "https://ilive.html5.qq.com");
                        httpURLConnection2.setDefaultUseCaches(false);
                        httpURLConnection2.setUseCaches(false);
                        httpURLConnection2.setConnectTimeout(5000);
                        httpURLConnection2.setReadTimeout(3000);
                        if (httpURLConnection2.getResponseCode() == 200) {
                            inputStream2 = httpURLConnection2.getInputStream();
                            try {
                                bufferedReader = new BufferedReader(new InputStreamReader(inputStream2));
                                try {
                                    StringBuffer stringBuffer = new StringBuffer();
                                    while (true) {
                                        String readLine = bufferedReader.readLine();
                                        if (readLine == null) {
                                            break;
                                        }
                                        stringBuffer.append(readLine);
                                    }
                                    nowRspInfo = RecomLiveManager.this.b(stringBuffer.toString());
                                    bufferedReader2 = bufferedReader;
                                } catch (Exception unused) {
                                    if (bufferedReader != null) {
                                        try {
                                            bufferedReader.close();
                                        } catch (IOException unused2) {
                                        }
                                    }
                                    if (inputStream2 != null) {
                                        try {
                                            inputStream2.close();
                                        } catch (IOException unused3) {
                                        }
                                    }
                                    if (httpURLConnection2 == null) {
                                        return null;
                                    }
                                    httpURLConnection2.disconnect();
                                    return null;
                                } catch (Throwable th) {
                                    httpURLConnection3 = httpURLConnection2;
                                    inputStream = inputStream2;
                                    th = th;
                                    bufferedReader2 = bufferedReader;
                                    httpURLConnection = httpURLConnection3;
                                    if (bufferedReader2 != null) {
                                        try {
                                            bufferedReader2.close();
                                        } catch (IOException unused4) {
                                        }
                                    }
                                    if (inputStream != null) {
                                        try {
                                            inputStream.close();
                                        } catch (IOException unused5) {
                                        }
                                    }
                                    if (httpURLConnection == null) {
                                        throw th;
                                    }
                                    httpURLConnection.disconnect();
                                    throw th;
                                }
                            } catch (Exception unused6) {
                                bufferedReader = null;
                            } catch (Throwable th2) {
                                httpURLConnection3 = httpURLConnection2;
                                inputStream = inputStream2;
                                th = th2;
                            }
                        } else {
                            inputStream2 = null;
                            nowRspInfo = null;
                        }
                        if (bufferedReader2 != null) {
                            try {
                                bufferedReader2.close();
                            } catch (IOException unused7) {
                            }
                        }
                        if (inputStream2 != null) {
                            try {
                                inputStream2.close();
                            } catch (IOException unused8) {
                            }
                        }
                        if (httpURLConnection2 != null) {
                            httpURLConnection2.disconnect();
                        }
                        return nowRspInfo;
                    } catch (Exception unused9) {
                        inputStream2 = null;
                        bufferedReader = null;
                    } catch (Throwable th3) {
                        th = th3;
                        httpURLConnection = httpURLConnection2;
                        inputStream = null;
                    }
                } catch (Exception unused10) {
                    inputStream2 = null;
                    httpURLConnection2 = null;
                    bufferedReader = null;
                } catch (Throwable th4) {
                    th = th4;
                    inputStream = null;
                    httpURLConnection = null;
                }
            }
        }, 0);
    }
}