添加log and crash 保存本地,分享。

This commit is contained in:
2025-11-11 10:48:20 +08:00
parent 0aca66ce84
commit 8d983bfa99
20 changed files with 231 additions and 130 deletions

View File

@@ -109,7 +109,6 @@ public class RetrofitClient {
sslContext.init(null, new TrustManager[]{trustAllCert}, new SecureRandom());
final OkHttpClient client = new OkHttpClient.Builder()
// .addInterceptor(new LogInterceptor())
.addInterceptor(new DataLoggingInterceptor(new DataLogger()))
.addInterceptor(new AccessTokenInterceptor(headers))
.proxy(Proxy.NO_PROXY)
@@ -129,31 +128,15 @@ public class RetrofitClient {
private Retrofit provideRetrofit(OkHttpClient client) {
return new Retrofit.Builder()
.addConverterFactory(MyConverterFactory.create())/**/
.addConverterFactory(MyConverterFactory.create())
// .addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
// .baseUrl("http://chat.qxmier.com/")
.baseUrl(CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl())
.client(client)
.build();
}
// private static Retrofit mRainRetrofit;
//
// public static Retrofit getRainRetrofit() {
// if (mRainRetrofit == null) {
// synchronized (RetrofitClient.class) {
// mRainRetrofit = new Retrofit.Builder()
// .addConverterFactory(RainConverterFactory.create())
// .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
// .baseUrl(BuildConfig.RAIN_GAME_BASE_URL)
// .client(client)
// .build();
// }
// }
// return mRainRetrofit;
// }
private RetrofitClient() {
mRetrofit = provideRetrofit(provideOkHttpClient());
@@ -201,11 +184,6 @@ public class RetrofitClient {
return mRetrofit.create(apiClientClass);
}
public void login() {
// login("18473492252", "123456");
// login("18229732986", "123456");
}
public void appUpdate(BaseObserver<AppUpdateModel> observer) {
sApiServer.appUpdate().compose(new DefaultTransformer<>()).subscribe(observer);
}
@@ -2808,7 +2786,6 @@ public class RetrofitClient {
}
public void firstChargeGift(BaseObserver<FirstChargeGiftBean> observer) {
// sApiServer.firstChargeGift().compose(new DefaultTransformer<>()).subscribe(observer);
sApiServer.firstChargeGift().enqueue(new Callback<BaseModel<FirstChargeGiftBean>>() {
@Override
public void onResponse(Call<BaseModel<FirstChargeGiftBean>> call, Response<BaseModel<FirstChargeGiftBean>> response) {