Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fairyland
Project
Project
Details
Activity
Releases
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
android
android_fairyland
Commits
bfb8faac
Commit
bfb8faac
authored
Dec 31, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改deviceId获取方式
parent
edc5ac05
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
21 deletions
+33
-21
MintsApplication.java
...p/src/main/java/com/mints/fairyland/MintsApplication.java
+10
-11
HomePresenter.kt
.../java/com/mints/fairyland/mvp/presenters/HomePresenter.kt
+1
-1
LoginPresenter.kt
...java/com/mints/fairyland/mvp/presenters/LoginPresenter.kt
+3
-3
MainFragmentPresenter.kt
...m/mints/fairyland/mvp/presenters/MainFragmentPresenter.kt
+1
-1
MyPresenter.kt
...in/java/com/mints/fairyland/mvp/presenters/MyPresenter.kt
+1
-1
PanPresenter.kt
...n/java/com/mints/fairyland/mvp/presenters/PanPresenter.kt
+1
-1
MainFragment.kt
...main/java/com/mints/fairyland/ui/fragment/MainFragment.kt
+1
-0
DeviceUuidFactory.java
...ain/java/com/mints/fairyland/utils/DeviceUuidFactory.java
+15
-3
No files found.
Fairyland/app/src/main/java/com/mints/fairyland/MintsApplication.java
View file @
bfb8faac
...
...
@@ -128,22 +128,21 @@ public class MintsApplication extends MultiDexApplication {
// 猎豹游戏初始化
LiebaoManager
.
getInstance
().
initCmGameSdk
();
// 友盟初始化
// initUm(this);
TalkingDataConfig
();
}
/**
* 设置TalkingData
*/
private
void
TalkingDataConfig
()
{
TCAgent
.
LOG_ON
=
BuildConfig
.
DEBUG
;
String
talkingData_id
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"TD_KEY"
);
String
td_channel_id
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
);
TCAgent
.
init
(
this
,
talkingData_id
,
td_channel_id
);
TCAgent
.
setReportUncaughtExceptions
(
true
);
public
void
TalkingDataConfig
()
{
try
{
TCAgent
.
LOG_ON
=
BuildConfig
.
DEBUG
;
String
talkingData_id
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"TD_KEY"
);
String
td_channel_id
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
);
TCAgent
.
init
(
this
,
talkingData_id
,
td_channel_id
);
TCAgent
.
setReportUncaughtExceptions
(
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
...
...
Fairyland/app/src/main/java/com/mints/fairyland/mvp/presenters/HomePresenter.kt
View file @
bfb8faac
...
...
@@ -103,7 +103,7 @@ class HomePresenter : BasePresenter<HomeView>() {
*/
fun
userLogin
(
type
:
Int
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
visitorlogin
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
...
...
Fairyland/app/src/main/java/com/mints/fairyland/mvp/presenters/LoginPresenter.kt
View file @
bfb8faac
...
...
@@ -63,7 +63,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"mobile"
]
=
mobile
vo
[
"smsCode"
]
=
smsCode
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
bindingMobile
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
...
...
@@ -103,7 +103,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo
[
"mobile"
]
=
mobile
vo
[
"smsCode"
]
=
smsCode
vo
[
"shumeiId"
]
=
ShumeiManager
.
getInstance
().
shumeiDeviceId
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
login
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
...
...
@@ -142,7 +142,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
view
.
showLoading
(
"加载中..."
)
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"shumeiId"
]
=
ShumeiManager
.
getInstance
().
shumeiDeviceId
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"wxInfo"
]
=
wxInfo
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
wechatlogin
(
vo
),
...
...
Fairyland/app/src/main/java/com/mints/fairyland/mvp/presenters/MainFragmentPresenter.kt
View file @
bfb8faac
...
...
@@ -98,7 +98,7 @@ class MainFragmentPresenter : BasePresenter<MainFragmentView>() {
fun
userLogin
()
{
view
.
showLoading
(
"加载中..."
)
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
visitorlogin
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
...
...
Fairyland/app/src/main/java/com/mints/fairyland/mvp/presenters/MyPresenter.kt
View file @
bfb8faac
...
...
@@ -187,7 +187,7 @@ class MyPresenter : BasePresenter<MyView>() {
*/
fun
userLogin
()
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
visitorlogin
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
...
...
Fairyland/app/src/main/java/com/mints/fairyland/mvp/presenters/PanPresenter.kt
View file @
bfb8faac
...
...
@@ -21,7 +21,7 @@ class PanPresenter : BasePresenter<PanView>() {
*/
fun
userLogin
()
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
visitorlogin
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
...
...
Fairyland/app/src/main/java/com/mints/fairyland/ui/fragment/MainFragment.kt
View file @
bfb8faac
...
...
@@ -116,6 +116,7 @@ class MainFragment : BaseFragment(), MainFragmentView {
private
fun
uploadDeviceInfo
()
{
mainFragmentPresenter
.
comSaveTerminalInfo
()
baseApplication
.
initUm
(
context
)
baseApplication
.
TalkingDataConfig
()
}
private
fun
showPowerDialog
()
{
...
...
Fairyland/app/src/main/java/com/mints/fairyland/utils/DeviceUuidFactory.java
View file @
bfb8faac
...
...
@@ -4,8 +4,10 @@ import android.content.Context;
import
android.content.SharedPreferences
;
import
android.provider.Settings
;
import
android.telephony.TelephonyManager
;
import
android.text.TextUtils
;
import
com.mints.fairyland.MintsApplication
;
import
com.mints.fairyland.common.DeviceInfo
;
import
java.io.UnsupportedEncodingException
;
import
java.util.UUID
;
...
...
@@ -23,7 +25,7 @@ public class DeviceUuidFactory {
protected
static
UUID
uuid
;
public
DeviceUuidFactory
()
{
Context
context
=
MintsApplication
.
getContext
();
Context
context
=
MintsApplication
.
getContext
();
if
(
uuid
==
null
)
{
synchronized
(
DeviceUuidFactory
.
class
)
{
if
(
uuid
==
null
)
{
...
...
@@ -86,7 +88,17 @@ public class DeviceUuidFactory {
* @return a UUID that may be used to uniquely identify your device for most purposes.
* @see //http://code.google.com/p/android/issues/detail?id=10603
*/
public
UUID
getDeviceUuid
()
{
return
uuid
;
public
String
getDeviceUuid
()
{
try
{
String
macAddress
=
DeviceInfo
.
Companion
.
getInstance
().
getMacAddress
();
String
mac
=
macAddress
.
replace
(
":"
,
""
);
if
(!
TextUtils
.
equals
(
mac
,
"020000000000"
))
{
return
MD5
.
GetMD5Code
(
mac
);
}
}
catch
(
Exception
e
)
{
}
return
uuid
.
toString
();
}
}
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