package com.tencent.mm.plugin.cdndownloader.service;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.i.c;
import com.tencent.mm.i.d;
import com.tencent.mm.i.g.a;
import com.tencent.mm.sdk.platformtools.ab;
import java.io.ByteArrayOutputStream;

class CDNDownloadService$2 implements a {
    CDNDownloadService$2() {
    }

    public final int a(String str, int i, c cVar, d dVar, boolean z) {
        String str2;
        AppMethodBeat.i(948);
        String str3 = "MicroMsg.CDNDownloadService";
        String str4 = "on cdn callback mediaId = %s, startRet = %d, keep_ProgressInfo = %s, keep_SceneResult = %s";
        Object[] objArr = new Object[4];
        objArr[0] = str;
        objArr[1] = Integer.valueOf(i);
        objArr[2] = cVar == null ? "null" : cVar.toString();
        if (dVar == null) {
            str2 = "null";
        } else {
            str2 = dVar.toString();
        }
        objArr[3] = str2;
        ab.d(str3, str4, objArr);
        if (i == -21006) {
            ab.i("MicroMsg.CDNDownloadService", "duplicate request, ignore this request, media id is %s", new Object[]{str});
            AppMethodBeat.o(948);
        } else if (i != 0) {
            ab.e("MicroMsg.CDNDownloadService", "start failed : %d, media id is :%s", new Object[]{Integer.valueOf(i), str});
            CDNDownloadService.O(str, 4, i);
            AppMethodBeat.o(948);
        } else if (cVar != null) {
            CDNDownloadService.n(str, (long) cVar.field_finishedLength, (long) cVar.field_toltalLength);
            AppMethodBeat.o(948);
        } else {
            if (dVar != null) {
                if (dVar.field_retCode != 0) {
                    ab.e("MicroMsg.CDNDownloadService", "cdntra clientid:%s sceneResult.retCode:%d sceneResult[%s]", new Object[]{str, Integer.valueOf(dVar.field_retCode), dVar});
                    CDNDownloadService.O(str, 4, dVar.field_retCode);
                } else {
                    ab.i("MicroMsg.CDNDownloadService", "cdn trans suceess, media id : %s", new Object[]{str});
                    CDNDownloadService.O(str, 3, 0);
                }
            }
            AppMethodBeat.o(948);
        }
        return 0;
    }

    public final void a(String str, ByteArrayOutputStream byteArrayOutputStream) {
    }

    public final byte[] l(String str, byte[] bArr) {
        return new byte[0];
    }
}
