package com.tencent.mm.plugin.webview.core; import com.tencent.mm.ipcinvoker.type.IPCVoid; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.MultiProcessMMKV; import com.tencent.mm.sdk.platformtools.WeChatProcess; import ek4.y; import ie1.h; import java.util.regex.Matcher; import java.util.regex.Pattern; import lh4.m; import lh4.o; import wg4.g; import wg4.h; import wg4.n; import yz3.j; public final class q { /* renamed from: a reason: collision with root package name */ public static final q f164627a = new q(); /* renamed from: b reason: collision with root package name */ public static final g f164628b = h.a(a.f164632d); /* renamed from: c reason: collision with root package name */ public static Pattern f164629c; /* renamed from: d reason: collision with root package name */ public static final g f164630d = h.a(b.f164633d); /* renamed from: e reason: collision with root package name */ public static boolean f164631e; public static final class a extends o implements kh4.a<String> { /* renamed from: d reason: collision with root package name */ public static final a f164632d = new a(); public a() { super(0); } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public String invoke() { return ((ie1.h) j.c(ie1.h.class)).pi(h.c.f232516x6, "^https://(mi|v2|c2)\\.gdt\\.qq\\.com/gdt_(.*)\\.fcg(.*)"); } } public static final class b extends o implements kh4.a<MultiProcessMMKV> { /* renamed from: d reason: collision with root package name */ public static final b f164633d = new b(); public b() { super(0); } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public MultiProcessMMKV invoke() { return MultiProcessMMKV.getMMKV("__webView_ad"); } } public final String a(String str) { Matcher matcher; if (str == null) { return null; } if (f164629c == null) { Pattern compile = Pattern.compile((String) ((n) f164628b).getValue()); if (compile == null) { return null; } f164629c = compile; } Pattern pattern = f164629c; if (pattern != null) { matcher = pattern.matcher(str); } else { matcher = null; } boolean z15 = false; if (matcher != null && matcher.find()) { z15 = true; } if (z15) { String decodeString = ((MultiProcessMMKV) ((n) f164630d).getValue()).decodeString("AdWUID", ""); m.f(decodeString, "mmkv.decodeString(\"AdWUID\", \"\")"); if (!y.n(decodeString)) { Log.i("MicroMsg.WebViewAdHelper", "getCustomHeaders wuid=" + decodeString + ", url=" + str); b(6); return "Wuid:" + decodeString; } b(7); if (!f164631e) { f164631e = true; b(0); String str2 = WeChatProcess.PROCESS_MAIN; m.f(str2, "PROCESS_MAIN"); com.tencent.mm.ipcinvoker.a.a(str2, IPCVoid.f75821d, s.f164636d, t.f164637d); } } return null; } public final void b(long j15) { com.tencent.mm.plugin.report.service.q.INSTANCE.idkeyStat(1931, j15, 1, false); } }