taxiApp26.3.9release版本

This commit is contained in:
刘金华 2023-09-01 16:13:32 +08:00
parent faebc07e8a
commit d5b1814ae2
38 changed files with 700 additions and 418 deletions

View File

@ -1,2 +0,0 @@
#Tue Jul 18 17:57:57 GMT+08:00 2023
gradle.version=5.6.4

View File

@ -21,8 +21,8 @@ android {
applicationId "net.sysolution.taxiapp" applicationId "net.sysolution.taxiapp"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 208 versionCode 229
versionName "3.3.3-beta26.3.8.2-release" versionName "3.3.3-beta26.3.9.3.5-release"
//alphaxx - ,bug //alphaxx - ,bug
//Betaxx - //Betaxx -
@ -33,7 +33,6 @@ android {
//3.1.10 //3.1.10
//3.2.0广 //3.2.0广
//333-10 crashHandler //333-10 crashHandler
//333-11 KuroLog日志 //333-11 KuroLog日志
@ -52,6 +51,11 @@ android {
26.3.8.9debug 广ledOk重复绑定同一个凭证会被过滤3s没gps信息清除定点广告改成30s 26.3.8.9debug 广ledOk重复绑定同一个凭证会被过滤3s没gps信息清除定点广告改成30s
gps信息gps则判断是否有定点广告 gps信息gps则判断是否有定点广告
26.3.8 logo 26.3.8 logo
26.3.8.2 taxiApp刷新列表时使广广
26.3.8.3 taxiApp刷新列表时广,广regions也加入缓存机制
26.3.8.6.9 38s
26.3.9 webSocket的连接保活代码gps坐标记录两个点的距离由原来的50米记录一次改为20米记录一次
26.3.9.3.5
**/ **/
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -6,6 +6,7 @@ import android.util.Log;
import com.google.gson.Gson; import com.google.gson.Gson;
import cn.trans88.taxiappkotlin.logic.model.BackgroundType; import cn.trans88.taxiappkotlin.logic.model.BackgroundType;
import cn.trans88.taxiappkotlin.util.DateUtil;
import cn.trans88.taxiappkotlin.util.YoungUtil; import cn.trans88.taxiappkotlin.util.YoungUtil;
public class Configurations { public class Configurations {
@ -53,6 +54,14 @@ public class Configurations {
loggerSwitchSave(false); loggerSwitchSave(false);
gpsSwitchSave(false); gpsSwitchSave(false);
upload_debug_file_urlSave("http://taxihub.cn:2345/postDebugFile"); upload_debug_file_urlSave("http://taxihub.cn:2345/postDebugFile");
//edit by ljh @2023/8/14
TaxiApp taxiApp = (TaxiApp) TaxiApp.Companion.instance();
taxiApp.getDaoAds().clear();
taxiApp.getRegionsList().clear();
//edit by ljh @2023/8/22
// taxiApp.saveLog("第一次注册清空了播放列表数据first register clear play order.");
}else{ }else{
YoungUtil.YoungLog("copy configurations"); YoungUtil.YoungLog("copy configurations");
YoungUtil.YoungLog("read file :cn.trans88.taxiappkotlin.logic.Settings OK"); YoungUtil.YoungLog("read file :cn.trans88.taxiappkotlin.logic.Settings OK");
@ -277,7 +286,8 @@ public class Configurations {
} }
public String advertiseOrder(){ public String advertiseOrder(){
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("advertiseOrder", ""); String adOrder = context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("advertiseOrder", "");
return adOrder != null ? adOrder : "";
} }
public void advertiseOrderSave(String s){ public void advertiseOrderSave(String s){

View File

@ -1,29 +1,36 @@
package cn.trans88.taxiappkotlin package cn.trans88.taxiappkotlin
import android.app.Application import android.app.Application
import android.content.Context
import android.content.Intent import android.content.Intent
import android.media.MediaCodecList import android.media.MediaCodecList
import android.os.Looper
import android.util.Log import android.util.Log
import cn.trans88.kurotool.util.LogLevel import cn.trans88.kurotool.util.LogLevel
import cn.trans88.kurotool.util.LogUtil import cn.trans88.kurotool.util.LogUtil
import cn.trans88.taxiappkotlin.ext.logd
import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.dao.DaoMaster import cn.trans88.taxiappkotlin.logic.dao.DaoMaster
import cn.trans88.taxiappkotlin.logic.dao.DaoSession import cn.trans88.taxiappkotlin.logic.dao.DaoSession
import cn.trans88.taxiappkotlin.logic.dao.HelperDaoDB import cn.trans88.taxiappkotlin.logic.dao.HelperDaoDB
import cn.trans88.taxiappkotlin.logic.exception.CrashHandler import cn.trans88.taxiappkotlin.logic.exception.CrashHandler
import cn.trans88.taxiappkotlin.logic.model.Advertise import cn.trans88.taxiappkotlin.logic.model.Advertise
import cn.trans88.taxiappkotlin.logic.model.BackgroundType import cn.trans88.taxiappkotlin.logic.model.BackgroundType
import cn.trans88.taxiappkotlin.logic.model.Regions
import cn.trans88.taxiappkotlin.logic.network.JoeyDownloadManager import cn.trans88.taxiappkotlin.logic.network.JoeyDownloadManager
import cn.trans88.taxiappkotlin.net.BizInterceptor import cn.trans88.taxiappkotlin.net.BizInterceptor
import cn.trans88.taxiappkotlin.ui.custom.JVideoView import cn.trans88.taxiappkotlin.ui.custom.JVideoView
import cn.trans88.taxiappkotlin.ui.play.PlayActivity import cn.trans88.taxiappkotlin.ui.play.PlayActivity
import cn.trans88.taxiappkotlin.util.DateUtil
import cn.trans88.taxiappkotlin.util.YoungUtil import cn.trans88.taxiappkotlin.util.YoungUtil
import com.facebook.stetho.Stetho import com.facebook.stetho.Stetho
import com.google.gson.Gson import com.google.gson.Gson
import com.trs88.kurolibrary.log.* import com.trs88.kurolibrary.log.*
import com.trs88.kurolibrary.restful.retrofit.KuroApiFactory import com.trs88.kurolibrary.restful.retrofit.KuroApiFactory
import io.reactivex.plugins.RxJavaPlugins import io.reactivex.plugins.RxJavaPlugins
import java.io.File import java.io.*
import java.util.* import java.util.*
import java.util.concurrent.CopyOnWriteArrayList
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
import kotlin.collections.HashMap import kotlin.collections.HashMap
@ -35,9 +42,17 @@ class TaxiApp:Application() {
var gson = Gson() var gson = Gson()
var defaultBackgroundType = "" var defaultBackgroundType = ""
//缓存数据库所有广告
var daoAds:CopyOnWriteArrayList<Advertise> = CopyOnWriteArrayList()
//缓存数据库regions
var regionsList:CopyOnWriteArrayList<Regions> = CopyOnWriteArrayList()
var nextVideoView:JVideoView? = null var nextVideoView:JVideoView? = null
var clearOrderTimer = Timer()
var isDoubleClearOrder = 0
val timer = Timer() val timer = Timer()
//定时任务是否执行 //定时任务是否执行
var isTimed:Boolean = false var isTimed:Boolean = false
@ -48,12 +63,13 @@ class TaxiApp:Application() {
var activity:PlayActivity? = null var activity:PlayActivity? = null
var testCount = 0 var testCount = 0
val TAG ="TaxiApp" val TAG = "TaxiApp"
val poolSize =Runtime.getRuntime().availableProcessors()*2+1 val poolSize = Runtime.getRuntime().availableProcessors()*2+1
// lateinit var listener:Player.Listener // lateinit var listener:Player.Listener
// var player: SimpleExoPlayer? = null // var player: SimpleExoPlayer? = null
// lateinit var factory: ProgressiveMediaSource.Factory // lateinit var factory: ProgressiveMediaSource.Factory
companion object{ companion object{
private var instance:Application? =null private var instance:Application? =null
fun instance() = instance!! fun instance() = instance!!
@ -68,6 +84,23 @@ class TaxiApp:Application() {
// var isFirstRegister = true // var isFirstRegister = true
} }
/**
* 保存日志到卡内存
* @param text String
*/
fun saveLog(text:String){
try{
val output = openFileOutput("logs", Context.MODE_APPEND)
val writer = BufferedWriter(OutputStreamWriter(output))
writer.use {
writer.write("${DateUtil.nowTime()} :: $text")
writer.newLine() //换行
}
} catch (e: IOException){
e.printStackTrace()
}
}
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
instance = this instance = this
@ -86,6 +119,7 @@ class TaxiApp:Application() {
setLogUtil() setLogUtil()
//获取设备上支持的所有解码器列表 //获取设备上支持的所有解码器列表
val allCodecs = MediaCodecList(MediaCodecList.ALL_CODECS) val allCodecs = MediaCodecList(MediaCodecList.ALL_CODECS)
val codes = allCodecs.codecInfos; val codes = allCodecs.codecInfos;
@ -199,6 +233,58 @@ class TaxiApp:Application() {
} }
} }
/**
* 删除缓存列表的单个广告
* @param advertise Advertise
*/
fun removeCacheAd(advertise: Advertise){
var index = 0;
for (daoAd in daoAds) {
if (daoAd.ad_id.equals(advertise.ad_id)){
index = daoAds.indexOf(daoAd)
break
}
}
daoAds.removeAt(index)
}
/**
* 更新集合里的Region
*/
fun updateCacheRegions(newRegion: Regions){
//edit by ljh @2023/8/11
var index = -1
for (region in regionsList) {
if (newRegion.autoId == region.autoId){
index = regionsList.indexOf(region)
}
}
if (index != -1) {
regionsList.removeAt(index)
regionsList.add(index,newRegion)
"updateCacheRegions:${newRegion.regionAdId},autoId:${newRegion.autoId}".logd()
}
"updateCacheRegions:${index}".logd()
}
/**
* 更新集合里的广告
* @param newAdvertise Advertise
*/
fun updateCacheAdvertise(newAdvertise: Advertise){
"updateCacheAdvertise:${newAdvertise}".logd()
var index = -1
for (daoAd in daoAds) {
if (newAdvertise.ad_id.equals(daoAd.ad_id)){
index = daoAds.indexOf(daoAd)
}
}
if (index != -1) {
daoAds.removeAt(index)
daoAds.add(index,newAdvertise)
}
}
private fun setLogUtil(){ private fun setLogUtil(){
val file = File(filesDir, "/log") val file = File(filesDir, "/log")
if (!file.exists()){ if (!file.exists()){

View File

@ -26,11 +26,8 @@ import cn.trans88.taxiappkotlin.play.RefreshPlayer
import cn.trans88.taxiappkotlin.ui.advertise.AdvertiseType import cn.trans88.taxiappkotlin.ui.advertise.AdvertiseType
import cn.trans88.taxiappkotlin.ui.play.PlayViewModel import cn.trans88.taxiappkotlin.ui.play.PlayViewModel
import cn.trans88.taxiappkotlin.ui.play.isAllowPlay import cn.trans88.taxiappkotlin.ui.play.isAllowPlay
import cn.trans88.taxiappkotlin.util.KuroTimer import cn.trans88.taxiappkotlin.util.*
import cn.trans88.taxiappkotlin.util.LastThread
import cn.trans88.taxiappkotlin.util.LastThreadListener
import cn.trans88.taxiappkotlin.util.SyncUtil.getSyncSingleTime import cn.trans88.taxiappkotlin.util.SyncUtil.getSyncSingleTime
import cn.trans88.taxiappkotlin.util.YoungUtil
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.trs88.kurolibrary.execute.KuroExecutor import com.trs88.kurolibrary.execute.KuroExecutor
@ -38,6 +35,8 @@ import kotlinx.coroutines.Dispatchers
import okhttp3.internal.closeQuietly import okhttp3.internal.closeQuietly
import org.greenrobot.greendao.query.LazyList import org.greenrobot.greendao.query.LazyList
import org.greenrobot.greendao.query.QueryBuilder import org.greenrobot.greendao.query.QueryBuilder
import java.lang.Exception
import java.lang.RuntimeException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.LinkedBlockingQueue
@ -76,7 +75,7 @@ object Repository {
fun getAdvertiseTEST(): Advertise? { fun getAdvertiseTEST(): Advertise? {
synchronized(TaxiApp::class.java){ synchronized(TaxiApp::class.java){
val list = myListMap[getTestPlayLevels()] val list = myListMap[getTestPlayLevels()]
"广告数量:${list?.size}".loge() "广告数量:${list?.size},currentListOrder:$currentListOrder".loge()
//#edit by ljh 2023/2/16 //#edit by ljh 2023/2/16
var advertise:Advertise? = null var advertise:Advertise? = null
val isTimedAdvertise = Configurations.config(taxiApp.activity).isTimedAdvertise val isTimedAdvertise = Configurations.config(taxiApp.activity).isTimedAdvertise
@ -90,7 +89,6 @@ object Repository {
} }
} }
fun getTestPlayCircularList(): MutableList<Advertise>? { fun getTestPlayCircularList(): MutableList<Advertise>? {
//#edit by ljh @2023/2/23 //#edit by ljh @2023/2/23
//如果正在播放的是多时段的定时广告,则返回定时广告的播放列表,否则返回不定时的播放列表 //如果正在播放的是多时段的定时广告,则返回定时广告的播放列表,否则返回不定时的播放列表
@ -283,16 +281,18 @@ object Repository {
taxiApp.timedAds taxiApp.timedAds
return AdvertiseType.GROUP.ordinal return AdvertiseType.GROUP.ordinal
} }
if (list!!.size > 0) { list?.let {
val level = when(index){ if (it.size > 0) {
AdvertiseType.AREA.ordinal -> "定点广告" val level = when(index){
AdvertiseType.IDLE.ordinal -> "闲置广告" AdvertiseType.AREA.ordinal -> "定点广告"
AdvertiseType.GROUP.ordinal -> "分组广告" AdvertiseType.IDLE.ordinal -> "闲置广告"
AdvertiseType.COUNT.ordinal -> "计数广告" AdvertiseType.GROUP.ordinal -> "分组广告"
else -> "其他广告" AdvertiseType.COUNT.ordinal -> "计数广告"
else -> "其他广告"
}
YoungUtil.YoungLog("当前播放广告的等级:$level,播放列表不为空")
return index
} }
YoungUtil.YoungLog("当前播放广告的等级:$level,播放列表不为空")
return index
} }
} }
YoungUtil.YoungLog("当前播放广告的等级:闲置广告") YoungUtil.YoungLog("当前播放广告的等级:闲置广告")
@ -305,7 +305,7 @@ object Repository {
*/ */
fun refreshMyList() { fun refreshMyList() {
synchronized(TaxiApp::class.java){ synchronized(TaxiApp::class.java){
var daoAdvertises:LazyList<Advertise>? = null var lazyList:LazyList<Advertise>? = null
try { try {
val currentTimeMillis = System.currentTimeMillis() val currentTimeMillis = System.currentTimeMillis()
YoungUtil.YoungLog("refreshMyList 是否在主线程: ${Thread.currentThread().isMainThread()}") YoungUtil.YoungLog("refreshMyList 是否在主线程: ${Thread.currentThread().isMainThread()}")
@ -335,17 +335,35 @@ object Repository {
DaoUtil.getOrderDao().deleteAll() DaoUtil.getOrderDao().deleteAll()
// val daoAdvertises = DaoUtil.getAdvertise().queryBuilder().orderDesc(AdvertiseDao.Properties.CreateAt).list() // val daoAdvertises = DaoUtil.getAdvertise().queryBuilder().orderDesc(AdvertiseDao.Properties.CreateAt).list()
//#edit by ljh @2023/8/7 使用缓存加懒加载防止内存溢出,需要手动关闭close //#edit by ljh @2023/8/7
daoAdvertises = DaoUtil.getAdvertise().queryBuilder().orderDesc(AdvertiseDao.Properties.CreateAt).listLazy() val daoAdvertises:List<Advertise> = if (taxiApp.daoAds.isNotEmpty()){
"从缓存获取广告列表.数量:${taxiApp.daoAds.size}".logd()
taxiApp.daoAds.sortByDescending {
it.createAt
}
taxiApp.daoAds
} else {
// val currentAds = DaoUtil.getAdvertise().queryBuilder().orderDesc(AdvertiseDao.Properties.CreateAt).list()
lazyList = DaoUtil.getAdvertise().queryBuilder().orderDesc(AdvertiseDao.Properties.CreateAt).listLazyUncached()
for (currentAd in lazyList) {
taxiApp.daoAds.add(currentAd)
}
lazyList
}
"存储的广告数量:${daoAdvertises.size}".loge() "存储的广告数量:${daoAdvertises.size}".loge()
//edit by ljh @2023/9/1
if (daoAdvertises.size == 0){
"卡里没广告了,清除排序".logd()
Configurations.config(TaxiApp.instance()).advertiseOrderSave("")
}
val advertises = mutableListOf<Advertise>() val advertises = mutableListOf<Advertise>()
//定点广告list //定点广告list
// val builder:QueryBuilder<Advertise> = DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.BelongTo.eq(AdvertiseType.AREA.ordinal)) //#edit by ljh @2023/8/11
// val query = builder.buildCursor().query() val areaCount = DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.BelongTo.eq(AdvertiseType.AREA.ordinal)).count()
// query.isClosed YoungUtil.YoungLog("定点广告数量:${areaCount}")
val area = DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.BelongTo.eq(AdvertiseType.AREA.ordinal)).list() val order = Configurations.config(TaxiApp.instance()).advertiseOrder()
YoungUtil.YoungLog("定点广告数量:${area.size}") "orderJson:$order".logd()
if (Configurations.config(TaxiApp.instance()).advertiseOrder() != "" && area.size == 0) { if (order != "" && areaCount == 0L) {
val orderList = Gson().fromJson<AdvertiseOrder>(Configurations.config(TaxiApp.instance()).advertiseOrder()).advertise_order val orderList = Gson().fromJson<AdvertiseOrder>(Configurations.config(TaxiApp.instance()).advertiseOrder()).advertise_order
YoungUtil.YoungLog("当前的播放顺序策略:${orderList.toString()}") YoungUtil.YoungLog("当前的播放顺序策略:${orderList.toString()}")
@ -363,12 +381,11 @@ object Repository {
advertises.addAll(daoAdvertises) advertises.addAll(daoAdvertises)
} }
} else { } else {
advertises.addAll(daoAdvertises) for (daoAdvertise in daoAdvertises) {
advertises.add(daoAdvertise)
}
// advertises.addAll(daoAdvertises)
advertises.reverse() advertises.reverse()
// daoAdvertises.reverse()
// daoAdvertises.forEach {
// advertises.add(it)
// }
} }
"advertises的广告数量${advertises.size}".loge() "advertises的广告数量${advertises.size}".loge()
for (index in 0 until advertises.size) { for (index in 0 until advertises.size) {
@ -406,6 +423,8 @@ object Repository {
val daoAdvertise = DaoUtil.getAdvertise() val daoAdvertise = DaoUtil.getAdvertise()
.queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(newAdvertise.ad_id.toString())).unique() .queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(newAdvertise.ad_id.toString())).unique()
daoAdvertise.isTimedAd = true daoAdvertise.isTimedAd = true
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
DaoUtil.getAdvertise().update(daoAdvertise) DaoUtil.getAdvertise().update(daoAdvertise)
schedules.forEach { schedules.forEach {
val list = kotlin.collections.ArrayList<Int>() val list = kotlin.collections.ArrayList<Int>()
@ -440,10 +459,13 @@ object Repository {
YoungUtil.YoungLog("广告不满足不加入播放列表:${newAdvertise.ad_id}") YoungUtil.YoungLog("广告不满足不加入播放列表:${newAdvertise.ad_id}")
} }
} }
} catch (e:Exception){
e.printStackTrace()
e.message?.loge()
refreshMyList()
} finally { } finally {
daoAdvertises?.let { lazyList?.let {
if (it.isClosed){ if (!it.isClosed){
"close daoAdvertises".logd()
it.close() it.close()
} }
} }
@ -567,26 +589,5 @@ object Repository {
lastThread!!.setSleep(0) lastThread!!.setSleep(0)
} }
// private fun getSyncTime(circularList: CircularList<Advertise>?): Date {
// if (circularList == null || circularList.size() == 0) return Date()
// var all = 0
// for (index in 0 until circularList.size()) {
// YoungUtil.YoungLog("getSyncTime index :$index")
// val advertise = circularList.getItem(index)
// all += advertise.duration.toInt()
// }
//
// return if (all > 0) {
// val curr = System.currentTimeMillis()
// val past = TimeUtil.pastSeconds(null, "00:00", curr)
// val delay = all - past % all
// YoungUtil.YoungLog("同步时间delay: $delay")
// val playDate = Date(curr + delay)
// playDate
// } else {
// Date()
// }
// }
} }

View File

@ -2,6 +2,7 @@ package cn.trans88.taxiappkotlin.logic.dao
import cn.trans88.taxiappkotlin.TaxiApp import cn.trans88.taxiappkotlin.TaxiApp
import cn.trans88.taxiappkotlin.ext.logd import cn.trans88.taxiappkotlin.ext.logd
import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.model.* import cn.trans88.taxiappkotlin.logic.model.*
import cn.trans88.taxiappkotlin.ui.advertise.AdvertiseType import cn.trans88.taxiappkotlin.ui.advertise.AdvertiseType
import java.io.File import java.io.File
@ -170,6 +171,10 @@ object DaoUtil {
*/ */
@Synchronized @Synchronized
fun deleteByPositionAdvertise(advertise: PositionAdvertise) { fun deleteByPositionAdvertise(advertise: PositionAdvertise) {
//edit by ljh @2023/8/11
taxiApp.daoAds.clear()
getPositionAdvertise().queryBuilder().where(PositionAdvertiseDao.Properties.Task_id.eq(advertise.task_id)).buildDelete().executeDeleteWithoutDetachingEntities() getPositionAdvertise().queryBuilder().where(PositionAdvertiseDao.Properties.Task_id.eq(advertise.task_id)).buildDelete().executeDeleteWithoutDetachingEntities()
getTimeSpan().queryBuilder().where(TimeSpanDao.Properties.AdvertiseId.eq(advertise.task_id)).buildDelete().executeDeleteWithoutDetachingEntities() getTimeSpan().queryBuilder().where(TimeSpanDao.Properties.AdvertiseId.eq(advertise.task_id)).buildDelete().executeDeleteWithoutDetachingEntities()
getRegion().queryBuilder().where(RegionsDao.Properties.RegionAdId.eq(advertise.task_id)).buildDelete().executeDeleteWithoutDetachingEntities() getRegion().queryBuilder().where(RegionsDao.Properties.RegionAdId.eq(advertise.task_id)).buildDelete().executeDeleteWithoutDetachingEntities()

View File

@ -27,7 +27,6 @@ public class Advertise implements Serializable {
private Double longitude=0.0; private Double longitude=0.0;
private Double latitude=0.0; private Double latitude=0.0;
private boolean isDownloaded=false; private boolean isDownloaded=false;
private boolean isDownloading=false; private boolean isDownloading=false;

View File

@ -1,5 +1,7 @@
package cn.trans88.taxiappkotlin.logic.model; package cn.trans88.taxiappkotlin.logic.model;
import com.google.gson.annotations.Expose;
import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated; import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Id;
@ -12,6 +14,8 @@ import java.io.Serializable;
@Entity @Entity
public class PlayLogger implements Serializable { public class PlayLogger implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Expose(serialize = false,deserialize = false)
@Id(autoincrement = true) @Id(autoincrement = true)
private Long autoId; private Long autoId;
private int ad_type; private int ad_type;

View File

@ -82,4 +82,18 @@ public class Regions {
public void setIsInRegion(boolean isInRegion) { public void setIsInRegion(boolean isInRegion) {
this.isInRegion = isInRegion; this.isInRegion = isInRegion;
} }
@Override
public String toString() {
return "Regions{" +
"autoId=" + autoId +
", id='" + id + '\'' +
", RegionAdId='" + RegionAdId + '\'' +
", lat=" + lat +
", lng=" + lng +
", price=" + price +
", radius=" + radius +
", isInRegion=" + isInRegion +
'}';
}
} }

View File

@ -55,7 +55,6 @@ object ConnManger {
var testToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY5ZmE0ZTI1NzIzMDkzZGM5MGMwYTA0IiwiZ3JvdXBfaWQiOiI2MmNmZGUzMzU3MjMwOTQ1NDM3MGFjNjIiLCJ1c2VyX2lkIjoiNjMyN2Q5NmI1NzIzMDkxYmJhZTM2MTkyIn0.6fQ1PsV3FM_C-I7yVd_7VpQIwLLMofF-8bKerpXmq_M" var testToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY5ZmE0ZTI1NzIzMDkzZGM5MGMwYTA0IiwiZ3JvdXBfaWQiOiI2MmNmZGUzMzU3MjMwOTQ1NDM3MGFjNjIiLCJ1c2VyX2lkIjoiNjMyN2Q5NmI1NzIzMDkxYmJhZTM2MTkyIn0.6fQ1PsV3FM_C-I7yVd_7VpQIwLLMofF-8bKerpXmq_M"
var defaultToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI0IiwiZ3JvdXBfaWQiOiI1Zjg5M2I4MTU3MjMwOTRhZDNmYzkxMjYiLCJ1c2VyX2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI1In0.o2M6CE2yFi7dvjILb485sQF436eMDdKwzTryK4rw3W0" var defaultToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI0IiwiZ3JvdXBfaWQiOiI1Zjg5M2I4MTU3MjMwOTRhZDNmYzkxMjYiLCJ1c2VyX2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI1In0.o2M6CE2yFi7dvjILb485sQF436eMDdKwzTryK4rw3W0"
@Volatile
var isRegisterSuccess = false var isRegisterSuccess = false
// val BaseUrl ="http://ledok.cn:2346/" // val BaseUrl ="http://ledok.cn:2346/"
@ -188,7 +187,8 @@ object ConnManger {
sendLogger() sendLogger()
sendLocation() sendLocation()
//edit by ljh @2023/9/1
WsManager.isRegister = false
WsManager.initWebSocket() WsManager.initWebSocket()
// Settings.toJson() // Settings.toJson()
} }
@ -406,20 +406,22 @@ object ConnManger {
call.enqueue(object : Callback { call.enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) { override fun onFailure(call: Call, e: IOException) {
YoungUtil.YoungLog("上传坐标失败:${e.message}") YoungUtil.YoungLog("上传坐标失败:${e.message}")
DaoUtil.getLocationDao().deleteAll() // DaoUtil.getLocationDao().deleteAll()
} }
override fun onResponse(call: Call, response: Response) { override fun onResponse(call: Call, response: Response) {
YoungUtil.YoungLog("上传坐标成功:${response.message},response is Sussceful ${response.isSuccessful}${response.code}") YoungUtil.YoungLog("上传坐标成功:${response.message},response is Sussceful ${response.isSuccessful}${response.code}")
if (response.code == 200) { if (response.code == 200) {
if (locations.size < 20) { for (location in locations) {
DaoUtil.getLocationDao().deleteAll() DaoUtil.getLocationDao().delete(location)
} else {
for (index in 0..19) {
DaoUtil.getLocationDao().delete(locations[index])
}
} }
// if (locations.size < 20) {
// DaoUtil.getLocationDao().deleteAll()
// } else {
// for (index in 0..19) {
// DaoUtil.getLocationDao().delete(locations[index])
// }
// }
} }
} }
@ -541,6 +543,9 @@ object ConnManger {
if (advertise.play_numbers < realCount!!){ if (advertise.play_numbers < realCount!!){
if (advertise.play_numbers != -1 ){ if (advertise.play_numbers != -1 ){
advertise.play_numbers = -1 advertise.play_numbers = -1
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
DaoUtil.updatePlayNumbers(advertise) DaoUtil.updatePlayNumbers(advertise)
} }
@ -579,6 +584,7 @@ object ConnManger {
//#edit by ljh @2023/6/5 改成大批量看是否能减小流量消耗 //#edit by ljh @2023/6/5 改成大批量看是否能减小流量消耗
ProcessingCommands.gson.toJson(playLoggers) ProcessingCommands.gson.toJson(playLoggers)
} }
"requestJson:$requestJson".loge()
val okHttpClient = OkHttpClient() val okHttpClient = OkHttpClient()
YoungUtil.YoungLog("准备上传日志") YoungUtil.YoungLog("准备上传日志")
@ -820,6 +826,8 @@ object ConnManger {
//Settings.advertiseOrder = "" //Settings.advertiseOrder = ""
Configurations.config(TaxiApp.instance()).taxiInfoSave("") Configurations.config(TaxiApp.instance()).taxiInfoSave("")
Configurations.config(TaxiApp.instance()).advertiseOrderSave(""); Configurations.config(TaxiApp.instance()).advertiseOrderSave("");
//edit by ljh @2023/8/22
// taxiApp.saveLog("账号重置resetAccountCleanDao clear play order.")
// DaoUtil.getAdvertise().deleteAll() // DaoUtil.getAdvertise().deleteAll()
DaoUtil.deleteAllAdvertise() DaoUtil.deleteAllAdvertise()
DaoUtil.getSanleAdvertise().deleteAll() DaoUtil.getSanleAdvertise().deleteAll()
@ -829,6 +837,9 @@ object ConnManger {
DaoUtil.getPlayLoggerDao().deleteAll() DaoUtil.getPlayLoggerDao().deleteAll()
DaoUtil.getRegion().deleteAll() DaoUtil.getRegion().deleteAll()
DaoUtil.getTimeSpan().deleteAll() DaoUtil.getTimeSpan().deleteAll()
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
taxiApp.regionsList.clear()
RefreshPlayer.refresh() RefreshPlayer.refresh()
} }
@ -840,6 +851,8 @@ object ConnManger {
} }
fun reconnect(code:Int,msg:String) { fun reconnect(code:Int,msg:String) {
WsManager.isConnected = false
WsManager.isReceivePong = false
WsManager.stopConnect(code,msg) WsManager.stopConnect(code,msg)
isRegisterSuccess = false isRegisterSuccess = false
//Settings.isFirstRegister = true //Settings.isFirstRegister = true

View File

@ -215,6 +215,10 @@ public class JoeyDownloadManager {
YoungUtil.YoungLog("从mxkl_url下载的视频广告,该广告时长为:"+videoDuration+"毫秒"); YoungUtil.YoungLog("从mxkl_url下载的视频广告,该广告时长为:"+videoDuration+"毫秒");
advertise.setDuration(String.valueOf(videoDuration)); advertise.setDuration(String.valueOf(videoDuration));
} }
//edit by ljh @2023/8/14
TaxiApp taxiApp = (TaxiApp) TaxiApp.Companion.instance();
taxiApp.getDaoAds().clear();
DaoUtil.INSTANCE.getAdvertise().update(advertise); DaoUtil.INSTANCE.getAdvertise().update(advertise);
} }
@ -339,6 +343,10 @@ public class JoeyDownloadManager {
if (advertise!=null){ if (advertise!=null){
advertise.setIsDownloading(true); advertise.setIsDownloading(true);
advertise.setIsDownloaded(false); advertise.setIsDownloaded(false);
//edit by ljh @2023/8/14
TaxiApp taxiApp = (TaxiApp) TaxiApp.Companion.instance();
taxiApp.getDaoAds().clear();
DaoUtil.INSTANCE.getAdvertise().update(advertise); DaoUtil.INSTANCE.getAdvertise().update(advertise);
} }
} }

View File

@ -26,13 +26,16 @@ import com.trs88.kurolibrary.execute.KuroExecutor
import com.trs88.kurolibrary.file.KuroFileUtil import com.trs88.kurolibrary.file.KuroFileUtil
import java.io.* import java.io.*
import java.util.* import java.util.*
import kotlin.collections.ArrayList
object ProcessingCommands { object ProcessingCommands {
val gson = Gson() val gson = Gson()
var beatTimer:Timer? = null var beatTimer:Timer? = null
var areaIndex = 0; var areaIndex = 0
/** /**
* 三乐平台的命令 * 三乐平台的命令
@ -43,6 +46,7 @@ object ProcessingCommands {
val baseTask = gson.fromJson(command, BaseTask::class.java) val baseTask = gson.fromJson(command, BaseTask::class.java)
YoungUtil.YoungLog("baskTask :${baseTask.toString()}") YoungUtil.YoungLog("baskTask :${baseTask.toString()}")
if (baseTask.type != null) { if (baseTask.type != null) {
val task = baseTask.task.toString() val task = baseTask.task.toString()
when (baseTask.type) { when (baseTask.type) {
@ -179,22 +183,26 @@ object ProcessingCommands {
// reconnect(1004,"长时间未收到心跳断开连接") // reconnect(1004,"长时间未收到心跳断开连接")
WsManager.isReceivePong = true
WsManager.isConnected = true
if(beatTimer!=null){ if(beatTimer!=null){
YoungUtil.YoungLog("received heart response,收到新的心跳应答,取消之前定时") YoungUtil.YoungLog("received heart response,收到新的心跳应答,取消之前定时")
beatTimer!!.cancel() beatTimer!!.cancel()
beatTimer!!.purge() beatTimer!!.purge()
beatTimer =null beatTimer = null
} }
beatTimer =Timer() beatTimer = Timer()
beatTimer!!.schedule(object :TimerTask(){ beatTimer!!.schedule(object :TimerTask(){
override fun run() { override fun run() {
YoungUtil.YoungLog("长时间没新的心跳应答,断开连接重试重新连接") YoungUtil.YoungLog("长时间没新的心跳应答,断开连接重新连接")
WsManager.isRegister = true
//验证conn的信息 //验证conn的信息
ConnManger.isBindOrTransfer = false ConnManger.isBindOrTransfer = false
reconnect(1004, "长时间未收到心跳断开连接") reconnect(1000, "长时间未收到心跳断开连接并重新注册")
} }
},4*60*1000) },36*1000) //#edit by ljh @2023/8/18 改成36s后没收到心跳回复重新注册
// },4*60*1000)
} }
/** /**
@ -206,7 +214,7 @@ object ProcessingCommands {
var ao = Configurations.config(TaxiApp.instance()).advertiseOrder() var ao = Configurations.config(TaxiApp.instance()).advertiseOrder()
if(ao.isNotEmpty()){ if(ao.isNotEmpty()){
val advertiseOrder = Gson().fromJson<AdvertiseOrder>(ao) val advertiseOrder = Gson().fromJson<AdvertiseOrder>(ao)
orderList= advertiseOrder.advertise_order orderList = advertiseOrder.advertise_order
} }
val orderModel = OrderModel() val orderModel = OrderModel()
@ -219,6 +227,7 @@ object ProcessingCommands {
send(response) send(response)
} }
/** /**
*发送所有广告信息 *发送所有广告信息
*/ */
@ -233,10 +242,15 @@ object ProcessingCommands {
} }
val allAdIds = mutableListOf<String>() val allAdIds = mutableListOf<String>()
if (positionAdvertises.size > 0){ if (positionAdvertises.size > 0){
var isOverdue = true
for (positionAdvertise in positionAdvertises) { for (positionAdvertise in positionAdvertises) {
positionAdvertise.isOverdue() isOverdue = positionAdvertise.isOverdue()
}
val positionAds = if (!isOverdue){
positionAdvertises
} else {
DaoUtil.getPositionAdvertise().loadAll()
} }
val positionAds = DaoUtil.getPositionAdvertise().loadAll()
positionAds.forEach { positionAds.forEach {
allAdIds.add(it.task_id) allAdIds.add(it.task_id)
} }
@ -246,7 +260,6 @@ object ProcessingCommands {
allAdIds.add(it.task_id) allAdIds.add(it.task_id)
} }
val playList = Repository.getTestPlayCircularList() val playList = Repository.getTestPlayCircularList()
// val advertises = DaoUtil.getAdvertises() // val advertises = DaoUtil.getAdvertises()
var currentPlayList = playList?.map { var currentPlayList = playList?.map {
@ -272,6 +285,8 @@ object ProcessingCommands {
* 设置广告排序 * 设置广告排序
*/ */
private fun setAdvertiseOrder(task: String, type: String?) { private fun setAdvertiseOrder(task: String, type: String?) {
//edit by ljh @2023/8/22
// taxiApp.saveLog("设置广告排序 task :${task}")
val advertiseOrder = gson.fromJson<AdvertiseOrder>(task) val advertiseOrder = gson.fromJson<AdvertiseOrder>(task)
//Settings.advertiseOrder = task //Settings.advertiseOrder = task
@ -290,7 +305,32 @@ object ProcessingCommands {
val advertiseOrder = gson.fromJson<AdvertiseOrder>(task) val advertiseOrder = gson.fromJson<AdvertiseOrder>(task)
//Settings.advertiseOrder = "" //Settings.advertiseOrder = ""
Configurations.config(TaxiApp.instance()).advertiseOrderSave("") //edit by ljh @2023/8/9/1
//三分钟内收到两次清除排序才会清除排序,防止排序被清除
taxiApp.isDoubleClearOrder += 1
if(taxiApp.isDoubleClearOrder < 2){
"没有点击两次清空排序,开始计时三分钟".logd()
taxiApp.clearOrderTimer.schedule(object :TimerTask(){
override fun run() {
try {
taxiApp.isDoubleClearOrder = 0
"三分钟时间到isDoubleClearOrder重置".logd()
} catch (e:java.lang.Exception){
e.printStackTrace()
}
}
},3*60*1000L)
} else {
"点击了两次清空排序,取消三分钟计时并清空排序".logd()
taxiApp.clearOrderTimer.cancel()
taxiApp.clearOrderTimer.purge()
taxiApp.clearOrderTimer = Timer()
Configurations.config(TaxiApp.instance()).advertiseOrderSave("")
taxiApp.isDoubleClearOrder = 0
}
//edit by ljh @2023/8/22
// taxiApp.saveLog("clearAdvertiseOrder清除了广告排序")
RefreshPlayer.refresh() RefreshPlayer.refresh()
@ -520,6 +560,8 @@ object ProcessingCommands {
deleteTimeSpan(advertise.task_id) deleteTimeSpan(advertise.task_id)
DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(deletePositionAdvertiseBean.task_id)).buildDelete() DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(deletePositionAdvertiseBean.task_id)).buildDelete()
.executeDeleteWithoutDetachingEntities() .executeDeleteWithoutDetachingEntities()
//edit by ljh @2023/8/16
taxiApp.daoAds.clear()
RefreshPlayer.refresh() RefreshPlayer.refresh()
break break
} }
@ -538,6 +580,8 @@ object ProcessingCommands {
* 删除定点广告区域 * 删除定点广告区域
*/ */
private fun deleteRegions(region_ad_id: String) { private fun deleteRegions(region_ad_id: String) {
//edit by ljh @2023/8/15
taxiApp.regionsList.clear()
DaoUtil.getRegion().queryBuilder().where(RegionsDao.Properties.RegionAdId.eq(region_ad_id)).buildDelete().executeDeleteWithoutDetachingEntities() DaoUtil.getRegion().queryBuilder().where(RegionsDao.Properties.RegionAdId.eq(region_ad_id)).buildDelete().executeDeleteWithoutDetachingEntities()
} }
@ -545,10 +589,11 @@ object ProcessingCommands {
* 添加定点广告 * 添加定点广告
*/ */
private fun addPositionAdvertise(task: String, type: String) { private fun addPositionAdvertise(task: String, type: String) {
//edit by ljh @2023/8/22
// taxiApp.saveLog("添加定点广告 task :${task}")
val positionAdvertise = gson.fromJson<PositionAdvertise>(task, PositionAdvertise::class.java) val positionAdvertise = gson.fromJson<PositionAdvertise>(task, PositionAdvertise::class.java)
val advertises = DaoUtil.getPositionAdvertises() val advertises = DaoUtil.getPositionAdvertises()
for(r in positionAdvertise.regions){ for(r in positionAdvertise.regions){
LogUtil.i("name:" + r.id + ", lng:" + r.lng + ", lat:" + r.lat); LogUtil.i("name:" + r.id + ", lng:" + r.lng + ", lat:" + r.lat);
} }
@ -592,6 +637,8 @@ object ProcessingCommands {
region.regionAdId = positionAdvertise.task_id region.regionAdId = positionAdvertise.task_id
DaoUtil.getRegion().insert(region) DaoUtil.getRegion().insert(region)
} }
//edit by ljh @2023/8/14
taxiApp.regionsList.clear()
} }
val sanleResponse = SanleResponse() val sanleResponse = SanleResponse()
@ -724,6 +771,9 @@ object ProcessingCommands {
if (insert) { if (insert) {
"insert advertise:$advertise".loge() "insert advertise:$advertise".loge()
DaoUtil.getAdvertise().insert(advertise) DaoUtil.getAdvertise().insert(advertise)
//edit by ljh @2023/8/16
taxiApp.daoAds.clear()
advertise.time_Span.forEach { advertise.time_Span.forEach {
it.advertiseId = advertise.ad_id it.advertiseId = advertise.ad_id
DaoUtil.getTimeSpan().insert(it) DaoUtil.getTimeSpan().insert(it)
@ -763,6 +813,8 @@ object ProcessingCommands {
* 添加三乐广告 * 添加三乐广告
*/ */
private fun addSanleAdvertise(task: String, type: String) { private fun addSanleAdvertise(task: String, type: String) {
//edit by ljh @2023/8/22
// taxiApp.saveLog("添加三乐广告 task :${task}")
val sanleAdvertises = DaoUtil.getSanleAdvertises() val sanleAdvertises = DaoUtil.getSanleAdvertises()
val sanleAdvertise = gson.fromJson<SanleAdvertise>(task, SanleAdvertise::class.java) val sanleAdvertise = gson.fromJson<SanleAdvertise>(task, SanleAdvertise::class.java)
@ -862,8 +914,13 @@ object ProcessingCommands {
*/ */
private fun deleteSanleAdvertise(task: String, type: String) { private fun deleteSanleAdvertise(task: String, type: String) {
YoungUtil.YoungLog("准备下架三乐广告") YoungUtil.YoungLog("准备下架三乐广告")
//edit by ljh @2023/8/22
// taxiApp.saveLog("准备下架三乐广告 task :${task}")
val deleteBean = gson.fromJson<DeleteSanleAdvertiseBean>(task, DeleteSanleAdvertiseBean::class.java) val deleteBean = gson.fromJson<DeleteSanleAdvertiseBean>(task, DeleteSanleAdvertiseBean::class.java)
//edit by ljh @2023/8/11
taxiApp.daoAds.clear()
//删除在播放的广告 //删除在播放的广告
DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(deleteBean.task_id)).buildDelete().executeDeleteWithoutDetachingEntities() DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(deleteBean.task_id)).buildDelete().executeDeleteWithoutDetachingEntities()
@ -1100,6 +1157,10 @@ object ProcessingCommands {
advertise.media_type = newAdvertiseWeb.media_type advertise.media_type = newAdvertiseWeb.media_type
advertise.is_exclusive = newAdvertiseWeb.is_exclusive advertise.is_exclusive = newAdvertiseWeb.is_exclusive
DaoUtil.getAdvertise().insertOrReplace(advertise) DaoUtil.getAdvertise().insertOrReplace(advertise)
//#edit by ljh @2023/8/11
taxiApp.daoAds.clear()
// DaoUtil.getAdvertise().delete(oldAdvertiseWeb) // DaoUtil.getAdvertise().delete(oldAdvertiseWeb)
// DaoUtil.getAdvertise().insert(newAdvertiseWeb) // DaoUtil.getAdvertise().insert(newAdvertiseWeb)
YoungUtil.YoungLog("restructure修改素材成功") YoungUtil.YoungLog("restructure修改素材成功")
@ -1140,11 +1201,9 @@ object ProcessingCommands {
// DaoUtil.getPositionAdvertise().delete(oldAdvertiseWeb) // DaoUtil.getPositionAdvertise().delete(oldAdvertiseWeb)
// DaoUtil.getPositionAdvertise().insert(newAdvertiseWeb) // DaoUtil.getPositionAdvertise().insert(newAdvertiseWeb)
val regions = newAdvertiseWeb.regions //edit by ljh @2023/8/14
for (region in regions) { taxiApp.regionsList.clear()
region.regionAdId = newAdvertiseWeb.task_id
DaoUtil.getRegion().insertOrReplace(region)
}
YoungUtil.YoungLog("restructure修改素材成功") YoungUtil.YoungLog("restructure修改素材成功")
} else { } else {
YoungUtil.YoungLog("restructure未找到更改素材") YoungUtil.YoungLog("restructure未找到更改素材")

View File

@ -1,5 +1,8 @@
package cn.trans88.taxiappkotlin.logic.network package cn.trans88.taxiappkotlin.logic.network
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.util.Log import android.util.Log
import cn.trans88.taxiappkotlin.Configurations import cn.trans88.taxiappkotlin.Configurations
import cn.trans88.taxiappkotlin.TaxiApp import cn.trans88.taxiappkotlin.TaxiApp
@ -7,6 +10,9 @@ import cn.trans88.taxiappkotlin.TaxiApp.Companion.HAOSHENG
import cn.trans88.taxiappkotlin.TaxiApp.Companion.MAIDIER import cn.trans88.taxiappkotlin.TaxiApp.Companion.MAIDIER
import cn.trans88.taxiappkotlin.TaxiApp.Companion.SANLE import cn.trans88.taxiappkotlin.TaxiApp.Companion.SANLE
import cn.trans88.taxiappkotlin.TaxiApp.Companion.XIXUN import cn.trans88.taxiappkotlin.TaxiApp.Companion.XIXUN
import cn.trans88.taxiappkotlin.ext.logd
import cn.trans88.taxiappkotlin.ext.loge
import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil import cn.trans88.taxiappkotlin.logic.dao.DaoUtil
import cn.trans88.taxiappkotlin.logic.model.CurrentPlayAdvertises import cn.trans88.taxiappkotlin.logic.model.CurrentPlayAdvertises
import cn.trans88.taxiappkotlin.util.KuroTimer import cn.trans88.taxiappkotlin.util.KuroTimer
@ -17,14 +23,18 @@ import com.google.gson.Gson
import okhttp3.* import okhttp3.*
import okhttp3.OkHttpClient.Builder import okhttp3.OkHttpClient.Builder
import okio.ByteString import okio.ByteString
import java.util.*
import java.util.concurrent.TimeUnit
object WsManager { object WsManager {
private const val TAG = "WsManager" private const val TAG = "WsManager"
private var okHttpClient: OkHttpClient? = null private var okHttpClient: OkHttpClient? = null
private var mRequest: Request? = null private var mRequest: Request? = null
private const val reconnectTime: Long = 10 * 1000 private const val reconnectTime: Long = 3 * 1000
// private const val reconnectTime: Long = 10 * 1000
// private const val reconnectTime: Long = 30 * 1000 // private const val reconnectTime: Long = 30 * 1000
// private const val heartbeatTime: Long = 120 * 1000 // private const val heartbeatTime: Long = 120 * 1000
private const val heartbeatTime: Long = 30 * 1000 private const val heartbeatTime: Long = 30 * 1000
@ -32,21 +42,56 @@ object WsManager {
private val heartbeatContext: String = "beat" private val heartbeatContext: String = "beat"
private var beatTimer:KuroTimer?=null private var beatTimer:KuroTimer?=null
private var wsTimer:KuroTimer?=null
private var tryReconnectTimer:KuroTimer?=null private var tryReconnectTimer:KuroTimer?=null
private var sendCurrentAdvertiseTimer:KuroTimer?=null private var sendCurrentAdvertiseTimer:KuroTimer?=null
var isReceivePong = false
var isRegister = false
@Volatile @Volatile
var mWebSocket: WebSocket? = null var mWebSocket: WebSocket? = null
@Volatile
var isConnected = false
private val reconnectRunnable = Runnable { private val reconnectRunnable = Runnable {
YoungUtil.YoungLog("Reconnecting with server......") YoungUtil.YoungLog("Reconnecting with server......")
initWebSocket() initWebSocket()
} }
//edit by ljh @2023/8/16
val heartHandler = object :Handler(Looper.getMainLooper()){
override fun handleMessage(msg: Message) {
if (msg.what != 10) return
"收到了handler msg,what = ${msg.what}".logd()
if (isReceivePong){
val cardId =if (TaxiApp.isTest){
TaxiApp.testCardid
} else {
Xixun.getCardId()
}
send(heartbeatContext)
YoungUtil.YoungLog("发送心跳消息send heartbeat: $heartbeatContext , $cardId")
isReceivePong = false
this.sendEmptyMessageDelayed(10, heartbeatTime)
} else {
this.removeMessages(10)
"没收到心跳回复主动断线重连".logd()
ProcessingCommands.beatTimer?.cancel()
ProcessingCommands.beatTimer?.purge()
// ProcessingCommands.beatTimer = null
tryReconnect()
}
}
}
fun initWebSocket() { fun initWebSocket() {
val testToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY5ZmE0ZTI1NzIzMDkzZGM5MGMwYTA0IiwiZGV2aWNlX2lkIjoieTZjLTMyMi00MDc5NiJ9.j8N1hRwYRq0bKScNe-xB8utsPUAuWEGUJMwCfLcv6D8" val testToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY5ZmE0ZTI1NzIzMDkzZGM5MGMwYTA0IiwiZGV2aWNlX2lkIjoieTZjLTMyMi00MDc5NiJ9.j8N1hRwYRq0bKScNe-xB8utsPUAuWEGUJMwCfLcv6D8"
// stopConnect() // stopConnect()
okHttpClient = Builder() okHttpClient = Builder()
.retryOnConnectionFailure(true) //如果没配置okhttp默认就是true .retryOnConnectionFailure(true) //如果没配置okhttp默认就是true
.build() .build()
@ -54,28 +99,116 @@ object WsManager {
YoungUtil.YoungLog("长连接进行连接的token:${Configurations.config(TaxiApp.instance()).appToken()}") YoungUtil.YoungLog("长连接进行连接的token:${Configurations.config(TaxiApp.instance()).appToken()}")
mRequest = Request.Builder() mRequest = Request.Builder()
.url("${Configurations.config(TaxiApp.instance()).taxiServiceUrl()}?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}") .url("${Configurations.config(TaxiApp.instance()).taxiServiceUrl()}?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}")
// .url("http://192.168.1.127:2347/?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}") // .url("http://192.168.1.141:2347/?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}")
// .url("http://1vf5fnic.beesnat.com/?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}") // .url("http://1vf5fnic.beesnat.com/?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}")
// .url("http://192.168.43.191:2347/?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}") // .url("http://192.168.43.191:2347/?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}")
.build() .build()
okHttpClient!!.newWebSocket(mRequest!!, object : WebSocketListener() { startConnect()
override fun onClosed(webSocket: WebSocket, code: Int, reason: String) {
YoungUtil.YoungLog("onClosed connection closed : $reason")
super.onClosed(webSocket, code, reason)
if (beatTimer != null){ // okHttpClient!!.newWebSocket(mRequest!!, object : WebSocketListener() {
beatTimer!!.cancel() //
beatTimer!!.purge() // override fun onClosed(webSocket: WebSocket, code: Int, reason: String) {
beatTimer = null // YoungUtil.YoungLog("连接关闭,关闭原因 onClosed connection closed : $reasoncode: $code")
} // super.onClosed(webSocket, code, reason)
stopAllTimer() //
//// beatTimer?.let {
//// it.cancel()
//// it.purge()
//// }
//
//// stopAllTimer()
// }
//
// override fun onClosing(webSocket: WebSocket, code: Int, reason: String) {
// //是当远程端暗示没有数据交互时回调(即此时准备关闭,但连接还没有关闭)
// YoungUtil.YoungLog("onClosing connection closing :$reason")
// super.onClosing(webSocket, code, reason)
// }
//
// override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
// val sb = StringBuffer()
// sb.append("异常类: ${t.javaClass}\n")
// sb.append("异常信息: ${t.message}\n\n")
// for (i in t.stackTrace.indices) {
// sb.append("****堆栈追踪 ${i + 1}\n")
// sb.append("类名: ${t.stackTrace[i].className}\n")
// sb.append("方法: ${t.stackTrace[i].methodName}\n")
// sb.append("文件: ${t.stackTrace[i].fileName}\n")
// sb.append("行数: ${t.stackTrace[i].lineNumber}\n\n")
// }
//
// YoungUtil.YoungLog("onFailure connection failed :" + sb.toString().trim())
//
//
// if (response != null) {
// YoungUtil.YoungLog("onFailure response message :" + response.message)
// }
//
//// wsMainHandler.removeCallbacks(heartbeat)
// Repository.taxiApp.wsHandler.postDelayed({
// tryReconnect()
// },6000)
// }
//
// override fun onMessage(webSocket: WebSocket, text: String) {
// YoungUtil.YoungLog("onMessage message received: $text")
// super.onMessage(webSocket, text)
// //当前只走三乐
// when (Configurations.config(TaxiApp.instance()).company()) {
// XIXUN -> ProcessingCommands.executeByXixun(text)
// SANLE -> ProcessingCommands.executeBySanle(text)
// HAOSHENG -> ProcessingCommands.executeBySanle(text)
// MAIDIER -> ProcessingCommands.executeBySanle(text)
// else -> YoungUtil.YoungLog("未知公司的命令")
// }
// }
//
// override fun onMessage(webSocket: WebSocket, bytes: ByteString) {
// super.onMessage(webSocket, bytes)
// }
//
// override fun onOpen(webSocket: WebSocket, response: Response) {
// super.onOpen(webSocket, response)
// YoungUtil.YoungLog("onOpen: connecting is open Ws连接成功!")
// mWebSocket = webSocket
//// reconnectHandler?.removeCallbacks(reconnectRunnable)
//// sendBeatData()
// //edit by ljh @2023/8/16
// isReceivePong = true
// heartHandler.removeMessages(10)
// heartHandler.sendEmptyMessage(10)
//
//// sendCurrentAdvertise()
//
//// send("服务器日志 ${Xixun.getCardId()} 注册成功")
// }
// })
// okHttpClient!!.dispatcher.executorService.shutdown()
}
private fun startConnect(){
mRequest?.let {
okHttpClient?.newWebSocket(it, getWebSocketListener())
}
}
private fun getWebSocketListener():WebSocketListener{
return object : WebSocketListener() {
override fun onClosed(webSocket: WebSocket, code: Int, reason: String) {
YoungUtil.YoungLog("连接关闭,关闭原因 onClosed connection closed : $reasoncode: $code")
super.onClosed(webSocket, code, reason)
mWebSocket = null
} }
override fun onClosing(webSocket: WebSocket, code: Int, reason: String) { override fun onClosing(webSocket: WebSocket, code: Int, reason: String) {
//是当远程端暗示没有数据交互时回调(即此时准备关闭,但连接还没有关闭) //是当远程端暗示没有数据交互时回调(即此时准备关闭,但连接还没有关闭)
YoungUtil.YoungLog("onClosing connection closing :$reason") YoungUtil.YoungLog("onClosing connection closing :$reason")
super.onClosing(webSocket, code, reason) super.onClosing(webSocket, code, reason)
} }
override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) { override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
@ -96,9 +229,9 @@ object WsManager {
if (response != null) { if (response != null) {
YoungUtil.YoungLog("onFailure response message :" + response.message) YoungUtil.YoungLog("onFailure response message :" + response.message)
} }
if (!isConnected && !isRegister) {
// wsMainHandler.removeCallbacks(heartbeat) tryReconnect()
tryReconnect() }
} }
override fun onMessage(webSocket: WebSocket, text: String) { override fun onMessage(webSocket: WebSocket, text: String) {
@ -120,90 +253,111 @@ object WsManager {
override fun onOpen(webSocket: WebSocket, response: Response) { override fun onOpen(webSocket: WebSocket, response: Response) {
super.onOpen(webSocket, response) super.onOpen(webSocket, response)
YoungUtil.YoungLog("onOpen: connecting is open") YoungUtil.YoungLog("onOpen: connecting is open Ws连接成功!")
mWebSocket = webSocket mWebSocket = webSocket
// reconnectHandler?.removeCallbacks(reconnectRunnable)
sendBeatData()
sendCurrentAdvertise() //edit by ljh @2023/8/16
isRegister = false
isReceivePong = true
isConnected = true
heartHandler.removeMessages(10)
heartHandler.sendEmptyMessage(10)
// send("服务器日志 ${Xixun.getCardId()} 注册成功")
} }
}) }
okHttpClient!!.dispatcher.executorService.shutdown()
} }
private fun stopAllTimer(){ private fun stopAllTimer(){
//停止重连 //停止重连
if (tryReconnectTimer!=null){ // tryReconnectTimer?.let {
tryReconnectTimer!!.cancel() // it.cancel()
tryReconnectTimer!!.purge() // it.purge()
tryReconnectTimer =null // }
}
//停止发送心跳 //停止发送心跳
if (beatTimer!=null){ // beatTimer?.let {
beatTimer!!.cancel() // it.cancel()
beatTimer!!.purge() // it.purge()
beatTimer =null // }
}
//停止发送广告信息 //停止发送广告信息
if (sendCurrentAdvertiseTimer!=null){ sendCurrentAdvertiseTimer?.let {
sendCurrentAdvertiseTimer!!.cancel() it.cancel()
sendCurrentAdvertiseTimer!!.purge() it.purge()
sendCurrentAdvertiseTimer =null
} }
} }
/** /**
* 重连 * 重连
*/ */
private fun tryReconnect() { private fun tryReconnect() {
YoungUtil.YoungLog("tryReconnect: ")
stopAllTimer() isRegister = false
YoungUtil.YoungLog("tryReconnect: mWebSocket是否为空${mWebSocket == null}")
wsTimer?.let {
it.cancel()
it.purge()
}
wsTimer = null
// stopAllTimer()
isConnected = false
//#edit by ljh @2023/7/12 //#edit by ljh @2023/7/12
//检测之前连接是否存在,存在则主动断开掉 //检测之前连接是否存在,存在则主动断开掉
try { try {
if (mWebSocket != null) { if (mWebSocket != null) {
YoungUtil.YoungLog("closing bad connection: 连接异常,关闭此连接重连")
// mWebSocket!!.cancel() // mWebSocket!!.cancel()
val close = mWebSocket!!.close(1006, "连接异常,关闭此连接重连") mWebSocket?.cancel()
val close = mWebSocket!!.close(1000, "连接异常再次关闭关闭此连接10s后重连")
YoungUtil.YoungLog("webSocket是否正常关闭$close") YoungUtil.YoungLog("webSocket是否正常关闭$close")
if (!close){
mWebSocket = null
}
} }
wsTimer = KuroTimer()
wsTimer?.schedule(object :KuroTimerTask(){
override fun run() {
"wsTimer执行".logd()
startConnect()
}
},5000)
} catch (e: Throwable) { } catch (e: Throwable) {
YoungUtil.YoungLog("断开连接异常:${e.message}") e.printStackTrace()
YoungUtil.YoungLog("重连异常:${e.message}")
} }
tryReconnectTimer = KuroTimer()
// val timer = KuroTimer() // initWebSocket()
tryReconnectTimer!!.schedule(object : KuroTimerTask() {
override fun run() {
YoungUtil.YoungLog("Reconnecting with server......")
initWebSocket()
}
},reconnectTime) // tryReconnectTimer = KuroTimer()
//
// tryReconnectTimer!!.schedule(object : KuroTimerTask() {
// override fun run() {
// YoungUtil.YoungLog("Reconnecting with server......")
// initWebSocket()
// }
// },reconnectTime)
} }
fun send(msg: String) { fun send(msg: String) {
YoungUtil.YoungLog("回复服务器 $msg") YoungUtil.YoungLog("回复服务器 $msg")
mWebSocket?.send(msg) ?: throw IllegalArgumentException("mWebSocket is null not send!") mWebSocket?.send(msg)
// mWebSocket?.send(msg) ?: throw IllegalArgumentException("mWebSocket is null not send!")
} }
fun stopConnect(code:Int,msg:String) { fun stopConnect(code:Int,msg:String) {
stopAllTimer() // stopAllTimer()
wsTimer?.let {
it.cancel()
it.purge()
}
wsTimer = null
try { try {
if (mWebSocket != null) { if (mWebSocket != null) {
YoungUtil.YoungLog("stopConnect: $msg") YoungUtil.YoungLog("stopConnect: $msg")
// mWebSocket!!.cancel() // mWebSocket!!.cancel()
mWebSocket?.cancel()
val close = mWebSocket!!.close(code, msg) val close = mWebSocket!!.close(code, msg)
YoungUtil.YoungLog("webSocket是否正常关闭$close") YoungUtil.YoungLog("webSocket是否正常关闭$close")
} }
@ -219,18 +373,23 @@ object WsManager {
val cardId =if (TaxiApp.isTest){ val cardId =if (TaxiApp.isTest){
TaxiApp.testCardid TaxiApp.testCardid
}else{ } else {
Xixun.getCardId() Xixun.getCardId()
} }
YoungUtil.YoungLog("heartbeat: $heartbeatContext , $cardId") YoungUtil.YoungLog("send heartbeat: $heartbeatContext , $cardId")
if (beatTimer!=null){ beatTimer?.let {
beatTimer!!.cancel() it.cancel()
beatTimer!!.purge() it.purge()
beatTimer =null
} }
// if (beatTimer!=null){
// beatTimer!!.cancel()
// beatTimer!!.purge()
// beatTimer =null
// }
beatTimer = KuroTimer() beatTimer = KuroTimer()
// val timer = KuroTimer() // val timer = KuroTimer()
@ -262,11 +421,15 @@ object WsManager {
YoungUtil.YoungLog("当前在播放的广告: $currentAdvertises") YoungUtil.YoungLog("当前在播放的广告: $currentAdvertises")
mWebSocket?.send(currentAdvertises) ?: throw IllegalArgumentException("mWebSocket is null not send!") mWebSocket?.send(currentAdvertises) ?: throw IllegalArgumentException("mWebSocket is null not send!")
if (sendCurrentAdvertiseTimer!=null){ sendCurrentAdvertiseTimer?.let {
sendCurrentAdvertiseTimer!!.cancel() it.cancel()
sendCurrentAdvertiseTimer!!.purge() it.purge()
sendCurrentAdvertiseTimer =null
} }
// if (sendCurrentAdvertiseTimer!=null){
// sendCurrentAdvertiseTimer!!.cancel()
// sendCurrentAdvertiseTimer!!.purge()
// sendCurrentAdvertiseTimer =null
// }
sendCurrentAdvertiseTimer = KuroTimer() sendCurrentAdvertiseTimer = KuroTimer()

View File

@ -34,6 +34,7 @@ import cn.trans88.taxiappkotlin.logic.gps.GpsReceiver
import cn.trans88.taxiappkotlin.logic.model.Advertise import cn.trans88.taxiappkotlin.logic.model.Advertise
import cn.trans88.taxiappkotlin.logic.network.* import cn.trans88.taxiappkotlin.logic.network.*
import cn.trans88.taxiappkotlin.play.RefreshPlayer import cn.trans88.taxiappkotlin.play.RefreshPlayer
import cn.trans88.taxiappkotlin.ui.advertise.AdvertiseType
import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.BusCallback import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.BusCallback
import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.BusReceiver import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.BusReceiver
import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.SubScreenType import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.SubScreenType
@ -88,15 +89,17 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
if (VERSION.SDK_INT >= VERSION_CODES.P) { if (VERSION.SDK_INT >= VERSION_CODES.P) {
setFlagHide() setFlagHide()
} }
//测试 //测试
Advertise().toString().loge() // Advertise().toString().loge()
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
//读取保留的配置文件 //读取保留的配置文件
// readConfiguration() // readConfiguration()
//清楚过期的播放日志 //清楚过期的播放日志
// clearOverdueLogger() // clearOverdueLogger()
//如果播放器player等于空那重新配置一下播放器player //如果播放器player等于空那重新配置一下播放器player
val taxiApp = TaxiApp.instance() as TaxiApp val taxiApp = TaxiApp.instance() as TaxiApp
// if (taxiApp.player == null){ // if (taxiApp.player == null){
@ -466,7 +469,9 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
*/ */
fun timeRefreshAdvertise() { fun timeRefreshAdvertise() {
YoungUtil.YoungLog("定时刷新广告") YoungUtil.YoungLog("定时刷新广告")
RefreshPlayer.refresh() if (Repository.getTestPlayLevels() != AdvertiseType.AREA.ordinal){
RefreshPlayer.refresh()
}
MainHandler.postDelay(10 * 60 * 1000, Runnable { MainHandler.postDelay(10 * 60 * 1000, Runnable {
timeRefreshAdvertise() timeRefreshAdvertise()

View File

@ -53,6 +53,7 @@ import cn.trans88.taxiappkotlin.logic.dao.AdvertiseDao.Properties
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil import cn.trans88.taxiappkotlin.logic.dao.DaoUtil
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil.getAdvertise import cn.trans88.taxiappkotlin.logic.dao.DaoUtil.getAdvertise
import cn.trans88.taxiappkotlin.logic.dao.PositionAdvertiseDao import cn.trans88.taxiappkotlin.logic.dao.PositionAdvertiseDao
import cn.trans88.taxiappkotlin.logic.dao.RegionsDao
import cn.trans88.taxiappkotlin.logic.gps.GpsInformationListener import cn.trans88.taxiappkotlin.logic.gps.GpsInformationListener
import cn.trans88.taxiappkotlin.logic.gps.GpsReceiver import cn.trans88.taxiappkotlin.logic.gps.GpsReceiver
import cn.trans88.taxiappkotlin.logic.model.* import cn.trans88.taxiappkotlin.logic.model.*
@ -69,6 +70,7 @@ import cn.trans88.taxiappkotlin.ui.custom.JVideoView
import cn.trans88.taxiappkotlin.util.DateUtil import cn.trans88.taxiappkotlin.util.DateUtil
import cn.trans88.taxiappkotlin.util.YoungUtil import cn.trans88.taxiappkotlin.util.YoungUtil
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import org.greenrobot.greendao.query.LazyList
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.util.* import java.util.*
@ -105,7 +107,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
private var curAdvertise: Advertise? = null private var curAdvertise: Advertise? = null
// private var nextAdvertise: Advertise? = null // private var nextAdvertise: Advertise? = null
@Volatile
private var curLocation: Location? = null private var curLocation: Location? = null
private var curLongitude: Double = 0.0 private var curLongitude: Double = 0.0
@ -286,6 +288,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
"${advertise.ad_id}定时轮播".loge() "${advertise.ad_id}定时轮播".loge()
val daoAdvertise = getAdvertise().queryBuilder().where(Properties.Ad_id.eq(advertise.ad_id.toString())).unique() val daoAdvertise = getAdvertise().queryBuilder().where(Properties.Ad_id.eq(advertise.ad_id.toString())).unique()
daoAdvertise.isTimedAd = false daoAdvertise.isTimedAd = false
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
getAdvertise().update(daoAdvertise) getAdvertise().update(daoAdvertise)
try { try {
RefreshPlayer.refresh() RefreshPlayer.refresh()
@ -319,6 +323,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
} else { } else {
val daoAdvertise = getAdvertise().queryBuilder().where(Properties.Ad_id.eq(advertise.ad_id.toString())).unique() val daoAdvertise = getAdvertise().queryBuilder().where(Properties.Ad_id.eq(advertise.ad_id.toString())).unique()
daoAdvertise.isTimedAd = true daoAdvertise.isTimedAd = true
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
getAdvertise().update(daoAdvertise) getAdvertise().update(daoAdvertise)
try { try {
RefreshPlayer.refresh() RefreshPlayer.refresh()
@ -586,17 +592,31 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//用来防止有多余的view没有删除。 //用来防止有多余的view没有删除。
if (fl_play.childCount > 1) { if (fl_play.childCount > 1) {
fl_play.postDelayed({
fl_play.post {
YoungUtil.YoungLog("删除ViewFrameLayout有多少子视图${fl_play.childCount}") YoungUtil.YoungLog("删除ViewFrameLayout有多少子视图${fl_play.childCount}")
if (fl_play.childCount > 1) { if (fl_play.childCount > 1) {
val childView = fl_play[0] val childView = fl_play[0]
if (childView != null) { if (childView != null) {
fl_play.removeView(childView) fl_play.removeView(childView)
} }
} }
// fl_play.removeViewAt(0) 出现过noFocus的异常 }
}, 1000)
// fl_play.postDelayed({
// YoungUtil.YoungLog("删除ViewFrameLayout有多少子视图${fl_play.childCount}")
// if (fl_play.childCount > 1) {
//
// val childView = fl_play[0]
//
// if (childView != null) {
// fl_play.removeView(childView)
// }
// }
//// fl_play.removeViewAt(0) 出现过noFocus的异常
// }, 1000)
YoungUtil.YoungLog("删除后View后FrameLayout有多少子视图${fl_play.childCount}") YoungUtil.YoungLog("删除后View后FrameLayout有多少子视图${fl_play.childCount}")
} }
} }
@ -698,7 +718,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
handler.removeCallbacks(nextCheck) handler.removeCallbacks(nextCheck)
curAdvertise = null curAdvertise = null
curLogger = null curLogger = null
// nextAdvertise =null // nextAdvertise = null
YoungUtil.YoungLog("停止播放") YoungUtil.YoungLog("停止播放")
} }
@ -834,14 +854,17 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
override fun onSpeedChanged(speed: Float) { override fun onSpeedChanged(speed: Float) {
} }
//缓存开关小于0时从数据库重新获取
private var regionCacheSwitch = 8888
/** /**
* 当坐标位置变化时触发 * 当坐标位置变化时触发
*/ */
override fun onLocationChanged(longitude: Double, latitude: Double, bearing: Float, speed: Float, satelliteNumber: Int) { override fun onLocationChanged(longitude: Double, latitude: Double, bearing: Float, speed: Float, satelliteNumber: Int) {
// KuroExecutor.execute(runnable = Runnable { // KuroExecutor.execute(runnable = Runnable {
// ThreadUtil.executeByPool(
ThreadUtil.executeByPool( //edit by ljh @2023/8/16
ThreadUtil.executeBySingleThread2(
Runnable { Runnable {
synchronized(this) { synchronized(this) {
if (satelliteNumber == 0) { if (satelliteNumber == 0) {
@ -856,7 +879,23 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
saveLocation(longitude, latitude, bearing, speed) saveLocation(longitude, latitude, bearing, speed)
val regions = DaoUtil.getRegion().loadAll() //edit by ljh @2023/8/28
regionCacheSwitch -= 1
if (regionCacheSwitch<=0){
regionCacheSwitch = 8888
taxiApp.regionsList.clear()
}
// val regions = DaoUtil.getRegion().loadAll()
var regions = if (taxiApp.regionsList.isNotEmpty()){
"从缓存获取regions数据${taxiApp.regionsList},regionCacheSwitch:$regionCacheSwitch".logd()
taxiApp.regionsList
} else {
val list = DaoUtil.getRegion().queryBuilder().build().list()
for (regions in list) {
taxiApp.regionsList.add(regions)
}
list
}
"regions.size:${regions.size}".logd() "regions.size:${regions.size}".logd()
for (region in regions) { for (region in regions) {
"regionAdId:${region.regionAdId},index:${regions.indexOf(region)}".logd() "regionAdId:${region.regionAdId},index:${regions.indexOf(region)}".logd()
@ -867,7 +906,21 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
YoungUtil.YoungLog("进圈 regionId: ${region.id}") YoungUtil.YoungLog("进圈 regionId: ${region.id}")
region.isInRegion = true region.isInRegion = true
DaoUtil.getRegion().update(region)
//edit by ljh @2023/8/14
if (taxiApp.regionsList.isNotEmpty()){
taxiApp.updateCacheRegions(region)
val reg = DaoUtil.getRegion().queryBuilder().where(RegionsDao.Properties.AutoId.eq(region.autoId)).unique()
if (reg != null){
reg.isInRegion = true
DaoUtil.getRegion().update(reg)
} else {
taxiApp.regionsList.clear()
DaoUtil.getRegion().update(region)
}
}else{
DaoUtil.getRegion().update(region)
}
if (isHavePositionAdvertise(region)) { if (isHavePositionAdvertise(region)) {
YoungUtil.YoungLog("进圈但已经存在广告,不再添加") YoungUtil.YoungLog("进圈但已经存在广告,不再添加")
@ -884,6 +937,9 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
if(positionAdvertise != null) { if(positionAdvertise != null) {
val advertise = setAdvertiseByPosition(positionAdvertise, region.id, longitude, latitude) val advertise = setAdvertiseByPosition(positionAdvertise, region.id, longitude, latitude)
DaoUtil.getAdvertise().insert(advertise) DaoUtil.getAdvertise().insert(advertise)
//edit by ljh @2023/8/15
taxiApp.daoAds.clear()
RefreshPlayer.refresh() RefreshPlayer.refresh()
} else { } else {
YoungUtil.YoungLog("positionAdvertise is null"); YoungUtil.YoungLog("positionAdvertise is null");
@ -892,7 +948,28 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
YoungUtil.YoungLog("没进圈 regionId: ${region.id}") YoungUtil.YoungLog("没进圈 regionId: ${region.id}")
if (isHavePositionAdvertise(region)) { if (isHavePositionAdvertise(region)) {
region.isInRegion = false region.isInRegion = false
DaoUtil.getRegion().update(region)
//edit by ljh @2023/8/14
if (taxiApp.regionsList.isNotEmpty()){
taxiApp.updateCacheRegions(region)
val reg = DaoUtil.getRegion().queryBuilder().where(RegionsDao.Properties.AutoId.eq(region.autoId)).unique()
if (reg != null){
reg.isInRegion = true
DaoUtil.getRegion().update(reg)
} else {
taxiApp.regionsList.clear()
DaoUtil.getRegion().update(region)
}
}else{
DaoUtil.getRegion().update(region)
}
// DaoUtil.getRegion().update(region)
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(region.regionAdId)).buildDelete() DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(region.regionAdId)).buildDelete()
.executeDeleteWithoutDetachingEntities() .executeDeleteWithoutDetachingEntities()
@ -901,6 +978,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
} }
} }
} }
} }
if(locationTimer!=null){ if(locationTimer!=null){
@ -926,6 +1004,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
fun clearAreaAdvertise() { fun clearAreaAdvertise() {
val list = getAdvertise().queryBuilder().where(Properties.BelongTo.eq(AREA.ordinal)).list() val list = getAdvertise().queryBuilder().where(Properties.BelongTo.eq(AREA.ordinal)).list()
list?.let { list?.let {
//edit by ljh @2023/8/11
taxiApp.daoAds.clear()
for (advertise in it) { for (advertise in it) {
getAdvertise().delete(advertise) getAdvertise().delete(advertise)
try { try {
@ -935,32 +1015,57 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
} }
} }
} }
} }
private fun saveLocation(longitude: Double, latitude: Double, bearing: Float, speed: Float) { private fun saveLocation(longitude: Double, latitude: Double, bearing: Float, speed: Float) {
synchronized(this) { if (curLocation == null) {
if (curLocation == null) { YoungUtil.YoungLog("当前curLocation == null")
YoungUtil.YoungLog("当前curLocation == null") val location = Location().apply {
val location = Location().apply { timestamp = System.currentTimeMillis()
timestamp = System.currentTimeMillis() setLongitude(longitude)
setLongitude(longitude) setLatitude(latitude)
setLatitude(latitude) setBearing(bearing)
setBearing(bearing) setSpeed(speed)
setSpeed(speed) distance = 0.0f
distance = 0.0f elapse = 0
elapse = 0 }
} DaoUtil.getLocationDao().insert(location)
DaoUtil.getLocationDao().insert(location) curLocation = location
curLocation = location } else {
} else { if (curLocation?.longitude?.toDouble() != longitude || curLocation?.latitude?.toDouble() != latitude) {
if (curLocation?.longitude?.toDouble() != longitude || curLocation?.latitude?.toDouble() != latitude) { //YoungUtil.YoungLog("当前位置不相等${curLocation.toString()},当前longitude =$longitude,latitude =$latitude")
//YoungUtil.YoungLog("当前位置不相等${curLocation.toString()},当前longitude =$longitude,latitude =$latitude") val distanceLocation = DistanceUtil.getDistance(curLocation!!.latitude, curLocation!!.longitude, latitude, longitude)
val distanceLocation = DistanceUtil.getDistance(curLocation!!.latitude, curLocation!!.longitude, latitude, longitude) //edit by ljh@2023/8/22
if (distanceLocation > 50) { if (distanceLocation > 20) {
// edit by yzd @20211201 // edit by yzd @20211201
// if (Settings.gpsSwitch) { // if (Settings.gpsSwitch) {
if (Configurations.config(TaxiApp.instance()).gpsSwitch()) { if (Configurations.config(TaxiApp.instance()).gpsSwitch()) {
YoungUtil.YoungLog("当前位置坐标距离上一个点大于50记录") YoungUtil.YoungLog("当前位置坐标距离上一个点大于20记录")
val location = Location().apply {
timestamp = System.currentTimeMillis()
setLongitude(longitude)
setLatitude(latitude)
setBearing(bearing)
setSpeed(speed)
val floatArray = FloatArray(1)
distanceBetween(curLocation?.latitude!!, curLocation?.longitude!!, latitude, longitude, floatArray)
distance = floatArray[0]
elapse = timestamp - curLocation?.timestamp!!
}
//过滤掉距离过大的数据edit by ljh 2023/8/8
location.distance?.let {
if (it < 10000f){
DaoUtil.getLocationDao().insert(location)
}
}
curLocation = location
//debug 将日志存卡里看location信息对不对
// taxiApp.saveLog(location.toString())
} else {
val tamp = System.currentTimeMillis() - curLocation!!.timestamp
if (tamp > 60 * 60 * 1000) {
YoungUtil.YoungLog("gps开关关闭每一个小时记录一次日志")
val location = Location().apply { val location = Location().apply {
timestamp = System.currentTimeMillis() timestamp = System.currentTimeMillis()
setLongitude(longitude) setLongitude(longitude)
@ -972,37 +1077,16 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
distance = floatArray[0] distance = floatArray[0]
elapse = timestamp - curLocation?.timestamp!! elapse = timestamp - curLocation?.timestamp!!
} }
//过滤掉距离过大的数据edit by ljh 2023/8/8 DaoUtil.getLocationDao().insert(location)
if (location.distance < 10 * 1000){
DaoUtil.getLocationDao().insert(location)
}
curLocation = location curLocation = location
} else {
val tamp = System.currentTimeMillis() - curLocation!!.timestamp
if (tamp > 60 * 60 * 1000) {
YoungUtil.YoungLog("gps开关关闭每一个小时记录一次日志")
val location = Location().apply {
timestamp = System.currentTimeMillis()
setLongitude(longitude)
setLatitude(latitude)
setBearing(bearing)
setSpeed(speed)
val floatArray = FloatArray(1)
distanceBetween(curLocation?.latitude!!, curLocation?.longitude!!, latitude, longitude, floatArray)
distance = floatArray[0]
elapse = timestamp - curLocation?.timestamp!!
}
DaoUtil.getLocationDao().insert(location)
curLocation = location
}
} }
} else {
YoungUtil.YoungLog("当前位置坐标距离上一个点小于50不记录")
return
} }
} else { } else {
YoungUtil.YoungLog("当前位置坐标距离上一个点小于20不记录")
return return
} }
} else {
return
} }
} }
} }
@ -1017,10 +1101,14 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
if (advertiseList.size > 1) { if (advertiseList.size > 1) {
for (index in 0 until advertiseList.size) { for (index in 0 until advertiseList.size) {
//edit by ljh @2023/8/31
taxiApp.removeCacheAd(advertiseList[index])
DaoUtil.getAdvertise().delete(advertiseList[index]) DaoUtil.getAdvertise().delete(advertiseList[index])
//todo 不一定是线程冲突造成 //todo 不一定是线程冲突造成
YoungUtil.YoungLog("线程冲突造成定点广告重复,删除多余的广告") YoungUtil.YoungLog("线程冲突造成定点广告重复,删除多余的广告")
} }
} else { } else {
YoungUtil.YoungLog("未发生线程冲突造成定点广告重复") YoungUtil.YoungLog("未发生线程冲突造成定点广告重复")
} }

View File

@ -7,6 +7,7 @@ import cn.trans88.taxiappkotlin.logic.dao.AdvertiseDao
import cn.trans88.taxiappkotlin.logic.dao.AdvertiseDao.Properties import cn.trans88.taxiappkotlin.logic.dao.AdvertiseDao.Properties
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil import cn.trans88.taxiappkotlin.logic.dao.DaoUtil
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil.getAdvertise import cn.trans88.taxiappkotlin.logic.dao.DaoUtil.getAdvertise
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil.taxiApp
import cn.trans88.taxiappkotlin.logic.dao.TimeSpanDao import cn.trans88.taxiappkotlin.logic.dao.TimeSpanDao
import cn.trans88.taxiappkotlin.logic.model.Advertise import cn.trans88.taxiappkotlin.logic.model.Advertise
import cn.trans88.taxiappkotlin.logic.model.PositionAdvertise import cn.trans88.taxiappkotlin.logic.model.PositionAdvertise
@ -50,6 +51,8 @@ fun Advertise.isReady(): Boolean {
advertise.setIsDownloading(false) advertise.setIsDownloading(false)
advertise.setIsDownloaded(false) advertise.setIsDownloaded(false)
getAdvertise().update(advertise) getAdvertise().update(advertise)
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
downloadFile() downloadFile()
ready = false ready = false
} }
@ -61,6 +64,8 @@ fun Advertise.isReady(): Boolean {
advertise.setIsDownloading(false) advertise.setIsDownloading(false)
advertise.setIsDownloaded(false) advertise.setIsDownloaded(false)
getAdvertise().update(advertise) getAdvertise().update(advertise)
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
downloadFile() downloadFile()
} }
ready = false ready = false

View File

@ -86,4 +86,14 @@ public class DateUtil {
// System.out.println("secondDate:"+dateTimeFormat.format(secondDate)); // System.out.println("secondDate:"+dateTimeFormat.format(secondDate));
return secondDate.getTime() - firstDate.getTime(); return secondDate.getTime() - firstDate.getTime();
} }
/**
* 获取当前时间
* @return
*/
public static String nowTime(){
String now = dateTimeFormat.format(new Date());
return now;
}
} }

View File

@ -1,5 +1,6 @@
package cn.trans88.taxiappkotlin.util package cn.trans88.taxiappkotlin.util
import android.content.Context
import cn.trans88.taxiappkotlin.Configurations import cn.trans88.taxiappkotlin.Configurations
import cn.trans88.taxiappkotlin.TaxiApp import cn.trans88.taxiappkotlin.TaxiApp
import cn.trans88.taxiappkotlin.ext.logd import cn.trans88.taxiappkotlin.ext.logd
@ -7,6 +8,7 @@ import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.model.BackgroundType import cn.trans88.taxiappkotlin.logic.model.BackgroundType
import com.google.gson.Gson import com.google.gson.Gson
import java.io.File import java.io.File
import java.io.IOException
/** /**
* *
@ -39,4 +41,7 @@ object FileUtil {
"找不到临时文件或文件已恢复".logd() "找不到临时文件或文件已恢复".logd()
} }
} }
} }

View File

@ -90,7 +90,7 @@ object SyncUtil {
// if (circularList == null || circularList.size() == 0) return 0 // if (circularList == null || circularList.size() == 0) return 0
var all = 0 var all = 0
var currentPosition =0 var currentPosition = 0
var sum =0 var sum =0
val syncTimeModel = SyncTimeModel() val syncTimeModel = SyncTimeModel()
@ -128,8 +128,8 @@ object SyncUtil {
} }
syncTimeModel.currentPosition =currentPosition syncTimeModel.currentPosition = currentPosition
syncTimeModel.delay =delay syncTimeModel.delay = delay
YoungUtil.YoungLog("同步时间为:${syncTimeModel.delay},日期:${Date(curr + delay)} ,播放的位置:${syncTimeModel.currentPosition},总时间:$sum,过去的时间:$passModuleTime") YoungUtil.YoungLog("同步时间为:${syncTimeModel.delay},日期:${Date(curr + delay)} ,播放的位置:${syncTimeModel.currentPosition},总时间:$sum,过去的时间:$passModuleTime")
return syncTimeModel return syncTimeModel

View File

@ -1,195 +0,0 @@
<?xml version="1.0" ?>
<sdk_metadata>
<library groupId="com.urbanairship.android" artifactId="urbanairship-sdk" recommended-version="9.3.1" >
<versions from="9.1.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-sdk:9.1.0" />
<versions from="9.0.0" to="9.0.4" status="deprecated" description="Version is known issues with in-app automation. Please update to version &lt;current&gt; as soon as possible." />
<versions from="8.9.1" to="8.9.2" status="deprecated" description="Version is known to have stability issues. Please update to version &lt;current&gt; as soon as possible. See &lt;url&gt; for more details." url="https://github.com/urbanairship/android-library/blob/master/CHANGELOG.md#version-893---october-17-2017" />
<versions from="6.1.4" to="8.7.0" status="deprecated" description="Version is known to have Android O compatibility issues. Please update to version &lt;current&gt; as soon as possible." />
<versions from="9.3.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-sdk:9.3.0" />
<versions from="9.3.1" status="recommended" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-sdk:9.3.1" />
</library>
<library groupId="com.urbanairship.android" artifactId="urbanairship-core" recommended-version="9.3.1" >
<versions from="9.1.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-core:9.1.0" />
<versions from="9.3.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-core:9.3.0" />
<versions from="9.3.1" status="recommended" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-core:9.3.1" />
</library>
<library groupId="com.urbanairship.android" artifactId="urbanairship-fcm" recommended-version="9.3.1" >
<versions from="9.1.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-fcm:9.1.0" />
<versions from="9.3.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-fcm:9.3.0" />
<versions from="9.3.1" status="recommended" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-fcm:9.3.1" />
</library>
<library groupId="com.urbanairship.android" artifactId="urbanairship-gcm" recommended-version="9.3.1" >
<versions from="9.1.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-gcm:9.1.0" />
<versions from="9.3.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-gcm:9.3.0" />
<versions from="9.3.1" status="recommended" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-gcm:9.3.1" />
</library>
<library groupId="com.urbanairship.android" artifactId="urbanairship-adm" recommended-version="9.3.1" >
<versions from="9.1.0" status="deprecated" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-adm:9.1.0" />
<versions from="9.3.0" status="recommended" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-adm:9.3.0" />
<versions from="9.3.1" status="recommended" version-literal="!SDK-VERSION-STRING!:com.urbanairship.android:urbanairship-adm:9.3.1" />
</library>
<library groupId="com.tune" artifactId="tune-marketing-console-sdk" recommended-version="5.3.0" >
<versions from="5.3.0" version-literal="com.tune.BuildConfig.5.3.0" description="Bug affecting SDK data quality" />
<versions from="5.2.1" version-literal="com.tune.BuildConfig.5.2.1" />
<versions from="5.2.0" version-literal="com.tune.BuildConfig.5.2.0" />
<versions from="5.1.1" status="deprecated" version-literal="com.tune.BuildConfig.5.1.1" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="5.0.0" to="5.0.2" status="deprecated" version-literal="com.tune.BuildConfig.5.0.0" description="Bug affecting SDK data quality" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.15.2" to="4.16.0" status="deprecated" version-literal="com.tune.BuildConfig.4.15.2" description="Bug affecting SDK data quality" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.15.1" version-literal="com.tune.BuildConfig.4.15.1" description="Bug affecting SDK performance" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.15.0" version-literal="com.tune.BuildConfig.4.15.0" description="Bug affecting SDK performance" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.14.0" version-literal="com.tune.BuildConfig.4.14.0" description="Bug affecting SDK performance" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.13.0" status="deprecated" version-literal="com.tune.BuildConfig.4.13.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.12.1" status="deprecated" version-literal="com.tune.BuildConfig.4.12.1" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.12.0" status="deprecated" version-literal="com.tune.BuildConfig.4.12.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.11.1" status="deprecated" version-literal="com.tune.BuildConfig.4.11.1" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.11.0" status="deprecated" version-literal="com.tune.BuildConfig.4.11.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.10.2" version-literal="com.tune.BuildConfig.4.10.2" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.10.1" version-literal="com.tune.BuildConfig.4.10.1" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.10.0" version-literal="com.tune.BuildConfig.4.10.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.9.0" version-literal="com.tune.BuildConfig.4.9.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.8.0" to="4.8.1" version-literal="com.tune.BuildConfig.4.8.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="4.0.0" to="4.7.1" status="deprecated" version-literal="com.tune.BuildConfig.4.0.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="3.0.0" to="3.11.4" status="deprecated" version-literal="com.tune.BuildConfig.3.0.0" description="Bug affecting app stability" url="https://developers.tune.com/sdk/migrating-to-android-4-8-0-and-above/" />
<versions from="0.0.0" to="3.0.0" status="deprecated" description="Bug affecting app stability" />
</library>
<library groupId="com.android.volley" artifactId="volley" recommended-version="1.1.0" >
<versions from="1.1.0" />
<versions from="1.1.0-rc2" status="deprecated" description="Bug affecting app stability" url="https://github.com/google/volley/releases" />
<versions from="1.1.0-rc1" status="deprecated" description="Bug affecting app stability" url="https://github.com/google/volley/releases" />
<versions from="1.0.0" status="deprecated" description="Bug affecting app stability" url="https://github.com/google/volley/releases" />
</library>
<library groupId="com.crashlytics.sdk.android" artifactId="answers" recommended-version="17.4.0">
<versions from="1.0.0" to="1.4.7" status="deprecated" description="Fabric Answers is deprecated. To continue getting real-time analytics, switch over to using Google Analytics.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/switch-to-analytics." url="https://firebase.google.com/docs/crashlytics/switch-to-analytics?platform=android" />
</library>
<library groupId="com.crashlytics.sdk.android" artifactId="crashlytics" recommended-version="17.2.2">
<versions from="2.0.0" to="2.10.1" status="deprecated" description="The Fabric Crashlytics SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/upgrade-sdk" url="https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android" />
</library>
<library groupId="com.crashlytics.sdk.android" artifactId="crashlytics-core" recommended-version="17.2.2">
<versions from="2.0.0" to="2.7.0" status="deprecated" description="The Fabric Crashlytics SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/upgrade-sdk" url="https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android" />
</library>
<library groupId="com.crashlytics.sdk.android" artifactId="crashlytics-ndk" recommended-version="17.2.2">
<versions from="0.5.0" to="2.1.1" status="deprecated" description="The Fabric Crashlytics SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/upgrade-sdk" url="https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android" />
</library>
<library groupId="com.google.guava" artifactId="guava" recommended-version="24.1-jre" >
<versions from="24.1-jre" />
</library>
<library groupId="com.google.guava" artifactId="guava" recommended-version="25.0-android" >
<versions from="25.0-android" />
<versions from="24.1.1-android" status="insecure" description="Moderate security vulnerability" url="https://github.com/google/guava/wiki/CVE-2018-10237" />
<versions from="24.1-android" status="deprecated" description="Bug affecting app performance" url="https://github.com/google/guava/releases" />
<versions from="24.0-android" status="deprecated" description="Bug affecting app performance" url="https://github.com/google/guava/releases" />
</library>
<library groupId="com.google.firebase" artifactId="firebase-analytics" recommended-version="15.0.0" >
<versions from="15.0.0" />
<versions from="12.0.1" />
<versions from="12.0.0" />
<versions from="11.8.0" />
<versions from="11.6.2" />
<versions from="11.6.0" />
<versions from="11.4.2" />
<versions from="11.4.0" />
<versions from="11.2.2" />
<versions from="11.2.0" />
<versions from="11.0.4" />
<versions from="11.0.2" />
<versions from="11.0.1" />
<versions from="11.0.0" />
<versions from="10.2.6" />
<versions from="10.2.4" />
<versions from="10.2.1" />
<versions from="10.2.0" />
<versions from="10.0.1" />
<versions from="10.0.0" />
<versions from="9.8.0" />
<versions from="9.6.1" />
<versions from="9.6.0" />
<versions from="9.4.0" />
<versions from="9.2.1" />
<versions from="9.2.0" />
<versions from="9.0.2" />
<versions from="9.0.1" />
<versions from="9.0.0" />
</library>
<library groupId="com.google.firebase" artifactId="firebase-appcheck-safetynet">
<versions from="16.0.0-beta01" to="16.0.0-beta01" status="deprecated" description="The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Before June 2023, migrate to the Firebase App Check SDK for Play Integrity by following https://firebase.google.com/docs/app-check/android/play-integrity-provider." url="https://developer.android.com/training/safetynet/deprecation-timeline"/>
<versions from="16.0.0-beta02" to="16.0.0-beta02" status="deprecated" description="The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Before June 2023, migrate to the Firebase App Check SDK for Play Integrity by following https://firebase.google.com/docs/app-check/android/play-integrity-provider." url="https://developer.android.com/training/safetynet/deprecation-timeline"/>
<versions from="16.0.0-beta03" to="16.0.0-beta03" status="deprecated" description="The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Before June 2023, migrate to the Firebase App Check SDK for Play Integrity by following https://firebase.google.com/docs/app-check/android/play-integrity-provider." url="https://developer.android.com/training/safetynet/deprecation-timeline"/>
<versions from="16.0.0-beta04" to="16.0.0-beta04" status="deprecated" description="The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Before June 2023, migrate to the Firebase App Check SDK for Play Integrity by following https://firebase.google.com/docs/app-check/android/play-integrity-provider." url="https://developer.android.com/training/safetynet/deprecation-timeline"/>
<versions from="16.0.0-beta05" to="16.0.0-beta05" status="deprecated" description="The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Before June 2023, migrate to the Firebase App Check SDK for Play Integrity by following https://firebase.google.com/docs/app-check/android/play-integrity-provider." url="https://developer.android.com/training/safetynet/deprecation-timeline"/>
<versions from="16.0.0-beta06" to="16.0.0-beta06" status="deprecated" description="The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Before June 2023, migrate to the Firebase App Check SDK for Play Integrity by following https://firebase.google.com/docs/app-check/android/play-integrity-provider." url="https://developer.android.com/training/safetynet/deprecation-timeline"/>
<versions from="16.0.0" status="deprecated" description="The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Before June 2023, migrate to the Firebase App Check SDK for Play Integrity by following https://firebase.google.com/docs/app-check/android/play-integrity-provider." url="https://developer.android.com/training/safetynet/deprecation-timeline"/>
</library>
<library groupId="com.google.firebase" artifactId="firebase-config">
<versions from="21.1.0" to="21.1.0" status="deprecated" description="Bug affecting some locales causing HTTP errors" url="https://firebase.google.com/docs/remote-config/get-started?platform=android" />
</library>
<library groupId="com.google.firebase" artifactId="firebase-crashlytics" recommended-version="18.3.1">
<versions from="17.0.0-beta01" to="17.0.0-beta01" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="17.0.0-beta02" to="17.0.0-beta02" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="17.0.0-beta03" to="17.0.0-beta03" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="17.0.0-beta04" to="17.0.0-beta04" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="18.3.0" to="18.3.0" status="deprecated" description="We detected an issue in this version of the Crashlytics Android SDK. We strongly recommend either using v18.2.13 or earlier or upgrading to v18.3.1+." url="https://github.com/firebase/firebase-android-sdk/issues/4223" />
</library>
<library groupId="com.google.firebase" artifactId="firebase-crashlytics-ndk" recommended-version="18.3.2">
<versions from="17.0.0-beta01" to="17.0.0-beta01" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="17.0.0-beta02" to="17.0.0-beta02" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="17.0.0-beta03" to="17.0.0-beta03" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="17.0.0-beta04" to="17.0.0-beta04" status="deprecated" description="The Firebase Crashlytics beta SDK is now deprecated and will continue reporting your app's crashes only until November 15, 2020. To continue getting crash reports in the Firebase console, make sure you upgrade to the generally available Firebase Crashlytics SDK version 17.0.0+.&#13;&#10;For more information, visit https://firebase.google.com/docs/crashlytics/get-started" url="https://firebase.google.com/docs/crashlytics/get-started?platform=android" />
<versions from="18.3.0" to="18.3.0" status="deprecated" description="We detected an issue in this version of the Crashlytics Android SDK. We strongly recommend either using v18.2.13 or earlier or upgrading to v18.3.1+." url="https://github.com/firebase/firebase-android-sdk/issues/4223" />
<versions from="18.3.1" to="18.3.1" status="deprecated" description="We detected an issue in this version of the Crashlytics Android SDK. We strongly recommend either using v18.2.13 or earlier or upgrading to v18.3.2+." url="https://github.com/firebase/firebase-android-sdk/issues/4313" />
</library>
<library groupId="com.google.firebase" artifactId="firebase-messaging" recommended-version="20.1.2" >
<versions from="20.1.1" status="deprecated" description="Bug affecting app stability" url="https://firebase.google.com/support/release-notes/android#messaging_v20-1-1" />
</library>
<library groupId="com.google.firebase" artifactId="firebase-ml-vision">
<versions from="15.0.0" to="24.1.0" status="deprecated" description="For more information, refer to documentation for specific features.&#13;&#10;Text recognition: https://firebase.google.com/docs/ml/android/recognize-text&#13;&#10;Image labeling: https://firebase.google.com/docs/ml/android/label-images&#13;&#10;Landmark recognition: https://firebase.google.com/docs/ml/android/recognize-landmarks " />
</library>
<library groupId="com.google.firebase" artifactId="firebase-ml-model-interpreter">
<versions from="15.0.0" to="22.0.4" status="deprecated" description="The Firebase ML Model Interpreter library is deprecated in favor of the Firebase ML Model Downloader library. For more information, visit https://firebase.google.com/docs/ml/android/use-custom-models" />
</library>
<library groupId="com.google.firebase" artifactId="firebase-perf">
<versions to="16.2.1" status="deprecated" description="This version will soon be deprecated. Update to version 19.0.10 or higher to get real time performance data. For more information, visit https://firebase.google.com/docs/perf-mon/troubleshooting" url="https://firebase.google.com/docs/perf-mon/troubleshooting?platform=android#faq-real-time-data"/>
</library>
<library groupId="com.google.dagger" artifactId="dagger-android" recommended-version="2.35.1" >
<versions from="2.15" />
<versions from="2.14.1" status="deprecated" description="Bug affecting SDK performance" url="https://github.com/google/dagger/releases/tag/2.15" />
<versions from="2.14" status="deprecated" description="Bug affecting SDK performance" url="https://github.com/google/dagger/releases/tag/2.15" />
<versions from="2.13" status="deprecated" description="Bug affecting app performance" url="https://github.com/google/dagger/releases/tag/2.15" />
<versions from="2.12" status="deprecated" description="Bug affecting app performance" url="https://github.com/google/dagger/releases/tag/2.15" />
<versions from="2.11" status="deprecated" description="Bug affecting SDK performance" url="https://github.com/google/dagger/releases/tag/2.15" />
<versions from="2.11-rc2" status="deprecated" description="Bug affecting SDK performance" url="https://github.com/google/dagger/releases/tag/2.15" />
<versions from="2.11-rc1" status="deprecated" description="Bug affecting SDK performance" url="https://github.com/google/dagger/releases/tag/2.15" />
<versions from="2.10" status="deprecated" url="https://github.com/google/dagger/releases/tag/2.15" />
</library>
<library groupId="AppsFlyer" artifactId="af-android-sdk" recommended-version="4.8.10" >
<versions from="4.8.9" version-literal="!SDK-VERSION-STRING!:com.appsflyer:af-android-sdk:4.8.9" />
<versions from="4.8.10" version-literal="!SDK-VERSION-STRING!:com.appsflyer:af-android-sdk:4.8.10" />
</library>
<library groupId="com.kochava" artifactId="tracker" recommended-version="3.4.0" >
<versions from="3.4.0" />
<versions from="3.3.1" version-literal="&quot;AndroidTracker 3.3.1&quot;, &quot;control.kochava.com&quot;" />
<versions from="3.3.0" version-literal="&quot;AndroidTracker 3.3.0&quot;, &quot;control.kochava.com&quot;" />
<versions from="3.2.0" version-literal="&quot;AndroidTracker 3.2.0&quot;, &quot;control.kochava.com&quot;" />
<versions from="3.1.1" version-literal="&quot;AndroidTracker 3.1.1&quot;, &quot;control.kochava.com&quot;" />
<versions from="3.1.0" status="deprecated" version-literal="&quot;AndroidTracker 3.1.0&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="3.0.0" status="deprecated" version-literal="&quot;AndroidTracker 3.0.0&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20170303" status="deprecated" version-literal="&quot;Android20170303&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20170216" status="deprecated" version-literal="&quot;Android20170216&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20170127" status="deprecated" version-literal="&quot;Android20170127&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20170106" status="deprecated" version-literal="&quot;Android20170106&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20161122" status="deprecated" version-literal="&quot;Android20161122&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20160914" status="deprecated" version-literal="&quot;Android20160914&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20160902" status="deprecated" version-literal="&quot;Android20160902&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20160811" status="deprecated" version-literal="&quot;Android20160811&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20160615" status="deprecated" version-literal="&quot;Android20160615&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20160427" status="deprecated" version-literal="&quot;Android20160427&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20160222" status="deprecated" version-literal="&quot;Android20160222&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20151109" status="deprecated" version-literal="&quot;Android20151109&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20150511" status="deprecated" version-literal="&quot;Android20150511&quot;, &quot;control.kochava.com&quot;" description="Bug affecting SDK performance" />
<versions from="20150312" status="insecure" version-literal="&quot;Android20150312&quot;, &quot;control.kochava.com&quot;" description="Moderate security vulnerability" />
<versions from="20150128" status="insecure" version-literal="&quot;Android20150128&quot;, &quot;control.kochava.com&quot;" description="Moderate security vulnerability" />
<versions from="20141023" status="insecure" version-literal="&quot;Android20141023&quot;, &quot;control.kochava.com&quot;" description="Moderate security vulnerability" />
<versions from="20140825" status="insecure" version-literal="&quot;Android20140825&quot;, &quot;control.kochava.com&quot;" description="Moderate security vulnerability" />
</library>
</sdk_metadata>

View File

@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":207,"versionName":"3.3.3-beta26.3.8.1-debug","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.3.8.1-debug{207}.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"TaxiApp_v3.3.3-beta26.3.8.1-debug{207}.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":229,"versionName":"3.3.3-beta26.3.9.3.5-debug","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.3.9.3.5-debug{229}.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"TaxiApp_v3.3.3-beta26.3.9.3.5-debug{229}.apk","properties":{}}]

View File

@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle. # Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
#Tue Jul 18 17:55:51 GMT+08:00 2023 #Mon Aug 28 09:57:51 GMT+08:00 2023
sdk.dir=D\:\\Android\\sdk sdk.dir=D\:\\Android\\sdk

View File

@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":208,"versionName":"3.3.3-beta26.3.8.2-release","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.3.8.2-release{208}.apk","fullName":"release","baseName":"release","dirName":""},"path":"TaxiApp_v3.3.3-beta26.3.8.2-release{208}.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":229,"versionName":"3.3.3-beta26.3.9.3.5-release","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.3.9.3.5-release{229}.apk","fullName":"release","baseName":"release","dirName":""},"path":"TaxiApp_v3.3.3-beta26.3.9.3.5-release{229}.apk","properties":{}}]