Commit b10ac2b7 authored by mengcuiguang's avatar mengcuiguang

添加同5逻辑

parent 9057d989
...@@ -175,6 +175,19 @@ object AdReportManager { ...@@ -175,6 +175,19 @@ object AdReportManager {
EVENT_TYPE_SCENCE_ALL_SWITCH_CLOSE("402"), // 总开关 关闭-新 EVENT_TYPE_SCENCE_ALL_SWITCH_CLOSE("402"), // 总开关 关闭-新
EVENT_TYPE_SCENCE_SWITCH_CLOSE("403"), // 场景开关 关闭-新 EVENT_TYPE_SCENCE_SWITCH_CLOSE("403"), // 场景开关 关闭-新
EVENT_TYPE_SCENCE_UID_NULL_LOGIN("404"), // 定时10分钟调用server接口-点击同意后 若uid为空 调用登录接口 EVENT_TYPE_SCENCE_UID_NULL_LOGIN("404"), // 定时10分钟调用server接口-点击同意后 若uid为空 调用登录接口
EVENT_TYPE_MATE_TIMER_INIT("600"), // 体内 - 启动页 初始化匹配定时器
EVENT_TYPE_SCENCE_IN_SPLASH_AGREE("601"), // 体内 - 启动页 点击同意
EVENT_TYPE_SCENCE_IN_SPLASH_DEVICESUC("602"), // 体内 - 启动页 上传设备信息成功调用10秒接口
EVENT_TYPE_MATE_TIMER_GET("603"), // 体内 - 匹配定时器请求服务10秒接口
EVENT_TYPE_MATE_TIMER_STOP("604"), // 体内 - 匹配定时器停止
EVENT_TYPE_MATE_TIMER_SUC("605"), // 体内 - 匹配定时器server返回结果匹配成功
EVENT_TYPE_SCENCE_IN_AD_HOT("606"), // 体内 -定时器小火箭页 应用内广告不展示
EVENT_TYPE_SCENCE_IN_FIVE_HOT("607"), // 体内 -定时器小火箭页 应用内不是同5
EVENT_TYPE_SCENCE_IN_FIVE_SHOW("608"), // 体内 -定时器小火箭页 展示
EVENT_TYPE_SCENCE_IN_FIVE_ENTER("609"), // 体内 -同5逻辑 进入逻辑校验
EVENT_TYPE_SCENCE_IN_FIVE_ENTER_HIT("610"), // 体内 -同5逻辑 命中 - 不展示广告
EVENT_TYPE_SCENCE_IN_FIVE_ENTER_NO_HIT("611"), // 体内 -同5逻辑 未命中 - 不展示广告
} }
enum class AdActivityType(val value: String) { enum class AdActivityType(val value: String) {
......
...@@ -15,6 +15,7 @@ import com.bytedance.msdk.api.v2.slot.GMAdSlotFullVideo; ...@@ -15,6 +15,7 @@ import com.bytedance.msdk.api.v2.slot.GMAdSlotFullVideo;
import com.mints.fiveworld.ad.AdHelper; import com.mints.fiveworld.ad.AdHelper;
import com.mints.fiveworld.ad.AdReportManager; import com.mints.fiveworld.ad.AdReportManager;
import com.mints.fiveworld.ad.wifi.WifiAdStatusListener; import com.mints.fiveworld.ad.wifi.WifiAdStatusListener;
import com.mints.fiveworld.common.AppConfig;
import com.mints.fiveworld.common.Constant; import com.mints.fiveworld.common.Constant;
import com.mints.fiveworld.manager.TrackManager; import com.mints.fiveworld.manager.TrackManager;
import com.mints.fiveworld.manager.UserManager; import com.mints.fiveworld.manager.UserManager;
...@@ -353,6 +354,7 @@ public class InSceneFull { ...@@ -353,6 +354,7 @@ public class InSceneFull {
@Override @Override
public void onFullVideoAdClosed() { public void onFullVideoAdClosed() {
AppConfig.inAdShowing = false;
if (wifiAdStatusListener != null) if (wifiAdStatusListener != null)
wifiAdStatusListener.adClose(); wifiAdStatusListener.adClose();
......
...@@ -15,6 +15,7 @@ import com.bytedance.msdk.api.v2.slot.GMAdSlotFullVideo; ...@@ -15,6 +15,7 @@ import com.bytedance.msdk.api.v2.slot.GMAdSlotFullVideo;
import com.mints.fiveworld.ad.AdHelper; import com.mints.fiveworld.ad.AdHelper;
import com.mints.fiveworld.ad.AdReportManager; import com.mints.fiveworld.ad.AdReportManager;
import com.mints.fiveworld.ad.wifi.WifiAdStatusListener; import com.mints.fiveworld.ad.wifi.WifiAdStatusListener;
import com.mints.fiveworld.common.AppConfig;
import com.mints.fiveworld.common.Constant; import com.mints.fiveworld.common.Constant;
import com.mints.fiveworld.manager.TrackManager; import com.mints.fiveworld.manager.TrackManager;
import com.mints.fiveworld.manager.UserManager; import com.mints.fiveworld.manager.UserManager;
...@@ -350,6 +351,7 @@ public class NewInSceneFull { ...@@ -350,6 +351,7 @@ public class NewInSceneFull {
@Override @Override
public void onFullVideoAdClosed() { public void onFullVideoAdClosed() {
AppConfig.inAdShowing = false;
if (wifiAdStatusListener != null) if (wifiAdStatusListener != null)
wifiAdStatusListener.adClose(); wifiAdStatusListener.adClose();
......
...@@ -47,4 +47,6 @@ public class AppConfig { ...@@ -47,4 +47,6 @@ public class AppConfig {
// 网赚总开关 默认开 // 网赚总开关 默认开
public static boolean openMoney = true; public static boolean openMoney = true;
// 应用内普通 插屏和全屏开关
public static boolean inAdShowing = false;
} }
...@@ -109,4 +109,10 @@ object Constant { ...@@ -109,4 +109,10 @@ object Constant {
const val REGISTER_FLAG = "REGISTER_FLAG"//服务协议 const val REGISTER_FLAG = "REGISTER_FLAG"//服务协议
const val PRIVACY_FLAG = "PRIVACY_FLAG"//隐私协议 const val PRIVACY_FLAG = "PRIVACY_FLAG"//隐私协议
const val BOTTOM_FLAG = "BOTTOM_FLAG"//滑动底部 const val BOTTOM_FLAG = "BOTTOM_FLAG"//滑动底部
const val SPLASH_10_MATE = "SPLASH_10_MATE"//启动页10秒
const val TIMER_10_MATE = "TIMER_10_MATE"//定时10秒
// 是否第一次显示小火箭 true-是
const val IS_ONE_HOTPAGE = "IS_ONE_HOTPAGE"
} }
package com.mints.fiveworld.keepalive;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import androidx.annotation.NonNull;
import com.mints.fiveworld.ad.AdReportManager;
import com.mints.fiveworld.common.AppConfig;
import com.mints.fiveworld.common.Constant;
import com.mints.fiveworld.manager.AppPreferencesManager;
import com.mints.fiveworld.manager.TrackManager;
import com.mints.fiveworld.manager.UmengManager;
import com.mints.fiveworld.manager.wifi.WifiDataManager;
import com.mints.fiveworld.ui.activitys.IncreasespeedActivity;
import com.mints.fiveworld.utils.ForegroundOrBackground;
import com.mints.fiveworld.utils.LogUtil;
/**
* 描述:匹配定时
* 作者:孟崔广
* 邮箱:mengcg@xiaojinqb.cn
*/
public class MateTimerManager implements Handler.Callback {
private static final String TAG = "MateTimerManager";
private static volatile MateTimerManager _inst;
private static final long CHECK_INTERVAL = 10 * 1000;//10秒
private static final int MSG1 = 1002;
public Handler mHandler = null;
public static MateTimerManager getInstance() {
if (_inst == null) {
synchronized (MateTimerManager.class) {
if (_inst == null) {
_inst = new MateTimerManager();
}
}
}
return _inst;
}
private MateTimerManager() {
}
public void init() {
AdReportManager.INSTANCE.eventScene(
AdReportManager.INNER_IN,
System.currentTimeMillis(),
Constant.CARRIER_TIMER,
"",
AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_INIT.getValue());
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_INIT.name());
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
}
mHandler = new Handler(Looper.getMainLooper(), this);
mHandler.sendEmptyMessageDelayed(MSG1, CHECK_INTERVAL);
}
@Override
public boolean handleMessage(@NonNull Message msg) {
if (msg.what == MSG1) {
LogUtil.d(TAG, "handleMessage");
TrackManager.getInstance().splashTenMate(Constant.TIMER_10_MATE);
AdReportManager.INSTANCE.eventScene(
AdReportManager.INNER_IN,
System.currentTimeMillis(),
Constant.CARRIER_TIMER,
"",
AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_GET.getValue());
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_GET.name());
if (mHandler!=null){
mHandler.sendEmptyMessageDelayed(MSG1, CHECK_INTERVAL);
}
}
return false;
}
public void stopTimer() {
readyGoHotPage();
AdReportManager.INSTANCE.eventScene(
AdReportManager.INNER_IN,
System.currentTimeMillis(),
Constant.CARRIER_TIMER,
"",
AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_STOP.getValue());
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_STOP.name());
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
mHandler = null;
}
}
/**
* 匹配成功跳转小火箭页面
* 触发时机:定时和体内 全屏或插屏广告点击关闭回调
*/
public void readyGoHotPage() {
Activity context= ForegroundOrBackground.getApp_activity();
if (context == null) return;
// 若体内 全屏或插屏动画展示时 直接返回
if (AppConfig.isShowInsertScreen) return;
// 如果展示过一次则返回
if (!AppPreferencesManager.INSTANCE.get().getBoolean(Constant.IS_ONE_HOTPAGE, true)) {
return;
}
// 应用内广告开关 为关则返回
if (!WifiDataManager.INSTANCE.getAppInAdSwitch()) {
AdReportManager.INSTANCE.eventScene(
AdReportManager.INNER_IN,
System.currentTimeMillis(),
Constant.CARRIER_TIMER,
"",
AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_AD_HOT.getValue());
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_AD_HOT.name());
return;
}
// 应用内同5 为开则返回
if (WifiDataManager.INSTANCE.getAppInFive()) {
AdReportManager.INSTANCE.eventScene(
AdReportManager.INNER_IN,
System.currentTimeMillis(),
Constant.CARRIER_TIMER,
"",
AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_FIVE_HOT.getValue());
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_FIVE_HOT.name());
return;
}
// 跳转界面
AdReportManager.INSTANCE.eventScene(
AdReportManager.INNER_IN,
System.currentTimeMillis(),
Constant.CARRIER_TIMER,
"",
AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_FIVE_SHOW.getValue());
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_FIVE_SHOW.name());
AppPreferencesManager.INSTANCE.get().put(Constant.IS_ONE_HOTPAGE, false);
Bundle bundle = new Bundle();
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_BOOST
);
readyGo(context, IncreasespeedActivity.class, bundle);
}
private void readyGo(Context context, Class<?> clazz, Bundle bundle) {
Intent intent = new Intent(context, clazz);
if (null != bundle) {
intent.putExtras(bundle);
}
context.startActivity(intent);
}
}
...@@ -93,32 +93,30 @@ class AntiAuditManager private constructor() { ...@@ -93,32 +93,30 @@ class AntiAuditManager private constructor() {
* *
* adflag=true 可以看广告且是白名单 * adflag=true 可以看广告且是白名单
*/ */
fun resetBlack(adflag: Boolean, senceType: String) { fun resetBlack(inadflag: Boolean, outadflag: Boolean, senceType: String) {
LogUtil.d(TAG, "重置黑名单 adflag=true 可以看广告且是白名单 -> $adflag") LogUtil.d(TAG, "重置黑名单 -> inadflag=$inadflag outadflag=$outadflag")
if (adflag) { if (!inadflag && !outadflag) {
// 服务器不拉黑
UmengManager.onEvent(AdReportManager.EventType.EVENT_TYPE_BLACK_FOR_SERVER.name)
} else{
// 服务器拉黑 // 服务器拉黑
UmengManager.onEvent(AdReportManager.EventType.EVENT_TYPE_BLACK_FOR_SERVER_BLACK.name) UmengManager.onEvent(AdReportManager.EventType.EVENT_TYPE_BLACK_FOR_SERVER_BLACK.name)
// 黑名单
sp.put(APP_OUT_BLACK, true)
} else {
// 黑名单
sp.put(APP_OUT_BLACK, false)
} }
// 黑名单
sp.put(APP_OUT_BLACK, !adflag) // 应用外广告总开关
// 广告总开关 sp.put(WifiDataManager.APP_OUT_SWITCH, outadflag)
sp.put(WifiDataManager.APP_OUT_SWITCH, adflag) WifiDataManager.setAppInAdSwitch(inadflag)
AdReportManager.eventScene( AdReportManager.eventScene(
AdReportManager.INNER_OUT, AdReportManager.INNER_OUT,
System.currentTimeMillis(), System.currentTimeMillis(),
senceType, senceType,
"后台返回广告重置状态=${adflag} 黑名单状态=${sp.getBoolean(APP_OUT_BLACK)} 广告总开关=${ "后台返回广告重置状态=inadflag=$inadflag outadflag=$outadflag 黑名单状态=${sp.getBoolean(APP_OUT_BLACK)}",
sp.getBoolean( AdReportManager.EVENT_TYPE_SCENCE_CLOSE
WifiDataManager.APP_OUT_SWITCH
)
}",
AdReportManager.EVENT_TYPE_SCENCE_CLOSE
) )
} }
......
...@@ -161,4 +161,11 @@ public class TrackManager { ...@@ -161,4 +161,11 @@ public class TrackManager {
trackPresenter.tempaddCallImp(vo); trackPresenter.tempaddCallImp(vo);
} }
} }
public void splashTenMate(String type) {
if (trackPresenter != null
&& !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.splashTenMate(type);
}
}
} }
...@@ -14,6 +14,8 @@ public class OutAppConfig implements Serializable { ...@@ -14,6 +14,8 @@ public class OutAppConfig implements Serializable {
*/ */
private boolean open; // 只是当前用户 应用外广告关闭,不是永久拉黑的关闭 private boolean open; // 只是当前用户 应用外广告关闭,不是永久拉黑的关闭
private boolean innerAdOpen=true; // 应用内广告开关
private boolean t5LogicOpen=true; // 应用内同5开关
private int closeNeedInitAppsCount;// 反审核阀值 private int closeNeedInitAppsCount;// 反审核阀值
public int getCloseNeedInitAppsCount() { public int getCloseNeedInitAppsCount() {
...@@ -49,6 +51,22 @@ public class OutAppConfig implements Serializable { ...@@ -49,6 +51,22 @@ public class OutAppConfig implements Serializable {
return open; return open;
} }
public boolean isInnerAdOpen() {
return innerAdOpen;
}
public void setInnerAdOpen(boolean innerAdOpen) {
this.innerAdOpen = innerAdOpen;
}
public boolean isT5LogicOpen() {
return t5LogicOpen;
}
public void setT5LogicOpen(boolean t5LogicOpen) {
this.t5LogicOpen = t5LogicOpen;
}
public void setOpen(boolean open) { public void setOpen(boolean open) {
this.open = open; this.open = open;
} }
......
...@@ -5,5 +5,7 @@ import java.io.Serializable ...@@ -5,5 +5,7 @@ import java.io.Serializable
data class SplashAppBean( data class SplashAppBean(
val closeNeedInitAppsCount: Int = 12, val closeNeedInitAppsCount: Int = 12,
val openMoney: Boolean = true, val openMoney: Boolean = true,
val openAll: Boolean = true, val openAll: Boolean = false,
val t5LogicOpen: Boolean = true,
val innerAdOpen: Boolean = true,
) : Serializable ) : Serializable
\ No newline at end of file
...@@ -2,8 +2,12 @@ package com.mints.fiveworld.mvp.presenters ...@@ -2,8 +2,12 @@ package com.mints.fiveworld.mvp.presenters
import android.text.TextUtils import android.text.TextUtils
import com.mints.fiveworld.MintsApplication 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.common.DeviceInfo
import com.mints.fiveworld.manager.AppHttpManager import com.mints.fiveworld.manager.AppHttpManager
import com.mints.fiveworld.manager.TrackManager
import com.mints.fiveworld.manager.UmengManager
import com.mints.fiveworld.manager.UserManager import com.mints.fiveworld.manager.UserManager
import com.mints.fiveworld.mvp.model.BaseResponse import com.mints.fiveworld.mvp.model.BaseResponse
import com.mints.fiveworld.mvp.model.SplashAppBean import com.mints.fiveworld.mvp.model.SplashAppBean
...@@ -23,28 +27,28 @@ class SplashPresenter : BasePresenter<SplashView>() { ...@@ -23,28 +27,28 @@ class SplashPresenter : BasePresenter<SplashView>() {
vo["uid"] = UserManager.getInstance().userID vo["uid"] = UserManager.getInstance().userID
vo["channel"] = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") vo["channel"] = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.getCloseNeedInitAppsCount(vo), .call(loanService.getCloseNeedInitAppsCount(vo),
object : BaseSubscriber<BaseResponse<SplashAppBean>>() { object : BaseSubscriber<BaseResponse<SplashAppBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
view.getAppsCountFail() view.getAppsCountFail()
} }
override fun onNext(baseResponse: BaseResponse<SplashAppBean>) { override fun onNext(baseResponse: BaseResponse<SplashAppBean>) {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
when (code) { when (code) {
200 -> view.getAppsCountSuc(baseResponse.data) 200 -> view.getAppsCountSuc(baseResponse.data)
else -> view.getAppsCountFail() else -> view.getAppsCountFail()
} }
} }
}) })
} }
/** /**
...@@ -54,37 +58,38 @@ class SplashPresenter : BasePresenter<SplashView>() { ...@@ -54,37 +58,38 @@ class SplashPresenter : BasePresenter<SplashView>() {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["device"] = DeviceUuidFactory().deviceUuid.toString() vo["device"] = DeviceUuidFactory().deviceUuid.toString()
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.visitorlogin(vo), .call(loanService.visitorlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() { object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() { override fun onCompleted() {
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
if (isLinkView) return if (isLinkView) return
view.userRegisterOver()
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
val data: UserBean? = baseResponse.data
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
view.userRegisterOver() view.userRegisterOver()
saveTerminalInfo(data.consumer.pk_id)
} }
else -> view.showToast(message)
} override fun onNext(baseResponse: BaseResponse<UserBean>) {
} if (isLinkView) return
}) val code = baseResponse.status
val message = baseResponse.message
val data: UserBean? = baseResponse.data
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
view.userRegisterOver()
saveTerminalInfo()
installApp()
}
else -> view.showToast(message)
}
}
})
} }
/** /**
* 提交设备信息 * 提交设备信息
*/ */
private fun saveTerminalInfo(userId: Long) { private fun saveTerminalInfo() {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
val deviceInfo: DeviceInfo = DeviceInfo.instance val deviceInfo: DeviceInfo = DeviceInfo.instance
val macAddress: String = deviceInfo.getMacAddress() val macAddress: String = deviceInfo.getMacAddress()
...@@ -103,27 +108,62 @@ class SplashPresenter : BasePresenter<SplashView>() { ...@@ -103,27 +108,62 @@ class SplashPresenter : BasePresenter<SplashView>() {
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName vo["appversion"] = deviceInfo.versionName
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.userRegisterOver()
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> {
AdReportManager.eventExpress(
AdReportManager.INNER_IN,
AdReportManager.EVENT_TYPE_SHOWFAIL,
AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_SPLASH_DEVICESUC.value,
"",
"",
"",
"",
System.currentTimeMillis(),
"TerminalInfoSuc",
"",
"",
""
)
UmengManager.onEvent(AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_SPLASH_DEVICESUC.name)
UmengManager.onEvent(AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_GET.name)
TrackManager.getInstance().splashTenMate(Constant.SPLASH_10_MATE)
}
}
}
})
}
private fun installApp() {
val vo = HashMap<String, Any>()
vo["device"] = DeviceUuidFactory().deviceUuid.toString() vo["device"] = DeviceUuidFactory().deviceUuid.toString()
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo), .call(loanService.installApp(vo),
object : BaseSubscriber<BaseResponse<Any>>() { object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return }
}
override fun onError(e: Throwable) {
override fun onError(e: Throwable) { }
if (isLinkView) return
view.userRegisterOver() override fun onNext(baseResponse: BaseResponse<Any>) {
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> {
// JpushManager.getInstance().setJpushService(userId.toString())
} }
} })
}
})
} }
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.mints.fiveworld.ad.AdReportManager; ...@@ -8,6 +8,7 @@ import com.mints.fiveworld.ad.AdReportManager;
import com.mints.fiveworld.common.Constant; import com.mints.fiveworld.common.Constant;
import com.mints.fiveworld.common.DeviceInfo; import com.mints.fiveworld.common.DeviceInfo;
import com.mints.fiveworld.common.random.HitChanceConfig; import com.mints.fiveworld.common.random.HitChanceConfig;
import com.mints.fiveworld.keepalive.MateTimerManager;
import com.mints.fiveworld.keepalive.appswitch.AntiAuditManager; import com.mints.fiveworld.keepalive.appswitch.AntiAuditManager;
import com.mints.fiveworld.manager.AppHttpManager; import com.mints.fiveworld.manager.AppHttpManager;
import com.mints.fiveworld.manager.AppPreferencesManager; import com.mints.fiveworld.manager.AppPreferencesManager;
...@@ -154,7 +155,7 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -154,7 +155,7 @@ public class TrackPresenter extends BaseTrackPresenter {
if (baseResponse.getStatus() == 200) { if (baseResponse.getStatus() == 200) {
// 点击同意后 若uid为空 则调用登录接口 // 点击同意后 若uid为空 则调用登录接口
MintsApplication context = MintsApplication.getContext(); MintsApplication context = MintsApplication.getContext();
if (context != null && !com.mints.fiveworld.manager.AppPreferencesManager.INSTANCE.get(context) if (context != null && !AppPreferencesManager.INSTANCE.get(context)
.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) { .getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
if (TextUtils.isEmpty(UserManager.getInstance().getUserID())) { if (TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
TrackManager.getInstance().userLogin(); TrackManager.getInstance().userLogin();
...@@ -173,7 +174,7 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -173,7 +174,7 @@ public class TrackPresenter extends BaseTrackPresenter {
WifiDataManager.INSTANCE.getNewDay(data.getTime(), data.getSetAllToZero(), null); WifiDataManager.INSTANCE.getNewDay(data.getTime(), data.getSetAllToZero(), null);
WifiDataManager.INSTANCE.resetServerSumCountData(data.getOuterConfigs()); WifiDataManager.INSTANCE.resetServerSumCountData(data.getOuterConfigs());
// 设置本地拉黑标记 由云端控制 // 设置本地拉黑标记 由云端控制
AntiAuditManager.Companion.getInstance().resetBlack(data.getOuterConfigs().isOpen(), Constant.CARRIER_OUT_TEN_TIME); AntiAuditManager.Companion.getInstance().resetBlack(data.getOuterConfigs().isInnerAdOpen(),data.getOuterConfigs().isOpen(), Constant.CARRIER_OUT_TEN_TIME);
} }
// 设置场景上报接口开头 // 设置场景上报接口开头
...@@ -283,4 +284,53 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -283,4 +284,53 @@ public class TrackPresenter extends BaseTrackPresenter {
} }
}); });
} }
public void splashTenMate(String type) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("uid", UserManager.getInstance().getUserID());
AppHttpManager.getInstance(loanApplication)
.call(loanService.splashTenMate(vo),
new BaseSubscriber<BaseResponse<JsonObject>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<JsonObject> baseResponse) {
// 启动页直接返回
if(TextUtils.equals(type,Constant.SPLASH_10_MATE)){
return;
}
try {
if (baseResponse.getStatus() == 200) {
JsonObject data = baseResponse.getData();
if (data != null) {
boolean flag = data.get("closetimingAndToReqMinsReq").getAsBoolean();
if (flag) {//true-关 请求
MateTimerManager.getInstance().stopTimer();
TrackManager.getInstance().setMinsActive();
AdReportManager.INSTANCE.eventScene(
AdReportManager.INNER_IN,
System.currentTimeMillis(),
Constant.CARRIER_TIMER,
"",
AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_SUC.getValue());
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_MATE_TIMER_SUC.name());
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
} }
...@@ -71,13 +71,13 @@ public interface LoanService { ...@@ -71,13 +71,13 @@ public interface LoanService {
/** /**
* 保活10分钟间隔上送后台 * 保活10分钟间隔上送后台
*/ */
@POST("na/setMinsActive/v121") @POST("na/setMinsActive/v1")
Observable<BaseResponse<WifiActiveBean>> setMinsActive121(@Body Map<String, Object> vo); Observable<BaseResponse<WifiActiveBean>> setMinsActive121(@Body Map<String, Object> vo);
/** /**
* 获取应用外广告配置 * 获取应用外广告配置
*/ */
@POST("common/getOuterAdConfig") @POST("common/getOuterAdConfig/v1")
Observable<BaseResponse<OutAppConfig>> getOuterAdConfig(@Body Map<String, Object> vo); Observable<BaseResponse<OutAppConfig>> getOuterAdConfig(@Body Map<String, Object> vo);
/** /**
...@@ -89,7 +89,7 @@ public interface LoanService { ...@@ -89,7 +89,7 @@ public interface LoanService {
/** /**
* 启动页获取反策略个数 * 启动页获取反策略个数
*/ */
@POST("common/getCloseNeedInitAppsCount") @POST("common/getCloseNeedInitAppsCount/v1")
Observable<BaseResponse<SplashAppBean>> getCloseNeedInitAppsCount(@Body Map<String, Object> vo); Observable<BaseResponse<SplashAppBean>> getCloseNeedInitAppsCount(@Body Map<String, Object> vo);
/** /**
...@@ -106,6 +106,18 @@ public interface LoanService { ...@@ -106,6 +106,18 @@ public interface LoanService {
@POST("stasticis/adCall/add/tempadd") @POST("stasticis/adCall/add/tempadd")
Observable<BaseResponse<Object>> tempaddCallImp(@Body Map<String, Object> vo); Observable<BaseResponse<Object>> tempaddCallImp(@Body Map<String, Object> vo);
/**
* 定时10秒匹配接口
*/
@POST("na/reqAppTimingNextDo/v1")
Observable<BaseResponse<JsonObject>> splashTenMate(@Body Map<String, Object> vo);
/**
* 开屏页点击同意调用
*/
@POST("api/installApp")
Observable<BaseResponse<Object>> installApp(@Body Map<String, Object> vo);
/** /**
* 默认http工厂 * 默认http工厂
*/ */
......
...@@ -49,8 +49,10 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -49,8 +49,10 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
tvAboutasVersion.setOnLongClickListener { tvAboutasVersion.setOnLongClickListener {
ToastUtil.showLong( ToastUtil.showLong(
MintsApplication.getContext(), MintsApplication.getContext(),
"黑名单:" + AntiAuditManager.instance.isBlack()+ "黑名单:" + AntiAuditManager.instance.isBlack() +
"\n 应用外总开关:" + AppPreferencesManager.get().getBoolean(WifiDataManager.APP_OUT_SWITCH, false) "\n 应用外总开关:" + AppPreferencesManager.get().getBoolean(WifiDataManager.APP_OUT_SWITCH, false) +
"\n 应用内广告总开关:" + WifiDataManager.getAppInAdSwitch() +
"\n 应用内同5开关:" + WifiDataManager.getAppInFive()
) )
true true
} }
......
...@@ -130,11 +130,11 @@ class MainActivity : BaseActivity(), MainView { ...@@ -130,11 +130,11 @@ class MainActivity : BaseActivity(), MainView {
} }
permissionBuilder.request { _, _, _ -> permissionBuilder.request { _, _, _ ->
val bundle = Bundle() val bundle = Bundle()
bundle.putString( // bundle.putString(
IncreasespeedActivity.INCREASE_TYPE, // IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_BOOST // IncreasespeedActivity.INCREASE_BOOST
) // )
readyGo(IncreasespeedActivity::class.java) // readyGo(IncreasespeedActivity::class.java)
} }
} }
......
...@@ -23,6 +23,7 @@ import com.mints.fiveworld.ad.AdReportManager; ...@@ -23,6 +23,7 @@ import com.mints.fiveworld.ad.AdReportManager;
import com.mints.fiveworld.common.AppConfig; import com.mints.fiveworld.common.AppConfig;
import com.mints.fiveworld.common.Constant; import com.mints.fiveworld.common.Constant;
import com.mints.fiveworld.common.DeviceInfo; import com.mints.fiveworld.common.DeviceInfo;
import com.mints.fiveworld.keepalive.MateTimerManager;
import com.mints.fiveworld.keepalive.appswitch.AntiAuditManager; import com.mints.fiveworld.keepalive.appswitch.AntiAuditManager;
import com.mints.fiveworld.manager.AppPreferencesManager; import com.mints.fiveworld.manager.AppPreferencesManager;
import com.mints.fiveworld.manager.TrackManager; import com.mints.fiveworld.manager.TrackManager;
...@@ -449,7 +450,7 @@ public class SplashActivity extends BaseActivity implements SplashView { ...@@ -449,7 +450,7 @@ public class SplashActivity extends BaseActivity implements SplashView {
mProgressBar.startOneAnim(); mProgressBar.startOneAnim();
// 设置本地拉黑标记 由云端控制 // 设置本地拉黑标记 由云端控制
AntiAuditManager.Companion.getInstance().resetBlack(data.getOpenAll(), Constant.CARRIER_SPLASH); AntiAuditManager.Companion.getInstance().resetBlack(data.getInnerAdOpen(),data.getOpenAll(), Constant.CARRIER_SPLASH);
AppConfig.openMoney = data.getOpenMoney(); AppConfig.openMoney = data.getOpenMoney();
AntiAuditManager.Companion.getInstance().setSumCount(data.getCloseNeedInitAppsCount()); AntiAuditManager.Companion.getInstance().setSumCount(data.getCloseNeedInitAppsCount());
...@@ -462,6 +463,9 @@ public class SplashActivity extends BaseActivity implements SplashView { ...@@ -462,6 +463,9 @@ public class SplashActivity extends BaseActivity implements SplashView {
AntiAuditManager.Companion.getInstance().setBlack(true); AntiAuditManager.Companion.getInstance().setBlack(true);
AntiAuditManager.Companion.getInstance().cmtBlackToServier(AntiAuditManager.SENCE_VPN); AntiAuditManager.Companion.getInstance().cmtBlackToServier(AntiAuditManager.SENCE_VPN);
// TrackManager.getInstance().getCommonHallBaseMsg();
// TrackManager.getInstance().firstApiWithUid();
// 预加载弹窗信息流
mMainHandler.postDelayed(this::goToMainActivity, 500); mMainHandler.postDelayed(this::goToMainActivity, 500);
return; return;
} }
...@@ -487,6 +491,12 @@ public class SplashActivity extends BaseActivity implements SplashView { ...@@ -487,6 +491,12 @@ public class SplashActivity extends BaseActivity implements SplashView {
AntiAuditManager.Companion.getInstance().setBlack(true); AntiAuditManager.Companion.getInstance().setBlack(true);
AntiAuditManager.Companion.getInstance().cmtBlackToServier(AntiAuditManager.SENCE_FAZHI); AntiAuditManager.Companion.getInstance().cmtBlackToServier(AntiAuditManager.SENCE_FAZHI);
// TrackManager.getInstance().getCommonHallBaseMsg();
// TrackManager.getInstance().firstApiWithUid();
// 预加载弹窗信息流
// mProgressBar = findViewById(R.id.progressBar);
// mPreContainer = findViewById(R.id.preContainer);
mProgressBar.setCompleteNoAnim(); mProgressBar.setCompleteNoAnim();
mMainHandler.postDelayed(() -> goToMainActivity(), 500); mMainHandler.postDelayed(() -> goToMainActivity(), 500);
} else { } else {
...@@ -549,13 +559,17 @@ public class SplashActivity extends BaseActivity implements SplashView { ...@@ -549,13 +559,17 @@ public class SplashActivity extends BaseActivity implements SplashView {
break; break;
case R.id.btn_dialogper_next: case R.id.btn_dialogper_next:
isClickAgree = true; isClickAgree = true;
MateTimerManager.getInstance().init();
splashPresenter.getCloseNeedInitAppsCount(); splashPresenter.getCloseNeedInitAppsCount();
splashPresenter.userLogin(); splashPresenter.userLogin();
if (powerDialog != null && powerDialog.isShowing()) { if (powerDialog != null && powerDialog.isShowing()) {
powerDialog.dismiss(); powerDialog.dismiss();
AppPreferencesManager.INSTANCE.get().put(Constant.LOAN_PERMISSION_FLAG, false); AppPreferencesManager.INSTANCE.get().put(Constant.LOAN_PERMISSION_FLAG, false);
} }
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_SCENCE_IN_SPLASH_AGREE.name());
if (Utils.isShowNavBar(mContext)) { if (Utils.isShowNavBar(mContext)) {
// 有底部导航栏 // 有底部导航栏
......
...@@ -419,7 +419,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -419,7 +419,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress(false, Constant.CARRIER_SAFE_CHECK) ExpressManager.loadExpress(false, Constant.CARRIER_SAFE_CHECK)
} }
AppConfig.inAdShowing = true
val bundle = Bundle() val bundle = Bundle()
bundle.putString( bundle.putString(
SafeTestingActivity.INCREASE2_TYPE, SafeTestingActivity.INCREASE2_TYPE,
...@@ -437,7 +437,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -437,7 +437,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress(false, Constant.CARRIER_SPEED_TEST) ExpressManager.loadExpress(false, Constant.CARRIER_SPEED_TEST)
} }
AppConfig.inAdShowing = true
readyGo(NetTestingActivity::class.java) readyGo(NetTestingActivity::class.java)
} }
R.id.tv_morewifi -> { // 更多WIFI R.id.tv_morewifi -> { // 更多WIFI
...@@ -450,7 +450,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -450,7 +450,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
} }
AppConfig.isCanBoost = true AppConfig.isCanBoost = true
AppConfig.inAdShowing = true
val bundle = Bundle() val bundle = Bundle()
bundle.putString( bundle.putString(
IncreasespeedActivity.INCREASE_TYPE, IncreasespeedActivity.INCREASE_TYPE,
...@@ -469,7 +469,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -469,7 +469,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
} }
AppConfig.isCanClean = true AppConfig.isCanClean = true
AppConfig.inAdShowing = true
val bundle = Bundle() val bundle = Bundle()
bundle.putString( bundle.putString(
IncreasespeedActivity.INCREASE_TYPE, IncreasespeedActivity.INCREASE_TYPE,
...@@ -488,7 +488,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -488,7 +488,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
} }
AppConfig.isCanSaveBattery = true AppConfig.isCanSaveBattery = true
AppConfig.inAdShowing = true
val bundle = Bundle() val bundle = Bundle()
bundle.putString( bundle.putString(
IncreasespeedActivity.INCREASE_TYPE, IncreasespeedActivity.INCREASE_TYPE,
...@@ -517,6 +517,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -517,6 +517,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress(false, Constant.CARRIER_WIFI_BOOST) ExpressManager.loadExpress(false, Constant.CARRIER_WIFI_BOOST)
} }
AppConfig.inAdShowing = true
readyGo(SignalStrengthActivity::class.java) readyGo(SignalStrengthActivity::class.java)
} }
......
...@@ -259,20 +259,10 @@ public final class Utils { ...@@ -259,20 +259,10 @@ public final class Utils {
* @return true 加载广告 * @return true 加载广告
*/ */
public static boolean canLoadAd() { public static boolean canLoadAd() {
String channel_name = CommonUtils.getAppMetaData( // 命中黑名单=true 或 应用内广告关闭=false
MintsApplication.getContext(), if (AntiAuditManager.Companion.getInstance().isBlack() ||
"CHANNEL_NAME" !WifiDataManager.INSTANCE.getAppInAdSwitch()) {
); return false;
if (
TextUtils.equals("oppo", channel_name) ||
TextUtils.equals("meizu", channel_name) ||
TextUtils.equals("vivo", channel_name) ||
TextUtils.equals("store360", channel_name) ||
TextUtils.equals("huawei", channel_name) ||
TextUtils.equals("xiaomi", channel_name)) {
if (WifiDataManager.INSTANCE.isBlackOrClose()) {
return false;
}
} }
return true; return true;
......
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