Compare commits
533 Commits
v5.22.6-79
...
delete
| Author | SHA1 | Date | |
|---|---|---|---|
| 684dbcfd87 | |||
| 4f8b961e2c | |||
| 58a7f7c3fa | |||
| ae8267d96d | |||
| e20af462b7 | |||
| e2773ed8c7 | |||
| c77e5ca56b | |||
| e78c23ca4f | |||
| b790d71aa5 | |||
| 5c91023a68 | |||
| 2eae71bc96 | |||
| 909477ec7f | |||
| a5da376f62 | |||
| d084cb1c34 | |||
| 411bf3561f | |||
| 610c006aeb | |||
| ffa81bc4c1 | |||
| 67477ac20a | |||
| a6a16e4694 | |||
| 8f8352dc12 | |||
| 1bbbe575f2 | |||
| 5975d9850f | |||
| ef001b0a77 | |||
| fd49ecbc8a | |||
| d683969eda | |||
| f8527da9df | |||
| f50d901171 | |||
| 71db870bd2 | |||
| b4c550f71b | |||
| 91bde61054 | |||
| d7940121ee | |||
| ef9c473301 | |||
| 2c82437449 | |||
| 311e5e4225 | |||
| 91864e3681 | |||
| 5e66db7435 | |||
| e7c74d3f39 | |||
| d0fa02b221 | |||
| 70e4378ef0 | |||
| f8ee943678 | |||
| 918aa17fbd | |||
| 0a7a3d9878 | |||
| b6a823e793 | |||
| 9a95a4623d | |||
| 206bc1bfcc | |||
| 4045e42a7b | |||
| 15f283d330 | |||
| 97bafee09e | |||
| e32745d9d7 | |||
| c37a54ac89 | |||
| 607d514ae9 | |||
| 62ee0b4a6e | |||
| 11ff054520 | |||
| e96fc0f3b4 | |||
| a7875b21c9 | |||
| e53154c810 | |||
| e1d89725bc | |||
| 1d3ec9eff6 | |||
| 0403743533 | |||
| 1f25b932d5 | |||
| d3545bc766 | |||
| b2b858c403 | |||
| debbe08262 | |||
| 4e746a2b16 | |||
| b86e372e5b | |||
| f65e76a94a | |||
| 05c8de827e | |||
| 78eb10fa3c | |||
| 23dfb7378b | |||
| 0e2e175194 | |||
| 9050a04c3a | |||
| 57df50b0a2 | |||
| 4ff21914c1 | |||
| 0dec30ff56 | |||
| 4bdfe6e190 | |||
| 55813cdaae | |||
| 8668b2b4ec | |||
| b758658ea6 | |||
| 4ca9c32762 | |||
| af8fdd5d65 | |||
| 36dd4f5a82 | |||
| c7161e3483 | |||
| bffaaffc56 | |||
| 3257dd4c53 | |||
| 6793945606 | |||
| 52be14a4ef | |||
| e2cb5a31cf | |||
| d807b7973b | |||
| 1fb0d13646 | |||
| 68a3eadfeb | |||
| a2d904c634 | |||
| 56cd1bdad7 | |||
| 999e1a3ad8 | |||
| 8b4f71bc75 | |||
| be937703b8 | |||
| aa069b7a21 | |||
| f89914746a | |||
| fb0db2feee | |||
| 250dba9198 | |||
| 4c531b40b0 | |||
| 875a84b5ae | |||
| 77b9b731e2 | |||
| bd11481c2d | |||
| a3f1b09da1 | |||
| 1798dfb64d | |||
| 8e5814d389 | |||
| 14c01cf171 | |||
| c800dac1ec | |||
| 88448b7b8d | |||
| 77a1e5fea7 | |||
| ef0a212b85 | |||
| 2ee4ad6752 | |||
| 9173a73ed0 | |||
| 5d8e208ef8 | |||
| 309111c422 | |||
| 3c3a228500 | |||
| 33a5e2061f | |||
| b62b1f399c | |||
| c4449db90a | |||
| 6edd9f2204 | |||
| 8508b9ece2 | |||
| 20d5ef7a6e | |||
| ff70d7a48a | |||
| 4bc2374cb4 | |||
| 73d7a38886 | |||
| 8efa858a01 | |||
| 53e2297976 | |||
| 9cd5e342ac | |||
| 26dfb79ece | |||
| e1f70ce788 | |||
| 7bc36814b7 | |||
| b29651ecfb | |||
| 74aad0e7e0 | |||
| 52a5faacfe | |||
| 5cee489ba6 | |||
| f76c3e3638 | |||
| fe5b93c35a | |||
| 74c3e7a10d | |||
| deb2b07644 | |||
| 386a7f82d9 | |||
| c6b433d09c | |||
| c556a127f5 | |||
| 94983c4b7f | |||
| 119cdf4f91 | |||
| bdfd88a4c3 | |||
| 2697fd57b4 | |||
| bde7685dc6 | |||
| 6acaa95098 | |||
| 610f116b82 | |||
| fe616ed87b | |||
| 06e238b2d5 | |||
| a4c323b5e0 | |||
| fdfb03348e | |||
| 91ba665c4c | |||
| ba65c5e23a | |||
| f05b20ed98 | |||
| 74d3e8b2d4 | |||
| 74364cd452 | |||
| dc2a023fbb | |||
| 47560daec6 | |||
| 657b900418 | |||
| d826c3dcce | |||
| 935d61f910 | |||
| 0a412feefb | |||
| 31111a1cc8 | |||
| cf901ef840 | |||
| 8d70716f15 | |||
| 7cf086874a | |||
| d1698f0c2d | |||
| f80bcbcfb9 | |||
| 0f2fcdba68 | |||
| 548156c159 | |||
| ea08a52750 | |||
| 4c51ca7670 | |||
| 2ea9d46e12 | |||
| 65445859d3 | |||
| 8c9927b9cb | |||
| 5477a4a4cc | |||
| d1277aa1aa | |||
| 2381550e08 | |||
| 3ff4a9b6cf | |||
| 174f47edb1 | |||
| 96fbe30924 | |||
| 954c7e427a | |||
| e466eb6683 | |||
| 01437e9d8a | |||
| eac553ba46 | |||
| e57017f5f2 | |||
| 6506a18d6f | |||
| ed79b230aa | |||
| ac56650ce5 | |||
| 81d5a8a12c | |||
| 192ae916de | |||
| 5047ae5f9c | |||
| f5a30a7dde | |||
| e9c22ef577 | |||
| 8292d8512d | |||
| a606633755 | |||
| 9788b632d6 | |||
| 0e988b2b49 | |||
| 0a8211d40b | |||
| 1b3c2da6d3 | |||
| 48209b05e7 | |||
| 2da42d48e6 | |||
| f6b1813e88 | |||
| c16407e360 | |||
| b7ca5c54a3 | |||
| d42a915ef5 | |||
| 91c1e8fcef | |||
| 9abd0de3fe | |||
| 25cb0de6c0 | |||
| 41804a9a05 | |||
| 4db1147c4f | |||
| 48f9d5e159 | |||
| ccaf82a20b | |||
| 7802082797 | |||
| c293a4485e | |||
| eb7f2b418b | |||
| bbdecd6627 | |||
| f88aa52d09 | |||
| dd77243a2f | |||
| 9ead786c4c | |||
| f367eabddc | |||
| 16ced738ac | |||
| d607c04c33 | |||
| da40da432f | |||
| 6a03b63e65 | |||
| 81400a37f1 | |||
| 228a786f6c | |||
| 224c17c582 | |||
| 64a35316cb | |||
| 8c889001bf | |||
| 224689ad9c | |||
| 78207eb0cb | |||
| c3b9b52f5d | |||
| 63b1e510fa | |||
| bb7b5cde09 | |||
| 9a2a60cd5d | |||
| 690c2e53d9 | |||
| 5a72c12233 | |||
| 74f41404ef | |||
| 586af43050 | |||
| 454f0cad26 | |||
| 50510b808f | |||
| d46ef9f068 | |||
| 293561d807 | |||
| 4c64137e9a | |||
| d7090125c7 | |||
| c2058290f4 | |||
| 0b2f845021 | |||
| c77934cc75 | |||
| 57e57c19d0 | |||
| 475b03d591 | |||
| a97091bf49 | |||
| 7a12c4ab1d | |||
| 4f732c3921 | |||
| 531deacc3d | |||
| b219e60f13 | |||
| 387fc37b19 | |||
| 1b88c3e0a3 | |||
| af1c7ff2c9 | |||
| 976f315ba8 | |||
| 216c13054b | |||
| 9643c3cb9c | |||
| 6a6d0641a2 | |||
| 3fd4d330d2 | |||
| f811759bf4 | |||
| 6efc5bb4fa | |||
| 754d7f58c0 | |||
| f0266504de | |||
| 84e7ee6347 | |||
| dc39f9f207 | |||
| 65c46c2eb4 | |||
| 923f212424 | |||
| 092bdd4812 | |||
| 40e30058f9 | |||
| 432f8dc090 | |||
| ea68931461 | |||
| 648e6c9dc4 | |||
| 4d15361b37 | |||
| c1660a9816 | |||
| e6a2f0528a | |||
| 71f2c937db | |||
| 2a8ae9a022 | |||
| 3f28fcc211 | |||
| dd850bdbbc | |||
| 6ae8b520ac | |||
| 6c7baf54f3 | |||
| d956081d61 | |||
| fe75be35fb | |||
| 9080f82b80 | |||
| 15d6fd98b5 | |||
| d1d22de559 | |||
| 8daf5a8feb | |||
| ac86821871 | |||
| 1d10fc52b9 | |||
| 1c1a1f3db0 | |||
| 788cada5c9 | |||
| 285c87568b | |||
| 8a749ad730 | |||
| 1b19760562 | |||
| 2f69074418 | |||
| 684e7a63db | |||
| 89e588fb9e | |||
| d81b3002cb | |||
| 4048554c6e | |||
| 5fe976f8d0 | |||
| 208c21c4ea | |||
| 55c8fd9271 | |||
| 664f35090d | |||
| aaec370afa | |||
| af09f28fdd | |||
| 00b92d2aec | |||
| 4c4dafde62 | |||
| d481741c1a | |||
| f6c4e58498 | |||
| b59c061df3 | |||
| 846c532eeb | |||
| 2a3b9ebc21 | |||
| 808c7a46fc | |||
| ed6e495ecc | |||
| a90d694a48 | |||
| 73595d5a78 | |||
| 9be57f617e | |||
| 3e021e3721 | |||
| 0896051458 | |||
| b12f08367a | |||
| 03babbfdee | |||
| 8d2b83566c | |||
| fe3c0a2084 | |||
| b26ac93f58 | |||
| 7285baadbf | |||
| 32cf945b4d | |||
| 207813376b | |||
| 98a54ad85d | |||
| fc0a36e4b8 | |||
| a3a68d7550 | |||
| 572400a3c7 | |||
| 8b42390175 | |||
| ad71193089 | |||
| f631810acc | |||
| 6c9ac11175 | |||
| 5ba2ec0129 | |||
| e6677c781d | |||
| 86fb3e02a2 | |||
| 9f15983512 | |||
| c1eb1cde87 | |||
| 1f9cee2823 | |||
| 67e0181fa5 | |||
| dfa2d9b568 | |||
| 402e3be226 | |||
| 2db297e7c9 | |||
| 43b634f17e | |||
| 3dce109b87 | |||
| 683981d5a1 | |||
| 9c9b23e1f2 | |||
| 629c274b20 | |||
| 2548e36e65 | |||
| 974e35962f | |||
| b05f3de5b2 | |||
| 9437d64b0f | |||
| a9787ebc5a | |||
| 329ca952d4 | |||
| 6cebded553 | |||
| 6b77c71b09 | |||
| 386315247a | |||
| 31d819573b | |||
| 060ef0e2e1 | |||
| 3797caaee6 | |||
| cfe262eee2 | |||
| 5d15f9097b | |||
| a9093dfe37 | |||
| c4ab306f0d | |||
| b9daf3075a | |||
| 843ac6b432 | |||
| e5d6de8bf4 | |||
| 7fd2a4ce67 | |||
| 7cc38a8d56 | |||
| fb9e0c19a5 | |||
| f3a2db619a | |||
| dc4fc254f6 | |||
| 9f451af564 | |||
| 6f62b597b7 | |||
| b6f73a1e61 | |||
| 814d212f53 | |||
| 4f07be4528 | |||
| 6eaf16e039 | |||
| 89a7325264 | |||
| 0cdceaf0ed | |||
| c0eb8c7263 | |||
| 4581acb5d4 | |||
| 9c1d64ffe6 | |||
| 6de711d127 | |||
| 17a5445f25 | |||
| 7062d5d8d4 | |||
| 38347243f3 | |||
| bf11c964a3 | |||
| d76e3beb63 | |||
| e6d8ee779d | |||
| 744b60d0de | |||
| 6bbca7e62d | |||
| 39983bdc02 | |||
| a72a12c516 | |||
| 4fa5234231 | |||
| 26f5a03c98 | |||
| cff85a9990 | |||
| cf82938182 | |||
| 103b551f88 | |||
| a7fb23fda9 | |||
| 0735458c8b | |||
| 7559e87117 | |||
| fbb9fb885b | |||
| 2547f21174 | |||
| 517c3c90d5 | |||
| 5ee773c5b8 | |||
| 1d0bf46597 | |||
| 98c0fb39b4 | |||
| db037e4162 | |||
| 2d3af55875 | |||
| 2fdb613ecc | |||
| 7ad634c78e | |||
| 6950c9af09 | |||
| 851f79c58f | |||
| 7ef2d9b193 | |||
| 7298d772bb | |||
| 7a6afa9f6c | |||
| 310b800149 | |||
| a3ff7d19a7 | |||
| b84f456943 | |||
| 07abad8e04 | |||
| ad8f06f899 | |||
| eb1b04caea | |||
| 84493b312e | |||
| fe4ad76e2a | |||
| e9efbbc44a | |||
| 7cc7bb54d0 | |||
| 4adcadbc21 | |||
| 38a5893b4d | |||
| 2c303002f3 | |||
| 42b7a4abf9 | |||
| 6a12a0236e | |||
| d37d4c37bf | |||
| 7a04e1b8f4 | |||
| b666368bb2 | |||
| d0991d1b1b | |||
| 3cf6dba418 | |||
| 76a18782d8 | |||
| 404c3e1968 | |||
| 11482d2318 | |||
| 34b3eb1299 | |||
| 04e36554bd | |||
| 2a0322e566 | |||
| b9de58d9dd | |||
| 9fba8efac4 | |||
| 3e5e768be1 | |||
| 6b54e584fd | |||
| 05e57ed12f | |||
| d1c50f90c3 | |||
| b33efeab8c | |||
| 1051d40fab | |||
| 2b6e0fd159 | |||
| 33f0e1d2c5 | |||
| 762309e2c1 | |||
| 744a3331f7 | |||
| 9384009bfa | |||
| 13cbfd60e5 | |||
| cd4d16feb0 | |||
| 0a92ba7653 | |||
| 6fdd2c860a | |||
| 47355a3db6 | |||
| 3cd8d4d4dc | |||
| 738c1b7283 | |||
| 01df2f7a17 | |||
| e774d1c636 | |||
| 8978e006e4 | |||
| e6cf1a2425 | |||
| 0d15bc1ba4 | |||
| 62f6aa1a71 | |||
| ce811ea2e9 | |||
| 730b1651f6 | |||
| b18ff30077 | |||
| 756a215db9 | |||
| 91f3a92a2f | |||
| 2cae0ade4b | |||
| 1853c683d7 | |||
| 4506ad4367 | |||
| a22deaff04 | |||
| 8c9201c401 | |||
| 1c8502608f | |||
| 10eed8844d | |||
| 2cbe13b8f8 | |||
| b61558438e | |||
| bc847a500e | |||
| 71abfe6a0d | |||
| d311d70bd1 | |||
| a63e9ed08e | |||
| 21a1573f2c | |||
| c05a82543a | |||
| cafbc0efb0 | |||
| cac6875044 | |||
| e3d5923ff3 | |||
| e5e21e8695 | |||
| 4f2917e1ac | |||
| 0a3fd9a99e | |||
| 782bbd95b2 | |||
| d4b3bc059a | |||
| 8a47e867c7 | |||
| 2067b8dea3 | |||
| bc3bfb16c2 | |||
| 38e3b8471f | |||
| 2aaac4faaf | |||
| 19ed5b963d | |||
| 77c725068b | |||
| c05b3bdca6 | |||
| 1f630ae652 | |||
| 26883ee136 | |||
| e48d090eb3 | |||
| d9cffafba1 | |||
| 868dbcd32c | |||
| d392247abd | |||
| 14ba1585e4 | |||
| 1c591c6e45 | |||
| c27b6421a7 | |||
| 71f69bc528 | |||
| 53c374064a | |||
| 457897397a | |||
| 90fedcbd2f | |||
| 8b8895603b | |||
| 1de8b02fdb | |||
| bd8115a2d9 | |||
| f2b163ee42 | |||
| f11fb23bf2 | |||
| aecc9cecdd |
210
.gitlab-ci.yml
210
.gitlab-ci.yml
@ -1,83 +1,159 @@
|
||||
# commit_sha 文件记录上一次成功流水线的commit sha,用于定时计划检测是否有新代码提交,有就执行流水线,没有就终止流水线
|
||||
cache:
|
||||
# 不同的分支采用不同的 cache,防止分支之间相互影响
|
||||
key: "${CI_COMMIT_REF_SLUG}_commit_sha"
|
||||
paths:
|
||||
- commit_sha
|
||||
policy: pull
|
||||
|
||||
# 将打包&发送apk包邮件job 和代码分析job 并行执行
|
||||
stages:
|
||||
- android-build && analysis
|
||||
- docker-build && sendmail
|
||||
- deploy-trigger
|
||||
- build&analyze
|
||||
- oss-upload&send-email
|
||||
- ci_sonar_mail
|
||||
|
||||
# 阻止了 合并请求 或 push(分支和标签)的流水线。 最后的 when: always 规则运行所有其他流水线类型,包括定时计划流水线。
|
||||
workflow:
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "push"'
|
||||
when: always
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: never
|
||||
- when: always
|
||||
|
||||
before_script:
|
||||
# 检查是否存在 commit_sha 文件
|
||||
- if [ -f commit_sha ]; then cat commit_sha; else echo "0000000" > commit_sha; fi
|
||||
- export BEFORE_COMMIT_SHA=$(cat commit_sha)
|
||||
# 比较commit sha ,若与上一次成功流水线的commit sha 相同,则退出流水线
|
||||
- if [ "$CI_COMMIT_SHA" == "$BEFORE_COMMIT_SHA" ] && [ "$CI_PIPELINE_SOURCE" != "web" ]; then exit 137; fi
|
||||
|
||||
# 使用 .post 阶段使作业在流水线的末尾运行。.post 始终是流水线的最后阶段。
|
||||
change_commit:
|
||||
tags:
|
||||
- offline-test
|
||||
stage: .post
|
||||
# 此job 跳过拉取git代码
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
script:
|
||||
# 更新 commit_sha
|
||||
- if [ "$CI_COMMIT_SHA" != "$BEFORE_COMMIT_SHA" ]; then echo $CI_COMMIT_SHA > commit_sha; fi
|
||||
cache:
|
||||
# 不同的分支采用不同的 cache,防止分支之间相互影响
|
||||
key: "${CI_COMMIT_REF_SLUG}_commit_sha"
|
||||
paths:
|
||||
- commit_sha
|
||||
policy: pull-push
|
||||
allow_failure:
|
||||
exit_codes: 137
|
||||
|
||||
android_build:
|
||||
tags:
|
||||
# - local-runner
|
||||
- offline-test
|
||||
stage: android-build && analysis
|
||||
image: hub.shanqu.cc/devops/ci-android:jdk11
|
||||
stage: build&analyze
|
||||
image: hub.shanqu.cc/library/ci-android:jdk11-sdk31-33
|
||||
resource_group: android_build
|
||||
variables:
|
||||
KUBERNETES_CPU_LIMIT: "16"
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
Apk_Path: "app/build/outputs/apk/**/release/*.apk"
|
||||
KUBERNETES_CPU_LIMIT: "10"
|
||||
script:
|
||||
- export GRADLE_USER_HOME=./.gradle
|
||||
- export GRADLE_USER_HOME=/home/gitlab-runner/ci-build-cache/$CI_PROJECT_PATH/.gradle
|
||||
- chmod +x ./gradlew
|
||||
- ./scripts/meta_build.sh --config_id 6400549c21c2c94ead074500 --sdk_platform toutiao --sdk_version 5.3.0 --channel BD-GHZS-ZP-KY --activate_reporting_ratio 60 --first_lanuch_jump e1wibGlua190eXBlXCI6XCJcIixcImxpbmtfaWRcIjpcIlwiLFwibGlua190ZXh0XCI6XCJcIixcImhvbWVfaW5kZXhcIjpcIlwiLFwiYm90dG9tX2luZGV4XCI6XCJcIn0= --unix_timestamp 1677657618 --output ./release/com.gh.gamecenter_5.17.4_694_BD-GHZS-ZP-KY_toutiao_5.3.0_1677657618.apk
|
||||
- rm -rf ./.gradle/caches/build-cache-1
|
||||
cache:
|
||||
paths:
|
||||
- .gradle
|
||||
- ./scripts/jenkins_build.sh -c
|
||||
#设置打包后的产物,用于job之间共享
|
||||
artifacts:
|
||||
paths:
|
||||
- Dockerfile
|
||||
expire_in: 15 mins
|
||||
paths:
|
||||
- app/build/tmp/*.apk
|
||||
expire_in: 48 hrs # 指定附件上载后保存的时间24h,默认永久在Gitlab保存
|
||||
allow_failure:
|
||||
exit_codes: 137
|
||||
only:
|
||||
- feature-meta_build
|
||||
|
||||
# 构建推送docker镜像
|
||||
docker-build:
|
||||
tags:
|
||||
- offline-test
|
||||
stage: docker-build && sendmail
|
||||
image: hub.shanqu.cc/library/docker:latest
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
script:
|
||||
- projectPath=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
|
||||
- docker build -t registry.cn-shenzhen.aliyuncs.com/ghzs/$projectPath:latest .
|
||||
- docker push registry.cn-shenzhen.aliyuncs.com/ghzs/$projectPath:latest
|
||||
- docker run -e PROJECTKEY=$projectPath -e EMAIL=$GITLAB_USER_EMAIL -e BRANCH=$CI_COMMIT_REF_NAME --name send-email --rm hub.shanqu.cc/platform/send-sonar-report:latest
|
||||
cache:
|
||||
paths:
|
||||
- .gradle
|
||||
policy: pull
|
||||
only:
|
||||
- feature-meta_build
|
||||
- dev
|
||||
- dev-5.26.0
|
||||
- dev-5.27.0
|
||||
|
||||
# 代码检查
|
||||
sonarqube_analysis:
|
||||
tags:
|
||||
- offline-test
|
||||
stage: android-build && analysis
|
||||
image: sonarsource/sonar-scanner-cli:latest
|
||||
dependencies: [] #禁止传递来的artifact
|
||||
script:
|
||||
## 获取项目的一级组和二级组和项目名作为projectKey,例如projectKey=platform-backend-eci-monitor
|
||||
- group=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
|
||||
- sonar-scanner
|
||||
-Dsonar.host.url=http://sonarqube-server.sonarqube:9000/
|
||||
-Dsonar.login=be43de7264ce4c4766eb0c020373c3e74e6df257
|
||||
-Dsonar.jacoco.reportPaths=target/jacoco.exec
|
||||
-Dsonar.projectKey=$group
|
||||
-Dsonar.projectName=$CI_PROJECT_PATH
|
||||
-Dsonar.sourceEncoding=UTF-8
|
||||
-Dsonar.exclusions=**/vendor/**,**/errcode/**
|
||||
-Dsonar.gitlab.project_id=$CI_PROJECT_ID
|
||||
-Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
|
||||
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
|
||||
-Dsonar.gitlab.ci_merge_request_iid=$CI_MERGE_REQUEST_IID
|
||||
-Dsonar.gitlab.merge_request_discussion=true
|
||||
-Dsonar.java.binaries=. # 如果不使用Maven或Gradle进行分析,则必须手动提供测试二进制文件
|
||||
only:
|
||||
- feature-meta_build
|
||||
tags:
|
||||
- offline-test
|
||||
stage: build&analyze
|
||||
image: sonarsource/sonar-scanner-cli:latest
|
||||
dependencies: [] #禁止传递来的artifact
|
||||
script:
|
||||
## 获取项目的一级组和二级组和项目名作为projectKey,例如projectKey=platform-backend-eci-monitor
|
||||
- group=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
|
||||
- sonar-scanner
|
||||
-Dsonar.host.url=http://sonarqube-server.sonarqube:9000/
|
||||
-Dsonar.login=be43de7264ce4c4766eb0c020373c3e74e6df257
|
||||
-Dsonar.jacoco.reportPaths=target/jacoco.exec
|
||||
-Dsonar.projectKey=$group
|
||||
-Dsonar.projectName=$CI_PROJECT_PATH
|
||||
-Dsonar.sourceEncoding=UTF-8
|
||||
-Dsonar.exclusions=**/vendor/**,**/errcode/**
|
||||
-Dsonar.gitlab.project_id=$CI_PROJECT_ID
|
||||
-Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
|
||||
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
|
||||
-Dsonar.gitlab.ci_merge_request_iid=$CI_MERGE_REQUEST_IID
|
||||
-Dsonar.gitlab.merge_request_discussion=true
|
||||
-Dsonar.java.binaries=.
|
||||
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
|
||||
allow_failure:
|
||||
exit_codes: 137
|
||||
only:
|
||||
- dev
|
||||
- dev-5.26.0
|
||||
- dev-5.27.0
|
||||
|
||||
## 触发多项目构建
|
||||
trigger_job:
|
||||
stage: deploy-trigger
|
||||
trigger:
|
||||
project: devops/automation/build-eci
|
||||
branch: dev
|
||||
## 发送简易检测结果报告
|
||||
send_sonar_report:
|
||||
tags:
|
||||
- offline-test
|
||||
stage: ci_sonar_mail
|
||||
image: hub.shanqu.cc/library/docker:latest
|
||||
# 此job 跳过拉取git代码
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
script:
|
||||
- group=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
|
||||
- docker run -e PROJECTKEY=$group -e EMAIL=$GITLAB_USER_EMAIL -e BRANCH=$CI_COMMIT_REF_NAME --name send-email --rm hub.shanqu.cc/platform/send-sonar-report:latest
|
||||
allow_failure:
|
||||
exit_codes: 137
|
||||
only:
|
||||
- dev
|
||||
- dev-5.26.0
|
||||
- dev-5.27.0
|
||||
|
||||
oss-upload&send-email:
|
||||
tags:
|
||||
- rancher-k8s
|
||||
stage: oss-upload&send-email
|
||||
image: hub.shanqu.cc/devops/android-apk-oss-upload:latest
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
VAULT_ADDR: https://vault.shanqu.cc # 固定值
|
||||
VAULT_SECRET_PATH: prod/devops/android-apk-oss-upload # 固定值
|
||||
VAULT_ROLE: android-apk-oss-upload # 固定值
|
||||
ENDPOINT: "oss-cn-shenzhen-internal.aliyuncs.com" # 固定值
|
||||
BUCKET: "shanqu" # 固定值
|
||||
FILE_PATH: "app/build/tmp/" # APK 存放路径
|
||||
Email_To_List: $EMAIL_TO_LIST # 邮件接受人列表
|
||||
Email_Title: "光环助手 $CI_COMMIT_BRANCH" # 邮件标题
|
||||
PIPELINE_ID: $CI_PIPELINE_ID # 流水线id
|
||||
COMMIT_BRANCH: $CI_COMMIT_BRANCH # 提交分支
|
||||
MAIL_MESSAGE: "[$CI_COMMIT_AUTHOR] $CI_COMMIT_MESSAGE"
|
||||
needs:
|
||||
- job: android_build
|
||||
artifacts: true
|
||||
script:
|
||||
### 绑定上传参数 ###
|
||||
- export OSS_PATH="release/dev/${CI_PROJECT_NAME}/$(date "+%Y/%m/%d")"
|
||||
### 开启上传 ###
|
||||
- /usr/local/bin/python /upload.py
|
||||
### 发送邮件
|
||||
- /usr/local/bin/python /ci-android-mail.py
|
||||
only:
|
||||
- dev
|
||||
- dev-5.26.0
|
||||
- dev-5.27.0
|
||||
|
||||
@ -11,6 +11,7 @@ android {
|
||||
|
||||
String CONFIG_ID = ""
|
||||
String FIRST_LAUNCH = ""
|
||||
int ACTIVATE_REPORTING_RATIO = 0
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
@ -76,6 +77,8 @@ android {
|
||||
// 首次启动的跳转配置
|
||||
buildConfigField "String", "FIRST_LAUNCH", "\"${FIRST_LAUNCH}\""
|
||||
|
||||
buildConfigField "int", "ACTIVATE_REPORTING_RATIO", "${ACTIVATE_REPORTING_RATIO}"
|
||||
|
||||
// All third-party appid/appkey
|
||||
buildConfigField "String", "API_HOST", "\"${API_HOST}\""
|
||||
buildConfigField "String", "NEW_API_HOST", "\"${NEW_API_HOST}\""
|
||||
@ -160,7 +163,7 @@ android {
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
// internal test dev host
|
||||
// internal, 内部测试包使用的 flavor,接口包含包括测试和正式环境
|
||||
internal {
|
||||
dimension "env"
|
||||
versionNameSuffix "-debug"
|
||||
@ -172,7 +175,7 @@ android {
|
||||
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${DEV_QUICK_LOGIN_APPKEY}\""
|
||||
}
|
||||
|
||||
// publish release host
|
||||
// publish, 发布时候使用的 flavor,接口仅包含正式环境
|
||||
publish {
|
||||
dimension "env"
|
||||
|
||||
@ -198,11 +201,17 @@ android {
|
||||
kuaishou {
|
||||
dimension "env"
|
||||
|
||||
String KUAI_SHOU_APP_ID = ""
|
||||
String KUAI_SHOU_APP_NAME = ""
|
||||
|
||||
buildConfigField "String", "DEV_API_HOST", "\"${API_HOST}\""
|
||||
buildConfigField "String", "NEW_DEV_API_HOST", "\"${NEW_API_HOST}\""
|
||||
buildConfigField "String", "DEV_VAPI_HOST", "\"${VAPI_HOST}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPID", "\"${QUICK_LOGIN_APPID}\""
|
||||
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${QUICK_LOGIN_APPKEY}\""
|
||||
|
||||
buildConfigField "String", "KUAI_SHOU_APP_ID", "\"${KUAI_SHOU_APP_ID}\""
|
||||
buildConfigField "String", "KUAI_SHOU_APP_NAME", "\"${KUAI_SHOU_APP_NAME}\""
|
||||
}
|
||||
|
||||
gdt {
|
||||
@ -292,7 +301,8 @@ dependencies {
|
||||
|
||||
implementation "com.lg:gid:${gid}"
|
||||
|
||||
compileOnly "com.github.axen1314.lancet:lancet-base:${lancet_version}"
|
||||
implementation "com.lg:shortcut:${shortcut}"
|
||||
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
|
||||
implementation project(':ndownload')
|
||||
@ -319,13 +329,13 @@ dependencies {
|
||||
implementation(project(':module_sensors_data')) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
implementation(project(':module_vpn'))
|
||||
implementation(project(':module_pkg'))
|
||||
// 默认不接入光能模块,提高编译速度
|
||||
// debugImplementation(project(':module_energy')) {
|
||||
// exclude group: 'androidx.swiperefreshlayout'
|
||||
// }
|
||||
// implementation(project(':feature:vpn'))
|
||||
implementation(project(':feature:pkg'))
|
||||
implementation(project(':feature:oaid'))
|
||||
implementation(project(':feature:floating-window'))
|
||||
implementation(project(':feature:beizi_startup_ad'))
|
||||
}
|
||||
|
||||
File propFile = file('sign.properties')
|
||||
if (propFile.exists()) {
|
||||
Properties props = new Properties()
|
||||
@ -465,7 +475,12 @@ andResGuard {
|
||||
"R.drawable.suggest_add_pic_icon",
|
||||
"R.drawable.icon_pic_add",
|
||||
"R.drawable.ask_search_input_delete",
|
||||
"R.drawable.suggest_pic_delete"
|
||||
"R.drawable.suggest_pic_delete",
|
||||
"R.id.cardIv",
|
||||
"R.id.cardMask",
|
||||
"R.id.cardGradientMask",
|
||||
"R.id.gameIconIv",
|
||||
"R.id.titleContainer"
|
||||
]
|
||||
compressFilePattern = [
|
||||
"*.png",
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
-keep class com.gh.gamecenter.db.info.* {*;}
|
||||
-keep class com.gh.gamecenter.entity.** {<fields>;}
|
||||
-keep class com.gh.gamecenter.qa.entity.** {<fields>;}
|
||||
-keep class com.gh.gamecenter.floatingwindow.FloatingWindowEntity {<fields>;}
|
||||
-keep class com.gh.gamecenter.BR
|
||||
-keep class com.gh.gamecenter.retrofit.* {*;}
|
||||
-keep class com.gh.gamecenter.eventbus.* {*;}
|
||||
@ -62,6 +63,16 @@
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
|
||||
### RecyclerView.jumpToPositionForSmoothScroller
|
||||
-keep class androidx.recyclerview.widget.RecyclerView {
|
||||
void jumpToPositionForSmoothScroller(int);
|
||||
}
|
||||
|
||||
### ViewBinding 反射相关
|
||||
-keep class * implements androidx.viewbinding.ViewBinding {
|
||||
public static *** inflate(android.view.LayoutInflater, android.view.ViewGroup, boolean);
|
||||
}
|
||||
|
||||
### TEA
|
||||
-keep class com.gh.gamecenter.TeaHelper { *; }
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ class FlavorProviderImp : IFlavorProvider {
|
||||
return channel
|
||||
}
|
||||
|
||||
override fun init(application: Application, activity: Activity) {
|
||||
override fun init(application: Application, activity: Activity, activateRatio: Int) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import com.leon.channel.helper.ChannelReaderUtil
|
||||
|
||||
class FlavorProviderImp : IFlavorProvider {
|
||||
|
||||
override fun init(application: Application, activity: Activity) {
|
||||
override fun init(application: Application, activity: Activity, activateRatio: Int) {
|
||||
GdtHelper.init(application, getChannelStr(application))
|
||||
|
||||
if (HaloApp.getInstance().isBrandNewInstall) {
|
||||
|
||||
Binary file not shown.
BIN
app/src/gdt/libs/GDTActionSDK.min.1.8.6.aar
Normal file
BIN
app/src/gdt/libs/GDTActionSDK.min.1.8.6.aar
Normal file
Binary file not shown.
10
app/src/internal/res/xml/network_security_config.xml
Normal file
10
app/src/internal/res/xml/network_security_config.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true">
|
||||
<trust-anchors>
|
||||
<!-- Trust user added CAs while debuggable only -->
|
||||
<certificates src="user" />
|
||||
<certificates src="system" />
|
||||
</trust-anchors>
|
||||
</base-config>
|
||||
</network-security-config>
|
||||
@ -5,15 +5,15 @@ import com.kwai.monitor.log.TurboAgent
|
||||
import com.kwai.monitor.log.TurboConfig
|
||||
|
||||
object KuaishouHelper {
|
||||
private const val APP_ID = "80655"
|
||||
private const val APP_NAME = "guanghuanzhushou_1"
|
||||
private val mAppId by lazy { BuildConfig.KUAI_SHOU_APP_ID.ifEmpty { "81537" } }
|
||||
private val mAppName by lazy { BuildConfig.KUAI_SHOU_APP_NAME.ifEmpty { "guanghuanzhushou_1" } }
|
||||
|
||||
@JvmStatic
|
||||
fun init(context: Context, channel: String) {
|
||||
TurboAgent.init(
|
||||
TurboConfig.TurboConfigBuilder.create(context)
|
||||
.setAppId(APP_ID)
|
||||
.setAppName(APP_NAME)
|
||||
.setAppId(mAppId)
|
||||
.setAppName(mAppName)
|
||||
.setAppChannel(channel)
|
||||
.build()
|
||||
)
|
||||
|
||||
@ -8,11 +8,11 @@ import com.gh.gamecenter.core.provider.IFlavorProvider
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.core.utils.TimeUtils
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.leon.channel.helper.ChannelReaderUtil
|
||||
import com.kwai.monitor.payload.TurboHelper
|
||||
|
||||
class FlavorProviderImp : IFlavorProvider {
|
||||
|
||||
override fun init(application: Application, activity: Activity) {
|
||||
override fun init(application: Application, activity: Activity, activateRatio: Int) {
|
||||
KuaishouHelper.init(application, getChannelStr(application))
|
||||
|
||||
if (HaloApp.getInstance().isBrandNewInstall) {
|
||||
@ -31,7 +31,7 @@ class FlavorProviderImp : IFlavorProvider {
|
||||
}
|
||||
|
||||
override fun getChannelStr(application: Application): String {
|
||||
var channel = ChannelReaderUtil.getChannel(application)
|
||||
var channel = TurboHelper.getChannel(application)
|
||||
if (channel == null || TextUtils.isEmpty(channel.trim())) {
|
||||
channel = KUAISHOU_CHANNEL
|
||||
}
|
||||
|
||||
BIN
app/src/kuaishou/libs/channelsdk-0.2.1-beta.aar
Normal file
BIN
app/src/kuaishou/libs/channelsdk-0.2.1-beta.aar
Normal file
Binary file not shown.
Binary file not shown.
BIN
app/src/kuaishou/libs/monitorsdk-1.0.13.aar
Normal file
BIN
app/src/kuaishou/libs/monitorsdk-1.0.13.aar
Normal file
Binary file not shown.
@ -46,7 +46,8 @@
|
||||
<!-- 如果有视频相关的广告且使用textureView播放,请务必添加,否则黑屏 -->
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<uses-sdk tools:overrideLibrary="com.shuyu.gsyvideoplayer,
|
||||
<uses-sdk tools:overrideLibrary="
|
||||
com.shuyu.gsyvideoplayer,
|
||||
com.shuyu.gsyvideoplayer.lib,
|
||||
com.haroldadmin.whatthestack,
|
||||
com.shuyu.gsyvideoplayer.armv7a,
|
||||
@ -76,7 +77,7 @@
|
||||
androidx.compose.animation.core,
|
||||
androidx.constraintlayout.compose,
|
||||
androidx.compose.ui.test.manifest,
|
||||
androidx.compose.ui.tooling.preview"/>
|
||||
androidx.compose.ui.tooling.preview" />
|
||||
|
||||
<!-- 去掉 SDK 一些流氓权限 -->
|
||||
<uses-permission
|
||||
@ -106,10 +107,15 @@
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:resizeableActivity="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:theme="@style/AppCompatTheme.APP"
|
||||
tools:replace="android:name,android:allowBackup"
|
||||
tools:targetApi="n">
|
||||
|
||||
<meta-data
|
||||
android:name="EasyGoClient"
|
||||
android:value="true" />
|
||||
|
||||
<meta-data
|
||||
android:name="io.sentry.auto-init"
|
||||
android:value="false" />
|
||||
@ -119,7 +125,7 @@
|
||||
android:name="io.sentry.breadcrumbs.system-events"
|
||||
android:value="false" />
|
||||
|
||||
<service android:name = "com.gh.ndownload.NDownloadService" />
|
||||
<service android:name="com.gh.ndownload.NDownloadService" />
|
||||
|
||||
<activity
|
||||
android:name="com.gh.gamecenter.SplashScreenActivity"
|
||||
@ -137,10 +143,15 @@
|
||||
<activity
|
||||
android:name="com.gh.gamecenter.MainActivity"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppCompatTheme.APP"
|
||||
android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />
|
||||
android:windowSoftInputMode="stateAlwaysHidden|adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.gh.gamecenter.DownloadManagerActivity"
|
||||
@ -621,8 +632,8 @@
|
||||
<!-- android:theme="@android:style/Theme.Translucent" />-->
|
||||
|
||||
<activity
|
||||
android:exported="true"
|
||||
android:name="com.gh.gamecenter.SkipActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.AppCompat.Light.Fullscreen.Transparent">
|
||||
<intent-filter>
|
||||
<data android:scheme="ghzhushou" />
|
||||
@ -641,6 +652,19 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- 光环助手授权登陆页面 -->
|
||||
<activity
|
||||
android:name=".authorization.AuthorizationActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<data android:scheme="ghzhushou_authorization" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.gh.gamecenter.teenagermode.TeenagerModeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@ -769,9 +793,9 @@
|
||||
<service
|
||||
android:name=".aidl.CommunicationService"
|
||||
android:enabled="true"
|
||||
android:exported="true" >
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.gh.gamecenter.aidl.CommunicationService"/>
|
||||
<action android:name="com.gh.gamecenter.aidl.CommunicationService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
27
app/src/main/assets/easygo.json
Normal file
27
app/src/main/assets/easygo.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"easyGoVersion": "1.0",
|
||||
"client": "com.gh.gamecenter",
|
||||
"logicEntities": [
|
||||
{
|
||||
"head": {
|
||||
"function": "magicwindow",
|
||||
"required": "true"
|
||||
},
|
||||
"body": {
|
||||
"mode":"1",
|
||||
"activityPairs":[
|
||||
{"from":"com.gh.gamecenter.MainActivity","to":"*"}
|
||||
],
|
||||
"defaultDualActivities": {
|
||||
"mainPages": "com.gh.gamecenter.MainActivity"
|
||||
},
|
||||
"UX": {
|
||||
"supportRotationUxCompat": "false",
|
||||
"isDraggable": "true"
|
||||
},
|
||||
"transActivities":[
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
{"v":"5.5.9","fr":60,"ip":0,"op":90,"w":1080,"h":202,"nm":"click","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"椭圆形","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[204,1455,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[24,24],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"椭圆形","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":63,"s":[10]},{"t":70,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[204,1455,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":39,"s":[100,100,100]},{"t":49,"s":[110,110,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[36,36],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"圆环","refId":"comp_0","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.531],"y":[0]},"t":28,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":38,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.526],"y":[0]},"t":48,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.446],"y":[0]},"t":63,"s":[50]},{"t":82,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[125.951,79.658,0],"ix":2},"a":{"a":0,"k":[205.951,1458.658,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.601,0.601,0.333],"y":[0,0,0]},"t":28,"s":[50,50,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.528,0.528,0.333],"y":[0,0,0]},"t":38,"s":[100,100,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.526,0.526,0.333],"y":[0,0,0]},"t":48,"s":[120,120,100]},{"t":63,"s":[100,100,100]}],"ix":6}},"ao":0,"w":1080,"h":1920,"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"点击手","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.596],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.515],"y":[0]},"t":63,"s":[100]},{"t":83,"s":[0]}],"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.507],"y":[0]},"t":10,"s":[6]},{"t":30,"s":[2]}],"ix":10},"p":{"a":0,"k":[178.982,123.325,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.489,0.489,0.333],"y":[0,0,0]},"t":10,"s":[100,100,100]},{"t":30,"s":[90,90,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-5.33,-8.3],[3.89,0.27],[-4.4,-1.68],[-4.33,-0.67],[-4.08,9.32],[3.33,5.44],[3.39,4.6],[0.87,-3.7],[3.6,-0.86],[1.03,-0.21],[2.34,-0.53],[0.96,1.15],[4.22,5.48],[-1.18,-4.56]],"o":[[1.11,1.71],[-3.89,-0.27],[6.42,2.5],[4.33,0.66],[1.63,-5.32],[-3.34,-5.45],[-1.68,-2.1],[-0.71,3.14],[-3.43,0.95],[-0.57,0.08],[-3.86,1.12],[-3.23,-3.94],[-1.89,-2.28],[2.42,4.64]],"v":[[-5.387,9.698],[-10.717,8.498],[-12.327,15.628],[5.813,21.748],[23.313,11.778],[20.273,-1.202],[11.563,-13.962],[5.393,-12.362],[1.083,-13.722],[-2.087,-9.742],[-5.707,-11.752],[-8.777,-7.572],[-18.297,-20.542],[-23.827,-17.832]],"c":true},"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"路径备份 2","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0}],"markers":[]}
|
||||
@ -1 +0,0 @@
|
||||
{"v":"5.6.4","fr":25,"ip":0,"op":35,"w":1080,"h":214,"nm":"点赞","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"椭圆形 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.588],"y":[0]},"t":17,"s":[15]},{"t":20,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[468.04,73.68,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.659,0.659,0.333],"y":[0,0,0]},"t":10,"s":[50,50,100]},{"t":19,"s":[150,150,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[24,24],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":10,"op":1510,"st":10,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"椭圆形 3","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.588],"y":[0]},"t":27,"s":[15]},{"t":30,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[468.04,73.68,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.659,0.659,0.333],"y":[0,0,0]},"t":20,"s":[50,50,100]},{"t":28,"s":[140,140,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[24,24],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":20,"op":1520,"st":20,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"路径备份 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.602],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":5,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.663],"y":[0]},"t":24,"s":[100]},{"t":29,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[531.02,129.675,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.514,0.514,0.333],"y":[0,0,0]},"t":5,"s":[100,100,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.533,0.533,0.333],"y":[0,0,0]},"t":10,"s":[90,90,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.586,0.586,0.333],"y":[0,0,0]},"t":15,"s":[95,95,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.499,0.499,0.333],"y":[0,0,0]},"t":19,"s":[90,90,100]},{"t":24,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-5.33,-8.3],[3.89,0.27],[-4.4,-1.68],[-4.33,-0.67],[-4.08,9.32],[3.33,5.44],[3.39,4.6],[0.87,-3.7],[3.6,-0.86],[1.03,-0.21],[2.34,-0.53],[0.96,1.15],[4.22,5.48],[-1.18,-4.56]],"o":[[1.11,1.71],[-3.89,-0.27],[6.42,2.5],[4.33,0.66],[1.63,-5.32],[-3.34,-5.45],[-1.68,-2.1],[-0.71,3.14],[-3.43,0.95],[-0.57,0.08],[-3.86,1.12],[-3.23,-3.94],[-1.89,-2.28],[2.42,4.64]],"v":[[-5.387,9.698],[-10.717,8.498],[-12.327,15.628],[5.813,21.748],[23.313,11.778],[20.273,-1.202],[11.563,-13.962],[5.393,-12.362],[1.083,-13.722],[-2.087,-9.742],[-5.707,-11.752],[-8.777,-7.572],[-18.297,-20.542],[-23.827,-17.832]],"c":true},"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"路径备份 2","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1500,"st":0,"bm":0}],"markers":[]}
|
||||
@ -1 +0,0 @@
|
||||
{"v":"5.5.9","fr":60,"ip":0,"op":120,"w":1080,"h":586,"nm":"上滑","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":2,"ty":4,"nm":"手","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.642],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":6,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.558],"y":[0]},"t":60,"s":[100]},{"t":71,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.479,"y":0},"t":3,"s":[611,475,0],"to":[0,-62.75,0],"ti":[0,62.75,0]},{"t":40,"s":[611,98.5,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[90,90,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-7.78,-12.06],[5.68,0.39],[-6.42,-2.45],[-6.32,-0.97],[-5.95,13.55],[4.87,7.91],[4.94,6.69],[1.26,-5.37],[5.25,-1.25],[1.5,-0.3],[3.4,-0.77],[1.4,1.68],[6.15,7.98],[-1.73,-6.64]],"o":[[1.62,2.49],[-5.68,-0.39],[9.37,3.63],[6.31,0.98],[2.39,-7.74],[-4.87,-7.92],[-2.45,-3.05],[-1.05,4.57],[-4.99,1.39],[-0.83,0.13],[-5.63,1.63],[-4.71,-5.72],[-2.75,-3.31],[3.52,6.76]],"v":[[-7.86,14.26],[-15.64,12.52],[-17.99,22.89],[8.47,31.78],[33.98,17.29],[29.55,-1.59],[16.85,-20.15],[7.86,-17.83],[1.56,-19.8],[-3.05,-14.02],[-8.33,-16.94],[-12.44,-11.045],[-26.761,-30.19],[-34.75,-25.78]],"c":true},"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"路径","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"矩形","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.715],"y":[0]},"t":57,"s":[100]},{"t":67,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[525,228.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"hasMask":true,"masksProperties":[{"inv":false,"mode":"a","pt":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.491,"y":0},"t":3,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[24.328,180.5],[-22,180.5],[-22,204.5],[24.328,204.5]],"c":true}]},{"t":40,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[24.328,-207.5],[-22,-207.5],[-22,204.5],[24.328,204.5]],"c":true}]}],"ix":1},"o":{"a":0,"k":100,"ix":3},"x":{"a":0,"k":0,"ix":4},"nm":"蒙版 1"}],"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[6,137],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":2,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,1,1,1,0.5,1,1,1,1,1,1,1,0,1,0.5,0.5,1,0],"ix":9}},"s":{"a":0,"k":[0,-68.5],"ix":5},"e":{"a":0,"k":[0,68.5],"ix":6},"t":1,"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":33,"ix":3},"m":1,"ix":2,"nm":"修剪路径 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":3,"op":123,"st":3,"bm":0}],"markers":[]}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.gh.base
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Application
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
@ -17,6 +18,7 @@ import com.gh.gamecenter.core.runOnUiThread
|
||||
import com.gh.gamecenter.core.utils.MD5Utils
|
||||
import com.gh.gamecenter.core.utils.ToastUtils
|
||||
import com.gh.gamecenter.common.entity.ErrorEntity
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse
|
||||
import com.gh.gamecenter.entity.ForumDetailEntity
|
||||
import com.gh.gamecenter.entity.LocalVideoEntity
|
||||
import com.gh.gamecenter.entity.QuoteCountEntity
|
||||
@ -29,7 +31,9 @@ import com.google.gson.JsonObject
|
||||
import com.lightgame.utils.Utils
|
||||
import com.zhihu.matisse.Matisse
|
||||
import com.zhihu.matisse.internal.utils.PathUtils
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.ResponseBody
|
||||
import retrofit2.HttpException
|
||||
import java.io.File
|
||||
@ -58,6 +62,7 @@ abstract class BaseRichEditorViewModel(application: Application) : AndroidViewMo
|
||||
var videoId = ""//更改封面视频id
|
||||
val quoteCountEntity = QuoteCountEntity()//数据上报用
|
||||
val sectionListLiveData = MutableLiveData<List<ForumDetailEntity.Section>>()
|
||||
var isModerator = false
|
||||
|
||||
fun setUploadVideoListener(uploadVideoListener: UploadVideoListener) {
|
||||
this.mUploadVideoListener = uploadVideoListener
|
||||
@ -423,6 +428,18 @@ abstract class BaseRichEditorViewModel(application: Application) : AndroidViewMo
|
||||
})
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun getModeratorsInfo(bbsId: String) {
|
||||
mApi.getModeratorsInfo(bbsId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(object : BiResponse<JsonObject>() {
|
||||
override fun onSuccess(data: JsonObject) {
|
||||
isModerator = data["is_moderators"].asBoolean
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun getVideoType(): String {
|
||||
return when (type) {
|
||||
BbsType.GAME_BBS.value -> {
|
||||
|
||||
@ -7,7 +7,9 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import com.gh.common.util.FloatingBackViewManager
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.SingletonWebActivity
|
||||
import com.gh.gamecenter.SkipActivity
|
||||
import com.gh.gamecenter.SplashScreenActivity
|
||||
import com.gh.gamecenter.authorization.AuthorizationActivity
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.gamecenter.common.utils.PackageFlavorHelper
|
||||
import com.gh.vspace.VHelper
|
||||
@ -27,11 +29,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
// 判断是否需要显示或隐藏返回小浮窗
|
||||
if (FloatingBackViewManager.getType().isNotEmpty()) {
|
||||
if ((activity::class.java.name == "EnergyCenterActivity")
|
||||
&& FloatingBackViewManager.getType() == FloatingBackViewManager.TYPE_TASK
|
||||
) {
|
||||
FloatingBackViewManager.disableBackView()
|
||||
} else if (activity is SingletonWebActivity
|
||||
if (activity is SingletonWebActivity
|
||||
&& FloatingBackViewManager.getType() == FloatingBackViewManager.TYPE_ACTIVITY
|
||||
) {
|
||||
FloatingBackViewManager.disableBackView()
|
||||
@ -56,7 +54,11 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
|
||||
DarkModeSwitchHelper.showDarkModeSwitchFloatingView(activity)
|
||||
}
|
||||
|
||||
if (activity is AppCompatActivity && activity !is SplashScreenActivity) {
|
||||
if (activity is AppCompatActivity
|
||||
&& activity !is SplashScreenActivity
|
||||
&& activity !is SkipActivity
|
||||
&& activity !is AuthorizationActivity
|
||||
) {
|
||||
VHelper.showFeedbackDialogIfLastSuccessfulLaunchedGameExitUnexpectedly(activity)
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,6 @@ import com.gh.gamecenter.core.AppExecutor
|
||||
import com.gh.gamecenter.core.runOnIoThread
|
||||
import com.gh.gamecenter.core.runOnUiThread
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.energy.EnergyBridge
|
||||
import com.gh.gamecenter.entity.SensorsEvent
|
||||
import com.gh.gamecenter.eventbus.EBDownloadStatus
|
||||
import com.gh.gamecenter.eventbus.EBPackage
|
||||
@ -61,7 +60,12 @@ import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.util.*
|
||||
|
||||
class DefaultJsApi(var context: Context, val entrance: String = "", private var mFragment: Fragment? = null) {
|
||||
class DefaultJsApi(
|
||||
var context: Context,
|
||||
val entrance: String = "",
|
||||
private var mFragment: Fragment? = null,
|
||||
private var mBbsId: String? = "",
|
||||
) {
|
||||
|
||||
private var mLoginHandler: CompletionHandler<Any>? = null
|
||||
private var mDownloadWatcher: DataWatcher? = null // 下载观察者
|
||||
@ -165,7 +169,6 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
|
||||
|
||||
WechatBindHelper.bindWechat(wechatLoginInfoMap, object : BiCallback<Boolean, Boolean> {
|
||||
override fun onFirst(first: Boolean) {
|
||||
EnergyBridge.postEnergyTask("bind_wechat")
|
||||
handler.complete(true)
|
||||
}
|
||||
|
||||
@ -206,7 +209,7 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
|
||||
runOnUiThread {
|
||||
// 若畅玩列表中安装了,优先启动畅玩游戏
|
||||
if (VHelper.isInstalled(packageName)) {
|
||||
if (!VHelper.showDialogIfVSpaceIsNeeded(context, "", "")) {
|
||||
if (!VHelper.showDialogIfVSpaceIsNeeded(context, "", "", "", "")) {
|
||||
VHelper.launch(context, packageName)
|
||||
}
|
||||
} else {
|
||||
@ -260,6 +263,24 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为论坛详情的专区
|
||||
*/
|
||||
@JavascriptInterface
|
||||
fun isForumZone(msg: Any): Boolean {
|
||||
return !mBbsId.isNullOrEmpty()
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开论坛搜索页
|
||||
*/
|
||||
@JavascriptInterface
|
||||
fun openForumSearch(msg: Any) {
|
||||
runOnUiThread {
|
||||
DirectUtils.directToForumOrUserSearch(context, mBbsId ?: "", entrance.ifBlank { "内部网页" })
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
fun exitWebView(msg: Any) {
|
||||
runOnUiThread { (context as Activity).finish() }
|
||||
@ -268,7 +289,6 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
|
||||
@JavascriptInterface
|
||||
fun updateRegulationTestStatus(msg: Any) {
|
||||
if (msg.toString().toLowerCase(Locale.getDefault()) == "pass") {
|
||||
EnergyBridge.postEnergyTask("finish_etiquette_exam")
|
||||
SPUtils.setString(Constants.SP_REGULATION_TEST_PASS_STATUS, "pass")
|
||||
}
|
||||
}
|
||||
@ -344,17 +364,17 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
|
||||
|
||||
@JavascriptInterface
|
||||
fun postWearBadgeTask(msg: Any) {
|
||||
EnergyBridge.postEnergyTask("wear_badge")
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
fun startEnergyCenter(msg: Any) {
|
||||
context.startActivity(EnergyBridge.getEnergyCenterIntent(context))
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
fun startEnergyHouse(msg: Any) {
|
||||
context.startActivity(EnergyBridge.getEnergyHouseIntent(context, null))
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
|
||||
@ -5,9 +5,8 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.text.TextUtils
|
||||
import android.util.Base64
|
||||
import com.gh.gamecenter.core.utils.CurrentActivityHolder
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.util.CheckLoginUtils
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.DirectUtils.directToFeedback
|
||||
import com.gh.common.util.DirectUtils.directToGameDetailVideoStreaming
|
||||
import com.gh.common.util.DirectUtils.directToGameServerCalendar
|
||||
@ -15,22 +14,30 @@ import com.gh.common.util.DirectUtils.directToGameVideo
|
||||
import com.gh.common.util.DirectUtils.directToLegacyVideoDetail
|
||||
import com.gh.common.util.DirectUtils.directToLinkPage
|
||||
import com.gh.common.util.DirectUtils.directToQa
|
||||
import com.gh.gamecenter.*
|
||||
import com.gh.gamecenter.core.utils.GsonUtils.gson
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.LibaoDetailActivity
|
||||
import com.gh.gamecenter.MainActivity
|
||||
import com.gh.gamecenter.NewsDetailActivity
|
||||
import com.gh.gamecenter.WebActivity
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.entity.CommunityEntity
|
||||
import com.gh.gamecenter.common.entity.LinkEntity
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.core.AppExecutor
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse
|
||||
import com.gh.gamecenter.common.utils.DialogHelper
|
||||
import com.gh.gamecenter.common.utils.EnvHelper
|
||||
import com.gh.gamecenter.core.AppExecutor
|
||||
import com.gh.gamecenter.core.utils.CurrentActivityHolder
|
||||
import com.gh.gamecenter.core.utils.GsonUtils.gson
|
||||
import com.gh.gamecenter.core.utils.ToastUtils
|
||||
import com.gh.gamecenter.entity.*
|
||||
import com.gh.gamecenter.entity.ActivityLabelEntity
|
||||
import com.gh.gamecenter.entity.SubjectRecommendEntity
|
||||
import com.gh.gamecenter.entity.VideoLinkEntity
|
||||
import com.gh.gamecenter.eventbus.EBSkip
|
||||
import com.gh.gamecenter.fragment.MainWrapperFragment
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils
|
||||
import com.gh.gamecenter.fragment.MainWrapperFragment
|
||||
import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity
|
||||
import com.gh.gamecenter.qa.BbsType
|
||||
import com.gh.gamecenter.qa.video.publish.VideoPublishActivity
|
||||
@ -401,10 +408,11 @@ object DefaultUrlHandler {
|
||||
val packageMd5 = uri.getQueryParameter(EntranceConsts.KEY_PACKAGE_MD5)
|
||||
val isQaFeedback = uri.getQueryParameter(EntranceConsts.KEY_IS_QA_FEEDBACK) == "true"
|
||||
val content = if (TextUtils.isEmpty(gameId) || TextUtils.isEmpty(packageMd5)) String.format(
|
||||
"%s-%s-V%s,",
|
||||
"%s—V%s—%s(V%s),",
|
||||
uri.getQueryParameter(EntranceConsts.KEY_GAME_NAME),
|
||||
uri.getQueryParameter(EntranceConsts.KEY_VERSION),
|
||||
if (TextUtils.isEmpty(platformName)) platform else platformName,
|
||||
uri.getQueryParameter(EntranceConsts.KEY_VERSION)
|
||||
uri.getQueryParameter(EntranceConsts.KEY_PLATFORM_VERSION),
|
||||
) else String.format(
|
||||
"%s-%s-V%s\n游戏ID:%s\n游戏包MD5:%s\n",
|
||||
uri.getQueryParameter(EntranceConsts.KEY_GAME_NAME),
|
||||
|
||||
@ -21,7 +21,7 @@ object FixedRateJobHelper {
|
||||
private const val TIME_PERIOD: Long = 10 * 60 * 1000L
|
||||
private const val LOGHUB_PERIOD: Long = 2 * 60 * 1000L
|
||||
private const val EXPOSURE_PERIOD: Long = 5 * 60 * 1000L
|
||||
private const val REGION_SETTING_PERIOD: Long = 30 * 1000L
|
||||
private const val REGION_SETTING_PERIOD: Long = 60 * 1000L
|
||||
private const val VIDEO_RECORD_PERIOD: Long = 60 * 1000L
|
||||
|
||||
private const val DOWNLOAD_HEARTBEAT_PERIOD: Long = 60 * 1000L
|
||||
@ -54,9 +54,7 @@ object FixedRateJobHelper {
|
||||
|
||||
// 提交曝光数据
|
||||
if (elapsedTime % EXPOSURE_PERIOD == 0L) {
|
||||
runOnUiThread {
|
||||
ExposureManager.commitSavedExposureEvents(true)
|
||||
}
|
||||
ExposureManager.commitSavedExposureEvents(true)
|
||||
}
|
||||
|
||||
// 分片检测下载进度
|
||||
|
||||
@ -9,7 +9,7 @@ class CheckDownloadHandler : ChainHandler() {
|
||||
|
||||
override fun handleRequest(context: Context, gameEntity: GameEntity) {
|
||||
val apk = gameEntity.getApk().safelyGetInRelease(0) ?: return
|
||||
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
|
||||
DialogUtils.checkDownload(context, apk.size, gameEntity.id, gameEntity.name) { isSubscribe: Boolean ->
|
||||
if (hasNext()) {
|
||||
getNext()?.handleRequest(context, gameEntity)
|
||||
} else {
|
||||
|
||||
@ -122,17 +122,6 @@ public class Config {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否启用畅玩游戏
|
||||
*/
|
||||
public static boolean isVGameEnabled() {
|
||||
if (getSettings() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !"off".equals(getSettings().getGameSmooth());
|
||||
}
|
||||
|
||||
/**
|
||||
* VPN 开关选项是否开启
|
||||
*/
|
||||
@ -229,6 +218,8 @@ public class Config {
|
||||
if (!TextUtils.isEmpty(json)) {
|
||||
mSettingsEntity = GsonUtils.fromJson(json, SettingsEntity.class);
|
||||
}
|
||||
|
||||
mSettingsEntity.setGameSmooth("off");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ import com.gh.common.chain.CertificationHandler;
|
||||
import com.gh.common.chain.ChainBuilder;
|
||||
import com.gh.common.chain.ChainHandler;
|
||||
import com.gh.common.chain.CheckDownloadHandler;
|
||||
import com.gh.common.chain.CheckStoragePermissionHandler;
|
||||
import com.gh.common.chain.DownloadDialogHelperHandler;
|
||||
import com.gh.common.chain.GamePermissionHandler;
|
||||
import com.gh.common.chain.OverseaDownloadHandler;
|
||||
@ -397,8 +398,9 @@ public class BindingAdapters {
|
||||
}
|
||||
|
||||
ChainBuilder builder = new ChainBuilder();
|
||||
builder.addHandler(new ValidateVSpaceHandler());
|
||||
builder.addHandler(new GamePermissionHandler());
|
||||
builder.addHandler(new CheckStoragePermissionHandler());
|
||||
builder.addHandler(new ValidateVSpaceHandler());
|
||||
builder.addHandler(new BrowserInstallHandler());
|
||||
builder.addHandler(new PackageCheckHandler());
|
||||
builder.addHandler(new DownloadDialogHelperHandler());
|
||||
@ -455,7 +457,7 @@ public class BindingAdapters {
|
||||
}
|
||||
|
||||
if (gameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch((AppCompatActivity) v.getContext(), gameEntity.getApk().get(0).getPackageName());
|
||||
VHelper.installOrLaunch((AppCompatActivity) v.getContext(), gameEntity);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -473,10 +475,9 @@ public class BindingAdapters {
|
||||
case INSTALL_NORMAL:
|
||||
if (gameEntity.getApk().size() == 1) {
|
||||
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity);
|
||||
String packageName = gameEntity.getApk().get(0).getPackageName();
|
||||
|
||||
if (gameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch(v.getContext(), packageName);
|
||||
VHelper.installOrLaunch(v.getContext(), gameEntity);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -594,9 +595,10 @@ public class BindingAdapters {
|
||||
case timeout:
|
||||
case neterror:
|
||||
case diskisfull:
|
||||
case diskioerror:
|
||||
case waiting:
|
||||
progressBar.setText(R.string.downloading);
|
||||
if (downloadEntity.isPluggable() && PackagesManager.INSTANCE.isInstalled(downloadEntity.getPackageName())) {
|
||||
if (downloadEntity.isPluggable() && PackagesManager.isInstalled(downloadEntity.getPackageName())) {
|
||||
progressBar.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN);
|
||||
} else {
|
||||
progressBar.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
|
||||
@ -605,7 +607,7 @@ public class BindingAdapters {
|
||||
case done:
|
||||
progressBar.setText(R.string.install);
|
||||
if (downloadEntity.isPluggable()
|
||||
&& PackagesManager.INSTANCE.isInstalled(downloadEntity.getPackageName())) {
|
||||
&& PackagesManager.isInstalled(downloadEntity.getPackageName())) {
|
||||
progressBar.setButtonStyle(DownloadButton.ButtonStyle.INSTALL_PLUGIN);
|
||||
} else {
|
||||
progressBar.setButtonStyle(DownloadButton.ButtonStyle.INSTALL_NORMAL);
|
||||
|
||||
@ -13,6 +13,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import com.airbnb.lottie.LottieAnimationView
|
||||
import com.gh.common.constant.Config
|
||||
import com.gh.common.util.NewFlatLogUtils
|
||||
import com.gh.common.xapk.XapkInstaller
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.fragment.BaseDialogFragment
|
||||
@ -31,6 +32,8 @@ class InstallPermissionDialogFragment : BaseDialogFragment() {
|
||||
lateinit var mView: View
|
||||
var isXapk = false
|
||||
var url: String = ""
|
||||
var gameId: String = ""
|
||||
var gameName: String = ""
|
||||
var mCallBack: ((isFromPermissionGrantedCallback: Boolean) -> Unit)? = null
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
@ -50,6 +53,8 @@ class InstallPermissionDialogFragment : BaseDialogFragment() {
|
||||
switchLottie.setAnimation("lottie/install_permission_switch.json")
|
||||
switchLottie.playAnimation()
|
||||
|
||||
if (isXapk) NewFlatLogUtils.logXApkInstallPermissionDialogShowed(gameId, gameName)
|
||||
|
||||
val randomNumber = if (isXapk) 1 else Random.nextInt(2)
|
||||
closeTv.goneIf(randomNumber == 0)
|
||||
closeIv.goneIf(randomNumber != 0)
|
||||
@ -60,14 +65,17 @@ class InstallPermissionDialogFragment : BaseDialogFragment() {
|
||||
|
||||
closeTv.setOnClickListener {
|
||||
if (isXapk) {
|
||||
NewFlatLogUtils.logXApkInstallPermissionDialogClick("尝试解压", false, gameId, gameName)
|
||||
mCallBack?.invoke(false)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
closeIv.setOnClickListener {
|
||||
if (isXapk) NewFlatLogUtils.logXApkInstallPermissionDialogClick("关闭", false, gameId, gameName)
|
||||
dismiss()
|
||||
}
|
||||
activateTv.setOnClickListener {
|
||||
NewFlatLogUtils.logXApkInstallPermissionDialogClick("立即开启", false, gameId, gameName)
|
||||
PermissionHelper.toInstallPermissionSetting(requireActivity())
|
||||
if (isXapk) {
|
||||
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, requireActivity().javaClass.name)
|
||||
@ -79,6 +87,8 @@ class InstallPermissionDialogFragment : BaseDialogFragment() {
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode == RESULT_OK && requestCode == INSTALL_PERMISSION_CODE) {
|
||||
NewFlatLogUtils.logXApkInstallPermissionDialogClick("立即开启", true, gameId, gameName)
|
||||
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
|
||||
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, "")
|
||||
SPUtils.setString(Constants.SP_XAPK_URL, "")
|
||||
@ -124,6 +134,8 @@ class InstallPermissionDialogFragment : BaseDialogFragment() {
|
||||
installPermissionDialogFragment.mCallBack = callBack
|
||||
installPermissionDialogFragment.isXapk = isXapk
|
||||
installPermissionDialogFragment.url = downloadEntity.url
|
||||
installPermissionDialogFragment.gameId = downloadEntity.gameId
|
||||
installPermissionDialogFragment.gameName = downloadEntity.name
|
||||
val transaction: FragmentTransaction = activity.supportFragmentManager.beginTransaction()
|
||||
transaction.show(installPermissionDialogFragment)
|
||||
transaction.commit()
|
||||
@ -132,6 +144,8 @@ class InstallPermissionDialogFragment : BaseDialogFragment() {
|
||||
this.mCallBack = callBack
|
||||
this.isXapk = isXapk
|
||||
this.url = downloadEntity.url
|
||||
this.gameId = downloadEntity.gameId
|
||||
this.gameName = downloadEntity.name
|
||||
}
|
||||
installPermissionDialogFragment.show(
|
||||
activity.supportFragmentManager,
|
||||
|
||||
@ -5,6 +5,7 @@ import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.common.loghub.LoghubHelper
|
||||
import com.gh.gamecenter.common.utils.FixedSizeLinkedHashSet
|
||||
import com.gh.gamecenter.common.utils.toJson
|
||||
import com.gh.gamecenter.core.AppExecutor
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.lightgame.utils.Utils
|
||||
|
||||
@ -30,19 +31,7 @@ object ExposureManager {
|
||||
* Log a single exposure event.
|
||||
*/
|
||||
fun log(event: ExposureEvent) {
|
||||
if (!exposureCache.contains(event.id)) {
|
||||
exposureSet.add(event)
|
||||
exposureCache.add(event.id)
|
||||
} else {
|
||||
Utils.log("Exposure", "遇到重复曝光事件,自动过滤 (${event.id} - ${event.payload.gameName})")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a collection of exposure event.
|
||||
*/
|
||||
fun log(eventList: List<ExposureEvent>) {
|
||||
for (event in eventList) {
|
||||
AppExecutor.logExecutor.execute {
|
||||
if (!exposureCache.contains(event.id)) {
|
||||
exposureSet.add(event)
|
||||
exposureCache.add(event.id)
|
||||
@ -50,29 +39,47 @@ object ExposureManager {
|
||||
Utils.log("Exposure", "遇到重复曝光事件,自动过滤 (${event.id} - ${event.payload.gameName})")
|
||||
}
|
||||
}
|
||||
commitSavedExposureEvents()
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a collection of exposure event.
|
||||
*/
|
||||
fun log(eventList: List<ExposureEvent>) {
|
||||
AppExecutor.logExecutor.execute {
|
||||
for (event in eventList) {
|
||||
if (!exposureCache.contains(event.id)) {
|
||||
exposureSet.add(event)
|
||||
exposureCache.add(event.id)
|
||||
} else {
|
||||
Utils.log("Exposure", "遇到重复曝光事件,自动过滤 (${event.id} - ${event.payload.gameName})")
|
||||
}
|
||||
}
|
||||
commitSavedExposureEvents()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param forcedUpload Ignore all restrictions.
|
||||
*/
|
||||
fun commitSavedExposureEvents(forcedUpload: Boolean = false) {
|
||||
if (exposureSet.size < STORE_SIZE && !forcedUpload || exposureSet.size == 0) return
|
||||
AppExecutor.logExecutor.execute {
|
||||
if (exposureSet.size < STORE_SIZE && !forcedUpload || exposureSet.size == 0) return@execute
|
||||
|
||||
uploadExposures(exposureSet.toList(), forcedUpload)
|
||||
uploadExposures(exposureSet, forcedUpload)
|
||||
|
||||
Utils.log("Exposure", "提交了${exposureSet.size}条曝光记录")
|
||||
exposureSet.clear()
|
||||
Utils.log("Exposure", "提交了${exposureSet.size}条曝光记录")
|
||||
exposureSet.clear()
|
||||
}
|
||||
}
|
||||
|
||||
private fun eliminateMultipleBrackets(jsonWithMultipleBracket: String): String {
|
||||
return jsonWithMultipleBracket.replace("[[", "[").replace("]]", "]")
|
||||
}
|
||||
|
||||
private fun uploadExposures(eventList: List<ExposureEvent>, forced: Boolean) {
|
||||
eventList.forEach {
|
||||
private fun uploadExposures(eventSet: HashSet<ExposureEvent>, forced: Boolean) {
|
||||
eventSet.forEach {
|
||||
LoghubHelper.uploadLog(buildLog(it), LOG_STORE, forced)
|
||||
it.recycle()
|
||||
// it.recycle()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.gh.common.exposure
|
||||
import android.text.TextUtils
|
||||
import com.g00fy2.versioncompare.Version
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.common.util.RealNameHelper
|
||||
import com.gh.gamecenter.common.utils.FixedSizeLinkedHashSet
|
||||
import com.gh.gamecenter.common.utils.toObject
|
||||
import com.gh.gamecenter.feature.entity.ApkEntity
|
||||
@ -30,6 +31,9 @@ object ExposureUtils {
|
||||
} else {
|
||||
entity.id
|
||||
}
|
||||
|
||||
traceEvent ?: gameEntity.exposureEvent
|
||||
|
||||
gameEntity.gameVersion = entity.getApk().elementAtOrNull(0)?.version
|
||||
?: gameEntity.gameVersion
|
||||
gameEntity.platform = platform
|
||||
@ -39,7 +43,9 @@ object ExposureUtils {
|
||||
source = traceEvent?.source ?: ArrayList(),
|
||||
eTrace = ExposureTraceUtils.appendTrace(traceEvent),
|
||||
event = ExposureType.DOWNLOAD
|
||||
)
|
||||
).apply {
|
||||
this.payload.certification = RealNameHelper.getCertificationStatus()
|
||||
}
|
||||
if (!TextUtils.isEmpty(entity.id)) {
|
||||
ExposureManager.log(exposureEvent)
|
||||
}
|
||||
@ -75,7 +81,9 @@ object ExposureUtils {
|
||||
source = traceEvent?.source ?: ArrayList(),
|
||||
eTrace = ExposureTraceUtils.appendTrace(traceEvent),
|
||||
event = ExposureType.DOWNLOAD_COMPLETE
|
||||
)
|
||||
).apply {
|
||||
this.payload.certification = RealNameHelper.getCertificationStatus()
|
||||
}
|
||||
exposureEvent.payload.host = host
|
||||
exposureEvent.payload.path = path
|
||||
exposureEvent.payload.speed = speed
|
||||
|
||||
@ -8,6 +8,8 @@ import com.google.gson.annotations.SerializedName
|
||||
class RegionSetting(
|
||||
@SerializedName("game_mirror")
|
||||
var mirrorGameIdSet: HashSet<String>,
|
||||
@SerializedName("game_mirror2")
|
||||
var mirrorGameIdSet2: HashSet<String>?,
|
||||
@SerializedName("game_block")
|
||||
var filterGameIdSet: HashSet<String>,
|
||||
@SerializedName("channel_control")
|
||||
|
||||
@ -23,7 +23,8 @@ object RegionSettingHelper {
|
||||
|
||||
private var mChannelControl: RegionSetting.ChannelControl? = null
|
||||
private var mFilterGameIdSet: HashSet<String>? = hashSetOf()
|
||||
private var mDisplayMirrorIfoGameIdSet: HashSet<String>? = hashSetOf()
|
||||
private var mDisplayMirrorGameIdSet: HashSet<String>? = hashSetOf()
|
||||
private var mDisplayMirrorGameIdSet2: HashSet<String>? = hashSetOf()
|
||||
private var mGameH5DownloadList: List<RegionSetting.GameH5Download>? = listOf()
|
||||
private var mGameSpecialDownloadInfoList: List<RegionSetting.GameSpecialDownloadInfo>? = listOf()
|
||||
private var mIpInfo: IpInfo? = null
|
||||
@ -33,7 +34,21 @@ object RegionSettingHelper {
|
||||
|
||||
@JvmStatic
|
||||
fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
|
||||
return mDisplayMirrorIfoGameIdSet?.contains(gameId) ?: false
|
||||
return mDisplayMirrorGameIdSet?.contains(gameId) == true
|
||||
|| mDisplayMirrorGameIdSet2?.contains(gameId) == true
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取镜像数据的位置,是归属镜像 1 还是镜像 2
|
||||
*/
|
||||
fun getMirrorPosition(gameId: String): Int {
|
||||
return if (mDisplayMirrorGameIdSet?.contains(gameId) == true) {
|
||||
1
|
||||
} else if (mDisplayMirrorGameIdSet2?.contains(gameId) == true) {
|
||||
2
|
||||
} else {
|
||||
-1
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -131,7 +146,8 @@ object RegionSettingHelper {
|
||||
|
||||
private fun updateSettingsInMemory(data: RegionSetting) {
|
||||
mFilterGameIdSet = data.filterGameIdSet
|
||||
mDisplayMirrorIfoGameIdSet = data.mirrorGameIdSet
|
||||
mDisplayMirrorGameIdSet = data.mirrorGameIdSet
|
||||
mDisplayMirrorGameIdSet2 = data.mirrorGameIdSet2
|
||||
mChannelControl = data.channelControl
|
||||
mGameH5DownloadList = data.gameH5DownloadList
|
||||
mGameSpecialDownloadInfoList = data.gameSpecialDownloadInfoList
|
||||
|
||||
@ -69,4 +69,8 @@ class AppProviderImpl : IAppProvider {
|
||||
override fun getFlavorProvider(): IFlavorProvider {
|
||||
return HaloApp.getInstance().flavorProvider
|
||||
}
|
||||
|
||||
override fun getIsBrandNewInstall(): Boolean {
|
||||
return HaloApp.getInstance().isBrandNewInstall
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.exposure.ExposureManager
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.provider.IExposureManagerProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.exposureManager, name = "ExposureManager暴露服务")
|
||||
class ExposureManagerProviderImpl: IExposureManagerProvider {
|
||||
override fun logExposure(exposureEvent: ExposureEvent) {
|
||||
ExposureManager.log(exposureEvent)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.FloatingBackViewManager
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IFloatingBackViewManagerProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.floatingBackViewManager, name = "FloatingViewBackManager暴露服务")
|
||||
class FloatingBackViewManagerProviderImpl : IFloatingBackViewManagerProvider {
|
||||
|
||||
override fun enableBackViewForTaskType() {
|
||||
FloatingBackViewManager.enableBackView(FloatingBackViewManager.TYPE_TASK)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -22,7 +22,7 @@ class GameDetailProviderImpl : IGameDetailProvider {
|
||||
context: Context,
|
||||
gameEntity: GameEntity?,
|
||||
entrance: String,
|
||||
defaultTab: Int,
|
||||
defaultTab: String,
|
||||
isSkipGameComment: Boolean,
|
||||
scrollToLibao: Boolean,
|
||||
scrollToServer: Boolean,
|
||||
|
||||
@ -7,7 +7,8 @@ import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.entity.LinkEntity
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.common.entity.SuggestType
|
||||
import com.gh.gamecenter.common.provider.ILinkDirectUtilsProvider
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.provider.ILinkDirectUtilsProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.linkDirectUtils, name = "DirectUtils暴露服务,主要是暴露directToLinkPage方法")
|
||||
class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
|
||||
@ -21,6 +22,16 @@ class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
|
||||
DirectUtils.directToLinkPage(context, linkEntity, entrance, path)
|
||||
}
|
||||
|
||||
override fun directToLinkPage(
|
||||
context: Context,
|
||||
linkEntity: LinkEntity,
|
||||
entrance: String,
|
||||
path: String,
|
||||
exposureEvent: ExposureEvent?
|
||||
) {
|
||||
DirectUtils.directToLinkPage(context, linkEntity, entrance, path, exposureEvent)
|
||||
}
|
||||
|
||||
override fun directToSuggestion(context: Context, type: SuggestType, requestCode: Int?) {
|
||||
DirectUtils.directToSuggestion(context, type, requestCode)
|
||||
}
|
||||
|
||||
@ -14,6 +14,10 @@ class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
|
||||
return RegionSettingHelper.shouldThisGameDisplayMirrorInfo(gameId)
|
||||
}
|
||||
|
||||
override fun getMirrorPosition(gameId: String): Int {
|
||||
return RegionSettingHelper.getMirrorPosition(gameId)
|
||||
}
|
||||
|
||||
override fun shouldThisGameShowSpecialDownload(gameId: String): Boolean {
|
||||
return RegionSettingHelper.shouldThisGameShowSpecialDownload(gameId)
|
||||
}
|
||||
|
||||
@ -102,6 +102,9 @@ class SimulatorDownloadManager private constructor() {
|
||||
DownloadStatus.diskisfull == downloadEntity.status -> {
|
||||
ToastUtils.showToast("存储空间已满,下载任务已暂停")
|
||||
}
|
||||
DownloadStatus.diskioerror == downloadEntity.status -> {
|
||||
ToastUtils.showToast("下载 IO 出现异常,下载任务已暂停")
|
||||
}
|
||||
DownloadStatus.neterror == downloadEntity.status -> {
|
||||
ToastUtils.showToast("网络不稳定,下载任务已暂停")
|
||||
}
|
||||
@ -301,6 +304,7 @@ class SimulatorDownloadManager private constructor() {
|
||||
DownloadStatus.subscribe,
|
||||
DownloadStatus.neterror,
|
||||
DownloadStatus.timeout,
|
||||
DownloadStatus.diskioerror,
|
||||
DownloadStatus.diskisfull -> {
|
||||
DownloadManager.getInstance().addObserver(dataWatcher)
|
||||
uiExecutor.executeWithDelay(Runnable { DownloadManager.getInstance().resume(entity, true) }, 200)
|
||||
|
||||
@ -49,7 +49,7 @@ object ArchiveDownloadButtonHelper {
|
||||
downloadBtn.setOnClickListener {
|
||||
when {
|
||||
// 检查是否已安装畅玩助手
|
||||
!VHelper.isVSpaceInstalled(context) -> showVspaceTipDialog(context, gameEntity)
|
||||
!VHelper.isVSpaceInstalled(context) -> showVSpaceTipDialog(context, gameEntity)
|
||||
// 检查是否已安装游戏
|
||||
!VHelper.isInstalled(packageName) -> {
|
||||
// 检查游戏是否在安装中
|
||||
@ -82,7 +82,7 @@ object ArchiveDownloadButtonHelper {
|
||||
}
|
||||
}
|
||||
|
||||
private fun showVspaceTipDialog(context: Context, gameEntity: GameEntity?) {
|
||||
private fun showVSpaceTipDialog(context: Context, gameEntity: GameEntity?) {
|
||||
NewFlatLogUtils.logCloudArchiveVSpaceDownloadDialogShow()
|
||||
DialogHelper.showDialog(
|
||||
context,
|
||||
@ -92,7 +92,7 @@ object ArchiveDownloadButtonHelper {
|
||||
R.string.cancel.toResString(),
|
||||
{
|
||||
NewFlatLogUtils.logCloudArchiveVSpaceDownloadDialogClick(R.string.archive_vspace_dialog_confirm.toResString())
|
||||
VHelper.showVspaceDialog(context, gameEntity)
|
||||
VHelper.showVSpaceDialog(context, gameEntity)
|
||||
},
|
||||
{
|
||||
NewFlatLogUtils.logCloudArchiveVSpaceDownloadDialogClick(R.string.cancel.toResString())
|
||||
@ -125,7 +125,8 @@ object ArchiveDownloadButtonHelper {
|
||||
context: Context,
|
||||
entrance: String,
|
||||
packageName: String,
|
||||
archiveEntity: ArchiveEntity
|
||||
archiveEntity: ArchiveEntity,
|
||||
gameEntity: GameEntity?
|
||||
) {
|
||||
VArchiveHelper.getArchiveFile(archiveEntity.md5)?.run {
|
||||
|
||||
@ -145,7 +146,14 @@ object ArchiveDownloadButtonHelper {
|
||||
}
|
||||
}
|
||||
|
||||
NewFlatLogUtils.logCloudArchiveDownloadOrApply(archiveEntity.name, entrance)
|
||||
NewFlatLogUtils.logCloudArchiveDownloadOrApply(
|
||||
archiveEntity.name,
|
||||
entrance,
|
||||
gameEntity?.id ?: "",
|
||||
gameEntity?.name ?: "",
|
||||
archiveEntity.id,
|
||||
false
|
||||
)
|
||||
}
|
||||
|
||||
private fun downloadArchive(
|
||||
@ -204,7 +212,14 @@ object ArchiveDownloadButtonHelper {
|
||||
|
||||
})
|
||||
|
||||
NewFlatLogUtils.logCloudArchiveDownloadOrApply(archiveEntity.name, entrance)
|
||||
NewFlatLogUtils.logCloudArchiveDownloadOrApply(
|
||||
archiveEntity.name,
|
||||
entrance,
|
||||
gameEntity?.id ?: "",
|
||||
gameEntity?.name ?: "",
|
||||
archiveEntity.id,
|
||||
true
|
||||
)
|
||||
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveDownload",
|
||||
@ -246,7 +261,7 @@ object ArchiveDownloadButtonHelper {
|
||||
R.string.archive_apply.toResString(),
|
||||
R.string.cancel.toResString(),
|
||||
{
|
||||
applyArchive(context, entrance, packageName, archiveEntity)
|
||||
applyArchive(context, entrance, packageName, archiveEntity, gameEntity)
|
||||
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_click", "使用")
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveOverwriteDialogClick",
|
||||
|
||||
@ -3,11 +3,15 @@ package com.gh.common.util;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
@ -19,6 +23,7 @@ import com.gh.gamecenter.adapter.viewholder.CommentViewHolder;
|
||||
import com.gh.gamecenter.common.callback.SimpleCallback;
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.common.utils.DialogHelper;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.utils.ImageUtils;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
@ -45,6 +50,7 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
@ -102,17 +108,27 @@ public class CommentUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void showReportDialog(final CommentEntity commentEntity,
|
||||
final Context context,
|
||||
final boolean showConversation,
|
||||
final String patch) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
|
||||
LinearLayout container = new LinearLayout(context);
|
||||
container.setOrientation(LinearLayout.VERTICAL);
|
||||
container.setBackgroundColor(ContextCompat.getColor(context, R.color.background_white));
|
||||
container.setPadding(0, DisplayUtils.dip2px(context, 12), 0, DisplayUtils.dip2px(context, 12));
|
||||
public static void showMorePopupWindow(
|
||||
final View anchor,
|
||||
final CommentEntity commentEntity,
|
||||
final boolean showConversation,
|
||||
final String patch,
|
||||
final OnCommentDeleteListener onCommentDeleteListener
|
||||
) {
|
||||
Context context = anchor.getContext();
|
||||
LayoutInflater inflater = LayoutInflater.from(context);
|
||||
View contentView = inflater.inflate(R.layout.layout_popup_container, null);
|
||||
PopupWindow popupWindow = new PopupWindow(
|
||||
contentView,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
popupWindow.setBackgroundDrawable(new ColorDrawable(0));
|
||||
popupWindow.setTouchable(true);
|
||||
popupWindow.setFocusable(true);
|
||||
popupWindow.setOutsideTouchable(true);
|
||||
|
||||
LinearLayout container = contentView.findViewById(R.id.container);
|
||||
List<String> dialogType = new ArrayList<>();
|
||||
dialogType.add("复制");
|
||||
dialogType.add("投诉");
|
||||
@ -121,21 +137,23 @@ public class CommentUtils {
|
||||
dialogType.add("查看对话");
|
||||
}
|
||||
|
||||
String commentUserId = commentEntity.getUser().getId();
|
||||
String userId = UserManager.getInstance().getUserId();
|
||||
MeEntity me = commentEntity.getMe();
|
||||
boolean isCommentedByUser = Objects.equals(commentUserId, userId);
|
||||
boolean isContentAuthorOrModerator = me != null && (me.isModerator() || me.isContentAuthor());
|
||||
if (isCommentedByUser || isContentAuthorOrModerator) {
|
||||
dialogType.add("删除");
|
||||
}
|
||||
|
||||
for (String s : dialogType) {
|
||||
final TextView reportTv = new TextView(context);
|
||||
View itemView = inflater.inflate(R.layout.layout_popup_option_item, container, false);
|
||||
TextView reportTv = itemView.findViewById(R.id.hint_text);
|
||||
reportTv.setText(s);
|
||||
reportTv.setTextSize(17);
|
||||
reportTv.setTextColor(ContextCompat.getColor(context, R.color.title));
|
||||
reportTv.setBackgroundResource(R.drawable.textview_white_style);
|
||||
int widthPixels = context.getResources().getDisplayMetrics().widthPixels;
|
||||
reportTv.setLayoutParams(new LinearLayout.LayoutParams((widthPixels * 9) / 10,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT));
|
||||
reportTv.setPadding(DisplayUtils.dip2px(context, 20), DisplayUtils.dip2px(context, 12),
|
||||
0, DisplayUtils.dip2px(context, 12));
|
||||
container.addView(reportTv);
|
||||
container.addView(itemView);
|
||||
|
||||
reportTv.setOnClickListener(v -> {
|
||||
dialog.cancel();
|
||||
popupWindow.dismiss();
|
||||
switch (reportTv.getText().toString()) {
|
||||
case "复制":
|
||||
copyText(commentEntity.getContent(), context);
|
||||
@ -143,19 +161,30 @@ public class CommentUtils {
|
||||
case "投诉":
|
||||
CheckLoginUtils.checkLogin(context, patch + "-投诉",
|
||||
() -> showReportTypeDialog(commentEntity, context));
|
||||
|
||||
break;
|
||||
case "查看对话":
|
||||
context.startActivity(CommentDetailActivity.getIntent(context, commentEntity.getId(), null));
|
||||
break;
|
||||
case "删除":
|
||||
DialogHelper.INSTANCE.showDialog(
|
||||
context,
|
||||
"提示",
|
||||
"删除评论后,评论下所有的回复都将被删除",
|
||||
"删除",
|
||||
"取消",
|
||||
() -> {
|
||||
deleteComment(context, commentEntity, onCommentDeleteListener);
|
||||
return null;
|
||||
},
|
||||
null,
|
||||
new DialogHelper.Config("", false, true, true, false, -1)
|
||||
);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(container);
|
||||
dialog.show();
|
||||
|
||||
ExtensionsKt.showAutoOrientation(popupWindow, anchor, 0, 0);
|
||||
}
|
||||
|
||||
private static void showReportTypeDialog(final CommentEntity commentEntity, final Context context) {
|
||||
@ -430,6 +459,28 @@ public class CommentUtils {
|
||||
});
|
||||
}
|
||||
|
||||
public static void deleteComment(
|
||||
final Context context,
|
||||
final CommentEntity commentEntity,
|
||||
final OnCommentDeleteListener listener
|
||||
) {
|
||||
Dialog dialog = DialogUtils.showWaitDialog(
|
||||
context,
|
||||
context.getString(R.string.post_dialog_hint)
|
||||
);
|
||||
RetrofitManager.getInstance().getApi()
|
||||
.deleteComment(commentEntity.getId())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doFinally(dialog::cancel)
|
||||
.subscribe(new Response<ResponseBody>() {
|
||||
@Override
|
||||
public void onResponse(@Nullable ResponseBody response) {
|
||||
listener.onCommentDelete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 设置评论item 用户相关的view(点赞/头像/用户名)
|
||||
public static void setCommentUserView(Context mContext, CommentViewHolder holder, CommentEntity entity) {
|
||||
@ -540,4 +591,8 @@ public class CommentUtils {
|
||||
public interface OnVoteListener {
|
||||
void onVote();
|
||||
}
|
||||
|
||||
public interface OnCommentDeleteListener {
|
||||
void onCommentDelete();
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,14 +171,25 @@ public class DataUtils {
|
||||
IdCardEntity idCardEntity = data.getIdCard();
|
||||
|
||||
if (idCardEntity != null) {
|
||||
values.put(GhContentProvider.KEY_IS_CERTIFICATED, !TextUtils.isEmpty(data.getIdCard().getId())); // 是否认证
|
||||
values.put(GhContentProvider.KEY_IS_ADULT,
|
||||
data.getIdCard().getMinor() == null
|
||||
|| !data.getIdCard().getMinor()
|
||||
);
|
||||
boolean isCertificated = !TextUtils.isEmpty(data.getIdCard().getId());
|
||||
boolean isAdult = data.getIdCard().getMinor() == null || !data.getIdCard().getMinor();
|
||||
|
||||
values.put(GhContentProvider.KEY_IS_CERTIFICATED, isCertificated); // 是否认证
|
||||
values.put(GhContentProvider.KEY_IS_ADULT, isAdult); // 是否成年
|
||||
|
||||
if (!isCertificated) {
|
||||
RealNameHelper.updateCertificationStatus(0);
|
||||
} else {
|
||||
if (isAdult) {
|
||||
RealNameHelper.updateCertificationStatus(2);
|
||||
} else {
|
||||
RealNameHelper.updateCertificationStatus(1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
values.put(GhContentProvider.KEY_IS_CERTIFICATED, false);
|
||||
values.put(GhContentProvider.KEY_IS_ADULT, false);
|
||||
RealNameHelper.updateCertificationStatus(0);
|
||||
}
|
||||
|
||||
EventBus.getDefault().post(new EBReuse(Constants.EB_REALNAME_RESULT));
|
||||
|
||||
@ -114,7 +114,7 @@ public class DetailDownloadUtils {
|
||||
if (downloadEntity == null && viewHolder.gameEntity.isVGame()) {
|
||||
String packageName = viewHolder.gameEntity.getUniquePackageName();
|
||||
if (!TextUtils.isEmpty(packageName)) {
|
||||
downloadEntity = VHelper.getDownloadEntitySnapshot(viewHolder.gameEntity.getId(), packageName);
|
||||
downloadEntity = VHelper.getVDownloadEntitySnapshot(viewHolder.gameEntity.getId(), packageName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ public class DetailDownloadUtils {
|
||||
if (downloadEntity == null && viewHolder.gameEntity.isVGame()) {
|
||||
String packageName = viewHolder.gameEntity.getUniquePackageName();
|
||||
if (!TextUtils.isEmpty(packageName)) {
|
||||
downloadEntity = VHelper.getDownloadEntitySnapshot(viewHolder.gameEntity.getId(), packageName);
|
||||
downloadEntity = VHelper.getVDownloadEntitySnapshot(viewHolder.gameEntity.getId(), packageName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,11 +263,12 @@ public class DetailDownloadUtils {
|
||||
case redirected:
|
||||
case pause:
|
||||
case diskisfull:
|
||||
case diskioerror:
|
||||
case overflow:
|
||||
String downloadingText = "游戏加载中 " + downloadEntity.getPercent() + "%";
|
||||
String resumeText = "继续加载 " + downloadEntity.getPercent() + "%";
|
||||
viewHolder.mDownloadPb.setText((downloadEntity.getStatus() == DownloadStatus.downloading || downloadEntity.getStatus() == DownloadStatus.redirected) ? downloadingText : resumeText);
|
||||
if (downloadEntity.isPluggable() && PackagesManager.INSTANCE.isInstalled(downloadEntity.getPackageName())) {
|
||||
if (downloadEntity.isPluggable() && PackagesManager.isInstalled(downloadEntity.getPackageName())) {
|
||||
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN);
|
||||
} else {
|
||||
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
|
||||
@ -350,6 +351,7 @@ public class DetailDownloadUtils {
|
||||
case neterror:
|
||||
case subscribe:
|
||||
case diskisfull:
|
||||
case diskioerror:
|
||||
case pause:
|
||||
viewHolder.mDownloadPb.setText("继续加载 " + viewHolder.downloadEntity.getPercent() + "%");
|
||||
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
|
||||
|
||||
@ -41,6 +41,7 @@ import com.facebook.drawee.generic.GenericDraweeHierarchy;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.filter.RegionSetting;
|
||||
import com.gh.common.xapk.XapkDialogHelper;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.ShellActivity;
|
||||
import com.gh.gamecenter.adapter.ReportReasonAdapter;
|
||||
@ -120,7 +121,7 @@ public class DialogUtils {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public static void checkDownload(Context context, String size, CheckDownloadCallBack callBack) {
|
||||
public static void checkDownload(Context context, String size, String gameId, String gameName, CheckDownloadCallBack callBack) {
|
||||
if (!NetworkUtils.isNetworkConnected(context)) {
|
||||
showNoConnectionDownloadDialog(context, () -> {
|
||||
},
|
||||
@ -135,7 +136,9 @@ public class DialogUtils {
|
||||
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(context), "出现弹窗提示");
|
||||
showDownloadDialog(context,
|
||||
() -> callBack.onResponse(false),
|
||||
() -> callBack.onResponse(true));
|
||||
() -> callBack.onResponse(true),
|
||||
gameId,
|
||||
gameName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,9 +167,11 @@ public class DialogUtils {
|
||||
DialogHelper.showDialog(context, "下载提示", "网络异常,请检查手机网络状态", "知道了", "WiFi自动下载", listener::onConfirm, cancelListener::onCancel, false, "", "");
|
||||
}
|
||||
|
||||
public static void showDownloadDialog(Context context, ConfirmListener listener, CancelListener cancelListener) {
|
||||
public static void showDownloadDialog(Context context, ConfirmListener listener, CancelListener cancelListener, String gameId, String gameName) {
|
||||
context = checkDialogContext(context);
|
||||
|
||||
NewFlatLogUtils.logDownloadMobileDataDialogShow(gameId, gameName);
|
||||
|
||||
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
|
||||
|
||||
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_download_traffic, null);
|
||||
@ -176,6 +181,7 @@ public class DialogUtils {
|
||||
|
||||
Context finalContext = context;
|
||||
allowOnce.setOnClickListener(v -> {
|
||||
NewFlatLogUtils.logDownloadMobileDataDialogClick(gameId, gameName, "允许一次");
|
||||
AppExecutor.getUiExecutor().executeWithDelay(() -> {
|
||||
Utils.toast(finalContext, "已使用移动网络下载,请注意流量消耗");
|
||||
}, 500);
|
||||
@ -184,11 +190,13 @@ public class DialogUtils {
|
||||
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "本次允许");
|
||||
});
|
||||
wifiAuto.setOnClickListener(v -> {
|
||||
NewFlatLogUtils.logDownloadMobileDataDialogClick(gameId, gameName, "WiFi自动下载");
|
||||
cancelListener.onCancel();
|
||||
dialog.dismiss();
|
||||
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "连上WiFi后自动下载");
|
||||
});
|
||||
allowAlways.setOnClickListener(v -> {
|
||||
NewFlatLogUtils.logDownloadMobileDataDialogClick(gameId, gameName, "总是允许");
|
||||
SPUtils.setBoolean(getTrafficDownloadHintKey(), false);
|
||||
AppExecutor.getUiExecutor().executeWithDelay(() -> {
|
||||
// 显示了弹窗以后,即便下面这个 toast 放在 listener.onConfirm 后调用也是显示 listener.onConfirm 里的 toast
|
||||
@ -200,6 +208,8 @@ public class DialogUtils {
|
||||
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "总是允许");
|
||||
});
|
||||
|
||||
dialog.setOnCancelListener(downloadDialog -> NewFlatLogUtils.logDownloadMobileDataDialogClick(gameId, gameName, "关闭弹窗"));
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(contentView);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
@ -963,33 +973,7 @@ public class DialogUtils {
|
||||
}
|
||||
|
||||
public static void showUnzipFailureDialog(Context context, DownloadEntity downloadEntity) {
|
||||
final Context activityContext = checkDialogContext(context);
|
||||
|
||||
final Dialog dialog = new Dialog(activityContext, R.style.GhAlertDialog);
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent);
|
||||
}
|
||||
|
||||
View contentView = LayoutInflater.from(activityContext).inflate(R.layout.dialog_unzip_failure, null);
|
||||
|
||||
View cancelBtn = contentView.findViewById(R.id.cancel);
|
||||
View confirmBtn = contentView.findViewById(R.id.confirm);
|
||||
|
||||
|
||||
cancelBtn.setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
confirmBtn.setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
String hint = "《" + downloadEntity.getName() + "》游戏安装包解压失败,问题反馈:";
|
||||
HelpAndFeedbackBridge.startSuggestionActivity(activityContext, SuggestType.normal, null, hint);
|
||||
});
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(contentView);
|
||||
dialog.show();
|
||||
XapkDialogHelper.INSTANCE.showUnzipFailureDialog(context, downloadEntity, false);
|
||||
}
|
||||
|
||||
public static void showNoticeDialog(Context context, String title, String content, @NonNull ConfirmListener listener) {
|
||||
@ -1030,7 +1014,7 @@ public class DialogUtils {
|
||||
SimpleDraweeView badgeView = contentView.findViewById(R.id.dialog_badge);
|
||||
ImageView badgeLightBg = contentView.findViewById(R.id.dialog_badge_light_bg);
|
||||
|
||||
ImageUtils.display(badgeView, badge.getIcon());
|
||||
ImageUtils.display(badgeView, badge.getMIcon());
|
||||
titleTv.setText(badge.getName());
|
||||
|
||||
// 领取条件文本超过一行就不显示
|
||||
@ -1084,6 +1068,8 @@ public class DialogUtils {
|
||||
|
||||
if ("self".equals(badge.getReceive().getType())) {
|
||||
receiveTv.setText(R.string.receive_badge);
|
||||
} else if ("auto".equals(badge.getReceive().getType())) {
|
||||
receiveTv.setText(R.string.view_badge);
|
||||
} else {
|
||||
receiveTv.setText(R.string.apply_badge);
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@ import com.gh.gamecenter.feature.exposure.ExposureEvent.Companion.createEvent
|
||||
import com.gh.gamecenter.feature.exposure.ExposureType
|
||||
import com.gh.gamecenter.forum.detail.ForumDetailActivity
|
||||
import com.gh.gamecenter.forum.home.CommunityHomeFragment
|
||||
import com.gh.gamecenter.forum.search.ForumOrUserSearchActivity
|
||||
import com.gh.gamecenter.fragment.MainWrapperFragment
|
||||
import com.gh.gamecenter.game.columncollection.detail.ColumnCollectionDetailActivity
|
||||
import com.gh.gamecenter.game.commoncollection.detail.CommonCollectionDetailActivity
|
||||
@ -189,6 +190,7 @@ object DirectUtils {
|
||||
"game_list_detail",
|
||||
"bbs_video",
|
||||
"explore_column",
|
||||
"game_explore",
|
||||
"column_test_v2"
|
||||
)
|
||||
|
||||
@ -309,13 +311,14 @@ object DirectUtils {
|
||||
name = linkEntity.name,
|
||||
display = linkEntity.display ?: Display()
|
||||
),
|
||||
entrance
|
||||
entrance,
|
||||
exposureEvent
|
||||
)
|
||||
}
|
||||
|
||||
"column_collection", "专题合集" -> directToColumnCollection(context, linkEntity.link!!, -1, entrance)
|
||||
|
||||
"server", "game_server", "开服表" -> directToGameServers(context, entrance, path)
|
||||
"server", "game_server", "开服表" -> directToGameServers(context, entrance, path, exposureEvent)
|
||||
|
||||
"top_game_comment" -> directToAmway(context, null, entrance, path)
|
||||
|
||||
@ -437,11 +440,28 @@ object DirectUtils {
|
||||
|
||||
"game_list" -> directToGameCollectionSquare(context, entrance, "", "", "")
|
||||
|
||||
"game_list_detail" -> directToGameCollectionDetail(context, linkEntity.link ?: "", entrance)
|
||||
"game_list_detail" -> directToGameCollectionDetail(
|
||||
context,
|
||||
linkEntity.link ?: "",
|
||||
entrance,
|
||||
exposureEvent = exposureEvent
|
||||
)
|
||||
|
||||
"explore_column" -> context.startActivity(DiscoveryActivity.getIntent(context, entrance))
|
||||
"explore_column", "game_explore" -> context.startActivity(
|
||||
DiscoveryActivity.getIntent(
|
||||
context,
|
||||
entrance,
|
||||
exposureEvent
|
||||
)
|
||||
)
|
||||
|
||||
"column_test_v2" -> context.startActivity(GameServerTestV2Activity.getIntent(context, entrance))
|
||||
"column_test_v2" -> context.startActivity(
|
||||
GameServerTestV2Activity.getIntent(
|
||||
context,
|
||||
entrance,
|
||||
exposureEvent
|
||||
)
|
||||
)
|
||||
|
||||
"" -> {
|
||||
// do nothing
|
||||
@ -554,6 +574,9 @@ object DirectUtils {
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, NewsDetailActivity::class.java.simpleName)
|
||||
bundle.putString(KEY_NEWSID, id)
|
||||
if (entrance?.contains("隐私政策") == true) {
|
||||
bundle.putBoolean(KEY_HIDE_USELESS_INFO, true)
|
||||
}
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -656,10 +679,10 @@ object DirectUtils {
|
||||
bundle.putString(KEY_GAMEID, id)
|
||||
if (!TextUtils.isEmpty(tab)) {
|
||||
when (tab) {
|
||||
"comment" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_RATING)
|
||||
"desc" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_DESC)
|
||||
"forum" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_BBS)
|
||||
"zone" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_TRENDES)
|
||||
"comment" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_RATING)
|
||||
"desc" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
"forum" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_BBS)
|
||||
"zone" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_TRENDS)
|
||||
}
|
||||
}
|
||||
if (traceEvent != null) {
|
||||
@ -699,7 +722,7 @@ object DirectUtils {
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putString(KEY_GAMEID, id)
|
||||
bundle.putBoolean(KEY_OPEN_VIDEO_STREAMING, true)
|
||||
bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_DESC)
|
||||
bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -707,14 +730,14 @@ object DirectUtils {
|
||||
fun directToGameDetail(
|
||||
context: Context,
|
||||
id: String,
|
||||
defaultTab: Int = GameDetailFragment.INDEX_DESC,
|
||||
defaultTab: String = GameDetailFragment.TAB_DESC,
|
||||
entrance: String? = null
|
||||
) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, GameDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putString(KEY_GAMEID, id)
|
||||
bundle.putInt(KEY_TARGET, defaultTab)
|
||||
bundle.putString(KEY_TARGET, defaultTab)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -777,8 +800,11 @@ object DirectUtils {
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
/**
|
||||
* 畅玩助手反馈跳转
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToFeedbackCompat(
|
||||
fun directToVGameFeedback(
|
||||
context: Context,
|
||||
content: String? = null,
|
||||
hintType: String? = null,
|
||||
@ -793,14 +819,14 @@ object DirectUtils {
|
||||
if (isQaFeedback) {
|
||||
bundle.putBoolean(KEY_IS_QA_FEEDBACK, true)
|
||||
bundle.putString(KEY_QA_CONTENT_ID, qaContentId)
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.cwzsQuestion)
|
||||
} else {
|
||||
bundle.putString(KEY_CONTENT, content)
|
||||
if (TextUtils.isEmpty(hintType)) {
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.gameQuestion)
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN)
|
||||
} else {
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.cwzsQuestion)
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, hintType)
|
||||
}
|
||||
}
|
||||
@ -1348,11 +1374,17 @@ object DirectUtils {
|
||||
* 跳转到板块
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToBlock(context: Context, blockData: SubjectRecommendEntity, entrance: String) {
|
||||
fun directToBlock(
|
||||
context: Context,
|
||||
blockData: SubjectRecommendEntity,
|
||||
entrance: String,
|
||||
exposureEvent: ExposureEvent? = null
|
||||
) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, BlockActivity::class.java.name)
|
||||
bundle.putParcelable(KEY_BLOCK_DATA, blockData)
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
exposureEvent?.let { bundle.putParcelableArrayList(KEY_EXPOSURE_SOURCE_LIST, ArrayList(exposureEvent.source)) }
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -1360,10 +1392,11 @@ object DirectUtils {
|
||||
* 跳转到开服表
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToGameServers(context: Context, entrance: String, path: String) {
|
||||
fun directToGameServers(context: Context, entrance: String, path: String, exposureEvent: ExposureEvent? = null) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, GameServersActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, ToolBarActivity.mergeEntranceAndPath(entrance, path))
|
||||
exposureEvent?.let { bundle.putParcelableArrayList(KEY_EXPOSURE_SOURCE_LIST, ArrayList(exposureEvent.source)) }
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -1391,7 +1424,7 @@ object DirectUtils {
|
||||
response?.apply {
|
||||
if (zone.status == "on") {
|
||||
if (zone.style == "link") {
|
||||
directToGameDetail(context, gameId, GameDetailFragment.INDEX_TRENDES, entrance)
|
||||
directToGameDetail(context, gameId, GameDetailFragment.TAB_TRENDS, entrance)
|
||||
} else {
|
||||
directToWebView(context, url, entrance)
|
||||
}
|
||||
@ -1813,7 +1846,8 @@ object DirectUtils {
|
||||
collectionId: String,
|
||||
blockId: String = "",
|
||||
blockName: String = "",
|
||||
entrance: String = ""
|
||||
entrance: String = "",
|
||||
exposureEvent: ExposureEvent? = null
|
||||
) {
|
||||
if (collectionId.isEmpty()) return
|
||||
val bundle = Bundle()
|
||||
@ -1822,6 +1856,7 @@ object DirectUtils {
|
||||
bundle.putString(KEY_BLOCK_NAME, blockName)
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putString(KEY_COLLECTION_ID, collectionId)
|
||||
exposureEvent?.let { bundle.putParcelableArrayList(KEY_EXPOSURE_SOURCE_LIST, ArrayList(exposureEvent.source)) }
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -1857,13 +1892,20 @@ object DirectUtils {
|
||||
* 跳转至游戏单详情
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToGameCollectionDetail(context: Context, id: String, entrance: String? = null, path: String? = null) {
|
||||
fun directToGameCollectionDetail(
|
||||
context: Context,
|
||||
id: String,
|
||||
entrance: String? = null,
|
||||
path: String? = null,
|
||||
exposureEvent: ExposureEvent? = null
|
||||
) {
|
||||
if (id.isEmpty()) return
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_TO, GameCollectionDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_GAME_COLLECTION_ID, id)
|
||||
exposureEvent?.let { bundle.putParcelableArrayList(KEY_EXPOSURE_SOURCE_LIST, ArrayList(exposureEvent.source)) }
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -1905,6 +1947,15 @@ object DirectUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到论坛搜索页
|
||||
* @param bbsId, 为空时搜索全范围的内容,不为空时搜索该 bbsId 对应的内容
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToForumOrUserSearch(context: Context, bbsId: String, entrance: String) {
|
||||
context.startActivity(ForumOrUserSearchActivity.getIntent(context, bbsId, entrance))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun directToVGameDownload(context: Context, switchToDownloadingTab: Boolean = false) {
|
||||
val bundle = Bundle()
|
||||
|
||||
@ -29,7 +29,7 @@ object DownloadDialogHelper {
|
||||
|
||||
private fun retrieveAvailableDialog(gameEntity: GameEntity, apkEntity: ApkEntity): GameEntity.Dialog? {
|
||||
val downloadDialog = if (gameEntity.shouldUseMirrorInfo()) {
|
||||
gameEntity.mirrorData?.downloadDialog
|
||||
gameEntity.obtainMirrorData()?.downloadDialog
|
||||
} else {
|
||||
gameEntity.downloadDialog
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.collection.ArrayMap
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.common.chain.*
|
||||
import com.gh.common.constant.Config
|
||||
import com.gh.common.dialog.DeviceRemindDialog
|
||||
@ -25,13 +24,13 @@ import com.gh.download.dialog.DownloadDialog
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.WebActivity
|
||||
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.gamecenter.common.callback.CancelListener
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.entity.LinkEntity
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.energy.EnergyBridge
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.entity.PluginLocation
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
@ -245,9 +244,11 @@ object DownloadItemUtils {
|
||||
context.getString(R.string.check)
|
||||
}
|
||||
isClickable = true
|
||||
buttonStyle = DownloadButton.ButtonStyle.NORMAL
|
||||
} else {
|
||||
if ("dialog" == offStatus) {
|
||||
text = context.getString(R.string.check)
|
||||
buttonStyle = DownloadButton.ButtonStyle.NORMAL
|
||||
} else if ("updating" == offStatus) {
|
||||
text = context.getString(R.string.updating)
|
||||
buttonStyle = DownloadButton.ButtonStyle.UPDATING
|
||||
@ -265,7 +266,7 @@ object DownloadItemUtils {
|
||||
var downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity)
|
||||
|
||||
if (downloadEntity == null && gameEntity.isVGame()) {
|
||||
downloadEntity = VHelper.getDownloadEntitySnapshot(gameEntity.id, gameEntity.getUniquePackageName())
|
||||
downloadEntity = VHelper.getVDownloadEntitySnapshot(gameEntity.id, gameEntity.getUniquePackageName())
|
||||
}
|
||||
|
||||
if (downloadEntity == null) {
|
||||
@ -311,6 +312,7 @@ object DownloadItemUtils {
|
||||
DownloadStatus.neterror,
|
||||
DownloadStatus.subscribe,
|
||||
DownloadStatus.diskisfull,
|
||||
DownloadStatus.diskioerror,
|
||||
DownloadStatus.overflow -> {
|
||||
buttonStyle = DownloadButton.ButtonStyle.NORMAL
|
||||
setText(R.string.resume)
|
||||
@ -430,6 +432,7 @@ object DownloadItemUtils {
|
||||
DownloadStatus.pause,
|
||||
DownloadStatus.timeout,
|
||||
DownloadStatus.neterror,
|
||||
DownloadStatus.diskioerror,
|
||||
DownloadStatus.diskisfull,
|
||||
DownloadStatus.subscribe,
|
||||
DownloadStatus.overflow -> {
|
||||
@ -833,6 +836,7 @@ object DownloadItemUtils {
|
||||
addHandler(CertificationHandler())
|
||||
addHandler(VersionNumberHandler())
|
||||
addHandler(OverseaDownloadHandler())
|
||||
addHandler(CheckStoragePermissionHandler())
|
||||
addHandler(ValidateVSpaceHandler())
|
||||
addHandler(CheckDownloadHandler())
|
||||
}
|
||||
@ -881,12 +885,11 @@ object DownloadItemUtils {
|
||||
}
|
||||
|
||||
if (gameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity)
|
||||
} else {
|
||||
install(context, gameEntity, position, adapter, refreshCallback)
|
||||
}
|
||||
} else if (str == context.getString(R.string.launch)) {
|
||||
EnergyBridge.postEnergyTask("play_game", gameEntity.id, gameEntity.getApk()[0].packageName)
|
||||
//启动模拟器游戏
|
||||
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
|
||||
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(context)) {
|
||||
@ -907,7 +910,7 @@ object DownloadItemUtils {
|
||||
}
|
||||
|
||||
if (gameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity)
|
||||
return
|
||||
}
|
||||
|
||||
@ -925,7 +928,12 @@ object DownloadItemUtils {
|
||||
}
|
||||
DownloadDialogHelper.findAvailableDialogAndShow(context, gameEntity, apk, object : EmptyCallback {
|
||||
override fun onCallback() {
|
||||
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
|
||||
DialogUtils.checkDownload(
|
||||
context,
|
||||
apk.size,
|
||||
gameEntity.id,
|
||||
gameEntity.name
|
||||
) { isSubscribe: Boolean ->
|
||||
update(context, gameEntity, entrance, location, isSubscribe, traceEvent)
|
||||
}
|
||||
}
|
||||
@ -1068,6 +1076,7 @@ object DownloadItemUtils {
|
||||
"game_type", gameEntity.categoryChinese,
|
||||
"download_status", gameEntity.downloadStatusChinese,
|
||||
"button_name", buttonName,
|
||||
"game_schema_type", gameEntity.gameBitChinese,
|
||||
"page_name", GlobalActivityManager.getCurrentPageEntity().pageName,
|
||||
"page_id", GlobalActivityManager.getCurrentPageEntity().pageId,
|
||||
"page_business_id", GlobalActivityManager.getCurrentPageEntity().pageBusinessId,
|
||||
|
||||
@ -99,6 +99,7 @@ object DownloadNotificationHelper {
|
||||
DownloadStatus.subscribe,
|
||||
DownloadStatus.timeout,
|
||||
DownloadStatus.diskisfull,
|
||||
DownloadStatus.diskioerror,
|
||||
DownloadStatus.neterror -> builder.setContentText("已暂停,连接WiFi自动下载")
|
||||
else -> builder.setContentText("暂停中")
|
||||
}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.gh.common.util
|
||||
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
|
||||
import com.gh.common.constant.Config
|
||||
import com.gh.common.exposure.ExposureUtils
|
||||
import com.gh.common.simulator.SimulatorDownloadManager
|
||||
@ -10,6 +8,8 @@ import com.gh.common.xapk.XapkInstaller
|
||||
import com.gh.download.DownloadDataHelper
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.callback.ConfirmListener
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
@ -18,9 +18,7 @@ import com.gh.gamecenter.common.entity.SuggestType
|
||||
import com.gh.gamecenter.common.eventbus.EBShowDialog
|
||||
import com.gh.gamecenter.common.retrofit.Response
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.energy.EnergyBridge
|
||||
import com.gh.gamecenter.eventbus.EBDownloadStatus
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.entity.SimulatorEntity
|
||||
@ -89,6 +87,7 @@ object DownloadObserver {
|
||||
return
|
||||
} else if (DownloadStatus.neterror == downloadEntity.status
|
||||
|| DownloadStatus.timeout == downloadEntity.status
|
||||
|| DownloadStatus.diskioerror == downloadEntity.status
|
||||
|| DownloadStatus.diskisfull == downloadEntity.status) {
|
||||
if (downloadEntity.meta[Constants.MARK_RETRY_DOWNLOAD].isNullOrEmpty()
|
||||
&& NetworkUtils.isWifiConnected(HaloApp.getInstance().application)
|
||||
@ -102,6 +101,8 @@ object DownloadObserver {
|
||||
} else {
|
||||
if (DownloadStatus.diskisfull == downloadEntity.status) {
|
||||
ToastUtils.toast("磁盘已满,请清理空间后重试下载")
|
||||
} else if (DownloadStatus.diskioerror == downloadEntity.status) {
|
||||
ToastUtils.toast("磁盘 IO 异常,请稍后重试")
|
||||
} else {
|
||||
ToastUtils.toast("网络不稳定,下载任务已暂停")
|
||||
}
|
||||
@ -216,7 +217,6 @@ object DownloadObserver {
|
||||
|
||||
GameActivityDownloadHelper.clear()
|
||||
|
||||
EnergyBridge.postEnergyTask("download_game", downloadEntity.gameId, downloadEntity.packageName)
|
||||
val platform = PlatformUtils.getInstance(mApplication)
|
||||
.getPlatformName(downloadEntity.platform)
|
||||
if (platform != null) {
|
||||
@ -234,17 +234,13 @@ object DownloadObserver {
|
||||
downloadEntity.name + " - " + platform + " - 下载完成"
|
||||
)
|
||||
else -> {
|
||||
if (downloadEntity.isVGame()) {
|
||||
VHelper.showFloatingWindow(downloadEntity.packageName)
|
||||
} else {
|
||||
if (!downloadEntity.isVGame()) {
|
||||
Utils.toast(mApplication, downloadEntity.name + " - 下载完成")
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (downloadEntity.isVGame()) {
|
||||
VHelper.showFloatingWindow(downloadEntity.packageName)
|
||||
} else {
|
||||
if (!downloadEntity.isVGame()) {
|
||||
Utils.toast(mApplication, downloadEntity.name + " - 下载完成")
|
||||
}
|
||||
}
|
||||
@ -280,7 +276,7 @@ object DownloadObserver {
|
||||
val downloadType = downloadEntity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE)
|
||||
// 是否是自动安装
|
||||
val isAutoInstall = SPUtils.getBoolean(Constants.SP_AUTO_INSTALL, true)
|
||||
if (downloadType == Constants.SIMULATOR_DOWNLOAD || isAutoInstall) {
|
||||
if (downloadType != Constants.VSPACE_32_DOWNLOAD_ONLY && (downloadType == Constants.SIMULATOR_DOWNLOAD || isAutoInstall)) {
|
||||
if (FileUtils.isEmptyFile(downloadEntity.path)) {
|
||||
Utils.toast(mApplication, R.string.install_failure_hint)
|
||||
downloadManager.cancel(downloadEntity.url)
|
||||
@ -316,9 +312,6 @@ object DownloadObserver {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 统计下载完成
|
||||
uploadData(gameId, downloadEntity.platform)
|
||||
}
|
||||
|
||||
// 下载过程分析统计
|
||||
@ -385,14 +378,22 @@ object DownloadObserver {
|
||||
SensorsBridge.trackEvent(
|
||||
"HaloFunGameDownloadDone",
|
||||
"game_name", downloadEntity.name,
|
||||
"game_id", downloadEntity.gameId
|
||||
"game_id", downloadEntity.gameId,
|
||||
"game_schema_type", if (downloadEntity.getMetaExtra(VHelper.KEY_BIT) == "32") "32位" else "64位"
|
||||
)
|
||||
} else if (downloadEntity.gameId != "62bd412bbbf04747cd3de539") {
|
||||
} else if (downloadEntity.gameId == Constants.HALO_FUN_GAME_ID) {
|
||||
SensorsBridge.trackEvent(
|
||||
"HaloFunDownloadDone",
|
||||
"space_schema_type",
|
||||
if (downloadEntity.packageName == VHelper.VSPACE_32BIT_PACKAGENAME) "32位" else "64位"
|
||||
)
|
||||
} else if (downloadEntity.gameId != Constants.GHZS_GAME_ID && downloadEntity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE) != Constants.SIMULATOR_DOWNLOAD) {
|
||||
SensorsBridge.trackEvent(
|
||||
"DownloadProcessFinish",
|
||||
"game_id", downloadEntity.gameId,
|
||||
"game_name", downloadEntity.meta[Constants.GAME_NAME] ?: "",
|
||||
"game_type", downloadEntity.meta[Constants.GAME_TYPE] ?: "",
|
||||
"game_schema_type", if (downloadEntity.getMetaExtra(VHelper.KEY_BIT) == "32") "32位" else "64位",
|
||||
"page_name", getCurrentPageEntity().pageName,
|
||||
"page_id", getCurrentPageEntity().pageId,
|
||||
"page_business_id", getCurrentPageEntity().pageBusinessId,
|
||||
@ -451,19 +452,4 @@ object DownloadObserver {
|
||||
DataLogUtils.uploadHijack(mApplication, downloadEntity)
|
||||
}
|
||||
|
||||
// 统计下载
|
||||
private fun uploadData(id: String, platform: String?) {
|
||||
val params = HashMap<String, String>()
|
||||
params["game"] = id
|
||||
params["platform"] = platform ?: ""
|
||||
val body = RequestBody.create(
|
||||
MediaType.parse("application/json"),
|
||||
JSONObject(params as Map<*, *>).toString()
|
||||
)
|
||||
RetrofitManager.getInstance().api.postDownload(body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(Response())
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,7 +7,6 @@ import android.view.View
|
||||
import android.widget.TextView
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.utils.dip2px
|
||||
import com.gh.gamecenter.energy.EnergyBridge
|
||||
import com.lightgame.utils.Util_System_Keyboard
|
||||
import com.lzf.easyfloat.EasyFloat
|
||||
import com.lzf.easyfloat.enums.ShowPattern
|
||||
@ -22,7 +21,6 @@ import com.lzf.easyfloat.enums.SidePattern
|
||||
object FloatingBackViewManager {
|
||||
|
||||
const val TYPE_ACTIVITY = "type_activity"
|
||||
const val TYPE_TASK = "type_task"
|
||||
|
||||
private const val FLOATING_BACK_VIEW = "floating_back_view"
|
||||
|
||||
@ -56,10 +54,6 @@ object FloatingBackViewManager {
|
||||
titleView?.text = "返回活动"
|
||||
|
||||
DirectUtils.directToWebView(activity, mActivityUrl, ("返回活动浮窗"))
|
||||
} else if (mType == TYPE_TASK) {
|
||||
titleView?.text = "返回任务"
|
||||
|
||||
activity.startActivity(EnergyBridge.getEnergyCenterIntent(activity))
|
||||
}
|
||||
|
||||
disableBackView()
|
||||
@ -111,11 +105,4 @@ object FloatingBackViewManager {
|
||||
mActivityUrl = ""
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回小浮窗类型是否为活动
|
||||
*/
|
||||
fun isTypeActivity(): Boolean {
|
||||
return mType == TYPE_ACTIVITY
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,7 +31,6 @@ import com.gh.gamecenter.core.utils.EmptyCallback
|
||||
import com.gh.gamecenter.core.utils.MtaHelper
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.core.utils.ToastUtils
|
||||
import com.gh.gamecenter.energy.EnergyBridge
|
||||
import com.gh.gamecenter.feature.entity.ApkEntity
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.entity.PluginLocation
|
||||
@ -222,7 +221,7 @@ object GameActivityDownloadHelper {
|
||||
) {
|
||||
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
|
||||
CertificationDialog.showCertificationDialog(context, gameEntity) {
|
||||
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
|
||||
DialogUtils.checkDownload(context, apk.size, gameEntity.id, gameEntity.name) { isSubscribe: Boolean ->
|
||||
download(context, gameEntity, apk, isSubscribe, entrance, location, traceEvent)
|
||||
}
|
||||
}
|
||||
@ -242,7 +241,12 @@ object GameActivityDownloadHelper {
|
||||
VHelper.validateVSpaceBeforeAction(context, gameEntity) {
|
||||
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
|
||||
CertificationDialog.showCertificationDialog(context, gameEntity) {
|
||||
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
|
||||
DialogUtils.checkDownload(
|
||||
context,
|
||||
apk.size,
|
||||
gameEntity.id,
|
||||
gameEntity.name
|
||||
) { isSubscribe: Boolean ->
|
||||
download(context, gameEntity, apk, isSubscribe, entrance, location, traceEvent)
|
||||
}
|
||||
}
|
||||
@ -263,7 +267,7 @@ object GameActivityDownloadHelper {
|
||||
DownloadDialog.showDownloadDialog(context, gameEntity, traceEvent, entrance, location)
|
||||
} else {
|
||||
CertificationDialog.showCertificationDialog(context, gameEntity) {
|
||||
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
|
||||
DialogUtils.checkDownload(context, apk.size, gameEntity.id, gameEntity.name) { isSubscribe: Boolean ->
|
||||
plugin(context, gameEntity, apk, entrance, location, isSubscribe, traceEvent)
|
||||
}
|
||||
}
|
||||
@ -299,7 +303,7 @@ object GameActivityDownloadHelper {
|
||||
}
|
||||
|
||||
if (gameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity)
|
||||
} else {
|
||||
downloadEntity?.run {
|
||||
install(context, gameEntity, apk, this)
|
||||
@ -316,7 +320,6 @@ object GameActivityDownloadHelper {
|
||||
location: String,
|
||||
traceEvent: ExposureEvent
|
||||
) {
|
||||
EnergyBridge.postEnergyTask("play_game", gameEntity.id, gameEntity.getApk()[0].packageName)
|
||||
//启动模拟器游戏
|
||||
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
|
||||
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(context)) {
|
||||
@ -338,7 +341,7 @@ object GameActivityDownloadHelper {
|
||||
}
|
||||
|
||||
if (gameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
|
||||
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity)
|
||||
return
|
||||
}
|
||||
|
||||
@ -357,7 +360,7 @@ object GameActivityDownloadHelper {
|
||||
location: String,
|
||||
traceEvent: ExposureEvent
|
||||
) {
|
||||
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
|
||||
DialogUtils.checkDownload(context, apk.size, gameEntity.id, gameEntity.name) { isSubscribe: Boolean ->
|
||||
update(context, gameEntity, apk, entrance, location, isSubscribe, traceEvent)
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ public class GameUtils {
|
||||
|
||||
// 在下载管理找不到下载实体,并且为畅玩游戏的时候到畅玩数据库里找
|
||||
if (downloadEntity == null && gameEntity.isVGame()) {
|
||||
downloadEntity = VHelper.getDownloadEntitySnapshot(gameEntity.getId(), apkEntity.getPackageName());
|
||||
downloadEntity = VHelper.getVDownloadEntitySnapshot(gameEntity.getId(), apkEntity.getPackageName());
|
||||
}
|
||||
|
||||
if (downloadEntity != null) {
|
||||
|
||||
@ -33,94 +33,6 @@ object IntegralLogHelper {
|
||||
log(json, "score", false)
|
||||
}
|
||||
|
||||
fun logTask(event: String, location: String, jobId: String, jobName: String, jobType: String) {
|
||||
val json = JSONObject().apply {
|
||||
tryWithDefaultCatch {
|
||||
put("meta", LogUtils.getMetaObject())
|
||||
put("event", event)
|
||||
put("location", location)
|
||||
put("timestamp", System.currentTimeMillis() / 1000)
|
||||
put("launch_id", launchId)
|
||||
put("session_id", sessionId)
|
||||
put("job_id", jobId)
|
||||
put("job_name", jobName)
|
||||
put("job_type", jobType)
|
||||
}
|
||||
}
|
||||
|
||||
debugOnly {
|
||||
Utils.log("LogUtils->$json")
|
||||
}
|
||||
log(json, "score", false)
|
||||
}
|
||||
|
||||
fun logCommodityCategory(
|
||||
event: String,
|
||||
location: String,
|
||||
entrance: String,
|
||||
categoryId: String,
|
||||
categoryName: String
|
||||
) {
|
||||
val json = JSONObject().apply {
|
||||
tryWithDefaultCatch {
|
||||
put("meta", LogUtils.getMetaObject())
|
||||
put("event", event)
|
||||
put("location", location)
|
||||
put("timestamp", System.currentTimeMillis() / 1000)
|
||||
put("launch_id", launchId)
|
||||
put("session_id", sessionId)
|
||||
put("entrance", entrance)
|
||||
put("goods_species_id", categoryId)
|
||||
put("goods_species_name", categoryName)
|
||||
}
|
||||
}
|
||||
|
||||
debugOnly {
|
||||
Utils.log("LogUtils->$json")
|
||||
}
|
||||
log(json, "score", false)
|
||||
}
|
||||
|
||||
fun logCommodity(event: String, location: String, commodityId: String, categoryId: String, categoryName: String) {
|
||||
val json = JSONObject().apply {
|
||||
tryWithDefaultCatch {
|
||||
put("meta", LogUtils.getMetaObject())
|
||||
put("event", event)
|
||||
put("location", location)
|
||||
put("timestamp", System.currentTimeMillis() / 1000)
|
||||
put("launch_id", launchId)
|
||||
put("session_id", sessionId)
|
||||
put("goods_id", commodityId)
|
||||
put("goods_species_id", categoryId)
|
||||
put("goods_species_name", categoryName)
|
||||
}
|
||||
}
|
||||
|
||||
debugOnly {
|
||||
Utils.log("LogUtils->$json")
|
||||
}
|
||||
log(json, "score", false)
|
||||
}
|
||||
|
||||
fun logEnergyRange(event: String, location: String, range: String) {
|
||||
val json = JSONObject().apply {
|
||||
tryWithDefaultCatch {
|
||||
put("meta", LogUtils.getMetaObject())
|
||||
put("event", event)
|
||||
put("location", location)
|
||||
put("timestamp", System.currentTimeMillis() / 1000)
|
||||
put("launch_id", launchId)
|
||||
put("session_id", sessionId)
|
||||
put("energy_range", range)
|
||||
}
|
||||
}
|
||||
|
||||
debugOnly {
|
||||
Utils.log("LogUtils->$json")
|
||||
}
|
||||
log(json, "score", false)
|
||||
}
|
||||
|
||||
fun logPendent(event: String, location: String, pendentId: String, pendentType: String? = null) {
|
||||
val json = JSONObject().apply {
|
||||
tryWithDefaultCatch {
|
||||
|
||||
@ -415,13 +415,19 @@ public class LogUtils {
|
||||
LoghubUtils.log(object, "video_streaming", false);
|
||||
}
|
||||
|
||||
public static void uploadWelcomeDialog(String action, String dialogId, String linkTitle) {
|
||||
public static void uploadWelcomeDialog(String action,
|
||||
String dialogId,
|
||||
String linkId,
|
||||
String linkType,
|
||||
String linkTitle) {
|
||||
ExposureEntity payload = new ExposureEntity();
|
||||
payload.setWelcomeDialogId(dialogId);
|
||||
payload.setWelcomeDialogLinkTitle(linkTitle);
|
||||
|
||||
SimpleLogContainerEntity entity = new SimpleLogContainerEntity();
|
||||
entity.setEvent("dialog");
|
||||
entity.setLinkId(linkId);
|
||||
entity.setLinkType(linkType);
|
||||
entity.setAction(action);
|
||||
entity.setMeta(MetaUtil.INSTANCE.getMeta());
|
||||
entity.setPayload(payload);
|
||||
@ -562,16 +568,19 @@ public class LogUtils {
|
||||
}
|
||||
|
||||
public static void uploadSearchGame(String event, String location, String key, String searchType) {
|
||||
uploadSearchClick(event, location, key, searchType, "", "", false, false);
|
||||
uploadSearchClick(event, location, key, searchType, "", "", 0, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mirrorDataPosition 镜像的归类,不是镜像是为 -1 ,使用镜像 1 时为 1,使用镜像 2 时为 2
|
||||
*/
|
||||
public static void uploadSearchClick(String event,
|
||||
String location,
|
||||
String key,
|
||||
String searchType,
|
||||
String gameId,
|
||||
String gameName,
|
||||
Boolean isMirrorData,
|
||||
int mirrorDataPosition,
|
||||
Boolean isAdData) {
|
||||
JSONObject object = new JSONObject();
|
||||
JSONObject payload = new JSONObject();
|
||||
@ -585,7 +594,13 @@ public class LogUtils {
|
||||
payload.put("search_type", searchType); //搜索类型, 有四种取值 默认搜索/历史搜索/自动搜索/主动搜索
|
||||
payload.put(KEY_GAME_ID, gameId); //event为search_click才取值
|
||||
payload.put(KEY_GAME_NAME, gameName); //event为search_click才取值
|
||||
payload.put("is_mirror_data", isMirrorData);
|
||||
|
||||
// 是否使用镜像
|
||||
if (mirrorDataPosition == 1) {
|
||||
payload.put("is_mirror_data", true);
|
||||
} else if (mirrorDataPosition == 2) {
|
||||
payload.put("is_mirror2_data", true);
|
||||
}
|
||||
payload.put("is_ad_data", isAdData);
|
||||
object.put(KEY_PAY_LOAD, payload);
|
||||
} catch (JSONException e) {
|
||||
|
||||
@ -5,6 +5,7 @@ import com.gh.gamecenter.common.json.JsonObjectBuilder
|
||||
import com.gh.gamecenter.common.json.json
|
||||
import com.gh.gamecenter.common.loghub.LoghubUtils
|
||||
import com.gh.gamecenter.common.utils.LogUtils
|
||||
import com.gh.gamecenter.entity.HomeSubSlide
|
||||
import com.lightgame.utils.Utils
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
@ -21,6 +22,10 @@ object NewFlatLogUtils {
|
||||
private const val KEY_GAME_NAME = "game_name"
|
||||
private const val KEY_TEXT = "text"
|
||||
private const val KEY_BUTTON_TYPE = "button_type"
|
||||
private const val KEY_BBS_ID = "bbs_id"
|
||||
|
||||
private const val EVENT_LOGIN_FROM_GHZS_SHOW = "halo_fun_login_from_ghzs_show"
|
||||
private const val EVENT_LOGIN_FROM_GHZS_CLICK = "halo_fun_login_from_ghzs_click"
|
||||
|
||||
private fun log(jsonObject: JSONObject, logStore: String = "event", uploadImmediately: Boolean = false) {
|
||||
Utils.log("NewFlatLogUtils", jsonObject.toString(4))
|
||||
@ -48,6 +53,66 @@ object NewFlatLogUtils {
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手下载弹窗展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunDownloadDialogShow(gameId: String, gameName: String, gameArchitecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_download_dialog_show"
|
||||
"game_id" to gameId
|
||||
"game_name" to gameName
|
||||
"game_architecture" to gameArchitecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手下载点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunDownloadDialogDownloadClick(architecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_download_dialog_download_click"
|
||||
"architecture" to architecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手安装提示弹窗展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunInstallTipDialogShow(architecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_install_tip_dialog_show"
|
||||
"architecture" to architecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手更新弹窗展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunUpdateDialogShow(gameId: String, gameName: String, gameArchitecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_update_dialog_show"
|
||||
"game_id" to gameId
|
||||
"game_name" to gameName
|
||||
"game_architecture" to gameArchitecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手(32位)弹窗事件
|
||||
@JvmStatic
|
||||
fun logHaloFun32DialogEvent(event: String, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to event
|
||||
"game_id" to gameId
|
||||
"game_name" to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 关联游戏跳转icon点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunGameDetailJumpClick(downloadStatus: String, gameId: String) {
|
||||
@ -74,11 +139,12 @@ object NewFlatLogUtils {
|
||||
|
||||
// 畅玩助手更新弹窗点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunUpdateDialogClick(dialogType: String, buttonType: String) {
|
||||
fun logHaloFunUpdateDialogClick(dialogType: String, buttonType: String, architecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_update_dialog_click"
|
||||
"dialog_type" to dialogType
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
"architecture" to architecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
@ -131,6 +197,105 @@ object NewFlatLogUtils {
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩游戏管理-长按弹出更多菜单dialog事件
|
||||
@JvmStatic
|
||||
fun logHaloFunGameMoreDialogShow(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_more_dialog_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
|
||||
// 畅玩游戏管理-添加桌面图标权限提示弹框展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunShortcutPermissionDialogShow(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_shutcup_icon_dialog_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
|
||||
// 畅玩游戏管理-添加桌面图标权限提示弹框按钮点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunShortcutPermissionDialogButtonClick(
|
||||
gameId: String,
|
||||
gameName: String,
|
||||
buttonType: String,
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_shutcup_icon_dialog_click"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩游戏管理-清除游戏数据弹框展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunCleanDataDialogShow(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_func_clean_data_dialog_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩游戏管理-添加桌面图标权限提示弹框按钮点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunCleanDataDialogButtonClick(
|
||||
gameId: String,
|
||||
gameName: String,
|
||||
buttonType: String,
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_func_clean_data_dialog_click"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 从畅玩游戏中唤起快捷图标创建弹窗(弹窗B)展示时上报
|
||||
@JvmStatic
|
||||
fun logCwFunShortcutPermissionDialogShow(gameId: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_shotcup_icon_dialog_b_show"
|
||||
KEY_GAME_ID to gameId
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
|
||||
// 用户点击快捷图标创建弹窗(弹窗B)中按钮时触发
|
||||
@JvmStatic
|
||||
fun logCwFunShortcutPermissionDialogButtonClick(
|
||||
gameId: String,
|
||||
buttonType: String,
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_shotcup_icon_dialog_b_click"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 搜索-点击热门标签
|
||||
@JvmStatic
|
||||
fun logSearchHotTagClick(
|
||||
@ -377,6 +542,27 @@ object NewFlatLogUtils {
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 搜索-点击搜索榜单内容
|
||||
@JvmStatic
|
||||
fun logSearchClickRankDetail(
|
||||
rankName: String,
|
||||
rankSequence: String,
|
||||
linkId: String,
|
||||
linkType: String,
|
||||
linkTitle: String
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "search_click_rank_detail"
|
||||
"rank_name" to rankName
|
||||
"rank_sequence" to rankSequence
|
||||
"link_id" to linkId
|
||||
"link_type" to linkType
|
||||
"link_title" to linkTitle
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
//点击社区-搜索页返回按钮
|
||||
@JvmStatic
|
||||
fun logClickSearchReturn(searchKey: String) {
|
||||
@ -922,19 +1108,25 @@ object NewFlatLogUtils {
|
||||
}
|
||||
|
||||
// 存档分享弹窗展示事件
|
||||
fun logCloudArchiveShareDialogShow() {
|
||||
fun logCloudArchiveShareDialogShow(gameId: String, gameName: String, cloudSaveId: String) {
|
||||
val json = json {
|
||||
"cloud_save_id" to cloudSaveId
|
||||
KEY_EVENT to "cloud_save_share_dialog_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 存档分享弹窗点击事件
|
||||
fun logCloudArchiveShareDialogClick(buttonType: String) {
|
||||
fun logCloudArchiveShareDialogClick(buttonType: String, gameId: String, gameName: String, cloudSaveId: String) {
|
||||
val json = json {
|
||||
"cloud_save_id" to cloudSaveId
|
||||
KEY_EVENT to "cloud_save_share_dialog_click"
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
@ -970,19 +1162,23 @@ object NewFlatLogUtils {
|
||||
}
|
||||
|
||||
// 上传存档弹窗展示事件
|
||||
fun logCloudArchiveUploadDialogShow() {
|
||||
fun logCloudArchiveUploadDialogShow(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "cloud_save_upload_dialog_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 上传存档弹窗点击事件
|
||||
fun logCloudArchiveUploadDialogClick(buttonType: String) {
|
||||
fun logCloudArchiveUploadDialogClick(buttonType: String, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "cloud_save_upload_dialog_click"
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
@ -1061,11 +1257,22 @@ object NewFlatLogUtils {
|
||||
}
|
||||
|
||||
// 云存档下载/使用事件
|
||||
fun logCloudArchiveDownloadOrApply(archiveName: String, entrance: String) {
|
||||
fun logCloudArchiveDownloadOrApply(
|
||||
archiveName: String,
|
||||
entrance: String,
|
||||
gameId: String,
|
||||
gameName: String,
|
||||
cloudSaveId: String,
|
||||
isDownload: Boolean,
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "cloud_save_download"
|
||||
"cloud_save_name" to archiveName
|
||||
"cloud_save_id" to cloudSaveId
|
||||
"is_download" to isDownload
|
||||
KEY_ENTRANCE to entrance
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
@ -1500,7 +1707,7 @@ object NewFlatLogUtils {
|
||||
type: String,
|
||||
time: Long,
|
||||
sequence: Int,
|
||||
){
|
||||
) {
|
||||
val json = json {
|
||||
"event" to "game_test_home_timeline_click"
|
||||
"action" to action //类型包括: 1.自动定位:滑动游戏时间轴自动更换定位 2.手动点击:手动点击时间轴的定位
|
||||
@ -1523,7 +1730,7 @@ object NewFlatLogUtils {
|
||||
type: String = "",
|
||||
startTime: Long = 0,
|
||||
sequence: Int = 0,
|
||||
){
|
||||
) {
|
||||
val json = json {
|
||||
"event" to "game_test_home_view"
|
||||
"location" to location //新游开测所处位置,包括:首页、版块
|
||||
@ -1533,7 +1740,7 @@ object NewFlatLogUtils {
|
||||
"type" to type //触发事件时所停留的时间定位;类型包括“推荐/全部”,时间轴定位在“推荐”时记“推荐”,其余位置则记“全部”
|
||||
"game_test_start" to startTime //触发事件时所停留的时间定位;时间类型为“全部”时,记录具体的月份日期 ;例如:12.30、12.31
|
||||
"sequence" to sequence //点击推荐标签在所有标签中所处位置,从左往右依次计算
|
||||
parseAndPutMeta().invoke(this)
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
@ -1581,6 +1788,56 @@ object NewFlatLogUtils {
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 出现 XAPK 安装权限引导弹窗
|
||||
fun logXApkInstallPermissionDialogShowed(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "xapk_install_permission_dialog_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 点击引导设置“安装权限”弹窗 时上报
|
||||
fun logXApkInstallPermissionDialogClick(button: String, isOn: Boolean, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "xapk_install_permission_dialog_click"
|
||||
"button" to button
|
||||
"is_on" to isOn
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 出现xapk解压失败弹窗时上报
|
||||
fun logXApkUnzipFailedDialogShowed(trigger: String, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "xapk_decompression_failed_dialog_show"
|
||||
"trigger" to trigger
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 点击解压失败弹窗 时上报
|
||||
fun logXApkUnzipFailedDialogClick(button: String, isOn: Boolean, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "xapk_decompression_failed_dialog_click"
|
||||
"button" to button
|
||||
"is_on" to isOn
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// vpn 弹窗显示
|
||||
fun logVpnHintDialogShow(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "vpn_pre_access_dialog_show"
|
||||
@ -1591,6 +1848,7 @@ object NewFlatLogUtils {
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// vpn 弹窗点击
|
||||
fun logVpnHintDialogClick(gameId: String, gameName: String, button: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "vpn_pre_access_dialog_click"
|
||||
@ -1602,4 +1860,329 @@ object NewFlatLogUtils {
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 谷歌框架弹窗显示
|
||||
fun logGAppsDialogShowed(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "google_services_hint_pop_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 谷歌框架弹窗点击
|
||||
fun logGAppsDialogClicked(gameId: String, gameName: String, buttonType: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "google_services_hint_pop_click"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 谷歌框架安装成功
|
||||
fun logGAppsInstallSuccess(gameId: String, gameName: String, interval: Int) {
|
||||
val json = json {
|
||||
KEY_EVENT to "google_services_install_success"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
"interval" to interval
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 谷歌框架安装失败
|
||||
fun logGAppsInstallFailed(gameId: String, gameName: String, interval: Int) {
|
||||
val json = json {
|
||||
KEY_EVENT to "google_services_install_fail"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
"interval" to interval
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 谷歌框架安装成功并点击启动游戏
|
||||
fun logGAppsInstalledAndLaunchGame(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "google_services_install_game_launch"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 点击子版块
|
||||
fun logClickSection(sectionId: String, bbsId: String, sequence: Int) {
|
||||
val json = json {
|
||||
KEY_EVENT to "click_section"
|
||||
"section_id" to sectionId
|
||||
KEY_BBS_ID to bbsId
|
||||
"sequence" to sequence
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 点击更多板块按钮
|
||||
fun logClickMoreSection() {
|
||||
val json = json {
|
||||
KEY_EVENT to "click_more_section"
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 左右滑动子版块
|
||||
fun logSlideSection() {
|
||||
val json = json {
|
||||
KEY_EVENT to "slide_section"
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 点击论坛详情页—专区tab
|
||||
fun logClickBBSDetailGameZoneTab(bbsId: String, entrance: String, url: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "click_bbs_detail_game_zone_tab"
|
||||
KEY_BBS_ID to bbsId
|
||||
KEY_ENTRANCE to entrance
|
||||
"url" to url
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 点击论坛详情页—游戏详情
|
||||
fun logClickBBSDetailGameDetail() {
|
||||
val json = json {
|
||||
KEY_EVENT to "click_bbs_detail_game_detail"
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 首页下拉刷新
|
||||
fun logHomePagePullRefresh(countNum: Int) {
|
||||
val json = json {
|
||||
KEY_EVENT to "home_page_pull_refresh"
|
||||
"count_num" to countNum
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 右侧卡片点击事件
|
||||
fun logRightSideCardClick(homeSubSlide: HomeSubSlide, countNum: Int, location: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "right_side_card_click"
|
||||
"title" to homeSubSlide.title
|
||||
"card_id" to homeSubSlide.cardId
|
||||
"type" to homeSubSlide.cardType
|
||||
"text" to homeSubSlide.cardText
|
||||
"count_num" to countNum
|
||||
"location" to location
|
||||
"link_type" to homeSubSlide.linkType
|
||||
"link_id" to homeSubSlide.linkId
|
||||
"link_text" to homeSubSlide.linkText
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 游戏详情浏览大事件
|
||||
@JvmStatic
|
||||
fun logGameDetailMajorEventDetailClick(
|
||||
gameId: String,
|
||||
gameName: String,
|
||||
linkId: String = "",
|
||||
linkType: String = "",
|
||||
linkTitle: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "game_detail_major_event_detail_click"
|
||||
KEY_GAME_NAME to gameName
|
||||
KEY_GAME_ID to gameId
|
||||
"link_id" to linkId
|
||||
"link_type" to linkType
|
||||
"link_title" to linkTitle
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 我的光环点击 banner
|
||||
@JvmStatic
|
||||
fun logHaloPersonalActivityBannerClick(
|
||||
linkId: String = "",
|
||||
linkType: String = "",
|
||||
linkTitle: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_self_activity_banner_click"
|
||||
"link_id" to linkId
|
||||
"link_type" to linkType
|
||||
"link_title" to linkTitle
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 视频流点击广告
|
||||
@JvmStatic
|
||||
fun logVideoAdsClick(
|
||||
linkId: String = "",
|
||||
linkType: String = "",
|
||||
linkTitle: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "video_ads_click"
|
||||
"link_id" to linkId
|
||||
"link_type" to linkType
|
||||
"link_title" to linkTitle
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "video_streaming")
|
||||
}
|
||||
|
||||
// 社区-搜索榜单-内容点击
|
||||
@JvmStatic
|
||||
fun logCommunitySearchClickRankDetail(
|
||||
rankName: String,
|
||||
linkId: String = "",
|
||||
linkType: String = "",
|
||||
linkTitle: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "click_search_rank_detail"
|
||||
"rank_name" to rankName
|
||||
"link_id" to linkId
|
||||
"link_type" to linkType
|
||||
"link_title" to linkTitle
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "bbs_community")
|
||||
}
|
||||
|
||||
// 首页下拉推送触发
|
||||
@JvmStatic
|
||||
fun logHomePushTrigger(pushId: String, count: Int, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "home_push_trigger"
|
||||
"home_push_id" to pushId
|
||||
"count_num" to count
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 首页下拉推送显示
|
||||
@JvmStatic
|
||||
fun logHomePushShow(pushId: String, action: String, count: Int, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "home_push_show"
|
||||
"home_push_id" to pushId
|
||||
"action" to action
|
||||
"count_num" to count
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 首页下拉推送消失
|
||||
@JvmStatic
|
||||
fun logHomePushClose(pushId: String, action: String, count: Int, gameId: String, gameName: String, interval: Int) {
|
||||
val json = json {
|
||||
KEY_EVENT to "home_push_close"
|
||||
"home_push_id" to pushId
|
||||
"action" to action
|
||||
"count_num" to count
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
"interval" to interval
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
/**
|
||||
* 埋点序号:24
|
||||
* 事件ID:halo_fun_login_from_ghzs_show
|
||||
* 事件名称:光环助手登录授权界面
|
||||
* 触发时机:畅玩助手点击授权登录跳转光环助手展示对应界面时
|
||||
* @param gameId 畅玩助手当前运行的游戏ID
|
||||
* @param gameName 畅玩助手当前运行的游戏名称
|
||||
*/
|
||||
fun logLoginFromGHZSShow(
|
||||
gameId: String,
|
||||
gameName: String
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to EVENT_LOGIN_FROM_GHZS_SHOW
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
/**
|
||||
* 埋点序号:25
|
||||
* 事件ID:halo_fun_login_from_ghzs_click
|
||||
* 事件名称:光环助手登录授权界面点击事件
|
||||
* 触发时机:点击相关按钮时
|
||||
* @param gameId 畅玩助手当前运行的游戏ID
|
||||
* @param gameName 畅玩助手当前运行的游戏名称
|
||||
* @param buttonType 按钮:确定\返回
|
||||
*/
|
||||
fun logLoginFromGHZSClick(
|
||||
gameId: String,
|
||||
gameName: String,
|
||||
buttonType: String
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to EVENT_LOGIN_FROM_GHZS_CLICK
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 下载流量提示弹窗展示事件
|
||||
@JvmStatic
|
||||
fun logDownloadMobileDataDialogShow(gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "download_mobile_data_dialog_show"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
|
||||
// 下载流量提示弹窗点击事件
|
||||
@JvmStatic
|
||||
fun logDownloadMobileDataDialogClick(gameId: String, gameName: String, button: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "download_mobile_data_dialog_click"
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
"button" to button
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json, "event", false)
|
||||
}
|
||||
}
|
||||
@ -1344,8 +1344,9 @@ object NewLogUtils {
|
||||
gameName: String,
|
||||
tagId: String,
|
||||
tagName: String,
|
||||
linkType: String,
|
||||
linkTitle: String
|
||||
linkId: String = "",
|
||||
linkType: String = "",
|
||||
linkTitle: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_EVENT to "search_click_tag"
|
||||
@ -1355,6 +1356,7 @@ object NewLogUtils {
|
||||
KEY_GAME_NAME to gameName
|
||||
"tag_id" to tagId
|
||||
"tag" to tagName
|
||||
"link_id" to linkId
|
||||
"link_type" to linkType
|
||||
"link_title" to linkTitle
|
||||
KEY_META to LogUtils.getMetaObject()
|
||||
|
||||
@ -38,6 +38,7 @@ import com.gh.gamecenter.manager.PackagesManager;
|
||||
import com.gh.vspace.VHelper;
|
||||
import com.gh.vspace.db.VGameEntity;
|
||||
import com.halo.assistant.HaloApp;
|
||||
import com.lg.vspace.VirtualAppManager;
|
||||
import com.lightgame.utils.Utils;
|
||||
|
||||
import net.dongliu.apk.parser.ApkFile;
|
||||
@ -554,9 +555,32 @@ public class PackageUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据包名,判断是否已安装该游戏
|
||||
* 不区分是否有桌面图标
|
||||
*/
|
||||
public static boolean isInstalledFromAllPackage(Context context, String packageName) {
|
||||
ArrayList<String> allPackageName = getAllPackageName(context);
|
||||
return allPackageName.contains(packageName);
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
context.getPackageManager().getPackageInfo(
|
||||
packageName,
|
||||
PackageManager.PackageInfoFlags.of(0)
|
||||
);
|
||||
} else {
|
||||
context.getPackageManager().getPackageInfo(packageName, 0);
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
ArrayList<String> allPackageName = getAllPackageName(context);
|
||||
boolean isInstalled = allPackageName.contains(packageName);
|
||||
|
||||
if (isInstalled) {
|
||||
// 能进这里说明上面的 try {} 结果有问题,记录一下
|
||||
SentryHelper.INSTANCE.onEvent("CHECK_INSTALLED_CONFLICT", "packageName", packageName);
|
||||
}
|
||||
|
||||
return isInstalled;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -16,6 +16,9 @@ object RealNameHelper {
|
||||
|
||||
var pendingInstallPkgPath = ""
|
||||
|
||||
// 0表示未实名,1表示未成年,2表示成年
|
||||
private var mCertificationStatus: Int = 0
|
||||
|
||||
/**
|
||||
* 弹未成年人不能下载游戏弹窗
|
||||
*/
|
||||
@ -124,7 +127,21 @@ object RealNameHelper {
|
||||
DownloadManager.getInstance()
|
||||
.addInvisiblePendingTask(downloadEntity)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实名状态 0表示未实名,1表示未成年,2表示成年
|
||||
*/
|
||||
fun getCertificationStatus(): Int {
|
||||
return mCertificationStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新实名状态 0表示未实名,1表示未成年,2表示成年
|
||||
*/
|
||||
@JvmStatic
|
||||
fun updateCertificationStatus(newCertificationStatus: Int) {
|
||||
mCertificationStatus = newCertificationStatus
|
||||
}
|
||||
|
||||
}
|
||||
29
app/src/main/java/com/gh/common/util/SensorsLogUtils.kt
Normal file
29
app/src/main/java/com/gh/common/util/SensorsLogUtils.kt
Normal file
@ -0,0 +1,29 @@
|
||||
package com.gh.common.util
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge
|
||||
|
||||
object SensorsLogUtils {
|
||||
private const val KEY_EVENT_NAME = "event_name"
|
||||
private val mLogHandler = LogHandler()
|
||||
|
||||
fun trackEventDelay(key: Int, eventName: String, delay: Long) {
|
||||
mLogHandler.sendMessageDelayed(Message().apply {
|
||||
what = key
|
||||
data.putString(KEY_EVENT_NAME, eventName)
|
||||
}, delay)
|
||||
}
|
||||
|
||||
fun removeTrackEvent(key: Int) {
|
||||
mLogHandler.removeMessages(key)
|
||||
}
|
||||
|
||||
class LogHandler : Handler(Looper.getMainLooper()) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
SensorsBridge.trackEvent(msg.data.getString(KEY_EVENT_NAME) ?: "")
|
||||
}
|
||||
}
|
||||
}
|
||||
135
app/src/main/java/com/gh/common/util/TextViewExt.kt
Normal file
135
app/src/main/java/com/gh/common/util/TextViewExt.kt
Normal file
@ -0,0 +1,135 @@
|
||||
package com.gh.common.util
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.Spannable
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.Spanned
|
||||
import android.text.TextPaint
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.text.style.ClickableSpan
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.text.style.UnderlineSpan
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.content.ContextCompat
|
||||
|
||||
/**
|
||||
* @author : liujiarui
|
||||
* date : 2023/3/22
|
||||
* description : 文本颜色事件控制
|
||||
*/
|
||||
//作用域进行限制
|
||||
@DslMarker
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class TextSpanDsl
|
||||
|
||||
interface DslSpannableStringBuilder {
|
||||
//增加一段文字
|
||||
fun addText(text: String, method: (@TextSpanDsl DslSpanBuilder.() -> Unit)? = null)
|
||||
fun addText(@StringRes stringRes: Int, method: (@TextSpanDsl DslSpanBuilder.() -> Unit)? = null)
|
||||
}
|
||||
|
||||
interface DslSpanBuilder {
|
||||
//设置文字颜色文本
|
||||
fun setColor(color: String)
|
||||
|
||||
//设置文字颜色int
|
||||
fun setColor(color: ColorInt)
|
||||
|
||||
//设置文字颜色id
|
||||
fun setColor(color: ColorResId)
|
||||
|
||||
//设置点击事件
|
||||
fun onClick(useUnderLine: Boolean = false, onClick: (View) -> Unit)
|
||||
}
|
||||
|
||||
//为 TextView 创建扩展函数,其参数为接口的扩展函数
|
||||
fun TextView.buildSpannableString(init: @TextSpanDsl DslSpannableStringBuilder.() -> Unit) {
|
||||
//具体实现类
|
||||
val spanStringBuilderImpl = DslSpannableStringBuilderImpl(context)
|
||||
spanStringBuilderImpl.init()
|
||||
movementMethod = LinkMovementMethod.getInstance()
|
||||
//通过实现类返回SpannableStringBuilder
|
||||
text = spanStringBuilderImpl.build()
|
||||
}
|
||||
|
||||
class DslSpannableStringBuilderImpl(val context: Context) : DslSpannableStringBuilder {
|
||||
private val builder = SpannableStringBuilder()
|
||||
|
||||
//记录上次添加文字后最后的索引值
|
||||
private var lastIndex: Int = 0
|
||||
var isClickable = false
|
||||
|
||||
override fun addText(text: String, method: (@TextSpanDsl DslSpanBuilder.() -> Unit)?) {
|
||||
val start = lastIndex
|
||||
builder.append(text)
|
||||
lastIndex += text.length
|
||||
val spanBuilder = DslSpanBuilderImpl(context)
|
||||
method?.let { spanBuilder.it() }
|
||||
spanBuilder.apply {
|
||||
onClickSpan?.let {
|
||||
builder.setSpan(it, start, lastIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
isClickable = true
|
||||
}
|
||||
if (!useUnderLine) {
|
||||
val noUnderlineSpan = NoUnderlineSpan()
|
||||
builder.setSpan(noUnderlineSpan, start, lastIndex, Spanned.SPAN_MARK_MARK)
|
||||
}
|
||||
foregroundColorSpan?.let {
|
||||
builder.setSpan(it, start, lastIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun addText(stringRes: Int, method: (@TextSpanDsl DslSpanBuilder.() -> Unit)?) {
|
||||
val text = context.getString(stringRes)
|
||||
addText(text, method)
|
||||
}
|
||||
|
||||
fun build(): SpannableStringBuilder {
|
||||
return builder
|
||||
}
|
||||
}
|
||||
|
||||
class DslSpanBuilderImpl(val context: Context) : DslSpanBuilder {
|
||||
var foregroundColorSpan: ForegroundColorSpan? = null
|
||||
var onClickSpan: ClickableSpan? = null
|
||||
var useUnderLine = true
|
||||
|
||||
override fun setColor(color: String) {
|
||||
foregroundColorSpan = ForegroundColorSpan(Color.parseColor(color))
|
||||
}
|
||||
|
||||
override fun setColor(color: ColorInt) {
|
||||
foregroundColorSpan = ForegroundColorSpan(color.color)
|
||||
}
|
||||
|
||||
override fun setColor(color: ColorResId) {
|
||||
val c = ContextCompat.getColor(context, color.colorResId)
|
||||
foregroundColorSpan = ForegroundColorSpan(c)
|
||||
}
|
||||
|
||||
override fun onClick(useUnderLine: Boolean, onClick: (View) -> Unit) {
|
||||
onClickSpan = object : ClickableSpan() {
|
||||
override fun onClick(widget: View) {
|
||||
onClick(widget)
|
||||
}
|
||||
}
|
||||
this.useUnderLine = useUnderLine
|
||||
}
|
||||
}
|
||||
|
||||
@JvmInline
|
||||
value class ColorInt(val color: Int)
|
||||
|
||||
@JvmInline
|
||||
value class ColorResId(val colorResId: Int)
|
||||
|
||||
class NoUnderlineSpan : UnderlineSpan() {
|
||||
override fun updateDrawState(ds: TextPaint) {
|
||||
ds.color = ds.linkColor
|
||||
ds.isUnderlineText = false
|
||||
}
|
||||
}
|
||||
131
app/src/main/java/com/gh/common/xapk/XapkDialogHelper.kt
Normal file
131
app/src/main/java/com/gh/common/xapk/XapkDialogHelper.kt
Normal file
@ -0,0 +1,131 @@
|
||||
package com.gh.common.xapk
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.gh.common.util.NewFlatLogUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.activityresult.ActResultRequest
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.common.entity.SuggestType
|
||||
import com.gh.gamecenter.common.utils.DialogHelper
|
||||
import com.gh.gamecenter.common.utils.PermissionHelper
|
||||
import com.gh.gamecenter.common.utils.dip2px
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.help.HelpAndFeedbackBridge
|
||||
import com.lightgame.download.DownloadEntity
|
||||
import com.lightgame.utils.Utils
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
object XapkDialogHelper {
|
||||
|
||||
private var mUnzipFailureDialogRef: WeakReference<Dialog>? = null
|
||||
|
||||
fun showUnzipFailureDialog(context: Context, downloadEntity: DownloadEntity, isManualAction: Boolean) {
|
||||
val trigger = if (isManualAction) "手动触发" else "自动触发"
|
||||
NewFlatLogUtils.logXApkUnzipFailedDialogShowed(trigger, downloadEntity.gameId, downloadEntity.name)
|
||||
|
||||
val previousShowedDialog = mUnzipFailureDialogRef?.get()
|
||||
|
||||
if (previousShowedDialog != null
|
||||
&& previousShowedDialog.isShowing
|
||||
&& context == previousShowedDialog.ownerActivity) {
|
||||
// 上一个解压失败弹窗还在显示,当前 activity 不用再显示新的弹窗了
|
||||
return
|
||||
}
|
||||
|
||||
val dialog = DialogHelper.showGuideDialog(
|
||||
context = context,
|
||||
title = "",
|
||||
content = "未授权允许未知来源安装、数据包格式、设备兼容性…等均可能导致解压失败。\n如果开启权限后仍未能解决,请提交反馈帮助我们改进。",
|
||||
confirmText = "开启权限",
|
||||
cancelText = "提交反馈",
|
||||
confirmClickCallback = {
|
||||
if (context is AppCompatActivity) {
|
||||
val intent = PermissionHelper.getToInstallPermissionSettingIntent(context)
|
||||
|
||||
NewFlatLogUtils.logXApkUnzipFailedDialogClick(
|
||||
"开启权限",
|
||||
false,
|
||||
downloadEntity.gameId,
|
||||
downloadEntity.name
|
||||
)
|
||||
|
||||
// 记录应用重启前需要重解压的信息
|
||||
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, context.javaClass.name)
|
||||
SPUtils.setString(Constants.SP_XAPK_URL, downloadEntity.url)
|
||||
|
||||
ActResultRequest(context).startForResult(intent) { resultCode, _ ->
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
NewFlatLogUtils.logXApkUnzipFailedDialogClick(
|
||||
"开启权限",
|
||||
true,
|
||||
downloadEntity.gameId,
|
||||
downloadEntity.name
|
||||
)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
val pm = context.packageManager
|
||||
val restartIntent = pm.getLaunchIntentForPackage(context.packageName)
|
||||
val mainIntent = Intent.makeRestartActivityTask(restartIntent!!.component)
|
||||
context.startActivity(mainIntent)
|
||||
Runtime.getRuntime().exit(0)
|
||||
} else {
|
||||
XapkInstaller.install(context, downloadEntity, true)
|
||||
}
|
||||
} else if (resultCode == Activity.RESULT_CANCELED) {
|
||||
Utils.log("授予未知应用安装权限失败")
|
||||
}
|
||||
}
|
||||
} else if (context is Activity) {
|
||||
PermissionHelper.toInstallPermissionSetting(context)
|
||||
}
|
||||
},
|
||||
cancelClickCallback = {
|
||||
val hint = "《" + downloadEntity.name + "》游戏安装包解压失败,问题反馈:"
|
||||
HelpAndFeedbackBridge.startSuggestionActivity(
|
||||
context,
|
||||
SuggestType.normal,
|
||||
null,
|
||||
hint,
|
||||
SimpleGameEntity(downloadEntity.gameId, downloadEntity.name, downloadEntity.icon)
|
||||
)
|
||||
NewFlatLogUtils.logXApkUnzipFailedDialogClick(
|
||||
"提交反馈",
|
||||
false,
|
||||
downloadEntity.gameId,
|
||||
downloadEntity.name
|
||||
)
|
||||
},
|
||||
uiModificationCallback = { binding, dialog ->
|
||||
binding.headIv.setBackgroundResource(R.drawable.dialog_unzip_failure_head_background)
|
||||
binding.titleTv.visibility = View.GONE
|
||||
// VectorDrawable 的动态颜色设置只在支持 Vector 的系统版本上生效,为了能方便复用资源不支持的就用默认颜色,又不是不能用!
|
||||
binding.closeIv.setColorFilter(Color.WHITE)
|
||||
binding.contentTv.setLineSpacing(5.0F.dip2px().toFloat(), 1.0F)
|
||||
binding.closeContainer.setOnClickListener {
|
||||
NewFlatLogUtils.logXApkUnzipFailedDialogClick(
|
||||
"关闭",
|
||||
false,
|
||||
downloadEntity.gameId,
|
||||
downloadEntity.name
|
||||
)
|
||||
dialog.dismiss()
|
||||
}
|
||||
},
|
||||
extraConfig = DialogHelper.Config(showCloseIcon = true)
|
||||
)
|
||||
|
||||
if (context is Activity) {
|
||||
dialog?.setOwnerActivity(context)
|
||||
}
|
||||
mUnzipFailureDialogRef = WeakReference(dialog)
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,8 +1,9 @@
|
||||
package com.gh.common.xapk
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import com.gh.common.util.DownloadNotificationHelper
|
||||
import com.gh.common.util.PackageInstaller
|
||||
import com.gh.common.util.*
|
||||
import com.gh.download.DownloadDataHelper
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.common.utils.debugOnly
|
||||
import com.gh.gamecenter.common.utils.getExtension
|
||||
@ -26,10 +27,10 @@ import java.util.*
|
||||
* obb文件直接解压至根目录即可,无需操作文件
|
||||
* apk文件这解压的gh-files文件夹中
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object XapkInstaller : IXapkUnzipListener {
|
||||
private const val XAPK_PACKAGE_PATH_TAG = "xapk_package_path"
|
||||
|
||||
// private const val XAPK_DATA_PATH_TAG = "xapk_data_path"
|
||||
const val XAPK_EXTENSION_NAME = "xapk"
|
||||
|
||||
// 通过解压过程存放于 DownloadEntity meta
|
||||
@ -63,6 +64,7 @@ object XapkInstaller : IXapkUnzipListener {
|
||||
|
||||
private fun unzipXapkFile(downloadEntity: DownloadEntity) {
|
||||
if (mXapkUnzipThreadMap[downloadEntity.path] == null) {
|
||||
DownloadDataHelper.uploadDownloadStatusEvent(downloadEntity, "xapk解压开始")
|
||||
val xapkUnzipThread = XapkUnzipThread(downloadEntity, this)
|
||||
xapkUnzipThread.start()
|
||||
mXapkUnzipThreadMap[downloadEntity.path] = xapkUnzipThread
|
||||
@ -136,6 +138,8 @@ object XapkInstaller : IXapkUnzipListener {
|
||||
)
|
||||
}
|
||||
|
||||
DownloadDataHelper.uploadDownloadStatusEvent(downloadEntity, "xapk解压失败")
|
||||
|
||||
debugOnly {
|
||||
Utils.log("unzip", "onFailure->$exception")
|
||||
}
|
||||
@ -161,6 +165,8 @@ object XapkInstaller : IXapkUnzipListener {
|
||||
DownloadManager.getInstance().updateDownloadEntity(downloadEntity)
|
||||
}
|
||||
|
||||
DownloadDataHelper.uploadDownloadStatusEvent(downloadEntity, "xapk解压成功")
|
||||
|
||||
debugOnly {
|
||||
Utils.log("unzip", "onSuccess->${downloadEntity.path}")
|
||||
}
|
||||
|
||||
@ -3,15 +3,13 @@ package com.gh.download
|
||||
import android.content.pm.PackageInfo
|
||||
import android.text.TextUtils
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.common.util.RealNameHelper
|
||||
import com.gh.common.xapk.XapkInstaller
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.exposure.meta.MetaUtil
|
||||
import com.gh.gamecenter.common.exposure.meta.MetaUtil.getMeta
|
||||
import com.gh.gamecenter.common.loghub.LoghubUtils
|
||||
import com.gh.gamecenter.common.utils.DeviceUtils
|
||||
import com.gh.gamecenter.common.utils.getExtension
|
||||
import com.gh.gamecenter.common.utils.getMetaExtra
|
||||
import com.gh.gamecenter.common.utils.isSimulatorGame
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.utils.SentryHelper
|
||||
import com.gh.ndownload.NDataChanger
|
||||
import com.halo.assistant.HaloApp
|
||||
@ -64,6 +62,7 @@ object DownloadDataHelper {
|
||||
|| status == DownloadStatus.neterror
|
||||
|| status == DownloadStatus.timeout
|
||||
|| status == DownloadStatus.diskisfull
|
||||
|| status == DownloadStatus.diskioerror
|
||||
) {
|
||||
"暂停下载-连上WiFi自动下载"
|
||||
} else if (status == DownloadStatus.done) {
|
||||
@ -127,6 +126,7 @@ object DownloadDataHelper {
|
||||
payloadObject.put("gameName", downloadEntity.name)
|
||||
payloadObject.put("platform", downloadEntity.platform)
|
||||
payloadObject.put("package", downloadEntity.packageName)
|
||||
payloadObject.put("certification", RealNameHelper.getCertificationStatus())
|
||||
payloadObject.put("filename", getFileName(downloadEntity))
|
||||
payloadObject.put("task_num", NDataChanger.downloadingTasks.size)
|
||||
jsonObject.put("payload", payloadObject)
|
||||
@ -211,6 +211,7 @@ object DownloadDataHelper {
|
||||
payloadObject.put("gameName", downloadEntity.name)
|
||||
payloadObject.put("platform", downloadEntity.platform)
|
||||
payloadObject.put("package", downloadEntity.packageName)
|
||||
payloadObject.put("certification", RealNameHelper.getCertificationStatus())
|
||||
payloadObject.put("filename", getFileName(downloadEntity))
|
||||
payloadObject.put("launch_ms", startupTime)
|
||||
payloadObject.put("task_num", NDataChanger.downloadingTasks.size)
|
||||
@ -226,11 +227,11 @@ object DownloadDataHelper {
|
||||
LoghubUtils.log(jsonObject, "download_debug", false)
|
||||
}
|
||||
|
||||
private fun uploadDownloadStatusEvent(downloadEntity: DownloadEntity) {
|
||||
fun uploadDownloadStatusEvent(downloadEntity: DownloadEntity, extraStatus: String? = null) {
|
||||
val jsonObject = JSONObject()
|
||||
|
||||
try {
|
||||
val statusAlias = getDownloadStatusAlias(downloadEntity)
|
||||
val statusAlias = extraStatus ?: getDownloadStatusAlias(downloadEntity)
|
||||
jsonObject.put("event", statusAlias)
|
||||
jsonObject.put("msg", downloadEntity.error)
|
||||
jsonObject.put("status", downloadEntity.status.status)
|
||||
@ -249,6 +250,7 @@ object DownloadDataHelper {
|
||||
payloadObject.put("gameName", downloadEntity.name)
|
||||
payloadObject.put("platform", downloadEntity.platform)
|
||||
payloadObject.put("package", downloadEntity.packageName)
|
||||
payloadObject.put("certification", RealNameHelper.getCertificationStatus())
|
||||
payloadObject.put("filename", getFileName(downloadEntity))
|
||||
payloadObject.put("total_size", sizeInMB)
|
||||
if (parallel != null) {
|
||||
@ -319,6 +321,7 @@ object DownloadDataHelper {
|
||||
payloadObject.put("gameName", downloadEntity.name)
|
||||
payloadObject.put("platform", downloadEntity.platform)
|
||||
payloadObject.put("package", downloadEntity.packageName)
|
||||
payloadObject.put("certification", RealNameHelper.getCertificationStatus())
|
||||
payloadObject.put("filename", getFileName(downloadEntity))
|
||||
payloadObject.put("speed_progress", JSONArray(averageSpeedList))
|
||||
payloadObject.put("is_finished", downloadEntity.status == DownloadStatus.done)
|
||||
@ -358,6 +361,7 @@ object DownloadDataHelper {
|
||||
sheet.put("game_id", downloadEntity.gameId)
|
||||
sheet.put("platform", downloadEntity.platform)
|
||||
sheet.put("package", downloadEntity.packageName)
|
||||
sheet.put("certification", RealNameHelper.getCertificationStatus())
|
||||
sheet.put("filename", getFileName(downloadEntity))
|
||||
sheet.put("total_size", downloadEntity.size / 1024 / 1024)
|
||||
sheet.put("current_progress_size", downloadEntity.progress / 1024)
|
||||
|
||||
@ -49,6 +49,7 @@ import com.gh.gamecenter.eventbus.EBDownloadStatus;
|
||||
import com.gh.gamecenter.manager.PackagesManager;
|
||||
import com.gh.gamecenter.login.user.UserManager;
|
||||
import com.gh.gamecenter.packagehelper.PackageRepository;
|
||||
import com.gh.vspace.VHelper;
|
||||
import com.gh.ndownload.NDataChanger;
|
||||
import com.gh.ndownload.NDownloadBridge;
|
||||
import com.gh.ndownload.NDownloadService;
|
||||
@ -339,15 +340,19 @@ public class DownloadManager implements DownloadStatusListener {
|
||||
ExtensionsKt.addMetaExtra(downloadEntity, Constants.SMOOTH_GAME, "true");
|
||||
ExtensionsKt.addMetaExtra(downloadEntity, Constants.EXTRA_DOWNLOAD_TYPE, Constants.SMOOTH_GAME);
|
||||
ExtensionsKt.addMetaExtra(downloadEntity, DownloadConfig.KEY_PROGRESS_CALLBACK_INTERVAL, "200");
|
||||
ExtensionsKt.addMetaExtra(downloadEntity, VHelper.KEY_REQUIRED_G_APPS, gameEntity.getGAppsSwitch());
|
||||
ExtensionsKt.addMetaExtra(downloadEntity, VHelper.KEY_BIT, apkEntity.getBit());
|
||||
|
||||
SensorsBridge.trackEvent("HaloFunGameDownloadClick",
|
||||
"game_name", gameEntity.getName(),
|
||||
"game_id", gameEntity.getId());
|
||||
"game_id", gameEntity.getId(),
|
||||
"game_schema_type", gameEntity.getGameBitChinese());
|
||||
} else {
|
||||
SensorsBridge.trackEvent("DownloadProcessBegin",
|
||||
"game_id", gameEntity.getId(),
|
||||
"game_name", gameEntity.getName(),
|
||||
"game_type", gameEntity.getCategoryChinese(),
|
||||
"game_schema_type", gameEntity.getGameBitChinese(),
|
||||
"page_name", GlobalActivityManager.getCurrentPageEntity().getPageName(),
|
||||
"page_id", GlobalActivityManager.getCurrentPageEntity().getPageId(),
|
||||
"page_business_id", GlobalActivityManager.getCurrentPageEntity().getPageBusinessId(),
|
||||
@ -624,7 +629,7 @@ public class DownloadManager implements DownloadStatusListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 url 获取下载任务快照 (仅保证下载状态一致)
|
||||
* 根据包名获取下载任务快照 (仅保证下载状态一致)
|
||||
*
|
||||
* @param packageName 包名 (多包名一样时取第一个,若使用场景里有多包名,请使用 url 获取下载任务)
|
||||
* @return null 表示下载列表中不存在该任务,否则返回下载任务
|
||||
|
||||
@ -93,9 +93,11 @@ object PackageObserver {
|
||||
}
|
||||
|
||||
if (EBPackage.TYPE_INSTALLED == busFour.type) {
|
||||
mPackageViewModel.addInstalledGame(packageName)
|
||||
|
||||
BrowserInstallHelper.onApkInstalled(mDownloadEntity?.path)
|
||||
if (!busFour.isVGame) {
|
||||
// 非畅玩游戏才执行下面的代码
|
||||
mPackageViewModel.addInstalledGame(packageName)
|
||||
BrowserInstallHelper.onApkInstalled(mDownloadEntity?.path)
|
||||
}
|
||||
|
||||
if (mDownloadEntity != null) {
|
||||
// 没有光环 ID 的都记录一下游戏 ID,供'我的游戏'区分同包名不同插件用
|
||||
@ -138,12 +140,13 @@ object PackageObserver {
|
||||
runOnIoThread { postNewlyInstalledApp(gameId, packageName) }
|
||||
}
|
||||
|
||||
if ("卸载" == busFour.type) {
|
||||
if (EBPackage.TYPE_UNINSTALLED == busFour.type) {
|
||||
mPackageViewModel.addUninstalledGame(packageName)
|
||||
mDownloadEntity?.let {
|
||||
if (it.isVGame()) return@let
|
||||
|
||||
if (it.isPluggable || it.isUpdate) {
|
||||
if (it.isPluggable
|
||||
|| (it.isUpdate && !PackageUtils.isInstalled(application, it.packageName))) {
|
||||
PackageInstaller.install(application, mDownloadEntity)
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import tv.danmaku.ijk.media.exo2.ExoSourceManager
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
object ExoCacheManager {
|
||||
|
||||
@ -98,7 +99,9 @@ object ExoCacheManager {
|
||||
.build()
|
||||
var response: Response? = null
|
||||
try {
|
||||
response = OkHttpClient.Builder().build().newCall(request).execute()
|
||||
response =
|
||||
OkHttpClient.Builder().connectTimeout(5, TimeUnit.SECONDS).readTimeout(5, TimeUnit.SECONDS).build()
|
||||
.newCall(request).execute()
|
||||
if (response!!.isSuccessful && response.body() != null) {
|
||||
val length = response.body()!!.contentLength()
|
||||
contentLength = if (length == 0L) -1L else length
|
||||
|
||||
@ -373,7 +373,9 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
|
||||
override fun onConfirm() {
|
||||
DialogUtils.checkDownload(
|
||||
context,
|
||||
apkEntity.size
|
||||
apkEntity.size,
|
||||
gameEntity.id,
|
||||
gameEntity.name
|
||||
) { isSubscribe ->
|
||||
DownloadManager.createDownload(
|
||||
context,
|
||||
|
||||
@ -27,7 +27,7 @@ class BlockActivity : DownloadToolbarActivity() {
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, BlockActivity::class.java, GameFragment::class.java)
|
||||
return getTargetIntent(this, BlockActivity::class.java, GameFragment::class.java, intent?.extras)
|
||||
}
|
||||
|
||||
override fun showDownloadMenu(): Boolean {
|
||||
|
||||
@ -101,7 +101,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
entrance: String,
|
||||
traceEvent: ExposureEvent?
|
||||
) {
|
||||
startGameDetailActivity(context, gameEntity, entrance, -1, traceEvent = traceEvent)
|
||||
startGameDetailActivity(context, gameEntity, entrance, "", traceEvent = traceEvent)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,7 +117,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
context: Context,
|
||||
gameEntity: GameEntity?,
|
||||
entrance: String,
|
||||
defaultTab: Int = -1,
|
||||
defaultTab: String = "",
|
||||
isSkipGameComment: Boolean = false,
|
||||
scrollToLibao: Boolean = false,
|
||||
scrollToServer: Boolean = false,
|
||||
@ -140,18 +140,18 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
)
|
||||
traceEvent.payload = payload
|
||||
}
|
||||
if (defaultTab != -1) {
|
||||
bundle.putInt(EntranceConsts.KEY_TARGET, defaultTab)
|
||||
if (defaultTab.isNotEmpty()) {
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, defaultTab)
|
||||
}
|
||||
if (isSkipGameComment) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, true)
|
||||
}
|
||||
if (scrollToLibao) {
|
||||
bundle.putInt(EntranceConsts.KEY_TARGET, GameDetailFragment.INDEX_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
|
||||
}
|
||||
if (scrollToServer) {
|
||||
bundle.putInt(EntranceConsts.KEY_TARGET, GameDetailFragment.INDEX_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_SERVER, true)
|
||||
}
|
||||
bundle.putString(EntranceConsts.KEY_GAMEID, gameEntity?.id)
|
||||
@ -257,7 +257,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
}
|
||||
if (openVideoStreaming) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_OPEN_VIDEO_STREAMING, true)
|
||||
bundle.putInt(EntranceConsts.KEY_TARGET, GameDetailFragment.INDEX_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
}
|
||||
if (openPlatformWindow) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, true)
|
||||
@ -269,7 +269,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
}
|
||||
}
|
||||
if (scrollToLibao) {
|
||||
bundle.putInt(EntranceConsts.KEY_TARGET, GameDetailFragment.INDEX_TRENDES)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
|
||||
}
|
||||
bundle.putString(EntranceConsts.KEY_GAMEID, gameId)
|
||||
|
||||
@ -861,7 +861,7 @@ class ImageViewerActivity : BaseActivity(), OnPageChangeListener {
|
||||
imageView.setOnLongClickListener {
|
||||
// 下滑的时候不弹
|
||||
if (imageView.isDragging()) {
|
||||
return@setOnLongClickListener false
|
||||
return@setOnLongClickListener true
|
||||
}
|
||||
|
||||
val dialog = Dialog(this@ImageViewerActivity)
|
||||
@ -897,7 +897,7 @@ class ImageViewerActivity : BaseActivity(), OnPageChangeListener {
|
||||
}
|
||||
dialog.cancel()
|
||||
}
|
||||
false
|
||||
true
|
||||
}
|
||||
view.tag = position
|
||||
container.addView(view)
|
||||
|
||||
@ -4,6 +4,7 @@ import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG;
|
||||
import static com.gh.gamecenter.common.constant.Constants.LOGOUT_TAG;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_BROWSER;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_LAUNCH_SIMULATOR_GAME;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_LAUNCH_VM_GAME;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_QQ;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_QQ_GROUP;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_WEB;
|
||||
@ -32,6 +33,7 @@ import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@ -41,6 +43,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.common.DefaultUrlHandler;
|
||||
import com.gh.common.constant.Config;
|
||||
@ -74,6 +77,7 @@ import com.gh.gamecenter.common.base.fragment.ToolbarFragment;
|
||||
import com.gh.gamecenter.common.constant.CommonConsts;
|
||||
import com.gh.gamecenter.common.constant.Constants;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
import com.gh.gamecenter.common.entity.LinkEntity;
|
||||
import com.gh.gamecenter.common.entity.NotificationUgc;
|
||||
import com.gh.gamecenter.common.entity.SuggestType;
|
||||
@ -88,6 +92,7 @@ import com.gh.gamecenter.common.utils.ImageUtils;
|
||||
import com.gh.gamecenter.common.utils.NotificationHelper;
|
||||
import com.gh.gamecenter.common.utils.ShareUtils;
|
||||
import com.gh.gamecenter.core.AppExecutor;
|
||||
import com.gh.gamecenter.core.provider.IStartUpAdProvider;
|
||||
import com.gh.gamecenter.core.utils.ClassUtils;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
import com.gh.gamecenter.core.utils.GsonUtils;
|
||||
@ -116,6 +121,7 @@ import com.gh.gamecenter.packagehelper.PackageViewModel;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.gh.gamecenter.room.AppDatabase;
|
||||
import com.gh.gamecenter.room.dao.SimulatorGameDao;
|
||||
import com.gh.vspace.VHelper;
|
||||
import com.google.android.exoplayer2.upstream.cache.Cache;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
@ -186,6 +192,8 @@ public class MainActivity extends BaseActivity {
|
||||
private final Handler handler = new Handler();
|
||||
public boolean showAd = false; // 是否显示广告
|
||||
|
||||
private IStartUpAdProvider mStartUpAdProvider;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
showAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null;
|
||||
@ -304,7 +312,8 @@ public class MainActivity extends BaseActivity {
|
||||
if (showAd) {
|
||||
observeStartUp();
|
||||
} else {
|
||||
checkDialog();
|
||||
hideStartUp();
|
||||
hideStartUpAd();
|
||||
}
|
||||
|
||||
// 默认配置为空时重试
|
||||
@ -465,6 +474,8 @@ public class MainActivity extends BaseActivity {
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
if (mStartUpAdProvider != null) mStartUpAdProvider.cancelStartUpAd(this);
|
||||
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
releaseExoSourceCache();
|
||||
}
|
||||
@ -498,8 +509,17 @@ public class MainActivity extends BaseActivity {
|
||||
showStartUp(startUp);
|
||||
AppExecutor.getUiExecutor().executeWithDelay(() -> {
|
||||
hideStartUp();
|
||||
observeStartUpAd();
|
||||
initStartUpAd();
|
||||
}, 2000);
|
||||
} else {
|
||||
initStartUpAd();
|
||||
}
|
||||
}
|
||||
|
||||
private void initStartUpAd() {
|
||||
mStartUpAdProvider = (IStartUpAdProvider) ARouter.getInstance().build(RouteConsts.provider.adSdk).navigation();
|
||||
if (mStartUpAdProvider != null && mStartUpAdProvider.shouldEnableSDK(HaloApp.getInstance().getChannel())) {
|
||||
initSDKStartUpAd();
|
||||
} else {
|
||||
observeStartUpAd();
|
||||
}
|
||||
@ -593,6 +613,12 @@ public class MainActivity extends BaseActivity {
|
||||
startAdContainer.setVisibility(View.GONE);
|
||||
ExtensionsKt.removeFromParent(startAdContainer);
|
||||
}
|
||||
View startSdkAdContainer = findViewById(R.id.sdkStartAdContainer);
|
||||
if (startSdkAdContainer != null) {
|
||||
startSdkAdContainer.setVisibility(View.GONE);
|
||||
ExtensionsKt.removeFromParent(startSdkAdContainer);
|
||||
if (mStartUpAdProvider != null) mStartUpAdProvider.cancelStartUpAd(this);
|
||||
}
|
||||
checkDialog();
|
||||
}
|
||||
|
||||
@ -650,6 +676,18 @@ public class MainActivity extends BaseActivity {
|
||||
mBaseHandler.sendEmptyMessageDelayed(COUNTDOWN_AD, 1000);
|
||||
}
|
||||
|
||||
private void initSDKStartUpAd() {
|
||||
View startAdContainer = findViewById(R.id.sdkStartAdContainer);
|
||||
startAdContainer.setVisibility(View.VISIBLE);
|
||||
FrameLayout adsFl = findViewById(R.id.adsFl);
|
||||
if (mStartUpAdProvider != null) {
|
||||
mStartUpAdProvider.initStartUpAd(startAdContainer, adsFl, showAd, () -> {
|
||||
hideStartUpAd();
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void showStartUp(StartupAdEntity ad) {
|
||||
TextView adContentTv = findViewById(R.id.adContentTv);
|
||||
View containerView = findViewById(R.id.maskContainer);
|
||||
@ -759,6 +797,24 @@ public class MainActivity extends BaseActivity {
|
||||
);
|
||||
}
|
||||
break;
|
||||
case HOST_LAUNCH_VM_GAME:
|
||||
String gamePackageName = getIntent().getStringExtra(EntranceConsts.KEY_GAME_PKG);
|
||||
if (TextUtils.isEmpty(gamePackageName)) {
|
||||
ToastUtils.showToast("游戏启动失败,请联系客服反馈相关信息");
|
||||
return;
|
||||
}
|
||||
ToastUtils.showToast("游戏启动中,请稍后~");
|
||||
handler.postDelayed(() -> {
|
||||
VHelper.postOnInitialized(() -> {
|
||||
if (VHelper.isInstalled(gamePackageName)) {
|
||||
VHelper.launch(this, gamePackageName, false, true);
|
||||
} else {
|
||||
ToastUtils.showToast("应用已被卸载!");
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}, 500);
|
||||
break;
|
||||
case KEY_MARKET_DETAILS:
|
||||
redirectGameDetail(bundle.getString(KEY_DATA));
|
||||
break;
|
||||
|
||||
@ -30,7 +30,6 @@ import com.ethanhua.skeleton.ViewSkeletonScreen;
|
||||
import com.gh.base.DownloadToolbarActivity;
|
||||
import com.gh.common.filter.RegionSettingHelper;
|
||||
import com.gh.common.history.HistoryHelper;
|
||||
import com.gh.gamecenter.feature.utils.ApkActiveUtils;
|
||||
import com.gh.common.util.CheckLoginUtils;
|
||||
import com.gh.common.util.CollectionUtils;
|
||||
import com.gh.common.util.DataCollectionUtils;
|
||||
@ -41,6 +40,8 @@ import com.gh.gamecenter.adapter.viewholder.DetailViewHolder;
|
||||
import com.gh.gamecenter.common.callback.OnRequestCallBackListener;
|
||||
import com.gh.gamecenter.common.constant.Constants;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.eventbus.EBNetworkState;
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.utils.ShareUtils;
|
||||
@ -49,15 +50,16 @@ import com.gh.gamecenter.common.view.VerticalItemDecoration;
|
||||
import com.gh.gamecenter.core.utils.ClickUtils;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.gamecenter.entity.NewsDetailEntity;
|
||||
import com.gh.gamecenter.eventbus.EBConcernChanged;
|
||||
import com.gh.gamecenter.eventbus.EBAddComment;
|
||||
import com.gh.gamecenter.eventbus.EBDeleteComment;
|
||||
import com.gh.gamecenter.eventbus.EBDownloadStatus;
|
||||
import com.gh.gamecenter.eventbus.EBPackage;
|
||||
import com.gh.gamecenter.feature.entity.GameEntity;
|
||||
import com.gh.gamecenter.feature.entity.MeEntity;
|
||||
import com.gh.gamecenter.entity.NewsDetailEntity;
|
||||
import com.gh.gamecenter.feature.entity.NewsEntity;
|
||||
import com.gh.gamecenter.eventbus.EBConcernChanged;
|
||||
import com.gh.gamecenter.eventbus.EBDownloadStatus;
|
||||
import com.gh.gamecenter.common.eventbus.EBNetworkState;
|
||||
import com.gh.gamecenter.eventbus.EBPackage;
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse;
|
||||
import com.gh.gamecenter.feature.utils.ApkActiveUtils;
|
||||
import com.gh.gamecenter.newsdetail.NewsDetailAdapter;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.lightgame.download.DataWatcher;
|
||||
@ -92,6 +94,9 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
|
||||
TextView mNoneDataTv;
|
||||
RelativeLayout mDetailCommentLl;
|
||||
RelativeLayout mSkeletonView;
|
||||
View mCommentContainer;
|
||||
View mDownloadContainer;
|
||||
View mBottomContainer;
|
||||
|
||||
MenuItem mNewsShare;
|
||||
MenuItem mNewsCollection;
|
||||
@ -118,7 +123,7 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
|
||||
private NewsEntity mNewsEntity;
|
||||
private DownloadEntity mDownloadEntity;
|
||||
|
||||
private Boolean mHideUselessInfo = false;
|
||||
private Boolean mHideUselessInfo = false; // 是否需要隐藏一些额外的信息(评论按钮等)
|
||||
|
||||
private Handler handler = new Handler();
|
||||
|
||||
@ -270,6 +275,9 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
|
||||
mNoneDataTv = findViewById(R.id.reuseNoneDataTv);
|
||||
mDetailCommentLl = findViewById(R.id.news_detail_ll_coment);
|
||||
mSkeletonView = findViewById(R.id.news_skeleton);
|
||||
mCommentContainer = findViewById(R.id.commentContainer);
|
||||
mDownloadContainer = findViewById(R.id.detail_ll_bottom);
|
||||
mBottomContainer = findViewById(R.id.bottomContainer);
|
||||
|
||||
mViewSkeletonScreen = Skeleton.bind(mSkeletonView).shimmer(false).load(R.layout.news_detail_skeleton).show();
|
||||
// init toolbar
|
||||
@ -292,6 +300,7 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
|
||||
|
||||
if (mHideUselessInfo) {
|
||||
getMenuItem(R.id.menu_download).setVisible(false);
|
||||
mCommentContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
adapter = new NewsDetailAdapter(this, this, mHideUselessInfo, mEntrance);
|
||||
@ -550,6 +559,17 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onDeleteComment(EBDeleteComment event) {
|
||||
adapter.getNewsCommentNum();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onAddComment(EBAddComment event) {
|
||||
adapter.getNewsCommentNum();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
switch (ev.getAction() & MotionEventCompat.ACTION_MASK) {
|
||||
@ -666,10 +686,22 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
|
||||
adapter.notifyItemInserted(1);
|
||||
|
||||
mDetailBottomLl.setVisibility(View.VISIBLE);
|
||||
DetailDownloadUtils.detailInitDownload(getDetailViewHolder(), true);
|
||||
mDownloadContainer.setVisibility(View.VISIBLE);
|
||||
mBottomContainer.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mDetailBottomLl.setVisibility(View.GONE);
|
||||
mCommentContainer.setVisibility(View.GONE);
|
||||
|
||||
// 关联了光环的文章不显示下载按钮
|
||||
if ("光环助手".equals(gameEntity.getName())) {
|
||||
mDetailBottomLl.setVisibility(View.GONE);
|
||||
mBottomContainer.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBottomContainer.setVisibility(View.VISIBLE);
|
||||
mDetailBottomLl.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
DetailDownloadUtils.detailInitDownload(getDetailViewHolder(), true);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -754,7 +786,7 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
|
||||
mDetailRv.addItemDecoration(mItemDecoration);
|
||||
if (mContentView != null) {
|
||||
mContentView.setBackgroundColor(ContextCompat.getColor(this, R.color.background));
|
||||
findViewById(R.id.commentContainer).setBackgroundColor(ContextCompat.getColor(this, R.color.background_white));
|
||||
findViewById(R.id.bottomContainer).setBackgroundColor(ContextCompat.getColor(this, R.color.background_white));
|
||||
((TextView) findViewById(R.id.commentTv)).setTextColor(ContextCompat.getColor(this, R.color.text_subtitle));
|
||||
}
|
||||
if (adapter != null) {
|
||||
|
||||
@ -236,7 +236,9 @@ open class SearchActivity : BaseActivity() {
|
||||
when (type) {
|
||||
DEFAULT -> {
|
||||
val fragment = supportFragmentManager.findFragmentByTag(SearchDefaultFragment::class.java.name)
|
||||
?: SearchDefaultFragment()
|
||||
?: SearchDefaultFragment().apply {
|
||||
arguments = Bundle().also { it.putBoolean(SearchDefaultFragment.KEY_IS_GAME_SEARCH, true) }
|
||||
}
|
||||
transaction.replace(R.id.search_result, fragment, SearchDefaultFragment::class.java.name)
|
||||
}
|
||||
GAME_DIGEST -> {
|
||||
|
||||
@ -3,18 +3,17 @@ package com.gh.gamecenter;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_BROWSER;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ANSWER;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ARTICLE;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_INVOKE_ONLY;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_CATEGORY;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COLUMN;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COLUMN_COLLECTION;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COMMUNITY;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COMMUNITY_COLUMN;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COMMUNITY_COLUMN_DETAIL;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COMMUNITY_QUESTION_LABEL_DETAIL;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_CREATE_SHORTCUT;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_DOWNLOAD;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_GAME;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_GAME_COLLECTION_DETAIL;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_GAME_COLLECTION_SQUARE;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_INVOKE_ONLY;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_LIBAO;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_QQ;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_QQ_GROUP;
|
||||
@ -36,33 +35,42 @@ import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_GAME_NAME;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_NAME;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_PACKAGENAME;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_PLATFORM;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_PLATFORM_VERSION;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TO;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TYPE;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_VERSION;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.gh.common.util.CheckLoginUtils;
|
||||
import com.gh.common.util.DirectUtils;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils;
|
||||
import com.gh.gamecenter.core.utils.GsonUtils;
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.entity.CommunityEntity;
|
||||
import com.gh.gamecenter.common.entity.LinkEntity;
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity;
|
||||
import com.gh.gamecenter.core.utils.GsonUtils;
|
||||
import com.gh.gamecenter.core.utils.ToastUtils;
|
||||
import com.gh.gamecenter.entity.SubjectRecommendEntity;
|
||||
import com.gh.gamecenter.entity.VideoLinkEntity;
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils;
|
||||
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel;
|
||||
import com.gh.gamecenter.video.videomanager.VideoManagerActivity;
|
||||
import com.gh.vspace.shortcut.OnCreateShortcutResult;
|
||||
import com.gh.vspace.shortcut.ShortcutManager;
|
||||
import com.gh.vspace.shortcut.ShortcutPermissionTipsDialog;
|
||||
import com.halo.assistant.HaloApp;
|
||||
import com.lightgame.config.CommonDebug;
|
||||
import com.lightgame.utils.Utils;
|
||||
import com.muugi.shortcut.core.Executor;
|
||||
|
||||
/**
|
||||
* Created by LGT on 2016/11/16.
|
||||
@ -104,6 +112,10 @@ public class SkipActivity extends BaseActivity {
|
||||
case HOST_INVOKE_ONLY:
|
||||
// 仅唤起光环助手,不进入光环页面。用于类似 ContentProvider 的用途
|
||||
break;
|
||||
case HOST_CREATE_SHORTCUT:
|
||||
// 创建桌面快捷方式
|
||||
createShortcut(uri);
|
||||
return;
|
||||
case HOST_ARTICLE:
|
||||
DirectUtils.directToArticle(this, path, ENTRANCE_BROWSER);
|
||||
break;
|
||||
@ -122,10 +134,11 @@ public class SkipActivity extends BaseActivity {
|
||||
String suggestionType = uri.getQueryParameter(KEY_TYPE);
|
||||
boolean isQaFeedback = !TextUtils.isEmpty(isQaFeedbackString) && isQaFeedbackString.equals("true");
|
||||
String content = (TextUtils.isEmpty(gameId) || TextUtils.isEmpty(packageMd5)) ?
|
||||
String.format("%s-%s-V%s,",
|
||||
String.format("%s—V%s—%s(V%s),",
|
||||
uri.getQueryParameter(KEY_GAME_NAME),
|
||||
uri.getQueryParameter(KEY_VERSION),
|
||||
TextUtils.isEmpty(platformName) ? platform : platformName,
|
||||
uri.getQueryParameter(KEY_VERSION)) :
|
||||
uri.getQueryParameter(KEY_PLATFORM_VERSION)) :
|
||||
String.format("%s-%s-V%s\n游戏ID:%s\n游戏包MD5:%s\n",
|
||||
uri.getQueryParameter(KEY_GAME_NAME),
|
||||
TextUtils.isEmpty(platformName) ? platform : platformName,
|
||||
@ -136,7 +149,7 @@ public class SkipActivity extends BaseActivity {
|
||||
if (!TextUtils.isEmpty(qaId)) {
|
||||
DirectUtils.directToQa(this, qaTitle, qaId);
|
||||
} else if ("vgame".equals(suggestionType)) {
|
||||
DirectUtils.directToFeedbackCompat(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
|
||||
DirectUtils.directToVGameFeedback(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
|
||||
} else {
|
||||
DirectUtils.directToFeedback(this, content, null, isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
|
||||
}
|
||||
@ -315,11 +328,11 @@ public class SkipActivity extends BaseActivity {
|
||||
entity.setLink(path);
|
||||
entity.setName(name);
|
||||
entity.setText(name);
|
||||
DirectUtils.directToBlock(this, entity, mEntrance);
|
||||
DirectUtils.directToBlock(this, entity, mEntrance, null);
|
||||
break;
|
||||
|
||||
case EntranceConsts.HOST_SERVER_BLOCK:
|
||||
DirectUtils.directToGameServers(this, ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directToGameServers(this, ENTRANCE_BROWSER, "浏览器", null);
|
||||
break;
|
||||
|
||||
case EntranceConsts.HOST_AMWAY_BLOCK:
|
||||
@ -387,7 +400,7 @@ public class SkipActivity extends BaseActivity {
|
||||
DirectUtils.directToHelpAndFeedback(this, TextUtils.isEmpty(position) ? 0 : Integer.parseInt(position));
|
||||
break;
|
||||
case HOST_GAME_COLLECTION_DETAIL:
|
||||
DirectUtils.directToGameCollectionDetail(this, path, ENTRANCE_BROWSER, "");
|
||||
DirectUtils.directToGameCollectionDetail(this, path, ENTRANCE_BROWSER, "", null);
|
||||
break;
|
||||
case HOST_GAME_COLLECTION_SQUARE:
|
||||
DirectUtils.directToGameCollectionSquare(this, ENTRANCE_BROWSER, "", "", "");
|
||||
@ -420,4 +433,55 @@ public class SkipActivity extends BaseActivity {
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
/**
|
||||
* 畅玩助手调用创建游戏桌面图标
|
||||
*/
|
||||
private void createShortcut(Uri uri) {
|
||||
String shortcutGameId = uri.getQueryParameter(EntranceConsts.KEY_GAME_ID);
|
||||
String shortcutGamePkg = uri.getQueryParameter(EntranceConsts.KEY_GAME_PKG);
|
||||
OnCreateShortcutResult onCreateShortcutResult = new OnCreateShortcutResult() {
|
||||
@Override
|
||||
public void showPermissionDialog(@Nullable Executor executor) {
|
||||
ShortcutPermissionTipsDialog dialog =
|
||||
new ShortcutPermissionTipsDialog(SkipActivity.this, shortcutGameId, executor);
|
||||
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
if (SkipActivity.this.isFinishing()) {
|
||||
ToastUtils.toast("创建桌面图标失败,请重试");
|
||||
return;
|
||||
}
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exist() {
|
||||
Utils.toast(SkipActivity.this, getString(R.string.shortcut_exist));
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void success() {
|
||||
Utils.toast(SkipActivity.this, getString(R.string.shortcut_create_success));
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failed() {
|
||||
Utils.toast(SkipActivity.this, getString(R.string.shortcut_create_failed));
|
||||
finish();
|
||||
}
|
||||
};
|
||||
ShortcutManager.Companion.getInstance().tryCreateShortCut(
|
||||
this,
|
||||
shortcutGameId,
|
||||
shortcutGamePkg,
|
||||
onCreateShortcutResult);
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,6 @@ import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.g00fy2.versioncompare.Version
|
||||
import com.gh.common.dialog.NewPrivacyPolicyDialogFragment
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.common.util.GameSubstituteRepositoryHelper.updateGameSubstituteRepository
|
||||
import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats
|
||||
import com.gh.download.DownloadManager
|
||||
@ -29,10 +28,12 @@ import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.callback.SimpleCallback
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.exposure.meta.MetaUtil
|
||||
import com.gh.gamecenter.common.tracker.TrackerLogger
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.provider.IAppProvider
|
||||
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
|
||||
import com.gh.gamecenter.core.provider.IStartUpAdProvider
|
||||
import com.gh.gamecenter.core.runOnIoThread
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.entity.PrivacyPolicyEntity
|
||||
@ -62,6 +63,9 @@ class SplashScreenActivity : BaseActivity() {
|
||||
private var mStartMainActivityDirectly = false // 是否不需要用户点击立即体验就直接跳转首页
|
||||
private var mViewModel: SplashScreenViewModel? = null
|
||||
private var mShouldPrefetchData = true
|
||||
private val mStartUpAdProvider by lazy {
|
||||
ARouter.getInstance().build(RouteConsts.provider.adSdk).navigation() as? IStartUpAdProvider
|
||||
}
|
||||
|
||||
private val mPermissions = arrayOf(
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
@ -160,9 +164,11 @@ class SplashScreenActivity : BaseActivity() {
|
||||
val signatureHash = packageUtilsConfig?.getApkSignatureByPackageName(this, packageName)?.get(0)
|
||||
val sideLoadInfo = packageUtilsConfig?.getSideLoadedInfo()
|
||||
val trackEvent = JSONObject()
|
||||
// 是否首次使用神策
|
||||
val isFirstTime = SPUtils.getBoolean(Constants.SP_SENSORS_IS_FIRST_TIME, true)
|
||||
tryCatchInRelease {
|
||||
trackEvent.run {
|
||||
put("\$is_first_time", SPUtils.getBoolean(Constants.SP_SENSORS_IS_FIRST_TIME, true))
|
||||
put("\$is_first_time", isFirstTime)
|
||||
put("is_side_loaded", sideLoadInfo?.get("is_side_loaded").toBoolean())
|
||||
put("installer_store", sideLoadInfo?.get("installer_store") ?: "")
|
||||
put("package_name", packageName)
|
||||
@ -172,6 +178,10 @@ class SplashScreenActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
SensorsBridge.trackEvent("AppLaunch", trackEvent)
|
||||
if (!isFirstTime && HaloApp.getInstance().isBrandNewInstall) {
|
||||
// 神策不是第一次使用,但是全局标志为全新安装,有问题,上报数据供后续确认
|
||||
SentryHelper.onEvent("WRONG_LAUNCH_LOG", "a_id", MetaUtil.getBase64EncodedAndroidId())
|
||||
}
|
||||
SPUtils.setBoolean(Constants.SP_SENSORS_IS_FIRST_TIME, false)
|
||||
}
|
||||
|
||||
@ -294,19 +304,39 @@ class SplashScreenActivity : BaseActivity() {
|
||||
overridePendingTransition(0, 0)
|
||||
startActivity(intent)
|
||||
doFlavorInit()
|
||||
initStartUpAdSDK()
|
||||
logAppLaunch()
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun doFlavorInit() {
|
||||
HaloApp.getInstance().flavorProvider.init(HaloApp.getInstance(), this)
|
||||
HaloApp.getInstance().flavorProvider.init(HaloApp.getInstance(), this, PkgHelper.getActivateRatio())
|
||||
|
||||
// 仅官网渠道和测试包启用神策
|
||||
if ("GH_206" == HaloApp.getInstance().channel || PackageFlavorHelper.IS_TEST_FLAVOR) {
|
||||
val whiteListChannel = arrayListOf(
|
||||
"GH_206",
|
||||
"KS-GHZS-KY1",
|
||||
"KS-GHZS-MC1",
|
||||
"GDT_GHZS_MC1",
|
||||
"T11-GH-APPDY-ZC01",
|
||||
"T7-GH-APPDY-KY03",
|
||||
"T8-GH-APPUX-KY04",
|
||||
"T1-GHZS-MC01",
|
||||
"T4-GHZS-MC03"
|
||||
)
|
||||
|
||||
if (whiteListChannel.contains(HaloApp.getInstance().channel) || PackageFlavorHelper.IS_TEST_FLAVOR) {
|
||||
SensorsBridge.init(HaloApp.getInstance(), HaloApp.getInstance().channel)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initStartUpAdSDK() {
|
||||
mStartUpAdProvider?.run {
|
||||
if (shouldEnableSDK(HaloApp.getInstance().channel)) {
|
||||
initSDK(applicationContext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getGitLogString(): String {
|
||||
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
|
||||
val stringBuilder = StringBuilder()
|
||||
@ -346,6 +376,7 @@ class SplashScreenActivity : BaseActivity() {
|
||||
if (gitLog.isNotEmpty()) {
|
||||
val md5 = MD5Utils.getContentMD5(gitLog)
|
||||
if (SPUtils.getString(Constants.GIT_LOG_MD5, "") != md5) {
|
||||
SPUtils.setString(Constants.GIT_LOG_MD5, md5)
|
||||
DialogHelper.showDialog(
|
||||
this,
|
||||
"${PackageUtils.getGhVersionName()} ${com.gh.gamecenter.common.BuildConfig.BUILD_TIME}",
|
||||
@ -353,7 +384,6 @@ class SplashScreenActivity : BaseActivity() {
|
||||
"确定",
|
||||
"",
|
||||
{
|
||||
SPUtils.setString(Constants.GIT_LOG_MD5, md5)
|
||||
launchMainActivity()
|
||||
},
|
||||
extraConfig = DialogHelper.Config(
|
||||
@ -367,7 +397,8 @@ class SplashScreenActivity : BaseActivity() {
|
||||
isVerticalScrollBarEnabled = true
|
||||
movementMethod = ScrollingMovementMethod.getInstance()
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
} else {
|
||||
launchMainActivity()
|
||||
}
|
||||
|
||||
@ -22,7 +22,6 @@ import androidx.annotation.NonNull;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge;
|
||||
import com.gh.gamecenter.energy.EnergyBridge;
|
||||
import com.gh.common.util.IntegralLogHelper;
|
||||
import com.gh.gamecenter.common.callback.BiCallback;
|
||||
import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
@ -261,7 +260,6 @@ public class WeiBoShareActivity extends Activity implements WbShareCallback {
|
||||
com.gh.gamecenter.common.utils.LogUtils.uploadShareResult(ShareUtils.shareType, ShareUtils.shareEntrance.getName(), "success",
|
||||
ShareUtils.shareEntity.getShareUrl(), ShareUtils.shareEntity.getShareTitle(), ShareUtils.shareEntity.getSummary(), ShareUtils.resourceId);
|
||||
EventBus.getDefault().post(new EBShare(ShareUtils.shareEntrance));
|
||||
EnergyBridge.postEnergyTaskForShare(ShareUtils.shareEntrance.getName(), ShareUtils.resourceId, ShareUtils.shareEntity.getShareUrl());
|
||||
if (ShareUtils.shareEntrance == ShareUtils.ShareEntrance.inviteFriends) {
|
||||
IntegralLogHelper.INSTANCE.logInviteResult("成功", "微博");
|
||||
}
|
||||
|
||||
@ -8,27 +8,31 @@ import android.view.ViewGroup;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
|
||||
import com.gh.gamecenter.common.constant.ItemViewType;
|
||||
import com.gh.common.util.CheckLoginUtils;
|
||||
import com.gh.common.util.CommentUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DirectUtils;
|
||||
import com.gh.gamecenter.common.utils.ImageUtils;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.gamecenter.common.utils.TextHelper;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.adapter.viewholder.CommentViewHolder;
|
||||
import com.gh.gamecenter.common.constant.ItemViewType;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.common.utils.ImageUtils;
|
||||
import com.gh.gamecenter.common.utils.TextHelper;
|
||||
import com.gh.gamecenter.common.viewholder.FooterViewHolder;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.gamecenter.entity.ArticleCommentParent;
|
||||
import com.gh.gamecenter.entity.CommentEntity;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.eventbus.EBDeleteComment;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter;
|
||||
import com.lightgame.utils.Utils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
@ -68,22 +72,34 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
mDataExceptionView = dataExceptionView;
|
||||
mRecyclerView = recyclerView;
|
||||
|
||||
loadData();
|
||||
mOnCommentCallBackListener.onCommentCallback(null);
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
public void refresh() {
|
||||
loadData(1);
|
||||
}
|
||||
|
||||
public void loadMore() {
|
||||
loadData(mPage + 1);
|
||||
}
|
||||
|
||||
public void loadData(int page) {
|
||||
if (mIsLoading) return;
|
||||
mIsLoading = true;
|
||||
RetrofitManager.getInstance().getApi()
|
||||
.getCommentTrace(mCommentId, mPage)
|
||||
.getCommentTrace(mCommentId, page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<List<CommentEntity>>() {
|
||||
@Override
|
||||
public void onResponse(List<CommentEntity> response) {
|
||||
super.onResponse(response);
|
||||
if (page == 1) {
|
||||
mCommentList.clear();
|
||||
}
|
||||
mCommentList.addAll(response);
|
||||
|
||||
if (response.size() < 20) {
|
||||
mIsOver = true;
|
||||
}
|
||||
@ -91,7 +107,7 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
mDataExceptionView.setVisibility(View.GONE);
|
||||
mRecyclerView.setVisibility(View.VISIBLE);
|
||||
notifyItemRangeChanged(0, getItemCount() - 1);
|
||||
mPage++;
|
||||
mPage = page;
|
||||
mIsLoading = false;
|
||||
}
|
||||
|
||||
@ -201,8 +217,14 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
});
|
||||
|
||||
holder.commentMore.setOnClickListener(v ->
|
||||
CommentUtils.showReportDialog(commentEntity,
|
||||
mContext, false, "资讯文章-评论"));
|
||||
CommentUtils.showMorePopupWindow(
|
||||
holder.commentMore,
|
||||
commentEntity,
|
||||
false,
|
||||
"资讯文章-评论",
|
||||
() -> EventBus.getDefault().post(new EBDeleteComment(commentEntity))
|
||||
)
|
||||
);
|
||||
|
||||
holder.commentUserIconDv.setOnClickListener(v -> DirectUtils.directToHomeActivity(mContext, commentEntity.getUser().getId(), "", "文章-评论详情"));
|
||||
holder.commentUserNameTv.setOnClickListener(v -> DirectUtils.directToHomeActivity(mContext, commentEntity.getUser().getId(), "", "文章-评论详情"));
|
||||
@ -254,4 +276,24 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
public boolean isLoading() {
|
||||
return mIsLoading;
|
||||
}
|
||||
|
||||
public void notifyCommentRemoved(final CommentEntity entity) {
|
||||
int positionInComments = getCommentIndexByEntity(mCommentList, entity);
|
||||
if (positionInComments != -1) {
|
||||
mCommentList.remove(positionInComments);
|
||||
notifyItemRemoved(positionInComments);
|
||||
}
|
||||
}
|
||||
|
||||
private static int getCommentIndexByEntity(
|
||||
final List<CommentEntity> commentList,
|
||||
final CommentEntity comment
|
||||
) {
|
||||
for (int i = 0; i < commentList.size();i++) {
|
||||
if (Objects.equals(comment.getId(), commentList.get(i).getId())) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -324,7 +324,11 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
if (mLibaoDetailEntity.getTime() != null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm", Locale.CHINA);
|
||||
String start = format.format((mLibaoDetailEntity.getTime().getStart() * 1000));
|
||||
String end = format.format((mLibaoDetailEntity.getTime().getEnd() * 1000));
|
||||
|
||||
long libaoLingEndTime = mLibaoDetailEntity.getTime().getEnd();
|
||||
String end = libaoLingEndTime == 0
|
||||
? mContext.getString(R.string.libao_ling_time_infinitely) // 礼包领取结束时间为空则表示礼包长期有效
|
||||
: format.format((mLibaoDetailEntity.getTime().getEnd() * 1000));
|
||||
|
||||
holder.binding.libaodetailTimeStart.setText(StringUtils.buildString("开始时间:", start));
|
||||
holder.binding.libaodetailTimeEnd.setText(StringUtils.buildString("截止时间:", end));
|
||||
|
||||
@ -42,6 +42,7 @@ import com.gh.gamecenter.databinding.NewsDigestItemBinding;
|
||||
import com.gh.gamecenter.entity.ArticleCommentParent;
|
||||
import com.gh.gamecenter.entity.CommentEntity;
|
||||
import com.gh.gamecenter.entity.ConcernEntity;
|
||||
import com.gh.gamecenter.eventbus.EBDeleteComment;
|
||||
import com.gh.gamecenter.manager.VisitManager;
|
||||
import com.gh.gamecenter.common.retrofit.JSONObjectResponse;
|
||||
import com.gh.gamecenter.common.retrofit.OkHttpCache;
|
||||
@ -50,12 +51,14 @@ import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter;
|
||||
import com.lightgame.utils.Utils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@ -151,6 +154,7 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
return;
|
||||
}
|
||||
if (isRefresh) {
|
||||
isOver = false;
|
||||
mNormalCommentList.clear();
|
||||
mPage = 1;
|
||||
}
|
||||
@ -467,8 +471,14 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
});
|
||||
|
||||
holder.commentMore.setOnClickListener(v ->
|
||||
CommentUtils.showReportDialog(finalCommentEntity,
|
||||
mContext, true, "资讯文章详情-评论详情"));
|
||||
CommentUtils.showMorePopupWindow(
|
||||
holder.commentMore,
|
||||
finalCommentEntity,
|
||||
true,
|
||||
"资讯文章详情-评论详情",
|
||||
() -> EventBus.getDefault().post(new EBDeleteComment(finalCommentEntity))
|
||||
)
|
||||
);
|
||||
|
||||
holder.commentUserNameTv.setOnClickListener(v -> DirectUtils.directToHomeActivity(mContext, finalCommentEntity.getUser().getId(), mEntrance, "文章-评论详情"));
|
||||
holder.commentUserIconDv.setOnClickListener(v -> DirectUtils.directToHomeActivity(mContext, finalCommentEntity.getUser().getId(), mEntrance, "文章-评论详情"));
|
||||
@ -524,6 +534,42 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
});
|
||||
}
|
||||
|
||||
public void notifyCommentRemoved(final CommentEntity entity) {
|
||||
|
||||
if (mHotCommentList.size() > 0) {
|
||||
int positionInHotComments = getCommentIndexByEntity(mHotCommentList, entity);
|
||||
if (positionInHotComments != -1) {// 如果在热门评论中存在要被删除的评论,则将此评论移除
|
||||
mHotCommentList.remove(positionInHotComments);
|
||||
}
|
||||
}
|
||||
|
||||
if (mNormalCommentList.size() > 0) {
|
||||
int positionInNormalComments = getCommentIndexByEntity(mNormalCommentList, entity);
|
||||
if (positionInNormalComments != -1) {// 如果在热门评论中存在要被删除的评论,则将此评论移除
|
||||
mNormalCommentList.remove(positionInNormalComments);
|
||||
}
|
||||
}
|
||||
|
||||
if (mConcernEntity != null) {
|
||||
int commentNum = mConcernEntity.getCommentnum();
|
||||
mConcernEntity.setCommentnum(commentNum - 1);
|
||||
}
|
||||
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private static int getCommentIndexByEntity(
|
||||
final List<CommentEntity> commentList,
|
||||
final CommentEntity comment
|
||||
) {
|
||||
for (int i = 0; i < commentList.size();i++) {
|
||||
if (Objects.equals(comment.getId(), commentList.get(i).getId())) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private void statNewsViews(final String news_id) {
|
||||
RetrofitManager.getInstance().getApi().postArticleVisit(news_id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@ -587,7 +633,7 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
}
|
||||
|
||||
public void addCommentCount() {
|
||||
mConcernEntity.setCommentnum(mConcernEntity.getCommentnum());
|
||||
mConcernEntity.setCommentnum(mConcernEntity.getCommentnum() + 1);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,6 @@ import com.gh.common.util.DetailDownloadUtils;
|
||||
import com.gh.gamecenter.common.utils.DialogHelper;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.gamecenter.core.utils.PageSwitchDataHelper;
|
||||
import com.gh.gamecenter.energy.EnergyBridge;
|
||||
import com.gh.common.util.LogUtils;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.common.util.PackageInstaller;
|
||||
@ -167,6 +166,7 @@ public class DetailViewHolder {
|
||||
"game_type", mGameEntity.getCategoryChinese(),
|
||||
"download_status", mGameEntity.getDownloadStatusChinese(),
|
||||
"button_name", mViewHolder.mDownloadPb.getText(),
|
||||
"game_schema_type", mGameEntity.getGameBitChinese(),
|
||||
"page_name", GlobalActivityManager.getCurrentPageEntity().getPageName(),
|
||||
"page_id", GlobalActivityManager.getCurrentPageEntity().getPageId(),
|
||||
"page_business_id", GlobalActivityManager.getCurrentPageEntity().getPageBusinessId(),
|
||||
@ -204,7 +204,6 @@ public class DetailViewHolder {
|
||||
break;
|
||||
case LAUNCH_OR_OPEN:
|
||||
if (!mGameEntity.getApk().isEmpty()) {
|
||||
EnergyBridge.postEnergyTask("play_game", mGameEntity.getId(), mGameEntity.getApk().get(0).getPackageName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -287,9 +286,9 @@ public class DetailViewHolder {
|
||||
|
||||
ChainBuilder builder = new ChainBuilder();
|
||||
builder.addHandler(new UpdateNewSimulatorHandler());
|
||||
builder.addHandler(new ValidateVSpaceHandler());
|
||||
builder.addHandler(new GamePermissionHandler());
|
||||
builder.addHandler(new CheckStoragePermissionHandler());
|
||||
builder.addHandler(new ValidateVSpaceHandler());
|
||||
|
||||
if (mGameEntity.getApk().size() == 1) {
|
||||
builder.addHandler(new BrowserInstallHandler());
|
||||
@ -348,7 +347,7 @@ public class DetailViewHolder {
|
||||
}
|
||||
|
||||
if (mGameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch(mViewHolder.context, mGameEntity.getApk().get(0).getPackageName());
|
||||
VHelper.installOrLaunch(mViewHolder.context, mGameEntity);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -390,7 +389,7 @@ public class DetailViewHolder {
|
||||
}
|
||||
|
||||
if (mGameEntity.isVGame()) {
|
||||
VHelper.installOrLaunch(v.getContext(), mGameEntity.getApk().get(0).getPackageName());
|
||||
VHelper.installOrLaunch(v.getContext(), mGameEntity);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -546,9 +545,13 @@ public class DetailViewHolder {
|
||||
DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN : DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
|
||||
DeviceRemindDialog.Companion.showDeviceRemindDialog(mViewHolder.context, mGameEntity);
|
||||
|
||||
if (mGameEntity.isVGame() && mViewHolder.context.getString(R.string.download).equals(method) && VHelper.INSTANCE.shouldLaunchGameAfterInstallation()) {
|
||||
//去掉游戏详情页启动畅玩游戏弹出加载框的行为 https://jira.shanqu.cc/browse/GHZS-2087
|
||||
/*if (mGameEntity.isVGame()
|
||||
&& mViewHolder.context.getString(R.string.download).equals(method)
|
||||
&& VHelper.INSTANCE.shouldLaunchGameAfterInstallation()
|
||||
&& !(VHelper.INSTANCE.isGAppsRequired(mGameEntity) && !VHelper.INSTANCE.isGAppsInstalled())) {
|
||||
mViewHolder.context.startActivity(VSpaceLoadingActivity.getIntent(mViewHolder.context, mGameEntity, false));
|
||||
}
|
||||
}*/
|
||||
} else {
|
||||
Utils.toast(mViewHolder.context, msg);
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ import com.gh.gamecenter.home.LegacyHomeItemData
|
||||
import com.gh.gamecenter.home.LegacyHomeSubjectTransformer
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse
|
||||
import com.gh.gamecenter.common.retrofit.Response
|
||||
import com.gh.gamecenter.energy.EnergyBridge
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.lightgame.utils.Utils
|
||||
import io.reactivex.Observable
|
||||
@ -212,8 +211,6 @@ class AmwayViewModel(application: Application) : ListViewModel<AmwayCommentEntit
|
||||
|
||||
Utils.toast(getApplication(), "点赞成功")
|
||||
updateAmwayCommentLikeCount(commentId, increaseCount = true, isLiked = true)
|
||||
|
||||
EnergyBridge.postEnergyTask("vote_game_comment", commentId)
|
||||
}
|
||||
|
||||
override fun onFailure(e: HttpException?) {
|
||||
|
||||
@ -0,0 +1,239 @@
|
||||
package com.gh.gamecenter.authorization
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import com.gh.common.util.CheckLoginUtils
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.common.util.NewFlatLogUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.utils.ImageUtils
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
import com.gh.gamecenter.common.utils.viewModelProvider
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
import com.gh.gamecenter.databinding.ActivityAuthorizationBinding
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.vspace.VHelper
|
||||
|
||||
/**
|
||||
* @author : liujiarui
|
||||
* date : 2023/4/3
|
||||
* description : 通用授权登陆界面
|
||||
* 1. 通过scheme跳转到该界面,传递参数,包括被授权app包名,跳转回的游戏包名(若没有则跳回被授权app)
|
||||
* 2. 检查参数,校验申请授权app 包名/签名信息/密钥 等是否合法,后续实现
|
||||
* 3. 检查是否已经登陆,如果已经登陆,直接初始化用户信息
|
||||
* 4. 如果未登陆,点击登陆按钮,跳转到登陆界面
|
||||
* 5. 登陆成功后,初始化用户信息
|
||||
* 6. 点击确认授权,跳转回被授权app
|
||||
* 7. 被授权app接收到授权成功的广播,进行相应的处理
|
||||
* 隐式意图示例:ghzhushou_authorization://authorize?packageName=com.lg.vspace&game_pkg=xxx.xxx.xxx
|
||||
* 注意:被授权的app需要创建一个(包名.AuthorizationReceiver)的广播接收者,用于接收授权成功的广播
|
||||
* 目前授权返回信息有:
|
||||
* 用户token[EntranceConsts.KEY_TOKEN],
|
||||
* 用户昵称[EntranceConsts.KEY_USER_NAME],
|
||||
* 用户头像[EntranceConsts.KEY_USER_AVATAR],
|
||||
*/
|
||||
class AuthorizationActivity : ToolBarActivity() {
|
||||
|
||||
private val mViewModel: AuthorizationViewModel by lazy {
|
||||
viewModelProvider()
|
||||
}
|
||||
|
||||
private lateinit var mBinding: ActivityAuthorizationBinding
|
||||
|
||||
//被授权app包名,用于获取icon和发送显示广播
|
||||
private var mRemotePkgName: String? = null
|
||||
|
||||
//跳转回的游戏app,如果为空,跳转到被授权app
|
||||
private var mGamePkg: String? = null
|
||||
|
||||
//授权内容
|
||||
private var mContent: String = ""
|
||||
|
||||
/**
|
||||
* 畅玩助手当前运行的游戏ID
|
||||
*/
|
||||
private var gameId: String = ""
|
||||
|
||||
/**
|
||||
* 畅玩助手当前运行的游戏名称
|
||||
*/
|
||||
private var gameName: String = ""
|
||||
|
||||
//授权token
|
||||
private var mToken = ""
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.activity_authorization
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.transparentStatusBar(this)
|
||||
setNavigationTitle("光环助手授权登陆")
|
||||
updateStatusBarColor(R.color.background_white, R.color.background_white)
|
||||
mBinding = ActivityAuthorizationBinding.bind(mContentView)
|
||||
checkParam()
|
||||
initView()
|
||||
mBinding.authorizeBtn.postDelayed({
|
||||
checkLogin {
|
||||
initUserInfo()
|
||||
}
|
||||
}, 500)
|
||||
NewFlatLogUtils.logLoginFromGHZSShow(
|
||||
gameId = gameId,
|
||||
gameName = gameName
|
||||
)
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
if (mToken.isNotEmpty()) return
|
||||
val loadingDialog = DialogUtils.showWaitDialog(this, "请稍后...")
|
||||
mViewModel.getAccessToken(listOf(mContent), {
|
||||
mToken = it
|
||||
loadingDialog.dismiss()
|
||||
}, {
|
||||
toast("获取token失败")
|
||||
loadingDialog.dismiss()
|
||||
})
|
||||
}
|
||||
|
||||
override fun onDarkModeChanged() {
|
||||
super.onDarkModeChanged()
|
||||
updateStatusBarColor(R.color.background_white, R.color.background_white)
|
||||
}
|
||||
|
||||
override fun onRestart() {
|
||||
super.onRestart()
|
||||
if (!CheckLoginUtils.isLogin()) {
|
||||
finish()
|
||||
} else {
|
||||
initUserInfo()
|
||||
initData()
|
||||
}
|
||||
}
|
||||
|
||||
//检查参数,理论上来说需要 校验申请授权app 包名/签名信息/密钥 等是否合法,后续实现
|
||||
private fun checkParam() {
|
||||
val uri = intent.data
|
||||
if (uri == null) {
|
||||
finish()
|
||||
return
|
||||
}
|
||||
val host = uri.host
|
||||
if (host != "authorize") {
|
||||
finish()
|
||||
return
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
mRemotePkgName = referrer?.host
|
||||
}
|
||||
mRemotePkgName = mRemotePkgName ?: uri.getQueryParameter(EntranceConsts.KEY_PACKAGENAME)
|
||||
mGamePkg = uri.getQueryParameter(EntranceConsts.KEY_GAME_PKG)
|
||||
mContent = uri.getQueryParameter(EntranceConsts.KEY_CONTENT) ?: ""
|
||||
gameId = uri.getQueryParameter(EntranceConsts.KEY_GAME_ID) ?: ""
|
||||
gameName = uri.getQueryParameter(EntranceConsts.KEY_GAME_NAME) ?: ""
|
||||
if (mRemotePkgName == null) {
|
||||
finish()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
//通过包名获取app图标和名称
|
||||
val pkgName = mRemotePkgName ?: return
|
||||
val icon = packageManager.getApplicationIcon(pkgName)
|
||||
val name = packageManager.getApplicationLabel(packageManager.getApplicationInfo(pkgName, 0))
|
||||
mBinding.authorizeAppIcon.setImageDrawable(icon)
|
||||
mBinding.authorizeAppName.text = name
|
||||
mBinding.authorizeBtn.setOnClickListener {
|
||||
NewFlatLogUtils.logLoginFromGHZSClick(
|
||||
gameId = gameId,
|
||||
gameName = gameName,
|
||||
buttonType = BUTTON_TYPE_CONFIRM
|
||||
)
|
||||
checkLogin {
|
||||
authorization()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkLogin(block: () -> Unit) {
|
||||
//判断光环是否登陆
|
||||
CheckLoginUtils.checkLogin(this, "光环助手授权登陆") {
|
||||
initData()
|
||||
block()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initUserInfo() {
|
||||
if (!CheckLoginUtils.isLogin()) return
|
||||
mBinding.nicknameTv.text = UserManager.getInstance().userInfoEntity?.name
|
||||
val icon = UserManager.getInstance().userInfoEntity?.icon
|
||||
if (icon != null) {
|
||||
ImageUtils.display(mBinding.avatarView, icon)
|
||||
}
|
||||
}
|
||||
|
||||
private fun authorization() {
|
||||
val remotePkgName = mRemotePkgName
|
||||
if (remotePkgName == null) {
|
||||
finish()
|
||||
return
|
||||
}
|
||||
if (mToken.isEmpty()) {
|
||||
toast("授权失败")
|
||||
return
|
||||
}
|
||||
val token = mToken
|
||||
val userId = UserManager.getInstance().userInfoEntity?.userId
|
||||
val username = UserManager.getInstance().userInfoEntity?.name
|
||||
val userAvatar = UserManager.getInstance().userInfoEntity?.icon
|
||||
//授权成功,发送广播, 返回token
|
||||
val intent = Intent()
|
||||
intent.setClassName(remotePkgName, "$remotePkgName.AuthorizationReceiver")
|
||||
intent.setPackage(remotePkgName)
|
||||
intent.putExtra(EntranceConsts.KEY_TOKEN, token)
|
||||
intent.putExtra(EntranceConsts.KEY_USER_ID, userId)
|
||||
intent.putExtra(EntranceConsts.KEY_USER_NAME, username)
|
||||
intent.putExtra(EntranceConsts.KEY_USER_AVATAR, userAvatar)
|
||||
sendBroadcast(intent)
|
||||
backToLaunchApp()
|
||||
finish()
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转回授权app
|
||||
*/
|
||||
private fun backToLaunchApp(showLoading: Boolean = true) {
|
||||
val gamePkg = mGamePkg
|
||||
if (gamePkg != null) { // 跳转回游戏
|
||||
VHelper.launch(this, gamePkg, ignoreGApps = true, showLoading = showLoading)
|
||||
return
|
||||
}
|
||||
val remotePkgName = this.mRemotePkgName
|
||||
if (remotePkgName != null) {// 跳转回其他授权app
|
||||
startActivity(packageManager.getLaunchIntentForPackage(remotePkgName))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
super.onBackPressed()
|
||||
|
||||
backToLaunchApp(false)
|
||||
|
||||
NewFlatLogUtils.logLoginFromGHZSClick(
|
||||
gameId = gameId,
|
||||
gameName = gameName,
|
||||
buttonType = BUTTON_TYPE_BACK
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val BUTTON_TYPE_CONFIRM = "确定"
|
||||
private const val BUTTON_TYPE_BACK = "返回"
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.gh.gamecenter.authorization
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Application
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.utils.toJson
|
||||
import com.gh.gamecenter.common.utils.toRequestBody
|
||||
import com.gh.gamecenter.login.retrofit.RetrofitManager
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
||||
/**
|
||||
* @author : liujiarui
|
||||
* date : 2023/4/13
|
||||
* description :
|
||||
*/
|
||||
class AuthorizationViewModel(application: Application) : AndroidViewModel(application) {
|
||||
private val mApi = RetrofitManager.getInstance().newApi
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun getAccessToken(contentList: List<String>, onSuccess: (String) -> Unit, onFail: () -> Unit) {
|
||||
val jsonObject = JSONObject()
|
||||
val jsonArray = JSONArray()
|
||||
contentList.forEach {
|
||||
jsonArray.put(it)
|
||||
}
|
||||
jsonObject.put(EntranceConsts.KEY_CONTENT, jsonArray)
|
||||
val requestBody = jsonObject.toRequestBody()
|
||||
mApi.grant(requestBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
{
|
||||
onSuccess(it.toJson())
|
||||
}, {
|
||||
onFail()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -43,14 +43,14 @@ class SpecialCatalogSubjectCollectionAdapter(
|
||||
}
|
||||
val entity = mList[position]
|
||||
ImageUtils.display(subjectCollectionImage, entity.image)
|
||||
subjectCollectionImage.loadingCallback = object : WrapContentDraweeView.LoadingCallback {
|
||||
subjectCollectionImage.registerLoadingCallback(object : WrapContentDraweeView.LoadingCallback {
|
||||
override fun loaded() {
|
||||
subjectCollectionImage.layoutParams = subjectCollectionImage.layoutParams.apply {
|
||||
height = 96F.dip2px()
|
||||
width = (subjectCollectionImage.aspectRatio * 96F.dip2px()).toInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
root.setOnClickListener {
|
||||
DirectUtils.directToLinkPage(
|
||||
mContext,
|
||||
|
||||
@ -71,6 +71,10 @@ class CloudArchiveManagerActivity : BaseActivity_TabLayout() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// 重连服务
|
||||
VHelper.reconnectServiceIfNeeded()
|
||||
|
||||
mGameEntity = intent.getParcelableExtra<GameEntity?>(EntranceConsts.KEY_GAME)?.apply {
|
||||
setEntryMap(DownloadManager.getInstance().getEntryMap(name))
|
||||
}
|
||||
@ -100,7 +104,7 @@ class CloudArchiveManagerActivity : BaseActivity_TabLayout() {
|
||||
mGameEntity?.getUniquePackageName() ?: "", mViewModel.archiveConfigStr
|
||||
) -> toast("暂未检测到本地的存档数据,请玩会儿游戏再试~")
|
||||
else -> {
|
||||
NewFlatLogUtils.logCloudArchiveUploadDialogShow()
|
||||
NewFlatLogUtils.logCloudArchiveUploadDialogShow(mGameEntity?.id ?: "", mGameEntity?.name ?: "")
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveUploadDialogShow",
|
||||
"game_id", mGameEntity?.id ?: "",
|
||||
@ -215,7 +219,7 @@ class CloudArchiveManagerActivity : BaseActivity_TabLayout() {
|
||||
confirmTv.alpha = if (text?.length != 0) 1F else 0.4F
|
||||
}
|
||||
confirmTv.setOnClickListener {
|
||||
NewFlatLogUtils.logCloudArchiveUploadDialogClick("确定")
|
||||
NewFlatLogUtils.logCloudArchiveUploadDialogClick("确定", mGameEntity?.id ?: "", mGameEntity?.name ?: "")
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveUploadDialogClick",
|
||||
"game_id", mGameEntity?.id ?: "",
|
||||
@ -230,7 +234,7 @@ class CloudArchiveManagerActivity : BaseActivity_TabLayout() {
|
||||
}
|
||||
}
|
||||
cancelTv.setOnClickListener {
|
||||
NewFlatLogUtils.logCloudArchiveUploadDialogClick("取消")
|
||||
NewFlatLogUtils.logCloudArchiveUploadDialogClick("取消", mGameEntity?.id ?: "", mGameEntity?.name ?: "")
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveUploadDialogClick",
|
||||
"game_id", mGameEntity?.id ?: "",
|
||||
@ -334,7 +338,7 @@ class CloudArchiveManagerActivity : BaseActivity_TabLayout() {
|
||||
btnText = getString(R.string.launch)
|
||||
setOnClickListener {
|
||||
CurrentActivityHolder.getCurrentActivity()?.let {
|
||||
VHelper.installOrLaunch(it, downloadEntity.packageName)
|
||||
VHelper.installOrLaunch(it, downloadEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,11 @@ class CloudArchiveManagerViewModel(
|
||||
) :
|
||||
ListViewModel<ArchiveEntity, ArchiveEntity>(application) {
|
||||
|
||||
companion object {
|
||||
private const val SORT_TYPE_CREATE = "time.create:-1"
|
||||
private const val SORT_TYPE_SHARE_AND_CREATE = "time.share:-1,time.create:-1"
|
||||
}
|
||||
|
||||
var archiveConfigStr = ""
|
||||
private val mNewApi = RetrofitManager.getInstance().newApi
|
||||
private val mApi = RetrofitManager.getInstance().api
|
||||
@ -54,10 +59,10 @@ class CloudArchiveManagerViewModel(
|
||||
|
||||
override fun provideDataObservable(page: Int): Observable<List<ArchiveEntity>>? = when (mType) {
|
||||
MyArchiveFragment.Type.MY_ARCHIVE -> {
|
||||
mNewApi.getMyArchives(gameId, page)
|
||||
mNewApi.getMyArchives(gameId, page, SORT_TYPE_CREATE)
|
||||
}
|
||||
MyArchiveFragment.Type.MY_DOWNLOAD_ARCHIVE -> null
|
||||
MyArchiveFragment.Type.MY_SHARE_ARCHIVE -> mNewApi.getMyShareArchives(gameId, page)
|
||||
MyArchiveFragment.Type.MY_SHARE_ARCHIVE -> mNewApi.getMyShareArchives(gameId, page, SORT_TYPE_SHARE_AND_CREATE)
|
||||
}
|
||||
|
||||
override fun provideDataSingle(page: Int): Single<MutableList<ArchiveEntity>>? {
|
||||
@ -77,7 +82,7 @@ class CloudArchiveManagerViewModel(
|
||||
url = vArchiveEntity.url,
|
||||
configUrl = vArchiveEntity.configUrl,
|
||||
md5 = vArchiveEntity.md5,
|
||||
time = ArchiveEntity.Time(update = vArchiveEntity.time),
|
||||
time = ArchiveEntity.Time(create = vArchiveEntity.time),
|
||||
gameVersion = vArchiveEntity.gameVersion
|
||||
)
|
||||
)
|
||||
|
||||
@ -48,7 +48,7 @@ class MyArchiveAdapter(
|
||||
val entity = mEntityList[position]
|
||||
holder.binding.run {
|
||||
titleTv.text = entity.name
|
||||
timeTv.text = entity.time.update.formatTime("yyyy-MM-dd HH:mm")
|
||||
timeTv.text = entity.time.create.formatTime("yyyy-MM-dd HH:mm")
|
||||
versionTv.text = "版本:${entity.gameVersion}"
|
||||
optionsIv.setOnClickListener {
|
||||
MyArchiveOptionDialogFragment.show(
|
||||
|
||||
@ -114,7 +114,11 @@ class MyArchiveOptionDialogFragment(
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
mBinding.shareTv.setOnClickListener {
|
||||
NewFlatLogUtils.logCloudArchiveShareDialogShow()
|
||||
NewFlatLogUtils.logCloudArchiveShareDialogShow(
|
||||
mGameEntity?.id ?: "",
|
||||
mGameEntity?.name ?: "",
|
||||
mArchiveEntity?.id ?: ""
|
||||
)
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveShareDialogShow",
|
||||
"game_id", mGameEntity?.id ?: "",
|
||||
@ -194,7 +198,12 @@ class MyArchiveOptionDialogFragment(
|
||||
mArchiveEntity?.let { entity ->
|
||||
mViewModel.shareArchive(entity, titleEt.text.toString().trim(), descEt.text.toString().trim())
|
||||
}
|
||||
NewFlatLogUtils.logCloudArchiveShareDialogClick("分享")
|
||||
NewFlatLogUtils.logCloudArchiveShareDialogClick(
|
||||
"分享",
|
||||
mGameEntity?.id ?: "",
|
||||
mGameEntity?.name ?: "",
|
||||
mArchiveEntity?.id ?: ""
|
||||
)
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveShareDialogClick",
|
||||
"game_id", mGameEntity?.id ?: "",
|
||||
@ -204,7 +213,12 @@ class MyArchiveOptionDialogFragment(
|
||||
dialog.dismiss()
|
||||
}
|
||||
cancelTv.setOnClickListener {
|
||||
NewFlatLogUtils.logCloudArchiveShareDialogClick("取消")
|
||||
NewFlatLogUtils.logCloudArchiveShareDialogClick(
|
||||
"取消",
|
||||
mGameEntity?.id ?: "",
|
||||
mGameEntity?.name ?: "",
|
||||
mArchiveEntity?.id ?: ""
|
||||
)
|
||||
SensorsBridge.trackEvent(
|
||||
"CloudSaveShareDialogClick",
|
||||
"game_id", mGameEntity?.id ?: "",
|
||||
|
||||
@ -17,7 +17,7 @@ class MyShareArchiveFragment : MyArchiveFragment() {
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
mBinding.tipsTv.visibility = View.GONE
|
||||
mBinding.reuseNoneData.reuseNoneDataTv.text = "还没有您分享存档噢~"
|
||||
mBinding.reuseNoneData.reuseNoneDataTv.text = "您还没有分享存档噢~"
|
||||
mBinding.reuseNoneData.reuseNoneDataDescTv.text = "快快把您的有趣存档分享给大家吧!"
|
||||
}
|
||||
|
||||
|
||||
@ -100,9 +100,6 @@ class CommunityArticleAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
if (entity.bbs == CommunityEntity()) {
|
||||
entity.bbs = entity.community
|
||||
}
|
||||
holder.binding.selectIv.goneIf(mCurrentOption == ManageOption.OPTION_MANAGER)
|
||||
holder.binding.selectIv.isChecked = selectItems.contains(entity.id)
|
||||
holder.binding.imageContainer.setOffset(if (mCurrentOption == ManageOption.OPTION_MANAGER) 40f else 76f)
|
||||
|
||||
@ -7,6 +7,9 @@ import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.exposure.ExposureSource
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* 猜你喜欢-发现页
|
||||
@ -27,9 +30,15 @@ class DiscoveryActivity : ToolBarActivity() {
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun getIntent(context: Context, entrance: String): Intent {
|
||||
fun getIntent(context: Context, entrance: String, exposureEvent: ExposureEvent? = null): Intent {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
exposureEvent?.let {
|
||||
bundle.putParcelableArrayList(
|
||||
EntranceConsts.KEY_EXPOSURE_SOURCE_LIST,
|
||||
ArrayList(exposureEvent.source)
|
||||
)
|
||||
}
|
||||
return getTargetIntent(context, DiscoveryActivity::class.java, DiscoveryFragment::class.java, bundle)
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,6 +151,8 @@ class DiscoveryFragment : LazyListFragment<DiscoveryItemData, DiscoveryViewModel
|
||||
override fun provideListAdapter(): ListAdapter<*> {
|
||||
val basicExposureSource = arrayListOf<ExposureSource>().apply {
|
||||
arguments?.getParcelable<ExposureSource>(EntranceConsts.KEY_EXPOSURE_SOURCE)?.let { add(it) }
|
||||
arguments?.getParcelableArrayList<ExposureSource>(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST)
|
||||
?.let { addAll(it) }
|
||||
}
|
||||
val outerSequence = requireArguments().getInt(EntranceConsts.KEY_POSITION, -1)
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.gh.common.xapk.XapkDialogHelper;
|
||||
import com.gh.gamecenter.common.base.fragment.BaseFragment;
|
||||
import com.gh.gamecenter.common.utils.DialogHelper;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
@ -162,7 +163,8 @@ public class GameDownloadFragment extends BaseFragment implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
if (downloadEntity.getStatus() == DownloadStatus.neterror
|
||||
|| downloadEntity.getStatus() == DownloadStatus.diskisfull) {
|
||||
|| downloadEntity.getStatus() == DownloadStatus.diskisfull
|
||||
|| downloadEntity.getStatus() == DownloadStatus.diskioerror) {
|
||||
adapter.notifyItemChanged(adapter.getBase());
|
||||
}
|
||||
} else {
|
||||
@ -198,6 +200,10 @@ public class GameDownloadFragment extends BaseFragment implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (location != null && XapkUnzipStatus.FAILURE.name().equals(downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_STATUS))) {
|
||||
XapkDialogHelper.INSTANCE.showUnzipFailureDialog(requireContext(), downloadEntity, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.PackageInstaller;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.common.xapk.XapkDialogHelper;
|
||||
import com.gh.gamecenter.common.entity.IconFloat;
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils;
|
||||
import com.gh.gamecenter.feature.view.DownloadButton;
|
||||
@ -176,6 +177,12 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
DownloadStatus status = downloadEntity.getStatus();
|
||||
String xapkStatus = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_STATUS);
|
||||
if (status.equals(DownloadStatus.done)) {
|
||||
viewHolder.binding.dmItemTvSpeed.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc));
|
||||
viewHolder.binding.dmItemTvSpeed.setText("加载完成");
|
||||
// 重置点击事件避免复用问题
|
||||
viewHolder.binding.dmItemTvSpeed.setOnClickListener(null);
|
||||
viewHolder.binding.dmItemTvStartorpause.setText(R.string.install);
|
||||
|
||||
if (XapkUnzipStatus.UNZIPPING.name().equals(xapkStatus)) {
|
||||
// XAPK状态有几率在SUCCESS后返回UNZIPPING, 此处对UNZIPPING之前的状态做一个判断
|
||||
if (XapkUnzipStatus.SUCCESS.name().equals(xapkStatusMap.get(downloadEntity.getUrl()))) {
|
||||
@ -195,8 +202,11 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
viewHolder.binding.dmItemTvStartorpause.setProgress((int) (downloadEntity.getPercent() * 10));
|
||||
viewHolder.binding.dmItemTvSpeed.setTextColor(ContextCompat.getColor(mContext, R.color.theme_red));
|
||||
viewHolder.binding.dmItemTvSpeed.setText("解压失败");
|
||||
viewHolder.binding.dmItemTvSpeed.setOnClickListener(v -> {
|
||||
XapkDialogHelper.INSTANCE.showUnzipFailureDialog(mContext, downloadEntity, true);
|
||||
});
|
||||
ExtensionsKt.enlargeTouchArea(viewHolder.binding.dmItemTvSpeed, 50);
|
||||
ExtensionsKt.setDrawableStart(viewHolder.binding.dmItemTvSpeed, R.drawable.unzip_failure_hint, null, null);
|
||||
return;
|
||||
} else if (XapkUnzipStatus.SUCCESS.name().equals(xapkStatus)) {
|
||||
viewHolder.binding.dmItemTvStartorpause.setButtonStyle(DownloadButton.ButtonStyle.XAPK_SUCCESS);
|
||||
viewHolder.binding.dmItemTvStartorpause.setProgress(1000);
|
||||
@ -205,9 +215,6 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
if (xapkStatus != null && !xapkStatus.isEmpty()) {
|
||||
xapkStatusMap.put(downloadEntity.getUrl(), xapkStatus);
|
||||
}
|
||||
viewHolder.binding.dmItemTvSpeed.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc));
|
||||
viewHolder.binding.dmItemTvSpeed.setText("加载完成");
|
||||
viewHolder.binding.dmItemTvStartorpause.setText(R.string.install);
|
||||
|
||||
if (downloadEntity.isPluggable()
|
||||
&& PackagesManager.isInstalled(downloadEntity.getPackageName())) {
|
||||
@ -232,6 +239,7 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
|| status.equals(DownloadStatus.timeout)
|
||||
|| status.equals(DownloadStatus.neterror)
|
||||
|| status.equals(DownloadStatus.diskisfull)
|
||||
|| status.equals(DownloadStatus.diskioerror)
|
||||
|| status.equals(DownloadStatus.subscribe)) {
|
||||
viewHolder.binding.dmItemTvStartorpause.setText(R.string.resume);
|
||||
viewHolder.binding.dmItemTvStartorpause.setButtonStyle(DownloadButton.ButtonStyle.NORMAL);
|
||||
@ -260,7 +268,8 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
if (XapkUnzipStatus.UNZIPPING.name().equals(xapkStatus)) {
|
||||
XapkInstaller.cancelUnzipTask(downloadEntity);
|
||||
return;
|
||||
} else if (XapkUnzipStatus.FAILURE.name().equals(xapkStatus)) {
|
||||
} else if (XapkUnzipStatus.FAILURE.name().equals(xapkStatus)
|
||||
|| XapkUnzipStatus.SUCCESS.name().equals(xapkStatus)) {
|
||||
PermissionHelper.checkStoragePermissionBeforeAction(mContext, () -> {
|
||||
final String path = downloadEntity.getPath();
|
||||
if (downloadEntity.isPluggable()
|
||||
@ -285,7 +294,7 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
case subscribe:
|
||||
PermissionHelper.checkStoragePermissionBeforeAction(mContext, () -> {
|
||||
// 下载管理不用判断是否大于50M
|
||||
DialogUtils.checkDownload(mContext, Float.toString(100F), isSubscribe -> {
|
||||
DialogUtils.checkDownload(mContext, Float.toString(100F), downloadEntity.getGameId(), downloadEntity.getName(), isSubscribe -> {
|
||||
if (isSubscribe) {
|
||||
DownloadManager.getInstance().subscribe(downloadEntity);
|
||||
statusMap.put(url, DownloadStatus.subscribe.getStatus());
|
||||
|
||||
@ -127,11 +127,12 @@ class InstalledGameViewModel(application: Application) : AndroidViewModel(applic
|
||||
}
|
||||
if (newEntity.getApk().size > 1) {
|
||||
for (apkEntity in newEntity.getApk()) {
|
||||
val packageName: String = sortedList.get(i).packageName
|
||||
val packageName: String = sortedList[i].packageName
|
||||
if (packageName == apkEntity.packageName) {
|
||||
val list = ArrayList<ApkEntity>()
|
||||
list.add(apkEntity)
|
||||
newEntity.setApk(list)
|
||||
newEntity.dropOtherApk()
|
||||
if (PackageUtils.isCanPluggable(apkEntity)) {
|
||||
val pluggableCollection =
|
||||
GameUtils.getPluggableCollectionFromGameEntity(
|
||||
|
||||
@ -26,7 +26,7 @@ import com.gh.gamecenter.feature.databinding.GameItemBinding
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils
|
||||
import com.gh.gamecenter.feature.game.GameItemViewHolder
|
||||
import com.gh.gamecenter.manager.PackagesManager.isInstalled
|
||||
import com.gh.gamecenter.manager.PackagesManager
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
import java.util.*
|
||||
|
||||
@ -120,7 +120,7 @@ class NewInstalledGameFragmentAdapter(context: Context, private var mViewModel:
|
||||
if (pluggableCollection != null && pluggableCollection.packages.contains(packageName)) {
|
||||
for (pkg in pluggableCollection.packages) {
|
||||
val ghId = PackageUtils.getGhId(pkg)
|
||||
if (isInstalled(pkg) && ghId != null && gameEntity.id == ghId.toString()) {
|
||||
if (PackagesManager.isInstalled(pkg) && ghId != null && gameEntity.id == ghId.toString()) {
|
||||
holder.binding.downloadBtn.setText(R.string.launch)
|
||||
holder.binding.downloadBtn.setBackgroundResource(R.drawable.download_button_normal_style)
|
||||
}
|
||||
|
||||
@ -19,6 +19,8 @@ import com.gh.download.DownloadManager
|
||||
import com.gh.download.dialog.DownloadDialog
|
||||
import com.gh.gamecenter.DownloadManagerActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.view.BugFixedPopupWindow
|
||||
import com.gh.gamecenter.core.utils.CurrentActivityHolder
|
||||
@ -132,7 +134,7 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) :
|
||||
if (itemData.divider == UpdatableGameViewModel.GREY) {
|
||||
holder.binding.container.setBackgroundColor(R.color.background.toColor(holder.binding.root.context))
|
||||
} else if (itemData.divider == UpdatableGameViewModel.BLUE) {
|
||||
holder.binding.container.setBackgroundColor(R.color.bg_F2F7FC.toColor(holder.binding.root.context))
|
||||
holder.binding.container.setBackgroundColor(R.color.update_other_version_highlight.toColor(holder.binding.root.context))
|
||||
} else {
|
||||
holder.binding.container.setBackgroundColor(R.color.background_white.toColor(holder.binding.root.context))
|
||||
}
|
||||
@ -163,7 +165,7 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) :
|
||||
}
|
||||
|
||||
if (itemData.otherVersionUpdate != null) {
|
||||
container.setBackgroundColor(R.color.bg_F2F7FC.toColor(context))
|
||||
container.setBackgroundColor(R.color.update_other_version_highlight.toColor(context))
|
||||
} else {
|
||||
container.setBackgroundColor(R.color.background_white.toColor(context))
|
||||
}
|
||||
@ -341,7 +343,9 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) :
|
||||
(CurrentActivityHolder.getCurrentActivity() as? FragmentActivity)?.checkStoragePermissionBeforeAction {
|
||||
DialogUtils.checkDownload(
|
||||
updateBtn.context,
|
||||
update.size
|
||||
update.size,
|
||||
downloadEntity?.gameId ?: "",
|
||||
downloadEntity?.name ?: ""
|
||||
) { isSubscribe: Boolean ->
|
||||
if (str.contains("化")) {
|
||||
if (update.pluggableCollection != null) {
|
||||
@ -397,6 +401,21 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) :
|
||||
updateBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
|
||||
}
|
||||
}
|
||||
|
||||
SensorsBridge.trackEvent(
|
||||
"DownLoadbuttonClick",
|
||||
"game_id", update.id,
|
||||
"game_name", update.name ?: "",
|
||||
"game_type", update.categoryChinese,
|
||||
"download_status", update.downloadStatusChinese,
|
||||
"button_name", str,
|
||||
"page_name", GlobalActivityManager.getCurrentPageEntity().pageName,
|
||||
"page_id", GlobalActivityManager.getCurrentPageEntity().pageId,
|
||||
"page_business_id", GlobalActivityManager.getCurrentPageEntity().pageBusinessId,
|
||||
"last_page_name", GlobalActivityManager.getLastPageEntity().pageName,
|
||||
"last_page_id", GlobalActivityManager.getLastPageEntity().pageId,
|
||||
"last_page_business_id", GlobalActivityManager.getLastPageEntity().pageBusinessId
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,16 +6,17 @@ import androidx.lifecycle.*
|
||||
import com.gh.common.exposure.ExposureUtils
|
||||
import com.gh.common.exposure.ExposureUtils.logADownloadExposureEvent
|
||||
import com.gh.common.history.HistoryHelper.insertGameEntity
|
||||
import com.gh.gamecenter.feature.utils.ApkActiveUtils
|
||||
import com.gh.common.util.DataCollectionUtils
|
||||
import com.gh.common.util.PackageInstaller.createDownloadId
|
||||
import com.gh.common.util.PackageInstaller.getDownloadPathWithId
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.common.base.BaseSimpleDao
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.retrofit.Response
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge.trackEvent
|
||||
import com.gh.gamecenter.common.utils.addMetaExtra
|
||||
import com.gh.gamecenter.common.utils.secondOrNull
|
||||
import com.gh.gamecenter.common.utils.toProperReadableSize
|
||||
@ -23,10 +24,12 @@ import com.gh.gamecenter.common.utils.tryCatchInRelease
|
||||
import com.gh.gamecenter.core.utils.GsonUtils.toJson
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.core.utils.UrlFilterUtils
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.entity.GameUpdateEntity
|
||||
import com.gh.gamecenter.feature.entity.PluginLocation
|
||||
import com.gh.gamecenter.eventbus.EBDownloadChanged
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.entity.PluginLocation
|
||||
import com.gh.gamecenter.feature.utils.ApkActiveUtils
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils
|
||||
import com.gh.gamecenter.manager.PackagesManager
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.halo.assistant.HaloApp
|
||||
@ -586,6 +589,8 @@ class UpdatableGameViewModel(
|
||||
downloadEntity.addMetaExtra(Constants.GAME_ICON_SUBSCRIPT, update.iconSubscript)
|
||||
downloadEntity.addMetaExtra(Constants.DOWNLOAD_ID, downloadId)
|
||||
downloadEntity.addMetaExtra(Constants.APK_MD5, update.md5)
|
||||
downloadEntity.addMetaExtra(Constants.GAME_NAME, update.name)
|
||||
downloadEntity.addMetaExtra(Constants.GAME_TYPE, update.categoryChinese)
|
||||
if (update.iconFloat != null) {
|
||||
downloadEntity.addMetaExtra(Constants.GAME_ICON_FLOAT_TOP_TEXT, update.iconFloat?.upperLeftText)
|
||||
downloadEntity.addMetaExtra(Constants.GAME_ICON_FLOAT_TOP_COLOR, update.iconFloat?.upperLeftColor)
|
||||
@ -634,6 +639,19 @@ class UpdatableGameViewModel(
|
||||
|
||||
// 收集下载数据
|
||||
DataCollectionUtils.uploadDownload(getApplication(), downloadEntity, "开始")
|
||||
|
||||
trackEvent(
|
||||
"DownloadProcessBegin",
|
||||
"game_id", update.id,
|
||||
"game_name", update.name ?: "",
|
||||
"game_type", update.categoryChinese,
|
||||
"page_name", getCurrentPageEntity().pageName,
|
||||
"page_id", getCurrentPageEntity().pageId,
|
||||
"page_business_id", getCurrentPageEntity().pageBusinessId,
|
||||
"last_page_name", getLastPageEntity().pageName,
|
||||
"last_page_id", getLastPageEntity().pageId,
|
||||
"last_page_business_id", getLastPageEntity().pageBusinessId
|
||||
)
|
||||
}
|
||||
|
||||
private fun sizeStringToLong(sizeString: String): Long {
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
package com.gh.gamecenter.energy
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.gamecenter.MainActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IEnergyTaskProvider
|
||||
|
||||
/**
|
||||
* 与光能模块桥接的桥
|
||||
*/
|
||||
object EnergyBridge {
|
||||
|
||||
private val mEnergyTaskHelp by lazy {
|
||||
ARouter.getInstance().build(RouteConsts.provider.energyTask).navigation() as? IEnergyTaskProvider
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun postEnergyTaskForShare(type: String, id: String, url: String) {
|
||||
mEnergyTaskHelp?.postEnergyTaskForShare(type, id, url)
|
||||
}
|
||||
|
||||
fun postEnergyTask(action: String) {
|
||||
mEnergyTaskHelp?.postEnergyTask(action)
|
||||
}
|
||||
|
||||
fun postInviteCodeTask(code: String, from: String, callback: (() -> Unit)?) {
|
||||
mEnergyTaskHelp?.postInviteCodeTask(code, from, callback)
|
||||
}
|
||||
|
||||
fun postEnergyTask(action: String, id: String?) {
|
||||
mEnergyTaskHelp?.postEnergyTask(action, id)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun postEnergyTask(action: String, id: String, packageName: String) {
|
||||
mEnergyTaskHelp?.postEnergyTask(action, id, packageName)
|
||||
}
|
||||
|
||||
fun postEnergyTask(action: String, id: String?, packageName: String?, url: String?) {
|
||||
mEnergyTaskHelp?.postEnergyTask(action, id, packageName, url)
|
||||
}
|
||||
|
||||
fun getEnergyCenterIntent(context: Context?): Intent {
|
||||
return mEnergyTaskHelp?.getEnergyCenterIntent(context) ?: Intent(context, MainActivity::class.java)
|
||||
}
|
||||
|
||||
fun getEnergyCenterIntent(context: Context?, initTabIndex: Int): Intent {
|
||||
return mEnergyTaskHelp?.getEnergyCenterIntent(context, initTabIndex) ?: Intent(
|
||||
context,
|
||||
MainActivity::class.java
|
||||
)
|
||||
}
|
||||
|
||||
fun getEnergyHouseIntent(context: Context?, categoryId: String?): Intent {
|
||||
return mEnergyTaskHelp?.getEnergyHouseIntent(context, categoryId) ?: Intent(context, MainActivity::class.java)
|
||||
}
|
||||
|
||||
}
|
||||
@ -11,6 +11,8 @@ class AppEntity(
|
||||
@SerializedName("version_code")
|
||||
var versionCode: Int = 0,
|
||||
|
||||
var category: String? = "",
|
||||
|
||||
var url: String? = null,
|
||||
|
||||
var size: String? = null,
|
||||
@ -31,6 +33,8 @@ class AppEntity(
|
||||
* EVERY_TIME_OPEN(每次打开)
|
||||
*/
|
||||
var alert: String? = null,
|
||||
// 关联64位更新
|
||||
var relation: AppEntity? = null
|
||||
) : Parcelable {
|
||||
fun isAlertEveryTime() = alert == "EVERY_TIME_OPEN"
|
||||
|
||||
|
||||
15
app/src/main/java/com/gh/gamecenter/entity/BlockEntity.kt
Normal file
15
app/src/main/java/com/gh/gamecenter/entity/BlockEntity.kt
Normal file
@ -0,0 +1,15 @@
|
||||
package com.gh.gamecenter.entity
|
||||
|
||||
import com.gh.gamecenter.common.entity.LinkEntity
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
class BlockEntity(
|
||||
@SerializedName("block_slide")
|
||||
val slides: ArrayList<LinkEntity>? = null,
|
||||
@SerializedName("block_recommend")
|
||||
val recommends: ArrayList<SubjectRecommendEntity>? = null,
|
||||
@SerializedName("block_column")
|
||||
val columns: ArrayList<SubjectEntity>? = null,
|
||||
@SerializedName("block_navigation")
|
||||
val navigation: GameNavigationWrapper? = null,
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user