Compare commits

...

10 Commits

Author SHA1 Message Date
sxy0 3ead09d554 update .gitignore 2024-11-05 18:49:59 +08:00
sxy0 5d69dd845c Add .gitignore file 2024-11-05 18:46:47 +08:00
刘金华 421517c248 优化运行日志上传 2024-06-29 16:35:58 +08:00
刘金华 37924fa2b5 修复有计次广告的时候重启后过了好几分钟才播的问题 2024-06-21 14:13:17 +08:00
刘金华 96376ed7fc 修复收到gps卫星数量为0时重复刷新问题 2024-04-19 16:46:39 +08:00
刘金华 a361a2c11c 新增软解码切换功能 2024-03-21 17:42:43 +08:00
刘金华 1c2cdacadb 新增软解码切换功能 2024-03-20 10:19:51 +08:00
刘金华 12c46700d6 修复设置上传周期失败问题 2023-12-21 16:17:15 +08:00
刘金华 057c386556 新增设置日志上传周期,默认是一天传一次 2023-12-13 15:43:00 +08:00
刘金华 71c6f658fd 优化定点广告切换黑屏问题 2023-12-12 16:29:08 +08:00
74 changed files with 2335 additions and 387 deletions

41
.gitignore vendored Normal file
View File

@ -0,0 +1,41 @@
.gradle/
.idea/
release/
build/
debug/
his-version-apk
# ---> Android
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
google-services.json
# Android Profiling
*.hprof

View File

@ -1,2 +1,2 @@
#Thu Sep 14 18:07:54 GMT+08:00 2023 #Tue Jun 25 17:25:11 GMT+08:00 2024
gradle.version=5.6.4 gradle.version=5.6.4

View File

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: androidx.room:room-common:2.2.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.room/room-common/2.2.5/f5e3b73a0c2ab5e276e26868e4ce3542baede207/room-common-2.2.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.room/room-common/2.2.5/924310c61a30c7a167a22f636331556bc654ec94/room-common-2.2.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Gradle: androidx.test.services:storage:1.4.0@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/3ae6e141069f76b9dd24050149524d9d/jetified-storage-1.4.0/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/3ae6e141069f76b9dd24050149524d9d/jetified-storage-1.4.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/3ae6e141069f76b9dd24050149524d9d/jetified-storage-1.4.0/AndroidManifest.xml" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.test.services/storage/1.4.0/27088f46bc0ab94523a20ccc56aa27e142662396/storage-1.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -16,6 +16,24 @@
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad67766727e8b516aa8b11db6408390f/jetified-debug-db-base-1.0.6/res" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad67766727e8b516aa8b11db6408390f/jetified-debug-db-base-1.0.6/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad67766727e8b516aa8b11db6408390f/jetified-debug-db-base-1.0.6/AndroidManifest.xml" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad67766727e8b516aa8b11db6408390f/jetified-debug-db-base-1.0.6/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad67766727e8b516aa8b11db6408390f/jetified-debug-db-base-1.0.6/jars/classes.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad67766727e8b516aa8b11db6408390f/jetified-debug-db-base-1.0.6/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/000d0a739247410c745f8b5cfc291dbb/jetified-debug-db-base-1.0.6/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/000d0a739247410c745f8b5cfc291dbb/jetified-debug-db-base-1.0.6/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/000d0a739247410c745f8b5cfc291dbb/jetified-debug-db-base-1.0.6/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4ddbfcbe0013ceaa7e5a6631cd5f6ef5/jetified-debug-db-base-1.0.6/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4ddbfcbe0013ceaa7e5a6631cd5f6ef5/jetified-debug-db-base-1.0.6/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4ddbfcbe0013ceaa7e5a6631cd5f6ef5/jetified-debug-db-base-1.0.6/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e310a8b89f2d8ba2f75dc3a1729e8b2a/jetified-debug-db-base-1.0.6/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e310a8b89f2d8ba2f75dc3a1729e8b2a/jetified-debug-db-base-1.0.6/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e310a8b89f2d8ba2f75dc3a1729e8b2a/jetified-debug-db-base-1.0.6/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/66c4a999c6f6d70833d2c8f86bcf185d/jetified-debug-db-base-1.0.6/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/66c4a999c6f6d70833d2c8f86bcf185d/jetified-debug-db-base-1.0.6/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/66c4a999c6f6d70833d2c8f86bcf185d/jetified-debug-db-base-1.0.6/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/50940156addf6bddb76e95ed727c8bee/jetified-debug-db-base-1.0.6/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/50940156addf6bddb76e95ed727c8bee/jetified-debug-db-base-1.0.6/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/50940156addf6bddb76e95ed727c8bee/jetified-debug-db-base-1.0.6/jars/classes.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/14ef4c0cf733cf117ddea4bb23fad05f/jetified-debug-db-base-1.0.6/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/14ef4c0cf733cf117ddea4bb23fad05f/jetified-debug-db-base-1.0.6/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/14ef4c0cf733cf117ddea4bb23fad05f/jetified-debug-db-base-1.0.6/res" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.amitshekhar.android/debug-db-base/1.0.6/43c6abb777258b8e02b7a4f4aef44f5996ddf30f/debug-db-base-1.0.6-javadoc.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.amitshekhar.android/debug-db-base/1.0.6/43c6abb777258b8e02b7a4f4aef44f5996ddf30f/debug-db-base-1.0.6-javadoc.jar!/" />

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.andkulikov:transitionseverywhere:2.0.0-beta01@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/10ea8aa4f6e092ff2f55dabcec7eb0a9/jetified-transitionseverywhere-2.0.0-beta01/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/10ea8aa4f6e092ff2f55dabcec7eb0a9/jetified-transitionseverywhere-2.0.0-beta01/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/10ea8aa4f6e092ff2f55dabcec7eb0a9/jetified-transitionseverywhere-2.0.0-beta01/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.andkulikov/transitionseverywhere/2.0.0-beta01/1cc96719538e8a0d18a71d74a3c998e3df9228e9/transitionseverywhere-2.0.0-beta01-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.andkulikov/transitionseverywhere/2.0.0-beta01/3d8df039674a1e242e675f386b2dd65f7d9f1625/transitionseverywhere-2.0.0-beta01-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -6,6 +6,13 @@
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/62035fcaa1eb865fcb157c3556d5e2c8/jetified-stetho-1.5.1/annotations.zip!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/62035fcaa1eb865fcb157c3556d5e2c8/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad36d5a34233c7fa29ad3770971d35c6/jetified-stetho-1.5.1/annotations.zip!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad36d5a34233c7fa29ad3770971d35c6/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/annotations.zip!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/083aec472dafcfc3b0c0d766cd43b137/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/887f6708c215f50988e88d72cdabde59/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/cccd8aa5fc5dd56698cef82da605b812/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/69ab993d74cceb064b535055353ca0cb/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ea069d680a452b2b20ed9f28da603030/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/440f81a160906a9defe08b476792ce98/jetified-stetho-1.5.1/annotations.zip!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b2fc26a486b08ed641398608a6b45164/jetified-stetho-1.5.1/annotations.zip!/" />
</ANNOTATIONS> </ANNOTATIONS>
<CLASSES> <CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/d20b09848ce936fd0a38f787548625fb/jetified-stetho-1.5.1/jars/classes.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/d20b09848ce936fd0a38f787548625fb/jetified-stetho-1.5.1/jars/classes.jar!/" />
@ -23,6 +30,27 @@
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/AndroidManifest.xml" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/res" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/jars/classes.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4d8a2b6516214c37dd58d58e9a7f5172/jetified-stetho-1.5.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/083aec472dafcfc3b0c0d766cd43b137/jetified-stetho-1.5.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/083aec472dafcfc3b0c0d766cd43b137/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/083aec472dafcfc3b0c0d766cd43b137/jetified-stetho-1.5.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/887f6708c215f50988e88d72cdabde59/jetified-stetho-1.5.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/887f6708c215f50988e88d72cdabde59/jetified-stetho-1.5.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/887f6708c215f50988e88d72cdabde59/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/cccd8aa5fc5dd56698cef82da605b812/jetified-stetho-1.5.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/cccd8aa5fc5dd56698cef82da605b812/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/cccd8aa5fc5dd56698cef82da605b812/jetified-stetho-1.5.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/69ab993d74cceb064b535055353ca0cb/jetified-stetho-1.5.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/69ab993d74cceb064b535055353ca0cb/jetified-stetho-1.5.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/69ab993d74cceb064b535055353ca0cb/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ea069d680a452b2b20ed9f28da603030/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ea069d680a452b2b20ed9f28da603030/jetified-stetho-1.5.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ea069d680a452b2b20ed9f28da603030/jetified-stetho-1.5.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/440f81a160906a9defe08b476792ce98/jetified-stetho-1.5.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/440f81a160906a9defe08b476792ce98/jetified-stetho-1.5.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/440f81a160906a9defe08b476792ce98/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b2fc26a486b08ed641398608a6b45164/jetified-stetho-1.5.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b2fc26a486b08ed641398608a6b45164/jetified-stetho-1.5.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b2fc26a486b08ed641398608a6b45164/jetified-stetho-1.5.1/jars/classes.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.facebook.stetho/stetho/1.5.1/b71856fcb682e807ccec3a276e47c94944b6c6ea/stetho-1.5.1-javadoc.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.facebook.stetho/stetho/1.5.1/b71856fcb682e807ccec3a276e47c94944b6c6ea/stetho-1.5.1-javadoc.jar!/" />

View File

@ -16,6 +16,27 @@
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/34c9268e89b7e26ed7d2a6d2fbc7372d/jetified-GreenDaoUpgradeHelper-v2.2.1/res" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/34c9268e89b7e26ed7d2a6d2fbc7372d/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/34c9268e89b7e26ed7d2a6d2fbc7372d/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/34c9268e89b7e26ed7d2a6d2fbc7372d/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/34c9268e89b7e26ed7d2a6d2fbc7372d/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/34c9268e89b7e26ed7d2a6d2fbc7372d/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7f2036a595ce5b219144e3375ddac139/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7f2036a595ce5b219144e3375ddac139/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7f2036a595ce5b219144e3375ddac139/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/19787c79412530f7cf41ba98e3cf4503/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/19787c79412530f7cf41ba98e3cf4503/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/19787c79412530f7cf41ba98e3cf4503/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0b4a4104fa2fea365d8bad6f5dfd0a29/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0b4a4104fa2fea365d8bad6f5dfd0a29/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0b4a4104fa2fea365d8bad6f5dfd0a29/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1c32e92e942e346fa72f85577fbd57cb/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1c32e92e942e346fa72f85577fbd57cb/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1c32e92e942e346fa72f85577fbd57cb/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/6bb8df3919283efc1f3f23f8c7562b55/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/6bb8df3919283efc1f3f23f8c7562b55/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/6bb8df3919283efc1f3f23f8c7562b55/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9f2d89654525734f9df46f8b0c86ea98/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9f2d89654525734f9df46f8b0c86ea98/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9f2d89654525734f9df46f8b0c86ea98/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/335eb90c2c2079801ad2d1562688d085/jetified-GreenDaoUpgradeHelper-v2.2.1/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/335eb90c2c2079801ad2d1562688d085/jetified-GreenDaoUpgradeHelper-v2.2.1/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/335eb90c2c2079801ad2d1562688d085/jetified-GreenDaoUpgradeHelper-v2.2.1/jars/classes.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.yuweiguocn/GreenDaoUpgradeHelper/v2.2.1/7aef2e7b4c18afb240f0e17af5d045f176d2b8ef/GreenDaoUpgradeHelper-v2.2.1-javadoc.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.yuweiguocn/GreenDaoUpgradeHelper/v2.2.1/7aef2e7b4c18afb240f0e17af5d045f176d2b8ef/GreenDaoUpgradeHelper-v2.2.1-javadoc.jar!/" />

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.google.android.exoplayer:exoplayer:r1.5.11@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/790c62dbd20241bc524dd54d3ef19633/jetified-exoplayer-r1.5.11/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/790c62dbd20241bc524dd54d3ef19633/jetified-exoplayer-r1.5.11/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/790c62dbd20241bc524dd54d3ef19633/jetified-exoplayer-r1.5.11/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.android.exoplayer/exoplayer/r1.5.11/51c6408ed7fb546c19d6b6f5c8b21d3a559842f1/exoplayer-r1.5.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.android.exoplayer/exoplayer/r1.5.11/5bb43348bca48bf6567a206024acdbcb23f4a990/exoplayer-r1.5.11-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Gradle: com.jakewharton:disklrucache:2.0.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jakewharton/disklrucache/2.0.2/93b399470e72c0bc8cb52379943b63c9aa586cd8/disklrucache-2.0.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jakewharton/disklrucache/2.0.2/a0405f093a7fa9000f68ba5a8db11f4a01d827d9/disklrucache-2.0.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jakewharton/disklrucache/2.0.2/a8b600c9a1d9f75cdc45bb1b24b4731845a7658b/disklrucache-2.0.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -16,6 +16,27 @@
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8acd84ed04507b25ad4ab1f092095a58/jetified-logger-2.2.0/jars/classes.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8acd84ed04507b25ad4ab1f092095a58/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8acd84ed04507b25ad4ab1f092095a58/jetified-logger-2.2.0/res" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8acd84ed04507b25ad4ab1f092095a58/jetified-logger-2.2.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8acd84ed04507b25ad4ab1f092095a58/jetified-logger-2.2.0/AndroidManifest.xml" /> <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8acd84ed04507b25ad4ab1f092095a58/jetified-logger-2.2.0/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad5dbc95019bd8e49004e8b34c57b5cc/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad5dbc95019bd8e49004e8b34c57b5cc/jetified-logger-2.2.0/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ad5dbc95019bd8e49004e8b34c57b5cc/jetified-logger-2.2.0/res" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/3c61309d95eba32c83569838bd6eb73d/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/3c61309d95eba32c83569838bd6eb73d/jetified-logger-2.2.0/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/3c61309d95eba32c83569838bd6eb73d/jetified-logger-2.2.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/94dd3650c1dd350610ff6179bb68c164/jetified-logger-2.2.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/94dd3650c1dd350610ff6179bb68c164/jetified-logger-2.2.0/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/94dd3650c1dd350610ff6179bb68c164/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1adbba6365c42fc22a765dabaf2bf186/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1adbba6365c42fc22a765dabaf2bf186/jetified-logger-2.2.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1adbba6365c42fc22a765dabaf2bf186/jetified-logger-2.2.0/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2c7174e836587cce110bf07de8a9d247/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2c7174e836587cce110bf07de8a9d247/jetified-logger-2.2.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2c7174e836587cce110bf07de8a9d247/jetified-logger-2.2.0/AndroidManifest.xml" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/590a8d0b56e7f81871a8e48271d0a8db/jetified-logger-2.2.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/590a8d0b56e7f81871a8e48271d0a8db/jetified-logger-2.2.0/AndroidManifest.xml" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/590a8d0b56e7f81871a8e48271d0a8db/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8ccd565971f02f2b178029a4f4566ab1/jetified-logger-2.2.0/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8ccd565971f02f2b178029a4f4566ab1/jetified-logger-2.2.0/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8ccd565971f02f2b178029a4f4566ab1/jetified-logger-2.2.0/AndroidManifest.xml" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.orhanobut/logger/2.2.0/98e69754ab23f7179137d8d2a0e3eea79200d746/logger-2.2.0-javadoc.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.orhanobut/logger/2.2.0/98e69754ab23f7179137d8d2a0e3eea79200d746/logger-2.2.0-javadoc.jar!/" />

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyVideoPlayer-arm64:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0a8bc628c5c2b59e5803dd252d230c69/jetified-gsyVideoPlayer-arm64-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0a8bc628c5c2b59e5803dd252d230c69/jetified-gsyVideoPlayer-arm64-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0a8bc628c5c2b59e5803dd252d230c69/jetified-gsyVideoPlayer-arm64-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-arm64/8.1.2/c6f27a359eb8fe4c2d26e0c786323ff027204ba7/gsyVideoPlayer-arm64-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-arm64/8.1.2/4d37565f790e60f0d875452224f40cfd8a050be2/gsyVideoPlayer-arm64-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyVideoPlayer-armv5:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b360dda17d7d2dabffa05706dc38e9c5/jetified-gsyVideoPlayer-armv5-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b360dda17d7d2dabffa05706dc38e9c5/jetified-gsyVideoPlayer-armv5-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b360dda17d7d2dabffa05706dc38e9c5/jetified-gsyVideoPlayer-armv5-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-armv5/8.1.2/80149f6a5bf76ba29c8067173600f6d1b3607ca2/gsyVideoPlayer-armv5-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-armv5/8.1.2/4d9b627b40d7ac32c2a4f165fcef0707787dfc81/gsyVideoPlayer-armv5-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyVideoPlayer-armv7a:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1a0615481ecb85d0cb83348dd9df58dc/jetified-gsyVideoPlayer-armv7a-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1a0615481ecb85d0cb83348dd9df58dc/jetified-gsyVideoPlayer-armv7a-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1a0615481ecb85d0cb83348dd9df58dc/jetified-gsyVideoPlayer-armv7a-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-armv7a/8.1.2/cd1b87b0f3c507abd5b9e51da344b590af1141c1/gsyVideoPlayer-armv7a-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-armv7a/8.1.2/3ccfc3d7981f9a925a069db589a1450857144386/gsyVideoPlayer-armv7a-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyVideoPlayer-base:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2b3dc07e55269a31ad24bd8b19352261/jetified-gsyVideoPlayer-base-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2b3dc07e55269a31ad24bd8b19352261/jetified-gsyVideoPlayer-base-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2b3dc07e55269a31ad24bd8b19352261/jetified-gsyVideoPlayer-base-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-base/8.1.2/d8d7811290044edab5f9070bbdd0926044ff404c/gsyVideoPlayer-base-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-base/8.1.2/5767ca223e495bf5ef9630a4f4d172ab64eb0665/gsyVideoPlayer-base-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyVideoPlayer-java:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/991b63861e192385d2a45317518c9ae6/jetified-gsyVideoPlayer-java-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/991b63861e192385d2a45317518c9ae6/jetified-gsyVideoPlayer-java-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/991b63861e192385d2a45317518c9ae6/jetified-gsyVideoPlayer-java-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-java/8.1.2/42f025c9609037f4ea2c63721987c6df76c1e06/gsyVideoPlayer-java-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-java/8.1.2/908aad69d136a466aa392a45ddd5c17ae8126946/gsyVideoPlayer-java-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyVideoPlayer-x64:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5eae8ee142e4c872b46a2bed9193c2fd/jetified-gsyVideoPlayer-x64-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5eae8ee142e4c872b46a2bed9193c2fd/jetified-gsyVideoPlayer-x64-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5eae8ee142e4c872b46a2bed9193c2fd/jetified-gsyVideoPlayer-x64-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-x64/8.1.2/8862c43f4332e5a59c532a69d568dc5be87abaa5/gsyVideoPlayer-x64-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-x64/8.1.2/dd3ead2ad18092a247a25f6d719b162b0a65be23/gsyVideoPlayer-x64-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyVideoPlayer-x86:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9629325aebcbe5ec806a7df2072bba58/jetified-gsyVideoPlayer-x86-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9629325aebcbe5ec806a7df2072bba58/jetified-gsyVideoPlayer-x86-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9629325aebcbe5ec806a7df2072bba58/jetified-gsyVideoPlayer-x86-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-x86/8.1.2/4f26ab09538d4ccbbda6eb3eb70eea1ebe52f9c8/gsyVideoPlayer-x86-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyVideoPlayer-x86/8.1.2/6fb69f7cfcd70a9d16c27983f775c545aff09035/gsyVideoPlayer-x86-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.shuyu:gsyvideoplayer-androidvideocache:8.1.2@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0a94de07336996d2e58928d8758c5c0e/jetified-gsyvideoplayer-androidvideocache-8.1.2/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0a94de07336996d2e58928d8758c5c0e/jetified-gsyvideoplayer-androidvideocache-8.1.2/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0a94de07336996d2e58928d8758c5c0e/jetified-gsyvideoplayer-androidvideocache-8.1.2/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyvideoplayer-androidvideocache/8.1.2/f3a37151911860bd9c81de39aa5cdbb062fc096a/gsyvideoplayer-androidvideocache-8.1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.shuyu/gsyvideoplayer-androidvideocache/8.1.2/f0094ffb27578e8850fc573b52af6624948ad744/gsyvideoplayer-androidvideocache-8.1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Gradle: com.zhouyou:rxeasyhttp:2.1.5@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7af653fe83e0e90c9b7886840ceae684/jetified-rxeasyhttp-2.1.5/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7af653fe83e0e90c9b7886840ceae684/jetified-rxeasyhttp-2.1.5/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7af653fe83e0e90c9b7886840ceae684/jetified-rxeasyhttp-2.1.5/AndroidManifest.xml" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.zhouyou/rxeasyhttp/2.1.5/7a0a1d0738c5f8c0a5286cc09e929e5cf7667954/rxeasyhttp-2.1.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.zhouyou/rxeasyhttp/2.1.5/6e05ef8e11293e988d7e27bf8228dd3e1d6efb53/rxeasyhttp-2.1.5-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: tv.danmaku.ijk.media:ijkplayer-exo:0.8.8@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/42d9a1858575c38fe01b9ac6560613d1/jetified-ijkplayer-exo-0.8.8/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/42d9a1858575c38fe01b9ac6560613d1/jetified-ijkplayer-exo-0.8.8/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/42d9a1858575c38fe01b9ac6560613d1/jetified-ijkplayer-exo-0.8.8/AndroidManifest.xml" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: tv.danmaku.ijk.media:ijkplayer-java:0.8.8@aar">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/97d6ec940fa9fe8f3f7d9f6c67d24115/jetified-ijkplayer-java-0.8.8/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/97d6ec940fa9fe8f3f7d9f6c67d24115/jetified-ijkplayer-java-0.8.8/res" />
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/97d6ec940fa9fe8f3f7d9f6c67d24115/jetified-ijkplayer-java-0.8.8/AndroidManifest.xml" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,8 +21,8 @@ android {
applicationId "net.sysolution.taxiapp" applicationId "net.sysolution.taxiapp"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 240 versionCode 257
versionName "3.3.3-beta26.3.9.97-debug" versionName "3.3.3-beta26.4.1.4-release"
//alphaxx - ,bug //alphaxx - ,bug
//Betaxx - //Betaxx -
@ -58,7 +58,14 @@ android {
3.3.3-beta26.3.9.3.94 gps开关查询广 3.3.3-beta26.3.9.3.94 gps开关查询广
3.3.3-beta26.3.9.3.95 3.3.3-beta26.3.9.3.95
26.3.9.96 广 26.3.9.96 广
26.3.9.97 taxiApp当天的运行时间 26.3.9.98 taxiApp当天的运行时间
26.3.9.99
广z繁切换会出现黑屏问题
3.3.3-beta26.4.0.6-release GPS,
3.3.3-beta26.4.0.7-release GPS上报2502508
3.3.3-beta26.4.1.2-release GPS卫星数量为0时频繁刷新问题
3.3.3-beta26.4.1.4-release GPS日志时100gps日志时2
3.3.3-beta26.4.1.5-release 广
**/ **/
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -111,7 +118,7 @@ android {
// //
greendao { greendao {
schemaVersion 44 schemaVersion 46
daoPackage 'cn.trans88.taxiappkotlin.logic.dao' daoPackage 'cn.trans88.taxiappkotlin.logic.dao'
targetGenDir 'src/main/java' targetGenDir 'src/main/java'
} }
@ -142,6 +149,8 @@ dependencies {
// //
implementation 'com.amitshekhar.android:debug-db:1.0.6' implementation 'com.amitshekhar.android:debug-db:1.0.6'
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
//logger //logger
implementation 'com.orhanobut:logger:2.2.0' implementation 'com.orhanobut:logger:2.2.0'
@ -172,7 +181,6 @@ dependencies {
// implementation 'androidx.room:room-runtime:2.2.5'//room // implementation 'androidx.room:room-runtime:2.2.5'//room
// kapt "androidx.room:room-compiler:2.2.5" // kapt "androidx.room:room-compiler:2.2.5"
//lifecycle协程 //lifecycle协程
implementation "androidx.lifecycle:lifecycle-livedata-core-ktx:$livedata" implementation "androidx.lifecycle:lifecycle-livedata-core-ktx:$livedata"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$livedata" implementation "androidx.lifecycle:lifecycle-livedata-ktx:$livedata"
@ -206,4 +214,14 @@ dependencies {
// implementation 'com.google.android.exoplayer:exoplayer-ui:2.14.2' // implementation 'com.google.android.exoplayer:exoplayer-ui:2.14.2'
// implementation 'com.github.Trans88:KuroLibrary:0.1.3' // implementation 'com.github.Trans88:KuroLibrary:0.1.3'
implementation 'com.zhouyou:rxeasyhttp:2.1.5'
implementation 'com.shuyu:gsyVideoPlayer-java:8.1.2'
//ijk模式的so
implementation 'com.shuyu:gsyVideoPlayer-armv5:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-armv7a:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-arm64:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-x64:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-x86:8.1.2'
} }

View File

@ -351,6 +351,18 @@ public class Configurations {
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isCustomLogo", b).apply(); context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isCustomLogo", b).apply();
} }
/**
* 是否使用软解码
* @return
*/
public boolean isSoftDecode(){
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("isSoftDecode", false);
}
public void isSoftDecodeSave(Boolean b){
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isSoftDecode", b).apply();
}
/** /**
* taxiApp开始运行时间 * taxiApp开始运行时间
* @return * @return
@ -375,16 +387,28 @@ public class Configurations {
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("endRunTime", startTime).apply(); context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("endRunTime", startTime).apply();
} }
/**
* taxiApp每次启动的总运行时间
* @return
*/
public Long sumRunTime(){
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("sumRunTime",0);
}
public void sumRunTimeSave(long runtime){
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("sumRunTime", runtime).apply();
}
/** /**
* taxiApp当天总的运行时间 * taxiApp当天总的运行时间
* @return * @return
*/ */
public long sumRunTime(){ public Long todaySumRunTime(){
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("sumRunTime",0L); return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("todaySumRunTime",0);
} }
public void sumRunTimeSave(Long startTime){ public void todaySumRunTimeSave(long runtime){
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("sumRunTime", startTime).apply(); context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("todaySumRunTime", runtime).apply();
} }
public String runtimeJsonString(){ public String runtimeJsonString(){
@ -396,6 +420,48 @@ public class Configurations {
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("runtimeJsonString", s).apply(); context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("runtimeJsonString", s).apply();
} }
public String logSummaryJsonString(){
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("logSummaryJsonString", "");
}
public void logSummaryJsonStringSave(String s){
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("logSummaryJsonString", s).apply();
}
/**
* taxiApp当天第一次运行时间
* @return
*/
public long firstRunTime(){
long defaultValue = System.currentTimeMillis();
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("firstRunTime",defaultValue);
}
public void firstRunTimeSave(Long runTime){
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("firstRunTime", runTime).apply();
}
/**
* 日志概要上传的周期默认一天传一次单位分钟
* @return
*/
public int logInterval(){
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getInt("logInterval", 0);
}
public void logIntervalSave(int logInterval){
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putInt("logInterval", logInterval).apply();
}
public String progressList(){
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("progressList", "");
}
public void progressListSave(String s){
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("progressList", s).apply();
}
} }

View File

@ -15,6 +15,7 @@ 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.AdvertiseProcess
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.model.Regions
import cn.trans88.taxiappkotlin.logic.network.JoeyDownloadManager import cn.trans88.taxiappkotlin.logic.network.JoeyDownloadManager
@ -26,14 +27,20 @@ import cn.trans88.taxiappkotlin.util.KuroTimer
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.shuyu.gsyvideoplayer.player.IjkPlayerManager
import com.shuyu.gsyvideoplayer.player.PlayerFactory
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
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 com.zhouyou.http.EasyHttp
import io.reactivex.plugins.RxJavaPlugins import io.reactivex.plugins.RxJavaPlugins
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.* import java.io.*
import java.util.* import java.util.*
import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.CopyOnWriteArrayList
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
import kotlin.collections.HashMap import kotlin.collections.HashMap
import kotlin.collections.HashSet
class TaxiApp:Application() { class TaxiApp:Application() {
@ -62,12 +69,16 @@ class TaxiApp:Application() {
val timerTaskMap = HashMap<String,kotlin.collections.ArrayList<TimerTask>>() val timerTaskMap = HashMap<String,kotlin.collections.ArrayList<TimerTask>>()
//存储定时广告的列表 //存储定时广告的列表
var timedAds:ArrayList<Advertise> = ArrayList() var timedAds:ArrayList<Advertise> = ArrayList()
//存储未上传成功的下载进度
var processList:HashSet<AdvertiseProcess> = HashSet()
var activity:PlayActivity? = null var activity:PlayActivity? = null
//gps日志定时器 //gps日志定时器
var gpsTimer: Timer? = null var gpsTimer: Timer? = null
//播放日志定时器 //存储静止点坐标定时器
var playerLogTimer: Timer? = null var quietGpsTimer: Timer? = null
//播放日志摘要定时器
var playerLogSummaryTimer: Timer? = null
var testCount = 0 var testCount = 0
val TAG = "TaxiApp" val TAG = "TaxiApp"
@ -75,7 +86,12 @@ class TaxiApp:Application() {
// 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
var sendLogTimes = 0
var isPositionRefresh = false
//是否软解码
var isSoftDecode = false
companion object{ companion object{
private var instance:Application? =null private var instance:Application? =null
@ -111,12 +127,18 @@ class TaxiApp:Application() {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
instance = this instance = this
PlayerFactory.setPlayManager(IjkPlayerManager::class.java) //ijk模式
GSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL)
//关闭IJK日志
IjkPlayerManager.setLogLevel(IjkMediaPlayer.IJK_LOG_SILENT)
val helperDaoDB = HelperDaoDB(this, "taxi-app-database.db", null) val helperDaoDB = HelperDaoDB(this, "taxi-app-database.db", null)
val db = helperDaoDB.writableDatabase val db = helperDaoDB.writableDatabase
daoMaster = DaoMaster(db) daoMaster = DaoMaster(db)
daoSession = daoMaster.newSession() daoSession = daoMaster.newSession()
EasyHttp.init(this)
//add by yzd @20211130 用config替换原有的配置文件 //add by yzd @20211130 用config替换原有的配置文件
Configurations.config(this).init(); Configurations.config(this).init();
//初始化异常捕捉 //yzd 注释于20211110 //初始化异常捕捉 //yzd 注释于20211110

View File

@ -63,11 +63,11 @@ class TaxiServiceAIDL:Service() {
when (type) { when (type) {
"BindAccount" -> { "BindAccount" -> {
val bindModel = Gson().fromJson(jsonString, BindModel::class.java) val bindModel = Gson().fromJson(jsonString, BindModel::class.java)
if (bindModel.server!=null && bindModel.server!=""){ if (bindModel.server != null && bindModel.server!=""){
bindModel.server =bindModel.server+"/" bindModel.server = bindModel.server+"/"
} }
if (bindModel.server!=null && bindModel.server!=""){ if (bindModel.server != null && bindModel.server!=""){
bindModel.tlsServer = bindModel.tlsServer+"/" bindModel.tlsServer = bindModel.tlsServer+"/"
} }

View File

@ -72,6 +72,11 @@ object Repository {
currentSyncTime = syncTime currentSyncTime = syncTime
} }
fun cancelTimer(){
kuroTimer.cancel()
kuroTimer.purge()
}
fun getAdvertiseTEST(): Advertise? { fun getAdvertiseTEST(): Advertise? {
synchronized(TaxiApp::class.java){ synchronized(TaxiApp::class.java){
val list = myListMap[getTestPlayLevels()] val list = myListMap[getTestPlayLevels()]
@ -90,6 +95,7 @@ object Repository {
} }
fun getTestPlayCircularList(): MutableList<Advertise>? { fun getTestPlayCircularList(): MutableList<Advertise>? {
"getTestPlayCircularList".logd()
//#edit by ljh @2023/2/23 //#edit by ljh @2023/2/23
//如果正在播放的是多时段的定时广告,则返回定时广告的播放列表,否则返回不定时的播放列表 //如果正在播放的是多时段的定时广告,则返回定时广告的播放列表,否则返回不定时的播放列表
val taxiApp:TaxiApp = TaxiApp.instance() as TaxiApp val taxiApp:TaxiApp = TaxiApp.instance() as TaxiApp
@ -102,48 +108,6 @@ object Repository {
return list return list
} }
fun getAdvertiseNext(): Advertise? {
// return getPlayAdvertise(circularListMap[getPlayLevels()])
val isTimedAdvertise = Configurations.config(taxiApp.activity).isTimedAdvertise
// val advertise = getNextPlayAdvertise(myListMap[getTestPlayLevels()])
val advertise = if (isTimedAdvertise){
getNextPlayAdvertise(taxiApp.timedAds)
} else {
getNextPlayAdvertise(myListMap[getTestPlayLevels()])
}
"getAdvertiseNext() -> advertise:${advertise}".loge()
return advertise
}
/**
* 拿到将要播放的广告
*/
private fun getNextPlayAdvertise(list: MutableList<Advertise>?): Advertise? {
YoungUtil.YoungLog("getNextPlayAdvertise")
var nextIndex = currentListOrder + 1
list?.let {
if (it.isEmpty()) {
return null
}
for (index in 0..list.size) {
//防止下标越界
if (nextIndex >= list.size) {
nextIndex = 0
}
//YoungUtil.YoungLog("当前播放的广告list位数 $currentListOrder")
val advertise = list[nextIndex]
if (advertise.isAllowPlay()) {
//YoungUtil.YoungLog("拿到广告花费时间 ${System.currentTimeMillis() - currentTimeMillis}")
YoungUtil.YoungLog("拿到下一个广告:" + advertise.ad_id)
return advertise
}
}
}
return null
}
/** /**
@ -209,43 +173,6 @@ object Repository {
return null return null
} }
/**
* 拿到将要播放的广告
*/
private fun getTestPlayAdvertiseByTempList(list: MutableList<Advertise>?): Advertise? {
YoungUtil.YoungLog("getTestPlayAdvertiseByTempList")
val currentTimeMillis = System.currentTimeMillis()
list?.let {
if (it.isEmpty()) {
"播放列表是空的".loge()
return null
}
//防止如果需求定点广告切换成普通广告,但是要继续上次普通广告的播放,然后现在的广告列表数改变,下标越界的情况
// if(currentListOrder>=list.size){
// currentListOrder=0
// }
for (index in 0..list.size) {
//防止下标越界
if (currentListOrder >= list.size) {
currentListOrder = 0
}
//YoungUtil.YoungLog("当前播放的广告list位数 $currentListOrder")
val advertise = list[currentListOrder]
if (advertise.isAllowPlay()) {
//YoungUtil.YoungLog("拿到广告花费时间 ${System.currentTimeMillis() - currentTimeMillis}")
YoungUtil.YoungLog("拿到广告:" + advertise.ad_id)
return advertise
}
}
}
return null
}
/** /**
* 拿到应该播放的等级 * 拿到应该播放的等级
@ -451,7 +378,7 @@ object Repository {
if (newAdvertise.isAllowPlay()) { if (newAdvertise.isAllowPlay()) {
//#edit by ljh @2023/2/23 myListMap集合只存放不是定时插播的广告 //#edit by ljh @2023/2/23 myListMap集合只存放不是定时插播的广告
if (!newAdvertise.isTimedAd){ if (!newAdvertise.isTimedAd){
"广告准备ok 加入Mylist 广告ad_id:${newAdvertise.ad_id},是否是最后一个广告:${newAdvertise.isLast},belongto: ${newAdvertise.belongTo}".loge("Repository") "广告准备ok 加入Mylist 广告ad_id:${newAdvertise.ad_id},是否是最后一个广告:${newAdvertise.isLast},belongto: ${newAdvertise.belongTo}".loge()
myListMap[newAdvertise.belongTo]?.add(newAdvertise) myListMap[newAdvertise.belongTo]?.add(newAdvertise)
} else if(isTimedAdNow && newAdvertise.isTimedAd && newAdvertise.is_exclusive) { } else if(isTimedAdNow && newAdvertise.isTimedAd && newAdvertise.is_exclusive) {
taxiApp.timedAds.forEach { taxiApp.timedAds.forEach {
@ -465,6 +392,8 @@ object Repository {
// myListMap[newAdvertise.belongTo]?.add(newAdvertise) // myListMap[newAdvertise.belongTo]?.add(newAdvertise)
} else { } else {
YoungUtil.YoungLog("广告不满足不加入播放列表:${newAdvertise.ad_id}") YoungUtil.YoungLog("广告不满足不加入播放列表:${newAdvertise.ad_id}")
//edit by ljh @2023/8/14
taxiApp.daoAds.clear()
} }
} }
} catch (e:Exception){ } catch (e:Exception){
@ -539,7 +468,7 @@ object Repository {
if (playViewModel == null) { if (playViewModel == null) {
playViewModel = viewModel playViewModel = viewModel
} }
refreshMyList() // refreshMyList()
// refreshCircularList() // refreshCircularList()
// playViewModel?.refreshAdvertise(getAdvertiseTEST()) // playViewModel?.refreshAdvertise(getAdvertiseTEST())
playViewModel?.refreshAdvertise() playViewModel?.refreshAdvertise()
@ -571,20 +500,28 @@ object Repository {
currentListOrder = 0 currentListOrder = 0
refreshMyList() refreshMyList()
// "sync:${Configurations.config(TaxiApp.instance()).sync()}".loge() // "sync:${Configurations.config(TaxiApp.instance()).sync()}".loge()
if (Configurations.config(TaxiApp.instance()).sync() && getTestPlayLevels() == AdvertiseType.GROUP.ordinal) { //#edit by ljh @2023/12/12 定点刷新
if (taxiApp.isPositionRefresh){
//非同步播放或者定点播放
YoungUtil.YoungLog("非同步刷新")
playViewModel!!.refreshAdvertise()
taxiApp.isPositionRefresh = false
} else if (Configurations.config(TaxiApp.instance()).sync() && getTestPlayLevels() == AdvertiseType.GROUP.ordinal) {
//设置同步播放并且是分组广告 //设置同步播放并且是分组广告
// if (Settings.sync) { // if (Settings.sync) {
val syncTimeModel = getSyncSingleTime(currentSyncTime, getTestPlayCircularList()) val syncTimeModel = getSyncSingleTime(currentSyncTime, getTestPlayCircularList())
YoungUtil.YoungLog("播放方式为同步播放,同步时间:${syncTimeModel.delay}=============================================") YoungUtil.YoungLog("播放方式为同步播放,同步时间:${syncTimeModel.delay}=============================================")
val currentTimeMillis = System.currentTimeMillis() val currentTimeMillis = System.currentTimeMillis()
val advertise = getAdvertiseTEST() // val advertise = getAdvertiseTEST()
val getAdvertiseSyncTime = syncTimeModel.delay-(System.currentTimeMillis()-currentTimeMillis) val getAdvertiseSyncTime = syncTimeModel.delay-(System.currentTimeMillis()-currentTimeMillis)
YoungUtil.YoungLog("获取到广告的时间 校准同步时间:$getAdvertiseSyncTime") YoungUtil.YoungLog("获取到广告的时间 校准同步时间:$getAdvertiseSyncTime")
// handler.postDelayed(SyncTimerTask(playViewModel!!, advertise, syncTimeModel.currentPosition), syncTimeModel.delay) // handler.postDelayed(SyncTimerTask(playViewModel!!, advertise, syncTimeModel.currentPosition), syncTimeModel.delay)
"即将播放的视频索引:${syncTimeModel.currentPosition}".logd()
kuroTimer.cancel() kuroTimer.cancel()
kuroTimer.purge() kuroTimer.purge()
kuroTimer = KuroTimer() kuroTimer = KuroTimer()
kuroTimer.schedule(SyncTimerTask(playViewModel!!, advertise, syncTimeModel.currentPosition), syncTimeModel.delay) // kuroTimer.schedule(SyncTimerTask(playViewModel!!, advertise, syncTimeModel.currentPosition), syncTimeModel.delay)
kuroTimer.schedule(SyncTimerTask(playViewModel!!, null, syncTimeModel.currentPosition), syncTimeModel.delay)
} else { } else {
//非同步播放或者定点播放 //非同步播放或者定点播放
YoungUtil.YoungLog("播放方式为非同步播放") YoungUtil.YoungLog("播放方式为非同步播放")

View File

@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** /**
* Master of DAO (schema version 44): knows all DAOs. * Master of DAO (schema version 46): knows all DAOs.
*/ */
public class DaoMaster extends AbstractDaoMaster { public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 44; public static final int SCHEMA_VERSION = 46;
/** Creates underlying database table using DAOs. */ /** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) { public static void createAllTables(Database db, boolean ifNotExists) {
@ -29,6 +29,7 @@ public class DaoMaster extends AbstractDaoMaster {
PlayLoggerDao.createTable(db, ifNotExists); PlayLoggerDao.createTable(db, ifNotExists);
PositionAdvertiseDao.createTable(db, ifNotExists); PositionAdvertiseDao.createTable(db, ifNotExists);
RegionsDao.createTable(db, ifNotExists); RegionsDao.createTable(db, ifNotExists);
RunTimeDataDao.createTable(db, ifNotExists);
SanleAdvertiseDao.createTable(db, ifNotExists); SanleAdvertiseDao.createTable(db, ifNotExists);
ScheduleDao.createTable(db, ifNotExists); ScheduleDao.createTable(db, ifNotExists);
SectionDao.createTable(db, ifNotExists); SectionDao.createTable(db, ifNotExists);
@ -46,6 +47,7 @@ public class DaoMaster extends AbstractDaoMaster {
PlayLoggerDao.dropTable(db, ifExists); PlayLoggerDao.dropTable(db, ifExists);
PositionAdvertiseDao.dropTable(db, ifExists); PositionAdvertiseDao.dropTable(db, ifExists);
RegionsDao.dropTable(db, ifExists); RegionsDao.dropTable(db, ifExists);
RunTimeDataDao.dropTable(db, ifExists);
SanleAdvertiseDao.dropTable(db, ifExists); SanleAdvertiseDao.dropTable(db, ifExists);
ScheduleDao.dropTable(db, ifExists); ScheduleDao.dropTable(db, ifExists);
SectionDao.dropTable(db, ifExists); SectionDao.dropTable(db, ifExists);
@ -77,6 +79,7 @@ public class DaoMaster extends AbstractDaoMaster {
registerDaoClass(PlayLoggerDao.class); registerDaoClass(PlayLoggerDao.class);
registerDaoClass(PositionAdvertiseDao.class); registerDaoClass(PositionAdvertiseDao.class);
registerDaoClass(RegionsDao.class); registerDaoClass(RegionsDao.class);
registerDaoClass(RunTimeDataDao.class);
registerDaoClass(SanleAdvertiseDao.class); registerDaoClass(SanleAdvertiseDao.class);
registerDaoClass(ScheduleDao.class); registerDaoClass(ScheduleDao.class);
registerDaoClass(SectionDao.class); registerDaoClass(SectionDao.class);

View File

@ -16,6 +16,7 @@ import cn.trans88.taxiappkotlin.logic.model.Order;
import cn.trans88.taxiappkotlin.logic.model.PlayLogger; import cn.trans88.taxiappkotlin.logic.model.PlayLogger;
import cn.trans88.taxiappkotlin.logic.model.PositionAdvertise; import cn.trans88.taxiappkotlin.logic.model.PositionAdvertise;
import cn.trans88.taxiappkotlin.logic.model.Regions; import cn.trans88.taxiappkotlin.logic.model.Regions;
import cn.trans88.taxiappkotlin.logic.model.RunTimeData;
import cn.trans88.taxiappkotlin.logic.model.SanleAdvertise; import cn.trans88.taxiappkotlin.logic.model.SanleAdvertise;
import cn.trans88.taxiappkotlin.logic.model.Schedule; import cn.trans88.taxiappkotlin.logic.model.Schedule;
import cn.trans88.taxiappkotlin.logic.model.Section; import cn.trans88.taxiappkotlin.logic.model.Section;
@ -30,6 +31,7 @@ import cn.trans88.taxiappkotlin.logic.dao.OrderDao;
import cn.trans88.taxiappkotlin.logic.dao.PlayLoggerDao; import cn.trans88.taxiappkotlin.logic.dao.PlayLoggerDao;
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.dao.RegionsDao;
import cn.trans88.taxiappkotlin.logic.dao.RunTimeDataDao;
import cn.trans88.taxiappkotlin.logic.dao.SanleAdvertiseDao; import cn.trans88.taxiappkotlin.logic.dao.SanleAdvertiseDao;
import cn.trans88.taxiappkotlin.logic.dao.ScheduleDao; import cn.trans88.taxiappkotlin.logic.dao.ScheduleDao;
import cn.trans88.taxiappkotlin.logic.dao.SectionDao; import cn.trans88.taxiappkotlin.logic.dao.SectionDao;
@ -53,6 +55,7 @@ public class DaoSession extends AbstractDaoSession {
private final DaoConfig playLoggerDaoConfig; private final DaoConfig playLoggerDaoConfig;
private final DaoConfig positionAdvertiseDaoConfig; private final DaoConfig positionAdvertiseDaoConfig;
private final DaoConfig regionsDaoConfig; private final DaoConfig regionsDaoConfig;
private final DaoConfig runTimeDataDaoConfig;
private final DaoConfig sanleAdvertiseDaoConfig; private final DaoConfig sanleAdvertiseDaoConfig;
private final DaoConfig scheduleDaoConfig; private final DaoConfig scheduleDaoConfig;
private final DaoConfig sectionDaoConfig; private final DaoConfig sectionDaoConfig;
@ -67,6 +70,7 @@ public class DaoSession extends AbstractDaoSession {
private final PlayLoggerDao playLoggerDao; private final PlayLoggerDao playLoggerDao;
private final PositionAdvertiseDao positionAdvertiseDao; private final PositionAdvertiseDao positionAdvertiseDao;
private final RegionsDao regionsDao; private final RegionsDao regionsDao;
private final RunTimeDataDao runTimeDataDao;
private final SanleAdvertiseDao sanleAdvertiseDao; private final SanleAdvertiseDao sanleAdvertiseDao;
private final ScheduleDao scheduleDao; private final ScheduleDao scheduleDao;
private final SectionDao sectionDao; private final SectionDao sectionDao;
@ -101,6 +105,9 @@ public class DaoSession extends AbstractDaoSession {
regionsDaoConfig = daoConfigMap.get(RegionsDao.class).clone(); regionsDaoConfig = daoConfigMap.get(RegionsDao.class).clone();
regionsDaoConfig.initIdentityScope(type); regionsDaoConfig.initIdentityScope(type);
runTimeDataDaoConfig = daoConfigMap.get(RunTimeDataDao.class).clone();
runTimeDataDaoConfig.initIdentityScope(type);
sanleAdvertiseDaoConfig = daoConfigMap.get(SanleAdvertiseDao.class).clone(); sanleAdvertiseDaoConfig = daoConfigMap.get(SanleAdvertiseDao.class).clone();
sanleAdvertiseDaoConfig.initIdentityScope(type); sanleAdvertiseDaoConfig.initIdentityScope(type);
@ -124,6 +131,7 @@ public class DaoSession extends AbstractDaoSession {
playLoggerDao = new PlayLoggerDao(playLoggerDaoConfig, this); playLoggerDao = new PlayLoggerDao(playLoggerDaoConfig, this);
positionAdvertiseDao = new PositionAdvertiseDao(positionAdvertiseDaoConfig, this); positionAdvertiseDao = new PositionAdvertiseDao(positionAdvertiseDaoConfig, this);
regionsDao = new RegionsDao(regionsDaoConfig, this); regionsDao = new RegionsDao(regionsDaoConfig, this);
runTimeDataDao = new RunTimeDataDao(runTimeDataDaoConfig, this);
sanleAdvertiseDao = new SanleAdvertiseDao(sanleAdvertiseDaoConfig, this); sanleAdvertiseDao = new SanleAdvertiseDao(sanleAdvertiseDaoConfig, this);
scheduleDao = new ScheduleDao(scheduleDaoConfig, this); scheduleDao = new ScheduleDao(scheduleDaoConfig, this);
sectionDao = new SectionDao(sectionDaoConfig, this); sectionDao = new SectionDao(sectionDaoConfig, this);
@ -138,6 +146,7 @@ public class DaoSession extends AbstractDaoSession {
registerDao(PlayLogger.class, playLoggerDao); registerDao(PlayLogger.class, playLoggerDao);
registerDao(PositionAdvertise.class, positionAdvertiseDao); registerDao(PositionAdvertise.class, positionAdvertiseDao);
registerDao(Regions.class, regionsDao); registerDao(Regions.class, regionsDao);
registerDao(RunTimeData.class, runTimeDataDao);
registerDao(SanleAdvertise.class, sanleAdvertiseDao); registerDao(SanleAdvertise.class, sanleAdvertiseDao);
registerDao(Schedule.class, scheduleDao); registerDao(Schedule.class, scheduleDao);
registerDao(Section.class, sectionDao); registerDao(Section.class, sectionDao);
@ -154,6 +163,7 @@ public class DaoSession extends AbstractDaoSession {
playLoggerDaoConfig.clearIdentityScope(); playLoggerDaoConfig.clearIdentityScope();
positionAdvertiseDaoConfig.clearIdentityScope(); positionAdvertiseDaoConfig.clearIdentityScope();
regionsDaoConfig.clearIdentityScope(); regionsDaoConfig.clearIdentityScope();
runTimeDataDaoConfig.clearIdentityScope();
sanleAdvertiseDaoConfig.clearIdentityScope(); sanleAdvertiseDaoConfig.clearIdentityScope();
scheduleDaoConfig.clearIdentityScope(); scheduleDaoConfig.clearIdentityScope();
sectionDaoConfig.clearIdentityScope(); sectionDaoConfig.clearIdentityScope();
@ -193,6 +203,10 @@ public class DaoSession extends AbstractDaoSession {
return regionsDao; return regionsDao;
} }
public RunTimeDataDao getRunTimeDataDao() {
return runTimeDataDao;
}
public SanleAdvertiseDao getSanleAdvertiseDao() { public SanleAdvertiseDao getSanleAdvertiseDao() {
return sanleAdvertiseDao; return sanleAdvertiseDao;
} }

View File

@ -23,6 +23,7 @@ object DaoUtil {
private var mScheduleDao:ScheduleDao private var mScheduleDao:ScheduleDao
private var mRegionsDao:RegionsDao private var mRegionsDao:RegionsDao
private var mContainerDao:ContainerDao private var mContainerDao:ContainerDao
private var mRunTimeDataDao:RunTimeDataDao
init { init {
// helperDaoDB = HelperDaoDB(TaxiApp.instance(), DB_NAME, null) // helperDaoDB = HelperDaoDB(TaxiApp.instance(), DB_NAME, null)
@ -39,6 +40,7 @@ object DaoUtil {
mScheduleDao = daoSession.scheduleDao mScheduleDao = daoSession.scheduleDao
mRegionsDao = daoSession.regionsDao mRegionsDao = daoSession.regionsDao
mContainerDao = daoSession.containerDao mContainerDao = daoSession.containerDao
mRunTimeDataDao = daoSession.runTimeDataDao
} }
@Synchronized @Synchronized
@ -82,6 +84,11 @@ object DaoUtil {
return mSanleAdvertiseDao return mSanleAdvertiseDao
} }
@Synchronized
fun getRunTimeDao(): RunTimeDataDao {
return mRunTimeDataDao
}
@Synchronized @Synchronized
fun getPositionAdvertise(): PositionAdvertiseDao = mPositionAdvertiseDao fun getPositionAdvertise(): PositionAdvertiseDao = mPositionAdvertiseDao
@ -203,4 +210,11 @@ object DaoUtil {
} }
} }
/**
* 删除已上传的运行时长数据
*/
fun deleteIsUpRunTimeData(){
getRunTimeDao().queryBuilder().where(RunTimeDataDao.Properties.IsUpload.eq(1)).buildDelete().executeDeleteWithoutDetachingEntities()
}
} }

View File

@ -0,0 +1,171 @@
package cn.trans88.taxiappkotlin.logic.dao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import cn.trans88.taxiappkotlin.logic.model.RunTimeData;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "RUN_TIME_DATA".
*/
public class RunTimeDataDao extends AbstractDao<RunTimeData, Long> {
public static final String TABLENAME = "RUN_TIME_DATA";
/**
* Properties of entity RunTimeData.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property AutoId = new Property(0, Long.class, "autoId", true, "_id");
public final static Property CardId = new Property(1, String.class, "cardId", false, "CARD_ID");
public final static Property SumRuntime = new Property(2, Long.class, "sumRuntime", false, "SUM_RUNTIME");
public final static Property StartRuntime = new Property(3, Long.class, "startRuntime", false, "START_RUNTIME");
public final static Property IsUpload = new Property(4, Integer.class, "isUpload", false, "IS_UPLOAD");
}
public RunTimeDataDao(DaoConfig config) {
super(config);
}
public RunTimeDataDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"RUN_TIME_DATA\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: autoId
"\"CARD_ID\" TEXT," + // 1: cardId
"\"SUM_RUNTIME\" INTEGER," + // 2: sumRuntime
"\"START_RUNTIME\" INTEGER," + // 3: startRuntime
"\"IS_UPLOAD\" INTEGER);"); // 4: isUpload
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"RUN_TIME_DATA\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, RunTimeData entity) {
stmt.clearBindings();
Long autoId = entity.getAutoId();
if (autoId != null) {
stmt.bindLong(1, autoId);
}
String cardId = entity.getCardId();
if (cardId != null) {
stmt.bindString(2, cardId);
}
Long sumRuntime = entity.getSumRuntime();
if (sumRuntime != null) {
stmt.bindLong(3, sumRuntime);
}
Long startRuntime = entity.getStartRuntime();
if (startRuntime != null) {
stmt.bindLong(4, startRuntime);
}
Integer isUpload = entity.getIsUpload();
if (isUpload != null) {
stmt.bindLong(5, isUpload);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, RunTimeData entity) {
stmt.clearBindings();
Long autoId = entity.getAutoId();
if (autoId != null) {
stmt.bindLong(1, autoId);
}
String cardId = entity.getCardId();
if (cardId != null) {
stmt.bindString(2, cardId);
}
Long sumRuntime = entity.getSumRuntime();
if (sumRuntime != null) {
stmt.bindLong(3, sumRuntime);
}
Long startRuntime = entity.getStartRuntime();
if (startRuntime != null) {
stmt.bindLong(4, startRuntime);
}
Integer isUpload = entity.getIsUpload();
if (isUpload != null) {
stmt.bindLong(5, isUpload);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public RunTimeData readEntity(Cursor cursor, int offset) {
RunTimeData entity = new RunTimeData( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // autoId
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // cardId
cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2), // sumRuntime
cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3), // startRuntime
cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4) // isUpload
);
return entity;
}
@Override
public void readEntity(Cursor cursor, RunTimeData entity, int offset) {
entity.setAutoId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setCardId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setSumRuntime(cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2));
entity.setStartRuntime(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
entity.setIsUpload(cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4));
}
@Override
protected final Long updateKeyAfterInsert(RunTimeData entity, long rowId) {
entity.setAutoId(rowId);
return rowId;
}
@Override
public Long getKey(RunTimeData entity) {
if(entity != null) {
return entity.getAutoId();
} else {
return null;
}
}
@Override
public boolean hasKey(RunTimeData entity) {
return entity.getAutoId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}

View File

@ -1,5 +1,7 @@
package cn.trans88.taxiappkotlin.logic.model; package cn.trans88.taxiappkotlin.logic.model;
import java.util.Objects;
public class AdvertiseProcess { public class AdvertiseProcess {
private String type = "notify_download_ad_progress"; private String type = "notify_download_ad_progress";
private String ad_id; private String ad_id;
@ -20,4 +22,19 @@ public class AdvertiseProcess {
public void setProgress(String progress) { public void setProgress(String progress) {
this.progress = progress; this.progress = progress;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AdvertiseProcess that = (AdvertiseProcess) o;
return Objects.equals(type, that.type) &&
Objects.equals(ad_id, that.ad_id) &&
Objects.equals(progress, that.progress);
}
@Override
public int hashCode() {
return Objects.hash(type, ad_id, progress);
}
} }

View File

@ -0,0 +1,37 @@
package cn.trans88.taxiappkotlin.logic.model;
/**
* @Author LJH
* @Time 2023/12/13
* @description
*/
public class LogInterval {
private String id;
private String task_id;
private int interval;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTask_id() {
return task_id;
}
public void setTask_id(String task_id) {
this.task_id = task_id;
}
public int getInterval() {
return interval;
}
public void setInterval(int interval) {
this.interval = interval;
}
}

View File

@ -0,0 +1,19 @@
package cn.trans88.taxiappkotlin.logic.model;
/**
* @Author LJH
* @Time 2023/12/13
* @description
*/
public class LogIntervalResponse extends SanleResponse{
private int interval;
public int getInterval() {
return interval;
}
public void setInterval(int interval) {
this.interval = interval;
}
}

View File

@ -9,5 +9,9 @@ package cn.trans88.taxiappkotlin.logic.model
data class LogSummary( data class LogSummary(
val ad_id: String, val ad_id: String,
val play_num:Int, val play_num:Int,
val duration:Long val duration:Long,
val ad_type:Int,
val media_url:String,
val begin_play_ts:Long,
val end_play_ts:Long
) )

View File

@ -125,4 +125,6 @@ public class PlayLogger implements Serializable {
this.latitude = latitude; this.latitude = latitude;
} }
} }

View File

@ -0,0 +1,71 @@
package cn.trans88.taxiappkotlin.logic.model;
import com.google.gson.annotations.Expose;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import java.io.Serializable;
import org.greenrobot.greendao.annotation.Generated;
/**
* @Author LJH
* @Time 2024/2/29
* @description
*/
@Entity
public class RunTimeData implements Serializable {
private static final long serialVersionUID = 1L;
@Expose(serialize = false,deserialize = false)
@Id(autoincrement = true)
private Long autoId;
private String cardId; //设备id
private Long sumRuntime; //上一次开机的总运行时长
private Long startRuntime; //上一次开机的开始运行时间
private Integer isUpload; //是否上传 0 未上传; 1 已上传
@Generated(hash = 710149355)
public RunTimeData(Long autoId, String cardId, Long sumRuntime,
Long startRuntime, Integer isUpload) {
this.autoId = autoId;
this.cardId = cardId;
this.sumRuntime = sumRuntime;
this.startRuntime = startRuntime;
this.isUpload = isUpload;
}
@Generated(hash = 1108588427)
public RunTimeData() {
}
public Long getAutoId() {
return this.autoId;
}
public void setAutoId(Long autoId) {
this.autoId = autoId;
}
public String getCardId() {
return this.cardId;
}
public void setCardId(String cardId) {
this.cardId = cardId;
}
public Long getSumRuntime() {
return this.sumRuntime;
}
public void setSumRuntime(Long sumRuntime) {
this.sumRuntime = sumRuntime;
}
public Long getStartRuntime() {
return this.startRuntime;
}
public void setStartRuntime(Long startRuntime) {
this.startRuntime = startRuntime;
}
public Integer getIsUpload() {
return this.isUpload;
}
public void setIsUpload(Integer isUpload) {
this.isUpload = isUpload;
}
}

View File

@ -0,0 +1,37 @@
package cn.trans88.taxiappkotlin.logic.model;
/**
* @Author LJH
* @Time 2024/3/14
* @description
*/
public class SoftDecode {
private String id;
private String task_id;
private boolean isSoftDeCode;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTask_id() {
return task_id;
}
public void setTask_id(String task_id) {
this.task_id = task_id;
}
public boolean isSoftDeCode() {
return isSoftDeCode;
}
public void setSoftDeCode(boolean softDeCode) {
isSoftDeCode = softDeCode;
}
}

View File

@ -0,0 +1,18 @@
package cn.trans88.taxiappkotlin.logic.model;
/**
* @Author LJH
* @Time 2024/3/14
* @description
*/
public class SoftDecodeState extends SanleResponse{
private Boolean softDecode = false;
public Boolean getSoftDecode() {
return softDecode;
}
public void setSoftDecode(Boolean softDecode) {
this.softDecode = softDecode;
}
}

View File

@ -16,8 +16,11 @@ import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.Repository.taxiApp import cn.trans88.taxiappkotlin.logic.Repository.taxiApp
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil import cn.trans88.taxiappkotlin.logic.dao.DaoUtil
import cn.trans88.taxiappkotlin.logic.model.* import cn.trans88.taxiappkotlin.logic.model.*
import cn.trans88.taxiappkotlin.net.EasyHttpTool
import cn.trans88.taxiappkotlin.net.OkHttpTool
import cn.trans88.taxiappkotlin.play.RefreshPlayer import cn.trans88.taxiappkotlin.play.RefreshPlayer
import cn.trans88.taxiappkotlin.ui.play.PlayActivity import cn.trans88.taxiappkotlin.ui.play.PlayActivity
import cn.trans88.taxiappkotlin.ui.play.isSendedLog
import cn.trans88.taxiappkotlin.util.KuroTimer import cn.trans88.taxiappkotlin.util.KuroTimer
import cn.trans88.taxiappkotlin.util.KuroTimerTask import cn.trans88.taxiappkotlin.util.KuroTimerTask
import cn.trans88.taxiappkotlin.util.YoungUtil import cn.trans88.taxiappkotlin.util.YoungUtil
@ -32,6 +35,9 @@ import com.trs88.kurolibrary.execute.KuroExecutor
import com.trs88.kurolibrary.file.KuroFileUtil import com.trs88.kurolibrary.file.KuroFileUtil
import com.trs88.kurolibrary.file.PostFileCallBack import com.trs88.kurolibrary.file.PostFileCallBack
import com.xixun.xy.conn.aidl.ConnService import com.xixun.xy.conn.aidl.ConnService
import com.zhouyou.http.EasyHttp
import com.zhouyou.http.callback.SimpleCallBack
import com.zhouyou.http.exception.ApiException
import net.sysolution.taxiapp.ITaxiListener import net.sysolution.taxiapp.ITaxiListener
import okhttp3.* import okhttp3.*
import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.MediaType.Companion.toMediaTypeOrNull
@ -39,8 +45,11 @@ import okhttp3.RequestBody.Companion.asRequestBody
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
import java.util.* import java.util.*
import java.util.concurrent.Executors
import java.util.concurrent.ThreadPoolExecutor import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit
import java.util.stream.Collectors import java.util.stream.Collectors
import kotlin.concurrent.thread
/** /**
* @author TRS * @author TRS
@ -53,7 +62,7 @@ object ConnManger {
var isBindOrTransfer = false var isBindOrTransfer = false
//保存到conn的实体类信息 //保存到conn的实体类信息
var connectMessage:ConnectMessage = ConnectMessage() var connectMessage:ConnectMessage = ConnectMessage()
// private val handler =Handler() // private val handler = Handler()
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"
@ -63,6 +72,11 @@ object ConnManger {
// val BaseUrl ="http://taxihub.cn:2346/" // val BaseUrl ="http://taxihub.cn:2346/"
private var connService: ConnService? = null private var connService: ConnService? = null
@Volatile
var sendPlayerLogSwitch: Boolean = false
@Volatile
var sendGPSLogSwitch: Boolean = false
/** /**
* 注册App * 注册App
*/ */
@ -173,10 +187,13 @@ object ConnManger {
val registerToken = Configurations.config(TaxiApp.instance()).registerToken() val registerToken = Configurations.config(TaxiApp.instance()).registerToken()
//不是默认账号则存入conn //不是默认账号则存入conn
if (!registerToken.equals(defaultToken)){ if (!registerToken.equals(defaultToken)){
if (isBindOrTransfer){
isBindOrTransfer = false
}
"is not defaultToken,save message to conn.".loge() "is not defaultToken,save message to conn.".loge()
initConnectMessage() initConnectMessage()
//测试平台要加 //测试平台要加
// setServerToConn() // setServerToConn()
} else { } else {
//是默认账号看看conn有没保存信息如果有则重新注册一遍 //是默认账号看看conn有没保存信息如果有则重新注册一遍
if (connService != null){ if (connService != null){
@ -189,8 +206,11 @@ object ConnManger {
} }
} }
sendLogger() // sendLogger()
sendLocation() // sendLocation()
startPlayLogThread()
startLocationThread()
// debugLocation()
//edit by ljh @2023/9/1 //edit by ljh @2023/9/1
WsManager.isRegister = false WsManager.isRegister = false
WsManager.initWebSocket() WsManager.initWebSocket()
@ -203,9 +223,9 @@ object ConnManger {
isRegisterSuccess = false isRegisterSuccess = false
// val timer = Timer() // val timer = Timer()
//验证conn的信息 //验证conn的信息
if (isBindOrTransfer){ // if (isBindOrTransfer){
isBindOrTransfer = false // isBindOrTransfer = false
} // }
DelayTimer.timer({ registerApp() }, 4000) DelayTimer.timer({ registerApp() }, 4000)
} }
}) })
@ -443,7 +463,13 @@ object ConnManger {
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull() val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, requestJson) val body = RequestBody.create(parse, requestJson)
val okHttpClient = OkHttpClient() // val okHttpClient = OkHttpClient()
//edit by ljh @2024/2/26
val okHttpClient = OkHttpClient.Builder()
.connectTimeout(80, TimeUnit.SECONDS)
.readTimeout(80, TimeUnit.SECONDS)
.writeTimeout(80, TimeUnit.SECONDS)
.build()
//YoungUtil.YoungLog("准备上传坐标,上传地址:${SaveSimpleData.getLogServiceUrl()}") //YoungUtil.YoungLog("准备上传坐标,上传地址:${SaveSimpleData.getLogServiceUrl()}")
YoungUtil.YoungLog("准备上传坐标") YoungUtil.YoungLog("准备上传坐标")
YoungUtil.YoungLog("sendLocation:${requestJson}") YoungUtil.YoungLog("sendLocation:${requestJson}")
@ -457,8 +483,7 @@ 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}")
//日志存卡里
// taxiApp.saveLog("上传坐标失败,不删除失败的数据")
// DaoUtil.getLocationDao().deleteAll() // DaoUtil.getLocationDao().deleteAll()
} }
@ -478,37 +503,128 @@ object ConnManger {
} }
} }
/** /**
* 发送坐标 * 启动发送坐标线程
*/ */
fun sendLocation() { fun startLocationThread(){
taxiApp.gpsTimer?.let { if (Configurations.config(TaxiApp.instance()).gpsSwitch()) {
it.cancel() if (!sendGPSLogSwitch){
it.purge() thread {
} "启动发送坐标线程".logd()
synchronized(ConnManger::class.java){ sendGPSLogSwitch = true
//edit by yzd @20211201 while (true) {
//if (Settings.gpsSwitch) { // val locations = DaoUtil.getLocations()
if (Configurations.config(TaxiApp.instance()).gpsSwitch()) { val upLocations = DaoUtil.getLocationDao().queryBuilder().limit(100).build().list()
"gpsSwitch on".loge() "locations size:${upLocations.size}".logd()
taxiApp.gpsTimer = Timer() if (upLocations.isNotEmpty()){
taxiApp.gpsTimer?.schedule(object : TimerTask() { val requestJson: String = ProcessingCommands.gson.toJson(upLocations)
override fun run() { "提交GPS数据 $requestJson".logd()
sendLocationToWeb() val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
// sendLocation() val body = RequestBody.create(parse, requestJson)
val url = Configurations.config(TaxiApp.instance()).logServiceUrl() + "postGpsLocationLog"
try {
val request = Request.Builder()
.url(url)
.addHeader("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
// .addHeader("Accept-Encoding", "gzip")
.post(body)
.build()
val response = OkHttpTool.getInstance().client.newCall(request).execute()
"response code:${response?.code}".logd()
if (response.isSuccessful){
"上传GPS日志成功 ".logd()
DaoUtil.getLocationDao().deleteInTx(upLocations)
"删除GPS日志成功,upLocations.size:${upLocations.size}".logd()
// if(upLocations.size < 250) {
// Thread.sleep(8*60*1000L)
// }
} else {
"上传GPS日志失败".loge()
Thread.sleep(2*60*1000L)
}
} catch (e: Exception) {
"up logs failed,Exception:${e.message}".loge()
Thread.sleep(2*60*1000L)
}
} else {
"gps数据小于0条不上传2分钟后再次查询".logd()
try {
Thread.sleep(2*60*1000L)
} catch (e: Exception) {
"${e?.message}".loge()
e.printStackTrace()
}
}
} }
}, 5000,10000) }
} else { } else {
"gpsSwitch off".loge() "gps日志线程已经启动了无需再次启动".loge()
taxiApp.gpsTimer = Timer() }
taxiApp.gpsTimer?.schedule(object : TimerTask() {
override fun run() { }
sendLocationToWeb() }
// sendLocation()
/**
* 提交GPS数据接口测试
*/
fun debugLocation(){
"开始提交GPS数据接口测试".logd()
thread {
while (true){
"提交GPS数据接口测试".logd()
val locations = mutableListOf<Location>()
for (i in 0 .. 1000){
for (j in 0 .. 1000){}
val location = Location().apply {
timestamp = System.currentTimeMillis()
longitude = 22.665534200203726
latitude = 113.91975187778473
bearing = 1F
speed = 1F
distance = 99F
elapse = 2
} }
}, 5000,60 * 60 * 1000) locations.add(location)
}
val jsonStr = ProcessingCommands.gson.toJson(locations)
"提交测试的GPS数据 $jsonStr".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, jsonStr)
EasyHttp.post(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postGpsLocationLog")
.readTimeOut(80*1000) //读超时80s,单位毫秒
.writeTimeOut(80*1000) //写超时80s,单位毫秒
.connectTimeout(80*1000) //连接超时80s,单位毫秒
.headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.requestBody(body)
.retryCount(5) //网络不好自动重试5次
.retryDelay(600) //本次请求重试延迟时间600ms
.syncRequest(true)//设置同步请求
.execute(object : SimpleCallBack<String>(){
override fun onError(e: ApiException?) {
"上传测试的GPS数据失败${e?.message}".loge()
}
override fun onSuccess(t: String?) {
"上传测试的GPS数据成功 $t".loge()
locations.clear()
}
})
try {
Thread.sleep(3*60*1000L)
}catch (e: Exception) {
"${e?.message}".loge()
e.printStackTrace()
}
} }
} }
} }
@ -684,71 +800,138 @@ object ConnManger {
*/ */
fun sendLogsSummary(){ fun sendLogsSummary(){
YoungUtil.YoungLog("sendLogger in Thread is ${Looper.getMainLooper().thread === Thread.currentThread()}") YoungUtil.YoungLog("sendLogger in Thread is ${Looper.getMainLooper().thread === Thread.currentThread()}")
val playLoggers = DaoUtil.getPlayLoggers() thread {
if (playLoggers.isNotEmpty()) { val playLoggers = DaoUtil.getPlayLoggers()
//#edit by ljh @2023/6/5 改成大批量看是否能减小流量消耗 "playLoggers size: ${playLoggers.size}".logd()
val requestJson = ProcessingCommands.gson.toJson(playLoggers) val requestJson = getLogSummaryJson(playLoggers)
if (requestJson.isNotEmpty()){
for (playLogger in playLoggers) { EasyHttpTool.sendPlayLogToServer(requestJson)
DaoUtil.getPlayLogger().delete(playLogger) // sendLogsSummaryToWeb(requestJson)
} }
val okHttpClient = OkHttpClient()
YoungUtil.YoungLog("准备上传日志")
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, requestJson)
YoungUtil.YoungLog("sendLogger:${requestJson}")
val request: Request = Request.Builder()
.url(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postPlayerLog") //要访问的链接
.addHeader("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.addHeader("Accept-Encoding", "gzip")
.post(body)
.build()
val call = okHttpClient.newCall(request)
call.enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
YoungUtil.YoungLog("上传日志失败:${e.message}")
}
override fun onResponse(call: Call, response: Response) {
YoungUtil.YoungLog("上传日志成功:${response.message},response isSuccessful ${response.isSuccessful}${response.code}")
// if (response.code == 200) {
// //#edit by ljh @2023/6/5 删除批量上传的日志
// DaoUtil.getPlayLogger().deleteAll()
// }
"删除已上传的日志".logd()
}
})
} }
} }
private fun getLogSummaryJson(){
val playLoggers = DaoUtil.getPlayLoggers()
val maxEndPlayTs = playLoggers.map {
it.end_play_ts
}.max()
val minBeginPlayTs = playLoggers.map {
it.begin_play_ts
}.min()
"开始播放时间:$minBeginPlayTs,最后一条日志的播放时间:$maxEndPlayTs".loge() /**
if (playLoggers.isNotEmpty()) { * 上传日志概要到平台
* @param jsonStr String
*/
var logsSummaryTimer:Timer? = null
fun sendLogsSummaryToWeb(requestJson:String){
val okHttpClient = OkHttpClient.Builder()
.connectTimeout(80, TimeUnit.SECONDS)
.readTimeout(80, TimeUnit.SECONDS)
.writeTimeout(80, TimeUnit.SECONDS)
.build()
YoungUtil.YoungLog("准备上传日志摘要")
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, requestJson)
YoungUtil.YoungLog("sendLogger:${requestJson}")
val request: Request = Request.Builder()
.url(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postPlayerLogPlus") //要访问的链接
.addHeader("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.addHeader("Accept-Encoding", "gzip")
.post(body)
.build()
val call = okHttpClient.newCall(request)
call.enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
YoungUtil.YoungLog("上传日志失败:${e.message}")
e.printStackTrace()
"3s后重新上传日志摘要".loge()
logsSummaryTimer?.let {
it.cancel()
it.purge()
}
logsSummaryTimer = null
logsSummaryTimer = Timer()
logsSummaryTimer?.schedule(object :TimerTask(){
override fun run() {
sendLogsSummaryToWeb(requestJson)
}
},3000L)
}
override fun onResponse(call: Call, response: Response) {
YoungUtil.YoungLog("上传日志成功:${response.message},response isSuccessful ${response.isSuccessful}${response.code}")
if (response.code == 200) {
Configurations.config(taxiApp).logSummaryJsonStringSave("")
} else {
"服务器没回复200重新上传日志摘要".loge()
"3s后重新上传日志摘要".loge()
logsSummaryTimer?.let {
it.cancel()
it.purge()
}
logsSummaryTimer = null
logsSummaryTimer = Timer()
logsSummaryTimer?.schedule(object :TimerTask(){
override fun run() {
sendLogsSummaryToWeb(requestJson)
}
},3000L)
}
}
})
}
/**
* 获取昨天的日志概要Json数据
*/
private fun getLogSummaryJson(playLoggers:List<PlayLogger>):String{
// val cacheJson = Configurations.config(taxiApp).logSummaryJsonString()
// if (!cacheJson.isNullOrEmpty()){
// "cacheJson:$cacheJson".logd()
// return cacheJson
// }
var jsonStr = ""
if (!playLoggers.isNullOrEmpty()){
val summaryList = ArrayList<LogSummary>()
// val endPlayTime = playLoggers.map {
// it.end_play_ts
// }.max() ?: 0L
// val beginPlayTime = playLoggers.map {
// it.begin_play_ts
// }.min() ?: 0L
val logsGroup = playLoggers.groupBy { it.ad_id }
logsGroup.keys.forEach {
val adId = it
logsGroup.get(it)?.let { playLoggers ->
val beginPlayTime = playLoggers.map { it.begin_play_ts }.filter { it > 1702192270 }.min() ?: 0L
val endPlayTime = playLoggers.map { it.end_play_ts }.max() ?: 0L
val playNums = playLoggers.size
val playLogger = playLoggers.get(0)
val ad_type = playLogger.ad_type
val media_url = playLogger.media_url
val duration = playLogger.duration
val summary = LogSummary(adId,playNums,duration,ad_type,media_url,beginPlayTime,endPlayTime)
"开始播放时间:$beginPlayTime,结束播放时间:$endPlayTime".loge()
"添加一条日志摘要:${summary.toString()}".loge()
summaryList.add(summary)
}
}
for (playLogger in playLoggers) { for (playLogger in playLoggers) {
DaoUtil.getPlayLogger().delete(playLogger) DaoUtil.getPlayLogger().delete(playLogger)
} }
jsonStr = Gson().toJson(summaryList)
// Configurations.config(taxiApp).logSummaryJsonStringSave(jsonStr)
} }
"日志概要json:$jsonStr".loge()
return jsonStr
} }
/** /**
* 上报运行时长 * 上报运行时长
*/ */
var runtimeTimer:Timer? = null
fun sendRuntimeToWeb(){ fun sendRuntimeToWeb(){
val jsonStr = Configurations.config(taxiApp).runtimeJsonString() ?: "" val jsonStr = Configurations.config(taxiApp).runtimeJsonString() ?: ""
val okHttpClient = OkHttpClient() val okHttpClient = OkHttpClient.Builder()
.connectTimeout(80, TimeUnit.SECONDS)
.readTimeout(80, TimeUnit.SECONDS)
.writeTimeout(80, TimeUnit.SECONDS)
.build()
YoungUtil.YoungLog("准备上报运行时长") YoungUtil.YoungLog("准备上报运行时长")
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull() val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, jsonStr) val body = RequestBody.create(parse, jsonStr)
@ -764,12 +947,18 @@ object ConnManger {
override fun onFailure(call: Call, e: IOException) { override fun onFailure(call: Call, e: IOException) {
YoungUtil.YoungLog("上传运行时长失败:${e.message}") YoungUtil.YoungLog("上传运行时长失败:${e.message}")
Timer().schedule(object :TimerTask(){ e.printStackTrace()
"3s后重新上报运行时长".loge()
runtimeTimer?.let {
it.cancel()
it.purge()
}
runtimeTimer = Timer()
runtimeTimer?.schedule(object :TimerTask(){
override fun run() { override fun run() {
"重新上报运行时长".loge()
sendRuntimeToWeb() sendRuntimeToWeb()
} }
},5000) },3000L)
} }
override fun onResponse(call: Call, response: Response) { override fun onResponse(call: Call, response: Response) {
@ -777,30 +966,82 @@ object ConnManger {
if (response.code == 200) { if (response.code == 200) {
"清除上传成功的运行时长数据".loge() "清除上传成功的运行时长数据".loge()
Configurations.config(taxiApp).runtimeJsonStringSave("") Configurations.config(taxiApp).runtimeJsonStringSave("")
} else {
"3s后重新上报运行时长".loge()
runtimeTimer?.let {
it.cancel()
it.purge()
}
runtimeTimer = Timer()
runtimeTimer?.schedule(object :TimerTask(){
override fun run() {
sendRuntimeToWeb()
}
},3000L)
} }
} }
}) })
} }
/** /**
* 发送播放日志 * 提交播放日志
*/ */
fun sendLogger() { fun startPlayLogThread(){
taxiApp.playerLogTimer?.let { if (Configurations.config(TaxiApp.instance()).loggerSwitch()) {
if (!sendPlayerLogSwitch){
thread {
"提交播放日志线程启动".logd()
sendPlayerLogSwitch = true
while (true){
// val playerLogs = DaoUtil.getPlayLoggers()
val playerLogs = DaoUtil.getPlayLogger().queryBuilder().limit(100).build().list()
"播放日志数据数量:${playerLogs.size}".logd()
if (playerLogs.size>10){
EasyHttpTool.sendPlayLogToServer(playerLogs)
} else {
try {
Thread.sleep(60*1000L)
} catch (e: Exception){
"Exception:${e.message}".loge()
e.printStackTrace()
}
}
}
}
} else {
"播放日志线程已经启动了,无需再次启动!".loge()
}
}
}
/**
* 定时发送播放日志摘要
*/
fun sendLogSummaryByInterval(interval:Int) {
taxiApp.playerLogSummaryTimer?.let {
it.cancel() it.cancel()
it.purge() it.purge()
} }
//edit by yzd @20211201 if (interval > 0) {
//if (Settings.loggerSwitch) { //if (Settings.loggerSwitch) {
if (Configurations.config(TaxiApp.instance()).loggerSwitch()) { taxiApp.playerLogSummaryTimer = Timer()
taxiApp.playerLogTimer = Timer() taxiApp.playerLogSummaryTimer?.schedule(object :TimerTask(){
taxiApp.playerLogTimer?.schedule(object :TimerTask(){
override fun run() { override fun run() {
sendLoggerToWeb() val playLoggers = DaoUtil.getPlayLoggers()
"定时上传日志摘要playLoggers size: ${playLoggers.size}".logd()
val requestJson = getLogSummaryJson(playLoggers)
if (requestJson.isNotEmpty() && logsSummaryTimer == null){
EasyHttpTool.sendPlayLogToServer(requestJson)
// sendLogsSummaryToWeb(requestJson)
}
} }
},5000,30000) },interval*60*1000L,interval*60*1000L)
} }
} }
/** /**

View File

@ -40,7 +40,7 @@ public class JoeyDownloadManager {
private static IPlay iPlay; private static IPlay iPlay;
//edit by ljh 2022/11/29 //edit by ljh 2022/11/29
private static final int RETRY_TIMES = 600; private static final int RETRY_TIMES = 600;
private static int downloadCount =100;//重试的次数 private static int downloadCount = 100;//重试的次数
private static Application app; private static Application app;
// private LastThread lastThread = null;//执行最后一次 // private LastThread lastThread = null;//执行最后一次
@ -192,6 +192,7 @@ public class JoeyDownloadManager {
downloadListener = new JoeyDownloadListener() { downloadListener = new JoeyDownloadListener() {
@Override @Override
protected void completed(BaseDownloadTask task) { protected void completed(BaseDownloadTask task) {
YoungUtil.YoungLog("下载完成 --》 completed");
YoungUtil.YoungLog("Download " YoungUtil.YoungLog("Download "
+ task.getUrl() + task.getUrl()
+ " successful, [Size/Speed ==> " + " successful, [Size/Speed ==> "
@ -226,7 +227,7 @@ public class JoeyDownloadManager {
advertiseProcess.setProgress(String.valueOf(100)); advertiseProcess.setProgress(String.valueOf(100));
String progressJson = new Gson().toJson(advertiseProcess); String progressJson = new Gson().toJson(advertiseProcess);
YoungUtil.YoungLog("广告:"+task.getTag()+",下载完成进度100"); YoungUtil.YoungLog("广告:"+task.getTag()+",下载完成进度100");
WsManager.INSTANCE.send(progressJson); // WsManager.INSTANCE.send(progressJson);
try { try {
RefreshPlayer.refresh(); RefreshPlayer.refresh();
@ -307,17 +308,18 @@ public class JoeyDownloadManager {
if(soFarBytes >= totalBytes){ if(soFarBytes >= totalBytes){
try{ try{
Thread.sleep(500); Thread.sleep(500);
}catch (Exception e){} } catch (Exception e){}
AdvertiseProcess advertiseProcess =new AdvertiseProcess(); AdvertiseProcess advertiseProcess =new AdvertiseProcess();
advertiseProcess.setAd_id(task.getTag().toString()); advertiseProcess.setAd_id(task.getTag().toString());
advertiseProcess.setProgress(String.valueOf(100)); advertiseProcess.setProgress(String.valueOf(100));
String progressJson = new Gson().toJson(advertiseProcess); String progressJson = new Gson().toJson(advertiseProcess);
YoungUtil.YoungLog("广告:"+task.getTag().toString()+",下载完成进度100"); YoungUtil.YoungLog("广告:"+task.getTag().toString()+",下载完成进度100");
WsManager.INSTANCE.send(progressJson); // WsManager.INSTANCE.send(progressJson);
try{
Thread.sleep(500); // try{
}catch (Exception e){} // Thread.sleep(500);
WsManager.INSTANCE.send(progressJson); // }catch (Exception e){}
// WsManager.INSTANCE.send(progressJson);
} }
// if (progress%5==0){ // if (progress%5==0){
// AdvertiseProcess advertiseProcess =new AdvertiseProcess(); // AdvertiseProcess advertiseProcess =new AdvertiseProcess();

View File

@ -22,11 +22,11 @@ import cn.trans88.taxiappkotlin.ui.play.isOverdue
import cn.trans88.taxiappkotlin.util.YoungUtil import cn.trans88.taxiappkotlin.util.YoungUtil
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.JsonParser import com.google.gson.JsonParser
import com.google.gson.reflect.TypeToken
import com.trs88.kurolibrary.execute.KuroExecutor 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 {
@ -82,8 +82,13 @@ object ProcessingCommands {
"get_advertise_order" -> sendOrderInfo(task,baseTask.type) "get_advertise_order" -> sendOrderInfo(task,baseTask.type)
"update_player_log_switch" -> playLoggerSwitch(task,baseTask.type) "update_player_log_switch" -> playLoggerSwitch(task,baseTask.type)
"update_gps_log_switch" -> gpsSwitch(task,baseTask.type) "update_gps_log_switch" -> gpsSwitch(task,baseTask.type)
"soft_decode_switch" -> isSoftDecodeSwitch(task,baseTask.type)
//获取播放日志开关状态 //获取播放日志开关状态
"get_player_log_state" -> getLoggerSwitch(task,baseTask.type) "get_player_log_state" -> getLoggerSwitch(task,baseTask.type)
"get_soft_decode" -> getSoftDecodeState(task,baseTask.type)
//设置日志上传间隔
"set_log_interval" -> setLogInterval(task,baseTask.type)
"get_log_interval" -> getLogInterval(task,baseTask.type)
//获取gps日志开关状态 //获取gps日志开关状态
"get_gps_state" -> getGpsSwitch(task,baseTask.type) "get_gps_state" -> getGpsSwitch(task,baseTask.type)
"get_today_runtime" -> getTodayRuntime(task,baseTask.type) "get_today_runtime" -> getTodayRuntime(task,baseTask.type)
@ -109,7 +114,9 @@ object ProcessingCommands {
//edit by yzd @20211201 //edit by yzd @20211201
//Settings.gpsSwitch =gpsSwitch.isTurn_on //Settings.gpsSwitch =gpsSwitch.isTurn_on
Configurations.config(TaxiApp.instance()).gpsSwitchSave(gpsSwitch.isTurn_on) Configurations.config(TaxiApp.instance()).gpsSwitchSave(gpsSwitch.isTurn_on)
ConnManger.sendLocation() // ConnManger.sendLocation()
//edit by ljh @2024/2/29 定点数据上传优化
ConnManger.startLocationThread()
// if (gpsSwitch.isTurn_on){ // if (gpsSwitch.isTurn_on){
// ConnManger.sendLocation() // ConnManger.sendLocation()
// } // }
@ -150,9 +157,8 @@ object ProcessingCommands {
val sb = logException(e) val sb = logException(e)
YoungUtil.YoungLog("熙讯长连接执行命令出现异常: $sb") YoungUtil.YoungLog("熙讯长连接执行命令出现异常: $sb")
} }
} }
// /** // /**
// *发送排正在播放的广告信息 // *发送排正在播放的广告信息
// */ // */
@ -168,7 +174,7 @@ object ProcessingCommands {
val baseResponse = gson.fromJson<BaseResponse>(task) val baseResponse = gson.fromJson<BaseResponse>(task)
val sanleResponse = LoggerState() val sanleResponse = LoggerState()
val turn_on = Configurations.config(TaxiApp.instance()).loggerSwitch() val turn_on = Configurations.config(TaxiApp.instance()).loggerSwitch()
"getLoggerSwitch-->当前播放日志开关状态:$turn_on".logd() "getLoggerSwitch --> 当前播放日志开关状态:$turn_on".logd()
sanleResponse.type = type sanleResponse.type = type
sanleResponse.id = baseResponse.id sanleResponse.id = baseResponse.id
@ -176,6 +182,26 @@ object ProcessingCommands {
sanleResponse.turn_on = turn_on sanleResponse.turn_on = turn_on
val response = gson.toJson(sanleResponse) val response = gson.toJson(sanleResponse)
send(response) send(response)
//测试日志上传
// ConnManger.sendLogsSummary()
}
/**
* 获取日志上传间隔
*/
private fun getLogInterval(task: String, type: String) {
val baseResponse = gson.fromJson<BaseResponse>(task)
val intervalResponse = LogIntervalResponse()
val interval = Configurations.config(TaxiApp.instance()).logInterval()
"getLogInterval-->日志上传间隔:$interval".logd()
intervalResponse.type = type
intervalResponse.id = baseResponse.id
intervalResponse.task_id = baseResponse.task_id
intervalResponse.interval = interval
val response = gson.toJson(intervalResponse)
send(response)
} }
/** /**
@ -193,24 +219,50 @@ object ProcessingCommands {
sanleResponse.turn_on = turn_on sanleResponse.turn_on = turn_on
val response = gson.toJson(sanleResponse) val response = gson.toJson(sanleResponse)
send(response) send(response)
//debug
//测试软解码开关
// taxiApp.isSoftDecode = !taxiApp.isSoftDecode
//测试gps
// val lat2 = 22.665534200203726
// val lon2 = 113.91975187778473
// val lat3 = 23.665534200203726
// val lon3 = 114.91975187778473
// var isRun = true
// Timer().schedule(object :TimerTask(){
// override fun run() {
// if (isRun){
// "进圈".loge()
// taxiApp.activity?.getViewModel()?.onLocationChanged(lon2,lat2,2.0f,66.0f,1)
// isRun = false
// } else {
// "出圈".loge()
// taxiApp.activity?.getViewModel()?.onLocationChanged(lon3,lat3,2.0f,66.0f,1)
// isRun = true
// }
// }
// },0,3000L)
} }
/** /**
* 实时获取当天taixApp运行时间 * 实时获取本次启动后的taixApp运行时间
*/ */
private fun getTodayRuntime(task: String, type: String) { private fun getTodayRuntime(task: String, type: String) {
val baseResponse = gson.fromJson<BaseResponse>(task) val baseResponse = gson.fromJson<BaseResponse>(task)
val sanleResponse = TodayRunTime() val sanleResponse = TodayRunTime()
val startRuntime = Configurations.config(TaxiApp.instance()).startRunTime() // val startRuntime = Configurations.config(TaxiApp.instance()).startRunTime()
val endRuntime = Configurations.config(TaxiApp.instance()).endRunTime() // val endRuntime = Configurations.config(TaxiApp.instance()).endRunTime()
val sumRuntime = Configurations.config(TaxiApp.instance()).sumRunTime() val todaySumRunTime = Configurations.config(TaxiApp.instance()).todaySumRunTime()
val todayRuntime = endRuntime - startRuntime + sumRuntime "getTodayRuntime-->当天taxiApp运行时间$todaySumRunTime".logd()
"getTodayRuntime-->当前taxiApp运行时间$todayRuntime".logd() // val sumTimeList = DaoUtil.getRunTimeDao().queryBuilder().where(
// RunTimeDataDao.Properties.IsUpload.eq(0)).list()
sanleResponse.type = type sanleResponse.type = type
sanleResponse.id = baseResponse.id sanleResponse.id = baseResponse.id
sanleResponse.task_id = baseResponse.task_id sanleResponse.task_id = baseResponse.task_id
sanleResponse.runtime = todayRuntime sanleResponse.runtime = todaySumRunTime
// sanleResponse.runtime = sumTimeList.size.toLong()
val response = gson.toJson(sanleResponse) val response = gson.toJson(sanleResponse)
send(response) send(response)
} }
@ -228,7 +280,65 @@ object ProcessingCommands {
if (loggerSwitch.isTurn_on){ if (loggerSwitch.isTurn_on){
// ConnManger.loggerTimer?.cancel() // ConnManger.loggerTimer?.cancel()
// ConnManger.loggerTimer?.purge() // ConnManger.loggerTimer?.purge()
ConnManger.sendLogger()
// ConnManger.sendLogger()
ConnManger.startPlayLogThread()
}
baseResponse.type = type
val response = gson.toJson(baseResponse)
send(response)
}
/**
* 是否设置软解码
* @param task String
* @param type String
*/
private fun isSoftDecodeSwitch(task: String, type: String) {
val baseResponse = gson.fromJson<BaseResponse>(task)
val loggerSwitch = gson.fromJson<SoftDecode>(task)
//edit by ljh @2024/3/14
Configurations.config(TaxiApp.instance()).isSoftDecodeSave(loggerSwitch.isSoftDeCode)
taxiApp.isSoftDecode = loggerSwitch.isSoftDeCode
"是否软解码:${taxiApp.isSoftDecode}".logd()
baseResponse.type = type
val response = gson.toJson(baseResponse)
send(response)
}
/**
* 获取软解码开关状态
*/
private fun getSoftDecodeState(task: String, type: String) {
val baseResponse = gson.fromJson<BaseResponse>(task)
val sanleResponse = SoftDecodeState()
val turn_on = Configurations.config(TaxiApp.instance()).isSoftDecode()
"getSoftDecodeState --> 当前软解码开关状态开关状态:$turn_on".logd()
sanleResponse.type = type
sanleResponse.id = baseResponse.id
sanleResponse.task_id = baseResponse.task_id
sanleResponse.softDecode = turn_on
val response = gson.toJson(sanleResponse)
send(response)
}
/**
* 设置日志上传周期
*/
private fun setLogInterval(task: String, type: String) {
val baseResponse = gson.fromJson<BaseResponse>(task)
val loggerInterval = gson.fromJson<LogInterval>(task)
"设置上传日志周期:${loggerInterval.interval}".logd()
//edit by yzd @20211201
//Settings.loggerSwitch = loggerSwitch.isTurn_on
Configurations.config(TaxiApp.instance()).loggerSwitchSave(true)
if (loggerInterval.interval > -1){
Configurations.config(TaxiApp.instance()).logIntervalSave(loggerInterval.interval)
// ConnManger.sendLogSummaryByInterval(loggerInterval.interval)
} }
baseResponse.type = type baseResponse.type = type
@ -250,6 +360,7 @@ object ProcessingCommands {
beatTimer!!.cancel() beatTimer!!.cancel()
beatTimer!!.purge() beatTimer!!.purge()
beatTimer = null beatTimer = null
} }
beatTimer = Timer() beatTimer = Timer()
@ -281,7 +392,7 @@ object ProcessingCommands {
orderModel.task_id = baseResponse.task_id orderModel.task_id = baseResponse.task_id
orderModel.id = baseResponse.id orderModel.id = baseResponse.id
orderModel.type = type orderModel.type = type
orderModel.advertise_order =orderList orderModel.advertise_order = orderList
val response = gson.toJson(orderModel) val response = gson.toJson(orderModel)
@ -289,9 +400,25 @@ object ProcessingCommands {
} }
/** /**
*发送所有广告信息 * 发送所有广告信息
*/ */
private fun sendAllAdvertiseInfo(task: String, type: String) { private fun sendAllAdvertiseInfo(task: String, type: String) {
//提交未上传成功的下载进度
try {
val progressListJson = Configurations.config(taxiApp).progressList()
if (!progressListJson.isNullOrEmpty()){
"progressListJson:$progressListJson".logd()
val progressList = gson.fromJson<AdvertiseProcess>(progressListJson,object : TypeToken<Set<AdvertiseProcess>>(){}.type) as HashSet<AdvertiseProcess>
for (advertiseProcess in progressList) {
send(gson.toJson(advertiseProcess))
}
Configurations.config(taxiApp).progressListSave("")
taxiApp.processList.clear()
}
} catch (e: Exception) {
"exception:${e?.message}".loge()
}
val baseResponse = gson.fromJson<BaseResponse>(task) val baseResponse = gson.fromJson<BaseResponse>(task)
val positionAdvertises = DaoUtil.getPositionAdvertise().loadAll() val positionAdvertises = DaoUtil.getPositionAdvertise().loadAll()
@ -364,33 +491,6 @@ object ProcessingCommands {
private fun clearAdvertiseOrder(task: String, type: String?) { private fun clearAdvertiseOrder(task: String, type: String?) {
val advertiseOrder = gson.fromJson<AdvertiseOrder>(task) val advertiseOrder = gson.fromJson<AdvertiseOrder>(task)
"clearAdvertiseOrder".logd() "clearAdvertiseOrder".logd()
//日志存卡里
// taxiApp.saveLog("收到了清空排序指令...")
//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
// RefreshPlayer.refresh()
// }
//edit by ljh @2023/8/22 //edit by ljh @2023/8/22
// taxiApp.saveLog("clearAdvertiseOrder清除了广告排序") // taxiApp.saveLog("clearAdvertiseOrder清除了广告排序")
@ -406,7 +506,6 @@ object ProcessingCommands {
RefreshPlayer.refresh() RefreshPlayer.refresh()
} }
/** /**
@ -515,7 +614,7 @@ object ProcessingCommands {
val sanleResponse = SanleResponse() val sanleResponse = SanleResponse()
sanleResponse.task_id = taskId sanleResponse.task_id = taskId
sanleResponse.id =id sanleResponse.id = id
sanleResponse.type = type sanleResponse.type = type
val response = gson.toJson(sanleResponse) val response = gson.toJson(sanleResponse)
send(response) send(response)
@ -748,6 +847,12 @@ object ProcessingCommands {
sanleResponse.type = type sanleResponse.type = type
val response = gson.toJson(sanleResponse) val response = gson.toJson(sanleResponse)
send(response) send(response)
val advertiseProcess = AdvertiseProcess()
advertiseProcess.ad_id = positionAdvertise.task_id
advertiseProcess.progress = 100.toString()
val progressJson = Gson().toJson(advertiseProcess)
send(progressJson)
} }
/** /**
@ -933,7 +1038,7 @@ object ProcessingCommands {
"${task_id}计次播放,该广告播放次数为${sanleAdvertise.play_numbers}".logd() "${task_id}计次播放,该广告播放次数为${sanleAdvertise.play_numbers}".logd()
} }
if (time_section != null && time_section.size>0){ if (time_section != null && time_section.size>0 && !isCount){
isTimedAd = true isTimedAd = true
"${task_id}是分时段播放广告".loge() "${task_id}是分时段播放广告".loge()
} }
@ -964,6 +1069,12 @@ object ProcessingCommands {
sanleResponse.type = type sanleResponse.type = type
val response = gson.toJson(sanleResponse) val response = gson.toJson(sanleResponse)
send(response) send(response)
val advertiseProcess = AdvertiseProcess()
advertiseProcess.ad_id = sanleAdvertise.task_id
advertiseProcess.progress = 100.toString()
val progressJson = Gson().toJson(advertiseProcess)
send(progressJson)
// send("服务器日志 ${Xixun.getCardId()} 添加广告 id =${sanleAdvertise.id}") // send("服务器日志 ${Xixun.getCardId()} 添加广告 id =${sanleAdvertise.id}")
} }

View File

@ -14,6 +14,7 @@ import cn.trans88.taxiappkotlin.ext.logd
import cn.trans88.taxiappkotlin.ext.loge import cn.trans88.taxiappkotlin.ext.loge
import cn.trans88.taxiappkotlin.logic.Repository 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.AdvertiseProcess
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
import cn.trans88.taxiappkotlin.util.KuroTimerTask import cn.trans88.taxiappkotlin.util.KuroTimerTask
@ -357,7 +358,22 @@ object WsManager {
// if(!(heartbeatContext.equals(msg))){ // if(!(heartbeatContext.equals(msg))){
// Repository.taxiApp.saveLog("回复服务器 $msg") // Repository.taxiApp.saveLog("回复服务器 $msg")
// } // }
if (msg.contains("notify_download_ad_progress")) {
"notify_download_ad_progress ----> $msg".logd()
if (mWebSocket == null) {
try {
val process = Repository.taxiApp.gson.fromJson<AdvertiseProcess>(
msg,
AdvertiseProcess::class.java
)
Repository.taxiApp.processList.add(process)
val json = Repository.taxiApp.gson.toJson(Repository.taxiApp.processList)
Configurations.config(Repository.taxiApp).progressListSave(json)
} catch (e:Exception){
"exception${e?.message}".loge()
}
}
}
mWebSocket?.send(msg) mWebSocket?.send(msg)
// mWebSocket?.send(msg) ?: throw IllegalArgumentException("mWebSocket is null not send!") // mWebSocket?.send(msg) ?: throw IllegalArgumentException("mWebSocket is null not send!")
} }

View File

@ -0,0 +1,15 @@
package cn.trans88.taxiappkotlin.net
import com.zhouyou.http.model.ApiResult
/**
*
* @Author LJH
* @Time 2024/2/28
* @description
*/
class EasyHttpResult<T> :ApiResult<T>(){
var message:String = ""
}

View File

@ -0,0 +1,273 @@
package cn.trans88.taxiappkotlin.net
import cn.trans88.taxiappkotlin.Configurations
import cn.trans88.taxiappkotlin.TaxiApp
import cn.trans88.taxiappkotlin.ext.logd
import cn.trans88.taxiappkotlin.ext.loge
import cn.trans88.taxiappkotlin.logic.dao.AdvertiseDao
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil
import cn.trans88.taxiappkotlin.logic.dao.RunTimeDataDao
import cn.trans88.taxiappkotlin.logic.model.PlayLogger
import cn.trans88.taxiappkotlin.logic.model.RunTimeData
import cn.trans88.taxiappkotlin.logic.model.RuntimeJson
import cn.trans88.taxiappkotlin.logic.network.ProcessingCommands
import cn.trans88.taxiappkotlin.ui.advertise.AdvertiseType
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.zhouyou.http.EasyHttp
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody
import com.zhouyou.http.callback.SimpleCallBack
import com.zhouyou.http.exception.ApiException
import okhttp3.Request
import java.util.stream.Collectors
/**
*
* @Author LJH
* @Time 2024/2/28
* @description
*/
object EasyHttpTool {
/**
* 提交运行时长
* @param runtimeJson String
*/
fun sendRunTimeToServer(runtimeJson: String){
"sendRunTimeToServer run".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, runtimeJson)
EasyHttp.post(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postRunningTimeLog")
.readTimeOut(80*1000)
.writeTimeOut(80*1000)
.connectTimeout(80*1000)
.headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.headers("Accept-Encoding", "gzip")
.requestBody(body)
.retryCount(5)//本次请求重试次数
.retryDelay(600)//本次请求重试延迟时间600ms
.execute(object :SimpleCallBack<String>(){
override fun onError(e: ApiException?) {
"上传运行时长失败:${e?.message}".loge()
}
override fun onSuccess(t: String?) {
"上传运行时长成功:${t}".loge()
}
})
}
/**
* 提交运行时长
*/
fun sendRunTimeToServer(){
val sumTimeList = DaoUtil.getRunTimeDao().queryBuilder().where(
RunTimeDataDao.Properties.IsUpload.eq(0)).list()
"未提交的运行时长数量sumTimeList size: ${sumTimeList?.size}".logd()
if (!sumTimeList.isNullOrEmpty()){
for (runTimeData in sumTimeList) {
sendRunLogToServer(runTimeData)
// val runtimeJson = RuntimeJson(runTimeData.cardId,runTimeData.sumRuntime,runTimeData.startRuntime)
// val runtimeJsonStr = Gson().toJson(runtimeJson)
// "提交运行时长sendRunTimeToServer$runtimeJsonStr".logd()
// val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
// val body = RequestBody.create(parse, runtimeJsonStr)
// EasyHttp.post(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postRunningTimeLog")
// .readTimeOut(80*1000)
// .writeTimeOut(80*1000)
// .connectTimeout(80*1000)
// .headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
// .headers("Accept-Encoding", "gzip")
// .requestBody(body)
// .retryCount(1)//本次请求重试次数
// .retryDelay(1000)//本次请求重试延迟时间1000ms
// .execute(object :SimpleCallBack<String>(){
// override fun onError(e: ApiException?) {
// "上传运行时长失败:${e?.message}".loge()
// }
//
// override fun onSuccess(t: String?) {
// "上传运行时长成功:${t}".loge()
// runTimeData.isUpload = 1
// DaoUtil.getRunTimeDao().update(runTimeData)
// "将提交的runTimeData标记成已上传".logd()
// }
// })
}
// val lists:List<RuntimeJson> = sumTimeList.map {
// RuntimeJson(it.cardId,it.sumRuntime,it.startRuntime)
// }
// val runtimeJson = Gson().toJson(lists)
}
}
/**
* 上传1条运行日志
*/
fun sendRunLogToServer(runTimeData:RunTimeData){
// val logJson = ProcessingCommands.gson.toJson(dbPlayerLogs)
val runtimeJson = RuntimeJson(runTimeData.cardId,runTimeData.sumRuntime,runTimeData.startRuntime)
val runtimeJsonStr = Gson().toJson(runtimeJson)
"提交运行时长sendRunTimeToServer$runtimeJsonStr".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, runtimeJsonStr)
val url = Configurations.config(TaxiApp.instance()).logServiceUrl() + "postRunningTimeLog"
try {
val request = Request.Builder()
.url(url)
.addHeader("Authorization","Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.addHeader("Accept-Encoding","gzip")
.post(body)
.build()
val response = OkHttpTool.getInstance().client.newCall(request).execute()
"response code:${response?.code}".logd()
"response body:${response?.body?.string().toString()}".logd()
if (response.isSuccessful){
"上传运行时长成功".loge()
runTimeData.isUpload = 1
DaoUtil.getRunTimeDao().update(runTimeData)
"将提交的runTimeData标记成已上传".logd()
} else {
"上传运行时长失败".loge()
}
} catch (e: Exception) {
"上传运行时长失败:${e?.message}".loge()
}
}
/**
* 提交日志摘要
* @param gpsJson String
*/
fun sendPlayLogToServer(logJson: String){
"提交日志摘要 $logJson".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, logJson)
EasyHttp.post(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postPlayerLogPlus")
.readTimeOut(80*1000)
.writeTimeOut(80*1000)
.connectTimeout(80*1000)
.headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.headers("Accept-Encoding", "gzip")
.requestBody(body)
.retryCount(5) //本次请求重试次数
.retryDelay(600) //本次请求重试延迟时间600ms
.execute(object :SimpleCallBack<String>(){
override fun onError(e: ApiException?) {
"上传日志摘要失败:${e?.message}".loge()
}
override fun onSuccess(t: String?) {
"上传日志摘要成功 $t".loge()
}
})
}
/**
* 提交GPS数据
* @param gpsJson String
*/
fun sendGPSToServer(gpsJson: String){
"提交GPS数据 $gpsJson".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, gpsJson)
EasyHttp.post(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postGpsLocationLog")
.readTimeOut(80*1000)
.writeTimeOut(80*1000)
.connectTimeout(80*1000)
.headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.requestBody(body)
.retryCount(5) //本次请求重试次数
.retryDelay(600) //本次请求重试延迟时间600ms
.syncRequest(true)//设置同步请求
.execute(object :SimpleCallBack<String>(){
override fun onError(e: ApiException?) {
"上传GPS数据失败${e?.message}".loge()
}
override fun onSuccess(t: String?) {
"上传GPS数据成功 $t".loge()
}
})
}
/**
* 上传100条播放日志
*/
fun sendPlayLogToServer(dbPlayerLogs:List<PlayLogger>){
val logJson = ProcessingCommands.gson.toJson(dbPlayerLogs)
"提交日志Json $logJson".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, logJson)
val url = Configurations.config(TaxiApp.instance()).logServiceUrl() + "postPlayerLog"
try {
val request = Request.Builder()
.url(url)
.addHeader("Authorization","Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.addHeader("Accept-Encoding","gzip")
.post(body)
.build()
val response = OkHttpTool.getInstance().client.newCall(request).execute()
"response code:${response?.code}".logd()
"response body:${response?.body?.string().toString()}".logd()
if (response.isSuccessful){
"上传日志成功 ".logd()
DaoUtil.getPlayLogger().deleteInTx(dbPlayerLogs)
"删除日志成功".logd()
} else {
"上传日志失败".loge()
Thread.sleep(60*1000L)
}
} catch (e: Exception) {
"提交失败Exception:${e.message}".loge()
Thread.sleep(60*1000L)
}
// EasyHttp.post(url)
// .readTimeOut(80*1000)
// .writeTimeOut(80*1000)
// .connectTimeout(80*1000)
// .headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
// .headers("Accept-Encoding", "gzip")
// .requestBody(body)
// .retryCount(5) //本次请求重试次数
// .retryDelay(600) //本次请求重试延迟时间600ms
// .syncRequest(true)//设置同步请求
// .execute(object :SimpleCallBack<String>(){
// override fun onError(e: ApiException?) {
// "上传日志失败:${e?.message}".loge()
// try {
// Thread.sleep(60*1000L)
// } catch (e: Exception){
// "Exception:${e.message}".loge()
// e.printStackTrace()
// }
// }
//
// override fun onSuccess(t: String?) {
// "上传日志成功 $t".loge()
// DaoUtil.getPlayLogger().deleteInTx(tenPlayLogs)
// "删除日志成功".loge()
// }
// })
}
}

View File

@ -0,0 +1,74 @@
package cn.trans88.taxiappkotlin.net;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import okhttp3.Callback;
import okhttp3.Dns;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class OkHttpTool {
private OkHttpClient client;
private volatile static OkHttpTool instance;
public static OkHttpTool getInstance() {
if (instance == null) {
synchronized (OkHttpTool.class) {
if (instance == null) {
instance = new OkHttpTool();
}
}
}
return instance;
}
private OkHttpTool() {
client = new OkHttpClient.Builder()
.connectTimeout(80, TimeUnit.SECONDS)
.readTimeout(80,TimeUnit.SECONDS)
.writeTimeout(80,TimeUnit.SECONDS)
.build();
}
/**
* 发送异步请求
* @param url
* @param callback
*/
public void sendRequest(String url, Callback callback){
Request request = new Request.Builder()
.url(url).build();
client.newCall(request).enqueue(callback);
}
/**
* 发送同步请求
* @param url
* @return
* @throws IOException
*/
public Response sendSyncRequest(String url) throws IOException {
Request request = new Request.Builder().url(url).build();
return client.newCall(request).execute();
}
public OkHttpClient getClient(){
return client;
}
}

View File

@ -0,0 +1,57 @@
package cn.trans88.taxiappkotlin.ui.play;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
import cn.trans88.taxiappkotlin.R;
/**
* 无任何控制ui的播放
* Created by guoshuyu on 2017/8/6.
*/
public class EmptyControlVideo extends StandardGSYVideoPlayer {
public EmptyControlVideo(Context context, Boolean fullFlag) {
super(context, fullFlag);
}
public EmptyControlVideo(Context context) {
super(context);
}
public EmptyControlVideo(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public int getLayoutId() {
return R.layout.empty_control_video;
}
@Override
protected void touchSurfaceMoveFullLogic(float absDeltaX, float absDeltaY) {
super.touchSurfaceMoveFullLogic(absDeltaX, absDeltaY);
//不给触摸快进如果需要屏蔽下方代码即可
mChangePosition = false;
//不给触摸音量如果需要屏蔽下方代码即可
mChangeVolume = false;
//不给触摸亮度如果需要屏蔽下方代码即可
mBrightness = false;
}
// @Override
// protected void touchDoubleUp() {
// //super.touchDoubleUp();
// //不需要双击暂停
// }
@Override
protected void touchDoubleUp(MotionEvent e) {
//super.touchDoubleUp();
//不需要双击暂停
}
}

View File

@ -33,8 +33,10 @@ import cn.trans88.taxiappkotlin.logic.dao.PlayLoggerDao
import cn.trans88.taxiappkotlin.logic.gps.GpsReceiver 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.model.Location import cn.trans88.taxiappkotlin.logic.model.Location
import cn.trans88.taxiappkotlin.logic.model.RunTimeData
import cn.trans88.taxiappkotlin.logic.model.RuntimeJson import cn.trans88.taxiappkotlin.logic.model.RuntimeJson
import cn.trans88.taxiappkotlin.logic.network.* import cn.trans88.taxiappkotlin.logic.network.*
import cn.trans88.taxiappkotlin.net.EasyHttpTool
import cn.trans88.taxiappkotlin.play.RefreshPlayer 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.broadcaskReceiver.BusCallback import cn.trans88.taxiappkotlin.ui.broadcaskReceiver.BusCallback
@ -54,11 +56,16 @@ import com.permissionx.guolindev.PermissionX
import com.trs88.kurolibrary.execute.KuroExecutor import com.trs88.kurolibrary.execute.KuroExecutor
import com.trs88.kurolibrary.util.MainHandler import com.trs88.kurolibrary.util.MainHandler
import com.xixun.xy.conn.aidl.ConnService import com.xixun.xy.conn.aidl.ConnService
import com.zhouyou.http.EasyHttp
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import java.io.File import java.io.File
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
import java.util.* import java.util.*
import kotlin.concurrent.thread
//未校时或没网时卡的初始时间存在为1970年的情况
// 时间至少大于1970-10-02 00:21:26才有可能已经校时完成
const val NOVALIDTIME = 23646086L
class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreenSizeListener { class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreenSizeListener {
val CREATE_VIEW_MSG = 11111111 val CREATE_VIEW_MSG = 11111111
@ -77,6 +84,7 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
private var saveRuntimeTimer:Timer? = null private var saveRuntimeTimer:Timer? = null
private var startSaveRunTimer:Timer? = null private var startSaveRunTimer:Timer? = null
private var sumTimeTimer:Timer? = null
val handler = MyHandler(this) val handler = MyHandler(this)
@ -93,6 +101,8 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
YoungUtil.YoungLog("playActivity onCreate") YoungUtil.YoungLog("playActivity onCreate")
TaxiApp.isActive = true TaxiApp.isActive = true
ConnManger.sendGPSLogSwitch = false
ConnManger.sendPlayerLogSwitch = false
//防止息屏 //防止息屏
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
@ -128,7 +138,9 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
val loggerSwitch = Configurations.config(this).loggerSwitch() val loggerSwitch = Configurations.config(this).loggerSwitch()
val gpsSwitch = Configurations.config(this).gpsSwitch() val gpsSwitch = Configurations.config(this).gpsSwitch()
"loggerSwitch ------> $loggerSwitch,gpsSwitch -----------> $gpsSwitch".logd() val isSoftDecode = Configurations.config(this).isSoftDecode()
taxiApp.isSoftDecode = isSoftDecode
"loggerSwitch ------> $loggerSwitch,gpsSwitch -----------> $gpsSwitch,isSoftDecode----->$isSoftDecode".logd()
JoeyDownloadManager.getInstance().setCallBack(this) JoeyDownloadManager.getInstance().setCallBack(this)
@ -170,7 +182,7 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
customView() customView()
Thread(Runnable { clearOverdueLogger() }).start() // Thread(Runnable { clearOverdueLogger() }).start()
val serverIntent = Intent(this, PlayServer::class.java) val serverIntent = Intent(this, PlayServer::class.java)
startService(serverIntent) startService(serverIntent)
//开机不管同步不同步直接先放 //开机不管同步不同步直接先放
@ -187,11 +199,68 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
} }
mLocationManager?.removeUpdates(getLocationListener()) mLocationManager?.removeUpdates(getLocationListener())
} }
saveStartTime()
},30 * 1000) },30 * 1000)
saveStartTimeThread()
// testLocation() // testLocation()
} }
fun saveStartTimeThread(){
thread {
while (true) {
var cacheStartTime:Long = configurations.startRunTime()
var currentTime = System.currentTimeMillis()
"saveStartTimeThread ---> 当前系统时间currentTime:$currentTime".loge()
"saveStartTimeThread ---> 上一次的启动时间cacheStartTime:$cacheStartTime".loge()
if (currentTime > NOVALIDTIME && currentTime > cacheStartTime) {
//如果上一次启动时间和当前时间相比是第二天重置当天的总运行时长todaySunRuntime
var dayType = DateUtil.getDaysDiff(currentTime,cacheStartTime)
if (dayType != DayType.IS_SAME_DAY.ordinal){
"第二天了,重置当天的运行时长".logd()
configurations.todaySumRunTimeSave(0)
}
//删除已提交的运行时长数据
DaoUtil.deleteIsUpRunTimeData()
//如果上次缓存的总运行时长大于0,取出存到数据库中
val cacheSumTime = configurations.sumRunTime()
"cacheSumTime ---> 上一次的运行时长cacheSumTime:$cacheSumTime".loge()
if (cacheSumTime > 0 && cacheStartTime > NOVALIDTIME){
val cardId = configurations.cardId()
val runTimeData = RunTimeData()
runTimeData.cardId = cardId
runTimeData.sumRuntime = cacheSumTime
runTimeData.isUpload = 0
runTimeData.startRuntime = cacheStartTime
DaoUtil.getRunTimeDao().insert(runTimeData)
}
//重新初始化startRunTime为当前启动时间,sumRuntime为0
configurations.startRunTimeSave(currentTime)
configurations.sumRunTimeSave(0)
//开启定时器让sumRunTime累加
startSaveSumTimer()
//提交未上传的运行时长数据
EasyHttpTool.sendRunTimeToServer()
//跳出循环
break
} else {
"系统时间尚未校时80s后重新获取系统时间".loge()
try {
Thread.sleep(80*1000)
} catch (e:Exception) {
e.printStackTrace()
}
}
}
}
}
/** /**
* 保存开始运行时间 * 保存开始运行时间
*/ */
@ -199,7 +268,8 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
var cacheStartTime:Long = configurations.startRunTime() var cacheStartTime:Long = configurations.startRunTime()
var currentTime = System.currentTimeMillis() var currentTime = System.currentTimeMillis()
"saveStartTime ---> currentTime:$currentTime".loge() "saveStartTime ---> currentTime:$currentTime".loge()
if (currentTime>23646086L){
if (currentTime > NOVALIDTIME && currentTime > cacheStartTime){
startSaveRunTimer?.let { startSaveRunTimer?.let {
it.purge() it.purge()
@ -210,13 +280,31 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
var dayType = DateUtil.getDaysDiff(currentTime,cacheStartTime) var dayType = DateUtil.getDaysDiff(currentTime,cacheStartTime)
when(dayType){ when(dayType){
DayType.IS_OTHER_DAY.ordinal -> { //如果缓存的启动时间是三天前(或更久)了,或者为零,直接覆盖 DayType.IS_OTHER_DAY.ordinal -> { //如果缓存的启动时间是三天前(或更久)了,或者为零,直接覆盖
configurations.logSummaryJsonStringSave("")
Thread(Runnable { clearOverdueLogger() }).start()
isSendedLog = false
sendLogInterval()
"startRunTimeendRunTime初始化为$currentTime".loge() "startRunTimeendRunTime初始化为$currentTime".loge()
configurations.startRunTimeSave(currentTime) configurations.startRunTimeSave(currentTime)
configurations.endRunTimeSave(currentTime) configurations.endRunTimeSave(currentTime)
configurations.sumRunTimeSave(0L) configurations.firstRunTimeSave(currentTime)
configurations.sumRunTimeSave(0)
configurations.runtimeJsonStringSave("")
startRuntimeTimer() startRuntimeTimer()
} }
DayType.IS_SAME_DAY.ordinal -> {//同一天重启 DayType.IS_SAME_DAY.ordinal -> {//同一天重启
isSendedLog = false
// val logSummaryJson = configurations.logSummaryJsonString()
// if (!logSummaryJson.isNullOrEmpty()){
// "同一天重启,之前的日志数据没传,重新上传".loge()
// ConnManger.sendLogsSummary()
// } else {
// isSendedLog = false
// }
sendLogInterval()
//先计算上次重启前的运行时间 //先计算上次重启前的运行时间
val lastSumTime = configurations.sumRunTime() val lastSumTime = configurations.sumRunTime()
val lastStartRuntime = configurations.startRunTime() val lastStartRuntime = configurations.startRunTime()
@ -229,11 +317,15 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
"程序启动,目前运行时间(毫秒):${todaySumRuntime}".loge() "程序启动,目前运行时间(毫秒):${todaySumRuntime}".loge()
//测试上报接口 //测试上报接口
// val runtimeJson = RuntimeJson(configurations.cardId(),todaySumRuntime,System.currentTimeMillis()) // val runtimeJson = RuntimeJson(configurations.cardId(),todaySumRuntime,lastStartRuntime)
// val jsonStr = Gson().toJson(runtimeJson)
// "测试数据:$jsonStr".loge()
// configurations.runtimeJsonStringSave(Gson().toJson(runtimeJson)) // configurations.runtimeJsonStringSave(Gson().toJson(runtimeJson))
if (!configurations.runtimeJsonString().isNullOrEmpty()){ // if (!configurations.runtimeJsonString().isNullOrEmpty()){
ConnManger.sendRuntimeToWeb() // ConnManger.sendRuntimeToWeb()
} // }
//保存新的开始运行时间,和结束时间 //保存新的开始运行时间,和结束时间
configurations.startRunTimeSave(currentTime) configurations.startRunTimeSave(currentTime)
@ -241,6 +333,8 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
startRuntimeTimer() startRuntimeTimer()
} }
DayType.IS_SECOND_DAY.ordinal -> { DayType.IS_SECOND_DAY.ordinal -> {
// ConnManger.sendLogsSummary()
sendLogInterval()
//先计算上次重启前的运行时间 //先计算上次重启前的运行时间
val lastSumTime = configurations.sumRunTime() val lastSumTime = configurations.sumRunTime()
val lastStartRuntime = configurations.startRunTime() val lastStartRuntime = configurations.startRunTime()
@ -251,19 +345,26 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
val yesterdaySumTime = lastRunTime + lastSumTime val yesterdaySumTime = lastRunTime + lastSumTime
"程序启动,昨天运行时间(毫秒):${yesterdaySumTime}".loge() "程序启动,昨天运行时间(毫秒):${yesterdaySumTime}".loge()
//提交昨天一整天的运行时间 //提交昨天一整天的运行时间
val runtimeJson = RuntimeJson(configurations.cardId(),yesterdaySumTime,System.currentTimeMillis()) val firstRuntime = configurations.firstRunTime()
configurations.runtimeJsonStringSave(Gson().toJson(runtimeJson)) val runtimeJson = RuntimeJson(configurations.cardId(),yesterdaySumTime,firstRuntime)
ConnManger.sendRuntimeToWeb() // configurations.runtimeJsonStringSave(Gson().toJson(runtimeJson))
//edit by ljh on 2024/2/28
//优化上传运行时长方式
EasyHttpTool.sendRunTimeToServer(Gson().toJson(runtimeJson))
// ConnManger.sendRuntimeToWeb()
//保存新的开始运行时间,和结束时间 //保存新的开始运行时间,和结束时间
configurations.startRunTimeSave(currentTime) configurations.startRunTimeSave(currentTime)
configurations.endRunTimeSave(currentTime) configurations.endRunTimeSave(currentTime)
configurations.sumRunTimeSave(0L) configurations.firstRunTimeSave(currentTime)
configurations.sumRunTimeSave(0)
startRuntimeTimer() startRuntimeTimer()
} }
else -> { else -> {
configurations.startRunTimeSave(currentTime) configurations.startRunTimeSave(currentTime)
configurations.endRunTimeSave(currentTime) configurations.endRunTimeSave(currentTime)
configurations.sumRunTimeSave(0L) configurations.firstRunTimeSave(currentTime)
configurations.sumRunTimeSave(0)
sendLogInterval()
} }
} }
} else { } else {
@ -276,8 +377,60 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
},30*1000L,30*1000L) },30*1000L,30*1000L)
} }
} }
}
/**
* 定时传日志摘要
*/
private fun sendLogInterval(){
val logInterval = configurations.logInterval()
"logInterval:$logInterval".logd()
if (logInterval > 0){
// ConnManger.sendLogSummaryByInterval(logInterval)
}
}
/**
* 启动计算运行时长的计时器
*/
private fun startSaveSumTimer(){
sumTimeTimer?.purge()
sumTimeTimer?.cancel()
sumTimeTimer = Timer()
"计算运行时长的计时器启动".logd()
sumTimeTimer?.schedule(object : TimerTask(){
override fun run() {
val startRuntime = configurations.startRunTime()
val currentTime = System.currentTimeMillis()
val currentType = DateUtil.getDaysDiff(currentTime,startRuntime)
var cacheSumRunTime = configurations.sumRunTime()
var cacheTodaySumRunTime = configurations.todaySumRunTime()
if (currentType == DayType.IS_SECOND_DAY.ordinal){
"当前时间已经是第二天了,记录一次".logd()
val cardId = configurations.cardId()
val rumTimeData = RunTimeData()
rumTimeData.isUpload = 0
rumTimeData.cardId = cardId
rumTimeData.sumRuntime = cacheSumRunTime
rumTimeData.startRuntime = startRuntime
DaoUtil.getRunTimeDao().insert(rumTimeData)
//重新初始化startRunTime为当前启动时间,sumRuntime为0
configurations.startRunTimeSave(currentTime)
configurations.sumRunTimeSave(0)
configurations.todaySumRunTimeSave(0)
cacheTodaySumRunTime = 0
cacheSumRunTime = 0
}
//每30s累加一次
"当前运行时长cacheSumRunTime${cacheSumRunTime},累加30s".logd()
configurations.sumRunTimeSave(cacheSumRunTime+30*1000L)
configurations.todaySumRunTimeSave(cacheTodaySumRunTime+30*1000L)
}
},30*1000L,30*1000L)
} }
/** /**
@ -293,18 +446,44 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
override fun run() { override fun run() {
val endRuntime = configurations.endRunTime() val endRuntime = configurations.endRunTime()
val startRuntime = configurations.startRunTime() val startRuntime = configurations.startRunTime()
val currentTime = System.currentTimeMillis()
"RuntimeTimer --> currentEndRuntime:$endRuntime".loge() "RuntimeTimer --> currentEndRuntime:$endRuntime".loge()
val type = DateUtil.getDaysDiff(endRuntime,startRuntime) val type = DateUtil.getDaysDiff(endRuntime,startRuntime)
val currentType = DateUtil.getDaysDiff(currentTime,startRuntime)
val isSecond = DayType.IS_SECOND_DAY.ordinal == currentType
// if (isSecond && Repository.taxiApp.sendLogTimes == 0) {
// //当前时间被手动设置成第二天了,提交一次运行时长数据
// isSendedLog = true
// val lastRunTime = endRuntime - startRuntime
// val yesterdayRuntime = configurations.sumRunTime() + lastRunTime
// //提交昨天一整天的运行时间
// val firstRuntime = configurations.firstRunTime()
// val runtimeJson = RuntimeJson(configurations.cardId(),yesterdayRuntime,firstRuntime)
// configurations.runtimeJsonStringSave(Gson().toJson(runtimeJson))
// ConnManger.sendRuntimeToWeb()
//
// //提交一次日志数据
// ConnManger.sendLogsSummary()
//
// Repository.taxiApp.sendLogTimes = 1
// }
if (DayType.IS_SECOND_DAY.ordinal == type) { if (DayType.IS_SECOND_DAY.ordinal == type) {
// ConnManger.sendLogsSummary()
val lastRunTime = endRuntime - startRuntime val lastRunTime = endRuntime - startRuntime
val yesterdayRuntime = configurations.sumRunTime() + lastRunTime val yesterdayRuntime = configurations.sumRunTime() + lastRunTime
//提交昨天一整天的运行时间 //提交昨天一整天的运行时间
val runtimeJson = RuntimeJson(configurations.cardId(),yesterdayRuntime,System.currentTimeMillis()) val firstRuntime = configurations.firstRunTime()
configurations.runtimeJsonStringSave(Gson().toJson(runtimeJson)) val runtimeJson = RuntimeJson(configurations.cardId(),yesterdayRuntime,firstRuntime)
ConnManger.sendRuntimeToWeb() // configurations.runtimeJsonStringSave(Gson().toJson(runtimeJson))
// ConnManger.sendRuntimeToWeb()
//edit by ljh on 2024/2/28
EasyHttpTool.sendRunTimeToServer(Gson().toJson(runtimeJson))
//保存新的开始运行时间,和结束时间 //保存新的开始运行时间,和结束时间
configurations.startRunTimeSave(endRuntime) configurations.startRunTimeSave(endRuntime)
configurations.sumRunTimeSave(0L) configurations.firstRunTimeSave(endRuntime)
configurations.sumRunTimeSave(0)
} }
configurations.endRunTimeSave(endRuntime+30*1000L) configurations.endRunTimeSave(endRuntime+30*1000L)
@ -351,6 +530,7 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
override fun onServiceConnected(name: ComponentName?, service: IBinder?) { override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
YoungUtil.YoungLog("bindService onServiceConnected") YoungUtil.YoungLog("bindService onServiceConnected")
connService = ConnService.Stub.asInterface(service) connService = ConnService.Stub.asInterface(service)
ConnManger.setConnService(connService) ConnManger.setConnService(connService)
ConnManger.registerApp() ConnManger.registerApp()
@ -409,7 +589,7 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
val overdueTime = currentTimeMillis - 30 * 24 * 60 * 60 * 1000 val overdueTime = currentTimeMillis - 30 * 24 * 60 * 60 * 1000
//lt < gt > ge >= le <= //lt < gt > ge >= le <=
DaoUtil.getPlayLoggerDao().queryBuilder().where(PlayLoggerDao.Properties.Created_at.lt(overdueTime)).buildDelete().executeDeleteWithoutDetachingEntities() DaoUtil.getPlayLoggerDao().queryBuilder().where(PlayLoggerDao.Properties.Created_at.lt(overdueTime)).buildDelete().executeDeleteWithoutDetachingEntities()
"清除日志后,当前日志数量:${DaoUtil.getPlayLoggers().size}".logd()
} }
/** /**
@ -445,7 +625,6 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
busLayoutParams.width = Configurations.config(TaxiApp.instance()).screenSizeX() / 7 busLayoutParams.width = Configurations.config(TaxiApp.instance()).screenSizeX() / 7
busLayoutParams.height = Configurations.config(TaxiApp.instance()).screenSizeY() busLayoutParams.height = Configurations.config(TaxiApp.instance()).screenSizeY()
img_bus_top.visibility = View.VISIBLE img_bus_top.visibility = View.VISIBLE
val program = File(TaxiApp.instance().filesDir, TaxiApp.instance().getString(string.dir_program)) val program = File(TaxiApp.instance().filesDir, TaxiApp.instance().getString(string.dir_program))
@ -495,9 +674,10 @@ class PlayActivity : AppCompatActivity(), NetworkCallback, BusCallback, OnScreen
*/ */
fun cancelCustomView(){ fun cancelCustomView(){
YoungUtil.YoungLog("取消自定义显示,路线、左转右转等..") YoungUtil.YoungLog("取消自定义显示,路线、左转右转等..")
runOnUiThread{
ll_bus.visibility = View.GONE ll_bus.visibility = View.GONE
img_other_screen.visibility = View.GONE img_other_screen.visibility = View.GONE
}
fl_play.apply { fl_play.apply {
val logoView = this.findViewWithTag<View>("logo") val logoView = this.findViewWithTag<View>("logo")

View File

@ -25,6 +25,7 @@ import cn.trans88.taxiappkotlin.TaxiApp
import cn.trans88.taxiappkotlin.TaxiApp.Companion.HAOSHENG import cn.trans88.taxiappkotlin.TaxiApp.Companion.HAOSHENG
import cn.trans88.taxiappkotlin.ext.logd import cn.trans88.taxiappkotlin.ext.logd
import cn.trans88.taxiappkotlin.ext.loge import cn.trans88.taxiappkotlin.ext.loge
import cn.trans88.taxiappkotlin.logic.Repository
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.TextInfo import cn.trans88.taxiappkotlin.logic.model.TextInfo
@ -37,6 +38,7 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.RequestOptions
import com.google.gson.Gson import com.google.gson.Gson
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import kotlinx.android.synthetic.main.activity_main.view.* import kotlinx.android.synthetic.main.activity_main.view.*
import java.io.File import java.io.File
@ -134,51 +136,69 @@ fun View.createView(context: Context, advertise: Advertise, seek: Int): View? {
// YoungUtil.YoungLog("初始化视频控件耗时:${currentTimeMillis - System.currentTimeMillis()}") // YoungUtil.YoungLog("初始化视频控件耗时:${currentTimeMillis - System.currentTimeMillis()}")
// video = jVideoView // video = jVideoView
// } // }
if (Repository.taxiApp.isSoftDecode){
//MediaPlayer "SoftDecode 使用的是软解码".logd()
// YoungUtil.YoungLog("素材是视频:${Configurations.config(TaxiApp.instance()).downloadUrl()}${advertise.media_url}") //ijk GSYPlayer
val currentTimeMillis = System.currentTimeMillis() val videoPlayer = EmptyControlVideo(context)
videoPlayer.setUp(advertise.pathName,true,"")
val jVideoView = JVideoView(context) videoPlayer.startPlayLogic()
videoPlayer.setVideoAllCallBack(object : GSYSampleCallBack(){
jVideoView.videoPath = advertise.pathName override fun onPrepared(url: String?, vararg objects: Any?) {
super.onPrepared(url, *objects)
jVideoView.setOnPreparedListener { mediaPlayer -> "视频准备完成".logd()
mediaPlayer.isLooping = false }
YoungUtil.YoungLog("视频准备完成,当前线程${Looper.getMainLooper().thread === Thread.currentThread()}") })
YoungUtil.YoungLog("视频的播放时长${jVideoView.duration}") video = videoPlayer
try { } else {
mediaPlayer.start() "使用的是硬解码".logd()
} catch (e:Exception){ //MediaPlayer
"播放异常:${e.printStackTrace()}".loge() YoungUtil.YoungLog("素材是视频:${Configurations.config(TaxiApp.instance()).downloadUrl()}${advertise.media_url}")
if (mediaPlayer.isLooping){ val currentTimeMillis = System.currentTimeMillis()
mediaPlayer.stop()
val jVideoView = JVideoView(context)
jVideoView.videoPath = advertise.pathName
jVideoView.setOnPreparedListener { mediaPlayer ->
mediaPlayer.isLooping = false
YoungUtil.YoungLog("视频准备完成,当前线程${Looper.getMainLooper().thread === Thread.currentThread()}")
YoungUtil.YoungLog("视频的播放时长${jVideoView.duration}")
try {
mediaPlayer.start()
} catch (e:Exception){
"播放异常:${e.printStackTrace()}".loge()
if (mediaPlayer.isLooping){
mediaPlayer.stop()
}
mediaPlayer.reset()
jVideoView.videoPath = advertise.pathName
mediaPlayer.prepare()
mediaPlayer.start()
} }
mediaPlayer.reset()
jVideoView.videoPath = advertise.pathName
mediaPlayer.prepare()
mediaPlayer.start()
} }
jVideoView.setOnErrorListener { mp, what, ext ->
val whatMsg = when(what){
MediaPlayer.MEDIA_ERROR_UNKNOWN -> "UNKNOWN_error"
else -> "SERVER_DIED"
}
val extraMsg = when(ext){
MediaPlayer.MEDIA_ERROR_IO -> {
"IO_Error"
}
MediaPlayer.MEDIA_ERROR_MALFORMED -> "ERROR_MALFORMED"
MediaPlayer.MEDIA_ERROR_UNSUPPORTED -> "ERROR_UNSUPPORTED"
else -> "ERROR_TIMED_OUT"
}
"extraMsg:$extraMsg,whatMsg:$whatMsg".loge()
true
}
YoungUtil.YoungLog("初始化视频控件耗时:${currentTimeMillis - System.currentTimeMillis()}")
video = jVideoView
} }
jVideoView.setOnErrorListener { mp, what, ext ->
val whatMsg = when(what){
MediaPlayer.MEDIA_ERROR_UNKNOWN -> "UNKNOWN_error"
else -> "SERVER_DIED"
}
val extraMsg = when(ext){
MediaPlayer.MEDIA_ERROR_IO -> {
"IO_Error"
}
MediaPlayer.MEDIA_ERROR_MALFORMED -> "ERROR_MALFORMED"
MediaPlayer.MEDIA_ERROR_UNSUPPORTED -> "ERROR_UNSUPPORTED"
else -> "ERROR_TIMED_OUT"
}
"extraMsg:$extraMsg,whatMsg:$whatMsg".loge()
true
}
YoungUtil.YoungLog("初始化视频控件耗时:${currentTimeMillis - System.currentTimeMillis()}")
video = jVideoView
//其他 //其他
// if (Build.VERSION.SDK_INT >= 26) { // if (Build.VERSION.SDK_INT >= 26) {

View File

@ -72,6 +72,7 @@ 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 org.greenrobot.greendao.query.LazyList
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.io.File
import java.util.* import java.util.*
@ -80,6 +81,12 @@ import java.util.*
* 所有与界面相关的数据都应该放在ViewModel中 * 所有与界面相关的数据都应该放在ViewModel中
*/ */
//todo 这里不应该持有ui应该要建立对应的livedata去回调给ui //todo 这里不应该持有ui应该要建立对应的livedata去回调给ui
//如果是第二天但是第一天日志没传完就设为true
var isSendedLog: Boolean = true
//从缓存获取次数达到8888次后从数据库获取一次数据并更新缓存
const val MAX_CACHE: Int = 8888
// 跳跃点的距离阈值,单位为米
const val JUMP_THRESHOLD = 10000.0f
class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout, private val imageView: ImageView) : ViewModel(), GpsInformationListener, IPlay, LifecycleObserver { class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout, private val imageView: ImageView) : ViewModel(), GpsInformationListener, IPlay, LifecycleObserver {
private val providerMap = HashMap<String,String>() private val providerMap = HashMap<String,String>()
@ -499,6 +506,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
if(!advertise.isCount){ if(!advertise.isCount){
setCurAdvertise(advertise) setCurAdvertise(advertise)
} else {
curAdvertise = advertise
} }
//edit by yzd @2022-09-09 //edit by yzd @2022-09-09
@ -569,6 +578,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//view.startAnimation(addAnim) //view.startAnimation(addAnim)
fl_play.addView(view) fl_play.addView(view)
// fl_play.addView(view)
removeView() removeView()
@ -592,17 +602,22 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//用来防止有多余的view没有删除。 //用来防止有多余的view没有删除。
if (fl_play.childCount > 1) { if (fl_play.childCount > 1) {
fl_play.post { fl_play.postDelayed({
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]
//edit by ljh on2024/5/9
if (childView is EmptyControlVideo) {
"上一个图层是软解码视图释放资源is EmptyControlVideo".loge()
childView.release()
}
if (childView != null) { if (childView != null) {
fl_play.removeView(childView) fl_play.removeView(childView)
} }
} }
} },2000L)
// fl_play.postDelayed({ // fl_play.postDelayed({
// YoungUtil.YoungLog("删除ViewFrameLayout有多少子视图${fl_play.childCount}") // YoungUtil.YoungLog("删除ViewFrameLayout有多少子视图${fl_play.childCount}")
@ -786,6 +801,8 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
} }
} }
var cachePlayLoggers = ArrayList<PlayLogger>()
/** /**
* 将curLogger设置为播放完成后存储到LoggerContainer中并将curLogger清空 * 将curLogger设置为播放完成后存储到LoggerContainer中并将curLogger清空
*/ */
@ -796,9 +813,10 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
curLogger!!.end_play_ts = System.currentTimeMillis() curLogger!!.end_play_ts = System.currentTimeMillis()
// val roundingDuration = Math.ceil((curLogger!!.duration.toDouble() / 1000)) * 1000 // val roundingDuration = Math.ceil((curLogger!!.duration.toDouble() / 1000)) * 1000
// curLogger!!.duration = roundingDuration.toLong() // curLogger!!.duration = roundingDuration.toLong()
// DaoUtil.getPlayLoggerDao().insert(curLogger)
DaoUtil.getPlayLoggerDao().insert(curLogger)
"存储日志:${curLogger?.begin_play_ts}".loge() "存储日志:${curLogger?.begin_play_ts}".loge()
// "当前日志数量:${DaoUtil.getPlayLoggers().size}".logd()
DaoUtil.getPlayLoggerDao().insert(curLogger)
} }
curLogger = null curLogger = null
} }
@ -883,7 +901,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//edit by ljh @2023/8/28 //edit by ljh @2023/8/28
regionCacheSwitch -= 1 regionCacheSwitch -= 1
if (regionCacheSwitch<=0){ if (regionCacheSwitch<=0){
regionCacheSwitch = 8888 regionCacheSwitch = MAX_CACHE
taxiApp.regionsList.clear() taxiApp.regionsList.clear()
} }
// val regions = DaoUtil.getRegion().loadAll() // val regions = DaoUtil.getRegion().loadAll()
@ -898,6 +916,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
list list
} }
"regions.size:${regions.size}".logd() "regions.size:${regions.size}".logd()
var isRefresh = false
for (region in regions) { for (region in regions) {
"regionAdId:${region.regionAdId},index:${regions.indexOf(region)}".logd() "regionAdId:${region.regionAdId},index:${regions.indexOf(region)}".logd()
YoungUtil.YoungLog("当前两点间距离:${DistanceUtil.getDistance(region.lat, region.lng, latitude, longitude)}") YoungUtil.YoungLog("当前两点间距离:${DistanceUtil.getDistance(region.lat, region.lng, latitude, longitude)}")
@ -919,7 +938,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
taxiApp.regionsList.clear() taxiApp.regionsList.clear()
DaoUtil.getRegion().update(region) DaoUtil.getRegion().update(region)
} }
}else{ } else {
DaoUtil.getRegion().update(region) DaoUtil.getRegion().update(region)
} }
@ -941,7 +960,11 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//edit by ljh @2023/8/15 //edit by ljh @2023/8/15
taxiApp.daoAds.clear() taxiApp.daoAds.clear()
RefreshPlayer.refresh() //edit by ljh @2023/12/12 刷新定点广告
Repository.cancelTimer()
isRefresh = true
// RefreshPlayer.refresh()
} else { } else {
YoungUtil.YoungLog("positionAdvertise is null"); YoungUtil.YoungLog("positionAdvertise is null");
} }
@ -957,13 +980,13 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
val reg = DaoUtil.getRegion().queryBuilder().where(RegionsDao.Properties.AutoId.eq(region.autoId)).unique() val reg = DaoUtil.getRegion().queryBuilder().where(RegionsDao.Properties.AutoId.eq(region.autoId)).unique()
if (reg != null){ if (reg != null){
reg.isInRegion = true reg.isInRegion = false
DaoUtil.getRegion().update(reg) DaoUtil.getRegion().update(reg)
} else { } else {
taxiApp.regionsList.clear() taxiApp.regionsList.clear()
DaoUtil.getRegion().update(region) DaoUtil.getRegion().update(region)
} }
}else{ } else {
DaoUtil.getRegion().update(region) DaoUtil.getRegion().update(region)
} }
@ -972,13 +995,21 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//edit by ljh @2023/8/14 //edit by ljh @2023/8/14
taxiApp.daoAds.clear() taxiApp.daoAds.clear()
//edit by ljh @2023/12/12
Repository.cancelTimer()
isRefresh = true
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()
YoungUtil.YoungLog("没进圈删除定点广告:${region.regionAdId}") YoungUtil.YoungLog("没进圈删除定点广告:${region.regionAdId}")
RefreshPlayer.refresh() taxiApp.isPositionRefresh = true
// RefreshPlayer.refresh()
} }
} }
} }
if (isRefresh){
"定点变动,刷新列表".loge()
RefreshPlayer.refresh()
}
} }
@ -1002,18 +1033,25 @@ 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对象是空的吗${list == null}".loge()
"list元素是0吗${list?.size}".loge()
//edit by ljh @2024/4/19修复收到的GPS卫星数量为0时频繁刷新问题
if (list.isNotEmpty()){
//edit by ljh @2023/8/11 //edit by ljh @2023/8/11
taxiApp.daoAds.clear() taxiApp.daoAds.clear()
for (advertise in it) { for (advertise in list) {
getAdvertise().delete(advertise) getAdvertise().delete(advertise)
try { }
RefreshPlayer.refresh() try {
} catch (e: InterruptedException) { "clearAreaAdvertise -> 刷新列表了".loge()
e.printStackTrace() RefreshPlayer.refresh()
} } catch (e: InterruptedException) {
e.printStackTrace()
} }
} }
@ -1044,6 +1082,12 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//edit by ljh@2023/8/22 //edit by ljh@2023/8/22
if (distanceLocation > 20) { if (distanceLocation > 20) {
// Log.d("LCT","DistanceUtil --> distanceLocation:$distanceLocation") // Log.d("LCT","DistanceUtil --> distanceLocation:$distanceLocation")
//edit by ljh@2024/5/9
taxiApp.quietGpsTimer?.apply {
cancel()
purge()
}
taxiApp.quietGpsTimer = null
// edit by yzd @20211201 // edit by yzd @20211201
// if (Settings.gpsSwitch) { // if (Settings.gpsSwitch) {
@ -1068,11 +1112,13 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
//过滤掉距离过大的数据edit by ljh 2023/8/8 //过滤掉距离过大的数据edit by ljh 2023/8/8
location.distance?.let { location.distance?.let {
if (it < 10000f){ if (it < JUMP_THRESHOLD){
DaoUtil.getLocationDao().insert(location) DaoUtil.getLocationDao().insert(location)
// 如果不是跳跃点,更新上一个有效点的坐标
curLocation = location
} }
} }
curLocation = location // DaoUtil.getLocationDao().insert(location)
//debug 将日志存卡里看location信息对不对 //debug 将日志存卡里看location信息对不对
// taxiApp.saveLog(location.toString()) // taxiApp.saveLog(location.toString())
} else { } else {
@ -1097,7 +1143,22 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
} }
} }
} else { } else {
YoungUtil.YoungLog("当前位置坐标距离上一个点小于20不记录") YoungUtil.YoungLog("当前位置坐标距离上一个点小于20")
//edit by ljh@2024/5/9
val lon = String.format("%.7f", longitude).toDouble()
val lat = String.format("%.7f", latitude).toDouble()
val location = Location().apply {
timestamp = System.currentTimeMillis()
setLongitude(lon)
setLatitude(lat)
setBearing(bearing)
setSpeed(speed)
// val floatArray = FloatArray(1)
// distanceBetween(curLocation?.latitude!!, curLocation?.longitude!!, latitude, longitude, floatArray)
distance = distanceLocation.toFloat()
elapse = timestamp - curLocation?.timestamp!!
}
saveQuietGPS(location)
return return
} }
} else { } else {
@ -1106,6 +1167,23 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
} }
} }
/**
* 存储静止点
* @param location Location
*/
private fun saveQuietGPS(location: Location) {
if (taxiApp.quietGpsTimer == null) {
"开启存储静止点的定时器".logd()
taxiApp.quietGpsTimer = Timer()
taxiApp.quietGpsTimer?.schedule(object :TimerTask(){
override fun run() {
"三分钟没收到非静止的点了,存储静止点:${location.timestamp}".logd()
DaoUtil.getLocationDao().insert(location)
}
},3*60*1000,3*60*1000)
}
}
/** /**
* 判断是否当前是否已经在播当前区域的定点广告 * 判断是否当前是否已经在播当前区域的定点广告
*/ */
@ -1159,6 +1237,13 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
this.latitude = latitude this.latitude = latitude
} }
//edit by ljh @2023/12/12
val file = File(advertise.pathName)
if (file.exists()) {
"定点广告的素材已下载".loge()
advertise.isDownloaded = true
}
YoungUtil.YoungLog("setAdvertiseByPosition adid${advertise.ad_id}") YoungUtil.YoungLog("setAdvertiseByPosition adid${advertise.ad_id}")
advertise.toString().loge() advertise.toString().loge()

View File

@ -4,6 +4,7 @@ import android.os.Handler
import cn.trans88.kurotool.util.TimeUtil import cn.trans88.kurotool.util.TimeUtil
import cn.trans88.taxiappkotlin.ext.logd import cn.trans88.taxiappkotlin.ext.logd
import cn.trans88.taxiappkotlin.ext.loge import cn.trans88.taxiappkotlin.ext.loge
import cn.trans88.taxiappkotlin.logic.Repository
import cn.trans88.taxiappkotlin.logic.dao.AdvertiseDao 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
@ -35,11 +36,11 @@ fun Advertise.isReady(): Boolean {
if(media_type != MaterialType.Text.ordinal){ if(media_type != MaterialType.Text.ordinal){
/* 这里exist判断不准文件存在被判定为不存在 略作改动 /* 这里exist判断不准文件存在被判定为不存在 略作改动
if (!File(this.pathName).exists()) { if (!File(this.pathName).exists()) {
YoungUtil.YoungLog("${this.pathName}的广告本地不存在,重新下载 ready返回false") YoungUtil.YoungLog("${this.pathName}的广告本地不存在,重新下载 ready返回false")
downloadFile() downloadFile()
ready = false ready = false
} }
*/ */
//edit by yzd @20211222 //edit by yzd @20211222
val file = File(this.pathName) val file = File(this.pathName)
@ -91,6 +92,7 @@ fun Advertise.isAllowPlay(): Boolean {
if (advertise == null){ if (advertise == null){
YoungUtil.YoungLog("广告已经下坎不再播放:${this.ad_id}") YoungUtil.YoungLog("广告已经下坎不再播放:${this.ad_id}")
return false return false
} }

View File

@ -22,6 +22,7 @@ public class DateUtil {
public static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/** /**
* 获取任务第一次执行的开始或者结束日期 * 获取任务第一次执行的开始或者结束日期
* @param weekDay * @param weekDay
@ -112,7 +113,7 @@ public class DateUtil {
* @return * @return
*/ */
public static int getDaysDiff(long currentTime, long cacheTime){ public static int getDaysDiff(long currentTime, long cacheTime){
Log.d("yzd_t", "currentTime: " + currentTime + ", cacheTime: " + cacheTime); Log.d("yzd_t", "currentTime: " + currentTime + ", cacheStartTime: " + cacheTime);
int dayType = DayType.IS_OTHER_DAY.ordinal(); int dayType = DayType.IS_OTHER_DAY.ordinal();
// long currentTimeStamp = 1699723270L; // 替换为currentTimeStamp的值 2023/11/12 // long currentTimeStamp = 1699723270L; // 替换为currentTimeStamp的值 2023/11/12
// long lastTimeStamp = 1699690270L; // 替换为lastTimeStamp的值 2023/11/11 // long lastTimeStamp = 1699690270L; // 替换为lastTimeStamp的值 2023/11/11
@ -146,10 +147,10 @@ public class DateUtil {
Log.d("yzd_t", "daysDiff: " + daysDiff); Log.d("yzd_t", "daysDiff: " + daysDiff);
if (daysDiff == 1) { if (daysDiff == 1) {
Log.d("yzd_t","currentTimeStamp对应的时间是lastTimeStamp的后一天的时间。"); Log.d("yzd_t","对比当前时间是第二天");
dayType = DayType.IS_SECOND_DAY.ordinal(); dayType = DayType.IS_SECOND_DAY.ordinal();
} else if (daysDiff == 0) { } else if (daysDiff == 0) {
Log.d("yzd_t","currentTimeStamp对应的时间不是lastTimeStamp的后一天的时间。"); Log.d("yzd_t","对比当前时间是同一天");
dayType = DayType.IS_SAME_DAY.ordinal(); dayType = DayType.IS_SAME_DAY.ordinal();
} }

View File

@ -0,0 +1,87 @@
package cn.trans88.taxiappkotlin.util;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import okhttp3.Callback;
import okhttp3.Dns;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class OkHttpTool {
private OkHttpClient client;
private volatile static OkHttpTool instance;
public static OkHttpTool getInstance() {
if (instance == null) {
synchronized (OkHttpTool.class) {
if (instance == null) {
instance = new OkHttpTool();
}
}
}
return instance;
}
private OkHttpTool() {
client = new OkHttpClient.Builder()
.connectTimeout(80, TimeUnit.SECONDS)
.readTimeout(80, TimeUnit.SECONDS)
.writeTimeout(80, TimeUnit.SECONDS)
.build();;
}
/**
* 发送异步请求
* @param url
* @param callback
*/
public void sendRequest(String url, Callback callback){
Request request = new Request.Builder().url(url).build();
client.newCall(request).enqueue(callback);
}
/**
* 发送同步请求
* @param url
* @return
* @throws IOException
*/
public Response sendSyncRequest(String url) throws IOException {
Request request = new Request.Builder().url(url).build();
return client.newCall(request).execute();
}
public String getVistor(String url, String token) {
Log.i("TAG", "token:" + token);
// Headers headers = new Headers.Builder().add("token",token).build();
Request request = new Request.Builder().get().url(url + "?dataKey=" + token).build();
try {
Response response = client.newCall(request).execute();
if (response.isSuccessful() && response.code() == 200) {
return response.body().string();
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}

View File

@ -118,9 +118,9 @@ object SyncUtil {
sum += advertise.duration.toInt() sum += advertise.duration.toInt()
if (sum>=passModuleTime){ if (sum >= passModuleTime){
currentPosition =index+1 currentPosition = index+1
delay =sum -passModuleTime delay = sum - passModuleTime
if (currentPosition >= list.size) { if (currentPosition >= list.size) {
YoungUtil.YoungLog("同步时当前播放广告位置大于列表长度重置为0") YoungUtil.YoungLog("同步时当前播放广告位置大于列表长度重置为0")

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<FrameLayout
android:id="@+id/surface_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
</FrameLayout>
</RelativeLayout>

View File

@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":240,"versionName":"3.3.3-beta26.3.9.97-debug","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.3.9.97-debug{240}.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"TaxiApp_v3.3.3-beta26.3.9.97-debug{240}.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":245,"versionName":"3.3.3-beta26.4.0.5-debug","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.4.0.5-debug{245}.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"TaxiApp_v3.3.3-beta26.4.0.5-debug{245}.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.
#Mon Nov 06 09:42:57 GMT+08:00 2023 #Tue Jun 25 17:11:45 GMT+08:00 2024
sdk.dir=D\:\\Android\\sdk sdk.dir=D\:\\Android\\sdk

View File

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