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"
minSdkVersion 21
targetSdkVersion 29
versionCode 208
versionName "3.3.3-beta26.3.8.2-release"
versionCode 229
versionName "3.3.3-beta26.3.9.3.5-release"
//alphaxx - ,bug
//Betaxx -
@ -33,7 +33,6 @@ android {
//3.1.10
//3.2.0广
//333-10 crashHandler
//333-11 KuroLog日志
@ -52,6 +51,11 @@ android {
26.3.8.9debug 广ledOk重复绑定同一个凭证会被过滤3s没gps信息清除定点广告改成30s
gps信息gps则判断是否有定点广告
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"

View File

@ -6,6 +6,7 @@ import android.util.Log;
import com.google.gson.Gson;
import cn.trans88.taxiappkotlin.logic.model.BackgroundType;
import cn.trans88.taxiappkotlin.util.DateUtil;
import cn.trans88.taxiappkotlin.util.YoungUtil;
public class Configurations {
@ -53,6 +54,14 @@ public class Configurations {
loggerSwitchSave(false);
gpsSwitchSave(false);
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{
YoungUtil.YoungLog("copy configurations");
YoungUtil.YoungLog("read file :cn.trans88.taxiappkotlin.logic.Settings OK");
@ -277,7 +286,8 @@ public class Configurations {
}
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){

View File

@ -1,29 +1,36 @@
package cn.trans88.taxiappkotlin
import android.app.Application
import android.content.Context
import android.content.Intent
import android.media.MediaCodecList
import android.os.Looper
import android.util.Log
import cn.trans88.kurotool.util.LogLevel
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.DaoSession
import cn.trans88.taxiappkotlin.logic.dao.HelperDaoDB
import cn.trans88.taxiappkotlin.logic.exception.CrashHandler
import cn.trans88.taxiappkotlin.logic.model.Advertise
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.net.BizInterceptor
import cn.trans88.taxiappkotlin.ui.custom.JVideoView
import cn.trans88.taxiappkotlin.ui.play.PlayActivity
import cn.trans88.taxiappkotlin.util.DateUtil
import cn.trans88.taxiappkotlin.util.YoungUtil
import com.facebook.stetho.Stetho
import com.google.gson.Gson
import com.trs88.kurolibrary.log.*
import com.trs88.kurolibrary.restful.retrofit.KuroApiFactory
import io.reactivex.plugins.RxJavaPlugins
import java.io.File
import java.io.*
import java.util.*
import java.util.concurrent.CopyOnWriteArrayList
import kotlin.collections.ArrayList
import kotlin.collections.HashMap
@ -35,9 +42,17 @@ class TaxiApp:Application() {
var gson = Gson()
var defaultBackgroundType = ""
//缓存数据库所有广告
var daoAds:CopyOnWriteArrayList<Advertise> = CopyOnWriteArrayList()
//缓存数据库regions
var regionsList:CopyOnWriteArrayList<Regions> = CopyOnWriteArrayList()
var nextVideoView:JVideoView? = null
var clearOrderTimer = Timer()
var isDoubleClearOrder = 0
val timer = Timer()
//定时任务是否执行
var isTimed:Boolean = false
@ -54,6 +69,7 @@ class TaxiApp:Application() {
// var player: SimpleExoPlayer? = null
// lateinit var factory: ProgressiveMediaSource.Factory
companion object{
private var instance:Application? =null
fun instance() = instance!!
@ -68,6 +84,23 @@ class TaxiApp:Application() {
// 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() {
super.onCreate()
instance = this
@ -86,6 +119,7 @@ class TaxiApp:Application() {
setLogUtil()
//获取设备上支持的所有解码器列表
val allCodecs = MediaCodecList(MediaCodecList.ALL_CODECS)
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(){
val file = File(filesDir, "/log")
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.play.PlayViewModel
import cn.trans88.taxiappkotlin.ui.play.isAllowPlay
import cn.trans88.taxiappkotlin.util.KuroTimer
import cn.trans88.taxiappkotlin.util.LastThread
import cn.trans88.taxiappkotlin.util.LastThreadListener
import cn.trans88.taxiappkotlin.util.*
import cn.trans88.taxiappkotlin.util.SyncUtil.getSyncSingleTime
import cn.trans88.taxiappkotlin.util.YoungUtil
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.trs88.kurolibrary.execute.KuroExecutor
@ -38,6 +35,8 @@ import kotlinx.coroutines.Dispatchers
import okhttp3.internal.closeQuietly
import org.greenrobot.greendao.query.LazyList
import org.greenrobot.greendao.query.QueryBuilder
import java.lang.Exception
import java.lang.RuntimeException
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.LinkedBlockingQueue
@ -76,7 +75,7 @@ object Repository {
fun getAdvertiseTEST(): Advertise? {
synchronized(TaxiApp::class.java){
val list = myListMap[getTestPlayLevels()]
"广告数量:${list?.size}".loge()
"广告数量:${list?.size},currentListOrder:$currentListOrder".loge()
//#edit by ljh 2023/2/16
var advertise:Advertise? = null
val isTimedAdvertise = Configurations.config(taxiApp.activity).isTimedAdvertise
@ -90,7 +89,6 @@ object Repository {
}
}
fun getTestPlayCircularList(): MutableList<Advertise>? {
//#edit by ljh @2023/2/23
//如果正在播放的是多时段的定时广告,则返回定时广告的播放列表,否则返回不定时的播放列表
@ -283,7 +281,8 @@ object Repository {
taxiApp.timedAds
return AdvertiseType.GROUP.ordinal
}
if (list!!.size > 0) {
list?.let {
if (it.size > 0) {
val level = when(index){
AdvertiseType.AREA.ordinal -> "定点广告"
AdvertiseType.IDLE.ordinal -> "闲置广告"
@ -295,6 +294,7 @@ object Repository {
return index
}
}
}
YoungUtil.YoungLog("当前播放广告的等级:闲置广告")
return AdvertiseType.IDLE.ordinal
}
@ -305,7 +305,7 @@ object Repository {
*/
fun refreshMyList() {
synchronized(TaxiApp::class.java){
var daoAdvertises:LazyList<Advertise>? = null
var lazyList:LazyList<Advertise>? = null
try {
val currentTimeMillis = System.currentTimeMillis()
YoungUtil.YoungLog("refreshMyList 是否在主线程: ${Thread.currentThread().isMainThread()}")
@ -335,17 +335,35 @@ object Repository {
DaoUtil.getOrderDao().deleteAll()
// val daoAdvertises = DaoUtil.getAdvertise().queryBuilder().orderDesc(AdvertiseDao.Properties.CreateAt).list()
//#edit by ljh @2023/8/7 使用缓存加懒加载防止内存溢出,需要手动关闭close
daoAdvertises = DaoUtil.getAdvertise().queryBuilder().orderDesc(AdvertiseDao.Properties.CreateAt).listLazy()
//#edit by ljh @2023/8/7
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()
//edit by ljh @2023/9/1
if (daoAdvertises.size == 0){
"卡里没广告了,清除排序".logd()
Configurations.config(TaxiApp.instance()).advertiseOrderSave("")
}
val advertises = mutableListOf<Advertise>()
//定点广告list
// val builder:QueryBuilder<Advertise> = DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.BelongTo.eq(AdvertiseType.AREA.ordinal))
// val query = builder.buildCursor().query()
// query.isClosed
val area = DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.BelongTo.eq(AdvertiseType.AREA.ordinal)).list()
YoungUtil.YoungLog("定点广告数量:${area.size}")
if (Configurations.config(TaxiApp.instance()).advertiseOrder() != "" && area.size == 0) {
//#edit by ljh @2023/8/11
val areaCount = DaoUtil.getAdvertise().queryBuilder().where(AdvertiseDao.Properties.BelongTo.eq(AdvertiseType.AREA.ordinal)).count()
YoungUtil.YoungLog("定点广告数量:${areaCount}")
val order = Configurations.config(TaxiApp.instance()).advertiseOrder()
"orderJson:$order".logd()
if (order != "" && areaCount == 0L) {
val orderList = Gson().fromJson<AdvertiseOrder>(Configurations.config(TaxiApp.instance()).advertiseOrder()).advertise_order
YoungUtil.YoungLog("当前的播放顺序策略:${orderList.toString()}")
@ -363,12 +381,11 @@ object Repository {
advertises.addAll(daoAdvertises)
}
} else {
advertises.addAll(daoAdvertises)
for (daoAdvertise in daoAdvertises) {
advertises.add(daoAdvertise)
}
// advertises.addAll(daoAdvertises)
advertises.reverse()
// daoAdvertises.reverse()
// daoAdvertises.forEach {
// advertises.add(it)
// }
}
"advertises的广告数量${advertises.size}".loge()
for (index in 0 until advertises.size) {
@ -406,6 +423,8 @@ object Repository {
val daoAdvertise = DaoUtil.getAdvertise()
.queryBuilder().where(AdvertiseDao.Properties.Ad_id.eq(newAdvertise.ad_id.toString())).unique()
daoAdvertise.isTimedAd = true
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
DaoUtil.getAdvertise().update(daoAdvertise)
schedules.forEach {
val list = kotlin.collections.ArrayList<Int>()
@ -440,10 +459,13 @@ object Repository {
YoungUtil.YoungLog("广告不满足不加入播放列表:${newAdvertise.ad_id}")
}
}
} catch (e:Exception){
e.printStackTrace()
e.message?.loge()
refreshMyList()
} finally {
daoAdvertises?.let {
if (it.isClosed){
"close daoAdvertises".logd()
lazyList?.let {
if (!it.isClosed){
it.close()
}
}
@ -567,26 +589,5 @@ object Repository {
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.ext.logd
import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.model.*
import cn.trans88.taxiappkotlin.ui.advertise.AdvertiseType
import java.io.File
@ -170,6 +171,10 @@ object DaoUtil {
*/
@Synchronized
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()
getTimeSpan().queryBuilder().where(TimeSpanDao.Properties.AdvertiseId.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 latitude=0.0;
private boolean isDownloaded=false;
private boolean isDownloading=false;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,8 @@
package cn.trans88.taxiappkotlin.logic.network
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.util.Log
import cn.trans88.taxiappkotlin.Configurations
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.SANLE
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.model.CurrentPlayAdvertises
import cn.trans88.taxiappkotlin.util.KuroTimer
@ -17,14 +23,18 @@ import com.google.gson.Gson
import okhttp3.*
import okhttp3.OkHttpClient.Builder
import okio.ByteString
import java.util.*
import java.util.concurrent.TimeUnit
object WsManager {
private const val TAG = "WsManager"
private var okHttpClient: OkHttpClient? = 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 heartbeatTime: Long = 120 * 1000
private const val heartbeatTime: Long = 30 * 1000
@ -32,21 +42,56 @@ object WsManager {
private val heartbeatContext: String = "beat"
private var beatTimer:KuroTimer?=null
private var wsTimer:KuroTimer?=null
private var tryReconnectTimer:KuroTimer?=null
private var sendCurrentAdvertiseTimer:KuroTimer?=null
var isReceivePong = false
var isRegister = false
@Volatile
var mWebSocket: WebSocket? = null
@Volatile
var isConnected = false
private val reconnectRunnable = Runnable {
YoungUtil.YoungLog("Reconnecting with server......")
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() {
val testToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY5ZmE0ZTI1NzIzMDkzZGM5MGMwYTA0IiwiZGV2aWNlX2lkIjoieTZjLTMyMi00MDc5NiJ9.j8N1hRwYRq0bKScNe-xB8utsPUAuWEGUJMwCfLcv6D8"
// stopConnect()
okHttpClient = Builder()
.retryOnConnectionFailure(true) //如果没配置okhttp默认就是true
.build()
@ -54,28 +99,116 @@ object WsManager {
YoungUtil.YoungLog("长连接进行连接的token:${Configurations.config(TaxiApp.instance()).appToken()}")
mRequest = Request.Builder()
.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://192.168.43.191:2347/?auth_token=${Configurations.config(TaxiApp.instance()).appToken()}")
.build()
okHttpClient!!.newWebSocket(mRequest!!, object : WebSocketListener() {
override fun onClosed(webSocket: WebSocket, code: Int, reason: String) {
YoungUtil.YoungLog("onClosed connection closed : $reason")
super.onClosed(webSocket, code, reason)
startConnect()
if (beatTimer != null){
beatTimer!!.cancel()
beatTimer!!.purge()
beatTimer = null
// okHttpClient!!.newWebSocket(mRequest!!, object : WebSocketListener() {
//
// override fun onClosed(webSocket: WebSocket, code: Int, reason: String) {
// YoungUtil.YoungLog("连接关闭,关闭原因 onClosed connection closed : $reasoncode: $code")
// super.onClosed(webSocket, code, reason)
//
//// 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()
}
stopAllTimer()
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) {
//是当远程端暗示没有数据交互时回调(即此时准备关闭,但连接还没有关闭)
YoungUtil.YoungLog("onClosing connection closing :$reason")
super.onClosing(webSocket, code, reason)
}
override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
@ -96,10 +229,10 @@ object WsManager {
if (response != null) {
YoungUtil.YoungLog("onFailure response message :" + response.message)
}
// wsMainHandler.removeCallbacks(heartbeat)
if (!isConnected && !isRegister) {
tryReconnect()
}
}
override fun onMessage(webSocket: WebSocket, text: String) {
YoungUtil.YoungLog("onMessage message received: $text")
@ -120,90 +253,111 @@ object WsManager {
override fun onOpen(webSocket: WebSocket, response: Response) {
super.onOpen(webSocket, response)
YoungUtil.YoungLog("onOpen: connecting is open")
YoungUtil.YoungLog("onOpen: connecting is open Ws连接成功!")
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(){
//停止重连
if (tryReconnectTimer!=null){
tryReconnectTimer!!.cancel()
tryReconnectTimer!!.purge()
tryReconnectTimer =null
}
// tryReconnectTimer?.let {
// it.cancel()
// it.purge()
// }
//停止发送心跳
if (beatTimer!=null){
beatTimer!!.cancel()
beatTimer!!.purge()
beatTimer =null
}
// beatTimer?.let {
// it.cancel()
// it.purge()
// }
//停止发送广告信息
if (sendCurrentAdvertiseTimer!=null){
sendCurrentAdvertiseTimer!!.cancel()
sendCurrentAdvertiseTimer!!.purge()
sendCurrentAdvertiseTimer =null
sendCurrentAdvertiseTimer?.let {
it.cancel()
it.purge()
}
}
/**
* 重连
*/
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
//检测之前连接是否存在,存在则主动断开掉
try {
if (mWebSocket != null) {
YoungUtil.YoungLog("closing bad connection: 连接异常,关闭此连接重连")
// mWebSocket!!.cancel()
val close = mWebSocket!!.close(1006, "连接异常,关闭此连接重连")
mWebSocket?.cancel()
val close = mWebSocket!!.close(1000, "连接异常再次关闭关闭此连接10s后重连")
YoungUtil.YoungLog("webSocket是否正常关闭$close")
if (!close){
mWebSocket = null
}
} catch (e: Throwable) {
YoungUtil.YoungLog("断开连接异常:${e.message}")
}
tryReconnectTimer = KuroTimer()
// val timer = KuroTimer()
tryReconnectTimer!!.schedule(object : KuroTimerTask() {
wsTimer = KuroTimer()
wsTimer?.schedule(object :KuroTimerTask(){
override fun run() {
YoungUtil.YoungLog("Reconnecting with server......")
initWebSocket()
"wsTimer执行".logd()
startConnect()
}
},5000)
} catch (e: Throwable) {
e.printStackTrace()
YoungUtil.YoungLog("重连异常:${e.message}")
}
},reconnectTime)
// initWebSocket()
// tryReconnectTimer = KuroTimer()
//
// tryReconnectTimer!!.schedule(object : KuroTimerTask() {
// override fun run() {
// YoungUtil.YoungLog("Reconnecting with server......")
// initWebSocket()
// }
// },reconnectTime)
}
fun send(msg: String) {
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) {
stopAllTimer()
// stopAllTimer()
wsTimer?.let {
it.cancel()
it.purge()
}
wsTimer = null
try {
if (mWebSocket != null) {
YoungUtil.YoungLog("stopConnect: $msg")
// mWebSocket!!.cancel()
mWebSocket?.cancel()
val close = mWebSocket!!.close(code, msg)
YoungUtil.YoungLog("webSocket是否正常关闭$close")
}
@ -223,14 +377,19 @@ object WsManager {
Xixun.getCardId()
}
YoungUtil.YoungLog("heartbeat: $heartbeatContext , $cardId")
YoungUtil.YoungLog("send heartbeat: $heartbeatContext , $cardId")
if (beatTimer!=null){
beatTimer!!.cancel()
beatTimer!!.purge()
beatTimer =null
beatTimer?.let {
it.cancel()
it.purge()
}
// if (beatTimer!=null){
// beatTimer!!.cancel()
// beatTimer!!.purge()
// beatTimer =null
// }
beatTimer = KuroTimer()
// val timer = KuroTimer()
@ -262,11 +421,15 @@ object WsManager {
YoungUtil.YoungLog("当前在播放的广告: $currentAdvertises")
mWebSocket?.send(currentAdvertises) ?: throw IllegalArgumentException("mWebSocket is null not send!")
if (sendCurrentAdvertiseTimer!=null){
sendCurrentAdvertiseTimer!!.cancel()
sendCurrentAdvertiseTimer!!.purge()
sendCurrentAdvertiseTimer =null
sendCurrentAdvertiseTimer?.let {
it.cancel()
it.purge()
}
// if (sendCurrentAdvertiseTimer!=null){
// sendCurrentAdvertiseTimer!!.cancel()
// sendCurrentAdvertiseTimer!!.purge()
// sendCurrentAdvertiseTimer =null
// }
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.network.*
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.BusReceiver
import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.SubScreenType
@ -88,8 +89,10 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
if (VERSION.SDK_INT >= VERSION_CODES.P) {
setFlagHide()
}
//测试
Advertise().toString().loge()
// Advertise().toString().loge()
setContentView(R.layout.activity_main)
//读取保留的配置文件
@ -466,7 +469,9 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
*/
fun timeRefreshAdvertise() {
YoungUtil.YoungLog("定时刷新广告")
if (Repository.getTestPlayLevels() != AdvertiseType.AREA.ordinal){
RefreshPlayer.refresh()
}
MainHandler.postDelay(10 * 60 * 1000, Runnable {
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.getAdvertise
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.GpsReceiver
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.YoungUtil
import kotlinx.android.synthetic.main.activity_main.*
import org.greenrobot.greendao.query.LazyList
import java.io.ByteArrayOutputStream
import java.util.*
@ -105,7 +107,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
private var curAdvertise: Advertise? = null
// private var nextAdvertise: Advertise? = null
@Volatile
private var curLocation: Location? = null
private var curLongitude: Double = 0.0
@ -286,6 +288,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
"${advertise.ad_id}定时轮播".loge()
val daoAdvertise = getAdvertise().queryBuilder().where(Properties.Ad_id.eq(advertise.ad_id.toString())).unique()
daoAdvertise.isTimedAd = false
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
getAdvertise().update(daoAdvertise)
try {
RefreshPlayer.refresh()
@ -319,6 +323,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
} else {
val daoAdvertise = getAdvertise().queryBuilder().where(Properties.Ad_id.eq(advertise.ad_id.toString())).unique()
daoAdvertise.isTimedAd = true
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
getAdvertise().update(daoAdvertise)
try {
RefreshPlayer.refresh()
@ -586,17 +592,31 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//用来防止有多余的view没有删除。
if (fl_play.childCount > 1) {
fl_play.postDelayed({
fl_play.post {
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)
}
// 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}")
}
}
@ -834,14 +854,17 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
override fun onSpeedChanged(speed: Float) {
}
//缓存开关小于0时从数据库重新获取
private var regionCacheSwitch = 8888
/**
* 当坐标位置变化时触发
*/
override fun onLocationChanged(longitude: Double, latitude: Double, bearing: Float, speed: Float, satelliteNumber: Int) {
// KuroExecutor.execute(runnable = Runnable {
ThreadUtil.executeByPool(
// ThreadUtil.executeByPool(
//edit by ljh @2023/8/16
ThreadUtil.executeBySingleThread2(
Runnable {
synchronized(this) {
if (satelliteNumber == 0) {
@ -856,7 +879,23 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
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()
for (region in regions) {
"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}")
region.isInRegion = true
//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)) {
YoungUtil.YoungLog("进圈但已经存在广告,不再添加")
@ -884,6 +937,9 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
if(positionAdvertise != null) {
val advertise = setAdvertiseByPosition(positionAdvertise, region.id, longitude, latitude)
DaoUtil.getAdvertise().insert(advertise)
//edit by ljh @2023/8/15
taxiApp.daoAds.clear()
RefreshPlayer.refresh()
} else {
YoungUtil.YoungLog("positionAdvertise is null");
@ -892,7 +948,28 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
YoungUtil.YoungLog("没进圈 regionId: ${region.id}")
if (isHavePositionAdvertise(region)) {
region.isInRegion = false
//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()
.executeDeleteWithoutDetachingEntities()
@ -901,6 +978,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
}
}
}
}
if(locationTimer!=null){
@ -926,6 +1004,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
fun clearAreaAdvertise() {
val list = getAdvertise().queryBuilder().where(Properties.BelongTo.eq(AREA.ordinal)).list()
list?.let {
//edit by ljh @2023/8/11
taxiApp.daoAds.clear()
for (advertise in it) {
getAdvertise().delete(advertise)
try {
@ -935,10 +1015,10 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
}
}
}
}
private fun saveLocation(longitude: Double, latitude: Double, bearing: Float, speed: Float) {
synchronized(this) {
if (curLocation == null) {
YoungUtil.YoungLog("当前curLocation == null")
val location = Location().apply {
@ -956,11 +1036,12 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
if (curLocation?.longitude?.toDouble() != longitude || curLocation?.latitude?.toDouble() != latitude) {
//YoungUtil.YoungLog("当前位置不相等${curLocation.toString()},当前longitude =$longitude,latitude =$latitude")
val distanceLocation = DistanceUtil.getDistance(curLocation!!.latitude, curLocation!!.longitude, latitude, longitude)
if (distanceLocation > 50) {
//edit by ljh@2023/8/22
if (distanceLocation > 20) {
// edit by yzd @20211201
// if (Settings.gpsSwitch) {
if (Configurations.config(TaxiApp.instance()).gpsSwitch()) {
YoungUtil.YoungLog("当前位置坐标距离上一个点大于50记录")
YoungUtil.YoungLog("当前位置坐标距离上一个点大于20记录")
val location = Location().apply {
timestamp = System.currentTimeMillis()
setLongitude(longitude)
@ -973,10 +1054,14 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
elapse = timestamp - curLocation?.timestamp!!
}
//过滤掉距离过大的数据edit by ljh 2023/8/8
if (location.distance < 10 * 1000){
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) {
@ -997,7 +1082,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
}
}
} else {
YoungUtil.YoungLog("当前位置坐标距离上一个点小于50不记录")
YoungUtil.YoungLog("当前位置坐标距离上一个点小于20不记录")
return
}
} else {
@ -1005,7 +1090,6 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
}
}
}
}
/**
* 判断是否当前是否已经在播当前区域的定点广告
@ -1017,10 +1101,14 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
if (advertiseList.size > 1) {
for (index in 0 until advertiseList.size) {
//edit by ljh @2023/8/31
taxiApp.removeCacheAd(advertiseList[index])
DaoUtil.getAdvertise().delete(advertiseList[index])
//todo 不一定是线程冲突造成
YoungUtil.YoungLog("线程冲突造成定点广告重复,删除多余的广告")
}
} else {
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.DaoUtil
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.model.Advertise
import cn.trans88.taxiappkotlin.logic.model.PositionAdvertise
@ -50,6 +51,8 @@ fun Advertise.isReady(): Boolean {
advertise.setIsDownloading(false)
advertise.setIsDownloaded(false)
getAdvertise().update(advertise)
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
downloadFile()
ready = false
}
@ -61,6 +64,8 @@ fun Advertise.isReady(): Boolean {
advertise.setIsDownloading(false)
advertise.setIsDownloaded(false)
getAdvertise().update(advertise)
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
downloadFile()
}
ready = false

View File

@ -86,4 +86,14 @@ public class DateUtil {
// System.out.println("secondDate:"+dateTimeFormat.format(secondDate));
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
import android.content.Context
import cn.trans88.taxiappkotlin.Configurations
import cn.trans88.taxiappkotlin.TaxiApp
import cn.trans88.taxiappkotlin.ext.logd
@ -7,6 +8,7 @@ import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.model.BackgroundType
import com.google.gson.Gson
import java.io.File
import java.io.IOException
/**
*
@ -39,4 +41,7 @@ object FileUtil {
"找不到临时文件或文件已恢复".logd()
}
}
}

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.
# For customization when using a Version Control System, please read the
# 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

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":{}}]