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

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


package com.appodeal.ads.networks.a;

import android.app.Activity;
import android.location.Location;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.annotation.VisibleForTesting;
import com.appodeal.ads.Appodeal;
import com.appodeal.ads.UserSettings;
import com.appodeal.ads.az;
import com.appodeal.ads.bf;
import com.appodeal.ads.utils.t;
import com.ironsource.mediationsdk.IronSourceSegment;
import com.tapjoy.TJAdUnitConstants;
import com.tapjoy.TapjoyConstants;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Locale;
public class g implements Runnable {
    @VisibleForTesting
    String a;
    private final a b;
    private final int c;
    private final int d;
    private final Handler e;
    private final int f = 0;
    private final int g = 1;

    public interface a {
        void a(String str, int i, int i2);

        void d(int i, int i2);
    }

    public g(Activity activity, a aVar, int i, int i2, String str, String str2, int i3) {
        String str3;
        String str4;
        this.b = aVar;
        this.c = i;
        this.d = i2;
        String packageName = activity.getPackageName();
        Uri.Builder buildUpon = Uri.parse("https://api.pubnative.net/api/v3/native").buildUpon();
        buildUpon.appendQueryParameter("apptoken", str).appendQueryParameter("zoneid", str2).appendQueryParameter("bundleid", packageName).appendQueryParameter("os", TapjoyConstants.TJC_DEVICE_PLATFORM_TYPE).appendQueryParameter("osver", Build.VERSION.RELEASE).appendQueryParameter("srvi", "1").appendQueryParameter("af", "title,description,icon,banner,cta,rating").appendQueryParameter("al", "m").appendQueryParameter("mf", "contentinfo").appendQueryParameter("locale", Locale.getDefault().getLanguage()).appendQueryParameter("adcount", String.valueOf(i3)).appendQueryParameter("ua", System.getProperty("http.agent")).appendQueryParameter("coppa", com.appodeal.ads.h.h ? "1" : "0");
        if (!com.appodeal.ads.h.h) {
            buildUpon.appendQueryParameter("devicemodel", Build.MODEL);
        }
        if (az.g()) {
            str3 = "dnt";
            str4 = "1";
        } else {
            str3 = "dnt";
            str4 = "0";
        }
        buildUpon.appendQueryParameter(str3, str4);
        buildUpon.appendQueryParameter("gid", az.h());
        if (!com.appodeal.ads.h.h) {
            Location a2 = az.a(activity);
            UserSettings b = az.b(activity);
            if (a2 != null) {
                buildUpon.appendQueryParameter(TJAdUnitConstants.String.LAT, String.valueOf(a2.getLatitude()));
                buildUpon.appendQueryParameter(TJAdUnitConstants.String.LONG, String.valueOf(a2.getLongitude()));
            } else if (b != null) {
                if (b.g() != null) {
                    buildUpon.appendQueryParameter(TJAdUnitConstants.String.LAT, String.valueOf(b.g()));
                }
                if (b.h() != null) {
                    buildUpon.appendQueryParameter(TJAdUnitConstants.String.LONG, String.valueOf(b.h()));
                }
            }
            if (b != null) {
                UserSettings.Gender gender = b.getGender();
                if (gender != null) {
                    String str5 = null;
                    switch (gender.getValue()) {
                        case 1:
                            str5 = "f";
                            break;
                        case 2:
                            str5 = "m";
                            break;
                    }
                    if (str5 != null) {
                        buildUpon.appendQueryParameter("gender", str5);
                    }
                }
                Integer age = b.getAge();
                if (age != null) {
                    buildUpon.appendQueryParameter(IronSourceSegment.AGE, String.valueOf(age));
                }
                String b2 = b.b();
                if (b2 != null) {
                    buildUpon.appendQueryParameter("keywords", b2);
                }
                String c = b.c();
                if (c != null) {
                    buildUpon.appendQueryParameter("ip", c);
                }
            }
        }
        this.a = buildUpon.build().toString();
        this.e = new Handler(Looper.getMainLooper()) {
            @Override
            public void handleMessage(Message message) {
                if (g.this.b != null) {
                    switch (message.what) {
                        case 0:
                            break;
                        default:
                            return;
                        case 1:
                            String str6 = (String) message.obj;
                            if (str6 != null) {
                                g.this.b.a(str6, g.this.c, g.this.d);
                                return;
                            }
                            break;
                    }
                    g.this.b.d(g.this.c, g.this.d);
                }
            }
        };
    }

    public void a() {
        t.a.execute(this);
    }

    @Override
    public void run() {
        HttpURLConnection httpURLConnection;
        Exception e;
        String a2;
        HttpURLConnection httpURLConnection2 = null;
        try {
            try {
                httpURLConnection = (HttpURLConnection) new URL(this.a).openConnection();
                try {
                    httpURLConnection.setConnectTimeout(20000);
                    httpURLConnection.setReadTimeout(20000);
                    httpURLConnection.setRequestProperty("User-Agent", System.getProperty("http.agent"));
                    a2 = bf.a(httpURLConnection.getInputStream());
                } catch (Exception e2) {
                    e = e2;
                    Appodeal.a(e);
                    this.e.sendEmptyMessage(0);
                    if (httpURLConnection == null) {
                        return;
                    }
                    httpURLConnection.disconnect();
                }
            } catch (Throwable th) {
                th = th;
                if (0 != 0) {
                    httpURLConnection2.disconnect();
                }
                throw th;
            }
        } catch (Exception e3) {
            httpURLConnection = null;
            e = e3;
        } catch (Throwable th2) {
            th = th2;
            if (0 != 0) {
            }
            throw th;
        }
        if (a2 != null && !a2.isEmpty() && !a2.equals(" ")) {
            this.e.sendMessage(this.e.obtainMessage(1, a2));
            if (httpURLConnection == null) {
                return;
            }
            httpURLConnection.disconnect();
        }
        this.e.sendEmptyMessage(0);
        if (httpURLConnection == null) {
        }
        httpURLConnection.disconnect();
    }
}