package com.tencent.mm.plugin.appbrand.jsapi.s;

import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import com.tencent.luggage.g.d;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.jsapi.s.b.1;
import com.tencent.ytcommon.BuildConfig;

class b$1$1 implements Runnable {
    final /* synthetic */ byte[] ibu;
    final /* synthetic */ 1 ibv;

    b$1$1(1 1, byte[] bArr) {
        this.ibv = 1;
        this.ibu = bArr;
    }

    public final void run() {
        AppMethodBeat.i(126628);
        if (this.ibu == null || this.ibu.length == 0) {
            AppMethodBeat.o(126628);
            return;
        }
        int i;
        byte[] bArr = this.ibu;
        if (bArr != null && bArr.length > 0) {
            boolean i2;
            Options options = new Options();
            options.inJustDecodeBounds = true;
            BitmapFactory.decodeByteArray(bArr, 0, bArr.length, options);
            String str = options.outMimeType;
            d.v("Util", "imageType:%s", new Object[]{str});
            i2 = -1;
            switch (str.hashCode()) {
                case -879299344:
                    if (str.equals("image/GIF")) {
                        i2 = true;
                        break;
                    }
                    break;
                case -879267568:
                    if (str.equals("image/gif")) {
                        i2 = 0;
                        break;
                    }
                    break;
            }
            switch (i2) {
                case 0:
                case 1:
                    i2 = true;
                    break;
                default:
                    i2 = 0;
                    break;
            }
        }
        i2 = 0;
        if (i2 != 0) {
            this.ibv.ibt.setImageByteArray(this.ibu);
            AppMethodBeat.o(126628);
            return;
        }
        try {
            this.ibv.ibt.setImageBitmap(com.tencent.mm.sdk.platformtools.d.bQ(this.ibu));
            AppMethodBeat.o(126628);
        } catch (Exception e) {
            d.c("Luggage.ViewAttributeHelper", BuildConfig.FLAVOR, new Object[]{e});
            AppMethodBeat.o(126628);
        }
    }
}
