米多多 v3.0.1版本的 MD5 值为:f69e79dbe1787218a397ad907fb8f3ab

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


package c.j.c.d.a;

import c.a.a.q.i;
import c.g.b.f;
import com.alibaba.fastjson.support.spring.FastJsonJsonView;
import com.alibaba.sdk.android.oss.common.utils.HttpHeaders;
import com.alipay.alipaysecuritysdk.common.config.Constant;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
import h.j;
import h.m;
import java.io.File;
import java.util.concurrent.TimeUnit;
import okhttp3.Cache;
import okhttp3.CacheControl;
import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
public class b {
    public static b f5689e;
    public Retrofit f5690a;
    public c.j.c.d.a.c f5691b;
    public final Interceptor f5692c = new a(this);
    public final Interceptor f5693d = new C0138b(this);

    public class a implements Interceptor {
        public a(b bVar) {
        }

        @Override
        public Response intercept(Interceptor.Chain chain) {
            Request request = chain.request();
            if (!ComNetWorkUtil.b(c.a.a.a.a())) {
                request = request.newBuilder().cacheControl(CacheControl.FORCE_CACHE).build();
            }
            Response proceed = chain.proceed(request);
            if (ComNetWorkUtil.b(c.a.a.a.a())) {
                return proceed.newBuilder().header(HttpHeaders.CACHE_CONTROL, request.cacheControl().toString()).removeHeader("Pragma").build();
            }
            return proceed.newBuilder().header(HttpHeaders.CACHE_CONTROL, "public, only-if-cached, max-stale=172800").removeHeader("Pragma").build();
        }
    }

    public class C0138b implements Interceptor {
        public C0138b(b bVar) {
        }

        @Override
        public Response intercept(Interceptor.Chain chain) {
            return chain.proceed(chain.request().newBuilder().addHeader(HttpHeaders.CONTENT_TYPE, FastJsonJsonView.DEFAULT_CONTENT_TYPE).addHeader("token", (String) i.b("APP_TOKEN", "")).addHeader("ClientType", Constant.SDK_OS).addHeader("ClientVersion", c.a.a.q.b.a(c.a.a.a.a())).build());
        }
    }

    public static class c implements Interceptor {

        public class a extends RequestBody {
            public final RequestBody f5694a;

            public a(c cVar, RequestBody requestBody) {
                this.f5694a = requestBody;
            }

            @Override
            public long contentLength() {
                return -1L;
            }

            @Override
            public MediaType contentType() {
                return this.f5694a.contentType();
            }

            @Override
            public void writeTo(h.d dVar) {
                h.d c2 = m.c(new j(dVar));
                this.f5694a.writeTo(c2);
                c2.close();
            }
        }

        public final RequestBody a(RequestBody requestBody) {
            return new a(this, requestBody);
        }

        @Override
        public Response intercept(Interceptor.Chain chain) {
            Request request = chain.request();
            if (request.body() != null && request.header(HttpHeaders.CONTENT_ENCODING) == null) {
                return chain.proceed(request.newBuilder().header(HttpHeaders.CONTENT_ENCODING, "gzip").method(request.method(), a(request.body())).build());
            }
            return chain.proceed(request);
        }
    }

    public b() {
        if (!c.j.c.d.d.a.f5740a.b() && !c.j.c.d.d.a.f5740a.c()) {
            OkHttpClient b2 = b();
            f fVar = new f();
            fVar.d("yyyy-MM-dd'T'HH:mm:ssZ");
            fVar.c();
            Retrofit build = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(fVar.b())).addCallAdapterFactory(RxJavaCallAdapterFactory.create()).client(b2).baseUrl(d.f5699e).build();
            this.f5690a = build;
            this.f5691b = (c.j.c.d.a.c) build.create(c.j.c.d.a.c.class);
            return;
        }
        OkHttpClient b3 = b();
        f fVar2 = new f();
        fVar2.d("yyyy-MM-dd'T'HH:mm:ssZ");
        fVar2.c();
        Retrofit build2 = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(fVar2.b())).addCallAdapterFactory(RxJavaCallAdapterFactory.create()).client(b3).baseUrl("http://www.beizhuabao.com").build();
        this.f5690a = build2;
        this.f5691b = (c.j.c.d.a.c) build2.create(c.j.c.d.a.c.class);
    }

    public static c.j.c.d.a.c a() {
        b bVar = new b();
        f5689e = bVar;
        return bVar.f5691b;
    }

    public final OkHttpClient b() {
        HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
        httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        return new OkHttpClient.Builder().readTimeout(30000L, TimeUnit.MILLISECONDS).connectTimeout(30000L, TimeUnit.MILLISECONDS).addInterceptor(httpLoggingInterceptor).addInterceptor(this.f5692c).addInterceptor(new c()).addNetworkInterceptor(this.f5692c).addInterceptor(this.f5693d).cache(new Cache(new File(c.a.a.a.a().getCacheDir(), "cache"), 104857600L)).build();
    }
}