Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
eagleEye
/
eagleEye-udf
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d6da180a
authored
Mar 25, 2025
by
魏建枢
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
设备IDv0版本
parent
3daa838d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
eagleEye-udf/src/main/java/com/cloud/udf/util/GenDeviceIdV0.java
eagleEye-udf/src/main/java/com/cloud/udf/util/GenDeviceIdV0.java
0 → 100644
View file @
d6da180a
package
com
.
cloud
.
udf
.
util
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.collections.CollectionUtils
;
import
com.cloud.udf.vo.device.android.AndroidCollectionBody
;
import
com.cloud.udf.vo.device.android.deviceInfo.AndroidA1
;
import
com.cloud.udf.vo.device.android.deviceInfo.D3
;
import
com.cloud.udf.vo.device.ios.IosCollectionBody
;
import
com.cloud.udf.vo.device.ios.IosDeviceInfo
;
/**
* @author wjs
* @version 创建时间:2025-3-25 17:53:21
* 类说明
*/
public
class
GenDeviceIdV0
{
private
final
static
String
SALT
=
"yylmfy6iehjzmq"
;
public
static
String
genAndroidDeviceIdHashV1
(
AndroidCollectionBody
androidBodyObj
)
{
System
.
out
.
println
(
"GenDeviceIdV1 genAndroidDeviceIdHashV1 start!"
);
StringBuilder
sbD3
=
new
StringBuilder
();
StringBuilder
sbDevicId
=
new
StringBuilder
();
AndroidA1
a1
=
new
AndroidA1
();
List
<
D3
>
d3List
=
new
ArrayList
<>();
if
(
androidBodyObj
!=
null
)
{
a1
=
androidBodyObj
.
getA1
();
if
(
a1
!=
null
)
{
d3List
=
a1
.
getD3
();
if
(
CollectionUtils
.
isEmpty
(
d3List
))
{
d3List
=
new
ArrayList
<>();
}
}
else
{
a1
=
new
AndroidA1
();
}
}
for
(
D3
d3
:
d3List
)
{
sbD3
.
append
(
d3
.
toString
()).
append
(
":"
);
}
sbDevicId
.
append
(
a1
.
getB6
()).
append
(
"/"
);
sbDevicId
.
append
(
a1
.
getB2
()).
append
(
"/"
);
sbDevicId
.
append
(
a1
.
getB15
()).
append
(
"/"
);
sbDevicId
.
append
(
a1
.
getB1
()).
append
(
"/"
);
sbDevicId
.
append
(
a1
.
getB3
()).
append
(
"/"
);
sbDevicId
.
append
(
a1
.
getB14
()).
append
(
"/"
);
sbDevicId
.
append
(
a1
.
getB8
()).
append
(
"/"
);
// sbDevicId.append(Build.FINGERPRINT).append("/");
sbDevicId
.
append
(
a1
.
getD4
().
split
(
"&"
)[
0
]).
append
(
"/"
);
sbDevicId
.
append
(
a1
.
getC3
()).
append
(
"/"
);
System
.
out
.
println
(
"GenDeviceIdV1 genAndroidDeviceIdHashV1 end! body:"
+
null
+
":"
+
sbD3
.
toString
()
+
":"
+
sbDevicId
.
toString
());
return
Md5Utils
.
string2MD5
(
null
+
":"
+
sbD3
.
toString
()
+
":"
+
sbDevicId
.
toString
());
}
public
static
String
genIosDeviceIdHash
(
IosCollectionBody
iosBodyObj
)
{
System
.
out
.
println
(
"GenDeviceIdV1 genIosDeviceIdHash start!"
);
StringBuilder
sb
=
new
StringBuilder
();
IosDeviceInfo
a1
=
new
IosDeviceInfo
();
if
(
null
!=
iosBodyObj
)
{
a1
=
iosBodyObj
.
getA1
();
if
(
null
==
a1
)
{
a1
=
new
IosDeviceInfo
();
}
}
sb
.
append
(
a1
.
getAp1
())
.
append
(
a1
.
getAp5
())
;
System
.
out
.
println
(
"GenDeviceIdV1 genIosDeviceIdHash end! body:"
+
sb
.
toString
());
return
(
HashUtil
.
genKeyHash
(
sb
.
toString
())+
SALT
).
toLowerCase
();
}
}
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