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
e202a05c
Commit
e202a05c
authored
Jun 22, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 2.1.2和规划整改
parent
ebd09841
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
20 deletions
+102
-20
config.gradle
config.gradle
+4
-4
NetworkUtil.java
m-im/src/main/java/com/yidianling/avchatkit/common/util/NetworkUtil.java
+5
-0
SecretActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/SecretActivity.kt
+1
-5
DeviceTool.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
+92
-11
No files found.
config.gradle
View file @
e202a05c
...
...
@@ -11,7 +11,7 @@ ext {
"m-user"
:
"0.0.61.90"
,
"m-user-medical"
:
"0.0.61.99"
,
"m-home"
:
"0.0.22.70"
,
"m-im-medical"
:
"0.0.21.3
1
"
,
"m-im-medical"
:
"0.0.21.3
2
"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -34,7 +34,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.4
0.7
3"
,
"ydl-platform"
:
"0.0.4
1.4
3"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.57"
,
...
...
@@ -96,7 +96,7 @@ ext {
"m-user"
:
"0.0.61.90"
,
"m-user-medical"
:
"0.0.61.99"
,
"m-home"
:
"0.0.22.70"
,
"m-im-medical"
:
"0.0.21.3
1
"
,
"m-im-medical"
:
"0.0.21.3
2
"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.8"
,
...
...
@@ -118,7 +118,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.4
0.7
3"
,
"ydl-platform"
:
"0.0.4
1.4
3"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.57"
,
...
...
m-im/src/main/java/com/yidianling/avchatkit/common/util/NetworkUtil.java
View file @
e202a05c
...
...
@@ -11,6 +11,7 @@ import android.os.Build;
import
android.telephony.TelephonyManager
;
import
android.text.TextUtils
;
import
com.ydl.ydlcommon.utils.DeviceTool
;
import
com.ydl.ydlcommon.utils.log.AliYunLogConfig
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
...
...
@@ -543,6 +544,10 @@ public class NetworkUtil {
*/
public
static
String
getActiveMacAddress
(
Context
context
)
{
if
(!
DeviceTool
.
checkHasAgreeSecret
())
{
return
""
;
}
WifiManager
wifi
=
(
WifiManager
)
context
.
getSystemService
(
Context
.
WIFI_SERVICE
);
WifiInfo
info
=
wifi
.
getConnectionInfo
();
...
...
m-user/src/main/java/com/yidianling/user/ui/login/SecretActivity.kt
View file @
e202a05c
...
...
@@ -21,7 +21,6 @@ import kotlinx.android.synthetic.main.user_activity_secret.*
class
SecretActivity
:
BaseActivity
()
{
private
var
secretDialog
:
SecretDialog
?
=
null
private
var
mSecretProtocolString
:
String
=
""
companion
object
{
val
SECRET_PROTOCOL
:
String
=
"secret_protocol"
...
...
@@ -47,10 +46,7 @@ class SecretActivity : BaseActivity() {
}
private
fun
getParam
()
{
mSecretProtocolString
=
intent
.
getStringExtra
(
SECRET_PROTOCOL
)
?:
""
if
(
null
!=
user_secret_desc
)
{
// user_secret_desc.text = Html.fromHtml(mSecretProtocolString)
}
}
private
fun
initView
()
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
View file @
e202a05c
...
...
@@ -20,8 +20,8 @@ import android.text.TextUtils;
import
android.util.Log
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.yidianling.common.tools.RxTool
;
import
com.ydl.ydlcommon.BuildConfig
;
import
com.yidianling.common.tools.RxTool
;
import
java.io.BufferedReader
;
import
java.io.FileReader
;
...
...
@@ -93,7 +93,7 @@ public class DeviceTool {
private
static
void
gotoMeizuPermission
(
Activity
activity
)
{
Intent
intent
=
new
Intent
(
"com.meizu.safe.security.SHOW_APPSEC"
);
intent
.
addCategory
(
Intent
.
CATEGORY_DEFAULT
);
intent
.
putExtra
(
"packageName"
,
BuildConfig
.
APPLICATION_ID
);
intent
.
putExtra
(
"packageName"
,
getPackageName
()
);
try
{
activity
.
startActivity
(
intent
);
}
catch
(
Exception
e
)
{
...
...
@@ -122,7 +122,9 @@ public class DeviceTool {
@SuppressLint
(
"MissingPermission"
)
public
static
final
String
getIMEI
()
{
Activity
topTaskActivity
=
ActivityManager
.
Companion
.
getInstance
().
getTopTaskActivity
();
if
(!
checkHasAgreeSecret
())
{
return
""
;
}
try
{
String
imei
=
""
;
RxPermissions
rxPermissions
=
new
RxPermissions
(
topTaskActivity
);
...
...
@@ -130,7 +132,7 @@ public class DeviceTool {
if
(
rxPermissions
.
isGranted
(
Manifest
.
permission
.
READ_PHONE_STATE
))
{
//实例化TelephonyManager对象
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
topTaskActivity
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
if
(
null
==
telephonyManager
){
if
(
null
==
telephonyManager
)
{
return
""
;
}
//获取IMEI号
...
...
@@ -150,6 +152,10 @@ public class DeviceTool {
public
static
String
getEncryptionAndroidID
()
{
if
(!
checkHasAgreeSecret
())
{
return
""
;
}
try
{
@SuppressLint
(
"HardwareIds"
)
String
id
=
Settings
.
Secure
.
getString
(
RxTool
.
getContext
().
getContentResolver
(),
...
...
@@ -160,7 +166,12 @@ public class DeviceTool {
return
""
;
}
}
public
static
String
getAndroidID
()
{
if
(!
checkHasAgreeSecret
())
{
return
""
;
}
try
{
@SuppressLint
(
"HardwareIds"
)
String
id
=
Settings
.
Secure
.
getString
(
RxTool
.
getContext
().
getContentResolver
(),
...
...
@@ -238,7 +249,7 @@ public class DeviceTool {
case
TelephonyManager
.
NETWORK_TYPE_LTE
:
return
NETWORN_4G
;
default
:
//中国移动 联通 电信 三种3G制式
//中国移动 联通 电信 三种3G制式
if
(
strSubTypeName
.
equalsIgnoreCase
(
"TD-SCDMA"
)
||
strSubTypeName
.
equalsIgnoreCase
(
"WCDMA"
)
||
strSubTypeName
.
equalsIgnoreCase
(
"CDMA2000"
))
{
return
NETWORN_3G
;
}
else
{
...
...
@@ -251,6 +262,9 @@ public class DeviceTool {
}
public
static
String
getMac
(
Context
context
)
{
if
(!
checkHasAgreeSecret
())
{
return
"02:00:00:00:00:00"
;
}
String
strMac
=
null
;
...
...
@@ -276,11 +290,16 @@ public class DeviceTool {
return
"02:00:00:00:00:00"
;
}
/*
* 获取MAC地址
*GPRS链接和WIFI链接返回同一个MAC地址
* */
* 获取MAC地址
*GPRS链接和WIFI链接返回同一个MAC地址
* */
public
static
String
getMacFromHardware
()
{
if
(!
checkHasAgreeSecret
())
{
return
"02:00:00:00:00:00"
;
}
try
{
List
<
NetworkInterface
>
all
=
Collections
.
list
(
NetworkInterface
.
getNetworkInterfaces
());
for
(
NetworkInterface
nif
:
all
)
{
...
...
@@ -306,8 +325,8 @@ public class DeviceTool {
}
return
"02:00:00:00:00:00"
;
}
/**
*
* 将ip的整数形式转换成ip形式
*
* @param ipInt
...
...
@@ -321,6 +340,7 @@ public class DeviceTool {
sb
.
append
((
ipInt
>>
24
)
&
0xFF
);
return
sb
.
toString
();
}
/**
* 获取WIFI当前ip地址
*
...
...
@@ -328,6 +348,10 @@ public class DeviceTool {
* @return
*/
public
static
String
getLocalWifiIpAddress
(
Context
context
)
{
if
(!
checkHasAgreeSecret
())
{
return
"隐私协议未同意,不让获取"
;
}
try
{
WifiManager
wifiManager
=
(
WifiManager
)
context
...
...
@@ -343,6 +367,10 @@ public class DeviceTool {
//GPRS连接下的ip
public
static
String
getLocalGPRSIpAddress
()
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
try
{
for
(
Enumeration
<
NetworkInterface
>
en
=
NetworkInterface
.
getNetworkInterfaces
();
en
.
hasMoreElements
();
)
{
NetworkInterface
intf
=
en
.
nextElement
();
...
...
@@ -361,9 +389,14 @@ public class DeviceTool {
/**
* 通过网络接口取MAC地址
*
* @return
*/
public
static
String
getNewMac
()
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
try
{
List
<
NetworkInterface
>
all
=
Collections
.
list
(
NetworkInterface
.
getNetworkInterfaces
());
for
(
NetworkInterface
nif
:
all
)
{
...
...
@@ -389,17 +422,27 @@ public class DeviceTool {
}
return
null
;
}
public
static
String
getLocalMacAddressFromWifiInfo
(
Context
context
)
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
WifiManager
wifi
=
(
WifiManager
)
context
.
getSystemService
(
Context
.
WIFI_SERVICE
);
WifiInfo
winfo
=
wifi
.
getConnectionInfo
();
String
mac
=
winfo
.
getMacAddress
();
return
mac
;
}
/*
* 获取IPV6地址
* */
* 获取IPV6地址
* */
public
static
String
getLocalIpV6
()
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
try
{
for
(
Enumeration
<
NetworkInterface
>
en
=
NetworkInterface
.
getNetworkInterfaces
();
en
.
hasMoreElements
();
)
{
...
...
@@ -424,7 +467,11 @@ public class DeviceTool {
}
return
null
;
}
public
static
String
getMacAddress
(
Context
context
)
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
// 如果是6.0以下,直接通过wifimanager获取
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
)
{
...
...
@@ -465,6 +512,10 @@ public class DeviceTool {
}
private
static
String
getMacAddress0
(
Context
context
)
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
if
(
isAccessWifiStateAuthorized
(
context
))
{
WifiManager
wifiMgr
=
(
WifiManager
)
context
.
getSystemService
(
Context
.
WIFI_SERVICE
);
...
...
@@ -522,6 +573,10 @@ public class DeviceTool {
* @return
*/
public
static
String
getMacAddress
()
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
String
strMacAddr
=
null
;
try
{
// 获得IpD地址
...
...
@@ -541,12 +596,17 @@ public class DeviceTool {
}
return
strMacAddr
;
}
/**
* 获取移动设备本地IP
*
* @return
*/
private
static
InetAddress
getLocalInetAddress
()
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
InetAddress
ip
=
null
;
try
{
// 列举
...
...
@@ -582,6 +642,10 @@ public class DeviceTool {
* @return
*/
public
static
String
getLocalIpAddress
()
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
try
{
for
(
Enumeration
<
NetworkInterface
>
en
=
NetworkInterface
.
getNetworkInterfaces
();
en
.
hasMoreElements
();
)
{
...
...
@@ -601,6 +665,10 @@ public class DeviceTool {
}
public
static
String
getMachineHardwareAddress
()
{
if
(!
checkHasAgreeSecret
())
{
return
null
;
}
Enumeration
<
NetworkInterface
>
interfaces
=
null
;
try
{
interfaces
=
NetworkInterface
.
getNetworkInterfaces
();
...
...
@@ -646,6 +714,10 @@ public class DeviceTool {
}
public
static
String
getLocalMacAddressFromBusybox
()
{
if
(!
checkHasAgreeSecret
())
{
return
""
;
}
String
result
=
""
;
String
Mac
=
""
;
result
=
callCmd
(
"busybox ifconfig"
,
"HWaddr"
);
...
...
@@ -683,4 +755,13 @@ public class DeviceTool {
return
result
;
}
/**
* 检查是否同意隐私协议
*/
public
static
boolean
checkHasAgreeSecret
()
{
String
hasAgreeSecret
=
SharedPreferencesEditor
.
getString
(
"hasAgreeSecret"
);
return
"true"
.
equals
(
hasAgreeSecret
);
}
}
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