星辰影院解锁vip v1.0.4版本的 MD5 值为:3d99bbcbb0d5d5e568b9f6134424c24e

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


package com.qiyi.qyapm.agent.android.g;

import com.iqiyi.qyverificationcenter.bean.QYVerifyConstants;
import com.sensorsdata.analytics.android.sdk.data.adapter.DbParams;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.json.JSONObject;

public class c {

    public static class a implements Callback {
        final b a;

        final String f8938b;

        a(b bVar, String str) {
            this.a = bVar;
            this.f8938b = str;
        }

        @Override
        public void onFailure(Call call, IOException iOException) {
            com.qiyi.qyapm.agent.android.e.a.a("APM upLoadFile fail !");
            this.a.a(false, this.f8938b, "-33", iOException.toString(), "");
        }

        @Override
        public void onResponse(Call call, Response response) throws IOException {
            if (response.isSuccessful()) {
                String string = response.body().string();
                try {
                    JSONObject jSONObject = new JSONObject(string);
                    if (QYVerifyConstants.VerifyResponCode.kSuccess.equals(jSONObject.getString("code"))) {
                        this.a.a(true, this.f8938b, "0", string, jSONObject.getJSONObject(DbParams.KEY_DATA).getString("httpInnerUrl"));
                    } else {
                        this.a.a(false, this.f8938b, "-32", string, "");
                    }
                    return;
                } catch (Exception unused) {
                    String format = String.format("APM upLoadFile response josn decode fail %s", string);
                    com.qiyi.qyapm.agent.android.e.a.a(format);
                    this.a.a(false, this.f8938b, "-34", format, "");
                    return;
                }
            }
            com.qiyi.qyapm.agent.android.e.a.a("APM upLoadFile response fail !");
            this.a.a(false, this.f8938b, "-35", "APM upLoadFile response fail !", "");
        }
    }

    public interface b {
        void a(boolean z, String str, String str2, String str3, String str4);
    }

    public static void a(String str, String str2, String str3, b bVar) {
        File file = new File(str2);
        if (file.exists()) {
            HashMap hashMap = new HashMap();
            hashMap.put("access_token", str3);
            hashMap.put("file_type", file.getName().substring(file.getName().lastIndexOf(".") + 1, file.getName().length()).toLowerCase());
            hashMap.put("file", file);
            b("http://secupload.iqiyi.com/common_upload", str2, hashMap, str, bVar);
            return;
        }
        bVar.a(false, str2, "-31", "no such file:" + str2, "");
    }

    public static void b(String str, String str2, HashMap<String, Object> hashMap, String str3, b bVar) {
        try {
            OkHttpClient build = new OkHttpClient.Builder().build();
            String format = String.format(str, new Object[0]);
            MultipartBody.Builder builder = new MultipartBody.Builder();
            builder.setType(MultipartBody.FORM);
            for (String str4 : hashMap.keySet()) {
                Object obj = hashMap.get(str4);
                if (!(obj instanceof File)) {
                    builder.addFormDataPart(str4, obj.toString());
                } else {
                    File file = (File) obj;
                    builder.addFormDataPart(str4, file.getName(), RequestBody.create((MediaType) null, file));
                }
            }
            build.newBuilder().writeTimeout(50L, TimeUnit.SECONDS).build().newCall(new Request.Builder().url(format).post(builder.build()).build()).enqueue(new a(bVar, str2));
        } catch (Exception e2) {
            com.qiyi.qyapm.agent.android.e.a.a(String.format("APM upLoadFile exception %s", e2));
        }
    }
}