APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:For S9
版本号:4.5
包名称:com.jb.gokeyboard.theme.emojiztfors9.getjar

MD5 校验值:27cf44ec6e0720408f5ef017a90a3331

反编译源代码说明

c.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.jb.gokeyboard.theme.template.gostore.data;

import android.content.Context;
import android.text.TextUtils;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
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 com.jb.gokeyboard.theme.template.gostore.data.e;
import com.jb.gokeyboard.theme.template.util.MD5;
import com.jiubang.commerce.ad.http.bean.BaseModuleDataItemBean;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Random;
import java.util.Set;

public class c {
    private static String i;
    private final RequestQueue a;
    private Context d;
    private final HashMap<String, a> e = new HashMap<>();
    private final Set<a> f = new HashSet();
    private final LinkedList<a> g = new LinkedList<>();
    private final String[] h = {"http://69.28.57.171:8888", "http://69.28.57.172:8888", "http://69.28.57.173:8888", "http://69.28.57.174:8888"};
    private final Request.UrlRewriteListener j = new Request.UrlRewriteListener() {
        @Override
        public String rewriteUrl(String str) {
            if (str != null && str.contains("https://gokeyboardmarket.goforandroid.com")) {
                String str2 = c.i;
                if (TextUtils.isEmpty(str2)) {
                    str2 = c.this.h[new Random().nextInt(c.this.h.length)];
                }
                return str.replace("https://gokeyboardmarket.goforandroid.com", str2);
            }
            return str;
        }
    };
    private final h<com.jb.gokeyboard.theme.template.gostore.databean.e> b = new com.jb.gokeyboard.theme.template.gostore.data.a(new com.jb.gokeyboard.theme.template.gostore.data.b());
    private i<Map<String, com.jb.gokeyboard.theme.template.gostore.databean.e>> c = new d();

    public class b {
        public final j a;

        public b(j jVar) {
            this.a = jVar;
        }
    }

    public c(Context context, RequestQueue requestQueue) {
        this.d = context;
        this.a = requestQueue;
    }

    public void a(int i2, int i3, int i4, j<com.jb.gokeyboard.theme.template.gostore.databean.g> jVar, int i5) {
        String a2 = com.jb.gokeyboard.theme.template.gostore.c.a.a(i2, i3, i4);
        b bVar = new b(jVar);
        a aVar = this.e.get(a2);
        if (aVar != null) {
            aVar.a(bVar);
            return;
        }
        String a3 = l.a(i5);
        com.jb.gokeyboard.theme.template.gostore.c.b bVar2 = new com.jb.gokeyboard.theme.template.gostore.c.b(i2, i3, i4);
        if (!TextUtils.isEmpty(i) && a3.contains("https://gokeyboardmarket.goforandroid.com")) {
            a3 = a3.replace("https://gokeyboardmarket.goforandroid.com", i);
        }
        Request<?> a4 = a(a3, 2, a2, new C0147c(a2, bVar2));
        a4.setUrlRewriteListener(this.j);
        a4.setTag(a2);
        a(new a(a4, bVar));
    }

    private Request<?> a(String str, int i2, final String str2, e.a aVar) {
        e eVar = new e(str, i2, aVar, new Response.Listener<Object>() {
            @Override
            public void onResponse(Object obj) {
                c.this.a(str2, obj);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                c.this.a(str2, volleyError);
            }
        });
        eVar.setShouldCache(false);
        return eVar;
    }

    private class C0147c implements e.a<com.jb.gokeyboard.theme.template.gostore.databean.g> {
        private String b;
        private com.jb.gokeyboard.theme.template.gostore.c.b c;

        C0147c(String str, com.jb.gokeyboard.theme.template.gostore.c.b bVar) {
            this.b = str;
            this.c = bVar;
        }

        @Override
        public Response<com.jb.gokeyboard.theme.template.gostore.databean.g> a(NetworkResponse networkResponse) {
            byte[] bArr = networkResponse.data;
            com.jb.gokeyboard.theme.template.util.j.a("DataLoader", "ClassifyDataNetworkResponseParser cacheKey=" + this.b + " : onResponse success :" + (bArr != null));
            com.jb.gokeyboard.theme.template.gostore.databean.g gVar = null;
            if (bArr != null) {
                try {
                    Map map = (Map) c.this.c.b(bArr, true, this.c.a(), this.c.b(), this.c.c());
                    if (map == null || map.get(this.b) == null) {
                        c.this.b.a(this.b, true);
                        throw new ParseError("该请求无内容,mCacheKey=" + this.b + ",resultObject = " + map);
                    }
                    for (Map.Entry entry : map.entrySet()) {
                        if (((com.jb.gokeyboard.theme.template.gostore.databean.e) entry.getValue()) != null) {
                            c.this.b.a((String) entry.getKey(), (String) entry.getValue());
                        }
                    }
                    gVar = c.this.b.b(this.b);
                } catch (ParseError e) {
                    e.printStackTrace();
                    return Response.error(e);
                }
            }
            return Response.success(gVar, HttpHeaderParser.parseCacheHeaders(networkResponse));
        }

        @Override
        public Map<String, String> a() {
            HashMap hashMap = new HashMap();
            hashMap.put("handle", BaseModuleDataItemBean.AD_DATA_SOURCE_TYPE_OFFLINE);
            String a = com.jb.gokeyboard.theme.template.gostore.c.a.a(this.c);
            hashMap.put("data", a);
            hashMap.put("pkey", "gokeyboard_market_plugin");
            hashMap.put("sign", MD5.MD5generator("gokeyboard_market_plugin_sign" + a + "gokeyboard_market_plugin_sign"));
            hashMap.put("shandle", "1");
            com.jb.gokeyboard.theme.template.util.j.a("DataLoader", a);
            return hashMap;
        }
    }

    public void a(String str, Object obj) {
        a remove = this.e.remove(str);
        com.jb.gokeyboard.theme.template.util.j.a("DataLoader", "mInFlightRequests.remove=" + remove + ",cacheKey=" + str);
        if (remove != null) {
            a(remove.b());
            this.g.remove(remove);
            Iterator it = remove.c.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                com.jb.gokeyboard.theme.template.util.j.a("DataLoader", "onDataListner" + bVar);
                if (bVar.a != null) {
                    bVar.a.a(obj);
                }
            }
        }
    }

    private void a(Request<?> request) {
        int indexOf;
        if (TextUtils.isEmpty(i) && request != null && request.getUrlRewriteListener() != null) {
            String url = request.getUrl();
            if (!TextUtils.isEmpty(url) && !url.contains("https://gokeyboardmarket.goforandroid.com") && (indexOf = url.indexOf("/gokeyboard_market/common?funid=6&rd=")) >= 0) {
                i = url.substring(0, indexOf);
            }
        }
    }

    public void a(String str, VolleyError volleyError) {
        this.b.a(str, false);
        com.jb.gokeyboard.theme.template.util.j.a("DataLoader", "cacheKey=" + str + " : onErrorResponse " + volleyError.getMessage(), volleyError);
        a remove = this.e.remove(str);
        if (remove != null) {
            this.g.remove(remove);
            Iterator it = remove.c.iterator();
            while (it.hasNext()) {
                b bVar = (b) it.next();
                if (bVar.a != null) {
                    bVar.a.onErrorResponse(volleyError);
                }
            }
        }
    }

    public void a(a aVar) {
        com.jb.gokeyboard.theme.template.util.j.a("DataLoader", "addDownQueue:" + aVar);
        this.a.add(aVar.b);
        this.e.put(aVar.a(), aVar);
        this.g.add(aVar);
    }

    public void a(Object obj) {
        com.jb.gokeyboard.theme.template.util.j.a("DataLoader", "tag=" + obj);
        Iterator<a> it = this.f.iterator();
        while (it.hasNext()) {
            a next = it.next();
            if (next.a(obj)) {
                com.jb.gokeyboard.theme.template.util.j.b("DataLoader", "取消数据加载任务:" + next.a());
                it.remove();
            }
        }
        Iterator<a> it2 = this.g.iterator();
        while (it.hasNext()) {
            a next2 = it2.next();
            if (next2.a(obj)) {
                com.jb.gokeyboard.theme.template.util.j.b("DataLoader", "取消数据加载任务:" + next2.a());
                it.remove();
                this.e.remove(next2.a());
            }
        }
        Iterator<a> it3 = this.e.values().iterator();
        while (it3.hasNext()) {
            a next3 = it3.next();
            if (next3.a(obj)) {
                com.jb.gokeyboard.theme.template.util.j.b("DataLoader", "取消数据加载任务:" + next3.a());
                it3.remove();
            }
        }
    }

    public class a {
        private final Request<?> b;
        private final LinkedList<b> c = new LinkedList<>();

        public a(Request<?> request, b bVar) {
            this.b = request;
            this.c.add(bVar);
        }

        public String a() {
            return this.b.getTag().toString();
        }

        public boolean a(Object obj) {
            if (!obj.equals(this.b.getTag())) {
                return false;
            }
            this.b.cancel();
            this.c.clear();
            return true;
        }

        public void a(b bVar) {
            if (!b(bVar)) {
                this.c.add(bVar);
            }
        }

        private boolean b(b bVar) {
            Iterator<b> it = this.c.iterator();
            while (it.hasNext()) {
                if (it.next().a == bVar.a) {
                    return true;
                }
            }
            return false;
        }

        public Request<?> b() {
            return this.b;
        }
    }

    public com.jb.gokeyboard.theme.template.gostore.databean.g a(String str) {
        return this.b.b(str);
    }

    public boolean b(String str) {
        return this.b.c(str);
    }
}