整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3

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


package com.beizi.ad.internal;

import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.webkit.WebView;
import com.beizi.ad.RewardedVideoAd;
import com.beizi.ad.alipay.model.IncentiveConfig;
import com.beizi.ad.internal.c.f;
import com.beizi.ad.internal.utilities.HaoboLog;
import com.beizi.ad.internal.utilities.SPUtils;
import com.beizi.ad.internal.utilities.StringUtil;
import com.bytedance.sdk.openadsdk.downloadnew.core.TTDownloadField;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
public class g {
    private static boolean G = false;
    private static boolean H = false;
    public static String f = null;
    public static String g = "";
    public static String h = "";
    private static String l = "USED_AD_UNIT_IDS_KEY";
    private static g m = null;
    private static String n = "BeiZiImpl";
    private static String p;
    private boolean A;
    private RewardedVideoAd B;
    private DisplayMetrics C;
    private com.beizi.ad.internal.c.f F;
    public Context i;
    public float j;
    public float k;
    private IncentiveConfig o;
    private float z;
    public boolean a = false;
    public String b = null;
    public boolean c = false;
    public String d = "";
    public HashMap<String, String> e = new HashMap<>();
    private HashSet<String> q = new HashSet<>();
    private HashSet<String> r = new HashSet<>();
    private HashSet<String> s = new HashSet<>();
    private HashSet<String> t = new HashSet<>();
    private HashSet<String> u = new HashSet<>();
    private HashSet<String> v = new HashSet<>();
    private Handler w = new Handler(Looper.getMainLooper()) {
        @Override
        public void handleMessage(Message message) {
            super.handleMessage(message);
            int i = message.what;
        }
    };
    private Handler x = null;
    private HandlerThread y = null;
    private boolean D = false;
    private boolean E = false;

    static class AnonymousClass3 {
        static final int[] a;

        static {
            int[] iArr = new int[l.values().length];
            a = iArr;
            try {
                iArr[l.SPLASH.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[l.BANNER.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[l.INTERSTITIAL.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[l.NATIVE.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                a[l.REWARDEDVIDEO.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
        }
    }

    private com.beizi.ad.internal.c.f p() {
        Context context = this.i;
        if (context == null) {
            return null;
        }
        return new f.a(context).a(52428800L).a();
    }

    private void q() {
        try {
            Class.forName("android.content.pm.PackageParser$Package").getDeclaredConstructor(String.class).setAccessible(true);
        } catch (Exception e) {
            e.printStackTrace();
        } catch (Throwable th) {
            th.printStackTrace();
        }
        try {
            Class<?> cls = Class.forName("android.app.ActivityThread");
            Method declaredMethod = cls.getDeclaredMethod("currentActivityThread", new Class[0]);
            declaredMethod.setAccessible(true);
            Object invoke = declaredMethod.invoke(null, new Object[0]);
            Field declaredField = cls.getDeclaredField("mHiddenApiWarningShown");
            declaredField.setAccessible(true);
            declaredField.setBoolean(invoke, true);
        } catch (Exception e2) {
            e2.printStackTrace();
        } catch (Throwable th2) {
            th2.printStackTrace();
        }
    }

    public g a(String str) {
        p = str;
        return m;
    }

    public void a(String str, boolean z) {
    }

    public com.beizi.ad.internal.c.f b() {
        if (this.i == null) {
            return null;
        }
        com.beizi.ad.internal.c.f fVar = this.F;
        if (fVar == null) {
            com.beizi.ad.internal.c.f p2 = p();
            this.F = p2;
            return p2;
        }
        return fVar;
    }

    public Handler c() {
        if (this.x == null) {
            if (this.y == null) {
                HandlerThread handlerThread = new HandlerThread("BackgroundHandler");
                this.y = handlerThread;
                handlerThread.start();
            }
            this.x = new Handler(this.y.getLooper());
        }
        return this.x;
    }

    public String d() {
        return f;
    }

    public Context e() {
        return this.i;
    }

    public String f() {
        String a = com.beizi.ad.a.a.b.a("aHR0cDovL2FwaS5odHAuYWQtc2NvcGUuY29tLmNuOjQ1NjAw");
        return TextUtils.isEmpty(a) ? "" : this.a ? a.replace("http:", "https:") : a;
    }

    public String g() {
        if (!TextUtils.isEmpty(p)) {
            return p;
        }
        String a = com.beizi.ad.a.a.b.a("aHR0cDovL2FwaS5odHAuYWQtc2NvcGUuY29tLmNuOjQ1NjAw");
        return TextUtils.isEmpty(a) ? "" : this.a ? a.replace("http:", "https:") : a;
    }

    public float h() {
        return this.j;
    }

    public float i() {
        return this.k;
    }

    public float j() {
        return Math.max(this.j, this.k);
    }

    public DisplayMetrics k() {
        return this.C;
    }

    public HashSet<String> l() {
        return this.v;
    }

    public boolean m() {
        return G;
    }

    public String n() {
        if (TextUtils.isEmpty(this.b)) {
            return f() + "/mb/sdk0/json";
        }
        return this.b;
    }

    public IncentiveConfig o() {
        return this.o;
    }

    public static g a() {
        g gVar;
        synchronized (g.class) {
            if (m == null) {
                m = new g();
            }
            gVar = m;
        }
        return gVar;
    }

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

    public void a(Context context, String str) {
        synchronized (g.class) {
            try {
                if (context != null) {
                    Log.i("lance", "SDK_VERSION:3.4.20.37");
                    this.i = context.getApplicationContext();
                    try {
                        HaoboLog.setErrorContext(context.getApplicationContext());
                        f = str;
                        String string = SPUtils.getString(this.i, TTDownloadField.TT_USERAGENT);
                        if (!TextUtils.isEmpty(string)) {
                            a().d = string;
                        } else {
                            WebView webView = new WebView(context);
                            int i = Build.VERSION.SDK_INT;
                            if (i >= 11 && i < 19) {
                                webView.removeJavascriptInterface("searchBoxJavaBridge_");
                                webView.removeJavascriptInterface("accessibility");
                                webView.removeJavascriptInterface("accessibilityTraversal");
                            }
                            if (i >= 19) {
                                WebView.setWebContentsDebuggingEnabled(false);
                            }
                            webView.getSettings().setSavePassword(false);
                            a().d = webView.getSettings().getUserAgentString();
                            if (!TextUtils.isEmpty(a().d)) {
                                SPUtils.put(this.i, TTDownloadField.TT_USERAGENT, a().d);
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                        a().d = "";
                    } catch (Throwable th) {
                        th.printStackTrace();
                        a().d = "";
                    }
                    DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
                    this.C = displayMetrics;
                    int i2 = displayMetrics.widthPixels;
                    int i3 = displayMetrics.heightPixels;
                    if (i2 < i3) {
                        this.j = i2 / 720.0f;
                        this.k = i3 / 1280.0f;
                    } else {
                        this.j = i3 / 720.0f;
                        this.k = i2 / 1280.0f;
                    }
                    if (!this.E) {
                        com.beizi.ad.a.d.a(this.i).a(new com.beizi.ad.a.c() {
                            @Override
                            public void a(long j, long j2) {
                                com.beizi.ad.a.a.k.a("lance", "在线时长:" + (j2 - j));
                                SPUtils.put(g.this.i, "startTime", Long.valueOf(j));
                                SPUtils.put(g.this.i, "endTime", Long.valueOf(j2));
                            }

                            @Override
                            public void a() {
                                com.beizi.ad.a.a.k.a("lance", "上报活跃量");
                            }
                        });
                    }
                    this.E = true;
                    if (Build.VERSION.SDK_INT >= 28) {
                        q();
                    }
                } else {
                    throw new IllegalArgumentException("Context cannot be null.");
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    public RewardedVideoAd a(Context context) {
        p pVar;
        synchronized (g.class) {
            pVar = new p(context);
            this.B = pVar;
        }
        return pVar;
    }

    public void a(float f2) {
        q.a(0.0f <= f2 && f2 <= 1.0f, "The app volume must be a value between 0 and 1 inclusive.");
        q.a(f, (Object) "BeiZi.initialize() must be called prior to setting the app volume.");
        this.z = f2;
    }

    public void a(boolean z) {
        q.a(f, (Object) "BeiZi.initialize() must be called prior to setting the app volume.");
        this.A = z;
    }

    public void a(l lVar, String str) {
        if (StringUtil.isEmpty(str)) {
            return;
        }
        int i = AnonymousClass3.a[lVar.ordinal()];
        if (i == 1) {
            this.q.add(str);
        } else if (i == 2) {
            this.r.add(str);
        } else if (i == 3) {
            this.s.add(str);
        } else if (i == 4) {
            this.t.add(str);
        } else if (i != 5) {
        } else {
            this.u.add(str);
        }
    }

    public void a(Map<String, String> map) {
        this.o = new IncentiveConfig();
        if (map == null || map.isEmpty()) {
            return;
        }
        for (Map.Entry<String, String> entry : map.entrySet()) {
            if ("configVersion".equals(entry.getKey())) {
                this.o.setConfigVersion(entry.getValue());
            }
            if ("macro".equals(entry.getKey())) {
                this.o.setMacro(entry.getValue());
            }
            if ("rtaUrl".equals(entry.getKey())) {
                this.o.setRtaUrl(entry.getValue());
            }
            if ("userInfoUrl".equals(entry.getKey())) {
                this.o.setUserInfoUrl(entry.getValue());
            }
            if ("authUrl".equals(entry.getKey())) {
                this.o.setAuthUrl(entry.getValue());
            }
            if ("transferUrl".equals(entry.getKey())) {
                this.o.setTransferUrl(entry.getValue());
            }
            if ("appId".equals(entry.getKey())) {
                this.o.setAppId(entry.getValue());
            }
        }
    }
}