Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
1fe2ddf1
Commit
1fe2ddf1
authored
Aug 22, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: deviceid问题修复
parent
4f8ada71
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
41 deletions
+10
-41
build.gradle
build.gradle
+1
-1
config.gradle
config.gradle
+1
-1
YdlRepository.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/app/YdlRepository.kt
+1
-2
ActionCountUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
+7
-37
No files found.
build.gradle
View file @
1fe2ddf1
...
...
@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version
=
'1.2.3'
constrait_support_version
=
'1.0.2'
componentVersion
=
"0.3.0.40"
componentVersion
=
"0.3.0.40
-SNAPSHOT
"
}
repositories
{
mavenCentral
()
...
...
config.gradle
View file @
1fe2ddf1
...
...
@@ -164,7 +164,7 @@ ext {
"blankUtil"
:
"com.blankj:utilcode:1.25.9"
,
"ydl-hnet"
:
"com.ydl:h-net:0.0.8"
,
"ydl-user-router"
:
"com.ydl:router:1.0.0-SNAPSHOT@aar"
,
"ydl-device"
:
"com.ydl:device-id:0.0.3
1
"
,
"ydl-device"
:
"com.ydl:device-id:0.0.3
3
"
,
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.57@aar"
,
//flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/app/YdlRepository.kt
View file @
1fe2ddf1
...
...
@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import
android.app.Application
import
android.os.Build
import
com.alibaba.android.arouter.launcher.ARouter
import
com.bun.miitmdid.core.JLibrary
import
com.tencent.mmkv.MMKV
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.http.UpLoadLogUtils
...
...
@@ -28,7 +27,7 @@ object YdlRepository {
// 需要在主 module 的 application 的 onCreate 方法中调用此方法
fun
initApp
(
app
:
Application
,
isDebug
:
Boolean
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
JLibrary
.
InitEntry
(
app
)
System
.
loadLibrary
(
"msaoaidsec"
)
}
MMKV
.
initialize
(
app
);
LogHelper
.
getInstance
().
deleteExpireLogSync
()
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
View file @
1fe2ddf1
...
...
@@ -11,14 +11,12 @@ import android.text.TextUtils
import
android.util.Log
import
com.google.gson.Gson
import
com.ydl.devicesidlib.DeviceIDHelper
import
com.ydl.devicesidlib.Utils
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.http.api.ApiRequestUtil
import
com.ydl.ydlcommon.data.http.params.ActionDataBean
import
com.ydl.ydlcommon.data.http.params.BaiduActionDataBean
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.DeviceTool
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxDeviceTool
...
...
@@ -151,15 +149,8 @@ class ActionCountUtils {
* 第一次安装获取失败,第二次打开就能成功
* 所以Utils.getIMEI(topTaskActivity)传入activity解决这个问题
* */
if
(
DeviceTool
.
checkHasAgreeSecret
()){
deviceId
=
if
(
Build
.
VERSION
.
SDK_INT
<=
Build
.
VERSION_CODES
.
P
)
{
val
topTaskActivity
=
ActivityManager
.
getInstance
().
getTopTaskActivity
()
//获取imei
Utils
.
getIMEI
(
topTaskActivity
)
}
else
{
//android Q及以上取oaid
DeviceIDHelper
.
getInstance
().
deviceId
}
if
(
DeviceTool
.
checkHasAgreeSecret
())
{
deviceId
=
DeviceIDHelper
.
getInstance
().
deviceId
}
actionDataParams
.
deviceId
(
deviceId
)
...
...
@@ -271,14 +262,7 @@ class ActionCountUtils {
* */
if
(
DeviceTool
.
checkHasAgreeSecret
())
{
deviceId
=
if
(
Build
.
VERSION
.
SDK_INT
<=
Build
.
VERSION_CODES
.
P
)
{
val
topTaskActivity
=
ActivityManager
.
getInstance
().
getTopTaskActivity
()
//获取imei
Utils
.
getIMEI
(
topTaskActivity
)
}
else
{
//android Q及以上取oaid
DeviceIDHelper
.
getInstance
().
deviceId
}
deviceId
=
DeviceIDHelper
.
getInstance
().
deviceId
}
//外部参数添加deviceid
actionDataParams
.
deviceId
(
deviceId
)
...
...
@@ -355,18 +339,11 @@ class ActionCountUtils {
actionDataParams
.
api
=
api
actionDataParams
.
appVersion
(
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
var
deviceId
=
""
if
(
DeviceTool
.
checkHasAgreeSecret
()){
deviceId
=
if
(
Build
.
VERSION
.
SDK_INT
<=
Build
.
VERSION_CODES
.
P
)
{
val
topTaskActivity
=
ActivityManager
.
getInstance
().
getTopTaskActivity
()
//获取imei
Utils
.
getIMEI
(
topTaskActivity
)
}
else
{
//android Q及以上取oaid
DeviceIDHelper
.
getInstance
().
deviceId
}
if
(
DeviceTool
.
checkHasAgreeSecret
())
{
deviceId
=
DeviceIDHelper
.
getInstance
().
deviceId
}
actionDataParams
.
deviceId
=
deviceId
actionDataParams
.
deviceId
=
deviceId
actionDataParams
.
time
(
System
.
currentTimeMillis
())
actionDataParams
.
appId
(
appId
)
...
...
@@ -406,14 +383,7 @@ class ActionCountUtils {
actionDataParams
.
appVersion
(
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
var
deviceId
=
""
if
(
DeviceTool
.
checkHasAgreeSecret
())
{
deviceId
=
if
(
Build
.
VERSION
.
SDK_INT
<=
Build
.
VERSION_CODES
.
P
)
{
val
topTaskActivity
=
ActivityManager
.
getInstance
().
getTopTaskActivity
()
//获取imei
Utils
.
getIMEI
(
topTaskActivity
)
}
else
{
//android Q及以上取oaid
DeviceIDHelper
.
getInstance
().
deviceId
}
deviceId
=
DeviceIDHelper
.
getInstance
().
deviceId
}
actionDataParams
.
deviceId
=
deviceId
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment