合并1.1.2需求
This commit is contained in:
10
.idea/gradle.xml
generated
10
.idea/gradle.xml
generated
@@ -21,6 +21,8 @@
|
||||
<option value="$PROJECT_DIR$/libraries/map-autonavi" />
|
||||
<option value="$PROJECT_DIR$/libraries/mogo-map" />
|
||||
<option value="$PROJECT_DIR$/libraries/mogo-map-api" />
|
||||
<option value="$PROJECT_DIR$/libraries/mogo-tanlu-api" />
|
||||
<option value="$PROJECT_DIR$/libraries/tanlulib" />
|
||||
<option value="$PROJECT_DIR$/main-extensions" />
|
||||
<option value="$PROJECT_DIR$/main-extensions/mogo-module-main-independent" />
|
||||
<option value="$PROJECT_DIR$/main-extensions/mogo-module-main-launcher" />
|
||||
@@ -29,8 +31,6 @@
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-authorize" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-back" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-common" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-event-panel" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-event-panel-noop" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-extensions" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-gps-simulator" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-gps-simulator-debug" />
|
||||
@@ -40,13 +40,19 @@
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-main" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-map" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-media" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-monitor" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-obu" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-push" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-push-base" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-push-noop" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-search" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-service" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-share" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-splash" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-splash-noop" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-tanlu" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-v2x" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-widgets" />
|
||||
<option value="$PROJECT_DIR$/services" />
|
||||
<option value="$PROJECT_DIR$/services/mogo-service" />
|
||||
<option value="$PROJECT_DIR$/services/mogo-service-api" />
|
||||
|
||||
153
app/build.gradle
153
app/build.gradle
@@ -2,11 +2,9 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
@@ -66,13 +64,13 @@ android {
|
||||
independent {
|
||||
manifest.srcFile 'src/independent/AndroidManifest.xml'
|
||||
}
|
||||
e8xx{
|
||||
e8xx {
|
||||
manifest.srcFile 'src/e8xx/AndroidManifest.xml'
|
||||
}
|
||||
em4 {
|
||||
manifest.srcFile 'src/em4/AndroidManifest.xml'
|
||||
}
|
||||
f8xxLauncherOnlineRelease{
|
||||
f8xxLauncherOnlineRelease {
|
||||
manifest.srcFile 'src/f8xxLauncherOnlineRelease/AndroidManifest.xml'
|
||||
}
|
||||
}
|
||||
@@ -81,7 +79,7 @@ android {
|
||||
|
||||
productFlavors {
|
||||
//独立app
|
||||
independent{
|
||||
independent {
|
||||
dimension "basic"
|
||||
// 是否启动位置服务
|
||||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'false'
|
||||
@@ -90,7 +88,7 @@ android {
|
||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||
}
|
||||
// launcher app
|
||||
launcher{
|
||||
launcher {
|
||||
dimension "basic"
|
||||
// 是否启动位置服务
|
||||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'true'
|
||||
@@ -99,11 +97,11 @@ android {
|
||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||
}
|
||||
// f系列-分体机全系列,未细分
|
||||
f8xx{
|
||||
f8xx {
|
||||
applicationId rootProject.ext.android.fLauncherApplicationId
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -117,7 +115,7 @@ android {
|
||||
applicationId rootProject.ext.android.launcherApplicationId
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -131,7 +129,7 @@ android {
|
||||
applicationId rootProject.ext.android.launcherApplicationId
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -173,7 +171,7 @@ android {
|
||||
applicationId rootProject.ext.android.independentApplicationId
|
||||
dimension "product"
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
buildConfigField 'int', 'AIType', '1'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -183,11 +181,11 @@ android {
|
||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||
}
|
||||
// d系列 1+16 版本
|
||||
d82x{
|
||||
d82x {
|
||||
applicationId rootProject.ext.android.independentApplicationId
|
||||
dimension "product"
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
buildConfigField 'int', 'AIType', '1'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -197,11 +195,11 @@ android {
|
||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||
}
|
||||
// 比亚迪
|
||||
bydauto{
|
||||
bydauto {
|
||||
applicationId rootProject.ext.android.bydautoIndependentApplicationId
|
||||
dimension "product"
|
||||
// 不使用语音
|
||||
buildConfigField 'int', 'AIType','0'
|
||||
buildConfigField 'int', 'AIType', '0'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,其他车机,比亚迪定为1
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
|
||||
@@ -229,42 +227,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
def generateVersionCode() {
|
||||
String vn = rootProject.ext.android.versionName
|
||||
String[] versions = vn.split("\\.")
|
||||
if (versions.length == 3) {
|
||||
int num1 = Integer.valueOf(versions[0])
|
||||
int num2 = Integer.valueOf(versions[1])
|
||||
int num3 = Integer.valueOf(versions[2])
|
||||
if (num1 < 1 || num1 > 99){
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
if (num2 < 0 || num2 > 99){
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
if (num3 < 0 || num3 > 99){
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
StringBuilder builder = new StringBuilder()
|
||||
builder.append(num1)
|
||||
if( num2 > 9 ){
|
||||
builder.append(num2)
|
||||
} else {
|
||||
builder.append("0").append(num2)
|
||||
}
|
||||
if( num3 > 9 ){
|
||||
builder.append(num3)
|
||||
} else {
|
||||
builder.append("0").append(num3)
|
||||
}
|
||||
println("last versionCode ${builder}")
|
||||
return Integer.valueOf(builder.toString())
|
||||
} else {
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
@@ -285,9 +247,8 @@ 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.mogologlib
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
launcherImplementation rootProject.ext.dependencies.modulemainlauncher
|
||||
@@ -301,6 +262,13 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.moduleservice
|
||||
implementation rootProject.ext.dependencies.modulesplash
|
||||
implementation rootProject.ext.dependencies.moduleV2x
|
||||
implementation rootProject.ext.dependencies.moduletanlu, {
|
||||
exclude group: 'com.mogo.module', module: 'module-share'
|
||||
}
|
||||
implementation rootProject.ext.dependencies.moduletanluapi
|
||||
implementation rootProject.ext.dependencies.mogomonitor
|
||||
implementation rootProject.ext.dependencies.mogomodulewidgets
|
||||
implementation rootProject.ext.dependencies.mogomoduleback
|
||||
} else {
|
||||
launcherImplementation project(':main-extensions:mogo-module-main-launcher')
|
||||
independentImplementation project(':main-extensions:mogo-module-main-independent')
|
||||
@@ -312,22 +280,21 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-service')
|
||||
implementation project(':modules:mogo-module-splash')
|
||||
implementation project(':modules:mogo-module-v2x')
|
||||
implementation project(':modules:mogo-module-tanlu'), {
|
||||
exclude group: 'com.mogo.module', module: 'module-share'
|
||||
}
|
||||
implementation project(':libraries:mogo-tanlu-api')
|
||||
implementation project(':modules:mogo-module-monitor')
|
||||
implementation project(':modules:mogo-module-widgets')
|
||||
implementation project(':modules:mogo-module-back')
|
||||
}
|
||||
|
||||
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 ->
|
||||
// variant.outputs.all { //这里修改apk文件名
|
||||
// outputFileName = "Launcher2.0_V${android.defaultConfig.versionName}_${getCurrentDate()}_${variant.name}_${getGitCommit()}.apk"
|
||||
// println outputFileName
|
||||
// }
|
||||
//}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
def buildTime = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08:00"))
|
||||
def flavor = variant.productFlavors.collect { it.name }.join('-')
|
||||
@@ -343,64 +310,4 @@ android.applicationVariants.all { variant ->
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def getMonthAndDay() {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MMddHH")
|
||||
return sdf.format(new Date())
|
||||
}
|
||||
|
||||
def getCurrentDate() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss")
|
||||
return sdf.format(new Date())
|
||||
}
|
||||
|
||||
def getGitCommit() {
|
||||
def gitDir = new File("${new File("${rootDir}")}/.git")
|
||||
if (!gitDir.isDirectory()) {
|
||||
return 'non_git_build'
|
||||
}
|
||||
|
||||
def cmd = 'git log --pretty=format:%h -1'
|
||||
def gitCommit = cmd.execute().text.trim()
|
||||
|
||||
print gitCommit
|
||||
|
||||
def cmd2 = 'git status -s'
|
||||
def gitStatus = cmd2.execute().text.trim()
|
||||
|
||||
println '---------'
|
||||
|
||||
print gitStatus
|
||||
if (gitStatus != null && !gitStatus.isEmpty()) {
|
||||
return 'local-build'
|
||||
}
|
||||
|
||||
assert !gitCommit.isEmpty()
|
||||
gitCommit
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
|
||||
it.getTasks().iterator().forEachRemaining {
|
||||
def nameLowCase = it.name
|
||||
|
||||
if (nameLowCase.startsWith("assemble")
|
||||
&& nameLowCase.contains("Independent")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "assembleIndependent"
|
||||
} else if (nameLowCase.startsWith("assemble")
|
||||
&& nameLowCase.contains("Launcher")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "assembleLauncher"
|
||||
} else if (nameLowCase.startsWith("install")
|
||||
&& nameLowCase.contains("Independent")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "installIndependent"
|
||||
} else if (nameLowCase.startsWith("install")
|
||||
&& nameLowCase.contains("Launcher")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "installLauncher"
|
||||
}
|
||||
}
|
||||
}
|
||||
apply from: "./regroup.gradle"
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// 道路事件操作面板
|
||||
|
||||
project.dependencies {
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
d82xImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
em1Implementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
bydautoImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
|
||||
d8xxImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
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')
|
||||
bydautoImplementation project(':modules:mogo-module-event-panel-noop')
|
||||
|
||||
d8xxImplementation project(':modules:mogo-module-event-panel-noop')
|
||||
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')
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
// 基于socket长链的push推送
|
||||
|
||||
project.dependencies {
|
||||
implementation rootProject.ext.dependencies.modulepushbase
|
||||
launcherImplementation rootProject.ext.dependencies.modulepush
|
||||
independentImplementation rootProject.ext.dependencies.modulepushnoop
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.modulepushbase
|
||||
launcherImplementation rootProject.ext.dependencies.modulepush
|
||||
independentImplementation rootProject.ext.dependencies.modulepushnoop
|
||||
} else {
|
||||
implementation project(":modules:mogo-module-push-base")
|
||||
launcherImplementation project(":modules:mogo-module-push")
|
||||
independentImplementation project(":modules:mogo-module-push-noop")
|
||||
}
|
||||
}
|
||||
45
app/regroup.gradle
Normal file
45
app/regroup.gradle
Normal file
@@ -0,0 +1,45 @@
|
||||
// 将 install 和 assemble 任务按功能分组
|
||||
|
||||
afterEvaluate {
|
||||
|
||||
def independent = ["em3", "em1", "d8xx", "d82x", "bydauto"]
|
||||
def launcher = ["f8xx", "em4"]
|
||||
|
||||
it.getTasks().iterator().forEachRemaining {
|
||||
def task = it
|
||||
def taskName = task.name
|
||||
if (taskName.startsWith("assemble")
|
||||
&& taskName.contains("Independent")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
independent.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "assembleIndependent"
|
||||
}
|
||||
}
|
||||
} else if (taskName.startsWith("assemble")
|
||||
&& taskName.contains("Launcher")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
launcher.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "assembleLauncher"
|
||||
}
|
||||
}
|
||||
} else if (taskName.startsWith("install")
|
||||
&& taskName.contains("Independent")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
independent.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "installIndependent"
|
||||
}
|
||||
}
|
||||
} else if (taskName.startsWith("install")
|
||||
&& taskName.contains("Launcher")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
launcher.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "installLauncher"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import com.bytedance.boost_multidex.BoostMultiDex;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||
import com.mogo.module.back.BackToLauncherConst;
|
||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
@@ -22,6 +22,7 @@ import com.mogo.module.push.base.PushUIConstants;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.widgets.MogoWidgetsProvider;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.passport.IMogoTicketCallback;
|
||||
@@ -29,8 +30,8 @@ import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.LogLevel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.boot.persistent.lib.PersistentManager;
|
||||
import com.zhidao.mogo.module.event.panel.EventPanelConstants;
|
||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
|
||||
import com.zhidao.mogo.tanlu.api.TanluApiConst;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -57,23 +58,26 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
// MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME));
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
||||
|
||||
//运营位卡片,需要默认显示,放在第一个加载
|
||||
if (DebugConfig.isLauncher() ) {
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
|
||||
} else {
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoWidgetsProvider.PATH, MogoWidgetsProvider.NAME ) );
|
||||
}
|
||||
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
|
||||
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
|
||||
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
||||
}
|
||||
MogoModulePaths.addModule( new MogoModule( TanluApiConst.MODULE_PATH, TanluApiConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
|
||||
|
||||
MogoModulePaths.addModule( new MogoModule( EventPanelConstants.PATH_NAME,
|
||||
EventPanelConstants.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME,
|
||||
LeftPanelConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME ) );
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_MOGO_MONITOR,
|
||||
"MogoMonitor"));
|
||||
MogoModulePaths.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
|
||||
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
|
||||
|
||||
if ( !DebugConfig.isLauncher() ) {
|
||||
@@ -95,18 +99,19 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
|
||||
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
|
||||
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
|
||||
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
prepareBaseService(2_000L);
|
||||
prepareBaseService( 2_000L );
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础服务:passport、location、socket
|
||||
*/
|
||||
private void prepareBaseService(long delay) {
|
||||
private void prepareBaseService( long delay ) {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
|
||||
// 第三方平台的sn是服务端生成的,所以必须在返回后才能开启
|
||||
|
||||
@@ -4,18 +4,18 @@ ext {
|
||||
android = [
|
||||
// applicationId : "com.mogo.launcher",
|
||||
// zhidadoApplicationId: "com.zhidao.launcher",
|
||||
launcherApplicationId : "com.mogo.launcher",
|
||||
independentApplicationId : "com.mogo.launcher.app",
|
||||
fLauncherApplicationId : "com.mogo.launcher.f",
|
||||
bydautoIndependentApplicationId: "com.mogo.launcher.app.bydauto",
|
||||
fLauncherAmapApiValue : "aa2c8a0547378ead2f9a37762d9dd179",
|
||||
bydautoIndependentApiValue : "b1e1d527b02a493913c50985827c943a",
|
||||
commonLauncherAmapApiValue : "a36b9f7b086fa3951bb35338a5a06dd3",
|
||||
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
|
||||
compileSdkVersion : 28,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 19,
|
||||
targetSdkVersion : 22,
|
||||
launcherApplicationId : "com.mogo.launcher",
|
||||
independentApplicationId : "com.mogo.launcher.app",
|
||||
fLauncherApplicationId : "com.mogo.launcher.f",
|
||||
bydautoIndependentApplicationId: "com.mogo.launcher.app.bydauto",
|
||||
fLauncherAmapApiValue : "aa2c8a0547378ead2f9a37762d9dd179",
|
||||
bydautoIndependentApiValue : "b1e1d527b02a493913c50985827c943a",
|
||||
commonLauncherAmapApiValue : "a36b9f7b086fa3951bb35338a5a06dd3",
|
||||
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
|
||||
compileSdkVersion : 28,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 19,
|
||||
targetSdkVersion : 22,
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
@@ -27,6 +27,7 @@ targetSdkVersion : 22,
|
||||
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
|
||||
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
|
||||
androidxcardview : "androidx.cardview:cardview:1.0.0",
|
||||
localbroadcastmanager : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
|
||||
// flexbox
|
||||
flexbox : 'com.google.android:flexbox:2.0.1',
|
||||
// 测试
|
||||
@@ -82,11 +83,12 @@ targetSdkVersion : 22,
|
||||
roomRxjava : "android.arch.persistence.room:rxjava2:1.1.1",
|
||||
|
||||
// material
|
||||
material : 'com.google.android.material:material:1.0.0',
|
||||
material : 'com.google.android.material:material:1.1.0',
|
||||
|
||||
|
||||
// modules
|
||||
moduletanlu : "com.mogo.module:module-tanlu:${MOGO_MODULE_TANLU_VERSION}",
|
||||
moduletanluapi : "com.mogo.module:module-tanlu-api:${MOGO_TANLU_API_VERSION}",
|
||||
moduleshare : "com.mogo.module:module-share:${MOGO_MODULE_SHARE_VERSION}",
|
||||
mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}",
|
||||
mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}",
|
||||
@@ -136,7 +138,7 @@ targetSdkVersion : 22,
|
||||
jetbrainsannotationsjava5: "org.jetbrains:annotations-java5:15.0",
|
||||
|
||||
// 统一登录
|
||||
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.8",
|
||||
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.11",
|
||||
// crash
|
||||
crashSdk : "com.zhidaoauto.crash.log:library:1.0.5",
|
||||
kotlinstdlibjdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7",
|
||||
@@ -146,6 +148,7 @@ targetSdkVersion : 22,
|
||||
videoarm64 : "com.shuyu:gsyVideoPlayer-arm64:7.1.2",
|
||||
videojava : "com.shuyu:gsyVideoPlayer-java:7.1.2",
|
||||
eventbus : "org.greenrobot:eventbus:3.1.1",
|
||||
videoprocessor : "com.zhidao.video:video-processor:1.0.2.1",
|
||||
|
||||
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1",
|
||||
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1",
|
||||
@@ -178,5 +181,21 @@ targetSdkVersion : 22,
|
||||
// 基础服务实现
|
||||
mogobaseservicesdk : "com.mogo.base:services-sdk:${MOGO_BASE_SERVICES_SDK_VERSION}",
|
||||
mogobaseserviceapk : "com.mogo.base:services-apk:${MOGO_BASE_SERVICES_APK_VERSION}",
|
||||
// loglib
|
||||
mogologlib : "com.mogo.module:module-loglib:${LOGLIB_VERSION}",
|
||||
// monitor
|
||||
mogomonitor : "com.mogo.module:module-monitor:${MOGO_MODULE_MONITOR_VERSION}",
|
||||
|
||||
// google
|
||||
googlezxing : "com.google.zxing:core:3.3.3",
|
||||
litezxing : "com.google.zxing:litezxing:1.0.29.8",
|
||||
|
||||
// android - room
|
||||
androidxroomruntime : "androidx.room:room-runtime:2.2.3",
|
||||
androidxroomcompiler : "androidx.room:room-compiler:2.2.3",
|
||||
androidxroomktx : "androidx.room:room-ktx:2.2.3",
|
||||
|
||||
//
|
||||
mogomodulewidgets : "com.mogo.module:module-widgets:${MOGO_MODULE_WIDGETS_VERSION}",
|
||||
]
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.mogo.service.passport.IMogoPassportManager;
|
||||
import com.mogo.service.passport.IMogoTicketCallback;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.account.sdk.AccountClientManager;
|
||||
import com.zhidao.account.sdk.Environment;
|
||||
import com.zhidao.account.sdk.callback.TicketInfoCallback;
|
||||
import com.zhidao.account.sdk.network.NetEnvironManager;
|
||||
|
||||
@@ -27,13 +28,14 @@ class PassportManager implements IMogoPassportManager {
|
||||
|
||||
private static volatile PassportManager sInstance;
|
||||
|
||||
private PassportManager(){}
|
||||
private PassportManager() {
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static PassportManager getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( PassportManager.class ) {
|
||||
if( sInstance == null ){
|
||||
public static PassportManager getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( PassportManager.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new PassportManager();
|
||||
}
|
||||
}
|
||||
@@ -41,7 +43,7 @@ class PassportManager implements IMogoPassportManager {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@@ -77,11 +79,25 @@ class PassportManager implements IMogoPassportManager {
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
AccountClientManager.init( context.getApplicationContext(), getNetEnvironment(), NetEnvironManager.OS_2C, "os2.0-launcher" );
|
||||
}
|
||||
|
||||
private Environment getNetEnvironment() {
|
||||
int mode = DebugConfig.getNetMode();
|
||||
if ( mode == DebugConfig.NET_MODE_DEMO ) {
|
||||
// 演示环境用 qa 的
|
||||
mode = DebugConfig.NET_MODE_QA;
|
||||
}
|
||||
AccountClientManager.init( context.getApplicationContext(), mode, NetEnvironManager.OS_2C, "os2.0-launcher" );
|
||||
switch ( mode ) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
return Environment.dev;
|
||||
case DebugConfig.NET_MODE_DEMO:
|
||||
case DebugConfig.NET_MODE_QA:
|
||||
return Environment.qa;
|
||||
case DebugConfig.NET_MODE_RELEASE:
|
||||
default:
|
||||
return Environment.release;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ dependencies {
|
||||
// 长链
|
||||
implementation 'com.zhidao.socket:built-in-socket:1.0.15'
|
||||
// passport
|
||||
implementation 'com.zhidao.tcloginsdk:tclogin:1.1.0'
|
||||
implementation 'com.zhidao.tcloginsdk:tclogin:1.1.3'
|
||||
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
|
||||
@@ -237,4 +237,17 @@ public class DebugConfig {
|
||||
public static String getSocketAppId() {
|
||||
return sSocketAppId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 道路事件动画
|
||||
*/
|
||||
private static boolean sRoadEventAnimated = false;
|
||||
|
||||
public static boolean isRoadEventAnimated() {
|
||||
return sRoadEventAnimated;
|
||||
}
|
||||
|
||||
public static void setRoadEventAnimated( boolean sRoadEventAnimated ) {
|
||||
DebugConfig.sRoadEventAnimated = sRoadEventAnimated;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,9 @@ public abstract class MvpFragment<V extends IView, P extends Presenter<V>> exten
|
||||
mRootView = inflater.inflate( getLayoutId(), container, false );
|
||||
} else {
|
||||
ViewGroup viewGroup = ( ViewGroup ) mRootView.getParent();
|
||||
if ( viewGroup != null )
|
||||
if ( viewGroup != null ) {
|
||||
viewGroup.removeView( mRootView );
|
||||
}
|
||||
}
|
||||
mRootView = inflater.inflate(getLayoutId(), container, false);
|
||||
return mRootView;
|
||||
@@ -82,6 +83,10 @@ public abstract class MvpFragment<V extends IView, P extends Presenter<V>> exten
|
||||
@NonNull
|
||||
protected abstract P createPresenter();
|
||||
|
||||
public P getPresenter() {
|
||||
return mPresenter;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected <T extends View> T findViewById(int id) {
|
||||
if (mRootView == null) {
|
||||
|
||||
@@ -61,6 +61,7 @@ public class ParamsUtil {
|
||||
STATIC_PARAMS.put( ServerParam.DEVICE_ID, DeviceIdUtils.getDeviceId( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.IMEI, CommonUtils.getIMEI( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.IMSI, CommonUtils.getIMSI( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.FOTA_VERSION, Utils.getFotaVersion() );
|
||||
STATIC_PARAMS.put( ServerParam.END_POINT, ServerParam.END_POINT_CAR );
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ class ServerParam {
|
||||
public static final String SN = "sn";
|
||||
public static final String CHANNEL = "channel";
|
||||
|
||||
public static final String FOTA_VERSION = "fotaVersion";
|
||||
|
||||
public static final String USER_ID = "userId";
|
||||
public static final String FILE = "file";
|
||||
public static final String END_POINT = "endPoint";
|
||||
|
||||
@@ -57,4 +57,34 @@ public class AppUtils {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isAppForeground( Context context ) {
|
||||
if ( context != null ) {
|
||||
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningAppProcessInfo > processes = activityManager.getRunningAppProcesses();
|
||||
for ( ActivityManager.RunningAppProcessInfo processInfo : processes ) {
|
||||
if ( processInfo.processName.equals( context.getPackageName() ) ) {
|
||||
if ( processInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isAppForeground( Context context, String pkg ) {
|
||||
if ( context != null ) {
|
||||
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningAppProcessInfo > processes = activityManager.getRunningAppProcesses();
|
||||
for ( ActivityManager.RunningAppProcessInfo processInfo : processes ) {
|
||||
if ( processInfo.processName.equals( pkg ) ) {
|
||||
if ( processInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,8 +443,8 @@ public class DateTimeUtils {
|
||||
* @param timestamp 时间戳
|
||||
* @return
|
||||
*/
|
||||
public static String getTimeText( long timestamp) {
|
||||
SimpleDateFormat format = new SimpleDateFormat(yyyy_Nian_MM_Yue_dd_Ri, Locale.US);
|
||||
public static String getTimeText( long timestamp, String dateFormat) {
|
||||
SimpleDateFormat format = new SimpleDateFormat(dateFormat, Locale.US);
|
||||
String strStart = format.format(new Date(timestamp));
|
||||
return strStart;
|
||||
}
|
||||
|
||||
@@ -1,423 +0,0 @@
|
||||
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.*
|
||||
|
||||
|
||||
/**
|
||||
* <p>数据类操作实现</p>
|
||||
*Created by donghongyu on 2019/9/6.
|
||||
*/
|
||||
//T必须指明上界是Any且不为null,下面会用到反射获取对象实例,默认是Any?
|
||||
open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
|
||||
//数据库操作的引用
|
||||
private var sqLiteDatabase: SQLiteDatabase? = null
|
||||
//要操作的数据实体的引用
|
||||
private var entityClass: Class<T>? = null
|
||||
//要操作的数据表名称
|
||||
private var tableName: String? = null
|
||||
//记录数据表是否存在
|
||||
private var isInit = false
|
||||
|
||||
//因为反射会消耗时间,这里使用缓存,进行性能优化
|
||||
//缓存空间(key-字段名,标注的自定义注解 value-成员变量)
|
||||
private var cacheField: HashMap<String, Field>? = null
|
||||
|
||||
override fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class<T>): 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<T> {
|
||||
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<T> {
|
||||
//拼接分页语句
|
||||
var limitString: String? = null
|
||||
if (startIndex != null && limit != null) {
|
||||
limitString = "$startIndex,$limit"
|
||||
}
|
||||
|
||||
val condition = Condition(getContentValuesForQuery(where))
|
||||
|
||||
var cursor: Cursor? = null
|
||||
|
||||
//定义查询结果
|
||||
val result = mutableListOf<T>()
|
||||
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<String>? = null
|
||||
|
||||
//根据传入的contentValues转换成查询条件
|
||||
init {
|
||||
//记录后面填充到查询语句“?”上的数据参数
|
||||
val argList = mutableListOf<String>()
|
||||
//拼接查询语句
|
||||
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<String> {
|
||||
return this.whereArgs!!
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取查询db结果
|
||||
*/
|
||||
private fun getQueryResult(cursor: Cursor, where: T): MutableList<T> {
|
||||
//定义查询结果
|
||||
val result = mutableListOf<T>()
|
||||
//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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.mogo.utils.sqlite
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
|
||||
/**
|
||||
* <p>操作SQLite数据库的顶层接口</p>
|
||||
* Created by donghongyu on 2019/9/6.
|
||||
*/
|
||||
interface IBaseDao<T> {
|
||||
/**
|
||||
* 初始化数据库连接
|
||||
*/
|
||||
fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class<T>): 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<T>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
package com.mogo.utils.sqlite;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.sqlite.annotation.DbField;
|
||||
import com.mogo.utils.sqlite.annotation.DbTable;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 数据库操作
|
||||
*
|
||||
* @param <T>
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class SQLBaseDao<T> implements SQLIDao<T> {
|
||||
private String TAG = "SQLBaseDao";
|
||||
|
||||
//数据库操作的引用
|
||||
private SQLiteDatabase sqLiteDatabase;
|
||||
//要操作的数据实体的引用
|
||||
private Class<T> entityClass;
|
||||
//要操作的数据表名称
|
||||
private String tableName;
|
||||
//记录数据表是否存在
|
||||
private boolean isInit = false;
|
||||
|
||||
//因为反射会消耗时间,这里使用缓存,进行性能优化
|
||||
//缓存空间(key-字段名,标注的自定义注解 value-成员变量)
|
||||
private HashMap<String, Field> cacheField;
|
||||
|
||||
@Override
|
||||
public boolean init(@NotNull SQLiteDatabase sqLiteDatabase, @NotNull Class<T> entityClass) {
|
||||
this.sqLiteDatabase = sqLiteDatabase;
|
||||
this.entityClass = entityClass;
|
||||
//自动建表(只创建一次)
|
||||
if (!isInit) {
|
||||
//获取表名
|
||||
tableName = entityClass.getAnnotation(DbTable.class).tableName();
|
||||
|
||||
//如果数据库没有建立连接跳出操作防止异常信息
|
||||
if (!sqLiteDatabase.isOpen()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//执行Sql进行自动建表
|
||||
String createTableSql = getCreateTableSql();
|
||||
Logger.d(TAG, "执行SQL:" + createTableSql);
|
||||
sqLiteDatabase.execSQL(createTableSql);
|
||||
|
||||
//初始化缓存空间
|
||||
cacheField = new HashMap();
|
||||
initCacheField();
|
||||
|
||||
//标记已经创建过数据表
|
||||
isInit = true;
|
||||
}
|
||||
|
||||
return isInit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param entity 要插入数据的数据对象爱你那个
|
||||
* @return 插入结果ID,如果发生错误则为-1
|
||||
*/
|
||||
@Override
|
||||
public long insert(T entity) {
|
||||
//1、准备好ContentValues中的数据
|
||||
//2、设置插入的内容
|
||||
ContentValues values = getContentValuesForInsert(entity);
|
||||
//3、执行插入
|
||||
long result;
|
||||
if (sqLiteDatabase != null && sqLiteDatabase.isOpen()) {
|
||||
result = sqLiteDatabase.insert(tableName, null, values);
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param where 要删除的对象,对象的字段如果赋值,则代表查询条件
|
||||
* @return 受影响行数
|
||||
*/
|
||||
@Override
|
||||
public int delete(T where) {
|
||||
// 拼接查询条件
|
||||
Condition condition = new Condition(getContentValuesForQuery(where));
|
||||
int result;
|
||||
if (sqLiteDatabase != null && sqLiteDatabase.isOpen()) {
|
||||
//受影响行数
|
||||
result = sqLiteDatabase.delete(
|
||||
tableName,
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs()
|
||||
);
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
*
|
||||
* @param where 要更新的对象,对象的字段如果赋值,则代表查询条件
|
||||
* @param newEntity 新的数据内容
|
||||
* @return 受影响行数
|
||||
*/
|
||||
@Override
|
||||
public int update(T where, T newEntity) {
|
||||
Condition condition = new Condition(getContentValuesForQuery(where));
|
||||
int result;
|
||||
if (sqLiteDatabase != null && sqLiteDatabase.isOpen()) {
|
||||
//受影响行数
|
||||
result = sqLiteDatabase.update(
|
||||
tableName,
|
||||
getContentValuesForInsert(newEntity),
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs()
|
||||
);
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据
|
||||
*
|
||||
* @param where 查询条件对象,同时也用来初始化对象使用
|
||||
*/
|
||||
@NotNull
|
||||
@Override
|
||||
public List<T> query(T where) {
|
||||
return query(where, null, null, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据
|
||||
*
|
||||
* @param where 查询条件对象,同时也用来初始化对象使用
|
||||
*/
|
||||
@NotNull
|
||||
@Override
|
||||
public List<T> query(T where, String orderBy) {
|
||||
return query(where, orderBy, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param where 根据条件 [where] 进行数据查询,如果[where]==只初始化不赋值 则代表查询所有数据
|
||||
* @param orderBy 排序字段
|
||||
* @param isOrderDESC 是否倒序 true-倒序,false-正序
|
||||
* @return 结果集合
|
||||
*/
|
||||
@Override
|
||||
public List<T> query(T where, String orderBy, boolean isOrderDESC) {
|
||||
if (isOrderDESC) {
|
||||
orderBy = orderBy + " DESC";
|
||||
}
|
||||
return query(where, orderBy, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据
|
||||
*
|
||||
* @param where 查询条件对象
|
||||
* @param orderBy 排序规则
|
||||
* @param startIndex 开始的位置
|
||||
* @param limit 限制查询得到的数据个数
|
||||
*/
|
||||
public ArrayList<T> query(T where, String orderBy, Integer startIndex, Integer limit) {
|
||||
//拼接分页语句
|
||||
String limitString = null;
|
||||
if (startIndex != null && limit != null) {
|
||||
limitString = startIndex + "," + limit;
|
||||
}
|
||||
Condition condition = new Condition(getContentValuesForQuery(where));
|
||||
Cursor cursor = null;
|
||||
//定义查询结果
|
||||
ArrayList<T> result = new ArrayList<>();
|
||||
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 (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取查询db结果
|
||||
*/
|
||||
private ArrayList<T> getQueryResult(Cursor cursor, T where) {
|
||||
//定义查询结果
|
||||
ArrayList<T> result = new ArrayList<>();
|
||||
//Cursor从头读到尾
|
||||
//游标从头读到尾
|
||||
cursor.moveToFirst();
|
||||
try {
|
||||
if (where != null) {
|
||||
//移动游标获取下一行数据
|
||||
while (!cursor.isAfterLast()) {
|
||||
//通过反射构建一个查询结果对象
|
||||
T item = (T) where.getClass().newInstance();
|
||||
Set<Map.Entry<String, Field>> fieldIterator = cacheField.entrySet();
|
||||
for (Map.Entry<String, Field> stringFieldEntry : fieldIterator) {
|
||||
//获取数据库字段名称
|
||||
String columnName = stringFieldEntry.getKey();
|
||||
//数据库字段名对应的数据对象的成员变量
|
||||
Field field = stringFieldEntry.getValue();
|
||||
//获取指定列名对应的索引
|
||||
int columnIndex = cursor.getColumnIndex(columnName);
|
||||
//获取成员变量数据类型
|
||||
Class fieldType = field.getType();
|
||||
if (columnIndex != -1) {
|
||||
if (fieldType == (String.class)) {
|
||||
field.set(item, cursor.getString(columnIndex));
|
||||
} else if (fieldType == (Integer.class)) {
|
||||
field.set(item, cursor.getInt(columnIndex));
|
||||
} else if (fieldType == (Long.class)) {
|
||||
field.set(item, cursor.getLong(columnIndex));
|
||||
} else if (fieldType == (Double.class)) {
|
||||
field.set(item, cursor.getDouble(columnIndex));
|
||||
} else if (fieldType == (Boolean.class)) {
|
||||
int value = cursor.getInt(columnIndex);
|
||||
if (value == 0) {
|
||||
field.set(item, false);
|
||||
} else {
|
||||
field.set(item, true);
|
||||
}
|
||||
} else if (fieldType == (byte[].class)) {
|
||||
field.set(item, cursor.getBlob(columnIndex));
|
||||
} else {
|
||||
//未知类型
|
||||
throw new UnsupportedOperationException("未定义的数据类型:fieldName= " + columnName + " fieldType= " + fieldType);
|
||||
}
|
||||
}
|
||||
}
|
||||
//添加到结果集
|
||||
result.add(item);
|
||||
//移动到下一个位置
|
||||
cursor.moveToNext();
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException | InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
cursor.close();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化字段缓存
|
||||
*/
|
||||
private void initCacheField() {
|
||||
//1.取到所有的列名(查询一个空表获取表结构,不影响性能)
|
||||
if (sqLiteDatabase != null && sqLiteDatabase.isOpen()) {
|
||||
String sqlQuery = "select * from " + tableName + " limit 1,0";
|
||||
Cursor cursor = sqLiteDatabase.rawQuery(sqlQuery, null);
|
||||
//获取所有的列名
|
||||
String[] columnNames = cursor.getColumnNames();
|
||||
//关闭资源
|
||||
cursor.close();
|
||||
//2.取所有成员名
|
||||
Field[] columnFields = entityClass.getDeclaredFields();
|
||||
//3.通过两层循环,进行对应关系建立
|
||||
for (String columnName : columnNames) {
|
||||
for (Field columnField : columnFields) {
|
||||
if (columnName.equals(columnField.getAnnotation(DbField.class).fieldName())) {
|
||||
columnField.setAccessible(true);
|
||||
cacheField.put(columnName, columnField);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼装创建数据表的SQL语句
|
||||
*/
|
||||
private String getCreateTableSql() {
|
||||
//create table if not exists tb_name(_id integer,name varchar2(20))
|
||||
StringBuffer sqlCreateTable = new StringBuffer();
|
||||
sqlCreateTable.append("create table if not exists ");
|
||||
sqlCreateTable.append(tableName + " (");
|
||||
//反射获取所有的数据对象内的成员变量
|
||||
Field[] fields = entityClass.getDeclaredFields();
|
||||
|
||||
for (int index = 0; index < fields.length; index++) {
|
||||
//字段名称
|
||||
String columnName = fields[index].getAnnotation(DbField.class).fieldName();
|
||||
//获取成员变量数据类型
|
||||
Class fieldType = fields[index].getType();
|
||||
|
||||
if (fieldType == (String.class)) {
|
||||
sqlCreateTable.append(columnName).append(" TEXT,");
|
||||
} else if (fieldType == (Integer.class)) {
|
||||
sqlCreateTable.append(columnName).append(" INTEGER,");
|
||||
} else if (fieldType == (Long.class)) {
|
||||
sqlCreateTable.append(columnName).append(" BIGINT,");
|
||||
} else if (fieldType == (Double.class)) {
|
||||
sqlCreateTable.append(columnName).append(" DOUBLE,");
|
||||
} else if (fieldType == (Boolean.class)) {
|
||||
sqlCreateTable.append(columnName).append(" INTEGER,");
|
||||
} else if (fieldType == (byte[].class)) {
|
||||
sqlCreateTable.append(columnName).append(" BLOB,");
|
||||
} else {
|
||||
//未知类型
|
||||
throw new UnsupportedOperationException("未定义的数据类型:fieldName= " + columnName + " fieldType= " + fieldType);
|
||||
}
|
||||
|
||||
if (index == fields.length - 1) {
|
||||
if (sqlCreateTable.toString().endsWith(",")) {
|
||||
sqlCreateTable.deleteCharAt(sqlCreateTable.length() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlCreateTable.append(")");
|
||||
return sqlCreateTable.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取插入使用的ContentValues
|
||||
*/
|
||||
private ContentValues getContentValuesForInsert(T entity) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
Set<Map.Entry<String, Field>> fieldIterator = cacheField.entrySet();
|
||||
for (Map.Entry<String, Field> stringFieldEntry : fieldIterator) {
|
||||
try {
|
||||
//获取变量的值
|
||||
Object valueObject = stringFieldEntry.getValue().get(entity);
|
||||
//获取列名
|
||||
String columnName = stringFieldEntry.getKey();
|
||||
//获取成员变量数据类型
|
||||
Class fieldType = stringFieldEntry.getValue().getType();
|
||||
|
||||
if (fieldType == (String.class)) {
|
||||
contentValues.put(columnName, (String) valueObject);
|
||||
} else if (fieldType == (Integer.class)) {
|
||||
contentValues.put(columnName, (Integer) valueObject);
|
||||
} else if (fieldType == (Long.class)) {
|
||||
contentValues.put(columnName, (Long) valueObject);
|
||||
} else if (fieldType == (Double.class)) {
|
||||
contentValues.put(columnName, (Double) valueObject);
|
||||
} else if (fieldType == (Boolean.class)) {
|
||||
if (((boolean) valueObject)) {
|
||||
contentValues.put(columnName, 1);
|
||||
} else {
|
||||
contentValues.put(columnName, 0);
|
||||
}
|
||||
} else if (fieldType == (byte[].class)) {
|
||||
contentValues.put(columnName, (byte[]) valueObject);
|
||||
} else {
|
||||
//未知类型
|
||||
throw new UnsupportedOperationException("未定义的数据类型:fieldName= " + columnName + " fieldType= " + fieldType);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "contentValues:" + contentValues);
|
||||
return contentValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取查询使用的 条件值对象
|
||||
*/
|
||||
private ContentValues getContentValuesForQuery(T entity) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
try {
|
||||
if (entity != null) {
|
||||
Set<Map.Entry<String, Field>> fieldIterator = cacheField.entrySet();
|
||||
for (Map.Entry<String, Field> stringFieldEntry : fieldIterator) {
|
||||
if (stringFieldEntry.getValue().get(entity) != null) {
|
||||
// 针对Boolean类型进行处理
|
||||
if (stringFieldEntry.getValue().get(entity) instanceof Boolean) {
|
||||
if ((boolean) stringFieldEntry.getValue().get(entity)) {
|
||||
contentValues.put(stringFieldEntry.getKey(), "1");
|
||||
} else {
|
||||
contentValues.put(stringFieldEntry.getKey(), "0");
|
||||
}
|
||||
}
|
||||
// 其它数据类型处理
|
||||
else {
|
||||
contentValues.put(stringFieldEntry.getKey(),
|
||||
stringFieldEntry.getValue().get(entity).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessError | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return contentValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件拼接对象
|
||||
*/
|
||||
static class Condition {
|
||||
/**
|
||||
* 条件key拼接
|
||||
* _id=?&&name=?
|
||||
*/
|
||||
private String whereCause;
|
||||
|
||||
/**
|
||||
* 条件值,与 whereCause 顺序一致
|
||||
*/
|
||||
private String[] whereArgs;
|
||||
|
||||
//根据传入的contentValues转换成查询条件
|
||||
public Condition(ContentValues whereContent) {
|
||||
//记录后面填充到查询语句“?”上的数据参数
|
||||
ArrayList<String> argList = new ArrayList<>();
|
||||
//拼接查询语句
|
||||
StringBuilder whereCaseSb = new StringBuilder();
|
||||
|
||||
/*
|
||||
* 是为了链接下面的查询条件条件,也或者是替换没有查询条件的语句。
|
||||
* 比如:要把检索条件作为一个参数传递给SQL,
|
||||
* 那么,当这个检索语句不存在的话就可以给它赋值为1=1.
|
||||
* 这样就避免了SQL出错,也就可以把加条件的SQL和不加条件的SQL合二为一。
|
||||
*/
|
||||
whereCaseSb.append(" 1=1 ");
|
||||
|
||||
Set<String> keys = whereContent.keySet();
|
||||
|
||||
//因为使用了“1=1”,所以即便是这里没有任何数据拼接,也是可以正常
|
||||
for (String key : keys) {
|
||||
Object valueObject = whereContent.get(key);
|
||||
if (valueObject != null) {
|
||||
String value = (String) valueObject;
|
||||
//拼接查询条件语句
|
||||
//1:1 and _id=? and name=?
|
||||
whereCaseSb.append(" and " + key + " =?");
|
||||
//记录?对应的value
|
||||
argList.add(value);
|
||||
}
|
||||
}
|
||||
//集合转成数组
|
||||
this.whereArgs = argList.toArray(new String[argList.size()]);
|
||||
this.whereCause = whereCaseSb.toString();
|
||||
}
|
||||
|
||||
public String getWhereCause() {
|
||||
return this.whereCause;
|
||||
}
|
||||
|
||||
public String[] getWhereArgs() {
|
||||
return this.whereArgs;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,14 @@ import com.mogo.utils.sqlite.proxy.BaseDaoProxyLog
|
||||
* <p>数据库处理工厂</p>
|
||||
* Created by donghongyu on 2019/9/6.
|
||||
*/
|
||||
open class BaseDaoFactory {
|
||||
open class SQLDaoFactory {
|
||||
|
||||
//默认数据库名称
|
||||
private var dbName = "MoGoSQLite.db"
|
||||
|
||||
companion object {
|
||||
//单利工厂
|
||||
private var baseDaoFactory: BaseDaoFactory? = null
|
||||
private var sqlDaoFactory: SQLDaoFactory? = null
|
||||
|
||||
//数据库存储路径
|
||||
private lateinit var sqLiteDatabasePath: String
|
||||
@@ -25,21 +25,21 @@ open class BaseDaoFactory {
|
||||
//数据库操作类
|
||||
private var sqLiteDatabase: SQLiteDatabase? = null
|
||||
|
||||
fun getInstance(): BaseDaoFactory {
|
||||
if (baseDaoFactory == null) {
|
||||
synchronized(BaseDaoFactory::class.java) {
|
||||
if (baseDaoFactory == null) {
|
||||
baseDaoFactory = BaseDaoFactory()
|
||||
fun getInstance(): SQLDaoFactory {
|
||||
if (sqlDaoFactory == null) {
|
||||
synchronized(SQLDaoFactory::class.java) {
|
||||
if (sqlDaoFactory == null) {
|
||||
sqlDaoFactory = SQLDaoFactory()
|
||||
}
|
||||
}
|
||||
}
|
||||
return baseDaoFactory!!
|
||||
return sqlDaoFactory!!
|
||||
}
|
||||
}
|
||||
|
||||
//获取数据库操作对象
|
||||
fun <T : Any> getBaseDao(context: Context, entityClass: Class<T>): IBaseDao<T>? {
|
||||
var baseDao: IBaseDao<T>? = null
|
||||
fun <T : Any> getBaseDao(context: Context, entityClass: Class<T>): SQLIDao<T>? {
|
||||
var baseDao: SQLIDao<T>? = null
|
||||
|
||||
try {
|
||||
//获取数据库名称,如果没有设置则使用默认名称
|
||||
@@ -49,12 +49,14 @@ open class BaseDaoFactory {
|
||||
}
|
||||
//openOrCreateDatabase 如果不存在则先创建再打开数据库,如果存在则直接打开。
|
||||
sqLiteDatabasePath =
|
||||
"${context.getDir("database", Context.MODE_APPEND).path}/$dbName"
|
||||
"${context.getDir("database", Context.MODE_APPEND).path}/$dbName"
|
||||
sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(sqLiteDatabasePath, null)
|
||||
|
||||
// 这里为了演示,添加了日志工具的叠加使用,根据需要可以自己修改
|
||||
// baseDao = BaseDaoProxyShow().bind(BaseDaoProxyLog().bind(BaseDao<T>())) as IBaseDao<T>
|
||||
baseDao = BaseDaoProxyLog().bind(BaseDao<T>()) as IBaseDao<T>
|
||||
// baseDao = BaseDaoProxyLog().bind(SQLBaseDao<T>()) as IBaseDao<T>
|
||||
// baseDao = BaseDao<T>()
|
||||
baseDao = BaseDaoProxyLog().bind(SQLBaseDao<T>()) as SQLIDao<T>
|
||||
|
||||
baseDao.init(sqLiteDatabase!!, entityClass)
|
||||
} catch (e: Exception) {
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.mogo.utils.sqlite;
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据库操作接口
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
public interface SQLIDao<T> {
|
||||
/**
|
||||
* 初始化数据库连接
|
||||
*/
|
||||
boolean init(SQLiteDatabase sqLiteDatabase, Class<T> entityClass);
|
||||
|
||||
/**
|
||||
* 将 [entity] 进行数据插入
|
||||
*/
|
||||
long insert(T entity);
|
||||
|
||||
/**
|
||||
* 根据条件 [where] 进行数据删除,如果[where]==只初始化不赋值 则代表删除所有数据
|
||||
*/
|
||||
int delete(T where);
|
||||
|
||||
/**
|
||||
* 根据条件 [where] 进行数据更新,如果[where]==只初始化不赋值 则代表删除所有数据
|
||||
*/
|
||||
int update(T where, T newEntity);
|
||||
|
||||
/**
|
||||
* @param where 根据条件 [where] 进行数据查询,如果[where]==只初始化不赋值 则代表查询所有数据
|
||||
* @return 结果集合
|
||||
*/
|
||||
List<T> query(T where);
|
||||
|
||||
/**
|
||||
* @param where 根据条件 [where] 进行数据查询,如果[where]==只初始化不赋值 则代表查询所有数据
|
||||
* @param orderBy 排序字段
|
||||
* @return 结果集合
|
||||
*/
|
||||
List<T> query(T where, String orderBy);
|
||||
|
||||
/**
|
||||
* @param where 根据条件 [where] 进行数据查询,如果[where]==只初始化不赋值 则代表查询所有数据
|
||||
* @param orderBy 排序字段
|
||||
* @param isOrderDESC 是否倒序
|
||||
* @return 结果集合
|
||||
*/
|
||||
List<T> query(T where, String orderBy, boolean isOrderDESC);
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.mogo.utils.sqlite.proxy
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import android.util.Log
|
||||
import com.mogo.utils.sqlite.IBaseDao
|
||||
|
||||
/**
|
||||
* <p>静态代理数据库操作类,用来记录日志</P>
|
||||
* Created by donghongyu on 2019/9/6.
|
||||
*/
|
||||
class BaseDaoProxy<T>(var iBaseDao: IBaseDao<T>) : IBaseDao<T> by iBaseDao {
|
||||
override fun init(sqLiteDatabase: SQLiteDatabase, entityClass: Class<T>): 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<T> {
|
||||
Log.i("数据库代理", "开始查询数据……")
|
||||
val result = iBaseDao.query(where)
|
||||
Log.i("数据库代理", "查询到> ${result.size} <条数据……")
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.utils.sqlite.proxy
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.mogo.utils.network.utils.GsonUtil
|
||||
import java.lang.reflect.InvocationHandler
|
||||
import java.lang.reflect.Method
|
||||
import java.lang.reflect.Proxy
|
||||
@@ -24,8 +25,8 @@ class BaseDaoProxyLog : InvocationHandler {
|
||||
this.target = target
|
||||
//取得代理对象
|
||||
return Proxy.newProxyInstance(
|
||||
target.javaClass.classLoader,
|
||||
target.javaClass.interfaces, this
|
||||
target.javaClass.classLoader,
|
||||
target.javaClass.interfaces, this
|
||||
)
|
||||
}
|
||||
|
||||
@@ -40,11 +41,11 @@ class BaseDaoProxyLog : InvocationHandler {
|
||||
override fun invoke(proxy: Any, method: Method, args: Array<Any>): Any? {
|
||||
var result: Any? = null
|
||||
//反射方法前调用
|
||||
Log.i("数据库代理", "当前执行>>${method.name}")
|
||||
Logger.i("SQL数据库管理", "当前执行>>${method.name}>>")
|
||||
//反射执行方法 相当于调用target.sayHelllo;
|
||||
result = method.invoke(target, *args)
|
||||
//反射方法后调用.
|
||||
Log.i("数据库代理", "执行结果>>$result")
|
||||
Logger.i("SQL数据库管理", "执行结果>>$result")
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
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>): Any? {
|
||||
var result: Any? = null
|
||||
//反射方法前调用
|
||||
Log.i("数据库代理", "显示执行>>${method.name}")
|
||||
//反射执行方法 相当于调用target.sayHelllo;
|
||||
result = method.invoke(target, *args)
|
||||
//反射方法后调用.
|
||||
Log.i("数据库代理", "执行结果>>$result")
|
||||
return result
|
||||
}
|
||||
}
|
||||
@@ -65,28 +65,33 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.1.24
|
||||
# 车聊聊
|
||||
CARCHATTING_VERSION=1.4.8
|
||||
CARCHATTING_VERSION=1.5.1
|
||||
# 车聊聊接口
|
||||
CARCHATTINGPROVIDER_VERSION=1.3.4
|
||||
# 视频引导
|
||||
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
|
||||
# 推送
|
||||
MOGO_MODULE_PUSH_VERSION=1.1.5.7
|
||||
MOGO_MODULE_PUSH_VERSION=1.1.6.2
|
||||
MOGO_MODULE_PUSH_BASE_VERSION=1.1.5.5
|
||||
MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6
|
||||
# 广告资源位
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.1
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=1.3.1.24
|
||||
MOGO_TANLU_API_VERSION = 1.0.0-SNAPSHOT
|
||||
|
||||
MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT
|
||||
#左侧面板模块
|
||||
MOGO_MODULE_LEFT_PANEL_VERSION = 1.2.1.10-SNAPSHOT
|
||||
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION = 1.2.1.10-SNAPSHOT
|
||||
# 小控件
|
||||
MOGO_MODULE_WIDGETS_VERSION = 1.2.1.10-SNAPSHOT
|
||||
|
||||
# Boost分包
|
||||
BOOST_MULTIDEX_VERSION=1.0.0
|
||||
@@ -100,8 +105,13 @@ MOGO_MODULE_OBU_VERSION = 1.2.1.10-SNAPSHOT
|
||||
MOGO_MODULE_SPLASH_VERSION = 1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_SPLASH_NOOP_VERSION = 1.0.0-SNAPSHOT
|
||||
|
||||
## 产品库必备配置
|
||||
# loglib
|
||||
LOGLIB_VERSION = 1.0.4
|
||||
# monitor
|
||||
MOGO_MODULE_MONITOR_VERSION = 1.0.0-SNAPSHOT
|
||||
|
||||
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
|
||||
applicationId=com.mogo.launcer
|
||||
applicationName=IntelligentPilot
|
||||
versionCode=80006
|
||||
versionName=8.0.6
|
||||
versionCode=80007
|
||||
versionName=8.0.7
|
||||
@@ -12,7 +12,7 @@ public interface IMogoMarkerClickListener {
|
||||
* 事件是否继续往下传递
|
||||
*
|
||||
* @param marker
|
||||
* @return true - 时间已经处理完毕不继续往下传,否则继续往下传
|
||||
* @return true - 事件已经处理完毕不继续往下传,否则继续往下传
|
||||
*/
|
||||
boolean onMarkerClicked( IMogoMarker marker );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
@@ -39,16 +36,16 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
compileOnly rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.tanluupload
|
||||
} else {
|
||||
compileOnly project(':modules:mogo-module-common')
|
||||
implementation project(':libraries:tanlulib')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.zhidao.mogo.tanlu.api.MogoTanluApiProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Group$$tanlulib implements IRouteGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> atlas) {
|
||||
atlas.put("/tanlulib/api", RouteMeta.build(RouteType.PROVIDER, MogoTanluApiProvider.class, "/tanlulib/api", "tanlulib", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProviderGroup;
|
||||
import com.zhidao.mogo.tanlu.api.MogoTanluApiProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Providers$$mogotanluapi implements IProviderGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> providers) {
|
||||
providers.put("com.mogo.service.tanlu.IMogoTanluProvider", RouteMeta.build(RouteType.PROVIDER, MogoTanluApiProvider.class, "/tanlulib/api", "tanlulib", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteRoot;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Root$$mogotanluapi implements IRouteRoot {
|
||||
@Override
|
||||
public void loadInto(Map<String, Class<? extends IRouteGroup>> routes) {
|
||||
routes.put("tanlulib", ARouter$$Group$$tanlulib.class);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.zhidao.mogo.tanlu.api;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.zhidao.mogo.tanlu.api";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.zhidao.mogo.tanlu.api";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "1.0.0-SNAPSHOT";
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.tanlu.api"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0.0-SNAPSHOT" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
/
|
||||
|
||||
</manifest>
|
||||
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0-SNAPSHOT","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
@@ -1 +0,0 @@
|
||||
{"jetified-arouter-compiler-1.2.2.jar (com.alibaba:arouter-compiler:1.2.2)":false,"auto-service-1.0-rc2.jar (com.google.auto.service:auto-service:1.0-rc2)":false}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\debug\jniLibs"/></dataSet></merger>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\debug\shaders"/></dataSet></merger>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\assets"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\intermediates\shader_assets\debug\compileDebugShaders\out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\debug\assets"/></dataSet></merger>
|
||||
@@ -1 +0,0 @@
|
||||
#Tue Aug 11 10:29:55 CST 2020
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\res"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\rs\debug"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\resValues\debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\res"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\rs\debug"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\resValues\debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\debug\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\debug\res"/></dataSet><mergedItems/></merger>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.tanlu.api"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0.0-SNAPSHOT" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
/
|
||||
|
||||
</manifest>
|
||||
@@ -1,2 +0,0 @@
|
||||
R_DEF: Internal format may change without notice
|
||||
local
|
||||
@@ -1,14 +0,0 @@
|
||||
1<?xml version="1.0" encoding="utf-8"?>
|
||||
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
3 package="com.zhidao.mogo.tanlu.api"
|
||||
4 android:versionCode="1"
|
||||
5 android:versionName="1.0.0-SNAPSHOT" >
|
||||
6
|
||||
7 <uses-sdk
|
||||
8 android:minSdkVersion="19"
|
||||
8-->F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
9 android:targetSdkVersion="22" />
|
||||
9-->F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
10 /
|
||||
11
|
||||
12</manifest>
|
||||
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0-SNAPSHOT","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"..\\..\\library_manifest\\debug\\AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,37 +0,0 @@
|
||||
-- Merging decision tree log ---
|
||||
manifest
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
package
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:2:5-40
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:versionName
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:versionCode
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
xmlns:android
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:11-69
|
||||
uses-sdk
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml reason: use-sdk injection requested
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:targetSdkVersion
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:minSdkVersion
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
0
libraries/mogo-tanlu-api/consumer-rules.pro
Normal file
0
libraries/mogo-tanlu-api/consumer-rules.pro
Normal file
@@ -1,3 +1,3 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-event-panel
|
||||
POM_ARTIFACT_ID=module-tanlu-api
|
||||
VERSION_CODE=1
|
||||
21
libraries/mogo-tanlu-api/proguard-rules.pro
vendored
Normal file
21
libraries/mogo-tanlu-api/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.zhidao.mogo.tanlu.api;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.zhidao.mogo.tanlu.api.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.event.panel">
|
||||
package="com.zhidao.mogo.tanlu.api">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zhidao.mogo.tanlu.api;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.tanlu.IMogoTanluProvider;
|
||||
import com.mogo.service.tanlu.TanluUploadParams;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.roadcondition.service.MainService;
|
||||
import com.zhidao.roadcondition.service.UploadParams;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static com.zhidao.mogo.tanlu.api.TanluApiConst.MODULE_NAME;
|
||||
import static com.zhidao.mogo.tanlu.api.TanluApiConst.MODULE_PATH;
|
||||
|
||||
/**
|
||||
* 探路api
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = MODULE_PATH)
|
||||
public class MogoTanluApiProvider implements IMogoTanluProvider {
|
||||
private Context context;
|
||||
|
||||
/**
|
||||
* 上传情报
|
||||
*
|
||||
* @param params 情报类型
|
||||
*/
|
||||
@Override
|
||||
public void uploadRoadCondition(TanluUploadParams params) {
|
||||
if(params!=null) {
|
||||
Logger.d(MODULE_NAME, "uploadRoadCondition: " + params);
|
||||
Map<String, Object> properties = new ArrayMap<>();
|
||||
properties.put("type", params.getEventType());
|
||||
properties.put("from", params.getFromType());
|
||||
AnalyticsUtils.track("v2x_share_type", properties);
|
||||
MainService.Companion.launchService(context, new UploadParams(params.getEventType(),
|
||||
params.getFromType(), params.getDuration()));
|
||||
}else{
|
||||
throw new IllegalArgumentException("TanluUploadParams 不允许为空");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启探路业务服务
|
||||
*/
|
||||
@Override
|
||||
public void startTanluService() {
|
||||
Logger.d(MODULE_NAME, "startTanluService");
|
||||
MainService.Companion.launchService(context, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.zhidao.mogo.tanlu.api;
|
||||
|
||||
/**
|
||||
* 探路api相关常量
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class TanluApiConst {
|
||||
public static final String MODULE_NAME = "MogoTanluApi";
|
||||
public static final String MODULE_PATH = "/tanlulib/api";
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zhidao.mogo.tanlu.api;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
1
libraries/tanlulib/.gitignore
vendored
Normal file
1
libraries/tanlulib/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
70
libraries/tanlulib/build.gradle
Normal file
70
libraries/tanlulib/build.gradle
Normal file
@@ -0,0 +1,70 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'android-aspectjx'
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
zipAlignEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.core:core-ktx:1.3.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation 'com.zhidaoauto.common:service:1.0.4.10'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
|
||||
implementation 'com.zhidaoauto.controller:api:1.0.8'
|
||||
implementation 'com.zhidao.cosupload:cosuploadsdk:1.1.6'
|
||||
implementation 'com.zhidao.video:video-processor:1.0.2.1'
|
||||
implementation 'com.foundation.utils:common-utils:1.0.7'
|
||||
|
||||
compileOnly rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.eventbus
|
||||
implementation rootProject.ext.dependencies.coroutinescore
|
||||
implementation rootProject.ext.dependencies.coroutinesandroid
|
||||
implementation rootProject.ext.dependencies.retrofit
|
||||
implementation rootProject.ext.dependencies.retrofitconvertergson
|
||||
implementation rootProject.ext.dependencies.gson
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
compileOnly rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.aspectj
|
||||
implementation rootProject.ext.dependencies.analytics
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.zhidao.roadcondition;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.zhidao.roadcondition";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.zhidao.roadcondition";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "1.0";
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.roadcondition"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="29" />
|
||||
|
||||
<application>
|
||||
|
||||
<!-- 分享相关广播 -->
|
||||
<receiver
|
||||
android:name="com.zhidao.roadcondition.receiver.ShareRoadReceiver"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="com.zhidao.share.roadcondition.action" />
|
||||
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- 获取图片和视频的服务 -->
|
||||
<service
|
||||
android:name="com.zhidao.roadcondition.service.MainService"
|
||||
android:enabled="true" />
|
||||
<service
|
||||
android:name="com.zhidao.roadcondition.service.DelayService"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"tanlulib-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.roadcondition","split":""}}]
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\main\jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\debug\jniLibs"/></dataSet></merger>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\main\shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\debug\shaders"/></dataSet></merger>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\main\assets"/><source path="F:\Station\Launcher\libraries\tanlulib\build\intermediates\shader_assets\debug\compileDebugShaders\out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\debug\assets"/></dataSet></merger>
|
||||
@@ -1 +0,0 @@
|
||||
#Tue Aug 11 10:29:55 CST 2020
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\main\res"/><source path="F:\Station\Launcher\libraries\tanlulib\build\generated\res\rs\debug"/><source path="F:\Station\Launcher\libraries\tanlulib\build\generated\res\resValues\debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\main\res"/><source path="F:\Station\Launcher\libraries\tanlulib\build\generated\res\rs\debug"/><source path="F:\Station\Launcher\libraries\tanlulib\build\generated\res\resValues\debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\debug\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\tanlulib\src\debug\res"/></dataSet><mergedItems/></merger>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.roadcondition"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="29" />
|
||||
|
||||
<application>
|
||||
|
||||
<!-- 分享相关广播 -->
|
||||
<receiver
|
||||
android:name="com.zhidao.roadcondition.receiver.ShareRoadReceiver"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="com.zhidao.share.roadcondition.action" />
|
||||
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- 获取图片和视频的服务 -->
|
||||
<service
|
||||
android:name="com.zhidao.roadcondition.service.MainService"
|
||||
android:enabled="true" />
|
||||
<service
|
||||
android:name="com.zhidao.roadcondition.service.DelayService"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,2 +0,0 @@
|
||||
R_DEF: Internal format may change without notice
|
||||
local
|
||||
@@ -1,50 +0,0 @@
|
||||
1<?xml version="1.0" encoding="utf-8"?>
|
||||
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
3 package="com.zhidao.roadcondition"
|
||||
4 android:versionCode="1"
|
||||
5 android:versionName="1.0" >
|
||||
6
|
||||
7 <uses-sdk
|
||||
8 android:minSdkVersion="19"
|
||||
8-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml
|
||||
9 android:targetSdkVersion="29" />
|
||||
9-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml
|
||||
10
|
||||
11 <application>
|
||||
11-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:4:5-24:19
|
||||
12
|
||||
13 <!-- 分享相关广播 -->
|
||||
14 <receiver
|
||||
14-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:6:9-13:20
|
||||
15 android:name="com.zhidao.roadcondition.receiver.ShareRoadReceiver"
|
||||
15-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:7:13-55
|
||||
16 android:exported="true" >
|
||||
16-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:8:13-36
|
||||
17 <intent-filter>
|
||||
17-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:9:13-12:29
|
||||
18 <action android:name="com.zhidao.share.roadcondition.action" />
|
||||
18-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:10:17-80
|
||||
18-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:10:25-77
|
||||
19
|
||||
20 <category android:name="android.intent.category.HOME" />
|
||||
20-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:11:17-73
|
||||
20-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:11:27-70
|
||||
21 </intent-filter>
|
||||
22 </receiver>
|
||||
23
|
||||
24 <!-- 获取图片和视频的服务 -->
|
||||
25 <service
|
||||
25-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:16:9-18:38
|
||||
26 android:name="com.zhidao.roadcondition.service.MainService"
|
||||
26-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:17:13-48
|
||||
27 android:enabled="true" />
|
||||
27-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:18:13-35
|
||||
28 <service
|
||||
28-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:20:9-22:40
|
||||
29 android:name="com.zhidao.roadcondition.service.DelayService"
|
||||
29-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:21:13-49
|
||||
30 android:exported="false" />
|
||||
30-->F:\Station\Launcher\libraries\tanlulib\src\main\AndroidManifest.xml:22:13-37
|
||||
31 </application>
|
||||
32
|
||||
33</manifest>
|
||||
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"tanlulib-debug.aar","fullName":"debug","baseName":"debug"},"path":"..\\..\\library_manifest\\debug\\AndroidManifest.xml","properties":{"packageId":"com.zhidao.roadcondition","split":""}}]
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user