diff --git a/.idea/misc.xml b/.idea/misc.xml index 21e99e2dc0..cd77a1f062 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 2aaeb5eaae..0354ef8f5f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -245,15 +245,10 @@ dependencies { implementation rootProject.ext.dependencies.carcallprovider implementation rootProject.ext.dependencies.carcall - implementation rootProject.ext.dependencies.moduletanlu, { exclude group: 'com.mogo.module', module: 'module-share' } - implementation rootProject.ext.dependencies.modulepushbase - launcherImplementation rootProject.ext.dependencies.modulepush - independentImplementation rootProject.ext.dependencies.modulepushnoop - if (Boolean.valueOf(RELEASE)) { launcherImplementation rootProject.ext.dependencies.modulemainlauncher independentImplementation rootProject.ext.dependencies.modulemainindependent @@ -262,67 +257,29 @@ dependencies { implementation rootProject.ext.dependencies.modulesearch implementation rootProject.ext.dependencies.mogomoduleguide implementation rootProject.ext.dependencies.mogomoduleauth - debugImplementation rootProject.ext.dependencies.gpssimulatordebug - releaseImplementation rootProject.ext.dependencies.gpssimulatornoop implementation rootProject.ext.dependencies.modulemedia implementation rootProject.ext.dependencies.moduleservice implementation rootProject.ext.dependencies.modulesplash implementation rootProject.ext.dependencies.moduleV2x - // 事件面板分渠道引用 - d82xImplementation rootProject.ext.dependencies.moduleventpanelnoop - em1Implementation rootProject.ext.dependencies.moduleventpanelnoop - bydImplementation rootProject.ext.dependencies.moduleventpanelnoop - d8xxImplementation rootProject.ext.dependencies.moduleventpanel - em4Implementation rootProject.ext.dependencies.moduleventpanel - e8xxImplementation rootProject.ext.dependencies.moduleventpanel - f8xxImplementation rootProject.ext.dependencies.moduleventpanel - em3Implementation rootProject.ext.dependencies.moduleventpanel - // 左侧面板分渠道引用 - d82xImplementation rootProject.ext.dependencies.moduleleftpanel - em1Implementation rootProject.ext.dependencies.moduleleftpanel - bydImplementation rootProject.ext.dependencies.moduleleftpanel - d8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop - em4Implementation rootProject.ext.dependencies.moduleleftpanelnoop - e8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop - e8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop - f8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop - em3Implementation rootProject.ext.dependencies.moduleleftpanelnoop } else { launcherImplementation project(':main-extensions:mogo-module-main-launcher') -// launcherImplementation project(':modules:mogo-module-main') independentImplementation project(':main-extensions:mogo-module-main-independent') implementation project(':foudations:mogo-commons') implementation project(':modules:mogo-module-common') implementation project(':modules:mogo-module-search') implementation project(':modules:mogo-module-guide') implementation project(':modules:mogo-module-authorize') - debugImplementation project(':modules:mogo-module-gps-simulator-debug') - releaseImplementation project(':modules:mogo-module-gps-simulator-noop') implementation project(':modules:mogo-module-media') implementation project(':modules:mogo-module-service') implementation project(':modules:mogo-module-splash') implementation project(':modules:mogo-module-v2x') - // 事件面板分渠道引用 - d82xImplementation project(':modules:mogo-module-event-panel-noop') - em1Implementation project(':modules:mogo-module-event-panel-noop') - bydImplementation project(':modules:mogo-module-event-panel-noop') - d8xxImplementation project(':modules:mogo-module-event-panel') - em4Implementation project(':modules:mogo-module-event-panel') - e8xxImplementation project(':modules:mogo-module-event-panel') - f8xxImplementation project(':modules:mogo-module-event-panel') - em3Implementation project(':modules:mogo-module-event-panel') - // 左侧面板分渠道引用 - d82xImplementation project(':modules:mogo-module-left-panel') - em1Implementation project(':modules:mogo-module-left-panel') - bydImplementation project(':modules:mogo-module-left-panel') - d8xxImplementation project(':modules:mogo-module-left-panel-noop') - em4Implementation project(':modules:mogo-module-left-panel-noop') - e8xxImplementation project(':modules:mogo-module-left-panel-noop') - f8xxImplementation project(':modules:mogo-module-left-panel-noop') - em3Implementation project(':modules:mogo-module-left-panel-noop') } apply from: "./functions/baseservices.gradle" + apply from: "./functions/socketpush.gradle" + apply from: "./functions/gpssimulator.gradle" + apply from: "./functions/eventpanel.gradle" + apply from: "./functions/leftpanel.gradle" } //android.applicationVariants.all { variant -> @@ -385,6 +342,7 @@ def getGitCommit() { } afterEvaluate { + it.getTasks().iterator().forEachRemaining { def nameLowCase = it.name diff --git a/app/functions/eventpanel.gradle b/app/functions/eventpanel.gradle new file mode 100644 index 0000000000..c1acd256e7 --- /dev/null +++ b/app/functions/eventpanel.gradle @@ -0,0 +1,25 @@ +// 道路事件操作面板 + +project.dependencies { + if (Boolean.valueOf(RELEASE)) { + d82xImplementation rootProject.ext.dependencies.moduleventpanelnoop + em1Implementation rootProject.ext.dependencies.moduleventpanelnoop + bydImplementation rootProject.ext.dependencies.moduleventpanelnoop + + d8xxImplementation rootProject.ext.dependencies.moduleventpanel + em4Implementation rootProject.ext.dependencies.moduleventpanel + e8xxImplementation rootProject.ext.dependencies.moduleventpanel + f8xxImplementation rootProject.ext.dependencies.moduleventpanel + em3Implementation rootProject.ext.dependencies.moduleventpanel + } else { + d82xImplementation project(':modules:mogo-module-event-panel-noop') + em1Implementation project(':modules:mogo-module-event-panel-noop') + bydImplementation project(':modules:mogo-module-event-panel-noop') + + d8xxImplementation project(':modules:mogo-module-event-panel') + em4Implementation project(':modules:mogo-module-event-panel') + e8xxImplementation project(':modules:mogo-module-event-panel') + f8xxImplementation project(':modules:mogo-module-event-panel') + em3Implementation project(':modules:mogo-module-event-panel') + } +} \ No newline at end of file diff --git a/app/functions/gpssimulator.gradle b/app/functions/gpssimulator.gradle new file mode 100644 index 0000000000..c33febbc07 --- /dev/null +++ b/app/functions/gpssimulator.gradle @@ -0,0 +1,11 @@ +// 基于后台轨迹模拟的gps模拟服务 + +project.dependencies { + if (Boolean.valueOf(RELEASE)) { + debugImplementation rootProject.ext.dependencies.gpssimulatordebug + releaseImplementation rootProject.ext.dependencies.gpssimulatornoop + } else { + debugImplementation project(':modules:mogo-module-gps-simulator-debug') + releaseImplementation project(':modules:mogo-module-gps-simulator-noop') + } +} \ No newline at end of file diff --git a/app/functions/leftpanel.gradle b/app/functions/leftpanel.gradle new file mode 100644 index 0000000000..9a1aa18c98 --- /dev/null +++ b/app/functions/leftpanel.gradle @@ -0,0 +1,26 @@ +// 辅助驾驶占位模块,目前部分车机不上辅助驾驶功能,使用该模块能力代替 + +project.dependencies { + if (Boolean.valueOf(RELEASE)) { + d82xImplementation rootProject.ext.dependencies.moduleleftpanel + em1Implementation rootProject.ext.dependencies.moduleleftpanel + bydImplementation rootProject.ext.dependencies.moduleleftpanel + + d8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop + em4Implementation rootProject.ext.dependencies.moduleleftpanelnoop + e8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop + e8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop + f8xxImplementation rootProject.ext.dependencies.moduleleftpanelnoop + em3Implementation rootProject.ext.dependencies.moduleleftpanelnoop + } else { + d82xImplementation project(':modules:mogo-module-left-panel') + em1Implementation project(':modules:mogo-module-left-panel') + bydImplementation project(':modules:mogo-module-left-panel') + + d8xxImplementation project(':modules:mogo-module-left-panel-noop') + em4Implementation project(':modules:mogo-module-left-panel-noop') + e8xxImplementation project(':modules:mogo-module-left-panel-noop') + f8xxImplementation project(':modules:mogo-module-left-panel-noop') + em3Implementation project(':modules:mogo-module-left-panel-noop') + } +} \ No newline at end of file diff --git a/app/functions/socketpush.gradle b/app/functions/socketpush.gradle new file mode 100644 index 0000000000..ef9923abfd --- /dev/null +++ b/app/functions/socketpush.gradle @@ -0,0 +1,7 @@ +// 基于socket长链的push推送 + +project.dependencies { + implementation rootProject.ext.dependencies.modulepushbase + launcherImplementation rootProject.ext.dependencies.modulepush + independentImplementation rootProject.ext.dependencies.modulepushnoop +} \ No newline at end of file diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index c2904fda00..3449fdb765 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -9,8 +9,6 @@ import com.auto.zhidao.logsdk.CrashSystem; import com.bytedance.boost_multidex.BoostMultiDex; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; -import com.mogo.map.location.IMogoLocationListener; -import com.mogo.map.location.MogoLocation; import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant; import com.mogo.module.carchatting.card.CallChatConstant; import com.mogo.module.common.MogoModule; @@ -23,8 +21,6 @@ import com.mogo.module.tanlu.constant.TanluConstants; import com.mogo.module.v2x.V2XConst; import com.mogo.service.IMogoServiceApis; import com.mogo.service.MogoServicePaths; -import com.mogo.service.connection.IMogoSocketManager; -import com.mogo.service.passport.IMogoPassportManager; import com.mogo.service.passport.IMogoTicketCallback; import com.mogo.utils.UiThreadHandler; import com.mogo.utils.logger.LogLevel; diff --git a/foudations/mogo-base-services-sdk/build.gradle b/foudations/mogo-base-services-sdk/build.gradle index 1dd7e70249..20fc05604d 100644 --- a/foudations/mogo-base-services-sdk/build.gradle +++ b/foudations/mogo-base-services-sdk/build.gradle @@ -30,11 +30,11 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation rootProject.ext.dependencies.arouter // 上报位置 - implementation 'com.zhidao.locupload:loc-upload-sdk:1.0.6' + implementation 'com.zhidao.locupload:loc-upload-sdk:1.0.9' // 长链 - implementation 'com.zhidao.socket:built-in-socket:1.0.11' + implementation 'com.zhidao.socket:built-in-socket:1.0.13' // passport - implementation 'com.zhidao.tcloginsdk:tclogin:1.0.6' + implementation 'com.zhidao.tcloginsdk:tclogin:1.0.7' annotationProcessor 'com.elegant.spi:compiler:1.0.3' diff --git a/foudations/mogo-connection/.gitignore b/foudations/mogo-connection/.gitignore deleted file mode 100644 index 796b96d1c4..0000000000 --- a/foudations/mogo-connection/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/foudations/mogo-connection/build.gradle b/foudations/mogo-connection/build.gradle deleted file mode 100644 index db342def5f..0000000000 --- a/foudations/mogo-connection/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'com.alibaba.arouter' - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - // buildToolsVersion rootProject.ext.android.buildToolsVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - - javaCompileOptions { - annotationProcessorOptions { - arguments = [AROUTER_MODULE_NAME: project.getName()] - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - api rootProject.ext.dependencies.socketsdk - api rootProject.ext.dependencies.socketsdkconnsvrprotoco - api rootProject.ext.dependencies.socketsdkprotobufjava - implementation rootProject.ext.dependencies.arouter - annotationProcessor rootProject.ext.dependencies.aroutercompiler - - if (Boolean.valueOf(RELEASE)) { - implementation rootProject.ext.dependencies.mogoutils - implementation rootProject.ext.dependencies.mogoserviceapi - } else { - implementation project(":foudations:mogo-utils") - implementation project(":services:mogo-service-api") - } -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/foudations/mogo-connection/consumer-rules.pro b/foudations/mogo-connection/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/foudations/mogo-connection/gradle.properties b/foudations/mogo-connection/gradle.properties deleted file mode 100644 index 3bf188938f..0000000000 --- a/foudations/mogo-connection/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.connection -POM_ARTIFACT_ID=mogo-connection -VERSION_CODE=1 diff --git a/foudations/mogo-connection/proguard-rules.pro b/foudations/mogo-connection/proguard-rules.pro deleted file mode 100644 index f1b424510d..0000000000 --- a/foudations/mogo-connection/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/foudations/mogo-connection/src/main/AndroidManifest.xml b/foudations/mogo-connection/src/main/AndroidManifest.xml deleted file mode 100644 index 639efc7d99..0000000000 --- a/foudations/mogo-connection/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/SocketManager.java b/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/SocketManager.java deleted file mode 100644 index 2faf7b6bed..0000000000 --- a/foudations/mogo-connection/src/main/java/com/mogo/connection/socket/SocketManager.java +++ /dev/null @@ -1,223 +0,0 @@ -package com.mogo.connection.socket; - -import android.content.Context; - -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; -import com.mogo.map.listener.IMogoMapListener; -import com.mogo.service.connection.IMessageResponse; -import com.mogo.service.connection.IMogoMsgAckListener; -import com.mogo.service.connection.IMogoOnMessageListener; -import com.mogo.service.connection.IMogoSocketManager; -import com.mogo.service.connection.MsgBody; -import com.mogo.utils.logger.Logger; -import com.mogo.utils.network.utils.GsonUtil; -import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon; -import com.zhidao.ptech.connsvr.protocol.MogoConnsvr; -import com.zhidao.socketsdk.manager.OnSocketAckCallback; -import com.zhidao.socketsdk.manager.OnSocketReceiveCallback; -import com.zhidao.socketsdk.manager.SocketConnManager; -import com.zhidao.socketsdk.manager.SocketConnManagerImpl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author congtaowang - * @since 2019-12-31 - *

- * 长链实现:基于 netty - */ - -public class SocketManager implements IMogoSocketManager, OnSocketReceiveCallback, OnSocketAckCallback { - - private static final String TAG = "SocketManager"; - - public static final int MSG_PRODUCT_LINE = MogoCommon.Product.mogoBussiness_VALUE; - private static final int MSG_HEADER_TYPE = MogoConnsvr.MsgType.mogoMsgTypeDispatchSvrNoRspReq_VALUE; - - private static volatile SocketManager sInstance; - - private SocketManager( Context context ) { - mSocketConnManager = SocketConnManagerImpl.getInstance( context ); - mSocketConnManager.addSocketMessageCallback( this ); - mSocketConnManager.addSocketAckCallback( this ); - } - - public static SocketManager getInstance( Context context ) { - if ( sInstance == null ) { - synchronized ( SocketManager.class ) { - if ( sInstance == null ) { - sInstance = new SocketManager( context ); - } - } - } - return sInstance; - } - - /** - * 管理消息分发 - *

- * key - msgType - */ - private Map< Integer, List< IMogoOnMessageListener > > mListeners = new ConcurrentHashMap<>(); - - /** - * 管理消息回执 - *

- * key - msgId - */ - private Map< Long, IMogoMsgAckListener > mAckListeners = new ConcurrentHashMap<>(); - - - private SocketConnManager mSocketConnManager; - public static final int MAX_CAP = 64; //保证充足的容量应对非常延时的推送 - private ArrayList< Long > mReceivedMsgId = new ArrayList<>( MAX_CAP ); - private int mCurrentIndex = 0; - - @Override - public void init( Context context, String appId ) { - if ( mSocketConnManager != null ) { - mSocketConnManager.init( appId ); - } - } - - @Override - public void onMessageReceived( byte[] content, long msgId ) { - try { - MogoConnsvr.Payload payload = MogoConnsvr.Payload.parseFrom( content ); - int msgType = payload.getMsgType(); - Logger.d( TAG, "received msg type = %d", msgType ); - List< IMogoOnMessageListener > listeners = mListeners.get( msgType ); - if ( listeners != null && !listeners.isEmpty() ) { - Iterator< IMogoOnMessageListener > iterator = listeners.iterator(); - if ( msgId != 0 ) { //兼容老版本 - if ( mReceivedMsgId.contains( msgId ) ) { // 避免消息重发 - return; - } - cacheLastReceivedMsgId( msgId ); - } - Object object = null; - while ( iterator.hasNext() ) { - IMogoOnMessageListener listener = iterator.next(); - if ( object == null ) { - object = GsonUtil.objectFromJson( payload.getPayload().toStringUtf8(), listener.target() ); - } - if ( listener != null ) { - Logger.d( TAG, "received msgId = %s, content = %s", msgId, payload.getPayload().toStringUtf8() ); - listener.onMsgReceived( object ); - } - } - } - } catch ( InvalidProtocolBufferException e ) { - Logger.e( TAG, e, "parse msg error." ); - } - } - - private void cacheLastReceivedMsgId( long msgId ) { - if ( msgId == 0 ) { - return; - } - synchronized ( this ){ - mReceivedMsgId.add( mCurrentIndex % MAX_CAP, msgId ); - mCurrentIndex++; - } - } - - @Override - public void onAck( byte[] headerBytes, byte[] payloadBytes ) { - try { - MogoConnsvr.Header header = MogoConnsvr.Header.parseFrom( headerBytes ); - int msgType = header.getMsgType(); - String appId = header.getAppId(); - int productLine = header.getProductLine(); - long msgId = header.getMsgId(); - IMogoMsgAckListener listener = mAckListeners.remove( msgId ); - if ( listener != null ) { - listener.onAck( msgId ); - } - Logger.d( TAG, "send message success: msgType = %d, appId = %s, productLine = %d", msgType, appId, productLine ); - } catch ( InvalidProtocolBufferException e ) { - e.printStackTrace(); - } - } - - @Override - public void registerOnMessageListener( int msgType, IMogoOnMessageListener listener ) { - if ( mListeners.containsKey( msgType ) ) { - Logger.w( TAG, "msgType %d is exist.", msgType ); - } - if ( !mListeners.containsKey( msgType ) ) { - mListeners.put( msgType, new ArrayList< IMogoOnMessageListener >() ); - } - mListeners.get( msgType ).add( listener ); - } - - @Override - public void unregisterOnMessageListener( int msgType ) { - mListeners.remove( msgType ); - } - - @Override - public void unregisterOnMessageListener( int msgType, IMogoOnMessageListener listener ) { - if ( listener == null ) { - return; - } - if ( !mListeners.containsKey( msgType ) ) { - return; - } - List< IMogoOnMessageListener > listeners = mListeners.get( msgType ); - if ( listeners != null && listeners.contains( listener ) ) { - listeners.remove( listener ); - } - } - - @Override - public void sendMsg( MsgBody body, IMogoMsgAckListener listener ) { - Logger.d( TAG, "sendMsg." ); - if ( mSocketConnManager != null ) { - if ( mSocketConnManager.isConnected() ) { - Logger.d( TAG, "isConnected." ); - final byte[] pb = convertToPBBytes( body.getMsgType(), objectToBytes( body.getContent() ) ); - mSocketConnManager.sendPayload( - MSG_PRODUCT_LINE, - pb, - MSG_HEADER_TYPE, - body.isAck(), - body.getMsgId() - ); - mAckListeners.put( body.getMsgId(), listener ); - } else { - Logger.e( TAG, "sendMsg error, connect is lost." ); - } - } else { - Logger.e( TAG, "sendMsg error, client is null." ); - } - } - - public byte[] objectToBytes( Object obj ) { - String jsonStr = GsonUtil.jsonFromObject( obj ); - return jsonStr.getBytes(); - } - - private byte[] convertToPBBytes( int msgType, byte[] payloadBytes ) { - MogoConnsvr.Payload payloadData = MogoConnsvr.Payload.newBuilder() - .setMsgType( msgType ) - .setPayload( ByteString.copyFrom( payloadBytes ) ).build(); - return payloadData.toByteArray(); - } - - public synchronized void release() { - mListeners.clear(); - mListeners = null; - sInstance = null; - } - - - @Override - public void init( Context context ) { - } -} diff --git a/foudations/mogo-connection/src/main/res/values/strings.xml b/foudations/mogo-connection/src/main/res/values/strings.xml deleted file mode 100644 index b965c02986..0000000000 --- a/foudations/mogo-connection/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - mogo-connection - diff --git a/foudations/mogo-utils/build.gradle b/foudations/mogo-utils/build.gradle index bbd4970b27..08408aa350 100644 --- a/foudations/mogo-utils/build.gradle +++ b/foudations/mogo-utils/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'com.android.library' - +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' android { compileSdkVersion rootProject.ext.android.compileSdkVersion // buildToolsVersion rootProject.ext.android.buildToolsVersion @@ -30,6 +31,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) api rootProject.ext.dependencies.glide + implementation rootProject.ext.dependencies.kotlinstdlibjdk7 implementation rootProject.ext.dependencies.glideanno implementation rootProject.ext.dependencies.glideokhttp3 implementation rootProject.ext.dependencies.supportannos diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDao.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDao.kt new file mode 100644 index 0000000000..c755822a6b --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDao.kt @@ -0,0 +1,423 @@ +package com.mogo.utils.sqlite + +import android.content.ContentValues +import android.database.Cursor +import android.database.sqlite.SQLiteDatabase +import com.mogo.utils.sqlite.annotation.DbField +import com.mogo.utils.sqlite.annotation.DbTable +import java.lang.reflect.Field +import java.util.* + + +/** + *

数据类操作实现

+ *Created by donghongyu on 2019/9/6. + */ +//T必须指明上界是Any且不为null,下面会用到反射获取对象实例,默认是Any? +open class BaseDao : IBaseDao { + + //数据库操作的引用 + private var sqLiteDatabase: SQLiteDatabase? = null + //要操作的数据实体的引用 + private var entityClass: Class? = null + //要操作的数据表名称 + private var tableName: String? = null + //记录数据表是否存在 + private var isInit = false + + //因为反射会消耗时间,这里使用缓存,进行性能优化 + //缓存空间(key-字段名,标注的自定义注解 value-成员变量) + private var cacheField: HashMap? = null + + override fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class): Boolean { + this.sqLiteDatabase = sqLiteDatabase + this.entityClass = entityClass + //自动建表(只创建一次) + if (!isInit) { + //获取表名 + tableName = entityClass.getAnnotation(DbTable::class.java).tableName + + //如果数据库没有建立连接跳出操作防止异常信息 + if (!sqLiteDatabase.isOpen) { + return false + } + + //执行Sql进行自动建表 + val createTableSql = getCreateTableSql() + sqLiteDatabase.execSQL(createTableSql) + + //初始化缓存空间 + cacheField = HashMap() + initCacheField() + + //标记已经创建过数据表 + isInit = true + } + + return isInit + } + + /** + * 初始化字段缓存 + */ + private fun initCacheField() { + //1.取到所有的列名(查询一个空表获取表结构,不影响性能) + if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) { + val sqlQuery = "select * from $tableName limit 1,0" + val cursor = sqLiteDatabase!!.rawQuery(sqlQuery, null) + //获取所有的列名 + val columnNames = cursor.columnNames + //关闭资源 + cursor.close() + //2.取所有成员名 + val columnFields = entityClass!!.declaredFields + //3.通过两层循环,进行对应关系建立 + columnNames.forEach ColumnFor@{ columnName -> + columnFields.forEach FieldFor@{ columnField -> + if (columnName == columnField.getAnnotation(DbField::class.java).fieldName) { + columnField.isAccessible = true + cacheField!![columnName] = columnField + } + return@FieldFor + } + } + } + } + + /** + * 拼装创建数据表的SQL语句 + */ + private fun getCreateTableSql(): String? { + //create table if not exists tb_name(_id integer,name varchar2(20)) + val sqlCreateTable = StringBuffer() + sqlCreateTable.append("create table if not exists ") + sqlCreateTable.append("$tableName (") + //反射获取所有的数据对象内的成员变量 + val fields = entityClass!!.declaredFields + + fields.forEachIndexed { index, field -> + //字段名称 + val columnName = field.getAnnotation(DbField::class.java).fieldName + //获取成员变量数据类型 + + when (val fieldType = field.type) { + String::class.java -> { + sqlCreateTable.append("$columnName TEXT,") + } + Integer::class.java -> { + sqlCreateTable.append("$columnName INTEGER,") + } + Long::class.java -> { + sqlCreateTable.append("$columnName BIGINT,") + } + Double::class.java -> { + sqlCreateTable.append("$columnName DOUBLE,") + } + ByteArray::class.java -> { + sqlCreateTable.append("$columnName BLOB,") + } + else -> { + //未知类型 + throw UnsupportedOperationException("未定义的数据类型:fieldName= $columnName fieldType= $fieldType") + } + } + + if (index == fields.size - 1) { + if (sqlCreateTable.endsWith(",")) + sqlCreateTable.deleteCharAt(sqlCreateTable.length - 1) + } + } + sqlCreateTable.append(")") + + return sqlCreateTable.toString() + } + + /** + * 插入数据 + */ + override fun insert(entity: T): Long { + //1、准备好ContentValues中的数据 + //2、设置插入的内容 + val values: ContentValues = getContentValuesForInsert(entity) + //3、执行插入 + return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) { + sqLiteDatabase!!.insert(tableName, null, values) + } else { + -1 + } + } + + /** + * 删除数据 + */ + override fun delete(where: T): Int { + val condition = Condition(getContentValuesForQuery(where)) + + return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) { + //受影响行数 + sqLiteDatabase!! + .delete( + tableName, + condition.getWhereCause(), + condition.getWhereArgs() + ) + } else { + -1 + } + } + + /** + * 更新数据 + */ + override fun update(where: T, newEntity: T): Int { + val condition = Condition(getContentValuesForQuery(where)) + + return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) { + //受影响行数 + sqLiteDatabase!! + .update( + tableName, + getContentValuesForInsert(newEntity), + condition.getWhereCause(), + condition.getWhereArgs() + ) + } else { + -1 + } + } + + /** + * 查询数据 + * @param where 查询条件对象,同时也用来初始化对象使用 + */ + override fun query(where: T): MutableList { + return query(where, null, null, null) + } + + /** + * 查询数据 + * @param where 查询条件对象 + * @param orderBy 排序规则 + * @param startIndex 开始的位置 + * @param limit 限制查询得到的数据个数 + */ + fun query(where: T, orderBy: String?, startIndex: Int?, limit: Int?): MutableList { + //拼接分页语句 + var limitString: String? = null + if (startIndex != null && limit != null) { + limitString = "$startIndex,$limit" + } + + val condition = Condition(getContentValuesForQuery(where)) + + var cursor: Cursor? = null + + //定义查询结果 + val result = mutableListOf() + if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) { + try { + //查询数据库 + cursor = sqLiteDatabase!! + .query( + tableName, + null, + condition.getWhereCause(), + condition.getWhereArgs(), + null, + null, + orderBy, + limitString + ) + //将查到结果添加到返回集合中 + result.addAll(getQueryResult(cursor, where)) + } catch (e: Exception) { + e.printStackTrace() + } finally { + cursor?.close() + } + } + return result + } + + /** + * 获取查询使用的ContentValues + */ + private fun getContentValuesForQuery(entity: T): ContentValues { + val contentValues = ContentValues() + try { + cacheField!!.forEach { + if (it.value.get(entity) == null) { + return@forEach + } + contentValues.put(it.key, it.value.get(entity).toString()) + } + } catch (e: IllegalAccessError) { + e.printStackTrace() + } + + return contentValues + } + + /** + * 条件拼接 + */ + class Condition(whereContent: ContentValues) { + /** + * 条件拼接 + * _id=?&&name=? + */ + private var whereCause: String? = null + + private var whereArgs: Array? = null + + //根据传入的contentValues转换成查询条件 + init { + //记录后面填充到查询语句“?”上的数据参数 + val argList = mutableListOf() + //拼接查询语句 + val whereCaseSb = StringBuilder() + + /** + * 是为了链接下面的查询条件条件,也或者是替换没有查询条件的语句。 + * 比如:要把检索条件作为一个参数传递给SQL, + * 那么,当这个检索语句不存在的话就可以给它赋值为1=1. + * 这样就避免了SQL出错,也就可以把加条件的SQL和不加条件的SQL合二为一。 + */ + whereCaseSb.append(" 1=1 ") + + val keys = whereContent.keySet() + val iterator = keys.iterator() + + //因为使用了“1=1”,所以即便是这里没有任何数据拼接,也是可以正常 + while (iterator.hasNext()) { + val key = iterator.next() as String + val valueObject = whereContent.get(key) + if (valueObject != null) { + val value = valueObject as String + //拼接查询条件语句 + //1:1 and _id=? and name=? + whereCaseSb.append(" and $key =?") + + //记录?对应的value + argList.add(value) + } + } + //集合转成数组 + this.whereArgs = argList.toTypedArray() + this.whereCause = whereCaseSb.toString() + } + + fun getWhereCause(): String { + return this.whereCause!! + } + + fun getWhereArgs(): Array { + return this.whereArgs!! + } + } + + /** + * 获取查询db结果 + */ + private fun getQueryResult(cursor: Cursor, where: T): MutableList { + //定义查询结果 + val result = mutableListOf() + //Cursor从头读到尾 + //游标从头读到尾 + cursor.moveToFirst() + //移动游标获取下一行数据 + while (!cursor.isAfterLast) { + //通过反射构建一个查询结果对象 + val item = where.javaClass.newInstance() + + //拿到缓存的当前数据对象的成员变量与数据库的键值关系 + val fieldIterator = cacheField!!.entries.iterator() + fieldIterator.forEach IteratorFor@{ + //获取数据库字段名称 + val columnName = it.key + //数据库字段名对应的数据对象的成员变量 + val field = it.value + //获取指定列名对应的索引 + val columnIndex = cursor.getColumnIndex(columnName) + //获取成员变量数据类型 + val fieldType = field.type + + if (columnIndex != -1) { + when (fieldType) { + String::class.java -> { + field.set(item, cursor.getString(columnIndex)) + } + Integer::class.java -> { + field.set(item, cursor.getInt(columnIndex)) + } + Long::class.java -> { + field.set(item, cursor.getLong(columnIndex)) + } + Double::class.java -> { + field.set(item, cursor.getDouble(columnIndex)) + } + ByteArray::class.java -> { + field.set(item, cursor.getBlob(columnIndex)) + } + else -> { + //未知类型 + throw UnsupportedOperationException("未定义的数据类型:columnName= $columnName fieldType= $fieldType") + } + } + } + } + //添加到结果集 + result.add(item) + //移动到下一个位置 + cursor.moveToNext() + } + cursor.close() + return result + } + + /** + * 获取插入使用的ContentValues + */ + private fun getContentValuesForInsert(entity: T): ContentValues { + val contentValues = ContentValues() + + val fieldIterator = cacheField!!.entries.iterator() + + fieldIterator.forEach IteratorFor@{ + try { + //获取变量的值 + val valueObject = it.value.get(entity) ?: return@IteratorFor + //获取列名 + val columnName = it.key + //获取成员变量数据类型 + val fieldType = it.value.type + when (fieldType) { + String::class.java -> { + contentValues.put(columnName, valueObject as String) + } + Integer::class.java -> { + contentValues.put(columnName, valueObject as Int) + } + Long::class.java -> { + contentValues.put(columnName, valueObject as Long) + } + Double::class.java -> { + contentValues.put(columnName, valueObject as Double) + } + ByteArray::class.java -> { + contentValues.put(columnName, valueObject as ByteArray) + } + else -> { + //未知类型 + throw UnsupportedOperationException("未定义的数据类型:columnName= $columnName fieldType= $fieldType") + } + } + } catch (e: IllegalArgumentException) { + e.printStackTrace() + } + } + + return contentValues + } + +} \ No newline at end of file diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDaoFactory.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDaoFactory.kt new file mode 100644 index 0000000000..605043bf5a --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/BaseDaoFactory.kt @@ -0,0 +1,74 @@ +package com.mogo.utils.sqlite + +import android.content.Context +import android.database.sqlite.SQLiteDatabase +import com.mogo.utils.sqlite.annotation.DbDatabase +import com.mogo.utils.sqlite.proxy.BaseDaoProxyLog + + +/** + *

数据库处理工厂

+ * Created by donghongyu on 2019/9/6. + */ +open class BaseDaoFactory { + + //默认数据库名称 + private var dbName = "MoGoSQLite.db" + + companion object { + //单利工厂 + private var baseDaoFactory: BaseDaoFactory? = null + + //数据库存储路径 + private lateinit var sqLiteDatabasePath: String + + //数据库操作类 + private var sqLiteDatabase: SQLiteDatabase? = null + + fun getInstance(): BaseDaoFactory { + if (baseDaoFactory == null) { + synchronized(BaseDaoFactory::class.java) { + if (baseDaoFactory == null) { + baseDaoFactory = BaseDaoFactory() + } + } + } + return baseDaoFactory!! + } + } + + //获取数据库操作对象 + fun getBaseDao(context: Context, entityClass: Class): IBaseDao? { + var baseDao: IBaseDao? = null + + try { + //获取数据库名称,如果没有设置则使用默认名称 + val dbDatabase = entityClass.getAnnotation(DbDatabase::class.java) + if (dbDatabase != null) { + dbName = dbDatabase.dbName + } + //openOrCreateDatabase 如果不存在则先创建再打开数据库,如果存在则直接打开。 + sqLiteDatabasePath = + "${context.getDir("database", Context.MODE_APPEND).path}/$dbName" + sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(sqLiteDatabasePath, null) + + // 这里为了演示,添加了日志工具的叠加使用,根据需要可以自己修改 + // baseDao = BaseDaoProxyShow().bind(BaseDaoProxyLog().bind(BaseDao())) as IBaseDao + baseDao = BaseDaoProxyLog().bind(BaseDao()) as IBaseDao + + baseDao.init(sqLiteDatabase!!, entityClass) + } catch (e: Exception) { + e.printStackTrace() + } + + return baseDao + } + + /** + * 关闭数据库 + */ + fun closeDatabase() { + sqLiteDatabase?.close() + } + +} \ No newline at end of file diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/IBaseDao.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/IBaseDao.kt new file mode 100644 index 0000000000..7af36200b8 --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/IBaseDao.kt @@ -0,0 +1,35 @@ +package com.mogo.utils.sqlite + +import android.database.sqlite.SQLiteDatabase + +/** + *

操作SQLite数据库的顶层接口

+ * Created by donghongyu on 2019/9/6. + */ +interface IBaseDao { + /** + * 初始化数据库连接 + */ + fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class): Boolean + + /** + * 将 [entity] 进行数据插入 + */ + fun insert(entity: T): Long + + /** + * 根据条件 [where] 进行数据删除 + */ + fun delete(where: T): Int + + /** + * 根据条件 [where] 进行数据更新,如果[where]==null 则代表删除所有数据 + */ + fun update(where: T, newEntity: T): Int + + /** + * 根据条件 [where] 进行数据查询,如果[where]==null 则代表查询所有数据 + */ + fun query(where: T): MutableList + +} \ No newline at end of file diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbDatabase.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbDatabase.kt new file mode 100644 index 0000000000..4fade720b2 --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbDatabase.kt @@ -0,0 +1,15 @@ +package com.mogo.utils.sqlite.annotation + + +/** + *

添加在要操作的数据对象名上面,用来设置数据库名称

+ * + * /** + * * @DbDatabase("AppSQLite.db") + * * class UserEntity {} + * */ + * Created by donghongyu on 2019/9/6. + */ +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS) +annotation class DbDatabase(val dbName: String) \ No newline at end of file diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbField.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbField.kt new file mode 100644 index 0000000000..cf63587d32 --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbField.kt @@ -0,0 +1,21 @@ +package com.mogo.utils.sqlite.annotation + + +/** + *

添加在要处理的数据对象的字段之上,用来设置数据表的字段名称

+ * /** + * *@DbTable("tb_user") + * *class UserEntity { + * * @DbField("_id") + * * var id: Int = 0 + * * @DbField("name") + * * var name: String? = null + * * @DbField("password") + * * var password: String? = null + * *} + * */ + * Created by donghongyu on 2019/9/6. + */ +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.FIELD) +annotation class DbField(val fieldName: String) \ No newline at end of file diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbTable.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbTable.kt new file mode 100644 index 0000000000..73aec8445f --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/annotation/DbTable.kt @@ -0,0 +1,15 @@ +package com.mogo.utils.sqlite.annotation + + +/** + *

添加在要操作的数据对象名上面,用来设置数据表名称

+ * + * /** + * * @DbTable("tb_user") + * * class UserEntity {} + * */ + * Created by donghongyu on 2019/9/6. + */ +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS) +annotation class DbTable(val tableName: String) \ No newline at end of file diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxy.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxy.kt new file mode 100644 index 0000000000..f48adc9f79 --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxy.kt @@ -0,0 +1,51 @@ +package com.mogo.utils.sqlite.proxy + +import android.database.sqlite.SQLiteDatabase +import android.util.Log +import com.mogo.utils.sqlite.IBaseDao + +/** + *

静态代理数据库操作类,用来记录日志

+ * Created by donghongyu on 2019/9/6. + */ +class BaseDaoProxy(var iBaseDao: IBaseDao) : IBaseDao by iBaseDao { + override fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class): Boolean { + Log.i("数据库代理", "初始化数据库连接……") + val isInitSuccess = iBaseDao.init(sqLiteDatabase, entityClass) + if (isInitSuccess) { + Log.i("数据库代理", "数据库连接成功……") + } else { + Log.e("数据库代理", "数据库连接失败……") + } + return isInitSuccess + } + + override fun insert(entity: T): Long { + Log.i("数据库代理", "开始插入数据……") + val result = iBaseDao.insert(entity) + Log.i("数据库代理", "插入数据索引位置> $result <……") + return result + } + + override fun delete(where: T): Int { + Log.i("数据库代理", "开始删除数据……") + val result = iBaseDao.delete(where) + Log.i("数据库代理", "删除了> $result <条数据……") + return result + } + + override fun update(where: T, newEntity: T): Int { + Log.i("数据库代理", "开始更新数据……") + val result = iBaseDao.update(where, newEntity) + Log.i("数据库代理", "更新了> $result <条数据……") + return result + } + + override fun query(where: T): MutableList { + Log.i("数据库代理", "开始查询数据……") + val result = iBaseDao.query(where) + Log.i("数据库代理", "查询到> ${result.size} <条数据……") + return result + } + +} \ No newline at end of file diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyLog.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyLog.kt new file mode 100644 index 0000000000..d65dd810dd --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyLog.kt @@ -0,0 +1,50 @@ +package com.mogo.utils.sqlite.proxy + +import android.util.Log +import java.lang.reflect.InvocationHandler +import java.lang.reflect.Method +import java.lang.reflect.Proxy + +/** + * 使用java实现动态代理数据库操作类加入日志功能 + * Created by donghongyu on 2019/9/6. + */ + +class BaseDaoProxyLog : InvocationHandler { + + private var target: Any? = null + + /** + * 绑定委托对象并返回一个【代理占位】 + * + * @param target 真实对象 + * @return 代理对象【占位】 + */ + fun bind(target: Any): Any { + this.target = target + //取得代理对象 + return Proxy.newProxyInstance( + target.javaClass.classLoader, + target.javaClass.interfaces, this + ) + } + + /** + * 同过代理对象调用方法首先进入这个方法. + * + * @param proxy --代理对象 + * @param method -- 方法,被调用方法. + * @param args -- 方法的参数 + */ + @Throws(Throwable::class) + override fun invoke(proxy: Any, method: Method, args: Array): Any? { + var result: Any? = null + //反射方法前调用 + Log.i("数据库代理", "当前执行>>${method.name}") + //反射执行方法 相当于调用target.sayHelllo; + result = method.invoke(target, *args) + //反射方法后调用. + Log.i("数据库代理", "执行结果>>$result") + return result + } +} diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyShow.kt b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyShow.kt new file mode 100644 index 0000000000..d924191ba1 --- /dev/null +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/sqlite/proxy/BaseDaoProxyShow.kt @@ -0,0 +1,49 @@ +package com.mogo.utils.sqlite.proxy + +import android.util.Log +import java.lang.reflect.InvocationHandler +import java.lang.reflect.Method +import java.lang.reflect.Proxy + +/** + * 使用java实现动态代理数据库操作类,加入更多额外的功能,来测试代理类的叠加功能 + * Created by donghongyu on 2019/9/6. + */ +class BaseDaoProxyShow : InvocationHandler { + + private var target: Any? = null + + /** + * 绑定委托对象并返回一个【代理占位】 + * + * @param target 真实对象 + * @return 代理对象【占位】 + */ + fun bind(target: Any): Any { + this.target = target + //取得代理对象 + return Proxy.newProxyInstance( + target.javaClass.classLoader, + target.javaClass.interfaces, this + ) + } + + /** + * 同过代理对象调用方法首先进入这个方法. + * + * @param proxy --代理对象 + * @param method -- 方法,被调用方法. + * @param args -- 方法的参数 + */ + @Throws(Throwable::class) + override fun invoke(proxy: Any, method: Method, args: Array): Any? { + var result: Any? = null + //反射方法前调用 + Log.i("数据库代理", "显示执行>>${method.name}") + //反射执行方法 相当于调用target.sayHelllo; + result = method.invoke(target, *args) + //反射方法后调用. + Log.i("数据库代理", "执行结果>>$result") + return result + } +} diff --git a/gradle.properties b/gradle.properties index 43e8fa55ee..7a46f14048 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,37 +29,38 @@ PASSWORD=xintai2018 RELEASE=false # 模块版本 ## 工程内模块 -MOGO_COMMONS_VERSION=1.2.1.17 -MOGO_UTILS_VERSION=1.2.1.17 -MAP_AMAP_VERSION=1.2.1.17 -MAP_AUTONAVI_VERSION=1.2.1.17 -MOGO_MAP_VERSION=1.2.1.17 -MOGO_MAP_API_VERSION=1.2.1.17 -MOGO_SERVICE_VERSION=1.2.1.17 -MOGO_SERVICE_API_VERSION=1.2.1.17 -MOGO_CONNECTION_VERSION=1.2.1.17 -MOGO_MODULE_APPS_VERSION=1.2.1.17 -MOGO_MODULE_NAVI_VERSION=1.2.1.17 -MOGO_MODULE_SHARE_VERSION=1.2.1.17 -MOGO_MODULE_COMMON_VERSION=1.2.1.17 -MOGO_MODULE_MAIN_VERSION=1.2.1.17 -MOGO_MODULE_MAP_VERSION=1.2.1.17 -MOGO_MODULE_SERVICE_VERSION=1.2.1.17 -MOGO_MODULE_EXTENSIONS_VERSION=1.2.1.17 -MOGO_MODULE_SEARCH_VERSION=1.2.1.17 -MOGO_MODULE_BACK_VERSION=1.2.1.17 -MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.1.17 -MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.1.17 -MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.1.17 -MOGO_MODULE_AUTHORIZE_VERSION=1.2.1.17 -MOGO_MODULE_GUIDE_VERSION=1.2.1.17 -MOGO_MODULE_MEDIA_VERSION=1.2.1.17 -MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.2.1.17 -MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.17 +MOGO_COMMONS_VERSION=1.2.1.19 +MOGO_UTILS_VERSION=1.2.1.19 +MAP_AMAP_VERSION=1.2.1.19 +MAP_AUTONAVI_VERSION=1.2.1.19 +MOGO_MAP_VERSION=1.2.1.19 +MOGO_MAP_API_VERSION=1.2.1.19 +MOGO_SERVICE_VERSION=1.2.1.19 +MOGO_SERVICE_API_VERSION=1.2.1.19 +MOGO_CONNECTION_VERSION=1.2.1.19 +MOGO_MODULE_APPS_VERSION=1.2.1.19 +MOGO_MODULE_NAVI_VERSION=1.2.1.19 +MOGO_MODULE_SHARE_VERSION=1.2.1.19 +MOGO_MODULE_COMMON_VERSION=1.2.1.19 +MOGO_MODULE_MAIN_VERSION=1.2.1.19 +MOGO_MODULE_MAP_VERSION=1.2.1.19 +MOGO_MODULE_SERVICE_VERSION=1.2.1.19 +MOGO_MODULE_EXTENSIONS_VERSION=1.2.1.19 +MOGO_MODULE_SEARCH_VERSION=1.2.1.19 +MOGO_MODULE_BACK_VERSION=1.2.1.19 +MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.1.19 +MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.1.19 +MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.1.19 +MOGO_MODULE_AUTHORIZE_VERSION=1.2.1.19 +MOGO_MODULE_GUIDE_VERSION=1.2.1.19 +MOGO_MODULE_MEDIA_VERSION=1.2.1.19 +MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.2.1.19 +MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.19 +MOGO_MODULE_V2X_VERSION=1.2.1.19 ## 工程外部模块 # 探路 -MOGO_MODULE_TANLU_VERSION=1.3.0.4-byd +MOGO_MODULE_TANLU_VERSION=1.3.0.10 # 车聊聊 CARCHATTING_VERSION=1.4.4 # 车聊聊接口 @@ -70,8 +71,7 @@ MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT # 在线车辆F MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2 -# v2x -MOGO_MODULE_V2X_VERSION=1.3.1 + # 推送 MOGO_MODULE_PUSH_VERSION=1.1.5.7 MOGO_MODULE_PUSH_BASE_VERSION=1.1.5.5 @@ -79,7 +79,7 @@ MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6 # 广告资源位 MOGO_MODULE_AD_CARD_VERSION=1.0.1 # 探路上报和分享模块 -TANLULIB_VERSION=1.3.0.4-byd +TANLULIB_VERSION=1.3.0.10 MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT #左侧面板模块 diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java index 05bf307195..b55d9adb37 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java @@ -21,8 +21,8 @@ public class UnScannedApps { sUnScannedApps.add( new AppInfo( AppEnum.BT_MUSIC.getName(), AppEnum.BT_MUSIC.getPkg(), null, 0, null, AppEnum.BT_PHONE.getIconResId() ) ); } else { sUnScannedApps.add( new AppInfo( AppEnum.BT_PHONE_NWD.getName(), AppEnum.BT_PHONE_NWD.getPkg(), null, 0, null, AppEnum.BT_PHONE_NWD.getIconResId() ) ); + sUnScannedApps.add( new AppInfo( AppEnum.CanBus.getName(), AppEnum.CanBus.getPkg(), null, 0, null, AppEnum.CanBus.getIconResId() ) ); } - sUnScannedApps.add( new AppInfo( AppEnum.CanBus.getName(), AppEnum.CanBus.getPkg(), null, 0, null, AppEnum.CanBus.getIconResId() ) ); } public static List< AppInfo > getUnScannedApps() { diff --git a/modules/mogo-module-apps/src/main/res/values/strings.xml b/modules/mogo-module-apps/src/main/res/values/strings.xml index 3bf6847233..10a1675519 100644 --- a/modules/mogo-module-apps/src/main/res/values/strings.xml +++ b/modules/mogo-module-apps/src/main/res/values/strings.xml @@ -21,6 +21,10 @@ com.zhidao.bootmanager com.zhidao.services com.android.settings + com.android.documentsui + com.android.messaging + com.android.contacts + com.android.dialer com.mogo.launcher diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java index 31116f19a2..b038ac044e 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/UserDataMarkerInfoWindowAdapter.java @@ -54,6 +54,7 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter { private View mInfoWindowView = null; + private View mContentContainer; private MogoImageView mUserHeader; private TextView mContent; private TextView mTag; @@ -92,12 +93,21 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter { if ( mInfoWindowView == null ) { mInfoWindowView = LayoutInflater.from( mContext ).inflate( R.layout.view_map_data_user_info_window, null ); + mContentContainer = mInfoWindowView.findViewById( R.id.module_service_id_marker_content ); mUserHeader = mInfoWindowView.findViewById( R.id.module_service_id_user_header ); mContent = mInfoWindowView.findViewById( R.id.module_service_id_content ); mTag = mInfoWindowView.findViewById( R.id.module_service_id_tag ); mCall = mInfoWindowView.findViewById( R.id.module_service_id_call ); + } - mCall.setVisibility( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ? View.GONE : View.VISIBLE ); + if ( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ) { + mContentContainer.setPadding( + mContentContainer.getPaddingLeft(), + mContentContainer.getPaddingTop(), + mContentContainer.getResources().getDimensionPixelSize( R.dimen.module_service_id_marker_content_paddingRight_widthoutCall ), + mContentContainer.getPaddingBottom() + ); + mCall.setVisibility( View.GONE ); } try { diff --git a/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml b/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml index 0967298a46..fe110eba36 100644 --- a/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml +++ b/modules/mogo-module-service/src/main/res/layout/view_map_data_user_info_window.xml @@ -13,6 +13,7 @@ android:id="@+id/module_service_id_marker_content" android:layout_width="wrap_content" android:layout_height="@dimen/module_services_info_window_height" + android:paddingRight="@dimen/module_service_id_marker_content_paddingRight" android:background="@drawable/module_services_driver_blue_info" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -44,7 +45,7 @@ app:layout_constraintStart_toEndOf="@+id/module_service_id_user_header" app:layout_constraintTop_toTopOf="@+id/module_service_id_user_header" app:layout_goneMarginRight="@dimen/dp_30" - tools:text="诗" /> + tools:text="诗一样的远方的远方" /> 24px 20px 120px + 20px \ No newline at end of file diff --git a/modules/mogo-module-service/src/main/res/values/dimens.xml b/modules/mogo-module-service/src/main/res/values/dimens.xml index 6faf47f1e0..c527ce9b25 100644 --- a/modules/mogo-module-service/src/main/res/values/dimens.xml +++ b/modules/mogo-module-service/src/main/res/values/dimens.xml @@ -20,4 +20,6 @@ 14px 12px 64px + 6.5px + 10px \ No newline at end of file diff --git a/modules/mogo-module-v2x/build.gradle b/modules/mogo-module-v2x/build.gradle index 95b4420777..707f339a23 100644 --- a/modules/mogo-module-v2x/build.gradle +++ b/modules/mogo-module-v2x/build.gradle @@ -45,23 +45,31 @@ dependencies { implementation 'com.tencent.liteavsdk:LiteAVSDK_Smart:7.2.8927' implementation 'ch.hsr:geohash:1.4.0' implementation rootProject.ext.dependencies.flexbox + implementation rootProject.ext.dependencies.rxandroid + implementation rootProject.ext.dependencies.androidxrecyclerview + implementation rootProject.ext.dependencies.androidxappcompat + implementation rootProject.ext.dependencies.androidxconstraintlayout + implementation rootProject.ext.dependencies.arouter + implementation rootProject.ext.dependencies.carcallprovider + implementation rootProject.ext.dependencies.carcall - compileOnly rootProject.ext.dependencies.kotlinstdlibjdk7 - compileOnly rootProject.ext.dependencies.androidxccorektx - compileOnly rootProject.ext.dependencies.androidxrecyclerview - - compileOnly rootProject.ext.dependencies.mogomap - compileOnly rootProject.ext.dependencies.mogoutils - compileOnly rootProject.ext.dependencies.mogocommons - compileOnly rootProject.ext.dependencies.mogoservice - compileOnly rootProject.ext.dependencies.mogoserviceapi - compileOnly rootProject.ext.dependencies.modulecommon - compileOnly rootProject.ext.dependencies.moduleservice - compileOnly rootProject.ext.dependencies.androidxappcompat - compileOnly rootProject.ext.dependencies.androidxconstraintlayout - compileOnly rootProject.ext.dependencies.arouter - compileOnly rootProject.ext.dependencies.carcallprovider - compileOnly rootProject.ext.dependencies.carcall + if (Boolean.valueOf(RELEASE)) { + implementation rootProject.ext.dependencies.mogomap + implementation rootProject.ext.dependencies.mogoutils + implementation rootProject.ext.dependencies.mogocommons + implementation rootProject.ext.dependencies.mogoservice + implementation rootProject.ext.dependencies.mogoserviceapi + implementation rootProject.ext.dependencies.modulecommon + implementation rootProject.ext.dependencies.moduleservice + } else { + implementation project(':libraries:mogo-map') + implementation project(':foudations:mogo-utils') + implementation project(':foudations:mogo-commons') + implementation project(':services:mogo-service') + implementation project(':services:mogo-service-api') + implementation project(':modules:mogo-module-common') + implementation project(':modules:mogo-module-service') + } annotationProcessor rootProject.ext.dependencies.aroutercompiler diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java index fd3e901346..c8816bf2ca 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java @@ -18,10 +18,10 @@ import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.navi.IMogoNaviListener; import com.mogo.module.common.entity.MarkerExploreWay; import com.mogo.module.common.entity.MarkerShowEntity; +import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.service.ServiceConst; import com.mogo.module.v2x.entity.net.V2XSeekHelpRes; import com.mogo.module.v2x.entity.net.V2XStrategyPushRes; -import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.v2x.network.V2XRefreshCallback; import com.mogo.module.v2x.receiver.SceneBroadcastReceiver; import com.mogo.module.v2x.scenario.impl.V2XScenarioManager; @@ -132,10 +132,12 @@ public class V2XModuleProvider implements intentFilter.addAction(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); localBroadcastManager.registerReceiver(localReceiver, intentFilter); - // TODO 这是测试页面 - V2XServiceManager - .getIMogoWindowManager() - .addView(new V2XTestConsoleWindow(context), 0, 0, false); + if (BuildConfig.DEBUG) { + // TODO 这是测试页面 + V2XServiceManager + .getIMogoWindowManager() + .addView(new V2XTestConsoleWindow(context), 0, 0, false); + } } private void initVoice(Context context) { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventDetailVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventDetailVH.java index 67841a9ea1..325cd4dcda 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventDetailVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventDetailVH.java @@ -11,7 +11,6 @@ import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; -import com.elegant.utils.ArrayUtils; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.voice.AIAssist; import com.mogo.module.common.entity.MarkerExploreWay; @@ -40,9 +39,10 @@ import com.mogo.module.v2x.voice.V2XVoiceCallbackListener; import com.mogo.module.v2x.voice.V2XVoiceConstants; import com.mogo.module.v2x.voice.V2XVoiceManager; import com.mogo.service.imageloader.MogoImageView; +import com.mogo.utils.ArrayUtils; import com.mogo.utils.DateTimeUtils; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.ArrayList; import java.util.Calendar; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java index 015f5e941c..f96ae6e301 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java @@ -30,7 +30,7 @@ import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.utils.ArrayUtils; import com.mogo.utils.logger.Logger; import com.mogo.utils.storage.SharedPrefsMgr; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java index b0b18824c8..bf22201dba 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java @@ -26,7 +26,7 @@ import com.mogo.module.v2x.utils.DrivingDirectionUtils; import com.mogo.module.v2x.utils.LocationUtils; import com.mogo.module.v2x.utils.MarkerUtils; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.Arrays; import java.util.HashMap; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401003.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401003.java index 3b179e600f..9f485d8446 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401003.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401003.java @@ -16,7 +16,7 @@ import com.mogo.module.v2x.utils.ToastUtils; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.service.connection.IMogoOnMessageListener; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401005.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401005.java index 304be7162f..0a790863af 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401005.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401005.java @@ -11,7 +11,7 @@ import com.mogo.module.v2x.utils.MarkerUtils; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.service.connection.IMogoOnMessageListener; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.ArrayList; import java.util.List; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401011.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401011.java index 55afafbd77..728898f2f4 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401011.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XMessageListener_401011.java @@ -6,7 +6,7 @@ import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.service.connection.IMogoOnMessageListener; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java index c3bf82a52e..a6b34d8c29 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java @@ -24,11 +24,10 @@ import com.mogo.service.MogoServicePaths; import com.mogo.service.network.IMogoNetwork; import com.mogo.utils.logger.Logger; import com.mogo.utils.network.RequestOptions; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.HashMap; import java.util.Map; - import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; import okhttp3.RequestBody; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/receiver/SceneBroadcastReceiver.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/receiver/SceneBroadcastReceiver.java index 4966e2dfba..dc04c9cab3 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/receiver/SceneBroadcastReceiver.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/receiver/SceneBroadcastReceiver.java @@ -8,7 +8,7 @@ import com.mogo.module.v2x.V2XConst; import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.v2x.scenario.impl.V2XScenarioManager; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; /** * 场景广播接收,道路预警、后台下发、违章停车、故障求助、疲劳驾驶 diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java index 495fc47b96..39cb846516 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java @@ -18,7 +18,7 @@ import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpScenario; import com.mogo.module.v2x.utils.ToastUtils; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.HashMap; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XRoadLiveCarWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XRoadLiveCarWindow.java index 9d9437b586..857146eb14 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XRoadLiveCarWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XRoadLiveCarWindow.java @@ -24,7 +24,7 @@ import com.mogo.module.v2x.voice.V2XVoiceConstants; import com.mogo.module.v2x.voice.V2XVoiceManager; import com.mogo.module.v2x.voice.V2XVoicePagingListener; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.ArrayList; import java.util.List; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/push/V2XPushEventScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/push/V2XPushEventScenario.java index 85240f8983..b6f266d2d3 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/push/V2XPushEventScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/push/V2XPushEventScenario.java @@ -14,7 +14,7 @@ import com.mogo.module.v2x.scenario.impl.AbsV2XScenario; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.service.windowview.IMogoTopViewStatusListener; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java index e69073c022..0d8fc7153b 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java @@ -15,7 +15,7 @@ import com.mogo.module.v2x.utils.ADASUtils; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.service.windowview.IMogoTopViewStatusListener; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; import java.util.HashMap; import java.util.Map; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/FatigueDrivingUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/FatigueDrivingUtils.java index 0322137b9d..a14819e68f 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/FatigueDrivingUtils.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/FatigueDrivingUtils.java @@ -6,7 +6,7 @@ import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.entity.net.V2XStrategyPushRes; import com.mogo.utils.logger.Logger; import com.mogo.utils.storage.SharedPrefsMgr; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; /** * author : donghongyu diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/LocationUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/LocationUtils.java index a3a8f4aed5..5df1ff2fcb 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/LocationUtils.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/LocationUtils.java @@ -16,7 +16,7 @@ import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery; import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.utils.logger.Logger; -import com.zhidao.utils.common.GsonUtil; +import com.mogo.utils.network.utils.GsonUtil; /** diff --git a/upload.sh b/upload.sh index ca7a1df0d9..6a00beaf4c 100755 --- a/upload.sh +++ b/upload.sh @@ -1,36 +1,102 @@ #!/bin/bash ./gradlew :foudations:mogo-utils:clean :foudations:mogo-utils:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :foudations:mogo-commons:clean :foudations:mogo-commons:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :libraries:mogo-map-api:clean :libraries:mogo-map-api:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :services:mogo-service-api:clean :services:mogo-service-api:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :libraries:map-amap:clean :libraries:map-amap:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :libraries:map-autonavi:clean :libraries:map-autonavi:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :libraries:mogo-map:clean :libraries:mogo-map:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-common:clean :modules:mogo-module-common:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :services:mogo-service:clean :services:mogo-service:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-obu:clean :modules:mogo-module-obu:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-map:clean :modules:mogo-module-map:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-apps:clean :modules:mogo-module-apps:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-gps-simulator:clean :modules:mogo-module-gps-simulator:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-gps-simulator-debug:clean :modules:mogo-module-gps-simulator-debug:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-gps-simulator-noop:clean :modules:mogo-module-gps-simulator-noop:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-service:clean :modules:mogo-module-service:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-authorize:clean :modules:mogo-module-authorize:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-share:clean :modules:mogo-module-share:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-extensions:clean :modules:mogo-module-extensions:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-search:clean :modules:mogo-module-search:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-media:clean :modules:mogo-module-media:uploadArchives +if [ $? -eq 0 ]; then +./gradlew :modules:mogo-module-v2x:clean :modules:mogo-module-v2x:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-back:clean :modules:mogo-module-back:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-main:clean :modules:mogo-module-main:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-guide:clean :modules:mogo-module-guide:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :main-extensions:mogo-module-main-independent:clean :main-extensions:mogo-module-main-independent:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :main-extensions:mogo-module-main-launcher:clean :main-extensions:mogo-module-main-launcher:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-event-panel:clean :modules:mogo-module-event-panel:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-event-panel-noop:clean :modules:mogo-module-event-panel-noop:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-left-panel:clean :modules:mogo-module-left-panel:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-left-panel-noop:clean :modules:mogo-module-left-panel-noop:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :modules:mogo-module-byd:clean :modules:mogo-module-byd:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :foudations:mogo-base-services-apk:clean :foudations:mogo-base-services-apk:uploadArchives +if [ $? -eq 0 ]; then ./gradlew :foudations:mogo-base-services-sdk:clean :foudations:mogo-base-services-sdk:uploadArchives - +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi +fi