package com.tencent.mm.plugin.webview.luggage.jsapi;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.View;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.a.g;
import com.tencent.mm.at.a.c.i;
import com.tencent.mm.modelsfs.FileOp;
import com.tencent.mm.plugin.emoji.h.b;
import com.tencent.mm.plugin.emoji.model.EmojiLogic;
import com.tencent.mm.plugin.webview.luggage.jsapi.bc.a;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;
import java.io.File;

class b$1 implements i {
    final /* synthetic */ String fEJ;
    final /* synthetic */ a kOx;
    final /* synthetic */ String ujP;
    final /* synthetic */ b ujQ;
    final /* synthetic */ Context val$context;

    b$1(b bVar, String str, Context context, String str2, a aVar) {
        this.ujQ = bVar;
        this.ujP = str;
        this.val$context = context;
        this.fEJ = str2;
        this.kOx = aVar;
    }

    public final void a(String str, View view, Bitmap bitmap, Object... objArr) {
        AppMethodBeat.i(6273);
        ab.i("MicroMsg.JsApiAddToEmotion", "imageLoaderListener onImageLoadComplete %s", new Object[]{str});
        if (bitmap != null && objArr != null && objArr.length > 0 && objArr[0] != null && (objArr[0] instanceof String) && str.equals(this.ujP)) {
            File file = new File(objArr[0].toString());
            if (file.exists()) {
                String v = g.v(file);
                FileOp.y(file.getAbsolutePath(), EmojiLogic.L(b.Yb(), BuildConfig.FLAVOR, v));
                b.b(this.val$context, v, this.fEJ, this.kOx);
                AppMethodBeat.o(6273);
                return;
            }
        }
        this.kOx.d("fail", null);
        AppMethodBeat.o(6273);
    }
}
