Wolves Themes v1.0版本的 MD5 值为:cddc92b47f6b7c4a195c9625507eb51c

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


package com.appodeal.ads.d;

import android.content.Context;
import android.support.annotation.VisibleForTesting;
import com.appodeal.ads.Appodeal;
import com.appodeal.ads.utils.t;
import com.ironsource.mediationsdk.utils.ServerResponseWrapper;
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;
public class h implements Serializable {
    @VisibleForTesting
    JSONArray b;
    private JSONObject c;
    private JSONObject d;
    private String e;
    private JSONObject h;
    private String j;
    private boolean f = false;
    private boolean g = false;
    private List<c> i = new ArrayList();
    @VisibleForTesting
    JSONArray a = new JSONArray();

    private class a implements Runnable {
        private JSONObject b;

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

        @Override
        public void run() {
            HttpURLConnection httpURLConnection;
            try {
                httpURLConnection = (HttpURLConnection) h.this.h().openConnection();
                try {
                    try {
                        httpURLConnection.setConnectTimeout(20000);
                        httpURLConnection.setReadTimeout(20000);
                        httpURLConnection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
                        httpURLConnection.setDoOutput(true);
                        httpURLConnection.setRequestMethod("POST");
                        DataOutputStream dataOutputStream = new DataOutputStream(httpURLConnection.getOutputStream());
                        dataOutputStream.write(this.b.toString().getBytes(Charset.forName("UTF-8")));
                        dataOutputStream.flush();
                        dataOutputStream.close();
                        if (httpURLConnection.getResponseCode() == 200) {
                            Appodeal.a("Stats sent");
                        }
                    } catch (Exception e) {
                        e = e;
                        Appodeal.a(e);
                    }
                } catch (Throwable th) {
                    th = th;
                    if (httpURLConnection != null) {
                        httpURLConnection.disconnect();
                    }
                    this.b = null;
                    throw th;
                }
            } catch (Exception e2) {
                e = e2;
                httpURLConnection = null;
            } catch (Throwable th2) {
                th = th2;
                httpURLConnection = null;
                if (httpURLConnection != null) {
                }
                this.b = null;
                throw th;
            }
        }
    }

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

    public void a(Context context) {
        if (this.i.size() > 0) {
            t.a.execute(new a(b(context)));
        }
    }

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

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

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

    public void a(List<e> list) {
        this.b = new JSONArray();
        for (e eVar : list) {
            this.b.put(eVar.c());
        }
    }

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

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

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

    @VisibleForTesting
    JSONObject b(Context context) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("encryptedSessionInfo", this.j);
            jSONObject.put("timestamp", System.currentTimeMillis());
            jSONObject.put("package", context.getPackageName());
            jSONObject.put("request", this.h);
            JSONArray jSONArray = new JSONArray();
            for (c cVar : this.i) {
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("encryptedBidderInfo", cVar.f().c());
                jSONObject2.put("bidderName", cVar.f().d());
                jSONObject2.put(ServerResponseWrapper.RESPONSE_FIELD, cVar.e());
                jSONObject2.put("winner", cVar.g());
                jSONArray.put(jSONObject2);
            }
            jSONObject.put("responses", jSONArray);
            return jSONObject;
        } catch (JSONException e) {
            Appodeal.a(e);
            return jSONObject;
        }
    }

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

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

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

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

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

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

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

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

    @VisibleForTesting
    URL h() {
        return new URL("https://adwatch.appodeal.com/api/v1/rtb/submit");
    }
}