Commit 084de85a authored by mengcuiguang2's avatar mengcuiguang2

添加风控逻辑

parent 472242f3
......@@ -147,6 +147,7 @@
<activity
android:name="com.mints.fiveworld.ui.activitys.HintActivity"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
<activity
android:name="com.mints.fiveworld.ui.activitys.SignalStrengthActivity"
......
......@@ -492,14 +492,6 @@ public class AlarmManager implements Handler.Callback {
return false;
}
//定时请求中-防止界面重叠,因为把加载成功的拦截去掉了
if (AlarmManager.isAlarming) {
LogUtil.d(TAG, "***当前类型:HOME-CLICK *** ->>>>>>>10分钟定时请求中 -防止界面重叠,因为把加载成功的拦截去掉了<<<<<<<-");
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_HOME_CLICK_TIMER.name());
return false;
}
// 体外场景或定时 进入透明页加载广告时,防止此段空白时间弹出广告
if (!AppOutWifiAdManager.Companion.getInstance().getAdLoadOk() ||
!WifiAdManager.Companion.getInstance().getAdLoadOk()) {
......
......@@ -127,6 +127,14 @@ public class HomePopManager implements Handler.Callback {
return;
}
//定时请求中-防止界面重叠,因为把加载成功的拦截去掉了
if (AlarmManager.isAlarming) {
LogUtil.d(TAG, "***当前类型:HOME-CLICK *** ->>>>>>>10分钟定时请求中 -防止界面重叠,因为把加载成功的拦截去掉了<<<<<<<-");
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_HOME_CLICK_TIMER.name());
return ;
}
// 体外场景或定时 进入透明页加载广告时,防止此段空白时间弹出广告
if (!AppOutWifiAdManager.Companion.getInstance().getAdLoadOk() ||
!WifiAdManager.Companion.getInstance().getAdLoadOk()) {
......
......@@ -29,10 +29,11 @@ class AntiAuditManager private constructor() {
const val TODAY_INSTALL_APK_COUNT = "TODAY_INSTALL_APK_COUNT"// 安装个数
const val TODAY_INSTALL_SUM_COUNT = "TODAY_INSTALL_SUM_COUNT"// 安装总个数(阈值)
// senceType 0-vpn,1-反策略,2-协议 3-意见反馈
// senceType 0-vpn,1-反策略,2-协议 3-风控
const val SENCE_VPN = "0"// vpn
const val SENCE_FAZHI = "1"// 阈值
const val SENCE_AGREEMENT = "2"// 协议
const val SENCE_RISK = "3"// 风控
const val SENCE_FEEDBACK = "98"// 问题反馈 - 点击
const val SENCE_FEEDBACK_SUBMIT = "99"// 问题反馈 - 提交
......
package com.mints.fiveworld.mvp.model
import java.io.Serializable
/**
* 风控
*/
data class RiskBean(
val msg: String = "",//提示msg字段内容
val isRiskUser: Boolean = false,//true-命中风控
) : Serializable
\ No newline at end of file
......@@ -5,8 +5,10 @@ import com.mints.fiveworld.MintsApplication
import com.mints.fiveworld.ad.AdReportManager
import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.common.DeviceInfo
import com.mints.fiveworld.keepalive.appswitch.AntiAuditManager
import com.mints.fiveworld.manager.*
import com.mints.fiveworld.mvp.model.BaseResponse
import com.mints.fiveworld.mvp.model.RiskBean
import com.mints.fiveworld.mvp.model.UserBean
import com.mints.fiveworld.mvp.model.UserTaskMsgBean
import com.mints.fiveworld.mvp.views.MainView
......@@ -92,7 +94,7 @@ class MainPresenter : BasePresenter<MainView>() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
object : BaseSubscriber<BaseResponse<RiskBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
......@@ -101,9 +103,15 @@ class MainPresenter : BasePresenter<MainView>() {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
override fun onNext(baseResponse: BaseResponse<RiskBean>) {
when (baseResponse.status) {
200 -> {
// 命中风控
if(baseResponse.data.isRiskUser){
AntiAuditManager.instance.setBlack(true)
AntiAuditManager.instance.cmtBlackToServier(AntiAuditManager.SENCE_RISK)
}
view.userLoginSuc()
}
......
......@@ -5,8 +5,10 @@ import com.mints.fiveworld.MintsApplication
import com.mints.fiveworld.ad.AdReportManager
import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.common.DeviceInfo
import com.mints.fiveworld.keepalive.appswitch.AntiAuditManager
import com.mints.fiveworld.manager.*
import com.mints.fiveworld.mvp.model.BaseResponse
import com.mints.fiveworld.mvp.model.RiskBean
import com.mints.fiveworld.mvp.model.SplashAppBean
import com.mints.fiveworld.mvp.model.UserBean
import com.mints.fiveworld.mvp.views.SplashView
......@@ -151,7 +153,7 @@ class SplashPresenter : BasePresenter<SplashView>() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
object : BaseSubscriber<BaseResponse<RiskBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
......@@ -164,9 +166,15 @@ class SplashPresenter : BasePresenter<SplashView>() {
}
override fun onNext(baseResponse: BaseResponse<Any>) {
override fun onNext(baseResponse: BaseResponse<RiskBean>) {
when (baseResponse.status) {
200 -> {
// 命中风控
if(baseResponse.data.isRiskUser){
AntiAuditManager.instance.setBlack(true)
AntiAuditManager.instance.cmtBlackToServier(AntiAuditManager.SENCE_RISK)
}
LogUtil.d("SplashPresenter222","saveTerminalInfo 返回onNext 200-2")
view.getAppsCountSuc(splashBean)
......
package com.mints.fiveworld.mvp.presenters;
import android.app.Activity;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import com.google.gson.JsonObject;
......@@ -21,10 +25,13 @@ import com.mints.fiveworld.manager.UserManager;
import com.mints.fiveworld.manager.wifi.WifiDataManager;
import com.mints.fiveworld.mvp.model.BaseResponse;
import com.mints.fiveworld.mvp.model.OutAppConfig;
import com.mints.fiveworld.mvp.model.RiskBean;
import com.mints.fiveworld.mvp.model.UserBean;
import com.mints.fiveworld.mvp.model.WifiActiveBean;
import com.mints.fiveworld.ui.activitys.HintActivity;
import com.mints.fiveworld.utils.AccessibilityUtils;
import com.mints.fiveworld.utils.DeviceUuidFactory;
import com.mints.fiveworld.utils.ForegroundOrBackground;
import com.mints.fiveworld.utils.LogUtil;
import com.mints.fiveworld.utils.WifiUtils;
import com.mints.fiveworld.utils.rxutil.CommonRxTask;
......@@ -105,7 +112,7 @@ public class TrackPresenter extends BaseTrackPresenter {
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
new BaseSubscriber<BaseResponse<Object>>() {
new BaseSubscriber<BaseResponse<RiskBean>>() {
@Override
public void onCompleted() {
}
......@@ -115,7 +122,31 @@ public class TrackPresenter extends BaseTrackPresenter {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
public void onNext(BaseResponse<RiskBean> baseResponse) {
try {
if (baseResponse.getStatus() == 200) {
// 命中风控
if(baseResponse.getData().isRiskUser()){
AntiAuditManager.Companion.getInstance().setBlack(true);
AntiAuditManager.Companion.getInstance().cmtBlackToServier(AntiAuditManager.SENCE_RISK);
}
Activity forwardActivity = ForegroundOrBackground.getApp_activity();
if (forwardActivity != null) {
if (!forwardActivity.isFinishing()) {
new Handler(Looper.getMainLooper()).postDelayed(() -> {
Intent intent= new Intent(forwardActivity, HintActivity.class);
intent.putExtra(HintActivity.HINT_TEXT,baseResponse.getData().getMsg());
forwardActivity.startActivity(intent);
}, 200);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
......
......@@ -6,6 +6,7 @@ import com.google.gson.JsonObject;
import com.mints.fiveworld.BuildConfig;
import com.mints.fiveworld.mvp.model.BaseResponse;
import com.mints.fiveworld.mvp.model.OutAppConfig;
import com.mints.fiveworld.mvp.model.RiskBean;
import com.mints.fiveworld.mvp.model.SplashAppBean;
import com.mints.fiveworld.mvp.model.UserBean;
import com.mints.fiveworld.mvp.model.UserTaskMsgBean;
......@@ -48,7 +49,7 @@ public interface LoanService {
* 提交设备信息、后台激活
*/
@POST("api/saveTerminalInfo")
Observable<BaseResponse<Object>> saveTerminalInfo(@Body Map<String, Object> vo);
Observable<BaseResponse<RiskBean>> saveTerminalInfo(@Body Map<String, Object> vo);
/**
* 场景事件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment