Commit 86c4b55f authored by jyx's avatar jyx

添加debug数据显示

parent 79cc1e34
......@@ -7,6 +7,8 @@ import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.TrackManager
import com.mints.flowbox.mvp.model.OutAppConfig
import com.mints.flowbox.utils.LogUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlin.random.Random
/**
* wifi本地数据管理
......@@ -21,89 +23,89 @@ object WifiDataManager {
private const val NEW_DAY_FLAG = "NEW_DAY_FLAG"
// wifi连接
private const val WIFI_ON = "WIFI_ON" // 次数
const val WIFI_ON = "WIFI_ON" // 次数
private const val WIFI_ON_SWITCH = "WIFI_ON_SWITCH" // 开关
// wifi断开
private const val WIFI_OFF = "WIFI_OFF"
const val WIFI_OFF = "WIFI_OFF"
private const val WIFI_OFF_SWITCH = "WIFI_OFF_SWITCH"
// 充电
private const val BATTERY_ON = "BATTERY_ON"
const val BATTERY_ON = "BATTERY_ON"
private const val BATTERY_ON_SWITCH = "BATTERY_ON_SWITCH"
// 拔电
private const val BATTERY_OFF = "BATTERY_OFF"
const val BATTERY_OFF = "BATTERY_OFF"
private const val BATTERY_OFF_SWITCH = "BATTERY_OFF_SWITCH"
// 安装apk
private const val INSTALL_APK = "INSTALL_APK"
const val INSTALL_APK = "INSTALL_APK"
private const val INSTALL_APK_SWITCH = "INSTALL_APK_SWITCH"
// 更新apk
private const val UPDATE_APK = "UPDATE_APK"
const val UPDATE_APK = "UPDATE_APK"
private const val UPDATE_APK_SWITCH = "UPDATE_APK_SWITCH"
// 卸载apk
private const val UNINSTALL_APK = "UNINSTALL_APK"
const val UNINSTALL_APK = "UNINSTALL_APK"
private const val UNINSTALL_APK_SWITCH = "UNINSTALL_APK_SWITCH"
// 挂断电话
private const val TELEPHONE_OFF = "TELEPHONE_OFF"
const val TELEPHONE_OFF = "TELEPHONE_OFF"
private const val TELEPHONE_OFF_SWITCH = "TELEPHONE_OFF_SWITCH"
// 锁屏
private const val LOCK_ON = "LOCK_ON"
const val LOCK_ON = "LOCK_ON"
private const val LOCK_ON_SWITCH = "LOCK_ON_SWITCH"
// 锁屏
private const val TIMING = "TIMING"
const val TIMING = "TIMING"
private const val TIMING_SWITCH = "TIMING_SWITCH"
// 总开关
private const val APP_OUT_SWITCH = "APP_OUT_SWITCH"
// 锁屏 单位:次数
private var LOCK_TIMES = 120
var LOCK_TIMES = 120
// private var LOCK_OPEN = false
// 充电 次数及开关
private var BATTERY_ON_TIMES = 10
var BATTERY_ON_TIMES = 10
// private var BATTERY_ON_OPEN = false
// 拔电 次数及开关
private var BATTERY_OFF_TIMES = 10
var BATTERY_OFF_TIMES = 10
// private var BATTERY_OFF_OPEN = false
// 断开wifi 次数及开关
private var WIFI_OFF_TIMES = 10
var WIFI_OFF_TIMES = 10
// private var WIFI_OFF_OPEN = false
// 开启wifi 次数及开关
private var WIFI_ON_TIMES = 10
var WIFI_ON_TIMES = 10
// private var WIFI_ON_OPEN = false
// 挂断电话 次数及开关
private var PHONE_OFF_TIMES = 20
var PHONE_OFF_TIMES = 20
// private var PHONE_OFF_OPEN = false
// 安装apk 次数及开关
private var INSTALL_APK_TIMES = 20
var INSTALL_APK_TIMES = 20
// private var INSTALL_APK_OPEN = false
// 更新apk 次数及开关
private var UPDATE_APK_TIMES = 20
var UPDATE_APK_TIMES = 20
// private var UPDATE_APK_OPEN = false
// 卸载apk 次数及开关
private var UNINSTALL_APK_TIMES = 20
var UNINSTALL_APK_TIMES = 20
// private var UNINSTALL_APK_OPEN = false
// 定时 次数及开关
private var TIMING_TIMES = 20
var TIMING_TIMES = 20
// private var TIMING_OPEN = false
private var TIMING_INTERVAL = 10
var TIMING_INTERVAL = 10
// 点击home键、最近任务列表 单位:分钟
// var HOME_TIMES = 30
......@@ -196,6 +198,8 @@ object WifiDataManager {
* 是否锁屏
*/
fun getLockOn(): Boolean {
if (AntiShake.check(Random.nextInt(1232))) return false
LogUtil.d(TAG, "lockOn -> 锁屏")
// 总开关关闭 return
......
......@@ -7,10 +7,13 @@ import android.widget.FrameLayout
import androidx.core.content.ContextCompat
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.BuildConfig
import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutSimpleGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback
import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.wifi.WifiDataManager
import com.mints.flowbox.ui.activitys.CleanActivity
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.AppUtil
......@@ -22,7 +25,6 @@ import kotlinx.android.synthetic.main.activity_apk.fl_ad
import kotlinx.android.synthetic.main.activity_apk.ivImg
import kotlinx.android.synthetic.main.activity_apk.iv_close
import kotlinx.android.synthetic.main.activity_apk.tvInfo
import kotlinx.android.synthetic.main.activity_timing.*
import kotlin.random.Random
/**
......@@ -36,6 +38,8 @@ class ApkActivity : BaseActivity() {
const val APK_PKG_NAME = "APK_PKG_NAME"
}
private val sp by lazy { AppPreferencesManager.get() }
private var mApkState = 0
private var mApkPkgName = ""
......@@ -58,7 +62,7 @@ class ApkActivity : BaseActivity() {
private fun initView() {
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_clean, ivImg)
if (mApkState == 0) {
if (mApkState == 0 || mApkState == 1) {
// 应用安装
val apkInfo2 = AppUtil.getApkInfo2(this, mApkPkgName)
tvTitle.text = "安装包残留提示"
......@@ -73,6 +77,13 @@ class ApkActivity : BaseActivity() {
GlideUtils.loadImageView(this, apkInfo2.applicationIcon, ivIcon)
tvInfo2.visibility = View.VISIBLE
ivIcon.visibility = View.VISIBLE
if (BuildConfig.DEBUG) {
tvInfo2.text = "\n-测试 -> 当前应用安装剩余次数:" + sp.getInt(
WifiDataManager.INSTALL_APK,
0
) + "当前应用安装总次数:" + WifiDataManager.INSTALL_APK_TIMES
}
} else if (mApkState == 2) {
// 应用卸载
tvTitle.text = "卸载残留提示"
......@@ -87,6 +98,14 @@ class ApkActivity : BaseActivity() {
.create()
tvInfo2.visibility = View.GONE
ivIcon.visibility = View.GONE
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "\n-测试 -> 当前应用卸载剩余次数:" + sp.getInt(
WifiDataManager.UNINSTALL_APK,
0
) + "当前应用卸载总次数:" + WifiDataManager.UNINSTALL_APK_TIMES
}
}
btnClean.setOnClickListener {
......
......@@ -7,11 +7,14 @@ import android.os.Handler
import android.os.Looper
import android.view.View
import android.widget.FrameLayout
import com.mints.flowbox.BuildConfig
import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutSimpleGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.wifi.AppOutWifiAdManager
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.wifi.WifiDataManager
import com.mints.flowbox.utils.StatusBarUtil
import kotlinx.android.synthetic.main.activity_boost_fast.*
import kotlinx.android.synthetic.main.activity_boost_fast.fl_ad
......@@ -35,6 +38,8 @@ class BoostFastActivity : Activity() {
// private const val GREEN = 0xff80ff80
// }
private val sp by lazy { AppPreferencesManager.get() }
private var mType = 0
override fun onCreate(savedInstanceState: Bundle?) {
......@@ -128,6 +133,14 @@ class BoostFastActivity : Activity() {
finish()
overridePendingTransition(0, 0)
}
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 定时 弹出次数:" + sp.getInt(
WifiDataManager.TIMING,
0
) + "总次数:" + WifiDataManager.TIMING_TIMES
}
}
/**初始化信息iyc*/
......
......@@ -5,9 +5,12 @@ import android.os.Handler
import android.os.Looper
import android.view.View
import android.widget.FrameLayout
import com.mints.flowbox.BuildConfig
import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutScreenGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.wifi.WifiDataManager
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.base.OutAppActivity
import com.mints.flowbox.utils.TimeRender
......@@ -19,6 +22,8 @@ import java.util.*
class ScreenActivity : OutAppActivity(), View.OnClickListener {
private val sp by lazy { AppPreferencesManager.get() }
override fun initViewsAndEvents() {
Handler(Looper.getMainLooper()).postDelayed({
mHelper.swipeBackLayout.setEdgeSize(ToolUtil.getScreenWidth(this))
......@@ -48,10 +53,17 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
private fun resetTime() {
val date = Date()
val monthDay = TimeRender.formatDate(date, TimeRender.DEFAULT_FORMAT_MONTH_DAY)
val time = TimeRender.formatDate(date, TimeRender.DEFAULT_FORMAT_MINTER)
var time = TimeRender.formatDate(date, TimeRender.DEFAULT_FORMAT_MINTER)
tvDate.text = TimeRender.getWeek() + " " + monthDay
tvTime.text = time
if (BuildConfig.DEBUG) {
tvDate.text = "测试 -> 当前锁屏已弹出次数:" + sp.getInt(
WifiDataManager.LOCK_ON,
0
) + " 总次数:" + WifiDataManager.LOCK_TIMES
}
}
override fun onClick(v: View?) {
......
......@@ -6,6 +6,7 @@ import android.widget.FrameLayout
import androidx.core.content.ContextCompat
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.BuildConfig
import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutSimpleGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback
......@@ -13,6 +14,8 @@ import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.keepalive.AlarmManager
import com.mints.flowbox.keepalive.OutAppRouter
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.wifi.WifiDataManager
import com.mints.flowbox.ui.activitys.Increasespeed2Activity
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.SpeedFastActivity
......@@ -21,11 +24,16 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.SpanUtils
import com.mints.flowbox.utils.SystemUtils
import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_apk.*
import kotlinx.android.synthetic.main.activity_boost_fast.*
import kotlinx.android.synthetic.main.activity_screen.*
import kotlinx.android.synthetic.main.activity_timing.*
import kotlinx.android.synthetic.main.activity_timing.btnClean
import kotlinx.android.synthetic.main.activity_timing.fl_ad
import kotlinx.android.synthetic.main.activity_timing.ivImg
import kotlinx.android.synthetic.main.activity_timing.iv_close
import kotlinx.android.synthetic.main.activity_timing.tvInfo
import kotlinx.android.synthetic.main.activity_timing.tvInfo2
import kotlin.random.Random
/**
......@@ -63,6 +71,8 @@ class TriggerActivity : BaseActivity() {
private var rope: YoYo.YoYoString? = null
private val sp by lazy { AppPreferencesManager.get() }
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
......@@ -95,6 +105,14 @@ class TriggerActivity : BaseActivity() {
.append("吧!")
.create()
btnClean.text = "立即提速"
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "-测试 -> 当前 连接WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_ON,
0
) + "总次数:" + WifiDataManager.WIFI_ON_TIMES
}
}
TRIGGER_TYPE_WIFI_TEST -> { // wifi测速
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_test, ivImg)
......@@ -105,6 +123,14 @@ class TriggerActivity : BaseActivity() {
.append("吧!")
.create()
btnClean.text = "WIFI测速"
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "-测试 -> 当前 连接WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_ON,
0
) + "总次数:" + WifiDataManager.WIFI_ON_TIMES
}
}
TRIGGER_TYPE_WIFI_SAFE -> { // wifi安全检测
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_safe, ivImg)
......@@ -115,6 +141,14 @@ class TriggerActivity : BaseActivity() {
.append("吧!")
.create()
btnClean.text = "WIFI安全检测"
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "-测试 -> 当前 连接WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_ON,
0
) + "总次数:" + WifiDataManager.WIFI_ON_TIMES
}
}
TRIGGER_TYPE_WIFI_DISCONNECT_TEST -> { // wifi断开时测速
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_test, ivImg)
......@@ -122,6 +156,14 @@ class TriggerActivity : BaseActivity() {
.append("检测到您的WIFI已断开连接,网络质量\n有所下降,快来测试一下当前网速吧!")
.create()
btnClean.text = "网络测速"
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "-测试 -> 当前 断开WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_OFF,
0
) + "总次数:" + WifiDataManager.WIFI_OFF_TIMES
}
}
TRIGGER_TYPE_WIFI_DISCONNECT_BOOST -> { // wifi断开时加速
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_boost, ivImg)
......@@ -129,6 +171,14 @@ class TriggerActivity : BaseActivity() {
.append("检测到您的WIFI已断开连接,网络\n质量有所下降,快来进行网络优化吧!")
.create()
btnClean.text = "网络优化"
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "-测试 -> 当前 断开WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_OFF,
0
) + "总次数:" + WifiDataManager.WIFI_OFF_TIMES
}
}
TRIGGER_TYPE_BOOST -> { // 一键加速
val usedPercentValue = SystemUtils.getUsedPercentValue(mContext)
......@@ -141,6 +191,7 @@ class TriggerActivity : BaseActivity() {
.append("可大幅提示手机运行速度")
.create()
btnClean.text = "一键加速"
}
TRIGGER_TYPE_SAVE_ELE -> { // 省电
AppConfig.fakeSaveBatteryCount = 1 + Random.nextInt(8)
......@@ -155,6 +206,14 @@ class TriggerActivity : BaseActivity() {
.append("耗电应用可节省更多电量")
.create()
btnClean.text = "一键省电"
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "-测试 -> 当前 拔电 弹出次数:" + sp.getInt(
WifiDataManager.BATTERY_OFF,
0
) + "总次数:" + WifiDataManager.BATTERY_OFF_TIMES
}
}
TRIGGER_TYPE_PHONE -> { // 电话挂断
......@@ -165,6 +224,14 @@ class TriggerActivity : BaseActivity() {
.create()
phoneContainer.visibility = View.VISIBLE
btnClean.visibility = View.GONE
if (BuildConfig.DEBUG) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "-测试 -> 当前 电话挂断 弹出次数:" + sp.getInt(
WifiDataManager.TELEPHONE_OFF,
0
) + "总次数:" + WifiDataManager.PHONE_OFF_TIMES
}
}
else -> {
finish()
......
......@@ -61,6 +61,16 @@
android:textColor="@color/color_40000000"
android:textSize="12sp" />
<TextView
android:id="@+id/tvInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="12sp"
android:visibility="gone" />
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="wrap_content"
......
......@@ -11,8 +11,8 @@
<ImageView
android:id="@+id/iv_left_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:padding="10dp"
......
......@@ -67,6 +67,19 @@
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/tvInfo2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="center"
android:text="-"
android:textColor="@color/black"
android:textSize="16sp"
android:visibility="gone" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/phoneContainer"
android:layout_width="match_parent"
......
......@@ -10,7 +10,7 @@
android:id="@+id/iv_left_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="14dp"
android:padding="15dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
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