导航菜单

页面标题

页面副标题

BodyTech v7.6.4 - c.java 源代码

正在查看: BodyTech v7.6.4 应用的 c.java JAVA 源代码文件

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


package ff;

import android.text.TextUtils;
import androidx.collection.ArrayMap;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.HttpHeaderParser;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public abstract class c<T> extends Request<T> {
    private Map<String, String> c;
    protected boolean d;
    private final List<Response.Listener<T>> e;
    private final List<Response.ErrorListener> k;
    private final Set<WeakReference<Request>> n;

    public c(int i, String str, Response.ErrorListener errorListener) {
        super(i, str, errorListener);
        this.n = new HashSet();
        this.e = new ArrayList();
        this.k = new ArrayList();
        d(errorListener);
    }

    public void a(Request request) {
        if (isCanceled()) {
            request.cancel();
        } else {
            this.n.add(new WeakReference<>(request));
        }
    }

    public void c(Map<String, String> map) {
        this.c = map;
    }

    public void cancel() {
        StringBuilder sb2 = new StringBuilder();
        sb2.append("CANCELLED REQUEST=");
        sb2.append(getUrl());
        sb2.append("::HEADERS=");
        Map<String, String> map = this.c;
        sb2.append(map != null ? map.toString() : "");
        jf.a.a("MBDataService", sb2.toString());
        super.cancel();
        Iterator<WeakReference<Request>> it = this.n.iterator();
        while (it.hasNext()) {
            Request request = it.next().get();
            if (request != null) {
                request.cancel();
            }
        }
        this.n.clear();
    }

    public void d(Response.ErrorListener errorListener) {
        if (errorListener == null) {
            return;
        }
        synchronized (this.k) {
            this.k.add(errorListener);
        }
    }

    public void deliverError(VolleyError volleyError) {
        onErrorResponse(volleyError);
    }

    protected void deliverResponse(T t) {
        ArrayList arrayList;
        synchronized (this.e) {
            arrayList = new ArrayList(this.e);
        }
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            ((Response.Listener) it.next()).onResponse(t);
        }
    }

    public void e(Response.Listener<T> listener) {
        if (listener == null) {
            return;
        }
        synchronized (this.e) {
            this.e.add(listener);
        }
    }

    public void f(String str, String str2) {
        if (this.c == null) {
            this.c = new ArrayMap();
        }
        this.c.put(str, str2);
    }

    @Deprecated
    public Response.ErrorListener getErrorListener() {
        List<Response.ErrorListener> list = this.k;
        if (list == null || list.isEmpty()) {
            return null;
        }
        return this.k.get(0);
    }

    public Map<String, String> getHeaders() throws AuthFailureError {
        return this.c;
    }

    public void onErrorResponse(VolleyError volleyError) {
        ArrayList<Response.ErrorListener> arrayList;
        synchronized (this.k) {
            arrayList = new ArrayList(this.k);
        }
        for (Response.ErrorListener errorListener : arrayList) {
            if (errorListener != null) {
                errorListener.onErrorResponse(volleyError);
            }
        }
    }

    protected VolleyError parseNetworkError(VolleyError volleyError) {
        String message;
        this.d = true;
        NetworkResponse networkResponse = volleyError.networkResponse;
        if (networkResponse != null) {
            try {
                jf.a.a("MBDataService", "ERR_RESPONSE::STATUS=" + networkResponse.statusCode + "::FROM=" + getUrl() + " ::CONTENT=" + new String(networkResponse.data, HttpHeaderParser.parseCharset(networkResponse.headers)) + "::ERROR=" + volleyError.getMessage());
            } catch (UnsupportedEncodingException e) {
                byte[] bArr = networkResponse.data;
                if (bArr == null || bArr.length <= 0) {
                    if (e.getCause() != null) {
                        message = e.getCause().toString() + ":" + e.getMessage();
                    } else {
                        message = e.getMessage();
                    }
                    jf.a.a("MBDataService", "ERR_RESPONSE::STATUS=" + networkResponse.statusCode + "::FROM=" + getUrl() + " ::CONTENT=null::ERROR=" + message);
                } else {
                    jf.a.a("MBDataService", "ERR_RESPONSE::STATUS=" + networkResponse.statusCode + "::FROM=" + getUrl() + " ::CONTENT=" + new String(networkResponse.data) + "::ERROR=" + e.getMessage());
                }
            }
        } else {
            jf.a.a("MBDataService", "ERR_RESPONSE:: null response for " + getUrl() + "::ERROR=" + volleyError.toString() + "::" + volleyError.getMessage());
        }
        return super.parseNetworkError(volleyError);
    }

    public Request<?> setRequestQueue(RequestQueue requestQueue) {
        StringBuilder sb2 = new StringBuilder();
        sb2.append("REQUEST=");
        sb2.append(getMethod());
        sb2.append("::");
        sb2.append(getUrl());
        sb2.append("::HEADERS=");
        Map<String, String> map = this.c;
        sb2.append(map != null ? map.toString() : "");
        jf.a.a("MBDataService", sb2.toString());
        try {
            String str = new String(getBody());
            if (!TextUtils.isEmpty(str)) {
                jf.a.a("MBDataService", "BODY=" + str.replace("\n", "").replace("\r", ""));
            }
        } catch (Exception unused) {
        }
        return super.setRequestQueue(requestQueue);
    }
}