导航菜单

页面标题

页面副标题

微商客 v2.1.2 - b.java 源代码

正在查看: 微商客 v2.1.2 应用的 b.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.qiyukf.nimlib.c;

import com.qiyukf.nimlib.c;
import com.qiyukf.nimlib.net.a.d.b;
import java.util.HashMap;
import org.json.JSONObject;

public final class b {
    private boolean a = true;
    private volatile boolean b = false;

    private static class a {
        private static final b a = new b();
    }

    public static b a() {
        return a.a;
    }

    public final void b() {
        if (c.h().disableReport || this.b) {
            return;
        }
        if (!this.a) {
            com.qiyukf.nimlib.log.b.B("don't need request strategy");
            return;
        }
        this.b = true;
        com.qiyukf.nimlib.log.b.B("request strategy");
        if (c.d() == null) {
            return;
        }
        com.qiyukf.nimlib.net.a.d.b.a().b();
        com.qiyukf.nimlib.net.a.d.b a2 = com.qiyukf.nimlib.net.a.d.b.a();
        String c = com.qiyukf.nimlib.push.b.c();
        HashMap hashMap = new HashMap(5);
        hashMap.put("deviceId", c);
        hashMap.put("sdktype", "IM");
        hashMap.put("sdkVer", "8.9.122");
        hashMap.put("platform", "AOS");
        hashMap.put("appkey", c.f());
        a2.a(com.qiyukf.nimlib.net.a.c.b.a("https://statistic.live.126.net/dispatcher/req", hashMap), new b.a() {
            @Override
            public final void onResponse(String str, int i, Throwable th) {
                b.this.a(str, i, th);
            }
        });
    }

    public void a(String str, int i, Throwable th) {
        this.b = false;
        if (i == 200 && str != null) {
            com.qiyukf.nimlib.log.b.B("request strategy success!,response = ".concat(String.valueOf(str)));
            try {
                JSONObject jSONObject = new JSONObject(str);
                int i2 = jSONObject.getInt("code");
                this.a = false;
                if (i2 == 200) {
                    JSONObject jSONObject2 = jSONObject.getJSONObject("data");
                    com.qiyukf.nimlib.c.b.c.b bVar = new com.qiyukf.nimlib.c.b.c.b();
                    bVar.a(jSONObject2.getString("endpoint"));
                    bVar.c(jSONObject2.getInt("maxDelay") * 1000);
                    bVar.a(jSONObject2.getInt("maxInterval") * 1000);
                    bVar.b(jSONObject2.getInt("minInterval") * 1000);
                    bVar.a(jSONObject2.getInt("maxSize"));
                    com.qiyukf.nimlib.c.a.a(bVar);
                    com.qiyukf.nimlib.c.a.b();
                    return;
                }
                com.qiyukf.nimlib.log.b.B("do not need report");
                com.qiyukf.nimlib.c.a.a((com.qiyukf.nimlib.c.b.c.b) null);
                com.qiyukf.nimlib.c.a.a();
                com.qiyukf.nimlib.c.a.c();
                return;
            } catch (Throwable th2) {
                th2.printStackTrace();
                return;
            }
        }
        this.a = true;
        com.qiyukf.nimlib.log.b.C("request strategy failed, code=" + i + ", e=" + (th != null ? th.getMessage() : null));
    }
}