正在查看: 多多分期 v4.1.2 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 多多分期 v4.1.2 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package d.i.b.d.a;
import com.alibaba.fastjson.support.spring.FastJsonJsonView;
import com.alipay.alipaysecuritysdk.common.config.Constant;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
import d.b.a.r.j;
import java.io.File;
import java.util.concurrent.TimeUnit;
import k.m;
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 f6818e;
public Retrofit f6819a;
public d.i.b.d.a.c f6820b;
public final Interceptor f6821c = new a(this);
public final Interceptor f6822d = new C0125b(this);
public class a implements Interceptor {
public a(b bVar) {
}
@Override
public Response intercept(Interceptor.Chain chain) {
Request request = chain.request();
if (!ComNetWorkUtil.b(d.b.a.a.a())) {
request = request.newBuilder().cacheControl(CacheControl.FORCE_CACHE).build();
}
Response proceed = chain.proceed(request);
if (!ComNetWorkUtil.b(d.b.a.a.a())) {
return proceed.newBuilder().header("Cache-Control", "public, only-if-cached, max-stale=172800").removeHeader("Pragma").build();
}
return proceed.newBuilder().header("Cache-Control", request.cacheControl().toString()).removeHeader("Pragma").build();
}
}
public class C0125b implements Interceptor {
public C0125b(b bVar) {
}
@Override
public Response intercept(Interceptor.Chain chain) {
return chain.proceed(chain.request().newBuilder().addHeader("Content-Type", FastJsonJsonView.DEFAULT_CONTENT_TYPE).addHeader("token", (String) j.b("APP_TOKEN", "")).addHeader("ClientType", Constant.SDK_OS).addHeader("ClientVersion", d.b.a.r.b.a(d.b.a.a.a())).build());
}
}
public static class c implements Interceptor {
public class a extends RequestBody {
public final RequestBody f6823a;
public a(c cVar, RequestBody requestBody) {
this.f6823a = requestBody;
}
@Override
public long contentLength() {
return -1L;
}
@Override
public MediaType contentType() {
return this.f6823a.contentType();
}
@Override
public void writeTo(k.d dVar) {
k.d c2 = m.c(new k.j(dVar));
this.f6823a.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();
return (request.body() == null || request.header("Content-Encoding") != null) ? chain.proceed(request) : chain.proceed(request.newBuilder().header("Content-Encoding", "gzip").method(request.method(), a(request.body())).build());
}
}
public b() {
if (d.i.b.d.d.a.f6876a.b() || d.i.b.d.d.a.f6876a.c()) {
OkHttpClient b2 = b();
d.l.b.f fVar = new d.l.b.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("http://www.beizhuabao.com").build();
this.f6819a = build;
this.f6820b = (d.i.b.d.a.c) build.create(d.i.b.d.a.c.class);
return;
}
OkHttpClient b3 = b();
d.l.b.f fVar2 = new d.l.b.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(d.f6828e).build();
this.f6819a = build2;
this.f6820b = (d.i.b.d.a.c) build2.create(d.i.b.d.a.c.class);
}
public static d.i.b.d.a.c a() {
b bVar = new b();
f6818e = bVar;
return bVar.f6820b;
}
public final OkHttpClient b() {
new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY);
return new OkHttpClient.Builder().readTimeout(30000L, TimeUnit.MILLISECONDS).connectTimeout(30000L, TimeUnit.MILLISECONDS).addInterceptor(this.f6821c).addInterceptor(new c()).addNetworkInterceptor(this.f6821c).addInterceptor(this.f6822d).cache(new Cache(new File(d.b.a.a.a().getCacheDir(), "cache"), 104857600L)).build();
}
}