Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
161702eb
Commit
161702eb
authored
Apr 22, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加风控逻辑
parent
34eeebf9
Changes
23
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
461 additions
and
303 deletions
+461
-303
build.gradle
GoodMoney/app/build.gradle
+4
-3
VideoAdingManager.java
.../java/com/mints/goodmoney/ad/video/VideoAdingManager.java
+133
-65
AppConfig.java
...p/src/main/java/com/mints/goodmoney/common/AppConfig.java
+4
-0
DeviceInfo.kt
...pp/src/main/java/com/mints/goodmoney/common/DeviceInfo.kt
+33
-0
SimulatorManager.kt
...main/java/com/mints/goodmoney/manager/SimulatorManager.kt
+23
-0
TrackManager.java
...c/main/java/com/mints/goodmoney/manager/TrackManager.java
+12
-0
UserWeight.kt
...p/src/main/java/com/mints/goodmoney/manager/UserWeight.kt
+60
-0
VedioRulesBean.java
...in/java/com/mints/goodmoney/mvp/model/VedioRulesBean.java
+6
-0
AwardPresenter.java
...va/com/mints/goodmoney/mvp/presenters/AwardPresenter.java
+0
-49
DrawcashPresenter.java
...com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
+2
-43
LoginPresenter.kt
...java/com/mints/goodmoney/mvp/presenters/LoginPresenter.kt
+2
-43
TrackPresenter.java
...va/com/mints/goodmoney/mvp/presenters/TrackPresenter.java
+98
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+8
-1
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+6
-3
DrawNativeVideoActivity.kt
...m/mints/goodmoney/ui/activitys/DrawNativeVideoActivity.kt
+6
-2
KylVideoActivity.kt
...java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
+6
-2
MorningClockActivity.kt
.../com/mints/goodmoney/ui/activitys/MorningClockActivity.kt
+6
-2
BaseActivity.java
...a/com/mints/goodmoney/ui/activitys/base/BaseActivity.java
+3
-0
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+1
-43
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+7
-46
TurnTableFragment.kt
...java/com/mints/goodmoney/ui/fragment/TurnTableFragment.kt
+3
-0
DrawcashVideoDialog.kt
.../mints/goodmoney/ui/widgets/dialog/DrawcashVideoDialog.kt
+1
-1
AccessibilityUtils.java
...in/java/com/mints/goodmoney/utils/AccessibilityUtils.java
+37
-0
No files found.
GoodMoney/app/build.gradle
View file @
161702eb
...
...
@@ -14,8 +14,8 @@ android {
applicationId
"com.mints.goodmoney"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
2
5
versionName
"1.2.
4
"
versionCode
2
6
versionName
"1.2.
5
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
@@ -199,7 +199,8 @@ dependencies {
implementation
'com.github.SheHuan:NiceImageView:1.0.5'
// 跑马灯
implementation
'com.sunfusheng:marqueeview:1.2.0'
// 检测运行设备是否模拟器
implementation
'com.snail:antifake:1.4'
// 工具类
// gson
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VideoAdingManager.java
View file @
161702eb
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/common/AppConfig.java
View file @
161702eb
...
...
@@ -131,4 +131,8 @@ public class AppConfig {
*/
public
static
boolean
isSuperTask
=
false
;
/**
* 激励视频是否休眠 false-不休眠 提示:加载失败,请稍后重试。
*/
public
static
boolean
isVideoSleep
=
false
;
}
GoodMoney/app/src/main/java/com/mints/goodmoney/common/DeviceInfo.kt
View file @
161702eb
...
...
@@ -1017,6 +1017,39 @@ class DeviceInfo private constructor() {
return
0
}
/**
* 获取后台运行APP
*/
fun
getRunningApp
():
String
{
try
{
val
appList
:
MutableList
<
MutableMap
<
String
,
String
>>
=
ArrayList
()
val
localPackageManager
=
mContext
?.
packageManager
localPackageManager
?.
let
{
val
localList
=
localPackageManager
.
getInstalledPackages
(
0
)
for
(
i
in
0
until
localList
.
size
)
{
val
pinfo
=
localList
.
get
(
i
)
as
PackageInfo
if
(
pinfo
.
applicationInfo
.
flags
and
ApplicationInfo
.
FLAG_SYSTEM
>
0
)
{
//系统程序 忽略
continue
}
if
(
ApplicationInfo
.
FLAG_UPDATED_SYSTEM_APP
and
pinfo
.
applicationInfo
.
flags
==
0
&&
ApplicationInfo
.
FLAG_STOPPED
and
pinfo
.
applicationInfo
.
flags
==
0
)
{
val
appMap
:
MutableMap
<
String
,
String
>
=
HashMap
()
appMap
[
"appName"
]
=
pinfo
.
applicationInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
appMap
[
"appPkg"
]
=
pinfo
.
packageName
appList
.
add
(
appMap
)
}
}
return
JsonUtil
.
toJson
(
appList
)
}
}
catch
(
e
:
Exception
){
}
return
""
}
companion
object
{
private
var
_inst
:
DeviceInfo
?
=
null
val
instance
:
DeviceInfo
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/SimulatorManager.kt
0 → 100644
View file @
161702eb
package
com.mints.goodmoney.manager
import
com.mints.goodmoney.MintsApplication
import
com.snail.antifake.jni.EmulatorDetectUtil
/**
* 描述:模拟器校验
* 作者:孟崔广
*/
object
SimulatorManager
{
/**
* 是否是模拟器 0-不是模拟器
*/
fun
isEmulator
():
Int
{
try
{
return
if
(
EmulatorDetectUtil
.
isEmulator
(
MintsApplication
.
getContext
()))
1
else
0
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
return
0
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TrackManager.java
View file @
161702eb
...
...
@@ -131,4 +131,16 @@ public class TrackManager {
trackPresenter
.
reportErrornterface
(
url
,
request
);
}
}
public
void
getAdWeight
()
{
if
(
trackPresenter
!=
null
&&
!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
getUserID
()))
{
trackPresenter
.
getAdWeight
();
}
}
public
void
riskinfo
()
{
if
(
trackPresenter
!=
null
&&
!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
getUserID
()))
{
trackPresenter
.
riskinfo
();
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/UserWeight.kt
0 → 100644
View file @
161702eb
package
com.mints.goodmoney.manager
import
com.mints.goodmoney.ad.video.VideoAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
import
com.mints.goodmoney.ui.fragment.MainFragment
import
com.mints.goodmoney.utils.ForegroundOrBackground
import
com.mints.goodmoney.utils.LogUtil
/**
* 描述:用户广告视频数和权重
* 作者:孟崔广
*/
object
UserWeight
{
private
val
TAG
=
UserWeight
::
class
.
java
.
simpleName
private
val
videoAdingManager
by
lazy
{
VideoAdingManager
.
getInstance
(
ForegroundOrBackground
.
getApp_activity
())
}
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
AppConfig
.
isVideoSleep
=
data
.
vedioRules
.
isVedioSleep
videoAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
,
data
.
vedioRules
.
csjfulL_VEDIO
.
rate
,
data
.
vedioRules
.
kS_VEDIO
.
rate
,
data
.
vedioRules
.
rtA_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate} "
+
"rtaWeight:${data.vedioRules.rtA_VEDIO.rate} "
+
"ksWeight:${data.vedioRules.kS_VEDIO.rate}"
)
// 广告视频数
AppConfig
.
csjVideoAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
AppConfig
.
wnVideoAdCount
=
data
.
vedioRules
.
sdhZ_VEDIO
.
surplus
AppConfig
.
flVideoAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
AppConfig
.
shVideoAdCount
=
data
.
vedioRules
.
corAl_VIDEO
.
surplus
AppConfig
.
ksVideoAdCount
=
data
.
vedioRules
.
kS_VEDIO
.
surplus
AppConfig
.
rtaVideoAdCount
=
data
.
vedioRules
.
rtA_VEDIO
.
surplus
AppConfig
.
csjFullVideoAdCount
=
data
.
vedioRules
.
csjfulL_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVideoAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount} "
+
"rtaCount:${AppConfig.rtaVideoAdCount} "
+
"ksCount:${AppConfig.ksVideoAdCount}"
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/VedioRulesBean.java
View file @
161702eb
...
...
@@ -13,6 +13,8 @@ public class VedioRulesBean implements Serializable {
private
KSVedioBean
KS_VEDIO
;
private
RTAVedioBean
RTA_VEDIO
;
private
boolean
flVideoFlag
;
private
boolean
vedioSleep
;
public
class
CsjVedioBean
implements
Serializable
{
private
int
surplus
;
//剩余可看视频数
...
...
@@ -158,4 +160,8 @@ public class VedioRulesBean implements Serializable {
public
boolean
isFlVideoFlag
()
{
return
flVideoFlag
;
}
public
boolean
isVedioSleep
()
{
return
vedioSleep
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/AwardPresenter.java
View file @
161702eb
...
...
@@ -199,53 +199,4 @@ public class AwardPresenter extends BasePresenter<AwardView> {
});
}
public
void
riskinfo
()
{
DeviceInfo
deviceInfo
=
DeviceInfo
.
Companion
.
getInstance
();
RxjavaUtil
.
executeRxTask
(
new
CommonRxTask
<
String
>(
""
)
{
@Override
public
void
doInIOThread
()
{
setT
(
deviceInfo
.
getAppInfoMap
());
}
@Override
public
void
doInUIThread
()
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"androidid"
,
deviceInfo
.
getAndroidId
(
null
));
vo
.
put
(
"os"
,
"android"
);
vo
.
put
(
"model"
,
deviceInfo
.
getBrand
()
+
" "
+
deviceInfo
.
getMobileModel
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
().
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
vo
.
put
(
"applist"
,
getT
());
vo
.
put
(
"eventid"
,
Constant
.
RISK_EVENT_ID_TASK
);
vo
.
put
(
"ischarge"
,
deviceInfo
.
isCharging
());
vo
.
put
(
"isusbdebug"
,
deviceInfo
.
getGetUsbStatus
());
vo
.
put
(
"iswifi"
,
deviceInfo
.
getGetWifiConnected
());
vo
.
put
(
"isroot"
,
deviceInfo
.
isRoot
());
vo
.
put
(
"isvpn"
,
deviceInfo
.
isVPN
());
vo
.
put
(
"memory"
,
deviceInfo
.
getTotalMemory
()
+
"+"
+
deviceInfo
.
getTotalStorage
());
vo
.
put
(
"operator"
,
deviceInfo
.
getOperator
());
vo
.
put
(
"idfa"
,
""
);
vo
.
put
(
"imei"
,
deviceInfo
.
getIMEI
());
vo
.
put
(
"oaid"
,
MintsApplication
.
OAID
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
riskinfo
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
@Override
public
void
onCompleted
()
{
if
(
isLinkView
())
return
;
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
Object
>
baseResponse
)
{
}
});
}
});
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
View file @
161702eb
...
...
@@ -8,6 +8,7 @@ import com.mints.goodmoney.common.Constant;
import
com.mints.goodmoney.common.DeviceInfo
;
import
com.mints.goodmoney.manager.AppHttpManager
;
import
com.mints.goodmoney.manager.ShumeiManager
;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.UserManager
;
import
com.mints.goodmoney.mvp.model.BaseResponse
;
import
com.mints.goodmoney.mvp.model.DrawcashBean
;
...
...
@@ -152,7 +153,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo
.
put
(
"oaid"
,
MintsApplication
.
OAID
);
}
riskinfo
(
deviceInfo
,
getT
()
);
TrackManager
.
getInstance
().
riskinfo
(
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
...
...
@@ -314,46 +315,4 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
});
}
/**
* 风控信息
*/
private
void
riskinfo
(
DeviceInfo
deviceInfo
,
String
appPkgList
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"androidid"
,
deviceInfo
.
getAndroidId
(
null
));
vo
.
put
(
"os"
,
"android"
);
vo
.
put
(
"model"
,
deviceInfo
.
getBrand
()
+
" "
+
deviceInfo
.
getMobileModel
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
().
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
vo
.
put
(
"applist"
,
appPkgList
);
vo
.
put
(
"eventid"
,
Constant
.
RISK_EVENT_ID_DRAWCASH
);
vo
.
put
(
"ischarge"
,
deviceInfo
.
isCharging
());
vo
.
put
(
"isusbdebug"
,
deviceInfo
.
getGetUsbStatus
());
vo
.
put
(
"iswifi"
,
deviceInfo
.
getGetWifiConnected
());
vo
.
put
(
"isroot"
,
deviceInfo
.
isRoot
());
vo
.
put
(
"isvpn"
,
deviceInfo
.
isVPN
());
vo
.
put
(
"memory"
,
deviceInfo
.
getTotalMemory
()
+
"+"
+
deviceInfo
.
getTotalStorage
());
vo
.
put
(
"operator"
,
deviceInfo
.
getOperator
());
vo
.
put
(
"idfa"
,
""
);
vo
.
put
(
"imei"
,
deviceInfo
.
getIMEI
());
vo
.
put
(
"oaid"
,
MintsApplication
.
OAID
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
riskinfo
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
@Override
public
void
onCompleted
()
{
if
(
isLinkView
())
return
;
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
Object
>
baseResponse
)
{
}
});
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/LoginPresenter.kt
View file @
161702eb
...
...
@@ -4,10 +4,7 @@ import android.text.TextUtils
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.DeviceInfo
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.manager.JpushManager
import
com.mints.goodmoney.manager.ShumeiManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.*
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.UserBean
import
com.mints.goodmoney.mvp.views.LoginView
...
...
@@ -251,7 +248,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo
[
"shumeiId"
]
=
ShumeiManager
.
getInstance
().
getShumeiDeviceId
()
vo
[
"appPkgList"
]
=
t
.
toString
()
riskinfo
(
deviceInfo
,
t
.
toString
()
)
TrackManager
.
getInstance
().
riskinfo
(
)
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
...
...
@@ -281,42 +278,4 @@ class LoginPresenter : BasePresenter<LoginView>() {
}
/**
* 风控信息
*/
fun
riskinfo
(
deviceInfo
:
DeviceInfo
,
appPkgList
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"androidid"
]
=
deviceInfo
.
getAndroidId
(
null
)
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
brand
+
" "
+
deviceInfo
.
mobileModel
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
vo
[
"applist"
]
=
appPkgList
vo
[
"eventid"
]
=
Constant
.
RISK_EVENT_ID_LOGIN
vo
[
"ischarge"
]
=
deviceInfo
.
isCharging
vo
[
"isusbdebug"
]
=
deviceInfo
.
getUsbStatus
vo
[
"iswifi"
]
=
deviceInfo
.
getWifiConnected
vo
[
"isroot"
]
=
deviceInfo
.
isRoot
vo
[
"isvpn"
]
=
deviceInfo
.
isVPN
vo
[
"memory"
]
=
deviceInfo
.
totalMemory
+
"+"
+
deviceInfo
.
totalStorage
vo
[
"operator"
]
=
deviceInfo
.
operator
vo
[
"idfa"
]
=
""
vo
[
"imei"
]
=
deviceInfo
.
iMEI
vo
[
"oaid"
]
=
MintsApplication
.
OAID
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
riskinfo
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Object
>)
{
}
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TrackPresenter.java
View file @
161702eb
package
com
.
mints
.
goodmoney
.
mvp
.
presenters
;
import
android.app.Activity
;
import
android.text.TextUtils
;
import
com.google.gson.JsonObject
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.common.DeviceInfo
;
import
com.mints.goodmoney.manager.AppHttpManager
;
import
com.mints.goodmoney.manager.SimulatorManager
;
import
com.mints.goodmoney.manager.UserWeight
;
import
com.mints.goodmoney.mvp.model.BaseResponse
;
import
com.mints.goodmoney.mvp.model.CommonParamBean
;
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
;
import
com.mints.goodmoney.utils.AccessibilityUtils
;
import
com.mints.goodmoney.utils.DeviceUuidFactory
;
import
com.mints.goodmoney.utils.rxutil.CommonRxTask
;
import
com.mints.goodmoney.utils.rxutil.RxjavaUtil
;
import
com.mints.library.net.neterror.BaseSubscriber
;
import
com.mints.library.net.neterror.Throwable
;
...
...
@@ -66,6 +75,9 @@ public class TrackPresenter extends BaseTrackPresenter {
@Override
public
void
onNext
(
BaseResponse
<
Object
>
baseResponse
)
{
if
(
TextUtils
.
equals
(
Constant
.
EVENT_TYPE_ONE
,
eventType
))
{
getAdWeight
();
}
}
});
}
...
...
@@ -302,4 +314,90 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
/**
* 获取权重
*/
public
void
getAdWeight
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
vedioPlans
(),
new
BaseSubscriber
<
BaseResponse
<
UserTaskMsgBean
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
UserTaskMsgBean
>
baseResponse
)
{
UserWeight
.
INSTANCE
.
initAdWeight
(
baseResponse
.
getData
());
}
});
}
public
void
riskinfo
()
{
DeviceInfo
deviceInfo
=
DeviceInfo
.
Companion
.
getInstance
();
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
RxjavaUtil
.
executeRxTask
(
new
CommonRxTask
<
String
>(
""
)
{
@Override
public
void
doInIOThread
()
{
setT
(
deviceInfo
.
getAppInfoMap
());
}
@Override
public
void
doInUIThread
()
{
vo
.
put
(
"androidid"
,
deviceInfo
.
getAndroidId
(
null
));
vo
.
put
(
"os"
,
"android"
);
vo
.
put
(
"model"
,
deviceInfo
.
getBrand
()
+
" "
+
deviceInfo
.
getMobileModel
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
().
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
vo
.
put
(
"applist"
,
getT
());
vo
.
put
(
"eventid"
,
Constant
.
RISK_EVENT_ID_TASK
);
vo
.
put
(
"ischarge"
,
deviceInfo
.
isCharging
());
vo
.
put
(
"isusbdebug"
,
deviceInfo
.
getGetUsbStatus
());
vo
.
put
(
"iswifi"
,
deviceInfo
.
getGetWifiConnected
());
vo
.
put
(
"isroot"
,
deviceInfo
.
isRoot
());
vo
.
put
(
"isvpn"
,
deviceInfo
.
isVPN
());
vo
.
put
(
"memory"
,
deviceInfo
.
getTotalMemory
()
+
"+"
+
deviceInfo
.
getTotalStorage
());
vo
.
put
(
"operator"
,
deviceInfo
.
getOperator
());
vo
.
put
(
"idfa"
,
""
);
vo
.
put
(
"imei"
,
deviceInfo
.
getIMEI
());
vo
.
put
(
"oaid"
,
MintsApplication
.
OAID
);
vo
.
put
(
"isSimulator"
,
SimulatorManager
.
INSTANCE
.
isEmulator
());
vo
.
put
(
"isAccessibility"
,
AccessibilityUtils
.
isAccessibilityEnabled
());
RxjavaUtil
.
executeRxTask
(
new
CommonRxTask
<
String
>(
""
)
{
@Override
public
void
doInIOThread
()
{
setT
(
deviceInfo
.
getRunningApp
());
}
@Override
public
void
doInUIThread
()
{
vo
.
put
(
"appRunningPkgList"
,
getT
());
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
riskinfo
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
Object
>
baseResponse
)
{
}
});
}
});
}
});
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
161702eb
...
...
@@ -582,7 +582,6 @@ public interface LoanService {
Observable
<
BaseResponse
<
JsonObject
>>
reportErrornterface
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* <<<<<<< Updated upstream
* 获取大转盘信息
*
* @return
...
...
@@ -622,6 +621,14 @@ public interface LoanService {
@POST
(
"api/myRotationChart"
)
Observable
<
BaseResponse
<
RotationChartBean
>>
myRotationChart
();
/**
* 获取权重信息
*
* @return
*/
@POST
(
"api/vedioPlans"
)
Observable
<
BaseResponse
<
UserTaskMsgBean
>>
vedioPlans
();
/**
* 默认http工厂
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
161702eb
...
...
@@ -502,7 +502,10 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
* 获取激励视频
*/
private
fun
awardVideo
()
{
if
(
videoAdingManager
.
videoFinishFlag
)
{
if
(
AppConfig
.
isVideoSleep
)
{
showToast
(
"加载失败,请稍后重试。"
)
return
}
else
if
(
videoAdingManager
.
videoFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
...
...
@@ -529,7 +532,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
override
fun
videoAdingListenerFail
(
adType
:
String
)
{
loadVideoFailCount
++
if
(
loadVideoFailCount
>=
2
)
{
if
(
loadVideoFailCount
>=
3
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
...
...
@@ -608,7 +611,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
// 上传风控信息
if
(
riskFlag
)
{
awardPresenter
.
riskinfo
()
TrackManager
.
getInstance
()
.
riskinfo
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/DrawNativeVideoActivity.kt
View file @
161702eb
...
...
@@ -25,6 +25,7 @@ import com.mints.goodmoney.call.business.VideoDBHelper
import
com.mints.goodmoney.call.detail.DetailApplyActivity
import
com.mints.goodmoney.call.permission.PermissionActivity
import
com.mints.goodmoney.call.permission.PermissionManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.DrawVideoBean
...
...
@@ -321,7 +322,10 @@ class DrawNativeVideoActivity : BaseActivity(),
* 获取激励视频
*/
private
fun
awardVideo
()
{
if
(
videoAdingManager
.
videoFinishFlag
)
{
if
(
AppConfig
.
isVideoSleep
)
{
showToast
(
"加载失败,请稍后重试。"
)
return
}
else
if
(
videoAdingManager
.
videoFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
...
...
@@ -345,7 +349,7 @@ class DrawNativeVideoActivity : BaseActivity(),
override
fun
videoAdingListenerFail
(
adType
:
String
)
{
loadVideoFailCount
++
if
(
loadVideoFailCount
>=
2
)
{
if
(
loadVideoFailCount
>=
3
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
View file @
161702eb
...
...
@@ -14,6 +14,7 @@ import com.mints.goodmoney.call.business.VideoDBHelper
import
com.mints.goodmoney.call.detail.DetailApplyActivity
import
com.mints.goodmoney.call.permission.PermissionActivity
import
com.mints.goodmoney.call.permission.PermissionManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.KylBean
...
...
@@ -163,7 +164,10 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
* 获取激励视频
*/
private
fun
awardVideo
()
{
if
(
videoAdingManager
.
videoFinishFlag
)
{
if
(
AppConfig
.
isVideoSleep
)
{
showToast
(
"加载失败,请稍后重试。"
)
return
}
else
if
(
videoAdingManager
.
videoFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
...
...
@@ -187,7 +191,7 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
override
fun
videoAdingListenerFail
(
adType
:
String
)
{
loadVideoFailCount
++
if
(
loadVideoFailCount
>=
2
)
{
if
(
loadVideoFailCount
>=
3
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MorningClockActivity.kt
View file @
161702eb
...
...
@@ -8,6 +8,7 @@ import com.mints.goodmoney.R
import
com.mints.goodmoney.ad.video.VideoAdingManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.manager.TtCsjAdManager
import
com.mints.goodmoney.mvp.model.MorningClockBean
import
com.mints.goodmoney.mvp.model.VideoAdingBean
...
...
@@ -107,7 +108,10 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
* 获取激励视频
*/
private
fun
awardVideo
()
{
if
(
videoAdingManager
.
videoFinishFlag
)
{
if
(
AppConfig
.
isVideoSleep
)
{
showToast
(
"加载失败,请稍后重试。"
)
return
}
else
if
(
videoAdingManager
.
videoFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
...
...
@@ -131,7 +135,7 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
override
fun
videoAdingListenerFail
(
adType
:
String
)
{
loadVideoFailCount
++
if
(
loadVideoFailCount
>=
2
)
{
if
(
loadVideoFailCount
>=
3
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/base/BaseActivity.java
View file @
161702eb
...
...
@@ -34,6 +34,9 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_SECURE
);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
!=
Build
.
VERSION_CODES
.
O
)
{
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
161702eb
...
...
@@ -234,7 +234,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 新人福利 放到个人中心展示 防止首页红包转动异常
// 设置视频权重
initAdWeight
(
data
)
UserWeight
.
initAdWeight
(
data
)
initExpress
(
data
.
flowAdRules
)
// 调用金币视频信息接口
...
...
@@ -571,48 +571,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
})
}
/**
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
videoAdingManager
?.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
,
data
.
vedioRules
.
csjfulL_VEDIO
.
rate
,
data
.
vedioRules
.
kS_VEDIO
.
rate
,
data
.
vedioRules
.
rtA_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate} "
+
"rtaWeight:${data.vedioRules.rtA_VEDIO.rate} "
+
"ksWeight:${data.vedioRules.kS_VEDIO.rate}"
)
// 广告视频数
AppConfig
.
csjVideoAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
AppConfig
.
wnVideoAdCount
=
data
.
vedioRules
.
sdhZ_VEDIO
.
surplus
AppConfig
.
flVideoAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
AppConfig
.
csjFullVideoAdCount
=
data
.
vedioRules
.
csjfulL_VEDIO
.
surplus
AppConfig
.
shVideoAdCount
=
data
.
vedioRules
.
corAl_VIDEO
.
surplus
AppConfig
.
ksVideoAdCount
=
data
.
vedioRules
.
kS_VEDIO
.
surplus
AppConfig
.
rtaVideoAdCount
=
data
.
vedioRules
.
rtA_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVideoAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount} "
+
"ratCount:${AppConfig.rtaVideoAdCount} "
+
"ksCount:${AppConfig.ksVideoAdCount}"
)
}
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
PreLoadExpressManager
.
init
(
flowAdRules
.
csj
,
flowAdRules
.
ylh
,
flowAdRules
.
ks
)
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
161702eb
...
...
@@ -329,8 +329,8 @@ class MyFragment : BaseFragment(),
AppConfig
.
wzReadCoin
=
data
.
shareNews
.
readCoin
}
//
更新
权重
initAdWeight
(
data
)
//
设置视频
权重
UserWeight
.
initAdWeight
(
data
)
initExpress
(
data
.
flowAdRules
)
AppConfig
.
app_black_name
=
data
.
userRiskApps
.
userRiskAppName
AppConfig
.
app_black_pkg
=
data
.
userRiskApps
.
userRiskAppPkg
...
...
@@ -1120,7 +1120,10 @@ class MyFragment : BaseFragment(),
* 获取激励视频
*/
private
fun
awardVideo
(
coin
:
Int
,
carrierType
:
String
)
{
if
(
videoAdingManager
.
videoFinishFlag
)
{
if
(
AppConfig
.
isVideoSleep
)
{
showToast
(
"加载失败,请稍后重试。"
)
return
}
else
if
(
videoAdingManager
.
videoFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
...
...
@@ -1147,7 +1150,7 @@ class MyFragment : BaseFragment(),
override
fun
videoAdingListenerFail
(
adType
:
String
)
{
loadVideoFailCount
++
if
(
loadVideoFailCount
>=
2
)
{
if
(
loadVideoFailCount
>=
3
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
...
...
@@ -1273,48 +1276,6 @@ class MyFragment : BaseFragment(),
mainMyAdapter
?.
setOnItemChildClickListener
(
this
)
}
/**
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
videoAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
,
data
.
vedioRules
.
csjfulL_VEDIO
.
rate
,
data
.
vedioRules
.
kS_VEDIO
.
rate
,
data
.
vedioRules
.
rtA_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate} "
+
"rtaWeight:${data.vedioRules.rtA_VEDIO.rate} "
+
"ksWeight:${data.vedioRules.kS_VEDIO.rate}"
)
// 广告视频数
AppConfig
.
csjVideoAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
AppConfig
.
wnVideoAdCount
=
data
.
vedioRules
.
sdhZ_VEDIO
.
surplus
AppConfig
.
flVideoAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
AppConfig
.
shVideoAdCount
=
data
.
vedioRules
.
corAl_VIDEO
.
surplus
AppConfig
.
ksVideoAdCount
=
data
.
vedioRules
.
kS_VEDIO
.
surplus
AppConfig
.
rtaVideoAdCount
=
data
.
vedioRules
.
rtA_VEDIO
.
surplus
AppConfig
.
csjFullVideoAdCount
=
data
.
vedioRules
.
csjfulL_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVideoAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount} "
+
"rtaCount:${AppConfig.rtaVideoAdCount} "
+
"ksCount:${AppConfig.ksVideoAdCount}"
)
}
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
PreLoadExpressManager
.
init
(
flowAdRules
.
csj
,
flowAdRules
.
ylh
,
flowAdRules
.
ks
)
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/TurnTableFragment.kt
View file @
161702eb
...
...
@@ -18,6 +18,7 @@ import com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.MokuManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.ClickTurnBean
import
com.mints.goodmoney.mvp.model.TurnBean
...
...
@@ -129,6 +130,8 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
}
override
fun
getTurnTableSuc
(
data
:
TurnBean
)
{
TrackManager
.
getInstance
().
getAdWeight
()
if
(
AppConfig
.
fragmentClickFlag
!=
Constant
.
FRAGMENT_CLICK_THREE
||
activity
==
null
||
requireActivity
().
isFinishing
)
{
return
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/dialog/DrawcashVideoDialog.kt
View file @
161702eb
...
...
@@ -108,7 +108,7 @@ class DrawcashVideoDialog(activity: Activity) :
override
fun
videoAdingListenerFail
(
adType
:
String
)
{
loadVideoFailCount
++
if
(
loadVideoFailCount
>=
2
)
{
if
(
loadVideoFailCount
>=
3
)
{
ToastUtil
.
show
(
activity
,
"加载超时,请休息一下"
)
}
else
{
loadVideo
(
videoAdingManager
,
bean
,
false
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/AccessibilityUtils.java
0 → 100644
View file @
161702eb
package
com
.
mints
.
goodmoney
.
utils
;
import
android.content.Context
;
import
android.view.accessibility.AccessibilityManager
;
import
com.mints.goodmoney.MintsApplication
;
/**
* 无障碍服务
*/
public
class
AccessibilityUtils
{
/**
* 判断用户是否开启无障碍服务
*
* @return 0-未开启无障碍功能
* @throws RuntimeException
*/
public
static
int
isAccessibilityEnabled
()
{
try
{
// 检查AccessibilityService是否开启
AccessibilityManager
am
=
(
AccessibilityManager
)
MintsApplication
.
getContext
().
getSystemService
(
Context
.
ACCESSIBILITY_SERVICE
);
boolean
isAccessibilityEnabled_flag
=
am
.
isEnabled
();
return
isAccessibilityEnabled_flag
?
1
:
0
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
0
;
// boolean isExploreByTouchEnabled_flag = false;
//
// // 检查无障碍服务是否以语音播报的方式开启
// isExploreByTouchEnabled_flag = isScreenReaderActive(context);
//
// return (isAccessibilityEnabled_flag && isExploreByTouchEnabled_flag);
}
}
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