package com.mbridge.msdk.foundation.same.report;

import android.text.TextUtils;
import com.mbridge.msdk.foundation.tools.af;
import org.json.JSONArray;
/* compiled from: DomainReport.java */
/* loaded from: classes5.dex */
public class b {

    /* renamed from: a  reason: collision with root package name */
    private static String f3655a = "DomainReport";

    public static boolean a(com.mbridge.msdk.c.g gVar, String str) {
        if (gVar != null) {
            try {
                if (TextUtils.isEmpty(str)) {
                    return true;
                }
                int Q = gVar.Q();
                JSONArray O = gVar.O();
                JSONArray N = gVar.N();
                if (N != null) {
                    for (int i = 0; i < N.length(); i++) {
                        if (str.contains(N.getString(i))) {
                            return false;
                        }
                    }
                }
                if (Q == 2) {
                    if (O != null) {
                        for (int i2 = 0; i2 < O.length(); i2++) {
                            if (str.contains(O.getString(i2))) {
                                return true;
                            }
                        }
                    }
                    return false;
                }
                return true;
            } catch (Exception e) {
                af.b(f3655a, e.getMessage());
                return true;
            }
        }
        return true;
    }
}
