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

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

MD5 校验值:27cf44ec6e0720408f5ef017a90a3331

反编译源代码说明

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


package com.jb.gokeyboard.theme.template.httpwecloud.controller;

import android.support.v4.app.NotificationCompat;
import com.facebook.ads.AudienceNetworkActivity;
import com.jb.gokeyboard.theme.template.d.a.c;
import com.jb.gokeyboard.theme.template.httpwecloud.bean.message.NotifyMessageBean;
import com.jb.gokeyboard.theme.template.util.j;
import com.jb.gokeyboard.theme.template.util.o;
import com.jiubang.commerce.ad.http.AdSdkRequestDataUtils;
import com.jiubang.commerce.mopub.database.DiluteUserTable;
import com.mopub.mobileads.VastExtensionXmlManager;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Random;
import org.apache.http.client.methods.HttpPost;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class b {
    private com.jb.gokeyboard.theme.template.httpwecloud.bean.a.b b;
    private a c;
    private String a = "http://msg.wecloud.io/gopush-msg/common?funid=1&appkey=8KHFOA9XLVSA7FK6A1MESQMH&rd=";
    private final int d = 999999999;
    private final int e = 200;
    private final int f = 10000;

    public interface a {
        void a(com.jb.gokeyboard.theme.template.httpwecloud.bean.b.a aVar);
    }

    public b(com.jb.gokeyboard.theme.template.httpwecloud.bean.a.b bVar) {
        this.b = bVar;
        this.a += new Random().nextInt(999999999);
    }

    public void a() {
        c.b(new Runnable() {
            @Override
            public void run() {
                HttpURLConnection httpURLConnection;
                HttpURLConnection httpURLConnection2;
                HttpURLConnection httpURLConnection3;
                HttpURLConnection httpURLConnection4;
                HttpURLConnection httpURLConnection5;
                JSONObject jSONObject = null;
                try {
                    try {
                        httpURLConnection5 = (HttpURLConnection) new URL(b.this.a).openConnection();
                    } catch (Throwable th) {
                        th = th;
                    }
                } catch (MalformedURLException e) {
                    e = e;
                    httpURLConnection4 = null;
                } catch (ProtocolException e2) {
                    e = e2;
                    httpURLConnection3 = null;
                } catch (IOException e3) {
                    e = e3;
                    httpURLConnection2 = null;
                } catch (Throwable th2) {
                    th = th2;
                    httpURLConnection = null;
                }
                try {
                    httpURLConnection5.addRequestProperty("charset", AudienceNetworkActivity.WEBVIEW_ENCODING);
                    httpURLConnection5.setRequestMethod(HttpPost.METHOD_NAME);
                    httpURLConnection5.setDoOutput(true);
                    httpURLConnection5.setDoInput(true);
                    httpURLConnection5.setConnectTimeout(10000);
                    httpURLConnection5.setReadTimeout(10000);
                    String c = b.this.b.c();
                    j.a("HttpWecloudRequest", "postJsonString=" + c);
                    httpURLConnection5.getOutputStream().write(c.getBytes());
                    j.a("HttpWecloudRequest", "ResponseCode=" + httpURLConnection5.getResponseCode());
                    if (httpURLConnection5.getResponseCode() == 200) {
                        jSONObject = b.this.a(httpURLConnection5.getInputStream());
                    }
                    if (httpURLConnection5 != null) {
                        httpURLConnection5.disconnect();
                    }
                    if (b.this.c != null) {
                        b.this.c.a(b.this.a(jSONObject));
                    }
                } catch (MalformedURLException e4) {
                    httpURLConnection4 = httpURLConnection5;
                    e = e4;
                    e.printStackTrace();
                    if (httpURLConnection4 != null) {
                        httpURLConnection4.disconnect();
                    }
                    httpURLConnection = httpURLConnection4;
                    if (b.this.c != null) {
                        a aVar = b.this.c;
                        com.jb.gokeyboard.theme.template.httpwecloud.bean.b.a a2 = b.this.a((JSONObject) null);
                        aVar.a(a2);
                        httpURLConnection = a2;
                    }
                } catch (ProtocolException e5) {
                    httpURLConnection3 = httpURLConnection5;
                    e = e5;
                    e.printStackTrace();
                    if (httpURLConnection3 != null) {
                        httpURLConnection3.disconnect();
                    }
                    httpURLConnection = httpURLConnection3;
                    if (b.this.c != null) {
                        a aVar2 = b.this.c;
                        com.jb.gokeyboard.theme.template.httpwecloud.bean.b.a a3 = b.this.a((JSONObject) null);
                        aVar2.a(a3);
                        httpURLConnection = a3;
                    }
                } catch (IOException e6) {
                    httpURLConnection2 = httpURLConnection5;
                    e = e6;
                    e.printStackTrace();
                    if (httpURLConnection2 != null) {
                        httpURLConnection2.disconnect();
                    }
                    httpURLConnection = httpURLConnection2;
                    if (b.this.c != null) {
                        a aVar3 = b.this.c;
                        com.jb.gokeyboard.theme.template.httpwecloud.bean.b.a a4 = b.this.a((JSONObject) null);
                        aVar3.a(a4);
                        httpURLConnection = a4;
                    }
                } catch (Throwable th3) {
                    httpURLConnection = httpURLConnection5;
                    th = th3;
                    if (httpURLConnection != null) {
                        httpURLConnection.disconnect();
                    }
                    if (b.this.c != null) {
                        b.this.c.a(b.this.a((JSONObject) null));
                    }
                    throw th;
                }
            }
        });
    }

    public JSONObject a(InputStream inputStream) {
        String str;
        String str2;
        try {
            if (this.b.a().intValue() == 1) {
                str2 = o.a(o.a(inputStream));
            } else {
                str2 = new String(o.a(inputStream));
            }
            str = str2;
        } catch (Exception e) {
            j.a("HttpWecloudRequest", "InputStream到String的转换异常!");
            str = null;
        }
        if (str == null) {
            return null;
        }
        j.a("HttpWecloudRequest", "jsonString=" + str);
        try {
            return new JSONObject(str);
        } catch (JSONException e2) {
            return null;
        }
    }

    public com.jb.gokeyboard.theme.template.httpwecloud.bean.b.a a(JSONObject jSONObject) {
        JSONObject jSONObject2;
        if (jSONObject == null) {
            return null;
        }
        j.b("HttpWecloudRequest", "parseJsonToResponseBean->jsonObect=" + jSONObject.toString());
        com.jb.gokeyboard.theme.template.httpwecloud.bean.b.a aVar = new com.jb.gokeyboard.theme.template.httpwecloud.bean.b.a();
        JSONObject optJSONObject = jSONObject.optJSONObject("result");
        int optInt = optJSONObject.optInt("status");
        if (optInt == 1) {
            JSONArray optJSONArray = jSONObject.optJSONArray(AdSdkRequestDataUtils.RESPONSE_JOSN_TAG_DATAS);
            com.jb.gokeyboard.theme.template.httpwecloud.bean.b.b bVar = new com.jb.gokeyboard.theme.template.httpwecloud.bean.b.b();
            bVar.a(Integer.valueOf(optInt));
            aVar.a(bVar);
            ArrayList arrayList = new ArrayList();
            int i = 0;
            while (true) {
                int i2 = i;
                if (i2 < optJSONArray.length()) {
                    String a2 = a(((JSONObject) optJSONArray.opt(i2)).optString("message_content"));
                    j.c("HttpWecloudRequest", "jsonStringObject=" + a2);
                    try {
                        jSONObject2 = new JSONObject(a2);
                    } catch (JSONException e) {
                        jSONObject2 = null;
                    }
                    if (jSONObject2 != null) {
                        String optString = jSONObject2.optString("d_type");
                        if ("1".equals(optString)) {
                            NotifyMessageBean notifyMessageBean = new NotifyMessageBean();
                            notifyMessageBean.setMessageId(Long.valueOf(jSONObject2.optLong("message_id")));
                            notifyMessageBean.setDisplayType(optString);
                            notifyMessageBean.setType(jSONObject2.optString(VastExtensionXmlManager.TYPE));
                            notifyMessageBean.setTitle(jSONObject2.optString("title"));
                            notifyMessageBean.setContent(jSONObject2.optString("content"));
                            notifyMessageBean.setPosition(jSONObject2.optString(DiluteUserTable.CONFIG_POSITON_ID));
                            notifyMessageBean.setImageType(jSONObject2.optString("image_type"));
                            notifyMessageBean.setImageUrl(jSONObject2.optString("image_url"));
                            notifyMessageBean.setActionType(jSONObject2.optString("action_type"));
                            notifyMessageBean.setActionParam(jSONObject2.optString("action_param"));
                            notifyMessageBean.setWarmType(jSONObject2.optString("warm_type"));
                            notifyMessageBean.setAbTest(jSONObject2.optString("abtest"));
                            notifyMessageBean.setBlackList(jSONObject2.optString("black_list"));
                            notifyMessageBean.setWhiteList(jSONObject2.optString("white_list"));
                            notifyMessageBean.setVersionCode(jSONObject2.optString("version_code"));
                            notifyMessageBean.setChannel(jSONObject2.optString("channel"));
                            notifyMessageBean.setEffectiveFrom(jSONObject2.optString("effective_from"));
                            notifyMessageBean.setEffectiveTo(jSONObject2.optString("effective_to"));
                            arrayList.add(notifyMessageBean);
                        }
                    }
                    i = i2 + 1;
                } else {
                    aVar.a(arrayList);
                    return aVar;
                }
            }
        } else {
            int optInt2 = optJSONObject.optInt("errorcode");
            String optString2 = optJSONObject.optString(NotificationCompat.CATEGORY_MESSAGE);
            com.jb.gokeyboard.theme.template.httpwecloud.bean.b.b bVar2 = new com.jb.gokeyboard.theme.template.httpwecloud.bean.b.b();
            bVar2.a(Integer.valueOf(optInt));
            bVar2.b(Integer.valueOf(optInt2));
            bVar2.a(optString2);
            aVar.a(bVar2);
            return aVar;
        }
    }

    private String a(String str) {
        if (str == null) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            char charAt = str.charAt(i);
            if (charAt != '\\') {
                sb.append(charAt);
            }
        }
        return sb.toString();
    }

    public void a(a aVar) {
        this.c = aVar;
    }
}