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
a25370d3
Commit
a25370d3
authored
Aug 23, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: deviceid 发布远程仓库v1版
parent
a1c9a63b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
57 deletions
+2
-57
build.gradle
build.gradle
+1
-1
DeviceTool.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
+0
-37
DeviceUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceUtils.kt
+1
-6
ActionCountUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
+0
-13
No files found.
build.gradle
View file @
a25370d3
...
...
@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version
=
'1.2.3'
constrait_support_version
=
'1.0.2'
componentVersion
=
"0.3.0.4
0
-SNAPSHOT"
componentVersion
=
"0.3.0.4
2.1
-SNAPSHOT"
}
repositories
{
mavenCentral
()
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
View file @
a25370d3
...
...
@@ -2,7 +2,6 @@ package com.ydl.ydlcommon.utils;
import
static
com
.
umeng
.
socialize
.
utils
.
ContextUtil
.
getPackageName
;
import
android.Manifest
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.content.ComponentName
;
...
...
@@ -21,7 +20,6 @@ import android.telephony.TelephonyManager;
import
android.text.TextUtils
;
import
android.util.Log
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.ydl.ydlcommon.BuildConfig
;
import
com.yidianling.common.tools.RxTool
;
...
...
@@ -108,41 +106,6 @@ public class DeviceTool {
}
/**
* 获取手机IMEI
*
* @return
*/
@SuppressLint
(
"MissingPermission"
)
public
static
final
String
getIMEI
()
{
Activity
topTaskActivity
=
ActivityManager
.
Companion
.
getInstance
().
getTopTaskActivity
();
if
(
checkHasAgreeSecret
())
{
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
();
if
(
imei
==
null
)
{
return
""
;
}
}
return
RxTool
.
Md5
(
imei
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
""
;
}
}
else
{
return
""
;
}
}
/**
* 检查是否同意隐私协议
* */
public
static
boolean
checkHasAgreeSecret
()
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceUtils.kt
View file @
a25370d3
...
...
@@ -13,7 +13,6 @@ import android.net.Uri
import
android.os.Build
import
android.os.Environment
import
android.os.PowerManager
import
android.telephony.TelephonyManager
import
android.text.TextUtils
import
android.util.DisplayMetrics
import
android.util.Log
...
...
@@ -22,10 +21,10 @@ import android.view.View
import
android.view.ViewConfiguration
import
android.view.WindowManager
import
android.view.inputmethod.InputMethodManager
import
java.io.File
import
java.lang.reflect.Field
import
java.text.NumberFormat
/**
* Created by haorui on 2019-08-22 .
* Des: 设备信息工具类
...
...
@@ -567,10 +566,6 @@ class DeviceUtils private constructor() {
context
.
startActivity
(
intent
)
}
fun
getIMEI
(
context
:
Context
):
String
{
val
tel
=
context
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
)
as
TelephonyManager
return
tel
.
deviceId
}
val
phoneType
:
String
get
()
=
Build
.
MODEL
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
View file @
a25370d3
...
...
@@ -143,12 +143,6 @@ class ActionCountUtils {
actionDataParams
.
osVersion
(
Build
.
VERSION
.
RELEASE
)
actionDataParams
.
wifi
(
if
(
isWifi
())
0
else
1
)
var
deviceId
=
""
/*
* 因为DeviceIDHelper.getInstance().deviceId对于imei
* 序列号对于小米手机Utils.getIMEI(context)
* 第一次安装获取失败,第二次打开就能成功
* 所以Utils.getIMEI(topTaskActivity)传入activity解决这个问题
* */
if
(
DeviceTool
.
checkHasAgreeSecret
())
{
deviceId
=
DeviceIDHelper
.
getInstance
().
deviceId
}
...
...
@@ -254,13 +248,6 @@ class ActionCountUtils {
baiduActionDataParams
.
pkname
=
packageName
baiduActionDataParams
.
deviceType
=
2
var
deviceId
=
""
/*
* 因为DeviceIDHelper.getInstance().deviceId对于imei
* 序列号对于小米手机Utils.getIMEI(context)
* 第一次安装获取失败,第二次打开就能成功
* 所以Utils.getIMEI(topTaskActivity)传入activity解决这个问题
* */
if
(
DeviceTool
.
checkHasAgreeSecret
())
{
deviceId
=
DeviceIDHelper
.
getInstance
().
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