导航菜单

页面标题

页面副标题

漫天星 v3.0.2 - h.java 源代码

正在查看: 漫天星 v3.0.2 应用的 h.java JAVA 源代码文件

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


package com.ss.android.downloadlib.addownload.compliance;

import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.ss.android.downloadlib.addownload.jv;
import com.ss.android.y.y.cl.k;
import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONObject;

public class h {
    public final AtomicInteger y;

    public static class y {
        public static h y = new h();
    }

    public h() {
        this.y = new AtomicInteger(0);
    }

    public String cl() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.y.get() < 3 ? "https://apps.bytesfield.com" : "https://apps.bytesfield-b.com");
        sb.append("/customer/api/app/deep_link");
        return sb.toString();
    }

    public void cl(@NonNull final com.ss.android.downloadlib.addownload.cl.io ioVar, final String str, final byte[] bArr, final i iVar) {
        jv.p().y(str, bArr, "application/json; charset=utf-8", 0, new k() {
            @Override
            public void y(String str2) {
                h.this.y(ioVar, str2, iVar);
            }

            @Override
            public void y(Throwable th) {
                h.this.y(ioVar, str, bArr, iVar);
            }
        });
    }

    public static h y() {
        return y.y;
    }

    public void y(final com.ss.android.downloadlib.addownload.cl.io ioVar, final i iVar) {
        if (jv.p() == null) {
            com.ss.android.downloadlib.io.lu.y().y("getDownloadNetworkFactory == NULL");
            y(401, ioVar);
        } else {
            com.ss.android.downloadlib.io.y().y(new Runnable() {
                @Override
                public void run() {
                    h hVar = h.this;
                    hVar.cl(ioVar, hVar.cl(), h.this.y(ioVar, true, 4), iVar);
                }
            });
        }
    }

    public void y(com.ss.android.downloadlib.addownload.cl.io ioVar, String str, byte[] bArr, i iVar) {
        if (this.y.get() < 6) {
            this.y.incrementAndGet();
            cl(ioVar, str, bArr, iVar);
        } else {
            y("当前网络不佳,请稍后再试");
            this.y.set(0);
            y(402, ioVar);
        }
    }

    private void y(final String str) {
        com.ss.android.downloadlib.i.y().cl().post(new Runnable() {
            @Override
            public void run() {
                jv.lu().y(6, jv.getContext(), null, str, null, 0);
            }
        });
    }

    public byte[] y(com.ss.android.downloadlib.addownload.cl.io ioVar, boolean z, int i) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("download_url", ioVar.y());
            jSONObject.put("package_name", ioVar.io());
            jSONObject.put("call_scene", 50);
            if (z) {
                jSONObject.put("sender_package_name", jv.getContext().getPackageName());
                jSONObject.put("sender_version", jv.q().f171io);
                if (i > 0) {
                    jSONObject.put("store", i);
                }
            } else {
                jSONObject.put("id", String.valueOf(ioVar.cl()));
                if (ioVar.k().n() != null) {
                    if (TextUtils.isEmpty(ioVar.k().n().y())) {
                        com.ss.android.downloadlib.io.lu.y().y("web_url is null");
                    }
                    jSONObject.put("web_url", ioVar.k().n().y());
                } else {
                    com.ss.android.downloadlib.io.lu.y().y("deeplink is null");
                }
            }
        } catch (Exception unused) {
            com.ss.android.downloadlib.io.lu.y().y("param build error");
        }
        return jSONObject.toString().getBytes();
    }

    public void y(@NonNull com.ss.android.downloadlib.addownload.cl.io ioVar, String str, i iVar) {
        try {
            if (TextUtils.isEmpty(str)) {
                com.ss.android.downloadlib.io.lu.y().y("response content is null");
                y(404, ioVar);
                iVar.y();
                return;
            }
            this.y.set(0);
            io st = io.st(str);
            if (st.y() != 0) {
                y(403, ioVar);
                iVar.y();
            } else if (TextUtils.isEmpty(st.cl())) {
                y(405, ioVar);
                iVar.y();
            } else {
                iVar.y(st.cl());
            }
        } catch (Exception e) {
            com.ss.android.downloadlib.io.lu.y().y(e, "DownloadMiuiMarketHelper parseResponse");
        }
    }

    public void y(int i, com.ss.android.downloadlib.addownload.cl.io ioVar) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.putOpt("download_miui_market_fail_code", Integer.valueOf(i));
        } catch (Exception e) {
            com.bytedance.sdk.component.utils.jv.y(e);
        }
        com.ss.android.downloadlib.p.y.y().y("get_miui_market_compliance_error", jSONObject, ioVar);
    }

    public void y(int i, com.ss.android.downloadlib.addownload.cl.io ioVar, JSONObject jSONObject) {
        try {
            jSONObject.putOpt("download_miui_market_success_result", Integer.valueOf(i));
        } catch (Exception e) {
            com.bytedance.sdk.component.utils.jv.y(e);
        }
        com.ss.android.downloadlib.p.y.y().y("get_miui_market_compliance_success", jSONObject, ioVar);
    }
}