[8.5.0]
[singapore] [改为华为云对象存储obs]
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
package com.mogo.och.common.module.utils;
|
||||
|
||||
import com.mogo.cloud.network.OkHttpFactory;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
public class CollectionUtils {
|
||||
public static void setInterceptor(){
|
||||
OkHttpClient okHttpClient = OkHttpFactory.Companion.getOkHttpClient();
|
||||
List<Interceptor> interceptors = okHttpClient.interceptors();
|
||||
Field pro = getDeclaredField(interceptors, "list");
|
||||
if(pro != null){
|
||||
pro.setAccessible(true);
|
||||
List<Interceptor> modifierList;
|
||||
try {
|
||||
modifierList = (List<Interceptor>) pro.get(interceptors);
|
||||
if(modifierList != null){
|
||||
modifierList.add(new SimpleInterceptor());
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获得名为field的字段
|
||||
* @Description:如果本身找不到去父类寻找
|
||||
* @param object
|
||||
* @param fieldName
|
||||
* @return Field
|
||||
* @author luhao
|
||||
* @since:2019年2月26日 下午4:06:16
|
||||
*/
|
||||
public static Field getDeclaredField(Object object, String fieldName){
|
||||
if(fieldName == null){
|
||||
return null;
|
||||
}
|
||||
Field field;
|
||||
Class<?> clazz = object.getClass() ;
|
||||
for(; clazz != Object.class ; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
field = clazz.getDeclaredField(fieldName) ;
|
||||
return field ;
|
||||
} catch (Exception e) {
|
||||
//这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
|
||||
//如果这里的异常打印或者往外抛,则就不会执行clazz = clazz.getSuperclass(),最后就不会进入到父类中了
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.och.common.module.utils
|
||||
|
||||
import android.util.Log
|
||||
import okhttp3.*
|
||||
|
||||
class SimpleInterceptor: Interceptor {
|
||||
var first = true;
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val original = chain.request()
|
||||
val encodedPath = original.url().encodedPath()
|
||||
Log.e("SimpleInterceptor",original.method()+ encodedPath+original.url().encodedQuery())
|
||||
when (encodedPath) {
|
||||
"/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/startOperation" -> {
|
||||
val builder = Response.Builder()
|
||||
val create = ResponseBody.create(MediaType.parse("application/json"), "{\"code\":100006,\"msg\":\"\",\"data\":null}")
|
||||
builder.code(200)
|
||||
builder.request(original)
|
||||
builder.protocol(Protocol.HTTP_1_1)
|
||||
builder.message("")
|
||||
return builder.body(create).build()
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
return chain.proceed(original)
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,9 @@ import com.mogo.eagle.core.utilcode.util.ProcessUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService
|
||||
import com.mogo.service.v2n.MGV2NConst
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import com.zhidao.cosupload.utils.CosLogger
|
||||
import com.zhidao.cosupload.utils.`object`.ObjectType
|
||||
import com.zhidao.cosupload.utils.`object`.ObjectTypeManager
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import ly.count.android.sdk.Countly
|
||||
@@ -123,6 +126,8 @@ class HttpDnsStartUp : AndroidStartup<Boolean>(), IMoGoCloudListener {
|
||||
// "--",
|
||||
// "--",
|
||||
// "--")
|
||||
CosLogger.setLogStatus(true)
|
||||
ObjectTypeManager.getInstance().objectType = ObjectType.Obs
|
||||
//监听cert文件下载
|
||||
CallerCloudListenerManager.addListener(TAG,this)
|
||||
// 设置网络环境:HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
|
||||
|
||||
@@ -61,7 +61,7 @@ bytex.ASM_API=ASM7
|
||||
|
||||
################ 外部依赖引用 ################w
|
||||
# loglib
|
||||
LOGLIB_VERSION=1.10.22
|
||||
LOGLIB_VERSION=1.11.0
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.4.7.65
|
||||
|
||||
Reference in New Issue
Block a user