Commit e15ea854 authored by mengcuiguang's avatar mengcuiguang

1、添加风控规则 2、热门活动添加游戏 3、按用户渠道匹配代码位 4、优化黑名单校验 代码优化

parent 49d3c7e6
......@@ -9,8 +9,8 @@ android {
applicationId "com.mints.goodmoney"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 7
versionName "1.0.6"
versionCode 8
versionName "1.0.7"
flavorDimensions "default"
// dex突破65535的限制
......@@ -105,8 +105,7 @@ android {
productFlavors {
goodmoneypkg {}
// toutiao {}
// sougou_123 {}
toutiao {}
}
productFlavors.all {
......
......@@ -13,6 +13,7 @@ import androidx.multidex.MultiDexApplication;
import com.bun.miitmdid.core.JLibrary;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.ChannelManager;
import com.mints.goodmoney.manager.LiebaoManager;
import com.mints.goodmoney.manager.MhManager;
import com.mints.goodmoney.manager.MiitHelper;
......@@ -105,10 +106,8 @@ public class MintsApplication extends MultiDexApplication {
// 移动安全联盟 oaid
initMiitHelper();
// 按包渠道更新代码位
TtCsjAdManager.updataIdByChannel();
YlhAdManager.INSTANCE.updataIdByChannel();
// 按渠道匹配代码位
ChannelManager.INSTANCE.updataCodeIdForRegisterChannel(null);
// 子线程初始化三方SDK
String processName = SystemUtils.INSTANCE.getProcessName(this, android.os.Process.myPid());
......
......@@ -43,6 +43,7 @@ object BannerManager {
.setCodeId(codeId) //广告位id
.setSupportDeepLink(true)
.setAdCount(1) //请求广告数量为1到3条
.setNativeAdType(AdSlot.TYPE_BANNER)
.setExpressViewAcceptedSize(expressViewAcceptedSizeWidth, expressViewAcceptedSizeHeight) //期望模板广告view的size,单位dp
.setImageAcceptedSize(640, 320) //这个参数设置即可,不影响模板广告的size
.build()
......
......@@ -28,6 +28,11 @@ public class AppConfig {
*/
public static boolean app_black_flag = false;
/**
* 用户渠道对应代码位
*/
public static String user_channel_ad = "";
/**
* 趣步赚成功标记
*/
......
......@@ -175,6 +175,7 @@ object Constant {
const val HOT_ACTIVITY_CAICY = "ccy"
const val HOT_ACTIVITY_BOOK = "readBook"
const val HOT_ACTIVITY_NEWS = "TO_RUISHI"
const val HOT_ACTIVITY_DHGAME = "dhGame"
// 打开激活
const val FIRST_DEVICE_FLAG = "first_device_flag"
......@@ -206,4 +207,10 @@ object Constant {
const val WRAPPER_TYPE_NEWS = 0
const val WRAPPER_TYPE_BOOK = 1
//1登录,2提现,3任务
const val RISK_EVENT_ID_LOGIN = 1
const val RISK_EVENT_ID_DRAWCASH = 2
const val RISK_EVENT_ID_TASK = 3
}
......@@ -2,13 +2,16 @@ package com.mints.goodmoney.common
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.ApplicationInfo
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.ConnectivityManager
import android.net.NetworkInfo
import android.net.Proxy
import android.net.wifi.WifiInfo
import android.net.wifi.WifiManager
import android.os.BatteryManager
import android.os.Build
import android.os.SystemClock
import android.provider.Settings
......@@ -115,7 +118,7 @@ class DeviceInfo private constructor() {
/**
* 是否使用vpn 需使用网络权限
*/
val isVPN: Boolean
val isVPN: Int
get() {
try {
val niList = NetworkInterface.getNetworkInterfaces()
......@@ -125,14 +128,14 @@ class DeviceInfo private constructor() {
continue
}
if ("tun0" == intf.name || "ppp0" == intf.name) {
return true // The VPN is up
return 1 // The VPN is up
}
}
}
} catch (e: Throwable) {
e.printStackTrace()
}
return false
return 0
}
/**
......@@ -864,6 +867,77 @@ class DeviceInfo private constructor() {
return "02:00:00:00:00:00"
}
/**
* 否充电中
*/
val isCharging: Int
get() {
try {
val batteryBroadcast: Intent? = mContext!!.registerReceiver(null,
IntentFilter(Intent.ACTION_BATTERY_CHANGED))
val isCharging = batteryBroadcast?.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) != 0
if (isCharging) {
return 1
}
} catch (e: Exception) {
e.printStackTrace()
}
return 0
}
/**
* 否处于USB调试模式
*/
val getUsbStatus: Int
get() {
try {
val enableAdb = Settings.Secure.getInt(
mContext!!.contentResolver, Settings.Secure.ADB_ENABLED, 0) > 0
if (enableAdb) {
return 1
}
} catch (e: Exception) {
e.printStackTrace()
}
return 0
}
/**
* 是否连接wifi
*/
val getWifiConnected: Int
get() {
try {
val connectivityManager = mContext!!.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val activeNetInfo: NetworkInfo? = connectivityManager.activeNetworkInfo
if (activeNetInfo != null && activeNetInfo.getType() === ConnectivityManager.TYPE_WIFI) {
return 1
}
} catch (e: Exception) {
e.printStackTrace()
}
return 0
}
/**
* 是否root
*/
val isRoot: Int
get() {
var file: File? = null
val paths = arrayOf("/system/bin/", "/system/xbin/", "/system/sbin/", "/sbin/", "/vendor/bin/", "/su/bin/")
try {
for (path in paths) {
file = File(path + "su")
if (file.exists() && file.canExecute()) {
return 1
}
}
} catch (x: java.lang.Exception) {
x.printStackTrace()
}
return 0
}
companion object {
private var _inst: DeviceInfo? = null
......
package com.mints.goodmoney.manager
import com.mints.goodmoney.mvp.model.AdcodeBean
import com.mints.goodmoney.mvp.model.UserMsgBean
/**
* 渠道管理, 根据渠道名称 调用不同的代码位
* 渠道管理
*/
object ChannelManager {
const val CHANNEL_XIAOJUJI = "xiaojuji"
const val CHANNEL_ZITOU = "zitou"
const val CHANNEL_QIAOSHUI = "qiaoshui"
const val CHANNEL_SOUGOU = "sougou"
const val CHANNEL_TOUTIAO = "toutiao"
const val CHANNEL_QUTOUTIAO = "qutoutiao"
/**
* 按用户注册渠道 动态更新代码位
*/
fun updataCodeIdForRegisterChannel(idBean: AdcodeBean?) {
TtCsjAdManager.updataIdByChannel(idBean)
YlhAdManager.updataIdByChannel(idBean)
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
import com.bytedance.sdk.openadsdk.TTNativeExpressAd;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.ToastUtil;
import java.util.List;
......@@ -84,6 +85,9 @@ public class TTNativeExpressManager {
@Override
public void onError(int code, String message) {
LogUtil.d("通用TTNativeExpressManager", "onError " + code + message);
if (view != null) {
view.removeAllViews();
}
......
......@@ -8,6 +8,8 @@ import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.mvp.model.AdcodeBean;
import com.mints.goodmoney.mvp.model.UserMsgBean;
import com.mints.library.utils.CommonUtils;
/**
......@@ -18,8 +20,6 @@ public class TtCsjAdManager {
public static final String TT_AD_APPID = "5113521";
public static final String TT_AD_NAME = Constant.MINTS_APP_NAME;
// 按渠道划分代码位
//============================== 版本升级、分享 START ==============================
/*banner*/
public static String TT_AD_BANNER_MY = "945661050";// 个人中心
public static String TT_AD_BANNER_JULEYUN = "945675532";// 聚乐云
......@@ -44,7 +44,6 @@ public class TtCsjAdManager {
/*插屏广告*/
public static String TT_AD_INSERT_LOADING_ID_LIEBAO = "945608874";//猎豹游戏加载时
public static String TT_AD_INSERT_LOADING_ID_JULEYUN = "945675533";//聚乐云
//============================== 版本升级、分享 END ==============================
private static boolean sInit;
......@@ -96,61 +95,64 @@ public class TtCsjAdManager {
/**
* 按包渠道更新代码位
*/
public static void updataIdByChannel() {
String channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME");
if (channel.contains(ChannelManager.CHANNEL_ZITOU)
|| channel.contains(ChannelManager.CHANNEL_XIAOJUJI)
|| channel.contains(ChannelManager.CHANNEL_QIAOSHUI)) {
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945666217";
TT_AD_NATIVEEXPRESS_WALK = "945666097";
TT_AD_NATIVEEXPRESS_WATER = "945666097";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945666097";
TT_AD_NATIVEEXPRESS_EAT = "945666097";
// 激励视频
TT_AD_VEDIO_DRINK = "945666029";
TT_AD_VEDIO_MAIN = "945666029";
TT_AD_VEDIO_ERASE = "945666029";
TT_AD_VEDIO_TURNABLE = "945666029";
TT_AD_VEDIO_MOREDIALOG = "945666029";
// banner
TT_AD_BANNER_MY="945666042";
} else if (channel.contains(ChannelManager.CHANNEL_SOUGOU)) {
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945666318";
TT_AD_NATIVEEXPRESS_WALK = "945666243";
TT_AD_NATIVEEXPRESS_WATER = "945666243";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945666243";
TT_AD_NATIVEEXPRESS_EAT = "945666243";
// 激励视频
TT_AD_VEDIO_DRINK = "945666260";
TT_AD_VEDIO_MAIN = "945666260";
TT_AD_VEDIO_ERASE = "945666260";
TT_AD_VEDIO_TURNABLE = "945666260";
TT_AD_VEDIO_MOREDIALOG = "945666260";
// banner
TT_AD_BANNER_MY="945666251";
} else if (channel.contains(ChannelManager.CHANNEL_QUTOUTIAO)) {
public static void updataIdByChannel(AdcodeBean idBean) {
// 渠道对象为空
if (idBean == null) {
String channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME");
if (channel.contains(ChannelManager.CHANNEL_TOUTIAO)) {
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945666217";
TT_AD_NATIVEEXPRESS_WALK = "945666097";
TT_AD_NATIVEEXPRESS_WATER = "945666097";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945666097";
TT_AD_NATIVEEXPRESS_EAT = "945666097";
// 激励视频
TT_AD_VEDIO_DRINK = "945666029";
TT_AD_VEDIO_MAIN = "945666029";
TT_AD_VEDIO_ERASE = "945666029";
TT_AD_VEDIO_TURNABLE = "945666029";
TT_AD_VEDIO_MOREDIALOG = "945666029";
// banner
TT_AD_BANNER_MY="945666042";
} else {
// 自有默认
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945562047";
TT_AD_NATIVEEXPRESS_WALK = "945562480";
TT_AD_NATIVEEXPRESS_WATER = "945562698";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945627921";
TT_AD_NATIVEEXPRESS_EAT = "945627922";
// 激励视频
TT_AD_VEDIO_DRINK = "945562032";
TT_AD_VEDIO_MAIN = "945562036";
TT_AD_VEDIO_ERASE = "945562037";
TT_AD_VEDIO_TURNABLE = "945562039";
TT_AD_VEDIO_MOREDIALOG = "945562040";
// banner
TT_AD_BANNER_MY="945661050";
}
} else {
// 后台返回 用户注册渠道
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945681112";
TT_AD_NATIVEEXPRESS_WALK = "945681145";
TT_AD_NATIVEEXPRESS_WATER = "945681145";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945681145";
TT_AD_NATIVEEXPRESS_EAT = "945681145";
TT_AD_NATIVEEXPRESS_AWARD = idBean.getCsj().getCsjv1();
TT_AD_NATIVEEXPRESS_WALK = idBean.getCsj().getCsjv2();
TT_AD_NATIVEEXPRESS_WATER = idBean.getCsj().getCsjv2();
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = idBean.getCsj().getCsjv2();
TT_AD_NATIVEEXPRESS_EAT = idBean.getCsj().getCsjv2();
// 激励视频
TT_AD_VEDIO_DRINK = "945681060";
TT_AD_VEDIO_MAIN = "945681060";
TT_AD_VEDIO_ERASE = "945681060";
TT_AD_VEDIO_TURNABLE = "945681060";
TT_AD_VEDIO_MOREDIALOG = "945681060";
TT_AD_VEDIO_DRINK = idBean.getCsj().getCsjv3();
TT_AD_VEDIO_MAIN = idBean.getCsj().getCsjv3();
TT_AD_VEDIO_ERASE = idBean.getCsj().getCsjv3();
TT_AD_VEDIO_TURNABLE =idBean.getCsj().getCsjv3();
TT_AD_VEDIO_MOREDIALOG = idBean.getCsj().getCsjv3();
// banner
TT_AD_BANNER_MY="945681032";
TT_AD_BANNER_MY=idBean.getCsj().getCsjv4();
}
}
}
......@@ -2,6 +2,8 @@ package com.mints.goodmoney.manager
import android.content.Context
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.mvp.model.AdcodeBean
import com.mints.goodmoney.mvp.model.UserMsgBean
import com.mints.library.utils.CommonUtils
import com.qq.e.comm.managers.GDTADManager
......@@ -15,8 +17,6 @@ object YlhAdManager {
const val YLH_AD_APPID = "1111046903"
// 按渠道划分代码位
//============================== 版本升级、分享 START ==============================
/* splash-postid */
var YLH_AD_SPLASH_POSTID = "7021944730189381"
......@@ -35,7 +35,6 @@ object YlhAdManager {
/* 插屏 */
var YLH_AD_INTERSTITIALAD_LIEBAO = "1021648750986824" //猎豹
var YLH_AD_INTERSTITIALAD_JULEYUN = "4051047730890430" //聚乐云
//============================== 版本升级、分享 END ==============================
/**
* 广告初始化
......@@ -45,42 +44,46 @@ object YlhAdManager {
}
/**
* 按包渠道更新代码位
* 更新代码位
*/
fun updataIdByChannel() {
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (channel.contains(ChannelManager.CHANNEL_ZITOU)
|| channel.contains(ChannelManager.CHANNEL_XIAOJUJI)
|| channel.contains(ChannelManager.CHANNEL_QIAOSHUI)) {
// 开屏
YLH_AD_SPLASH_POSTID = "4031840694338658"
fun updataIdByChannel(idBean: AdcodeBean?) {
// 渠道对象为空
if (idBean == null) {
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (channel.contains(ChannelManager.CHANNEL_TOUTIAO)) {
// 头条
// 开屏
YLH_AD_SPLASH_POSTID = "4031840694338658"
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "7091944614237712"
YLH_AD_VEDIO_MAIN_POSTID = "7091944614237712"
YLH_AD_VEDIO_ERASE_POSTID = "7091944614237712"
YLH_AD_VEDIO_TURNABLE_POSTID = "7091944614237712"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "7091944614237712"
} else if (channel.contains(ChannelManager.CHANNEL_SOUGOU)) {
// 开屏
YLH_AD_SPLASH_POSTID = "7081140694738761"
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "7091944614237712"
YLH_AD_VEDIO_MAIN_POSTID = "7091944614237712"
YLH_AD_VEDIO_ERASE_POSTID = "7091944614237712"
YLH_AD_VEDIO_TURNABLE_POSTID = "7091944614237712"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "7091944614237712"
} else {
// 自有默认
// 开屏
YLH_AD_SPLASH_POSTID = "7021944730189381"
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "8081841664335704"
YLH_AD_VEDIO_MAIN_POSTID = "8081841664335704"
YLH_AD_VEDIO_ERASE_POSTID = "8081841664335704"
YLH_AD_VEDIO_TURNABLE_POSTID = "8081841664335704"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "8081841664335704"
} else if (channel.contains(ChannelManager.CHANNEL_QUTOUTIAO)) {
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "2031043750380462"
YLH_AD_VEDIO_MAIN_POSTID = "8081940760988417"
YLH_AD_VEDIO_ERASE_POSTID = "9061142700180449"
YLH_AD_VEDIO_TURNABLE_POSTID = "5051746700185561"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "9001346780383626"
}
} else {
// 后台返回 用户注册渠道
// 开屏
YLH_AD_SPLASH_POSTID = "8001943784580831"
YLH_AD_SPLASH_POSTID = idBean.ylh.ylhv1
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "1001649784690072"
YLH_AD_VEDIO_MAIN_POSTID = "1001649784690072"
YLH_AD_VEDIO_ERASE_POSTID = "1001649784690072"
YLH_AD_VEDIO_TURNABLE_POSTID = "1001649784690072"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "1001649784690072"
YLH_AD_VEDIO_DRINK_POSTID = idBean.ylh.ylhv2
YLH_AD_VEDIO_MAIN_POSTID = idBean.ylh.ylhv2
YLH_AD_VEDIO_ERASE_POSTID = idBean.ylh.ylhv2
YLH_AD_VEDIO_TURNABLE_POSTID = idBean.ylh.ylhv2
YLH_AD_VEDIO_MOREDIALOG_POSTID = idBean.ylh.ylhv2
}
}
}
\ No newline at end of file
package com.mints.goodmoney.mvp.model;
import java.io.Serializable;
/**
* 用户渠道对应代码位
*/
public class AdcodeBean implements Serializable {
private CsjBean csj;
private YlhBean ylh;
private String key;
public CsjBean getCsj() {
return csj;
}
public YlhBean getYlh() {
return ylh;
}
public String getKey() {
return key;
}
public class CsjBean implements Serializable {
private String csjv1;//奖励弹框信息流
private String csjv2;//喝水等 通用信息流
private String csjv3;//激励视频
private String csjv4;//Banner
public String getCsjv1() {
return csjv1;
}
public String getCsjv2() {
return csjv2;
}
public String getCsjv3() {
return csjv3;
}
public String getCsjv4() {
return csjv4;
}
}
public class YlhBean implements Serializable {
private String ylhv1;//开屏
private String ylhv2;//激励
public String getYlhv1() {
return ylhv1;
}
public String getYlhv2() {
return ylhv2;
}
}
}
package com.mints.goodmoney.mvp.model;
import java.io.Serializable;
public class UserRiskAppsBean implements Serializable {
private String userRiskAppName;
private String userRiskAppPkg;
public String getUserRiskAppName() {
return userRiskAppName;
}
public String getUserRiskAppPkg() {
return userRiskAppPkg;
}
}
......@@ -9,9 +9,10 @@ public class UserTaskMsgBean implements Serializable {
private UserMsgBean userMsg;
private VedioRulesBean vedioRules;
private BlessingBigMsgBean blessingBigMsg;
private UserRiskAppsBean userRiskApps;
private AdcodeBean adcode;
private String ip;
private String userRiskApp;
public BlessingBigMsgBean getBlessingBigMsgBean() {
return blessingBigMsg;
......@@ -76,7 +77,11 @@ public class UserTaskMsgBean implements Serializable {
return ip;
}
public String getUserRiskApp() {
return userRiskApp;
public UserRiskAppsBean getUserRiskApps() {
return userRiskApps;
}
public AdcodeBean getAdcode() {
return adcode;
}
}
......@@ -2,8 +2,10 @@ package com.mints.goodmoney.mvp.presenters;
import android.text.TextUtils;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
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.ShumeiManager;
......@@ -49,7 +51,12 @@ public class AwardPresenter extends BasePresenter<AwardView> {
case 200://成功
JsonObject data = baseResponse.getData();
if (data != null) {
view.getUserTaskMsgSuc(data.get("coin").getAsInt());
boolean riskFlag = false;
JsonElement riskinfoRateElement = data.get("riskinfoRate");
if (riskinfoRateElement != null) {
riskFlag = data.get("riskinfoRate").getAsBoolean();
}
view.getUserTaskMsgSuc(data.get("coin").getAsInt(),riskFlag );
}
break;
default:
......@@ -145,4 +152,55 @@ 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.isWifi());
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) {
}
});
}
});
}
}
......@@ -6,6 +6,7 @@ import android.view.animation.AccelerateDecelerateInterpolator;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
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.ShumeiManager;
......@@ -152,6 +153,9 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo.put("oaid", MintsApplication.OAID);
}
riskinfo(deviceInfo,getT());
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
new BaseSubscriber<BaseResponse<UserBean>>() {
......@@ -227,4 +231,47 @@ 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.isWifi());
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) {
}
});
}
}
package com.mints.goodmoney.mvp.presenters
import android.content.pm.ApplicationInfo
import android.text.TextUtils
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant
......@@ -17,8 +16,6 @@ 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
import com.mints.library.utils.json.JsonUtil
import net.grandcentrix.tray.AppPreferences
import java.util.*
class LoginPresenter : BasePresenter<LoginView>() {
......@@ -254,6 +251,8 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
vo["appPkgList"] = t.toString()
riskinfo(deviceInfo, t.toString())
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
......@@ -281,4 +280,43 @@ 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.isWifi
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
......@@ -6,5 +6,5 @@ interface AwardView : BaseView {
/**
* 获取用户配置信息成功
*/
fun getUserTaskMsgSuc(coin: Int)
fun getUserTaskMsgSuc(coin: Int,riskFlag:Boolean)
}
\ No newline at end of file
......@@ -444,6 +444,14 @@ public interface LoanService {
@POST("api/addCashoutVedio")
Observable<BaseResponse<Object>> drawcashVideo();
/**
* 风控信息
*
* @return
*/
@POST("api/riskinfo/save")
Observable<BaseResponse<Object>> riskinfo(@Body Map<String, Object> vo);
/**
* 默认http工厂
*/
......
......@@ -49,6 +49,7 @@ public class OkHttpInterceptor implements Interceptor {
// 穿山甲分包渠道
String ttChannel = HumeSDK.getChannel(MintsApplication.getContext());
if (!TextUtils.isEmpty(ttChannel)) {
// 此处方式不能修改,已和后端约定
channel = channel + "_" + ttChannel;
}
} catch (Exception e) {
......
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.view.View.OnLongClickListener
import com.bytedance.hume.readapk.HumeSDK
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.utils.ToastUtil
......@@ -33,8 +35,9 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
ivAboutasIcon.setOnLongClickListener(OnLongClickListener {
ToastUtil.showLong(MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") +
"\n 头条渠道:" + HumeSDK.getChannel(context) +
"\n 头条version:" + HumeSDK.getVersion())
"\n\n 广告:" + AppConfig.user_channel_ad +
"\n\n 头条渠道:" + HumeSDK.getChannel(context) +
"\n\n 头条version:" + HumeSDK.getVersion())
true
})
......
......@@ -459,7 +459,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
override fun getUserTaskMsgSuc(coin: Int) {
override fun getUserTaskMsgSuc(coin: Int, riskFlag: Boolean) {
val sumCoin = coin.toString()
val allcoinBig = BigDecimal(sumCoin)
val rateBig = BigDecimal("10000")
......@@ -474,6 +474,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
.append("元").setFontSize(40).setForegroundColor(resources.getColor(R.color.color_333))
.create()
)
// 上传风控信息
if (riskFlag) {
awardPresenter.riskinfo()
}
}
/**
......
......@@ -7,6 +7,7 @@ import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import com.mints.goodmoney.ui.fragment.RsNewsFragment
import com.mints.goodmoney.ui.fragment.ZhangyueFragment
import kotlinx.android.synthetic.main.header_layout.*
/**
......@@ -56,7 +57,7 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
}
Constant.WRAPPER_TYPE_BOOK -> {
tv_title.text = "书城"
val zhangyueFragment = MyZhangyueFragment()
val zhangyueFragment = ZhangyueFragment()
if (!zhangyueFragment.isAdded()) {
// 提交事务
supportFragmentManager.beginTransaction()
......
......@@ -17,8 +17,7 @@ import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.yilan.sdk.player.ylplayer.YLPlayerConfig
import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import com.yilan.sdk.ui.category.ChannelFragment
import kotlinx.android.synthetic.main.fragment_horiz_channel.cdvvYilanTime
import kotlinx.android.synthetic.main.fragment_horiz_channel.vs_tips
import kotlinx.android.synthetic.main.layout_red_box.*
import net.grandcentrix.tray.AppPreferences
/**
......@@ -165,9 +164,8 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
cdvvYilanTime.setCountDownVedioListener {
if (isFirstWatchVideo) {
// 第一次观看完视频提醒用户
val vs = vs_tips.inflate()
Handler(Looper.getMainLooper()).postDelayed({
vs.visibility = View.GONE
vs_tips.visibility = View.GONE
}, 3000)
isFirstWatchVideo = false
}
......
......@@ -15,10 +15,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.TTPreLoadExpressManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.WnManager
import com.mints.goodmoney.manager.*
import com.mints.goodmoney.mvp.model.MainVedioMsgBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.mvp.presenters.HomePresenter
......@@ -198,8 +195,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 保存Ip,用于穿山甲回调校验
ps.put(Constant.CSJ_VEDIO_APPIP, data.ip)
// AppConfig.app_black = data.userRiskApp
AppConfig.app_black_name = data.userRiskApps.userRiskAppName
AppConfig.app_black_pkg = data.userRiskApps.userRiskAppPkg
AppConfig.flVideoFlag = data.vedioRules.isFlVideoFlag
AppConfig.user_channel_ad=data.adcode.key
ChannelManager.updataCodeIdForRegisterChannel(data.adcode)
// 新人福利 放到个人中心展示 防止首页红包转动异常
......
......@@ -54,7 +54,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
mainFragment = MainFragment()
liebaoGameFragment = LiebaoGameFragment()
fragments.add(mainFragment!!)
fragments.add(ZhangyueFragment())
fragments.add(MyZhangyueFragment())
fragments.add(RsNewsFragment())
fragments.add(liebaoGameFragment!!)
......@@ -83,14 +83,6 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
override fun onTabSelected(tab: XTabLayout.Tab) {
// if (tab.position == 3) {
// if (!UserManager.getInstance().userIsLogin()) {
// readyGo(WxLoginActivity::class.java)
// vpFragmentMoney.currentItem = if (curPosition == 3) 0 else curPosition
// return
// }
// }
curPosition = tab.position
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import com.mints.goodmoney.ad.banner.BannerManager
import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.manager.*
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter
......@@ -115,8 +116,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MY) {
// val instance = DeviceInfo.instance
// LogUtil.d(TAG,"否充电中:${instance.isCharging} 否处于USB调试模式:${instance.getUsbStatus} 是否处于wifi条件:${instance.getWifiConnected} 是否root:${instance.isRoot} ")
showToast(Utils.isStartAccessibilityService().toString())
if (!TextUtils.isEmpty(userManager.userID)) {
myPresenter.getAutoUserHallBaseMsg()
......@@ -216,8 +218,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 更新权重
initAdWeight(data)
// AppConfig.app_black = data.userRiskApp
AppConfig.app_black_name = data.userRiskApps.userRiskAppName
AppConfig.app_black_pkg = data.userRiskApps.userRiskAppPkg
AppConfig.flVideoFlag = data.vedioRules.isFlVideoFlag
AppConfig.user_channel_ad=data.adcode.key
ChannelManager.updataCodeIdForRegisterChannel(data.adcode)
// 新人福利
......@@ -713,6 +718,14 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
readyGo(FoodSubsidyActivity::class.java)
}
Constant.HOT_ACTIVITY_DHGAME -> {
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
return
}
readyGo(DhGameActivity::class.java)
}
else -> {
if (!TextUtils.isEmpty(hotBean.url) && !TextUtils.isEmpty(hotBean.title)) {
val bundle = Bundle()
......
package com.mints.goodmoney.ui.fragment
import android.os.Build
import android.view.View
import android.webkit.WebSettings
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.presenters.BookPresenter
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import kotlinx.android.synthetic.main.fragment_main_xmly.*
/**
* 描述:喜马拉雅
* 作者:孟崔广
*/
class XmlyFragment : LazyLoadBaseFragment(), View.OnClickListener {
private val bookPresenter by lazy { BookPresenter() }
override fun getContentViewLayoutID() = R.layout.fragment_main_xmly
override fun initViewsAndEvents() {
// bookPresenter.attachView(this)
}
override fun onFragmentFirstVisible() {
loadUrl()
initListener()
}
override fun onFragmentResume() {
super.onFragmentResume()
// if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
// bookPresenter.getReadInfo()
// }
}
override fun onClick(v: View) {
when (v.id) {
R.id.ivXmlyBack -> {
xmly_webview.goBack()
}
}
}
override fun onDestroy() {
super.onDestroy()
// bookPresenter.detachView()
}
/**
* 加载H5Game
*/
private fun loadUrl() {
xmly_webview?.let {
val loadUrl = "http://open.ximalaya.com/new-site/#index/448/ff71a11162f20808f9f349452dd9e141"
val settings = it.settings
// 本地 DOM 存储(解决加载某些网页出现白板现象)
settings.domStorageEnabled = true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// 解决 Android 5.0 上 WebView 默认不允许加载 Http 与 Https 混合内容
settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
}
settings.javaScriptEnabled = true
settings.javaScriptCanOpenWindowsAutomatically = true
it.loadUrl(loadUrl)
}
}
private fun initListener() {
ivXmlyBack.setOnClickListener(this)
}
}
\ No newline at end of file
......@@ -6,34 +6,7 @@
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/ivDhBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:layout_marginLeft="20dp"
android:text="主菜单"
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/tvDhRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/ivDhBack"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="重新加载"
android:textColor="@color/black"
android:layout_marginLeft="20dp"
android:textSize="16sp" />
</RelativeLayout>
<include layout="@layout/header_layout" />
<WebView
android:id="@+id/dh_webview"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<TextView
android:id="@+id/ivXmlyBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="6dp"
android:text="返回"
android:textColor="@color/black"
android:textSize="14sp" />
<WebView
android:id="@+id/xmly_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="none"
android:overScrollMode="never" />
</LinearLayout>
\ No newline at end of file
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