Life Simulator: Game Dev v0.6版本的 MD5 值为:ecca8c682c00d3b861fbed7f58e41c8d

以下内容为反编译后的 h.java 源代码,内容仅作参考


package com.appodeal.ads.d;

import android.content.Context;
import android.os.AsyncTask;
import com.amazon.device.ads.WebRequest;
import com.appodeal.ads.Appodeal;
import java.io.DataOutputStream;
import java.io.Serializable;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.nexage.sourcekit.vast.model.VASTModel;

public class h implements Serializable {
    private JSONObject a;
    private JSONObject c;
    private String d;
    private String e;
    private String f;
    private JSONObject i;
    private String k;
    private boolean g = false;
    private boolean h = false;
    private List<c> j = new ArrayList();
    private JSONArray b = new JSONArray();

    private class a extends AsyncTask<JSONObject, Void, Void> {
        private a() {
        }

        @Override
        public Void doInBackground(JSONObject... jSONObjectArr) {
            HttpURLConnection httpURLConnection;
            HttpURLConnection httpURLConnection2;
            HttpURLConnection httpURLConnection3 = null;
            try {
                JSONObject jSONObject = jSONObjectArr[0];
                httpURLConnection2 = (HttpURLConnection) new URL("http://adwatch.appodeal.com/api/v1/rtb/submit").openConnection();
                try {
                    httpURLConnection2.setConnectTimeout(20000);
                    httpURLConnection2.setReadTimeout(20000);
                    httpURLConnection2.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
                    httpURLConnection2.setDoOutput(true);
                    httpURLConnection2.setRequestMethod("POST");
                    DataOutputStream dataOutputStream = new DataOutputStream(httpURLConnection2.getOutputStream());
                    dataOutputStream.write(jSONObject.toString().getBytes(Charset.forName(WebRequest.CHARSET_UTF_8)));
                    dataOutputStream.flush();
                    dataOutputStream.close();
                } catch (Exception e) {
                    httpURLConnection = httpURLConnection2;
                    e = e;
                    try {
                        Appodeal.a(e);
                        if (httpURLConnection != null) {
                            httpURLConnection.disconnect();
                        }
                        return null;
                    } catch (Throwable th) {
                        th = th;
                        httpURLConnection3 = httpURLConnection;
                        if (httpURLConnection3 != null) {
                            httpURLConnection3.disconnect();
                        }
                        throw th;
                    }
                } catch (Throwable th2) {
                    httpURLConnection3 = httpURLConnection2;
                    th = th2;
                    if (httpURLConnection3 != null) {
                    }
                    throw th;
                }
            } catch (Exception e2) {
                e = e2;
                httpURLConnection = null;
            } catch (Throwable th3) {
                th = th3;
            }
            switch (httpURLConnection2.getResponseCode()) {
                case VASTModel.ERROR_CODE_BAD_MODEL:
                    Appodeal.a("Stats send");
                default:
                    if (httpURLConnection2 != null) {
                        httpURLConnection2.disconnect();
                    }
                    return null;
            }
        }
    }

    public JSONObject a() {
        try {
            if (this.b.length() > 0) {
                this.a.put("answered_bidders", this.b);
            }
            this.a.put("auction_inited", this.h);
        } catch (JSONException e) {
        }
        return this.a;
    }

    public void a(Context context) {
        try {
            if (this.j.size() > 0) {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("encryptedSessionInfo", this.k);
                jSONObject.put("timestamp", System.currentTimeMillis());
                jSONObject.put("package", context.getPackageName());
                jSONObject.put("request", this.i);
                JSONArray jSONArray = new JSONArray();
                for (c cVar : this.j) {
                    JSONObject jSONObject2 = new JSONObject();
                    jSONObject2.put("encryptedBidderInfo", cVar.f().c());
                    jSONObject2.put("bidderName", cVar.f().d());
                    jSONObject2.put("response", cVar.e());
                    jSONObject2.put("winner", cVar.g());
                    jSONArray.put(jSONObject2);
                }
                jSONObject.put("responses", jSONArray);
                new a().execute(jSONObject);
            }
        } catch (JSONException e) {
            Appodeal.a(e);
        }
    }

    public void a(com.appodeal.ads.d.a aVar) {
        if (aVar == null || aVar.i() == null) {
            return;
        }
        this.b.put(aVar.i().c());
    }

    public void a(c cVar) {
        this.j.add(cVar);
    }

    public void a(String str) {
        this.d = str;
    }

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

    public void a(boolean z) {
        this.g = z;
    }

    public JSONObject b() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("rtb_check", this.c);
            jSONObject.put("rtb_answered_bidders", this.b);
            jSONObject.put("rtb_stat_requests", this.a);
            jSONObject.put("bidder_name", this.e);
            jSONObject.put("bidder_id", this.f);
            jSONObject.put("waterfall_id", this.d);
        } catch (JSONException e) {
        }
        return jSONObject;
    }

    public void b(String str) {
        this.f = str;
    }

    public void b(JSONObject jSONObject) {
        this.a = jSONObject;
    }

    public JSONObject c() {
        JSONObject jSONObject = this.c == null ? new JSONObject() : this.c;
        if (jSONObject.has("adm")) {
            jSONObject.remove("adm");
        }
        if (jSONObject.has("mfr_id")) {
            jSONObject.remove("mfr_id");
        }
        if (jSONObject.has("bidder_id")) {
            jSONObject.remove("bidder_id");
        }
        return jSONObject;
    }

    public void c(String str) {
        this.e = str;
    }

    public void c(JSONObject jSONObject) {
        try {
            this.i = new JSONObject(jSONObject.toString());
        } catch (JSONException e) {
            Appodeal.a(e);
        }
    }

    public void d(String str) {
        this.k = str;
    }

    public boolean d() {
        return this.c != null && this.c.has("bidder_id") && this.c.has("id") && this.c.has("price");
    }

    public String e() {
        return this.f;
    }

    public boolean f() {
        return this.g;
    }

    public void g() {
        this.h = true;
    }

    public boolean h() {
        return this.i != null;
    }
}