package com.lockscreen.news.b; import android.content.Context; import com.lockscreen.news.bean.Ads; import com.lockscreen.news.bean.News; import com.lockscreen.news.c.b; import com.lockscreen.news.c.c; import com.lockscreen.news.e.g; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; /* compiled from: AdModel */ public class a { public static void a(Context context, int i, final b<ArrayList<Ads>> bVar) { Map<String, String> b = com.lockscreen.news.c.a.b(context); b.put("mStyle", "003"); b.put("mCount", i + ""); String b2 = com.lockscreen.news.d.a.a().b(); if (!g.a(b2)) { b.put("passBack", b2); } c.a(context).a(Integer.valueOf(context.hashCode()), "https://adsbrefrigerator.tt.cn/export/VSqqAf.api", b, new b<String>() { /* class com.lockscreen.news.b.a.AnonymousClass1 */ public void a(String str) { if (g.a(str)) { bVar.a(null, null); return; } a.b(str); bVar.a(com.lockscreen.news.e.a.a(str)); } @Override // com.lockscreen.news.c.b public void a(String str, String str2) { bVar.a(str, str2); } }); } /* access modifiers changed from: private */ public static void b(String str) { if (!g.a(str)) { try { com.lockscreen.news.d.a.a().a(new JSONObject(str).optString("passBack")); } catch (JSONException e) { e.printStackTrace(); } } } public static News a(Ads ads, int i, int i2) { if (g.a(ads)) { return null; } ads.a(i); ads.b(i2); News news = new News(); news.a(ads); String h = ads.h(); if (g.a("001", h)) { news.a(1); news.a(ads.e()); } else if (g.a("002", h)) { news.a(0); news.b(ads.e()); } else if (g.a("003", h)) { news.a(2); news.b(ads.e()); } else { news.a(2); news.b(ads.e()); } news.J(ads.m()); news.E(ads.k()); news.K(ads.g()); return news; } public static void a(Context context, Ads ads) { if (!g.a((Object) context) && !g.a(ads)) { a(context, ads.j(), ads.o(), ads.p()); } } public static void b(Context context, Ads ads) { if (!g.a((Object) context) && !g.a(ads)) { a(context, ads.f(), ads.o(), ads.p()); } } public static void c(Context context, Ads ads) { if (!g.a((Object) context) && !g.a(ads)) { a(context, ads.a(), ads.o(), ads.p()); } } public static void d(Context context, Ads ads) { if (!g.a((Object) context) && !g.a(ads)) { a(context, ads.l(), ads.o(), ads.p()); } } public static void e(Context context, Ads ads) { if (!g.a((Object) context) && !g.a(ads)) { a(context, ads.d(), ads.o(), ads.p()); } } private static void a(Context context, List<String> list, int i, int i2) { if (!g.a((Collection) list)) { Iterator<String> it = list.iterator(); while (it.hasNext()) { String next = it.next(); if (!g.a(next)) { if (next.contains("___pageNum___")) { next = next.replace("___pageNum___", i + ""); } if (next.contains("___pageIndex___")) { next = next.replace("___pageIndex___", i2 + ""); } c.a(context).a(Integer.valueOf(context.hashCode()), next, new b<String>() { /* class com.lockscreen.news.b.a.AnonymousClass2 */ public void a(String str) { } @Override // com.lockscreen.news.c.b public void a(String str, String str2) { } }); } } } } }