package ae0; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.text.TextUtils; import android.widget.RemoteViews; import com.meituan.robust.ChangeQuickRedirect; import com.meituan.robust.PatchProxy; import com.sensorsdata.analytics.android.sdk.aop.push.PushAutoTrackHelper; import com.shizhuang.duapp.R; import com.shizhuang.duapp.modules.home.model.DrawBoxInfo; import com.shizhuang.duapp.modules.home.model.GameWidgetInfo; import com.shizhuang.duapp.modules.home.utils.appwidget.IWidgetInflater; import com.shizhuang.duapp.modules.home.widget.DrawBoxWidget; import com.shizhuang.duapp.modules.home.widget.GameCombineWidget; import java.util.List; /* compiled from: HonorWidgetInflater */ public class k implements IWidgetInflater { public static ChangeQuickRedirect changeQuickRedirect; public final void a(RemoteViews remoteViews, Context context, AppWidgetManager appWidgetManager, ComponentName componentName) { if (!PatchProxy.proxy(new Object[]{remoteViews, context, appWidgetManager, componentName}, this, changeQuickRedirect, false, 157379, new Class[]{RemoteViews.class, Context.class, AppWidgetManager.class, ComponentName.class}, Void.TYPE).isSupported) { remoteViews.setImageViewResource(R.id.ivContainer_fit_xy, R.drawable.widget_game_combine_bg_honor); remoteViews.setViewVisibility(R.id.tvTitle, 0); remoteViews.setViewVisibility(R.id.tvSubTitle, 0); remoteViews.setViewVisibility(R.id.ivLogo, 0); remoteViews.setViewVisibility(R.id.ivDrawBoxRoot, 0); remoteViews.setViewVisibility(R.id.ivCollectionRoot, 0); remoteViews.setViewVisibility(R.id.ivZeroDrawRoot, 0); remoteViews.setViewVisibility(R.id.gift, 0); Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(String.format("%s%s", "dewuwidget://com.shizhuang.duapp.game.widget?jumpUrl=", "https://m.poizon.com/router/web/BrowserPage?loadUrl=https%3A%2F%2Fm.dewu.com%2Frn-activity%2Fdaily-blind-box%3Fid%3D1%26navControl%3D1"))); PushAutoTrackHelper.hookIntentGetActivity(context, -4, intent, 134217728); PendingIntent activity = PendingIntent.getActivity(context, -4, intent, 134217728); PushAutoTrackHelper.hookPendingIntentGetActivity(activity, context, -4, intent, 134217728); remoteViews.setOnClickPendingIntent(R.id.rlGameCombine, activity); appWidgetManager.updateAppWidget(componentName, remoteViews); } } @Override // com.shizhuang.duapp.modules.home.utils.appwidget.IWidgetInflater public void inflaterBoxWidget(Context context, AppWidgetManager appWidgetManager, DrawBoxInfo drawBoxInfo) { String str; if (!PatchProxy.proxy(new Object[]{context, appWidgetManager, drawBoxInfo}, this, changeQuickRedirect, false, 157378, new Class[]{Context.class, AppWidgetManager.class, DrawBoxInfo.class}, Void.TYPE).isSupported) { String str2 = "潮流世界"; if (drawBoxInfo == null || drawBoxInfo.getStatus() == null) { str = "https://m.poizon.com/router/web/BrowserPage?loadUrl=https%3A%2F%2Fm.dewu.com%2Frn-activity%2Fdaily-blind-box%3Fid%3D1%26navControl%3D1"; } else { str = drawBoxInfo.getRedirectUrl(); int intValue = drawBoxInfo.getStatus().intValue(); if (intValue == 0) { str2 = "登录得物"; } else if (intValue != 1) { if (intValue == 2) { str2 = String.format("可免费拆%s次", drawBoxInfo.getChanceNum()); } else if (intValue == 3) { str2 = "可拆出潮物"; } } } RemoteViews remoteViews = new RemoteViews(context.getPackageName(), (int) R.layout.draw_box_widget); remoteViews.removeAllViews(R.id.normal); remoteViews.setViewVisibility(R.id.honor, 0); Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(String.format("%s%s&code=%s", "dewuwidget://com.shizhuang.duapp.game.widget?jumpUrl=", str, "DRAW_BOX"))); PushAutoTrackHelper.hookIntentGetActivity(context, -5, intent, 134217728); PendingIntent activity = PendingIntent.getActivity(context, -5, intent, 134217728); PushAutoTrackHelper.hookPendingIntentGetActivity(activity, context, -5, intent, 134217728); remoteViews.setOnClickPendingIntent(R.id.flDrawBox, activity); remoteViews.setTextViewText(R.id.drawBoxTitle, "拆盲盒"); remoteViews.setTextViewText(R.id.drawBoxSubTitle, str2); appWidgetManager.updateAppWidget(new ComponentName(context.getApplicationContext(), DrawBoxWidget.class), remoteViews); } } /* JADX WARNING: Removed duplicated region for block: B:37:0x00c6 */ /* JADX WARNING: Removed duplicated region for block: B:42:0x00e6 */ @Override // com.shizhuang.duapp.modules.home.utils.appwidget.IWidgetInflater public void inflaterGameWidget(Context context, AppWidgetManager appWidgetManager) { RemoteViews remoteViews; ComponentName componentName; String str; String str2; String str3; String str4; String str5; int i; char c5; if (!PatchProxy.proxy(new Object[]{context, appWidgetManager}, this, changeQuickRedirect, false, 157377, new Class[]{Context.class, AppWidgetManager.class}, Void.TYPE).isSupported) { RemoteViews remoteViews2 = new RemoteViews(context.getPackageName(), (int) R.layout.game_combine_widget); ComponentName componentName2 = new ComponentName(context.getApplicationContext(), GameCombineWidget.class); remoteViews2.removeAllViews(R.id.normal); remoteViews2.setViewVisibility(R.id.honor, 0); try { if (zd0.k.f40661c == null) { zd0.k.f40661c = zd0.k.d(); } GameWidgetInfo gameWidgetInfo = zd0.k.f40661c; if (gameWidgetInfo != null) { List<GameWidgetInfo.GameWidgetIcon> booths = gameWidgetInfo.getBooths(); String str6 = null; if (booths != null) { str3 = null; str2 = null; String str7 = null; String str8 = null; str = null; for (GameWidgetInfo.GameWidgetIcon gameWidgetIcon : booths) { if (!(gameWidgetIcon == null || gameWidgetIcon.getCode() == null)) { String code = gameWidgetIcon.getCode(); int hashCode = code.hashCode(); if (hashCode != 2112) { if (hashCode != 76522) { if (hashCode == 77103 && code.equals("NCD")) { c5 = 1; if (c5 != 0) { str6 = gameWidgetIcon.getRouterUrl(); str7 = gameWidgetIcon.getIcon(); } else if (c5 == 1) { str3 = gameWidgetIcon.getRouterUrl(); str = gameWidgetIcon.getIcon(); } else if (c5 == 2) { str2 = gameWidgetIcon.getRouterUrl(); str8 = gameWidgetIcon.getIcon(); } } } else if (code.equals("N0L")) { c5 = 2; if (c5 != 0) { } } } else if (code.equals("BB")) { c5 = 0; if (c5 != 0) { } } c5 = 65535; if (c5 != 0) { } } } str5 = str6; str6 = str7; str4 = str8; } else { str5 = null; str4 = null; str3 = null; str2 = null; str = null; } Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(String.format("%s%s&code=%s", "dewuwidget://com.shizhuang.duapp.game.widget?jumpUrl=", str5, "BB"))); PushAutoTrackHelper.hookIntentGetActivity(context, -1, intent, 134217728); PendingIntent activity = PendingIntent.getActivity(context, -1, intent, 134217728); PushAutoTrackHelper.hookPendingIntentGetActivity(activity, context, -1, intent, 134217728); Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(String.format("%s%s&code=%s", "dewuwidget://com.shizhuang.duapp.game.widget?jumpUrl=", str3, "NCD"))); PushAutoTrackHelper.hookIntentGetActivity(context, -2, intent2, 134217728); PendingIntent activity2 = PendingIntent.getActivity(context, -2, intent2, 134217728); PushAutoTrackHelper.hookPendingIntentGetActivity(activity2, context, -2, intent2, 134217728); Intent intent3 = new Intent("android.intent.action.VIEW", Uri.parse(String.format("%s%s&code=%s", "dewuwidget://com.shizhuang.duapp.game.widget?jumpUrl=", str2, "N0L"))); PushAutoTrackHelper.hookIntentGetActivity(context, -3, intent3, 134217728); PendingIntent activity3 = PendingIntent.getActivity(context, -3, intent3, 134217728); PushAutoTrackHelper.hookPendingIntentGetActivity(activity3, context, -3, intent3, 134217728); Intent intent4 = new Intent("android.intent.action.VIEW", Uri.parse(String.format("%s%s&code=%s", "dewuwidget://com.shizhuang.duapp.game.widget?jumpUrl=", zd0.k.f40661c.getRouterUrl(), "MAIN"))); PushAutoTrackHelper.hookIntentGetActivity(context, -4, intent4, 134217728); PendingIntent activity4 = PendingIntent.getActivity(context, -4, intent4, 134217728); PushAutoTrackHelper.hookPendingIntentGetActivity(activity4, context, -4, intent4, 134217728); remoteViews2.setOnClickPendingIntent(R.id.ivDrawBoxRoot, activity); remoteViews2.setOnClickPendingIntent(R.id.ivCollectionRoot, activity2); remoteViews2.setOnClickPendingIntent(R.id.ivZeroDrawRoot, activity3); remoteViews2.setOnClickPendingIntent(R.id.rlGameCombine, activity4); if (!TextUtils.isEmpty(str5)) { i = 0; remoteViews2.setViewVisibility(R.id.ivDrawBoxRoot, 0); } else { i = 0; remoteViews2.setViewVisibility(R.id.ivDrawBoxRoot, 8); } if (!TextUtils.isEmpty(str3)) { remoteViews2.setViewVisibility(R.id.ivCollectionRoot, i); } else { remoteViews2.setViewVisibility(R.id.ivCollectionRoot, 8); } if (!TextUtils.isEmpty(str2)) { remoteViews2.setViewVisibility(R.id.ivZeroDrawRoot, i); } else { remoteViews2.setViewVisibility(R.id.ivZeroDrawRoot, 8); } componentName = componentName2; remoteViews = remoteViews2; try { zd0.k.c().f40662a.execute(new h(str6, str, str4, remoteViews2, appWidgetManager, componentName)); } catch (Exception unused) { a(remoteViews, context, appWidgetManager, componentName); } } else { a(remoteViews2, context, appWidgetManager, componentName2); } } catch (Exception unused2) { componentName = componentName2; remoteViews = remoteViews2; a(remoteViews, context, appWidgetManager, componentName); } } } }