Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
package com.mbridge.msdk.mbnative;
/* loaded from: classes4.dex */
public final class BuildConfig {
public static final String BUILD_TYPE = "release";
public static final boolean DEBUG = false;
public static final String FLAVOR = "oversea";
public static final String LIBRARY_PACKAGE_NAME = "com.mbridge.msdk.mbnative";
}

View File

@@ -0,0 +1,258 @@
package com.mbridge.msdk.mbnative;
/* loaded from: classes4.dex */
public final class R {
public static final class attr {
public static int corner = 0x7f0400b4;
private attr() {
}
}
public static final class color {
public static int mbridge_black = 0x7f0600ab;
public static int mbridge_black_66 = 0x7f0600ac;
public static int mbridge_black_alpha_50 = 0x7f0600ad;
public static int mbridge_cm_feedback_dialog_chice_bg_pressed = 0x7f0600ae;
public static int mbridge_cm_feedback_rb_text_color_color_list = 0x7f0600af;
public static int mbridge_common_white = 0x7f0600b3;
public static int mbridge_cpb_blue = 0x7f0600b4;
public static int mbridge_cpb_blue_dark = 0x7f0600b5;
public static int mbridge_cpb_green = 0x7f0600b6;
public static int mbridge_cpb_green_dark = 0x7f0600b7;
public static int mbridge_cpb_grey = 0x7f0600b8;
public static int mbridge_cpb_red = 0x7f0600b9;
public static int mbridge_cpb_red_dark = 0x7f0600ba;
public static int mbridge_cpb_white = 0x7f0600bb;
public static int mbridge_dd_grey = 0x7f0600bc;
public static int mbridge_ee_grey = 0x7f0600bd;
public static int mbridge_nativex_cta_txt_nor = 0x7f0600c1;
public static int mbridge_nativex_cta_txt_pre = 0x7f0600c2;
public static int mbridge_nativex_land_cta_bg_nor = 0x7f0600c3;
public static int mbridge_nativex_por_cta_bg_nor = 0x7f0600c4;
public static int mbridge_nativex_por_cta_bg_pre = 0x7f0600c5;
public static int mbridge_nativex_sound_bg = 0x7f0600c6;
public static int mbridge_purple_200 = 0x7f0600c7;
public static int mbridge_purple_500 = 0x7f0600c8;
public static int mbridge_purple_700 = 0x7f0600c9;
public static int mbridge_teal_200 = 0x7f0600da;
public static int mbridge_teal_700 = 0x7f0600db;
public static int mbridge_video_common_alertview_bg = 0x7f0600dc;
public static int mbridge_video_common_alertview_cancel_button_bg_default = 0x7f0600dd;
public static int mbridge_video_common_alertview_cancel_button_bg_pressed = 0x7f0600de;
public static int mbridge_video_common_alertview_cancel_button_textcolor = 0x7f0600df;
public static int mbridge_video_common_alertview_confirm_button_bg_default = 0x7f0600e0;
public static int mbridge_video_common_alertview_confirm_button_bg_pressed = 0x7f0600e1;
public static int mbridge_video_common_alertview_confirm_button_textcolor = 0x7f0600e2;
public static int mbridge_video_common_alertview_content_textcolor = 0x7f0600e3;
public static int mbridge_video_common_alertview_feedback_rb_bg = 0x7f0600e4;
public static int mbridge_video_common_alertview_title_textcolor = 0x7f0600e5;
public static int mbridge_white = 0x7f0600e6;
private color() {
}
}
public static final class dimen {
public static int mbridge_video_common_alertview_bg_padding = 0x7f0700fa;
public static int mbridge_video_common_alertview_button_height = 0x7f0700fb;
public static int mbridge_video_common_alertview_button_margintop = 0x7f0700fc;
public static int mbridge_video_common_alertview_button_radius = 0x7f0700fd;
public static int mbridge_video_common_alertview_button_textsize = 0x7f0700fe;
public static int mbridge_video_common_alertview_button_width = 0x7f0700ff;
public static int mbridge_video_common_alertview_content_margintop = 0x7f070100;
public static int mbridge_video_common_alertview_content_size = 0x7f070101;
public static int mbridge_video_common_alertview_contentview_maxwidth = 0x7f070102;
public static int mbridge_video_common_alertview_contentview_minwidth = 0x7f070103;
public static int mbridge_video_common_alertview_title_size = 0x7f070104;
private dimen() {
}
}
public static final class drawable {
public static int mbridge_arrow_down_white = 0x7f08019c;
public static int mbridge_arrow_down_white_blackbg = 0x7f08019d;
public static int mbridge_arrow_up_black = 0x7f08019e;
public static int mbridge_arrow_up_white = 0x7f08019f;
public static int mbridge_cm_alertview_bg = 0x7f0801a2;
public static int mbridge_cm_alertview_cancel_bg = 0x7f0801a3;
public static int mbridge_cm_alertview_cancel_bg_nor = 0x7f0801a4;
public static int mbridge_cm_alertview_cancel_bg_pressed = 0x7f0801a5;
public static int mbridge_cm_alertview_confirm_bg = 0x7f0801a6;
public static int mbridge_cm_alertview_confirm_bg_nor = 0x7f0801a7;
public static int mbridge_cm_alertview_confirm_bg_pressed = 0x7f0801a8;
public static int mbridge_cm_backward = 0x7f0801a9;
public static int mbridge_cm_backward_disabled = 0x7f0801aa;
public static int mbridge_cm_backward_nor = 0x7f0801ab;
public static int mbridge_cm_backward_selected = 0x7f0801ac;
public static int mbridge_cm_browser = 0x7f0801ad;
public static int mbridge_cm_btn_shake = 0x7f0801ae;
public static int mbridge_cm_circle_50black = 0x7f0801af;
public static int mbridge_cm_end_animation = 0x7f0801b0;
public static int mbridge_cm_exits = 0x7f0801b1;
public static int mbridge_cm_exits_nor = 0x7f0801b2;
public static int mbridge_cm_exits_selected = 0x7f0801b3;
public static int mbridge_cm_feedback_btn_bg = 0x7f0801b4;
public static int mbridge_cm_feedback_choice_btn_bg = 0x7f0801b5;
public static int mbridge_cm_feedback_choice_btn_bg_nor = 0x7f0801b6;
public static int mbridge_cm_feedback_choice_btn_bg_pressed = 0x7f0801b7;
public static int mbridge_cm_feedback_dialog_view_bg = 0x7f0801b8;
public static int mbridge_cm_feedback_dialog_view_btn_bg = 0x7f0801b9;
public static int mbridge_cm_forward = 0x7f0801ba;
public static int mbridge_cm_forward_disabled = 0x7f0801bb;
public static int mbridge_cm_forward_nor = 0x7f0801bc;
public static int mbridge_cm_forward_selected = 0x7f0801bd;
public static int mbridge_cm_head = 0x7f0801be;
public static int mbridge_cm_highlight = 0x7f0801bf;
public static int mbridge_cm_progress = 0x7f0801c0;
public static int mbridge_cm_progress_drawable = 0x7f0801c1;
public static int mbridge_cm_progress_icon = 0x7f0801c2;
public static int mbridge_cm_refresh = 0x7f0801c3;
public static int mbridge_cm_refresh_nor = 0x7f0801c4;
public static int mbridge_cm_refresh_selected = 0x7f0801c5;
public static int mbridge_cm_tail = 0x7f0801c6;
public static int mbridge_demo_star_nor = 0x7f0801c7;
public static int mbridge_demo_star_sel = 0x7f0801c8;
public static int mbridge_download_message_dialog_star_sel = 0x7f0801c9;
public static int mbridge_download_message_dilaog_star_nor = 0x7f0801ca;
public static int mbridge_native_bg_loading_camera = 0x7f0801d2;
public static int mbridge_nativex_close = 0x7f0801d3;
public static int mbridge_nativex_cta_land_nor = 0x7f0801d4;
public static int mbridge_nativex_cta_land_pre = 0x7f0801d5;
public static int mbridge_nativex_cta_por_nor = 0x7f0801d6;
public static int mbridge_nativex_cta_por_pre = 0x7f0801d7;
public static int mbridge_nativex_full_land_close = 0x7f0801d8;
public static int mbridge_nativex_full_protial_close = 0x7f0801d9;
public static int mbridge_nativex_fullview_background = 0x7f0801da;
public static int mbridge_nativex_pause = 0x7f0801db;
public static int mbridge_nativex_play = 0x7f0801dc;
public static int mbridge_nativex_play_bg = 0x7f0801dd;
public static int mbridge_nativex_play_progress = 0x7f0801de;
public static int mbridge_nativex_sound1 = 0x7f0801df;
public static int mbridge_nativex_sound2 = 0x7f0801e0;
public static int mbridge_nativex_sound3 = 0x7f0801e1;
public static int mbridge_nativex_sound4 = 0x7f0801e2;
public static int mbridge_nativex_sound5 = 0x7f0801e3;
public static int mbridge_nativex_sound6 = 0x7f0801e4;
public static int mbridge_nativex_sound7 = 0x7f0801e5;
public static int mbridge_nativex_sound8 = 0x7f0801e6;
public static int mbridge_nativex_sound_animation = 0x7f0801e7;
public static int mbridge_nativex_sound_bg = 0x7f0801e8;
public static int mbridge_nativex_sound_close = 0x7f0801e9;
public static int mbridge_nativex_sound_open = 0x7f0801ea;
public static int mbridge_shape_btn = 0x7f08021c;
public static int mbridge_shape_line = 0x7f08021e;
public static int mbridge_video_common_full_star = 0x7f080235;
public static int mbridge_video_common_full_while_star = 0x7f080236;
public static int mbridge_video_common_half_star = 0x7f080237;
private drawable() {
}
}
public static final class id {
public static int mbridge_full_animation_content = 0x7f0a0179;
public static int mbridge_full_animation_player = 0x7f0a017a;
public static int mbridge_full_iv_close = 0x7f0a017b;
public static int mbridge_full_pb_loading = 0x7f0a017c;
public static int mbridge_full_player_parent = 0x7f0a017d;
public static int mbridge_full_rl_close = 0x7f0a017e;
public static int mbridge_full_rl_playcontainer = 0x7f0a017f;
public static int mbridge_full_tv_display_content = 0x7f0a0180;
public static int mbridge_full_tv_display_description = 0x7f0a0181;
public static int mbridge_full_tv_display_icon = 0x7f0a0182;
public static int mbridge_full_tv_display_title = 0x7f0a0183;
public static int mbridge_full_tv_feeds_star = 0x7f0a0184;
public static int mbridge_full_tv_install = 0x7f0a0185;
public static int mbridge_interstitial_pb = 0x7f0a0187;
public static int mbridge_iv_pause = 0x7f0a0192;
public static int mbridge_iv_play = 0x7f0a0193;
public static int mbridge_iv_playend_pic = 0x7f0a0194;
public static int mbridge_iv_sound = 0x7f0a0195;
public static int mbridge_iv_sound_animation = 0x7f0a0196;
public static int mbridge_ll_loading = 0x7f0a019a;
public static int mbridge_ll_playerview_container = 0x7f0a019b;
public static int mbridge_my_big_img = 0x7f0a01a8;
public static int mbridge_native_pb = 0x7f0a01b0;
public static int mbridge_native_rl_root = 0x7f0a01b1;
public static int mbridge_nativex_webview_layout = 0x7f0a01b2;
public static int mbridge_nativex_webview_layout_webview = 0x7f0a01b3;
public static int mbridge_playercommon_ll_loading = 0x7f0a01b8;
public static int mbridge_playercommon_ll_sur_container = 0x7f0a01b9;
public static int mbridge_playercommon_rl_root = 0x7f0a01ba;
public static int mbridge_progress = 0x7f0a01bb;
public static int mbridge_progressBar = 0x7f0a01bc;
public static int mbridge_progressBar1 = 0x7f0a01bd;
public static int mbridge_rl_mediaview_root = 0x7f0a01d3;
public static int mbridge_textView = 0x7f0a01ed;
public static int mbridge_textureview = 0x7f0a01ef;
public static int mbridge_video_common_alertview_cancel_button = 0x7f0a020d;
public static int mbridge_video_common_alertview_confirm_button = 0x7f0a020e;
public static int mbridge_video_common_alertview_contentview = 0x7f0a020f;
public static int mbridge_video_common_alertview_contentview_scrollview = 0x7f0a0210;
public static int mbridge_video_common_alertview_private_action_button = 0x7f0a0211;
public static int mbridge_video_common_alertview_titleview = 0x7f0a0212;
public static int mbridge_view_cover = 0x7f0a0219;
private id() {
}
}
public static final class layout {
public static int loading_alert = 0x7f0d0055;
public static int mbridge_cm_alertview = 0x7f0d0066;
public static int mbridge_cm_feedback_notice_layout = 0x7f0d0067;
public static int mbridge_cm_feedbackview = 0x7f0d0068;
public static int mbridge_cm_loading_layout = 0x7f0d0069;
public static int mbridge_nativex_fullbasescreen = 0x7f0d006c;
public static int mbridge_nativex_fullscreen_top = 0x7f0d006d;
public static int mbridge_nativex_mbmediaview = 0x7f0d006e;
public static int mbridge_nativex_playerview = 0x7f0d006f;
public static int mbridge_playercommon_player_view = 0x7f0d0073;
private layout() {
}
}
public static final class string {
public static int mbridge_cm_feedback_btn_text = 0x7f12013c;
public static int mbridge_cm_feedback_dialog_close_close = 0x7f12013d;
public static int mbridge_cm_feedback_dialog_close_submit = 0x7f12013e;
public static int mbridge_cm_feedback_dialog_content_fraud = 0x7f12013f;
public static int mbridge_cm_feedback_dialog_content_misleading = 0x7f120140;
public static int mbridge_cm_feedback_dialog_content_not_play = 0x7f120141;
public static int mbridge_cm_feedback_dialog_content_other = 0x7f120142;
public static int mbridge_cm_feedback_dialog_content_por_violence = 0x7f120143;
public static int mbridge_cm_feedback_dialog_content_sound_problems = 0x7f120144;
public static int mbridge_cm_feedback_dialog_privacy_des = 0x7f120145;
public static int mbridge_cm_feedback_dialog_submit_notice = 0x7f120146;
public static int mbridge_cm_feedback_dialog_title = 0x7f120147;
private string() {
}
}
public static final class style {
public static int AppBaseTheme = 0x7f130005;
public static int MBridgeAppTheme = 0x7f1300ec;
public static int mbridge_common_activity_style = 0x7f1301f8;
public static int mbridge_transparent_common_activity_style = 0x7f1301fa;
public static int myDialog = 0x7f1301fc;
private style() {
}
}
public static final class styleable {
public static int[] RoundRectImageView = {com.ea.games.r3_row.R.attr.corner};
public static int RoundRectImageView_corner;
private styleable() {
}
}
private R() {
}
}

View File

@@ -0,0 +1,167 @@
package com.mbridge.msdk.mbnative.a;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.db.e;
import com.mbridge.msdk.foundation.db.g;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.out.Campaign;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes4.dex */
public final class a extends b<String, List<Campaign>> {
private e a = e.a(g.a(com.mbridge.msdk.foundation.controller.c.m().c()));
private int b;
@Override // com.mbridge.msdk.mbnative.a.b
public final /* synthetic */ List<Campaign> a(String str, int i) {
String str2 = str;
List<CampaignEx> a = this.a.a(str2, i, 2, this.b);
if (a == null) {
return null;
}
if (a(a, 2)) {
this.a.a(str2, 2, this.b);
return null;
}
ArrayList arrayList = new ArrayList();
arrayList.addAll(a);
return arrayList;
}
@Override // com.mbridge.msdk.mbnative.a.b
public final /* synthetic */ void a(String str, List<Campaign> list) {
String str2 = str;
List<Campaign> list2 = list;
if (TextUtils.isEmpty(str2) || list2 == null || list2.size() <= 0) {
return;
}
this.a.a(str2, 1, this.b, false);
this.a.a(str2, 2, this.b, false);
for (int i = 0; i < list2.size(); i++) {
CampaignEx campaignEx = (CampaignEx) list2.get(i);
campaignEx.setCacheLevel(1);
this.a.a(campaignEx, str2, 1);
}
}
@Override // com.mbridge.msdk.mbnative.a.b
public final /* synthetic */ void a(String str, List<Campaign> list, String str2) {
final String str3 = str;
final List<Campaign> list2 = list;
boolean z = !TextUtils.isEmpty(str2);
if (TextUtils.isEmpty(str3) || list2 == null || list2.size() <= 0) {
return;
}
this.a.a(str3, 1, this.b, z);
this.a.a(str3, 2, this.b, z);
com.mbridge.msdk.foundation.same.f.a.b().execute(new Runnable() { // from class: com.mbridge.msdk.mbnative.a.a.1
@Override // java.lang.Runnable
public final void run() {
for (int i = 0; i < list2.size(); i++) {
CampaignEx campaignEx = (CampaignEx) list2.get(i);
campaignEx.setCacheLevel(1);
a.this.a.a(campaignEx, str3, 1);
}
}
});
}
@Override // com.mbridge.msdk.mbnative.a.b
public final /* synthetic */ List<Campaign> b(String str, int i) {
String str2 = str;
List<CampaignEx> a = this.a.a(str2, i, 1, this.b);
if (a == null) {
return null;
}
if (!a(a, 1)) {
ArrayList arrayList = new ArrayList();
arrayList.addAll(a);
return arrayList;
}
for (int i2 = 0; i2 < a.size(); i2++) {
CampaignEx campaignEx = a.get(i2);
campaignEx.setCacheLevel(2);
this.a.a(campaignEx, str2, 1);
}
return null;
}
public a(int i) {
this.b = i;
}
/* JADX WARN: Removed duplicated region for block: B:12:0x0064 A[RETURN] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private boolean a(java.util.List<com.mbridge.msdk.foundation.entity.CampaignEx> r10, int r11) {
/*
r9 = this;
r0 = 0
if (r10 == 0) goto L65
int r1 = r10.size()
if (r1 <= 0) goto L65
long r1 = java.lang.System.currentTimeMillis()
java.lang.Object r10 = r10.get(r0)
com.mbridge.msdk.foundation.entity.CampaignEx r10 = (com.mbridge.msdk.foundation.entity.CampaignEx) r10
long r3 = r10.getTimestamp()
r5 = 1000(0x3e8, double:4.94E-321)
r10 = 1
if (r11 == r10) goto L41
r7 = 2
if (r11 == r7) goto L22
r5 = 0
goto L5f
L22:
com.mbridge.msdk.c.h r11 = com.mbridge.msdk.c.h.a()
com.mbridge.msdk.foundation.controller.c r7 = com.mbridge.msdk.foundation.controller.c.m()
java.lang.String r7 = r7.k()
com.mbridge.msdk.c.g r11 = r11.b(r7)
if (r11 != 0) goto L3b
com.mbridge.msdk.c.h.a()
com.mbridge.msdk.c.g r11 = com.mbridge.msdk.c.i.a()
L3b:
long r7 = r11.ad()
L3f:
long r5 = r5 * r7
goto L5f
L41:
com.mbridge.msdk.c.h r11 = com.mbridge.msdk.c.h.a()
com.mbridge.msdk.foundation.controller.c r7 = com.mbridge.msdk.foundation.controller.c.m()
java.lang.String r7 = r7.k()
com.mbridge.msdk.c.g r11 = r11.b(r7)
if (r11 != 0) goto L5a
com.mbridge.msdk.c.h.a()
com.mbridge.msdk.c.g r11 = com.mbridge.msdk.c.i.a()
L5a:
long r7 = r11.ac()
goto L3f
L5f:
long r1 = r1 - r3
int r11 = (r1 > r5 ? 1 : (r1 == r5 ? 0 : -1))
if (r11 <= 0) goto L65
return r10
L65:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.mbnative.a.a.a(java.util.List, int):boolean");
}
@Override // com.mbridge.msdk.mbnative.a.b
public final void a(String str, Campaign campaign, String str2) {
boolean z = !TextUtils.isEmpty(str2);
if (campaign == null || TextUtils.isEmpty(str)) {
return;
}
try {
CampaignEx campaignEx = (CampaignEx) campaign;
if (this.a.a(campaignEx.getId(), campaignEx.getTab(), str, campaignEx.getCacheLevel(), campaignEx.getType(), z)) {
this.a.a(campaignEx.getId(), str, campaignEx.getCacheLevel(), this.b, z);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,18 @@
package com.mbridge.msdk.mbnative.a;
import com.mbridge.msdk.out.Campaign;
/* loaded from: classes4.dex */
public abstract class b<K, V> {
public V a(K k, int i) {
return null;
}
public abstract void a(K k, V v);
public abstract void a(K k, V v, String str);
public abstract void a(String str, Campaign campaign, String str2);
public abstract V b(K k, int i);
}

View File

@@ -0,0 +1,20 @@
package com.mbridge.msdk.mbnative.a;
import com.mbridge.msdk.out.Campaign;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/* loaded from: classes4.dex */
public final class c {
public static Map<Integer, b<String, List<Campaign>>> a = new HashMap();
public static b<String, List<Campaign>> a(int i) {
if (a.containsKey(Integer.valueOf(i))) {
return a.get(Integer.valueOf(i));
}
a aVar = new a(i);
a.put(Integer.valueOf(i), aVar);
return aVar;
}
}

View File

@@ -0,0 +1,16 @@
package com.mbridge.msdk.mbnative.b;
import java.io.PrintWriter;
import java.io.StringWriter;
/* loaded from: classes4.dex */
public final class a {
public static String a(Exception exc) {
if (exc == null) {
return "";
}
StringWriter stringWriter = new StringWriter();
exc.printStackTrace(new PrintWriter(stringWriter));
return stringWriter.toString();
}
}

View File

@@ -0,0 +1,17 @@
package com.mbridge.msdk.mbnative.c;
import android.content.Context;
import com.mbridge.msdk.out.MBBidCommonHandler;
import java.util.Map;
/* loaded from: classes4.dex */
public abstract class a extends MBBidCommonHandler {
public static String TAG = "DemandMBBidNativeHandler";
public a() {
}
public a(Map<String, Object> map, Context context) {
super(map, context);
}
}

View File

@@ -0,0 +1,17 @@
package com.mbridge.msdk.mbnative.c;
import android.content.Context;
import com.mbridge.msdk.out.MBCommonHandler;
import java.util.Map;
/* loaded from: classes4.dex */
public abstract class b extends MBCommonHandler {
public static String TAG = "DemandMBNativeHandler";
public b() {
}
public b(Map<String, Object> map, Context context) {
super(map, context);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
package com.mbridge.msdk.mbnative.controller;
import android.os.Handler;
/* loaded from: classes4.dex */
public abstract class a {
public Handler a;
public abstract void a(int i, long j, int i2, String str);
public final synchronized void a(long j, int i, boolean z, String str, String str2) {
a(1, j, i, str2);
}
}

View File

@@ -0,0 +1,19 @@
package com.mbridge.msdk.mbnative.controller;
import android.os.Handler;
import com.mbridge.msdk.c.k;
/* loaded from: classes4.dex */
public abstract class b {
protected Handler a;
public abstract void a(int i, long j, int i2, k kVar, String str, String str2, com.mbridge.msdk.b.a.a aVar, boolean z);
public final synchronized void a(int i, long j, int i2, k kVar, String str, String str2, boolean z, com.mbridge.msdk.b.a.a aVar) {
try {
a(i, j, i2, kVar, str, str2, aVar, z);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,164 @@
package com.mbridge.msdk.mbnative.controller;
import android.os.Handler;
import android.view.View;
import android.view.ViewTreeObserver;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.as;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes4.dex */
public final class c {
private WeakReference<ViewTreeObserver> a;
private List<View> b;
private ViewTreeObserver.OnPreDrawListener c;
private a d;
private Handler e;
private boolean f;
private int g;
public interface a {
void a(ArrayList<View> arrayList, ArrayList<View> arrayList2);
}
public c(List<View> list, a aVar, Handler handler, int i) {
ArrayList arrayList = new ArrayList();
this.b = arrayList;
this.c = null;
this.d = aVar;
this.e = handler;
this.g = i;
if (list != null) {
this.b = list;
} else {
arrayList.clear();
}
try {
b();
} catch (Throwable th) {
af.b("ImpressionTracker", th.getMessage(), th);
}
try {
this.c = new ViewTreeObserver.OnPreDrawListener() { // from class: com.mbridge.msdk.mbnative.controller.c.1
@Override // android.view.ViewTreeObserver.OnPreDrawListener
public final boolean onPreDraw() {
c.this.b();
return true;
}
};
} catch (Throwable th2) {
af.b("ImpressionTracker", th2.getMessage(), th2);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void b() {
if (this.f) {
return;
}
Handler handler = this.e;
if (handler != null) {
if (this.g == 1) {
c();
} else {
handler.postDelayed(new Runnable() { // from class: com.mbridge.msdk.mbnative.controller.c.2
@Override // java.lang.Runnable
public final void run() {
c.this.c();
}
}, 100L);
}
}
this.f = true;
}
public final void a(View view) {
final View view2;
View view3;
if (view != null) {
view2 = f.a(view.getContext(), view);
this.b.add(view);
} else {
List<View> list = this.b;
view2 = null;
if (list != null && list.size() > 0) {
for (int i = 0; i < this.b.size() && ((view3 = this.b.get(i)) == null || (view2 = f.a(view3.getContext(), view3)) == null); i++) {
}
}
}
if (view2 == null) {
return;
}
view2.post(new Runnable() { // from class: com.mbridge.msdk.mbnative.controller.c.3
@Override // java.lang.Runnable
public final void run() {
ViewTreeObserver viewTreeObserver = view2.getViewTreeObserver();
if (viewTreeObserver == null || viewTreeObserver.isAlive()) {
c.this.a = new WeakReference(viewTreeObserver);
if (c.this.c != null) {
viewTreeObserver.addOnPreDrawListener(c.this.c);
}
}
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public void c() {
try {
this.f = false;
List<View> list = this.b;
if (list == null || list.size() <= 0) {
return;
}
ArrayList<View> arrayList = new ArrayList<>();
ArrayList<View> arrayList2 = new ArrayList<>();
for (int i = 0; i < this.b.size(); i++) {
View view = this.b.get(i);
if (b(view)) {
arrayList.add(view);
} else {
arrayList2.add(view);
}
}
a aVar = this.d;
if (aVar != null) {
aVar.a(arrayList, arrayList2);
}
if (arrayList.size() > 0) {
a();
}
arrayList.clear();
arrayList2.clear();
} catch (Exception unused) {
}
}
private boolean b(View view) {
return !as.a(view, this.g);
}
public final void a() {
try {
this.f = false;
WeakReference<ViewTreeObserver> weakReference = this.a;
if (weakReference != null && weakReference.get() != null) {
ViewTreeObserver viewTreeObserver = this.a.get();
if (viewTreeObserver != null && viewTreeObserver.isAlive()) {
viewTreeObserver.removeOnPreDrawListener(this.c);
}
this.a.clear();
}
this.d = null;
this.c = null;
List<View> list = this.b;
if (list != null) {
list.clear();
}
this.b = null;
} catch (Throwable unused) {
}
}
}

View File

@@ -0,0 +1,594 @@
package com.mbridge.msdk.mbnative.controller;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.c.j;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.entity.CampaignUnit;
import com.mbridge.msdk.foundation.entity.k;
import com.mbridge.msdk.foundation.same.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.nativex.view.MBMediaView;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.Frame;
import com.mbridge.msdk.tracker.network.h;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.CopyOnWriteArrayList;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class d extends com.mbridge.msdk.mbnative.controller.b {
private static final String e = "d";
private static Map<String, Map<Long, Object>> f = new HashMap();
private static Map<String, Boolean> g = new HashMap();
private static Map<String, k> h = new HashMap();
private static Map<String, Integer> i = new HashMap();
private static Map<String, Integer> j = new HashMap();
private static d k = null;
private static int u = -1;
private static int v = -2;
protected List<Integer> d;
private j l;
private com.mbridge.msdk.click.a m;
private com.mbridge.msdk.c.k n;
private String o;
private Map<String, Object> q;
private List<Integer> r;
private List<Integer> s;
private boolean t;
private boolean w;
private int x;
private int y;
Queue<Integer> b = null;
Queue<Long> c = null;
private int p = 0;
private com.mbridge.msdk.foundation.same.e.b z = new com.mbridge.msdk.foundation.same.e.b(com.mbridge.msdk.foundation.controller.c.m().c());
public static Map<String, Map<Long, Object>> a() {
return f;
}
public static Map<String, Boolean> b() {
return g;
}
public static Map<String, k> c() {
return h;
}
public static Map<String, Integer> d() {
return i;
}
public static Map<String, Integer> e() {
return j;
}
public d() {
if (Looper.myLooper() == null) {
Looper.prepare();
}
this.a = new Handler() { // from class: com.mbridge.msdk.mbnative.controller.d.1
@Override // android.os.Handler
public final void handleMessage(Message message) {
}
};
}
/* JADX WARN: Removed duplicated region for block: B:117:0x02f4 A[Catch: Exception -> 0x006c, TryCatch #3 {Exception -> 0x006c, blocks: (B:3:0x001c, B:7:0x0028, B:9:0x0051, B:12:0x006f, B:15:0x0076, B:17:0x007c, B:18:0x0088, B:20:0x008c, B:21:0x009f, B:23:0x00a5, B:24:0x00b1, B:26:0x00b7, B:27:0x00bf, B:29:0x00c8, B:31:0x00d6, B:33:0x0102, B:35:0x0108, B:37:0x011c, B:38:0x0123, B:40:0x0134, B:43:0x013b, B:54:0x016a, B:56:0x017b, B:58:0x0181, B:59:0x018b, B:61:0x01a1, B:63:0x01a7, B:65:0x01af, B:66:0x01bd, B:68:0x01c1, B:69:0x01c8, B:71:0x01e1, B:72:0x01e7, B:75:0x01f1, B:77:0x01f9, B:81:0x020d, B:83:0x0229, B:85:0x022f, B:86:0x023c, B:88:0x0242, B:90:0x024e, B:92:0x0252, B:94:0x0258, B:95:0x0265, B:97:0x026b, B:99:0x0282, B:115:0x02e4, B:117:0x02f4, B:118:0x02fd, B:161:0x0412, B:174:0x041d, B:179:0x0163, B:180:0x009c, B:120:0x0306, B:122:0x031c, B:124:0x0335, B:125:0x033d, B:127:0x0343, B:128:0x0345, B:130:0x0353, B:131:0x0359, B:133:0x0363, B:135:0x0369, B:137:0x0375, B:139:0x037b, B:141:0x0385, B:142:0x038b, B:144:0x0391, B:146:0x03a1, B:148:0x03a4, B:151:0x03a7, B:153:0x03ad, B:45:0x0144, B:47:0x014a, B:49:0x0158, B:50:0x015a, B:52:0x0160), top: B:2:0x001c, inners: #1, #5 }] */
/* JADX WARN: Removed duplicated region for block: B:122:0x031c A[Catch: all -> 0x0412, TryCatch #1 {all -> 0x0412, blocks: (B:120:0x0306, B:122:0x031c, B:124:0x0335, B:125:0x033d, B:127:0x0343, B:128:0x0345, B:130:0x0353, B:131:0x0359, B:133:0x0363, B:135:0x0369, B:137:0x0375, B:139:0x037b, B:141:0x0385, B:142:0x038b, B:144:0x0391, B:146:0x03a1, B:148:0x03a4, B:151:0x03a7, B:153:0x03ad), top: B:119:0x0306, outer: #3 }] */
/* JADX WARN: Removed duplicated region for block: B:160:? A[RETURN, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:163:0x02fc */
/* JADX WARN: Removed duplicated region for block: B:174:0x041d A[Catch: Exception -> 0x006c, TRY_LEAVE, TryCatch #3 {Exception -> 0x006c, blocks: (B:3:0x001c, B:7:0x0028, B:9:0x0051, B:12:0x006f, B:15:0x0076, B:17:0x007c, B:18:0x0088, B:20:0x008c, B:21:0x009f, B:23:0x00a5, B:24:0x00b1, B:26:0x00b7, B:27:0x00bf, B:29:0x00c8, B:31:0x00d6, B:33:0x0102, B:35:0x0108, B:37:0x011c, B:38:0x0123, B:40:0x0134, B:43:0x013b, B:54:0x016a, B:56:0x017b, B:58:0x0181, B:59:0x018b, B:61:0x01a1, B:63:0x01a7, B:65:0x01af, B:66:0x01bd, B:68:0x01c1, B:69:0x01c8, B:71:0x01e1, B:72:0x01e7, B:75:0x01f1, B:77:0x01f9, B:81:0x020d, B:83:0x0229, B:85:0x022f, B:86:0x023c, B:88:0x0242, B:90:0x024e, B:92:0x0252, B:94:0x0258, B:95:0x0265, B:97:0x026b, B:99:0x0282, B:115:0x02e4, B:117:0x02f4, B:118:0x02fd, B:161:0x0412, B:174:0x041d, B:179:0x0163, B:180:0x009c, B:120:0x0306, B:122:0x031c, B:124:0x0335, B:125:0x033d, B:127:0x0343, B:128:0x0345, B:130:0x0353, B:131:0x0359, B:133:0x0363, B:135:0x0369, B:137:0x0375, B:139:0x037b, B:141:0x0385, B:142:0x038b, B:144:0x0391, B:146:0x03a1, B:148:0x03a4, B:151:0x03a7, B:153:0x03ad, B:45:0x0144, B:47:0x014a, B:49:0x0158, B:50:0x015a, B:52:0x0160), top: B:2:0x001c, inners: #1, #5 }] */
/* JADX WARN: Removed duplicated region for block: B:176:? A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(java.util.Map<java.lang.String, java.lang.Object> r24, int r25) {
/*
Method dump skipped, instructions count: 1069
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.mbnative.controller.d.a(java.util.Map, int):void");
}
private int a(String str) {
if (str == null) {
return 0;
}
try {
JSONArray jSONArray = new JSONArray(str);
if (jSONArray.length() > 0) {
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
JSONObject jSONObject = (JSONObject) jSONArray.opt(i2);
if (2 == jSONObject.optInt("id", 0)) {
return jSONObject.optInt("ad_num");
}
}
}
} catch (Exception e2) {
af.b(e, com.mbridge.msdk.mbnative.b.a.a(e2));
}
return 0;
}
private void a(int i2, com.mbridge.msdk.c.k kVar, String str, String str2, com.mbridge.msdk.b.a.a aVar) {
Queue<Integer> queue = this.b;
if (queue == null || queue.size() <= 0) {
return;
}
try {
int intValue = this.b.poll().intValue();
long j2 = MBridgeConstans.REQUEST_TIME_OUT;
Queue<Long> queue2 = this.c;
if (queue2 != null && queue2.size() > 0) {
j2 = this.c.poll().longValue();
}
af.c(e, "preload start queue adsource = " + intValue);
a(intValue, j2, str, str2, this.q, i2, kVar, aVar);
} catch (Throwable unused) {
af.b(e, "queue poll exception");
}
}
private void a(int i2, long j2, String str, String str2, Map<String, Object> map, int i3, com.mbridge.msdk.c.k kVar, com.mbridge.msdk.b.a.a aVar) {
com.mbridge.msdk.mbnative.a.b<String, List<Campaign>> a2;
if (i2 != 1 && (a2 = com.mbridge.msdk.mbnative.a.c.a(i2)) != null) {
List<Campaign> b2 = a2.b(str, this.y);
if (b2 != null && b2.size() > 0) {
a(true, aVar, (String) null);
return;
}
}
if (i2 == 1) {
a(i2, j2, i3, kVar, str, str2, true, aVar);
} else if (i2 == 2) {
a(2, j2, i3, kVar, str, str2, aVar, false);
} else {
a(i2, j2, i3, kVar, str, str2, aVar, false);
}
}
/* JADX WARN: Removed duplicated region for block: B:103:0x02b8 A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:106:0x02c6 A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:111:0x02e9 A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:121:0x0313 */
/* JADX WARN: Removed duplicated region for block: B:126:0x037d A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:129:0x038a A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:134:0x03be A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:139:0x0419 A[ADDED_TO_REGION] */
/* JADX WARN: Removed duplicated region for block: B:142:0x044c A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:145:0x0460 */
/* JADX WARN: Removed duplicated region for block: B:150:0x032e A[Catch: Exception -> 0x009c, TryCatch #3 {Exception -> 0x009c, blocks: (B:3:0x001c, B:6:0x0069, B:8:0x006f, B:10:0x0077, B:12:0x007f, B:14:0x0087, B:16:0x0091, B:17:0x009f, B:19:0x00a9, B:20:0x00b3, B:22:0x00bd, B:23:0x00c7, B:25:0x00cd, B:27:0x00d6, B:29:0x00ef, B:30:0x00f6, B:32:0x00fc, B:33:0x0101, B:35:0x0128, B:36:0x012d, B:42:0x0148, B:45:0x0150, B:47:0x0158, B:49:0x015e, B:52:0x0163, B:54:0x0167, B:59:0x017b, B:61:0x0183, B:63:0x0189, B:67:0x0194, B:68:0x01a6, B:70:0x01aa, B:71:0x01c0, B:73:0x01c8, B:75:0x01d7, B:77:0x01ed, B:81:0x01fe, B:83:0x0204, B:88:0x0211, B:90:0x0218, B:93:0x021e, B:98:0x0269, B:99:0x0276, B:101:0x028f, B:103:0x02b8, B:104:0x02be, B:106:0x02c6, B:108:0x02d8, B:109:0x02e1, B:111:0x02e9, B:117:0x02f9, B:118:0x0309, B:123:0x0316, B:124:0x0342, B:126:0x037d, B:127:0x0382, B:129:0x038a, B:131:0x0394, B:132:0x03b4, B:134:0x03be, B:136:0x03c8, B:137:0x03e8, B:140:0x041e, B:142:0x044c, B:143:0x047e, B:147:0x0465, B:148:0x041b, B:150:0x032e, B:152:0x02fe, B:153:0x0303, B:158:0x022b, B:160:0x0231, B:169:0x0252, B:181:0x0281, B:187:0x0484), top: B:2:0x001c }] */
/* JADX WARN: Removed duplicated region for block: B:151:0x032b */
/* JADX WARN: Unreachable blocks removed: 2, instructions: 2 */
@Override // com.mbridge.msdk.mbnative.controller.b
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(int r26, long r27, int r29, com.mbridge.msdk.c.k r30, java.lang.String r31, java.lang.String r32, com.mbridge.msdk.b.a.a r33, boolean r34) {
/*
Method dump skipped, instructions count: 1189
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.mbnative.controller.d.a(int, long, int, com.mbridge.msdk.c.k, java.lang.String, java.lang.String, com.mbridge.msdk.b.a.a, boolean):void");
}
public static void a(int i2, String str) {
k kVar;
if (h.containsKey(str)) {
kVar = h.get(str);
} else {
kVar = new k();
}
int intValue = i.get(str).intValue();
int intValue2 = j.containsKey(str) ? j.get(str).intValue() : 1;
if (i2 == 1) {
int a2 = intValue + kVar.a();
kVar.a(a2 <= intValue2 ? a2 : 0);
} else if (i2 == 2) {
int b2 = intValue + kVar.b();
kVar.b(b2 <= intValue2 ? b2 : 0);
}
h.put(str, kVar);
}
public static void b(int i2, String str) {
if (h.containsKey(str)) {
k kVar = h.get(str);
if (i2 == 1) {
kVar.a(0);
} else if (i2 == 2) {
kVar.b(0);
}
h.put(str, kVar);
}
}
public class a extends com.mbridge.msdk.mbnative.f.a.b implements com.mbridge.msdk.foundation.same.e.d {
private int b;
private int c;
private int d;
private int e;
private int f;
private Runnable i;
private com.mbridge.msdk.b.a.a k;
private List<String> g = null;
private boolean h = false;
private boolean j = true;
public final void a(int i) {
this.f = i;
}
public final void a(com.mbridge.msdk.b.a.a aVar) {
this.k = aVar;
}
public final void a(Runnable runnable) {
this.i = runnable;
}
public final void a(List<String> list) {
this.g = list;
}
@Override // com.mbridge.msdk.foundation.same.e.d
public final void a(boolean z) {
this.h = z;
}
public final void b(int i) {
this.d = i;
}
public final void b(boolean z) {
this.j = z;
}
public final void c(int i) {
this.e = i;
}
public final void d(int i) {
this.c = i;
}
public a(int i) {
this.b = i;
}
@Override // com.mbridge.msdk.mbnative.f.a.b
public final void a(List<h> list, final CampaignUnit campaignUnit) {
d.this.w = true;
d.this.a(true, this.k, (String) null);
d.this.a(new Thread(new Runnable() { // from class: com.mbridge.msdk.mbnative.controller.d.a.1
@Override // java.lang.Runnable
public final void run() {
boolean z;
if (MBridgeConstans.PRELOAD_RESULT_IN_SUBTHREAD && Looper.myLooper() == null) {
Looper.prepare();
z = true;
} else {
z = false;
}
if (a.this.i != null) {
a aVar = a.this;
d.this.a.removeCallbacks(aVar.i);
}
if (com.mbridge.msdk.e.b.a()) {
d dVar = d.this;
}
if (d.f.containsKey("0_" + a.this.unitId)) {
d.f.remove("0_" + a.this.unitId);
}
if (a.this.f > 0) {
if (campaignUnit.ads.size() > a.this.f) {
a aVar2 = a.this;
aVar2.c = aVar2.f;
} else {
a.this.c = campaignUnit.ads.size();
}
} else if (a.this.f == -1) {
a.this.c = 0;
} else if (a.this.f == -3) {
a.this.c = campaignUnit.ads.size();
} else if (a.this.f == -2) {
if (campaignUnit.getTemplate() == 3) {
if (a.this.e != 0) {
a aVar3 = a.this;
aVar3.c = aVar3.e;
}
} else if (a.this.d != 0) {
a aVar4 = a.this;
aVar4.c = aVar4.d;
}
if (a.this.c <= 0) {
a.this.c = ((Integer) d.i.get(a.this.unitId)).intValue();
}
}
if (campaignUnit.ads.size() < a.this.c) {
a.this.c = campaignUnit.ads.size();
}
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
for (int i = 0; i < campaignUnit.ads.size(); i++) {
CampaignEx campaignEx = campaignUnit.ads.get(i);
campaignEx.setCampaignUnitId(a.this.unitId);
boolean c = ak.c(com.mbridge.msdk.foundation.controller.c.m().c(), campaignEx.getPackageName());
d dVar2 = d.this;
com.mbridge.msdk.foundation.controller.c.m().c();
if (arrayList.size() < a.this.c && campaignEx.getOfferType() != 99) {
if (ak.c(campaignEx)) {
campaignEx.setRtinsType(c ? 1 : 2);
}
if (com.mbridge.msdk.foundation.same.c.a(com.mbridge.msdk.foundation.controller.c.m().c(), campaignEx)) {
arrayList.add(campaignEx);
if (!TextUtils.isEmpty(campaignEx.getVideoUrlEncode())) {
arrayList2.add(campaignEx);
}
} else {
ak.a(a.this.unitId, campaignEx, com.mbridge.msdk.foundation.same.a.x);
}
a.a(a.this, campaignEx, null, null);
}
d dVar3 = d.this;
dVar3.a(dVar3.t, campaignEx);
}
a aVar5 = a.this;
d.a(d.this, arrayList2, aVar5.unitId);
com.mbridge.msdk.mbnative.a.b<String, List<Campaign>> a = com.mbridge.msdk.mbnative.a.c.a(campaignUnit.getAds().get(0) != null ? campaignUnit.getAds().get(0).getType() : 1);
if (a != null) {
a.a((com.mbridge.msdk.mbnative.a.b<String, List<Campaign>>) a.this.unitId, (String) arrayList);
}
d.a(a.this.b, a.this.unitId);
if (Looper.myLooper() != null && z) {
Looper.loop();
}
if (campaignUnit.getAds().get(0) != null) {
com.mbridge.msdk.click.c.a(com.mbridge.msdk.foundation.controller.c.m().c(), campaignUnit.getAds().get(0).getMaitve(), campaignUnit.getAds().get(0).getMaitve_src());
}
}
}));
}
@Override // com.mbridge.msdk.mbnative.f.a.b
public final void a(final int i, final String str) {
d.this.a(new Thread(new Runnable() { // from class: com.mbridge.msdk.mbnative.controller.d.a.3
@Override // java.lang.Runnable
public final void run() {
boolean z;
if (MBridgeConstans.PRELOAD_RESULT_IN_SUBTHREAD && Looper.myLooper() == null) {
Looper.prepare();
z = true;
} else {
z = false;
}
if (!a.this.h) {
if (a.this.i != null) {
a aVar = a.this;
d.this.a.removeCallbacks(aVar.i);
}
if (a.this.b() == 1 || a.this.j) {
a aVar2 = a.this;
d dVar = d.this;
String str2 = str;
int b = aVar2.b();
a aVar3 = a.this;
dVar.a(str2, b, aVar3.unitId, aVar3.placementId, aVar3.k);
}
} else if (a.this.j) {
a aVar4 = a.this;
d dVar2 = d.this;
String str3 = str;
int b2 = aVar4.b();
a aVar5 = a.this;
dVar2.a(str3, b2, aVar5.unitId, aVar5.placementId, aVar5.k);
}
if (i == -1) {
d.b(a.this.b, a.this.unitId);
}
if (Looper.myLooper() == null || !z) {
return;
}
Looper.loop();
}
}));
}
@Override // com.mbridge.msdk.mbnative.f.a.b
public final void b(final List<Frame> list) {
d.this.a(new Thread(new Runnable() { // from class: com.mbridge.msdk.mbnative.controller.d.a.4
@Override // java.lang.Runnable
public final void run() {
boolean z;
if (MBridgeConstans.PRELOAD_RESULT_IN_SUBTHREAD && Looper.myLooper() == null) {
Looper.prepare();
z = true;
} else {
z = false;
}
if (!a.this.h && a.this.i != null) {
a aVar = a.this;
d.this.a.removeCallbacks(aVar.i);
}
List list2 = list;
if (list2 != null && list2.size() > 0) {
Iterator it = list.iterator();
while (it.hasNext()) {
for (CampaignEx campaignEx : ((Frame) it.next()).getCampaigns()) {
d dVar = d.this;
dVar.a(dVar.t, campaignEx);
}
}
HashMap hashMap = new HashMap();
hashMap.put(Long.valueOf(System.currentTimeMillis()), list);
if (d.f.containsKey("1_" + a.this.unitId)) {
d.f.remove("1_" + a.this.unitId);
}
d.f.put("1_" + a.this.unitId, hashMap);
}
if (Looper.myLooper() == null || !z) {
return;
}
Looper.loop();
}
}));
}
public static /* synthetic */ void a(a aVar, final CampaignEx campaignEx, com.mbridge.msdk.foundation.same.report.d.c cVar, final com.mbridge.msdk.foundation.same.report.d.a.a aVar2) {
try {
final Context c = com.mbridge.msdk.foundation.controller.c.m().c();
com.mbridge.msdk.foundation.same.c.a(campaignEx, c, cVar, new c.a() { // from class: com.mbridge.msdk.mbnative.controller.d.a.2
@Override // com.mbridge.msdk.foundation.same.c.a
public final void a(String str, com.mbridge.msdk.foundation.same.report.d.c cVar2) {
com.mbridge.msdk.mbnative.e.a.a(str, cVar2, campaignEx, c, aVar2);
}
});
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
e.printStackTrace();
}
}
}
}
public final void a(String str, int i2, String str2, String str3, com.mbridge.msdk.b.a.a aVar) {
Log.e(e, str);
try {
Queue<Integer> queue = this.b;
if (queue != null) {
if (queue.size() > 0) {
}
a(false, aVar, str);
}
if (this.b != null) {
a(i2, this.n, str2, str3, aVar);
return;
}
a(false, aVar, str);
} catch (Exception e2) {
if (MBridgeConstans.DEBUG) {
e2.printStackTrace();
}
}
}
public class b implements Runnable {
private int b;
private com.mbridge.msdk.foundation.same.e.d c;
private int d;
private String e;
private String f;
private com.mbridge.msdk.b.a.a g;
private boolean h = false;
public final void a(com.mbridge.msdk.b.a.a aVar) {
this.g = aVar;
}
public final void a(String str) {
this.e = str;
}
public final void a(boolean z) {
this.h = z;
}
public b(int i, com.mbridge.msdk.foundation.same.e.d dVar, int i2, String str, String str2) {
this.b = i;
this.c = dVar;
this.d = i2;
this.e = str;
this.f = str2;
}
@Override // java.lang.Runnable
public final void run() {
this.c.a(true);
int i = this.b;
if (i != 1) {
if (i != 2) {
return;
}
d.this.a("REQUEST_TIMEOUT", this.d, this.e, this.f, this.g);
} else {
d.this.w = true;
if (this.h || this.d == 1) {
d.this.a("REQUEST_TIMEOUT", this.d, this.e, this.f, this.g);
}
}
}
}
public final void a(boolean z, com.mbridge.msdk.b.a.a aVar, String str) {
if (z) {
if (aVar == null || aVar.a()) {
return;
}
aVar.a(true);
aVar.onPreloadSucceed();
return;
}
if (aVar == null || aVar.a()) {
return;
}
aVar.a(true);
aVar.onPreloadFaild(str);
}
public final void a(boolean z, Campaign campaign) {
if (campaign == null) {
return;
}
if (z && campaign.getIconDrawable() == null) {
campaign.loadIconUrlAsyncWithBlock(null);
}
if (z && campaign.getBigDrawable() == null) {
campaign.loadImageUrlAsyncWithBlock(null);
}
}
public final void a(Thread thread) {
if (!MBridgeConstans.PRELOAD_RESULT_IN_SUBTHREAD) {
thread.run();
} else {
thread.start();
}
}
public static /* synthetic */ void a(d dVar, List list, String str) {
if (list != null) {
try {
if (list.size() > 0) {
try {
int i2 = MBMediaView.$r8$clinit;
Object invoke = com.mbridge.msdk.videocommon.download.b.class.getMethod("getInstance", new Class[0]).invoke(null, new Object[0]);
if (invoke != null) {
com.mbridge.msdk.videocommon.download.b.class.getMethod("createUnitCache", Context.class, String.class, CopyOnWriteArrayList.class, Integer.TYPE, com.mbridge.msdk.videocommon.listener.a.class).invoke(invoke, com.mbridge.msdk.foundation.controller.c.m().c(), str, new CopyOnWriteArrayList(list), 1, null);
com.mbridge.msdk.videocommon.download.b.class.getMethod("load", String.class).invoke(invoke, str);
}
} catch (Exception unused) {
af.b(e, "please import the videocommon aar");
}
}
} catch (Exception e2) {
af.b(e, com.mbridge.msdk.mbnative.b.a.a(e2));
}
}
}
}

View File

@@ -0,0 +1,33 @@
package com.mbridge.msdk.mbnative.controller;
import android.content.Context;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.db.g;
import com.mbridge.msdk.foundation.db.o;
import com.mbridge.msdk.foundation.entity.n;
import com.mbridge.msdk.foundation.tools.af;
import java.util.List;
/* loaded from: classes4.dex */
public class e {
private static final String a = "com.mbridge.msdk.mbnative.controller.e";
public static void a(Context context, String str) {
if (context != null) {
try {
o a2 = o.a(g.a(context));
if (TextUtils.isEmpty(str) || a2 == null || a2.a() <= 0) {
return;
}
List<n> a3 = a2.a("m_download_end");
List<n> a4 = a2.a("2000021");
List<n> a5 = a2.a("m_download_end");
com.mbridge.msdk.foundation.same.report.n.e(a4);
com.mbridge.msdk.foundation.same.report.n.a(a3);
com.mbridge.msdk.foundation.same.report.n.b(a5);
} catch (Exception e) {
af.b(a, e.getMessage());
}
}
}
}

View File

@@ -0,0 +1,38 @@
package com.mbridge.msdk.mbnative.controller;
import android.R;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import androidx.core.view.ViewCompat;
/* loaded from: classes4.dex */
public final class f {
private static View a(View view) {
if (view == null) {
return null;
}
try {
ViewCompat.isAttachedToWindow(view);
} catch (Throwable unused) {
}
try {
View rootView = view.getRootView();
if (rootView == null) {
return null;
}
View findViewById = rootView.findViewById(R.id.content);
return findViewById != null ? findViewById : rootView;
} catch (Throwable unused2) {
return null;
}
}
public static View a(Context context, View view) {
View view2 = null;
if (context != null && (context instanceof Activity)) {
view2 = ((Activity) context).getWindow().getDecorView().findViewById(R.id.content);
}
return view2 != null ? view2 : a(view);
}
}

View File

@@ -0,0 +1,119 @@
package com.mbridge.msdk.mbnative.d;
import android.content.Context;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.Frame;
import com.mbridge.msdk.out.NativeListener;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/* loaded from: classes4.dex */
public class a implements NativeListener.NativeAdListener {
private static final String a = "a";
private NativeListener.NativeAdListener b;
private boolean c = false;
private String d;
private Context e;
private boolean f;
public final void a(String str) {
this.d = str;
}
public final void a(boolean z) {
this.f = z;
}
public final boolean a() {
return this.c;
}
public final void b() {
this.c = true;
}
public a() {
}
public a(NativeListener.NativeAdListener nativeAdListener) {
this.b = nativeAdListener;
}
@Override // com.mbridge.msdk.out.NativeListener.NativeAdListener
public void onAdLoaded(List<Campaign> list, int i) {
CopyOnWriteArrayList copyOnWriteArrayList;
try {
this.c = false;
synchronized (list) {
copyOnWriteArrayList = new CopyOnWriteArrayList(list);
}
if (this.b != null) {
if (copyOnWriteArrayList.size() > 0) {
this.b.onAdLoaded(copyOnWriteArrayList, i);
} else {
this.b.onAdLoaded(list, i);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public final void a(CampaignEx campaignEx, String str) {
this.c = false;
NativeListener.NativeAdListener nativeAdListener = this.b;
if (nativeAdListener != null) {
nativeAdListener.onAdLoadError(str);
if (this.e == null) {
this.e = c.m().c();
}
if (TextUtils.isEmpty(this.d)) {
return;
}
com.mbridge.msdk.mbnative.e.a.a(this.e, str, this.d, this.f, campaignEx);
}
}
@Override // com.mbridge.msdk.out.NativeListener.NativeAdListener
public void onAdLoadError(String str) {
this.c = false;
NativeListener.NativeAdListener nativeAdListener = this.b;
if (nativeAdListener != null) {
nativeAdListener.onAdLoadError(str);
if (this.e == null) {
this.e = c.m().c();
}
if (TextUtils.isEmpty(this.d)) {
return;
}
com.mbridge.msdk.mbnative.e.a.a(this.e, str, this.d, this.f, (CampaignEx) null);
}
}
@Override // com.mbridge.msdk.out.NativeListener.NativeAdListener
public void onAdClick(Campaign campaign) {
NativeListener.NativeAdListener nativeAdListener = this.b;
if (nativeAdListener != null) {
nativeAdListener.onAdClick(campaign);
}
}
@Override // com.mbridge.msdk.out.NativeListener.NativeAdListener
public void onAdFramesLoaded(List<Frame> list) {
NativeListener.NativeAdListener nativeAdListener = this.b;
if (nativeAdListener != null) {
nativeAdListener.onAdFramesLoaded(list);
}
}
@Override // com.mbridge.msdk.out.NativeListener.NativeAdListener
public void onLoggingImpression(int i) {
NativeListener.NativeAdListener nativeAdListener = this.b;
if (nativeAdListener != null) {
nativeAdListener.onLoggingImpression(i);
}
}
}

View File

@@ -0,0 +1,64 @@
package com.mbridge.msdk.mbnative.e;
import android.content.Context;
import android.text.TextUtils;
import com.facebook.appevents.UserDataStore;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.download.core.DownloadCommon;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.d.c;
import com.mbridge.msdk.foundation.same.report.d.d;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.mbbid.common.BidResponsedEx;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class a {
public static void a(Context context, String str, String str2, boolean z, CampaignEx campaignEx) {
if (context != null) {
try {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
return;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put("key", "2000047");
jSONObject.put("network_type", ab.m(context));
jSONObject.put(MBridgeConstans.PROPERTIES_UNIT_ID, str2);
jSONObject.put(UserDataStore.STATE, System.currentTimeMillis());
if (campaignEx != null) {
jSONObject.put(BidResponsedEx.KEY_CID, campaignEx.getId());
jSONObject.put("adtp", campaignEx.getAdType());
jSONObject.put("rid", campaignEx.getRequestId());
jSONObject.put("rid_n", campaignEx.getRequestIdNotice());
}
if (!TextUtils.isEmpty(str2)) {
String str3 = com.mbridge.msdk.foundation.controller.a.b.get(str2);
if (str3 == null) {
str3 = "";
}
jSONObject.put("u_stid", str3);
}
if (!TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.V)) {
jSONObject.put(DownloadCommon.DOWNLOAD_REPORT_FIND_FILE_RESULT_VALUE_B, com.mbridge.msdk.foundation.same.a.V);
}
if (!TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.g)) {
jSONObject.put("c", com.mbridge.msdk.foundation.same.a.g);
}
jSONObject.put("hb", z ? 1 : 0);
jSONObject.put("reason", str);
d.a().a(jSONObject);
} catch (Throwable th) {
af.b("NativeReport", th.getMessage());
}
}
}
public static void a(String str, c cVar, CampaignEx campaignEx, Context context, com.mbridge.msdk.foundation.same.report.d.a.a aVar) {
try {
d.a().a(str, cVar, campaignEx, context, aVar);
} catch (Exception e) {
af.b("NativeReport", e.getMessage());
}
}
}

View File

@@ -0,0 +1,151 @@
package com.mbridge.msdk.mbnative.e;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.mbridge.msdk.c.g;
import com.mbridge.msdk.c.h;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.db.j;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.mbnative.controller.NativeController;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
/* loaded from: classes4.dex */
public final class b {
public static synchronized void a(CampaignEx campaignEx, Context context, String str, com.mbridge.msdk.mbnative.d.a aVar) {
boolean z;
int i;
synchronized (b.class) {
if (campaignEx == null) {
return;
}
try {
g a = h.a().a(c.m().k());
if (a != null) {
z = a.u() == 1;
} else {
z = true;
}
if (!campaignEx.isReport()) {
campaignEx.setReport(true);
a(campaignEx, context, str);
a(campaignEx, context, str, aVar, z);
List<String> a2 = a(campaignEx);
if (a2 != null && a2.size() != 0) {
int i2 = 0;
while (i2 < a2.size()) {
String str2 = a2.get(i2);
if (TextUtils.isEmpty(str2)) {
i = i2;
} else {
i = i2;
com.mbridge.msdk.click.a.a(context, campaignEx, str, str2, false, false);
}
i2 = i + 1;
}
}
b(campaignEx, context, str);
}
if (aVar != null && !campaignEx.isCallBackImpression()) {
if (!z) {
try {
aVar.onLoggingImpression(campaignEx.getType());
} catch (Exception e) {
Log.e("NativeReportUtils", e.getMessage());
}
}
campaignEx.setCallBackImpression(true);
}
} catch (Throwable th) {
throw th;
}
}
}
private static synchronized void a(final CampaignEx campaignEx, final Context context, String str) {
synchronized (b.class) {
try {
c.m().a(context);
if (!TextUtils.isEmpty(campaignEx.getImpressionURL())) {
com.mbridge.msdk.foundation.same.f.a.b().execute(new Runnable() { // from class: com.mbridge.msdk.mbnative.e.b.1
@Override // java.lang.Runnable
public final void run() {
try {
j.a(com.mbridge.msdk.foundation.db.g.a(context)).a(campaignEx.getId());
} catch (Exception unused) {
af.b("NativeReportUtils", "campain can't insert db");
}
}
});
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getImpressionURL(), false, true, com.mbridge.msdk.click.a.a.g);
}
if (!TextUtils.isEmpty(str) && campaignEx.getNativeVideoTracking() != null && campaignEx.getNativeVideoTracking().p() != null) {
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getNativeVideoTracking().p(), false, false);
}
} catch (Throwable th) {
throw th;
}
}
}
private static synchronized void b(CampaignEx campaignEx, Context context, String str) {
synchronized (b.class) {
if (campaignEx != null) {
try {
List<String> pv_urls = campaignEx.getPv_urls();
if (pv_urls != null && pv_urls.size() > 0) {
Iterator<String> it = pv_urls.iterator();
while (it.hasNext()) {
com.mbridge.msdk.click.a.a(context, campaignEx, str, it.next(), false, true);
}
}
} finally {
}
}
}
}
private static synchronized void a(CampaignEx campaignEx, Context context, String str, com.mbridge.msdk.mbnative.d.a aVar, boolean z) {
Map<String, Long> map;
synchronized (b.class) {
if (!TextUtils.isEmpty(campaignEx.getOnlyImpressionURL()) && (map = NativeController.b) != null && !map.containsKey(campaignEx.getOnlyImpressionURL())) {
if (z && aVar != null) {
try {
aVar.onLoggingImpression(campaignEx.getAdType());
} catch (Exception e) {
Log.e("NativeReportUtils", e.getMessage());
}
}
NativeController.b.put(campaignEx.getOnlyImpressionURL(), Long.valueOf(System.currentTimeMillis()));
com.mbridge.msdk.click.a.a(context, campaignEx, str, campaignEx.getOnlyImpressionURL(), false, true, com.mbridge.msdk.click.a.a.h);
}
}
}
private static List<String> a(CampaignEx campaignEx) {
ArrayList arrayList = new ArrayList();
if (campaignEx == null) {
return arrayList;
}
String ad_url_list = campaignEx.getAd_url_list();
if (TextUtils.isEmpty(ad_url_list)) {
return arrayList;
}
try {
JSONArray jSONArray = new JSONArray(ad_url_list);
for (int i = 0; i < jSONArray.length(); i++) {
arrayList.add((String) jSONArray.get(i));
}
} catch (JSONException e) {
e.printStackTrace();
}
return arrayList;
}
}

View File

@@ -0,0 +1,153 @@
package com.mbridge.msdk.mbnative.f;
import android.content.Context;
import android.content.res.Resources;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import com.mbridge.msdk.foundation.tools.ad;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.mbnative.controller.NativeController;
import com.mbridge.msdk.mbnative.controller.d;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.NativeListener;
import java.util.List;
import java.util.Map;
/* loaded from: classes4.dex */
public class a {
private NativeController a;
private Handler b = new Handler(Looper.getMainLooper());
private com.mbridge.msdk.mbnative.d.a c;
private NativeListener.NativeTrackingListener d;
public final void a(com.mbridge.msdk.mbnative.d.a aVar) {
this.c = aVar;
}
public final void a(NativeListener.NativeTrackingListener nativeTrackingListener) {
this.d = nativeTrackingListener;
}
public a() {
}
public a(com.mbridge.msdk.mbnative.d.a aVar, NativeListener.NativeTrackingListener nativeTrackingListener) {
this.c = aVar;
this.d = nativeTrackingListener;
}
public final void a(Context context, Resources resources, Map<String, Object> map) {
this.a = new NativeController(this.c, this.d, map, context);
}
public final void a() {
a(0, "");
}
public final void a(String str) {
a(0, str);
}
public final void b() {
a(1, "");
}
public final void d() {
try {
this.a.a();
} catch (Exception unused) {
af.b("NativeProvider", "release failed");
}
}
public final void a(View view, List<View> list, Campaign campaign) {
NativeController nativeController = this.a;
if (nativeController == null) {
return;
}
nativeController.a(campaign, view, list);
}
public final void a(View view, Campaign campaign) {
af.c("NativeProvider", "native provider registerView");
NativeController nativeController = this.a;
if (nativeController == null) {
return;
}
nativeController.a(campaign, view);
}
public final void b(View view, Campaign campaign) {
af.c("NativeProvider", "native provider unregisterView");
NativeController nativeController = this.a;
if (nativeController == null) {
return;
}
nativeController.b(campaign, view);
}
public final void b(View view, List<View> list, Campaign campaign) {
af.c("NativeProvider", "native provider unregisterView");
NativeController nativeController = this.a;
if (nativeController == null) {
return;
}
nativeController.b(campaign, view, list);
}
public static void preload(Map<String, Object> map, int i) {
af.c("NativeProvider", "native provider preload");
new d().a(map, i);
}
/* JADX INFO: Access modifiers changed from: private */
public void g() {
this.c.onAdLoadError("current request is loading");
this.c.b();
}
private void a(int i, String str) {
if (this.a != null) {
com.mbridge.msdk.mbnative.d.a aVar = this.c;
if (aVar != null && aVar.a()) {
if (ak.g()) {
g();
return;
} else {
this.b.post(new Runnable() { // from class: com.mbridge.msdk.mbnative.f.a.1
@Override // java.lang.Runnable
public final void run() {
a.this.g();
}
});
return;
}
}
com.mbridge.msdk.mbnative.d.a aVar2 = this.c;
if (aVar2 != null) {
aVar2.b();
}
this.a.a(i, str);
}
}
public final String e() {
NativeController nativeController = this.a;
return nativeController != null ? nativeController.b() : "";
}
public final String f() {
NativeController nativeController = this.a;
return nativeController != null ? nativeController.c() : "";
}
public final void c() {
try {
ad.b();
} catch (Exception unused) {
af.b("NativeProvider", "clear cache failed");
}
}
}

View File

@@ -0,0 +1,45 @@
package com.mbridge.msdk.mbnative.f.a;
import android.content.Context;
import android.os.Build;
import com.mbridge.msdk.foundation.same.net.f.e;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.f;
import com.mbridge.msdk.foundation.tools.k;
import com.mbridge.msdk.out.MBConfiguration;
/* loaded from: classes4.dex */
public final class a extends com.mbridge.msdk.foundation.same.net.f.b {
public a(Context context) {
super(context);
}
@Override // com.mbridge.msdk.foundation.same.net.f.a, com.mbridge.msdk.foundation.same.net.f.c
public final void addExtraParams(String str, e eVar) {
super.addExtraParams(str, eVar);
eVar.a("platform", "1");
eVar.a("os_version", Build.VERSION.RELEASE);
eVar.a("package_name", ab.f(this.mContext));
eVar.a("app_version_name", ab.q(this.mContext));
eVar.a("app_version_code", ab.r(this.mContext) + "");
eVar.a("orientation", ab.s(this.mContext) + "");
eVar.a("model", ab.h());
eVar.a("brand", ab.x());
eVar.a("gaid", "");
eVar.a("gaid2", f.b());
int m = ab.m(this.mContext);
eVar.a("network_type", m + "");
eVar.a("network_str", ab.a(this.mContext, m) + "");
eVar.a("language", ab.t(this.mContext));
eVar.a("timezone", ab.y());
eVar.a("useragent", ab.g());
eVar.a("sdk_version", MBConfiguration.SDK_VERSION);
eVar.a("screen_size", ab.j(this.mContext) + "x" + ab.h(this.mContext));
if (com.mbridge.msdk.e.b.a()) {
eVar.a("gp_version", k.d(this.mContext));
}
com.mbridge.msdk.foundation.same.net.f.f.a(eVar, this.mContext);
com.mbridge.msdk.foundation.same.net.f.f.a(eVar);
com.mbridge.msdk.foundation.same.net.f.f.e(eVar);
}
}

View File

@@ -0,0 +1,118 @@
package com.mbridge.msdk.mbnative.f.a;
import com.mbridge.msdk.foundation.entity.CampaignUnit;
import com.mbridge.msdk.foundation.same.net.c;
import com.mbridge.msdk.foundation.same.net.d;
import com.mbridge.msdk.out.Frame;
import com.mbridge.msdk.tracker.network.h;
import java.util.List;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public abstract class b extends c<JSONObject> {
private static final String a = "b";
private int b;
private String c;
public final String a() {
return this.c;
}
public abstract void a(int i, String str);
public final void a(String str) {
this.c = str;
}
public abstract void a(List<h> list, CampaignUnit campaignUnit);
public final int b() {
return this.b;
}
public abstract void b(List<Frame> list);
public final void e(int i) {
this.b = i;
}
@Override // com.mbridge.msdk.foundation.same.net.c
public void onPreExecute() {
super.onPreExecute();
}
@Override // com.mbridge.msdk.foundation.same.net.c, com.mbridge.msdk.foundation.same.net.b
public void onSuccess(d<JSONObject> dVar) {
com.mbridge.msdk.foundation.same.net.d.a aVar;
CampaignUnit parseCampaignUnit;
super.onSuccess(dVar);
if (dVar == null || (aVar = dVar.b) == null) {
return;
}
int i = this.b;
if (i == 0) {
final List<h> list = aVar.b;
final JSONObject jSONObject = dVar.c;
final int optInt = jSONObject.optInt("status");
if (1 == optInt) {
calcRequestTime(System.currentTimeMillis());
final String optString = jSONObject.optString("version");
com.mbridge.msdk.foundation.same.f.a.b().execute(new Runnable() { // from class: com.mbridge.msdk.mbnative.f.a.b.1
@Override // java.lang.Runnable
public final void run() {
final CampaignUnit parseCampaignUnit2;
if ("v5".equals(optString)) {
parseCampaignUnit2 = com.mbridge.msdk.foundation.entity.b.parseV5CampaignUnit(jSONObject.optJSONObject("data"));
} else {
parseCampaignUnit2 = com.mbridge.msdk.foundation.entity.b.parseCampaignUnit(jSONObject.optJSONObject("data"));
}
com.mbridge.msdk.foundation.same.f.a.c().post(new Runnable() { // from class: com.mbridge.msdk.mbnative.f.a.b.1.1
@Override // java.lang.Runnable
public final void run() {
CampaignUnit campaignUnit = parseCampaignUnit2;
if (campaignUnit != null && campaignUnit.getAds() != null && parseCampaignUnit2.getAds().size() > 0) {
AnonymousClass1 anonymousClass1 = AnonymousClass1.this;
b.this.a(list, parseCampaignUnit2);
b.this.saveRequestTime(parseCampaignUnit2.getAds().size());
} else {
AnonymousClass1 anonymousClass12 = AnonymousClass1.this;
b.this.a(optInt, jSONObject.optString("msg"));
}
}
});
}
});
return;
}
a(optInt, jSONObject.optString("msg"));
return;
}
if (i == 1) {
List<h> list2 = aVar.b;
JSONObject jSONObject2 = dVar.c;
int optInt2 = jSONObject2.optInt("status");
if (1 == optInt2) {
calcRequestTime(System.currentTimeMillis());
if ("v5".equals(jSONObject2.optString("version"))) {
parseCampaignUnit = com.mbridge.msdk.foundation.entity.b.parseV5CampaignUnit(jSONObject2.optJSONObject("data"));
} else {
parseCampaignUnit = com.mbridge.msdk.foundation.entity.b.parseCampaignUnit(jSONObject2.optJSONObject("data"));
}
if (parseCampaignUnit != null && parseCampaignUnit.getListFrames() != null && parseCampaignUnit.getListFrames().size() > 0) {
b(parseCampaignUnit.getListFrames());
saveRequestTime(parseCampaignUnit.getListFrames().size());
return;
} else {
a(optInt2, jSONObject2.optString("msg"));
return;
}
}
a(optInt2, jSONObject2.optString("msg"));
}
}
@Override // com.mbridge.msdk.foundation.same.net.c, com.mbridge.msdk.foundation.same.net.b
public void onError(com.mbridge.msdk.foundation.same.net.a.a aVar) {
a(aVar.a, com.mbridge.msdk.foundation.same.net.e.a.a(aVar));
}
}