酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

以下内容为反编译后的 ImageUploadProtocol.java 源代码,内容仅作参考


package com.kugou.android.musiczone.protocol;

import android.support.annotation.WorkerThread;
import android.text.TextUtils;
import c.b;
import c.c.o;
import c.c.u;
import c.s;
import c.t;
import com.kugou.common.msgcenter.f.r;
import com.kugou.common.network.w;
import com.kugou.common.utils.as;
import com.kugou.common.utils.ba;
import com.kugou.common.utils.br;
import com.kugou.fanxing.base.entity.PtcBaseEntity;
import d.z;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class ImageUploadProtocol {

    private interface a {
        @o
        b<Result> a(@c.c.a z zVar, @u Map<String, Object> map);
    }

    @WorkerThread
    public String a(String str, String str2) {
        File file;
        Result d2;
        s<Result> sVar = null;
        try {
            file = new File(str);
        } catch (Exception e2) {
            if (as.f54365e) {
                as.b("lmr", "upload image file error : " + e2.toString());
            } else {
                as.e(e2);
            }
            file = null;
        }
        if (file == null || !file.exists()) {
            return "";
        }
        t b2 = new t.a().b("uploadImage").a(c.b.a.a.a()).a(w.a(com.kugou.android.app.a.a.h, "http://imgphp.kugou.com/imageupload/stream.php")).a().b();
        z a2 = z.a(d.u.a("application/octet-stream"), file);
        HashMap hashMap = new HashMap();
        hashMap.put("type", str2);
        hashMap.put("extendName", ".jpg");
        hashMap.put("md5", new ba().a(r.a(br.d(), "yyyyMMdd") + "hewry678WEK23D"));
        hashMap.put("jsonResponse", 1);
        try {
            sVar = ((a) b2.a(a.class)).a(a2, hashMap).a();
        } catch (IOException e3) {
            if (as.f54365e) {
                as.b("lmr", "upload image net error : " + e3.toString());
            } else {
                as.e(e3);
            }
        }
        if (sVar == null || !sVar.c() || (d2 = sVar.d()) == null) {
            return "";
        }
        if (d2.IsSuccess) {
            return d2.FileName;
        }
        if (TextUtils.isEmpty(d2.Message) || !as.f54365e) {
            return "";
        }
        as.b("lmr", "upload image result error message " + d2.Message);
        return "";
    }

    private static class Result implements PtcBaseEntity {
        String FileName;
        boolean IsSuccess = false;
        String Message;

        private Result() {
        }
    }
}