Weather Tracker v1.0.0版本的 MD5 值为:3edef27647e42a8ea0e7c0d2dbf56f97

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


package com.chartboost.sdk.impl;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import com.chartboost.sdk.impl.f2;
import com.chartboost.sdk.internal.Model.CBError;
import com.tradplus.ads.common.FSConstants;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.concurrent.Executor;
import javax.net.ssl.HttpsURLConnection;
public class f2 {
    public final Executor a;
    public final a2 f2226b;
    public final Handler c;

    public f2(Executor executor, a2 a2Var, Handler handler) {
        this.a = executor;
        this.f2226b = a2Var;
        this.c = handler;
    }

    public void a(q5 q5Var, boolean z, String str, CBError.CBClickError cBClickError) {
        if (q5Var == null) {
            f6.b("CBURLOpener", "Impression is null on urlOpenAttempted");
            return;
        }
        q5Var.a(false);
        if (!z) {
            q5Var.a(str, cBClickError);
        } else {
            q5Var.c();
        }
    }

    public CBError.CBClickError b(Context context, q5 q5Var, String str) {
        try {
            String scheme = new URI(str).getScheme();
            if (scheme == null) {
                CBError.CBClickError cBClickError = CBError.CBClickError.URI_INVALID;
                a(q5Var, false, str, cBClickError);
                return cBClickError;
            } else if (!scheme.equals(FSConstants.HTTP) && !scheme.equals("https")) {
                return c(context, q5Var, str);
            } else {
                this.a.execute(new a(str, context, q5Var));
                return null;
            }
        } catch (URISyntaxException unused) {
            CBError.CBClickError cBClickError2 = CBError.CBClickError.URI_INVALID;
            a(q5Var, false, str, cBClickError2);
            return cBClickError2;
        }
    }

    public CBError.CBClickError c(Context context, q5 q5Var, String str) {
        if (context == null) {
            CBError.CBClickError cBClickError = CBError.CBClickError.NO_HOST_ACTIVITY;
            a(q5Var, false, str, cBClickError);
            return cBClickError;
        }
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            if (!(context instanceof Activity)) {
                intent.addFlags(268435456);
            }
            intent.setData(Uri.parse(str));
            context.startActivity(intent);
        } catch (Exception unused) {
            if (str.startsWith("market://")) {
                try {
                    str = "https://market.android.com/" + str.substring(9);
                    Intent intent2 = new Intent("android.intent.action.VIEW");
                    if (!(context instanceof Activity)) {
                        intent2.addFlags(268435456);
                    }
                    intent2.setData(Uri.parse(str));
                    context.startActivity(intent2);
                } catch (Exception e) {
                    f6.a("CBURLOpener", "Exception raised openeing an inavld playstore URL", e);
                    CBError.CBClickError cBClickError2 = CBError.CBClickError.URI_UNRECOGNIZED;
                    a(q5Var, false, str, cBClickError2);
                    return cBClickError2;
                }
            } else {
                CBError.CBClickError cBClickError3 = CBError.CBClickError.URI_UNRECOGNIZED;
                a(q5Var, false, str, cBClickError3);
                return cBClickError3;
            }
        }
        a(q5Var, true, str, null);
        return null;
    }

    public class a implements Runnable {
        public final String a;
        public final Context f2227b;
        public final q5 c;

        public a(String str, Context context, q5 q5Var) {
            this.a = str;
            this.f2227b = context;
            this.c = q5Var;
        }

        public final void a(final String str) {
            final Context context = this.f2227b;
            final q5 q5Var = this.c;
            f2.this.c.post(new Runnable() {
                @Override
                public final void run() {
                    f2.a.this.a(context, q5Var, str);
                }
            });
        }

        @Override
        public void run() {
            HttpsURLConnection httpsURLConnection;
            Exception e;
            try {
                String str = this.a;
                if (f2.this.f2226b.e()) {
                    HttpsURLConnection httpsURLConnection2 = null;
                    try {
                        httpsURLConnection = (HttpsURLConnection) new URL(this.a).openConnection();
                        try {
                            try {
                                httpsURLConnection.setSSLSocketFactory(d2.a());
                                httpsURLConnection.setInstanceFollowRedirects(false);
                                httpsURLConnection.setConnectTimeout(10000);
                                httpsURLConnection.setReadTimeout(10000);
                                String headerField = httpsURLConnection.getHeaderField("Location");
                                if (headerField != null) {
                                    str = headerField;
                                }
                            } catch (Exception e2) {
                                e = e2;
                                f6.a("CBURLOpener", "Exception raised while opening a HTTPS Connection", e);
                            }
                        } catch (Throwable th) {
                            th = th;
                            httpsURLConnection2 = httpsURLConnection;
                            if (httpsURLConnection2 != null) {
                                httpsURLConnection2.disconnect();
                            }
                            throw th;
                        }
                    } catch (Exception e3) {
                        httpsURLConnection = null;
                        e = e3;
                    } catch (Throwable th2) {
                        th = th2;
                        if (httpsURLConnection2 != null) {
                        }
                        throw th;
                    }
                    httpsURLConnection.disconnect();
                }
                a(str);
            } catch (Exception e4) {
                f6.b("CBURLOpener", "open followTask: " + e4);
            }
        }

        public void a(Context context, q5 q5Var, String str) {
            try {
                f2.this.c(context, q5Var, str);
            } catch (Exception e) {
                f6.b("CBURLOpener", "open openOnUiThread Runnable.run: " + e);
            }
        }
    }

    public boolean a(Context context, String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            if (!(context instanceof Activity)) {
                intent.addFlags(268435456);
            }
            intent.setData(Uri.parse(str));
            return context.getPackageManager().queryIntentActivities(intent, 65536).size() > 0;
        } catch (Exception e) {
            f6.a("CBURLOpener", "Cannot open URL", e);
            return false;
        }
    }

    public CBError.CBClickError a(Context context, q5 q5Var, String str) {
        return b(context, q5Var, str);
    }
}