APKPure.apk(点击下载) / c.java


package e.f.a.e;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.PictureDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RSRuntimeException;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.toolbox.ImageRequest;
import com.apkpure.aegon.R;
import com.apkpure.aegon.app.model.Asset;
import com.apkpure.aegon.app.model.AssetInfo;
import com.apkpure.aegon.app.newcard.AppCard;
import com.apkpure.aegon.app.newcard.impl.ExplorationEnterTranslateCategoryCard;
import com.apkpure.aegon.app.newcard.model.AppCardData;
import com.apkpure.aegon.application.AegonApplication;
import com.apkpure.aegon.application.RealApplicationLike;
import com.apkpure.aegon.cms.activity.CommonActivity;
import com.apkpure.aegon.cms.adapter.MultipleItemCMSAdapter;
import com.apkpure.aegon.db.table.PopupRecord;
import com.apkpure.aegon.download.model.UploadApkParam;
import com.apkpure.aegon.main.activity.MainTabActivity;
import com.apkpure.aegon.pages.CMSFragment;
import com.apkpure.aegon.post.model.CommentParamV2;
import com.apkpure.aegon.post.model.CommentParamV2Extra;
import com.apkpure.aegon.services.AppWatcherService;
import com.apkpure.aegon.utils.SpannableStringUtils;
import com.apkpure.aegon.widgets.button.DownloadEntryView;
import com.apkpure.aegon.widgets.flowlayout.TagFlowLayout;
import com.apkpure.proto.nano.AIHeadlineInfoProtos;
import com.apkpure.proto.nano.AppDetailInfoProtos;
import com.apkpure.proto.nano.AssetInfoProtos;
import com.apkpure.proto.nano.CmsResponseProtos;
import com.apkpure.proto.nano.ComemntImageProtos;
import com.apkpure.proto.nano.CommentInfoProtos;
import com.apkpure.proto.nano.DeveloperDetailInfoProtos;
import com.apkpure.proto.nano.HashtagDetailInfoProtos;
import com.apkpure.proto.nano.OpenConfigProtos;
import com.apkpure.proto.nano.RichTextInfoProtos;
import com.apkpure.proto.nano.ShareInfoProtos;
import com.apkpure.proto.nano.TopicInfoProtos;
import com.google.android.gms.analytics.ecommerce.ProductAction;
import com.google.android.gms.analytics.ecommerce.Promotion;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.sackcentury.shinebuttonlib.ShineButton;
import com.tencent.trpcprotocol.projecta.common.game_info.nano.GameInfo;
import e.g.a.c.k.i.a;
import e.g.a.c.k.l.b;
import e.g.a.c.n.p.c0.c;
import e.g.a.e.d.o;
import e.g.a.e.f.c2;
import e.g.a.e.f.i2;
import e.g.a.e.k.m.k0.k0;
import e.g.a.e.k.m.w;
import e.g.a.e.k.m.x;
import e.g.a.f.f;
import e.g.a.i.m0.i;
import e.g.a.i.m0.n;
import e.g.a.i0.a1;
import e.g.a.i0.f1;
import e.g.a.i0.h0;
import e.g.a.i0.n0;
import e.g.a.i0.p1;
import e.g.a.i0.q0;
import e.g.a.o.p.r;
import e.g.a.r.b.e;
import e.g.a.r.b.m;
import e.g.a.v.s.p;
import e.h.a.h;
import e.h.a.m.u.k;
import e.h.a.q.g;
import i.b.c.h;
import i.o.c.l;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Array;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import o.p.d;
import o.s.c.j;
import p.a.b0;
import p.a.g0;

public final class c {
    public static final a A(AppCardData appCardData, int i2) {
        j.e(appCardData, "<this>");
        Map<String, Object> config = appCardData.getConfig();
        Object obj = config == null ? null : config.get(AppCardData.KEY_ONLINE_AD_MEDIA_INFO);
        List list = obj instanceof List ? (List) obj : null;
        if (list == null) {
            return null;
        }
        boolean z = false;
        if (i2 >= 0 && i2 < list.size()) {
            z = true;
        }
        if (!z) {
            return null;
        }
        Object obj2 = list.get(i2);
        if (obj2 instanceof a) {
            return (a) obj2;
        }
        return null;
    }

    public static final String B(AppDetailInfoProtos.AppDetailInfo appDetailInfo) {
        j.e(appDetailInfo, "<this>");
        StringBuilder sb = new StringBuilder();
        sb.append((Object) appDetailInfo.packageName);
        sb.append('_');
        sb.append((Object) appDetailInfo.versionCode);
        sb.append('_');
        sb.append((Object) appDetailInfo.versionId);
        return sb.toString();
    }

    public static String C(Context context, CommentInfoProtos.CommentInfo commentInfo, boolean z, boolean z2) {
        ComemntImageProtos.CommentImage[] commentImageArr;
        StringBuilder sb = new StringBuilder();
        if (z2) {
            sb.append(f1.h(context, commentInfo.author.nickName));
        }
        CommentInfoProtos.CommentInfo commentInfo2 = commentInfo.replyTo;
        if (commentInfo2 != null) {
            String str = commentInfo2.author.nickName;
            if (!TextUtils.isEmpty(str)) {
                sb.append(context.getString(R.string.arg_RES_2131820667));
                sb.append(" ");
                sb.append(f1.h(context, str + ": "));
            }
        } else if (z2) {
            sb.append(": ");
        }
        RichTextInfoProtos.RichTextInfo[] richTextInfoArr = commentInfo.richText;
        if (richTextInfoArr != null && richTextInfoArr.length > 0) {
            for (RichTextInfoProtos.RichTextInfo richTextInfo : richTextInfoArr) {
                if ("text".equals(richTextInfo.type)) {
                    sb.append(richTextInfo.msg);
                }
            }
            if (z && (commentImageArr = commentInfo.images) != null && commentImageArr.length > 0) {
                sb.append(String.format(" %s", f1.d(commentImageArr[0].original.url)));
            }
        }
        return sb.toString();
    }

    public static <T> h D(T t2) {
        h hVar;
        try {
            if ((t2 instanceof Fragment) && t2.isAdded()) {
                T t3 = t2;
                hVar = e.h.a.c.d(t3.getContext()).h(t3);
            } else if ((t2 instanceof android.app.Fragment) && t2.isAdded()) {
                T t4 = t2;
                hVar = e.h.a.c.d(t4.getActivity()).f(t4);
            } else if (t2 instanceof l) {
                hVar = e.h.a.c.h(t2);
            } else if (t2 instanceof Activity) {
                T t5 = t2;
                Objects.requireNonNull(t5, "You cannot start a load on a not yet attached View or a Fragment where getActivity() returns null (which usually occurs when getActivity() is called before the Fragment is attached or after the Fragment is destroyed).");
                hVar = e.h.a.c.b(t5).f8019g.e(t5);
            } else {
                hVar = t2 instanceof View ? e.h.a.c.g(t2) : t2 instanceof Context ? e.h.a.c.f(t2) : null;
            }
            if (hVar != null) {
                return hVar;
            }
            int i2 = AegonApplication.f1165e;
            return e.h.a.c.f(RealApplicationLike.getContext());
        } catch (Exception e2) {
            e2.printStackTrace();
            int i3 = AegonApplication.f1165e;
        } catch (Throwable th) {
            int i4 = AegonApplication.f1165e;
            e.h.a.c.f(RealApplicationLike.getContext());
            throw th;
        }
    }

    public static final b0 E(f fVar) {
        j.e(fVar, "<this>");
        Activity c = fVar.c();
        if (c instanceof e.g.a.t.b.a) {
            return ((e.g.a.t.b.a) c).L1();
        }
        return null;
    }

    public static int F(Context context) {
        try {
            Class<?> cls = Class.forName("com.android.internal.R$dimen");
            return context.getResources().getDimensionPixelSize(Integer.parseInt(cls.getField("status_bar_height").get(cls.newInstance()).toString()));
        } catch (Exception e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public static int G(Context context) {
        return ((a1.b(context) - (p1.a(context, 16.0f) * 2)) * 9) / 16;
    }

    /* JADX WARNING: Removed duplicated region for block: B:12:0x003d  */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x007a A[LOOP:0: B:17:0x007a->B:22:0x009b, LOOP_START, PHI: r2 
      PHI: (r2v2 int) = (r2v1 int), (r2v3 int) binds: [B:16:0x0078, B:22:0x009b] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARNING: Removed duplicated region for block: B:8:0x0021  */
    public static final Object H(Context context, List<String> list, d<? super Map<String, ? extends Drawable>> dVar) {
        w wVar;
        int i2;
        ArrayList arrayList;
        int size;
        if (dVar instanceof w) {
            wVar = (w) dVar;
            int i3 = wVar.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                wVar.label = i3 - Integer.MIN_VALUE;
                Object obj = wVar.result;
                o.p.i.a aVar = o.p.i.a.COROUTINE_SUSPENDED;
                i2 = wVar.label;
                if (i2 != 0) {
                    k.g.c.u0(obj);
                    arrayList = new ArrayList();
                    ExplorationEnterTranslateCategoryCard explorationEnterTranslateCategoryCard = ExplorationEnterTranslateCategoryCard.x;
                    ExplorationEnterTranslateCategoryCard explorationEnterTranslateCategoryCard2 = ExplorationEnterTranslateCategoryCard.x;
                    s.e.a aVar2 = ExplorationEnterTranslateCategoryCard.y;
                    x xVar = new x(list, arrayList, context, null);
                    wVar.L$0 = context;
                    wVar.L$1 = list;
                    wVar.L$2 = arrayList;
                    wVar.label = 1;
                    if (k.g.c.x(xVar, wVar) == aVar) {
                        return aVar;
                    }
                } else if (i2 == 1) {
                    list = (List) wVar.L$1;
                    k.g.c.u0(obj);
                    arrayList = (ArrayList) wVar.L$2;
                    context = (Context) wVar.L$0;
                } else {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ExplorationEnterTranslateCategoryCard explorationEnterTranslateCategoryCard3 = ExplorationEnterTranslateCategoryCard.x;
                ExplorationEnterTranslateCategoryCard explorationEnterTranslateCategoryCard4 = ExplorationEnterTranslateCategoryCard.x;
                s.e.a aVar3 = ExplorationEnterTranslateCategoryCard.y;
                HashMap hashMap = new HashMap();
                Drawable d = i.i.d.a.d(context, R.drawable.arg_RES_2131230980);
                size = arrayList.size() - 1;
                int i4 = 0;
                if (size >= 0) {
                    while (true) {
                        g0 g0Var = (g0) arrayList.get(i4);
                        if (g0Var.d() == null) {
                            hashMap.put(list.get(i4), d);
                        } else {
                            hashMap.put(list.get(i4), g0Var.d());
                        }
                        if (i4 == size) {
                            break;
                        }
                        i4++;
                    }
                }
                return hashMap;
            }
        }
        wVar = new w(dVar);
        Object obj2 = wVar.result;
        o.p.i.a aVar4 = o.p.i.a.COROUTINE_SUSPENDED;
        i2 = wVar.label;
        if (i2 != 0) {
        }
        ExplorationEnterTranslateCategoryCard explorationEnterTranslateCategoryCard32 = ExplorationEnterTranslateCategoryCard.x;
        ExplorationEnterTranslateCategoryCard explorationEnterTranslateCategoryCard42 = ExplorationEnterTranslateCategoryCard.x;
        s.e.a aVar32 = ExplorationEnterTranslateCategoryCard.y;
        HashMap hashMap2 = new HashMap();
        Drawable d2 = i.i.d.a.d(context, R.drawable.arg_RES_2131230980);
        size = arrayList.size() - 1;
        int i42 = 0;
        if (size >= 0) {
        }
        return hashMap2;
    }

    public static void I(Context context, String str, String str2, AssetInfo assetInfo) {
        Intent intent = new Intent(context, AppWatcherService.class);
        intent.putExtra("command", "HANDLE_PACKAGE_EVENT");
        intent.putExtra("event", str);
        intent.putExtra("packageName", str2);
        intent.putExtra("assetInfo", assetInfo);
        try {
            context.startService(intent);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public static void J(String str) {
        if (!TextUtils.isEmpty(str)) {
            new b(str).start();
        } else {
            e.f.a.g.a.c("VastHttpToolLog", "url is null or empty", new Object[0]);
        }
    }

    public static g K() {
        return (g) new g().i(k.f8300a);
    }

    public static g L(int i2) {
        return (g) ((g) K().C(i2)).o(i2);
    }

    public static g M(int i2) {
        return (g) L(i2).K(new e.g.a.r.b.j(5));
    }

    public static void N(r rVar, DownloadEntryView downloadEntryView) {
        j.e(rVar, "this");
        j.e(downloadEntryView, "actionDownloadEntryView");
    }

    public static void O(r rVar, View view) {
        j.e(rVar, "this");
        j.e(view, "actionSkip");
    }

    public static boolean P(String str, Context context) {
        PackageInfo packageInfo;
        if (context == null) {
            return false;
        }
        try {
            packageInfo = context.getPackageManager().getPackageInfo(str, 0);
        } catch (PackageManager.NameNotFoundException | RuntimeException unused) {
            packageInfo = null;
        }
        return packageInfo != null;
    }

    public static final boolean Q(AppDetailInfoProtos.AppDetailInfo appDetailInfo) {
        j.e(appDetailInfo, "<this>");
        return appDetailInfo.hasVersion && appDetailInfo.asset != null;
    }

    public static final boolean R(View view) {
        j.e(view, "<this>");
        e.f.a.g.a.a("ViewIsFullVisibleTag", view.hashCode() + " view isShown: " + view.isShown() + ' ', new Object[0]);
        if (!view.isShown()) {
            return false;
        }
        Rect rect = new Rect();
        view.getGlobalVisibleRect(rect);
        e.f.a.g.a.a("ViewIsFullVisibleTag", view.hashCode() + " 算出来 view: 的大小: " + rect.top + ' ' + rect.bottom + ' ' + rect.left + ' ' + rect.right + " height:" + view.getHeight() + " width: " + view.getWidth(), new Object[0]);
        int i2 = rect.top;
        if (i2 == 0 && rect.left == 0) {
            return false;
        }
        if (rect.bottom - i2 >= view.getHeight() && rect.right - rect.left >= view.getWidth() - ((view.getWidth() * 1) / 3)) {
            return true;
        }
        e.f.a.g.a.a("ViewIsFullVisibleTag", view.hashCode() + " 不满足完全展示条件.", new Object[0]);
        return false;
    }

    public static boolean S(Fragment fragment) {
        if (!(fragment instanceof CMSFragment)) {
            return false;
        }
        long v1 = ((CMSFragment) fragment).v1();
        return v1 == 2019 || v1 == 2131;
    }

    public static boolean T(Fragment fragment) {
        if (!(fragment instanceof CMSFragment)) {
            return false;
        }
        String str = ((CMSFragment) fragment).u;
        if (TextUtils.equals("top_tops", str) || TextUtils.equals("top_categories", str)) {
            return true;
        }
        return false;
    }

    public static final void U(Context context, AppDetailInfoProtos.AppDetailInfo appDetailInfo) {
        j.e(context, "context");
        j.e(appDetailInfo, "appDetailInfo");
        boolean b = o.b(context, appDetailInfo.packageName);
        String string = context.getString(b ? R.string.arg_RES_2131821423 : R.string.arg_RES_2131821080);
        j.d(string, "if (isInstalled) {\n     ….string.hot_videos)\n    }");
        String str = b ? "new_video" : "hot_video";
        String k2 = j.k("https://tapi.pureapk.woa.com/v3/game_video?packageName=", appDetailInfo.packageName);
        V(context, k2, ((Object) appDetailInfo.title) + ' ' + string, str, appDetailInfo);
    }

    public static final void V(Context context, String str, String str2, String str3, AppDetailInfoProtos.AppDetailInfo appDetailInfo) {
        if (!(context instanceof Activity)) {
            k0 k0Var = k0.V0;
            i.i.g.c.d0(((s.e.c) k0.W0).f16991a, "jumpVideoListPage context error.");
            return;
        }
        OpenConfigProtos.OpenConfig openConfig = new OpenConfigProtos.OpenConfig();
        openConfig.url = str;
        openConfig.type = "CMS";
        openConfig.title = str2;
        openConfig.eventInfoV2 = i.i.d.c.R(new o.g("eventId", str3));
        Bundle i2 = n0.i(openConfig, null);
        if (appDetailInfo != null) {
            i2.putByteArray("appDetailInfoBytes", e.l.e.g1.d.toByteArray(appDetailInfo));
        }
        Intent intent = new Intent(context, CommonActivity.class);
        intent.putExtras(i2);
        context.startActivity(intent);
    }

    public static <T> void W(T t2, e.g.a.e.j.b bVar, ImageView imageView) {
        D(t2).r(bVar).b(L(R.drawable.arg_RES_2131231050)).Y(imageView);
    }

    public static <T> void X(T t2, Object obj, ImageView imageView) {
        D(t2).r(obj).b(g.R(new e(t2.getApplicationContext(), 10, 10))).Y(imageView);
    }

    public static <T> void Y(T t2, Object obj, ImageView imageView, g gVar) {
        k0(t2, obj, gVar, null, null).Y(imageView);
    }

    public static <T> void Z(T t2, Object obj, ImageView imageView, g gVar, m mVar) {
        k0(t2, obj, gVar, mVar, null).Y(imageView);
    }

    public static void a(Fragment fragment, View view, String str, int i2, int i3, String str2, boolean z, Map<String, ?> map) {
        if (T(fragment) || S(fragment)) {
            Map<String, Object> h2 = e.g.a.s.l.a.h(str, i2, i3, str2, 0);
            if (map != null) {
                ((HashMap) h2).putAll(map);
            }
            if (z) {
                e.g.a.s.l.a.P0(view, h2, "card");
            } else {
                e.g.a.s.l.a.V0(view, "card", h2);
            }
        }
    }

    public static <T> void a0(T t2, Object obj, g gVar, m mVar) {
        k0(t2, obj, gVar, mVar, null).f0();
    }

    public static void b(Fragment fragment, View view, String str, int i2, int i3, boolean z) {
        a(fragment, view, str, i2, i3, "", z, null);
    }

    public static void b0(Context context, String str, ImageView imageView) {
        e.h.a.g f2 = e.h.a.c.f(context).f(PictureDrawable.class);
        e.h.a.m.w.f.c cVar = new e.h.a.m.w.f.c();
        cVar.b = new e.h.a.q.l.a(300, false);
        ((e.h.a.g) ((e.h.a.g) f2.h0(cVar).I(true)).i(k.b)).Z(new e.g.a.r.b.o.c()).d0(str).Y(imageView);
    }

    public static void c(Fragment fragment, View view, String str, int i2, String str2, String str3) {
        if (T(fragment)) {
            j.e(str, "categoryNavCardTitle");
            j.e(str2, "id");
            HashMap hashMap = new HashMap(3);
            hashMap.put("small_position", Integer.valueOf(i2 + 1));
            hashMap.put("category_nav_button_id", str2);
            hashMap.put("recommend_id", str3);
            e.g.a.s.l.a.V0(view, str, hashMap);
        }
    }

    public static void c0(Context context, CommentInfoProtos.CommentInfo commentInfo) {
        if (commentInfo != null && p1.o(context)) {
            Map<String, Integer> map = f1.f6510a;
            String[] stringArray = context.getResources().getStringArray(R.array.arg_RES_2130903044);
            h.a aVar = new h.a(context);
            aVar.c(stringArray, new e.g.a.i.m0.g(context, commentInfo));
            aVar.a().show();
        }
    }

    public static String d(Intent intent) {
        Uri data = intent.getData();
        if (data != null) {
            return data.getSchemeSpecificPart();
        }
        return null;
    }

    public static e.g.a.m0.c0.c d0(Context context, int i2, RecyclerView recyclerView, int i3) {
        int a2 = p1.a(context, (float) i3);
        int a3 = p1.a(context, (float) (i3 - 4));
        int paddingTop = recyclerView.getPaddingTop();
        int paddingBottom = recyclerView.getPaddingBottom();
        recyclerView.setClipToPadding(true);
        if (i2 <= 1) {
            recyclerView.setPadding(a2, paddingTop, a2, paddingBottom);
            recyclerView.setPaddingRelative(a2, paddingTop, a2, paddingBottom);
        } else {
            if (i2 == 2) {
                a3 = 0;
            }
            recyclerView.setPadding(a2, paddingTop, a3, paddingBottom);
            recyclerView.setPaddingRelative(a2, paddingTop, a3, paddingBottom);
        }
        return i2 <= 1 ? new e.g.a.i.m0.l(context) : new e.g.a.i.m0.m(context, i2);
    }

    public static void e(c.a aVar, e.g.a.c.n.p.c0.c cVar) {
        j.e(aVar, "this");
        j.e(cVar, Promotion.ACTION_VIEW);
    }

    public static void e0(MultipleItemCMSAdapter multipleItemCMSAdapter, CmsResponseProtos.CmsItemList cmsItemList, CommentInfoProtos.CommentInfo commentInfo, n nVar) {
        CommentInfoProtos.CommentInfo commentInfo2;
        if (multipleItemCMSAdapter != null && cmsItemList != null && (commentInfo2 = cmsItemList.commentInfo) != null && commentInfo != null) {
            long[] jArr = commentInfo.parent;
            if (!TextUtils.equals((jArr == null || jArr.length <= 0) ? "" : String.valueOf(jArr[jArr.length - 1]), String.valueOf(commentInfo2.id))) {
                return;
            }
            if (multipleItemCMSAdapter.getData().size() == 1) {
                nVar.b();
                return;
            }
            int i2 = 0;
            while (true) {
                if (i2 >= multipleItemCMSAdapter.getData().size()) {
                    i2 = -1;
                    break;
                }
                try {
                    if (TextUtils.equals(String.valueOf(commentInfo.id), String.valueOf(((e.g.a.i.d) multipleItemCMSAdapter.getData().get(i2)).d.itemList[0].commentInfo.id))) {
                        break;
                    }
                    i2++;
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
            if (i2 != -1) {
                multipleItemCMSAdapter.remove(i2);
            }
        }
    }

    public static void f(c.a aVar, e.g.a.c.n.p.c0.c cVar) {
        j.e(aVar, "this");
        j.e(cVar, Promotion.ACTION_VIEW);
    }

    public static void f0(MultipleItemCMSAdapter multipleItemCMSAdapter, e.g.a.i.d dVar, n nVar) {
        if (multipleItemCMSAdapter.getData().isEmpty()) {
            nVar.b();
        } else {
            multipleItemCMSAdapter.addData(0, dVar);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:20:0x004c  */
    /* JADX WARNING: Removed duplicated region for block: B:22:0x0051  */
    /* JADX WARNING: Removed duplicated region for block: B:24:0x0056  */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x005b  */
    @TargetApi(18)
    public static Bitmap g(Context context, Bitmap bitmap, int i2) throws RSRuntimeException {
        Throwable th;
        RenderScript renderScript;
        Allocation allocation;
        Allocation allocation2;
        ScriptIntrinsicBlur scriptIntrinsicBlur = null;
        try {
            renderScript = RenderScript.create(context);
            try {
                renderScript.setMessageHandler(new RenderScript.RSMessageHandler());
                allocation2 = Allocation.createFromBitmap(renderScript, bitmap, Allocation.MipmapControl.MIPMAP_NONE, 1);
            } catch (Throwable th2) {
                th = th2;
                allocation2 = null;
                allocation = allocation2;
                if (scriptIntrinsicBlur != null) {
                }
                if (allocation != null) {
                }
                if (allocation2 != null) {
                }
                if (renderScript != null) {
                }
                throw th;
            }
            try {
                allocation = Allocation.createTyped(renderScript, allocation2.getType());
                try {
                    scriptIntrinsicBlur = ScriptIntrinsicBlur.create(renderScript, Element.U8_4(renderScript));
                    scriptIntrinsicBlur.setInput(allocation2);
                    scriptIntrinsicBlur.setRadius((float) i2);
                    scriptIntrinsicBlur.forEach(allocation);
                    allocation.copyTo(bitmap);
                    scriptIntrinsicBlur.destroy();
                    allocation.destroy();
                    allocation2.destroy();
                    renderScript.destroy();
                    return bitmap;
                } catch (Throwable th3) {
                    th = th3;
                    if (scriptIntrinsicBlur != null) {
                    }
                    if (allocation != null) {
                    }
                    if (allocation2 != null) {
                    }
                    if (renderScript != null) {
                    }
                    throw th;
                }
            } catch (Throwable th4) {
                th = th4;
                allocation = null;
                if (scriptIntrinsicBlur != null) {
                    scriptIntrinsicBlur.destroy();
                }
                if (allocation != null) {
                    allocation.destroy();
                }
                if (allocation2 != null) {
                    allocation2.destroy();
                }
                if (renderScript != null) {
                    renderScript.destroy();
                }
                throw th;
            }
        } catch (Throwable th5) {
            th = th5;
            renderScript = null;
            allocation2 = null;
            allocation = allocation2;
            if (scriptIntrinsicBlur != null) {
            }
            if (allocation != null) {
            }
            if (allocation2 != null) {
            }
            if (renderScript != null) {
            }
            throw th;
        }
    }

    public static void g0(MultipleItemCMSAdapter multipleItemCMSAdapter, CommentInfoProtos.CommentInfo commentInfo, n nVar) {
        if (multipleItemCMSAdapter == null) {
            return;
        }
        if (multipleItemCMSAdapter.getData().size() == 1) {
            nVar.b();
            return;
        }
        int i2 = 0;
        while (true) {
            if (i2 >= multipleItemCMSAdapter.getData().size()) {
                i2 = -1;
                break;
            }
            try {
                if (TextUtils.equals(String.valueOf(commentInfo.id), String.valueOf(((e.g.a.i.d) multipleItemCMSAdapter.getData().get(i2)).d.itemList[0].commentInfo.id))) {
                    break;
                }
                i2++;
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
        if (i2 != -1) {
            multipleItemCMSAdapter.remove(i2);
        }
    }

    public static Bitmap h(Bitmap bitmap, int i2, boolean z) {
        int[] iArr;
        int i3 = i2;
        Bitmap copy = z ? bitmap : bitmap.copy(bitmap.getConfig(), true);
        if (i3 < 1) {
            return null;
        }
        int width = copy.getWidth();
        int height = copy.getHeight();
        int i4 = width * height;
        int[] iArr2 = new int[i4];
        copy.getPixels(iArr2, 0, width, 0, 0, width, height);
        int i5 = width - 1;
        int i6 = height - 1;
        int i7 = i3 + i3 + 1;
        int[] iArr3 = new int[i4];
        int[] iArr4 = new int[i4];
        int[] iArr5 = new int[i4];
        int[] iArr6 = new int[Math.max(width, height)];
        int i8 = (i7 + 1) >> 1;
        int i9 = i8 * i8;
        int i10 = i9 * RecyclerView.a0.FLAG_TMP_DETACHED;
        int[] iArr7 = new int[i10];
        for (int i11 = 0; i11 < i10; i11++) {
            iArr7[i11] = i11 / i9;
        }
        int[] iArr8 = new int[2];
        iArr8[1] = 3;
        iArr8[0] = i7;
        int[][] iArr9 = (int[][]) Array.newInstance(int.class, iArr8);
        int i12 = i3 + 1;
        int i13 = 0;
        int i14 = 0;
        int i15 = 0;
        while (i13 < height) {
            int i16 = 0;
            int i17 = 0;
            int i18 = 0;
            int i19 = 0;
            int i20 = 0;
            int i21 = 0;
            int i22 = 0;
            int i23 = 0;
            int i24 = -i3;
            int i25 = 0;
            while (i24 <= i3) {
                int i26 = iArr2[Math.min(i5, Math.max(i24, 0)) + i14];
                int[] iArr10 = iArr9[i24 + i3];
                iArr10[0] = (i26 & 16711680) >> 16;
                iArr10[1] = (i26 & 65280) >> 8;
                iArr10[2] = i26 & 255;
                int abs = i12 - Math.abs(i24);
                i25 = (iArr10[0] * abs) + i25;
                i16 = (iArr10[1] * abs) + i16;
                i17 = (iArr10[2] * abs) + i17;
                if (i24 > 0) {
                    i21 += iArr10[0];
                    i22 += iArr10[1];
                    i23 += iArr10[2];
                } else {
                    i18 += iArr10[0];
                    i19 += iArr10[1];
                    i20 += iArr10[2];
                }
                i24++;
                i6 = i6;
                iArr6 = iArr6;
            }
            int i27 = i3;
            int i28 = i25;
            int i29 = 0;
            while (i29 < width) {
                iArr3[i14] = iArr7[i28];
                iArr4[i14] = iArr7[i16];
                iArr5[i14] = iArr7[i17];
                int i30 = i28 - i18;
                int i31 = i16 - i19;
                int i32 = i17 - i20;
                int[] iArr11 = iArr9[((i27 - i3) + i7) % i7];
                int i33 = i18 - iArr11[0];
                int i34 = i19 - iArr11[1];
                int i35 = i20 - iArr11[2];
                if (i13 == 0) {
                    iArr = iArr7;
                    iArr6[i29] = Math.min(i29 + i3 + 1, i5);
                } else {
                    iArr = iArr7;
                }
                int i36 = iArr2[i15 + iArr6[i29]];
                iArr11[0] = (i36 & 16711680) >> 16;
                iArr11[1] = (i36 & 65280) >> 8;
                iArr11[2] = i36 & 255;
                int i37 = i21 + iArr11[0];
                int i38 = i22 + iArr11[1];
                int i39 = i23 + iArr11[2];
                i28 = i30 + i37;
                i16 = i31 + i38;
                i17 = i32 + i39;
                i27 = (i27 + 1) % i7;
                int[] iArr12 = iArr9[i27 % i7];
                i18 = i33 + iArr12[0];
                i19 = i34 + iArr12[1];
                i20 = i35 + iArr12[2];
                i21 = i37 - iArr12[0];
                i22 = i38 - iArr12[1];
                i23 = i39 - iArr12[2];
                i14++;
                i29++;
                iArr7 = iArr;
            }
            i15 += width;
            i13++;
            copy = copy;
            height = height;
            i6 = i6;
            iArr6 = iArr6;
        }
        int i40 = i6;
        int i41 = height;
        int i42 = 0;
        while (i42 < width) {
            int i43 = -i3;
            int i44 = 0;
            int i45 = 0;
            int i46 = 0;
            int i47 = 0;
            int i48 = 0;
            int i49 = 0;
            int i50 = 0;
            int i51 = i43;
            int i52 = i43 * width;
            int i53 = 0;
            int i54 = 0;
            while (i51 <= i3) {
                int max = Math.max(0, i52) + i42;
                int[] iArr13 = iArr9[i51 + i3];
                iArr13[0] = iArr3[max];
                iArr13[1] = iArr4[max];
                iArr13[2] = iArr5[max];
                int abs2 = i12 - Math.abs(i51);
                i53 = (iArr3[max] * abs2) + i53;
                i54 = (iArr4[max] * abs2) + i54;
                i44 = (iArr5[max] * abs2) + i44;
                if (i51 > 0) {
                    i48 += iArr13[0];
                    i49 += iArr13[1];
                    i50 += iArr13[2];
                } else {
                    i45 += iArr13[0];
                    i46 += iArr13[1];
                    i47 += iArr13[2];
                }
                if (i51 < i40) {
                    i52 += width;
                }
                i51++;
                i40 = i40;
                width = width;
            }
            int i55 = i3;
            int i56 = i42;
            int i57 = i54;
            int i58 = i53;
            int i59 = 0;
            while (i59 < i41) {
                iArr2[i56] = (iArr2[i56] & -16777216) | (iArr7[i58] << 16) | (iArr7[i57] << 8) | iArr7[i44];
                int i60 = i58 - i45;
                int i61 = i57 - i46;
                int i62 = i44 - i47;
                int[] iArr14 = iArr9[((i55 - i3) + i7) % i7];
                int i63 = i45 - iArr14[0];
                int i64 = i46 - iArr14[1];
                int i65 = i47 - iArr14[2];
                if (i42 == 0) {
                    iArr6[i59] = Math.min(i59 + i12, i40) * width;
                }
                int i66 = iArr6[i59] + i42;
                iArr14[0] = iArr3[i66];
                iArr14[1] = iArr4[i66];
                iArr14[2] = iArr5[i66];
                int i67 = i48 + iArr14[0];
                int i68 = i49 + iArr14[1];
                int i69 = i50 + iArr14[2];
                i58 = i60 + i67;
                i57 = i61 + i68;
                i44 = i62 + i69;
                i55 = (i55 + 1) % i7;
                int[] iArr15 = iArr9[i55];
                i45 = i63 + iArr15[0];
                i46 = i64 + iArr15[1];
                i47 = i65 + iArr15[2];
                i48 = i67 - iArr15[0];
                i49 = i68 - iArr15[1];
                i50 = i69 - iArr15[2];
                i56 += width;
                i59++;
                i3 = i2;
            }
            i42++;
            i3 = i2;
            i40 = i40;
            i41 = i41;
            i7 = i7;
            iArr2 = iArr2;
            width = width;
        }
        copy.setPixels(iArr2, 0, width, 0, 0, width, i41);
        return copy;
    }

    public static void h0(Context context, String str, String str2, String str3, String str4) {
        OpenConfigProtos.OpenConfig openConfig = new OpenConfigProtos.OpenConfig();
        openConfig.title = context.getString(R.string.arg_RES_2131821708);
        openConfig.type = "WebAgent";
        HashMap hashMap = new HashMap();
        hashMap.put("eventId", context.getString(R.string.arg_RES_2131821601));
        hashMap.put("currentPage", "");
        openConfig.eventInfoV2 = hashMap;
        openConfig.url = !TextUtils.isEmpty(str2) ? p.b(str, str2, null, str4) : !TextUtils.isEmpty(str3) ? p.b(null, null, null, str3) : p.b(str, null, null, null);
        n0.M(context, openConfig);
    }

    public static CommentParamV2 i(CommentParamV2 commentParamV2, ShareInfoProtos.ShareInfo shareInfo, UploadApkParam uploadApkParam) {
        String str;
        Objects.requireNonNull(commentParamV2);
        Map<String, Integer> map = f1.f6510a;
        if (shareInfo == null || uploadApkParam == null) {
            str = null;
        } else {
            String d = uploadApkParam.d();
            String e2 = uploadApkParam.e();
            String h2 = uploadApkParam.h();
            int f2 = uploadApkParam.f();
            String v = e.d.a.a.a.v(e2, f2);
            String v2 = e.d.a.a.a.v(e2, f2);
            StringBuilder g0 = e.d.a.a.a.g0("<input style=\"color:#007AFF;border:1px solid #007AFF;border-radius:6px;font-size:14px;background:#fff;padding:5px;margin:5px;align:center\" type=\"button\" data-type=\"apk\" data-label=\"", d, "\" data-vn=\"", h2, "\" data-fp=\"");
            e.d.a.a.a.F0(g0, Build.FINGERPRINT, "\" data-record=\"", v2, "\" data-id=\"");
            g0.append(e2);
            g0.append("\"   data-vc=\"");
            g0.append(f2);
            g0.append("\" data-fn=\"");
            e.d.a.a.a.F0(g0, v, "\"  value=\" 《", d, "》&nbsp;&nbsp;&nbsp;V");
            str = e.d.a.a.a.U(g0, h2, "&nbsp;&nbsp;\" readonly=\"readonly\" /><br><br>");
        }
        CommentParamV2.d(commentParamV2, str);
        CommentParamV2 commentParamV22 = new CommentParamV2((CommentParamV2.a) null);
        CommentParamV2.o(commentParamV22, commentParamV2.g0());
        CommentParamV2.K(commentParamV22, commentParamV2.a0());
        CommentParamV2.i(commentParamV22, commentParamV2.h0());
        CommentParamV2.f(commentParamV22, commentParamV2.i0());
        CommentParamV2.h(commentParamV22, commentParamV2.j0());
        CommentParamV2.n(commentParamV22, commentParamV2.O());
        if (shareInfo != null) {
            CommentParamV2.D(commentParamV22, e.l.e.g1.d.toByteArray(shareInfo));
        }
        if (uploadApkParam != null) {
            CommentParamV2.I(commentParamV22, uploadApkParam);
        }
        AppDetailInfoProtos.AppDetailInfo M = commentParamV2.M();
        if (M != null) {
            CommentParamV2.F(commentParamV22, e.l.e.g1.d.toByteArray(M));
        }
        CommentParamV2.e(commentParamV22, commentParamV2.X());
        TopicInfoProtos.TopicInfo b0 = commentParamV2.b0();
        if (b0 != null) {
            CommentParamV2.G(commentParamV22, e.l.e.g1.d.toByteArray(b0));
        }
        CommentParamV2.d(commentParamV22, commentParamV2.N());
        CommentParamV2.p(commentParamV22, commentParamV2.Z());
        HashtagDetailInfoProtos.HashtagDetailInfo W = commentParamV2.W();
        if (W != null) {
            CommentParamV2.H(commentParamV22, e.l.e.g1.d.toByteArray(W));
        }
        CommentParamV2.C(commentParamV22, commentParamV2.P());
        CommentParamV2.a(commentParamV22, commentParamV2.Q());
        CommentParamV2.j(commentParamV22, commentParamV2.e0());
        CommentParamV2.k(commentParamV22, commentParamV2.n0());
        CommentParamV2.l(commentParamV22, commentParamV2.m0());
        CommentParamV2.m(commentParamV22, commentParamV2.l0());
        CommentParamV2.q(commentParamV22, commentParamV2.f0());
        CommentParamV2.r(commentParamV22, commentParamV2.V());
        CommentParamV2.t(commentParamV22, commentParamV2.U());
        CommentParamV2.s(commentParamV22, commentParamV2.S());
        CommentParamV2.y(commentParamV22, commentParamV2.R());
        CommentParamV2.u(commentParamV22, commentParamV2.T());
        CommentParamV2.z(commentParamV22, commentParamV2.d0());
        return commentParamV22;
    }

    public static final void i0(String str, String str2, int i2, int i3, long j2) {
        j.e(str, "event");
        j.e(str2, "elementId");
        ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
        concurrentHashMap.put("ad_sdk", "taboolaApi");
        concurrentHashMap.put("is_ad", 5);
        concurrentHashMap.put(AppCardData.KEY_SCENE, 2118L);
        concurrentHashMap.put("ad_placement_id", 2118);
        concurrentHashMap.put("ad_type", 2);
        concurrentHashMap.put("sdk_ad_type", 2);
        concurrentHashMap.put("model_type", 1128);
        concurrentHashMap.put("module_name", "open_screen_card");
        concurrentHashMap.put("return_code", Integer.valueOf(i2));
        if (i3 != -1) {
            concurrentHashMap.put("ad_click", Integer.valueOf(i3));
        }
        if (j2 != 0) {
            concurrentHashMap.put("ad_use_timelong", Long.valueOf(System.currentTimeMillis() - j2));
        }
        int i4 = AegonApplication.f1165e;
        View view = new View(RealApplicationLike.getContext());
        e.g.a.h0.b.h.s(view, str2, concurrentHashMap, false);
        e.g.a.h0.b.h.o(str, view, concurrentHashMap);
        q0.a("Taboola", "reportTablooaCommon: event=" + str + ", tablooaPara=" + concurrentHashMap);
    }

    public static final void j(Context context, AppDetailInfoProtos.AppDetailInfo appDetailInfo, TagFlowLayout tagFlowLayout, boolean z) {
        j.e(context, "<this>");
        j.e(appDetailInfo, "appDetailInfo");
        j.e(tagFlowLayout, "appFlagFl");
        ArrayList arrayList = new ArrayList();
        if (z) {
            arrayList.add(appDetailInfo.title);
            tagFlowLayout.b(2, 0, 2, 0);
        }
        AssetInfoProtos.AssetInfo assetInfo = appDetailInfo.asset;
        if (j.a(Asset.TYPE_XAPK, assetInfo == null ? null : assetInfo.type)) {
            arrayList.add(context.getString(R.string.arg_RES_2131820674));
        }
        if (appDetailInfo.isAPKs) {
            arrayList.add(context.getString(R.string.arg_RES_2131820618));
        }
        if (appDetailInfo.isOBB) {
            arrayList.add(context.getString(R.string.arg_RES_2131820657));
        }
        String[] strArr = appDetailInfo.cornerTag;
        if (strArr != null) {
            int length = strArr.length;
            int i2 = 0;
            int i3 = 0;
            while (i2 < length) {
                String str = strArr[i2];
                i2++;
                if (i3 <= 1) {
                    i3++;
                    arrayList.add(str);
                }
            }
        }
        if (arrayList.isEmpty()) {
            tagFlowLayout.setVisibility(8);
            return;
        }
        tagFlowLayout.setVisibility(0);
        tagFlowLayout.getSelectedList();
        tagFlowLayout.setAdapter(new e.g.a.p.a(arrayList, z, context));
    }

    public static /* synthetic */ void j0(String str, String str2, int i2, int i3, long j2, int i4) {
        int i5 = (i4 & 4) != 0 ? 0 : i2;
        int i6 = (i4 & 8) != 0 ? -1 : i3;
        if ((i4 & 16) != 0) {
            j2 = 0;
        }
        i0(str, str2, i5, i6, j2);
    }

    public static CommentParamV2 k(String str) {
        CommentParamV2 commentParamV2 = new CommentParamV2((CommentParamV2.a) null);
        CommentParamV2.K(commentParamV2, str);
        CommentParamV2.t(commentParamV2, 2);
        CommentParamV2.i(commentParamV2, false);
        CommentParamV2.f(commentParamV2, false);
        CommentParamV2.h(commentParamV2, false);
        CommentParamV2.k(commentParamV2, false);
        CommentParamV2.p(commentParamV2, 9);
        CommentParamV2.n(commentParamV2, e.g.a.b0.d.a.NORMAL);
        CommentParamV2.z(commentParamV2, true);
        return commentParamV2;
    }

    public static <T> e.h.a.g<Drawable> k0(T t2, Object obj, g gVar, m mVar, e.h.a.g<Drawable> gVar2) {
        return D(t2).r(obj).b(gVar).Z(new e.g.a.r.b.k(mVar)).g0(gVar2);
    }

    public static CommentParamV2 l(AppDetailInfoProtos.AppDetailInfo appDetailInfo, CommentParamV2Extra commentParamV2Extra) {
        CommentParamV2 commentParamV2 = new CommentParamV2((CommentParamV2.a) null);
        CommentParamV2.K(commentParamV2, appDetailInfo.label);
        CommentParamV2.t(commentParamV2, 1);
        CommentParamV2.i(commentParamV2, false);
        CommentParamV2.f(commentParamV2, false);
        CommentParamV2.h(commentParamV2, false);
        CommentParamV2.k(commentParamV2, false);
        CommentParamV2.p(commentParamV2, 9);
        CommentParamV2.n(commentParamV2, e.g.a.b0.d.a.APP);
        CommentParamV2.C(commentParamV2, commentParamV2Extra);
        CommentParamV2.F(commentParamV2, e.l.e.g1.d.toByteArray(appDetailInfo));
        return commentParamV2;
    }

    public static void l0(Context context, AIHeadlineInfoProtos.AIHeadlineInfo aIHeadlineInfo, int i2) {
        Map<String, Long> map;
        String str;
        e.g.a.s.j jVar = new e.g.a.s.j(context, aIHeadlineInfo, i2);
        AIHeadlineInfoProtos.AIHeadlineInfo aIHeadlineInfo2 = jVar.f7086f;
        if ((aIHeadlineInfo2 == null || aIHeadlineInfo2.tags == null || aIHeadlineInfo2.events == null) ? false : true) {
            switch (i2) {
                case 6:
                    map = aIHeadlineInfo2.events;
                    str = ProductAction.ACTION_DETAIL;
                    break;
                case 7:
                    map = aIHeadlineInfo2.events;
                    str = "download";
                    break;
                case 8:
                    map = aIHeadlineInfo2.events;
                    str = "review1";
                    break;
                case 9:
                    try {
                        map = aIHeadlineInfo2.events;
                        str = "review2";
                        break;
                    } catch (Exception unused) {
                        new Throwable("aiHeadlineInfo.events get key is null");
                        return;
                    }
                default:
                    switch (i2) {
                        case 16:
                            map = aIHeadlineInfo2.events;
                            str = "review3";
                            break;
                        case 17:
                            map = aIHeadlineInfo2.events;
                            str = "review4";
                            break;
                        case 18:
                            map = aIHeadlineInfo2.events;
                            str = "review5";
                            break;
                        case 19:
                            map = aIHeadlineInfo2.events;
                            str = "post";
                            break;
                        case 20:
                            map = aIHeadlineInfo2.events;
                            str = "vote";
                            break;
                        case 21:
                            map = aIHeadlineInfo2.events;
                            str = "reply";
                            break;
                        case 22:
                            map = aIHeadlineInfo2.events;
                            str = "follow";
                            break;
                        case 23:
                            map = aIHeadlineInfo2.events;
                            str = "unfollow";
                            break;
                        case 24:
                            map = aIHeadlineInfo2.events;
                            str = "image";
                            break;
                        case 25:
                            map = aIHeadlineInfo2.events;
                            str = "tube";
                            break;
                        default:
                            return;
                    }
            }
            jVar.a(map.get(str).longValue());
        }
    }

    public static CommentParamV2 m(AppDetailInfoProtos.AppDetailInfo appDetailInfo, CommentParamV2Extra commentParamV2Extra, int i2) {
        CommentParamV2 commentParamV2 = new CommentParamV2((CommentParamV2.a) null);
        CommentParamV2.K(commentParamV2, appDetailInfo.label);
        CommentParamV2.t(commentParamV2, 3);
        CommentParamV2.i(commentParamV2, false);
        CommentParamV2.f(commentParamV2, false);
        CommentParamV2.h(commentParamV2, false);
        CommentParamV2.k(commentParamV2, false);
        CommentParamV2.p(commentParamV2, 9);
        CommentParamV2.e(commentParamV2, (float) i2);
        CommentParamV2.i(commentParamV2, true);
        CommentParamV2.n(commentParamV2, e.g.a.b0.d.a.APP);
        CommentParamV2.C(commentParamV2, commentParamV2Extra);
        CommentParamV2.F(commentParamV2, e.l.e.g1.d.toByteArray(appDetailInfo));
        return commentParamV2;
    }

    public static void m0(int i2) {
        c2[] values = c2.values();
        if (i2 >= 0 && i2 < 51) {
            i2.e(values[i2]);
        }
    }

    public static CommentParamV2 n(Context context) {
        CommentParamV2 commentParamV2 = new CommentParamV2((CommentParamV2.a) null);
        CommentParamV2.c(commentParamV2, true);
        CommentParamV2.K(commentParamV2, context.getString(R.string.arg_RES_2131821922));
        CommentParamV2.t(commentParamV2, 2);
        CommentParamV2.i(commentParamV2, false);
        CommentParamV2.f(commentParamV2, false);
        CommentParamV2.h(commentParamV2, false);
        CommentParamV2.k(commentParamV2, false);
        CommentParamV2.p(commentParamV2, 9);
        CommentParamV2.n(commentParamV2, e.g.a.b0.d.a.NORMAL);
        return commentParamV2;
    }

    public static final void n0(MainTabActivity mainTabActivity, int i2, String str) {
        String string = mainTabActivity.getString(R.string.arg_RES_2131820777);
        j.d(string, "activity.getString(R.string.click_home_activities)");
        e.g.a.s.f.b(mainTabActivity, mainTabActivity.getString(i2), str, 0, string);
    }

    public static void o(Context context) {
        p(context, "feedback", "", "");
    }

    /* JADX WARNING: Code restructure failed: missing block: B:16:0x0057, code lost:
        if (r11 != null) goto L_0x0059;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:21:0x0077, code lost:
        if (r11 != null) goto L_0x0059;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:25:0x00a2, code lost:
        if (r11 != null) goto L_0x0059;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:27:0x00a8, code lost:
        if (r11 != null) goto L_0x0059;
     */
    public static void o0(TextView textView, CmsResponseProtos.CmsItemList cmsItemList, DeveloperDetailInfoProtos.DeveloperDetailInfo developerDetailInfo, TextView textView2) {
        if (textView != null) {
            Context context = textView.getContext();
            long j2 = cmsItemList != null ? cmsItemList.appInfo.topIndex : 0;
            if (developerDetailInfo != null) {
                j2 = developerDetailInfo.topIndex;
            }
            if (j2 == 1) {
                textView.setBackgroundResource(R.drawable.arg_RES_2131231551);
                textView.setTextColor(context.getResources().getColor(R.color.arg_RES_2131100647));
                textView.setTextSize(12.0f);
                if (textView2 != null) {
                    textView2.setVisibility(8);
                }
            } else {
                if (j2 == 2) {
                    textView.setBackgroundResource(R.drawable.arg_RES_2131231552);
                    textView.setTextColor(context.getResources().getColor(R.color.arg_RES_2131100647));
                    textView.setTextSize(12.0f);
                } else if (j2 == 3) {
                    textView.setBackgroundResource(R.drawable.arg_RES_2131231553);
                    textView.setTextColor(context.getResources().getColor(R.color.arg_RES_2131100647));
                    textView.setTextSize(12.0f);
                } else {
                    int i2 = (j2 > 100 ? 1 : (j2 == 100 ? 0 : -1));
                    textView.setBackgroundColor(context.getResources().getColor(17170445));
                    textView.setTextColor(context.getResources().getColor(R.color.arg_RES_2131100559));
                    if (i2 >= 0) {
                        textView.setTextSize(11.6f);
                    } else {
                        textView.setTextSize(12.0f);
                    }
                }
                textView2.setVisibility(0);
            }
            textView.setText(MessageFormat.format("{0}", Long.valueOf(j2)));
        }
    }

    public static void p(Context context, String str, String str2, String str3) {
        OpenConfigProtos.OpenConfig openConfig = new OpenConfigProtos.OpenConfig();
        openConfig.title = context.getString(R.string.arg_RES_2131820854);
        openConfig.type = "WebAgent";
        int i2 = p.f7359a;
        Uri.Builder a2 = e.g.a.v.s.r.a("page/contact-us.html");
        a2.appendQueryParameter(PopupRecord.TYPE_COLUMN_NAME, str);
        if (str2 != null) {
            a2.appendQueryParameter("subject", str2);
        }
        if (str3 != null) {
            a2.appendQueryParameter("displayMessage", str3);
        }
        openConfig.url = a2.build().toString();
        HashMap hashMap = new HashMap();
        hashMap.put("eventId", context.getString(R.string.arg_RES_2131821577));
        openConfig.eventInfoV2 = hashMap;
        n0.M(context, openConfig);
    }

    public static void p0(TextView textView, CmsResponseProtos.CmsItemList cmsItemList, DeveloperDetailInfoProtos.DeveloperDetailInfo developerDetailInfo, TextView textView2) {
        String str;
        int i2;
        if (textView != null) {
            Context context = textView.getContext();
            long j2 = cmsItemList != null ? cmsItemList.appInfo.topIndex : 0;
            if (j2 == 1) {
                i2 = R.drawable.arg_RES_2131231776;
            } else if (j2 == 2) {
                i2 = R.drawable.arg_RES_2131231777;
            } else if (j2 == 3) {
                i2 = R.drawable.arg_RES_2131231778;
            } else {
                int i3 = (j2 > 100 ? 1 : (j2 == 100 ? 0 : -1));
                textView.setBackgroundColor(context.getResources().getColor(17170445));
                textView.setTextColor(context.getResources().getColor(R.color.arg_RES_2131099747));
                if (i3 >= 0) {
                    textView.setTextSize(11.6f);
                    str = MessageFormat.format("{0}", Long.valueOf(j2));
                } else {
                    textView.setTextSize(12.0f);
                    str = MessageFormat.format("{0}", Long.valueOf(j2));
                }
                textView.setText(str);
            }
            textView.setBackgroundResource(i2);
            textView.setTextColor(context.getResources().getColor(R.color.arg_RES_2131100647));
            textView.setTextSize(12.0f);
            str = "";
            textView.setText(str);
        }
    }

    public static AppCard q(e.g.a.e.k.g gVar) {
        j.e(gVar, "this");
        return gVar instanceof AppCard ? (AppCard) gVar : AppCard.a.d((View) gVar);
    }

    public static final void q0(Context context, String str, String str2, boolean z, boolean z2) {
        e.g.a.p.d dVar = new e.g.a.p.d(z, z2);
        j.f(context, "receiver$0");
        j.f(str2, "message");
        s.b.a.b bVar = new s.b.a.b(context);
        j.f(str, AppMeasurementSdk.ConditionalUserProperty.VALUE);
        bVar.f16975a.setTitle(str);
        j.f(str2, AppMeasurementSdk.ConditionalUserProperty.VALUE);
        bVar.f16975a.setMessage(str2);
        dVar.invoke(bVar);
        j.b(bVar.f16975a.show(), "builder.show()");
    }

    public static <T> Bitmap r(T t2, Object obj) throws Exception {
        return (Bitmap) ((e.h.a.q.e) D(t2).k().c0(obj).f0()).get();
    }

    public static int r0(int i2) {
        return (((i2 >> 24) & 255) << 0) | (((i2 >> 0) & 255) << 24) | (((i2 >> 8) & 255) << 16) | (((i2 >> 16) & 255) << 8);
    }

    public static <T> Drawable s(T t2, Object obj) throws Exception {
        return (Drawable) ((e.h.a.q.e) D(t2).l().c0(obj).f0()).get();
    }

    public static short s0(short s2) {
        int i2 = s2 & 255;
        return (short) ((((s2 >> 8) & 255) << 0) | (i2 << 8));
    }

    public static <T> File t(T t2, Object obj) throws Exception {
        return (File) ((e.h.a.q.e) D(t2).p().c0(obj).f0()).get();
    }

    public static final String t0(GameInfo gameInfo) {
        j.e(gameInfo, "<this>");
        String[] strArr = gameInfo.categories;
        boolean z = true;
        if (strArr != null) {
            if (!(strArr.length == 0)) {
                z = false;
            }
        }
        if (z) {
            return new String();
        }
        String join = TextUtils.join(",", strArr);
        j.d(join, "{\n        TextUtils.join…\", this.categories)\n    }");
        return join;
    }

    public static String u(Context context, String str) {
        int i2;
        if (TextUtils.equals(str, "REVIEW")) {
            i2 = R.string.arg_RES_2131820970;
        } else if (TextUtils.equals(str, "POST")) {
            i2 = R.string.arg_RES_2131821876;
        } else if (!TextUtils.equals(str, "STORY")) {
            return "";
        } else {
            i2 = R.string.arg_RES_2131821084;
        }
        return context.getString(i2);
    }

    public static void u0(Activity activity, ShineButton shineButton, TextView textView, LinearLayout linearLayout, CommentInfoProtos.CommentInfo commentInfo, String str) {
        v0(activity, shineButton, textView, linearLayout, commentInfo, str, false, new p1.c(shineButton, textView, commentInfo, new i(commentInfo)));
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r7v0, types: [java.io.DataInputStream] */
    /* JADX WARN: Type inference failed for: r7v1 */
    /* JADX WARN: Type inference failed for: r7v4, types: [java.io.DataInputStream] */
    /* JADX WARNING: Code restructure failed: missing block: B:21:0x0061, code lost:
        if (r14 == null) goto L_0x006c;
     */
    /* JADX WARNING: Removed duplicated region for block: B:109:0x01db  */
    /* JADX WARNING: Removed duplicated region for block: B:113:0x01e6 A[SYNTHETIC, Splitter:B:113:0x01e6] */
    /* JADX WARNING: Removed duplicated region for block: B:126:0x0240 A[SYNTHETIC, Splitter:B:126:0x0240] */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x00b8 A[SYNTHETIC, Splitter:B:43:0x00b8] */
    /* JADX WARNING: Removed duplicated region for block: B:56:0x00db A[Catch:{ Exception -> 0x0180, all -> 0x017c }] */
    /* JADX WARNING: Removed duplicated region for block: B:66:0x0174  */
    /* JADX WARNING: Removed duplicated region for block: B:77:0x018c A[SYNTHETIC, Splitter:B:77:0x018c] */
    /* JADX WARNING: Removed duplicated region for block: B:84:0x019a  */
    public static final String v(String str) {
        long j2;
        int i2;
        DataInputStream dataInputStream;
        Throwable th;
        Throwable th2;
        int i3;
        Throwable th3;
        FileNotFoundException e2;
        DataInputStream dataInputStream2;
        Exception e3;
        e.g.a.d.p.a aVar;
        DataInputStream dataInputStream3;
        FileInputStream fileInputStream;
        Throwable th4;
        Throwable th5;
        IOException e4;
        FileInputStream fileInputStream2 = null;
        if (!TextUtils.isEmpty(str)) {
            File file = new File(str);
            if (file.exists() && file.length() >= 22) {
                int min = Math.min(65557, (int) file.length());
                int min2 = Math.min(8096, min);
                long length = file.length() - ((long) min2);
                int i4 = 0;
                int i5 = min2;
                loop0:
                while (true) {
                    if (i5 < 22) {
                        break;
                    }
                    byte[] bArr = new byte[i5];
                    try {
                        fileInputStream = new FileInputStream(file);
                        try {
                            fileInputStream.skip(length);
                            fileInputStream.read(bArr, 0, i5);
                        } catch (IOException e5) {
                            e4 = e5;
                        } catch (Throwable th6) {
                            th4 = th6;
                            if (fileInputStream != null) {
                            }
                            throw th4;
                        }
                    } catch (IOException e6) {
                        e4 = e6;
                        fileInputStream = null;
                        try {
                            e4.printStackTrace();
                        } catch (Throwable th7) {
                            th5 = th7;
                            fileInputStream2 = fileInputStream;
                            th4 = th5;
                            fileInputStream = fileInputStream2;
                            if (fileInputStream != null) {
                            }
                            throw th4;
                        }
                    } catch (Throwable th8) {
                        th5 = th8;
                        th4 = th5;
                        fileInputStream = fileInputStream2;
                        if (fileInputStream != null) {
                            try {
                                fileInputStream.close();
                            } catch (IOException e7) {
                                e7.printStackTrace();
                            }
                        }
                        throw th4;
                    }
                    try {
                        fileInputStream.close();
                    } catch (IOException e8) {
                        e8.printStackTrace();
                    }
                    ByteBuffer wrap = ByteBuffer.wrap(bArr);
                    ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
                    wrap.order(byteOrder);
                    if (wrap.order() == byteOrder) {
                        int capacity = wrap.capacity() - 22;
                        while (capacity >= 0) {
                            if (wrap.getInt(capacity) == 101010256 && (wrap.getShort(capacity + 20) & 65535) == i4) {
                                j2 = length + ((long) capacity);
                                break loop0;
                            }
                            capacity--;
                            i4++;
                        }
                        i5 = Math.min(i5, min - i4);
                        length -= (long) (i5 - 21);
                    } else {
                        throw new IllegalArgumentException("ByteBuffer byte order must be little endian");
                    }
                }
                i2 = (int) j2;
                aVar = new e.g.a.d.p.a(str);
                dataInputStream3 = new DataInputStream(aVar);
                try {
                    aVar.a((long) i2);
                    if (dataInputStream3.readInt() != 1347093766) {
                        dataInputStream3.readShort();
                        dataInputStream3.readShort();
                        dataInputStream3.readShort();
                        dataInputStream3.readShort();
                        dataInputStream3.readInt();
                        i3 = r0(dataInputStream3.readInt());
                        int s0 = s0(dataInputStream3.readShort());
                        byte[] bArr2 = new byte[s0];
                        if (s0 > 0) {
                            dataInputStream3.read(bArr2, 0, s0);
                        }
                        aVar.a((long) (i3 - 24));
                        long readLong = -1 & dataInputStream3.readLong();
                        aVar.a((long) (i3 - 16));
                        byte[] bArr3 = new byte[16];
                        aVar.read(bArr3);
                        if (new String(bArr3, "UTF-8").equals("APK Sig Block 42")) {
                            i3 = (i3 - ((int) ((((readLong >> 56) & 255) << 0) | (((((((((readLong >> 0) & 255) << 56) | (((readLong >> 8) & 255) << 48)) | (((readLong >> 16) & 255) << 40)) | (((readLong >> 24) & 255) << 32)) | (((readLong >> 32) & 255) << 24)) | (((readLong >> 40) & 255) << 16)) | (((readLong >> 48) & 255) << 8))))) - 8;
                        }
                        try {
                            dataInputStream3.close();
                        } catch (IOException e9) {
                            e9.printStackTrace();
                        }
                        String str2 = "";
                        if (i3 > 0) {
                            long j3 = (long) i3;
                            File file2 = new File(str);
                            if (!file2.exists() || file2.length() <= 0) {
                                q0.b("apkpatch-MD5", "filePath not exists! " + str);
                            } else if (file2.length() < j3 || j3 <= 0) {
                                StringBuilder Z = e.d.a.a.a.Z("Must be (length > endPos && endPos > startPos && startPos >= 0)!\t|length:");
                                Z.append(file2.length());
                                Z.append("|startPos:");
                                Z.append(0L);
                                Z.append("|endPos:");
                                Z.append(j3);
                                Z.append("\t|File:");
                                Z.append(file2.getPath());
                                throw new IllegalArgumentException(Z.toString());
                            } else {
                                try {
                                    FileInputStream fileInputStream3 = new FileInputStream(file2);
                                    try {
                                        str2 = e.g.a.d.q.a.b(fileInputStream3, 0, j3 - 0);
                                        try {
                                            fileInputStream3.close();
                                        } catch (IOException e10) {
                                            e10.printStackTrace();
                                        }
                                    } catch (FileNotFoundException e11) {
                                        e2 = e11;
                                        fileInputStream2 = fileInputStream3;
                                        try {
                                            e2.printStackTrace();
                                            if (fileInputStream2 != null) {
                                                fileInputStream2.close();
                                            }
                                            return str2;
                                        } catch (Throwable th9) {
                                            th3 = th9;
                                            if (fileInputStream2 != null) {
                                            }
                                            throw th3;
                                        }
                                    } catch (Throwable th10) {
                                        th3 = th10;
                                        fileInputStream2 = fileInputStream3;
                                        if (fileInputStream2 != null) {
                                            try {
                                                fileInputStream2.close();
                                            } catch (IOException e12) {
                                                e12.printStackTrace();
                                            }
                                        }
                                        throw th3;
                                    }
                                } catch (FileNotFoundException e13) {
                                    e2 = e13;
                                    e2.printStackTrace();
                                    if (fileInputStream2 != null) {
                                    }
                                    return str2;
                                }
                            }
                        }
                        return str2;
                    }
                    throw new IOException("signature != EndOfCentralDirRecord.SIGNATURE");
                } catch (Exception e14) {
                    e3 = e14;
                    dataInputStream2 = dataInputStream3;
                    try {
                        e3.printStackTrace();
                        if (dataInputStream2 != 0) {
                        }
                        i3 = -1;
                        String str22 = "";
                        if (i3 > 0) {
                        }
                        return str22;
                    } catch (Throwable th11) {
                        th2 = th11;
                        fileInputStream2 = dataInputStream2;
                        th = th2;
                        dataInputStream = fileInputStream2;
                        if (dataInputStream != 0) {
                        }
                        throw th;
                    }
                } catch (Throwable th12) {
                    th = th12;
                    dataInputStream = dataInputStream3;
                    if (dataInputStream != 0) {
                    }
                    throw th;
                }
            }
        }
        j2 = -1;
        i2 = (int) j2;
        try {
            aVar = new e.g.a.d.p.a(str);
            dataInputStream3 = new DataInputStream(aVar);
            aVar.a((long) i2);
            if (dataInputStream3.readInt() != 1347093766) {
            }
        } catch (Exception e15) {
            e3 = e15;
            dataInputStream2 = null;
            e3.printStackTrace();
            if (dataInputStream2 != 0) {
                try {
                    dataInputStream2.close();
                } catch (IOException e16) {
                    e16.printStackTrace();
                }
            }
            i3 = -1;
            String str222 = "";
            if (i3 > 0) {
            }
            return str222;
        } catch (Throwable th13) {
            th2 = th13;
            th = th2;
            dataInputStream = fileInputStream2;
            if (dataInputStream != 0) {
                try {
                    dataInputStream.close();
                } catch (IOException e17) {
                    e17.printStackTrace();
                }
            }
            throw th;
        }
    }

    public static void v0(Activity activity, ShineButton shineButton, TextView textView, LinearLayout linearLayout, CommentInfoProtos.CommentInfo commentInfo, String str, boolean z, p1.c cVar) {
        int i2;
        int i3;
        long j2 = commentInfo.supportLen;
        String str2 = commentInfo.voteStatus;
        boolean equals = TextUtils.equals(str2, "up");
        textView.setTextColor(equals ? e.g.a.s.l.a.X(activity) : e.g.a.s.l.a.h1(activity));
        String d = h0.d(j2 + "");
        if (!equals && !"down".equals(str2) && j2 == 0) {
            d = activity.getString(R.string.arg_RES_2131820827);
        }
        textView.setText(d);
        shineButton.f3780k = activity;
        ShineButton.a aVar = new ShineButton.a();
        shineButton.f3787r = aVar;
        shineButton.setOnClickListener(aVar);
        shineButton.setAnimDuration(ImageRequest.DEFAULT_IMAGE_TIMEOUT_MS);
        shineButton.setChecked(equals);
        shineButton.f3777h = i.i.d.a.d(shineButton.f3780k, R.drawable.arg_RES_2131231023);
        shineButton.f3778i = i.i.d.a.d(shineButton.f3780k, R.drawable.arg_RES_2131231022);
        shineButton.setUnCheckColor(z ? -1 : 0);
        shineButton.setMaskColor(0);
        if (e.g.a.s.l.a.e0(activity)) {
            i3 = i.i.d.a.b(activity, R.color.arg_RES_2131100474);
            i2 = R.color.arg_RES_2131100553;
        } else {
            i3 = i.i.d.a.b(activity, R.color.arg_RES_2131099829);
            i2 = R.color.arg_RES_2131100552;
        }
        int b = i.i.d.a.b(activity, i2);
        shineButton.setBigShineColor(i3);
        shineButton.setSmallShineColor(b);
        shineButton.setCheckColor(i3);
        shineButton.f();
        if (str != null) {
            cVar.f6560g = str;
        }
        cVar.f6561h = z;
        shineButton.setOnClickInterceptListener(new e.g.a.i.m0.h(activity));
        shineButton.setOnClickListener(cVar);
        linearLayout.setOnClickListener(new e.g.a.i.m0.f(shineButton));
    }

    public static GridLayoutManager w(Context context) {
        return new GridLayoutManager(context, 12);
    }

    public static CharSequence x(Context context, CommentInfoProtos.CommentInfo commentInfo, boolean z) {
        SpannableStringUtils.b bVar = new SpannableStringUtils.b(context);
        RichTextInfoProtos.RichTextInfo[] richTextInfoArr = commentInfo.richText;
        if (richTextInfoArr != null && richTextInfoArr.length > 0) {
            for (RichTextInfoProtos.RichTextInfo richTextInfo : richTextInfoArr) {
                if ("text".equals(richTextInfo.type)) {
                    String str = richTextInfo.msg;
                    bVar.a();
                    bVar.f2491a = str;
                }
            }
            if (z && commentInfo.children != null) {
                ComemntImageProtos.CommentImage[] commentImageArr = commentInfo.images;
                if (commentImageArr.length > 0) {
                    String format = String.format(" %s", f1.d(commentImageArr[0].original.url));
                    bVar.a();
                    bVar.f2491a = format;
                }
            }
        }
        bVar.a();
        return bVar.f2498k;
    }

    public static CharSequence y(Context context, CommentInfoProtos.CommentInfo commentInfo, boolean z) {
        ComemntImageProtos.CommentImage[] commentImageArr;
        SpannableStringUtils.b bVar = new SpannableStringUtils.b(context);
        String str = commentInfo.descriptionShort;
        bVar.a();
        bVar.f2491a = str;
        if (z && (commentImageArr = commentInfo.images) != null && commentImageArr.length > 0) {
            String format = String.format(" %s", f1.d(commentImageArr[0].original.url));
            bVar.a();
            bVar.f2491a = format;
        }
        bVar.a();
        return bVar.f2498k;
    }

    public static View z(Context context) {
        View inflate = View.inflate(context, R.layout.arg_RES_2131493255, null);
        inflate.setOnClickListener(new e.g.a.i.b0.h0(context));
        e.g.a.s.l.a.K0(inflate, 1099, "my_follow", 1, null);
        return inflate;
    }
}