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
f62e8d62
Commit
f62e8d62
authored
Jul 21, 2022
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 埋点工具重新封装
parent
871e8507
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
22 deletions
+15
-22
DeviceTool.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
+13
-20
ActionCountUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
+2
-2
No files found.
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
View file @
f62e8d62
...
...
@@ -21,6 +21,7 @@ import android.util.Log;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.ydl.ydlcommon.BuildConfig
;
import
com.ydl.ydlcommon.base.BaseApp
;
import
com.yidianling.common.tools.RxTool
;
import
java.io.BufferedReader
;
...
...
@@ -119,28 +120,20 @@ public class DeviceTool {
*
* @return
*/
@SuppressLint
(
"MissingPermission"
)
public
static
final
String
getIMEI
()
{
Activity
topTaskActivity
=
ActivityManager
.
Companion
.
getInstance
().
getTopTaskActivity
();
if
(!
checkHasAgreeSecret
())
{
return
""
;
}
@SuppressLint
({
"MissingPermission"
,
"HardwareIds"
})
public
static
String
getIMEI
()
{
try
{
String
imei
=
""
;
RxPermissions
rxPermissions
=
new
RxPermissions
(
topTaskActivity
);
if
(
rxPermissions
.
isGranted
(
Manifest
.
permission
.
READ_PHONE_STATE
))
{
//实例化TelephonyManager对象
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
topTaskActivity
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
if
(
null
==
telephonyManager
)
{
return
""
;
}
//获取IMEI号
imei
=
telephonyManager
.
getDeviceId
();
String
imei
;
//实例化TelephonyManager对象
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
BaseApp
.
instance
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
if
(
null
==
telephonyManager
)
{
return
""
;
}
//获取IMEI号
imei
=
telephonyManager
.
getDeviceId
();
if
(
imei
==
null
)
{
return
""
;
}
if
(
imei
==
null
)
{
return
""
;
}
return
RxTool
.
Md5
(
imei
);
}
catch
(
Exception
e
)
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
View file @
f62e8d62
...
...
@@ -7,11 +7,11 @@ import android.net.NetworkInfo
import
android.net.wifi.WifiManager
import
android.os.Build
import
com.umeng.commonsdk.UMConfigure
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.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.DeviceTool
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxTool
...
...
@@ -110,7 +110,7 @@ class ActionCountUtils {
actionDataParams
.
appVersion
(
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()))
val
deviceId
=
if
(
Build
.
VERSION
.
SDK_INT
<=
Build
.
VERSION_CODES
.
P
)
{
//获取imei
Utils
.
getIMEI
(
BaseApp
.
instance
)
DeviceTool
.
getIMEI
(
)
}
else
{
//android Q及以上取oaid
oaId
...
...
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