Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fiveworld
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_fiveworld
Commits
73aa3a4b
Commit
73aa3a4b
authored
Jan 05, 2022
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
228085c2
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
7 additions
and
795 deletions
+7
-795
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+0
-22
MintsApplication.java
app/src/main/java/cn/mingc/golden/MintsApplication.java
+1
-0
DeviceInfo.kt
app/src/main/java/cn/mingc/golden/common/DeviceInfo.kt
+0
-106
InstallKeeper.kt
...main/java/cn/mingc/golden/common/install/InstallKeeper.kt
+0
-22
InstallService.kt
...ain/java/cn/mingc/golden/common/install/InstallService.kt
+0
-48
InstallWatch.kt
.../main/java/cn/mingc/golden/common/install/InstallWatch.kt
+0
-49
BroadcastReceiver.kt
.../main/java/cn/mingc/golden/mreceiver/BroadcastReceiver.kt
+0
-41
NotificationService.java
...n/java/cn/mingc/golden/mreceiver/NotificationService.java
+0
-220
WifiWatch.kt
app/src/main/java/cn/mingc/golden/mreceiver/WifiWatch.kt
+0
-71
IncreasespeedActivity.kt
...ava/cn/mingc/golden/ui/activitys/IncreasespeedActivity.kt
+2
-71
NetTestingActivity.kt
...n/java/cn/mingc/golden/ui/activitys/NetTestingActivity.kt
+0
-7
OneCleanActivity.kt
...ain/java/cn/mingc/golden/ui/activitys/OneCleanActivity.kt
+0
-5
SafeTestingActivity.kt
.../java/cn/mingc/golden/ui/activitys/SafeTestingActivity.kt
+0
-52
SignalStrengthActivity.kt
...va/cn/mingc/golden/ui/activitys/SignalStrengthActivity.kt
+0
-37
WebActivity.kt
...src/main/java/cn/mingc/golden/ui/activitys/WebActivity.kt
+0
-3
CircleCleanAnimationView.kt
...va/cn/mingc/golden/ui/widgets/CircleCleanAnimationView.kt
+1
-1
AppUtil.kt
app/src/main/java/cn/mingc/golden/utils/AppUtil.kt
+2
-2
ForegroundOrBackground.java
...in/java/cn/mingc/golden/utils/ForegroundOrBackground.java
+0
-37
TransitionActivity.java
...c/main/java/cn/mingc/library/base/TransitionActivity.java
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
73aa3a4b
...
@@ -223,24 +223,6 @@
...
@@ -223,24 +223,6 @@
tools:replace=
"android:resource"
/>
tools:replace=
"android:resource"
/>
</provider>
<!-- 广点通广告 -->
</provider>
<!-- 广点通广告 -->
<!-- sigmob start================== -->
<activity
android:name=
"com.sigmob.sdk.base.common.AdActivity"
android:excludeFromRecents=
"true"
android:screenOrientation=
"portrait"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:theme=
"@style/sig_transparent_style"
/>
<provider
android:name=
"com.sigmob.sdk.SigmobFileProvider"
android:authorities=
"${applicationId}.sigprovider"
android:exported=
"false"
android:grantUriPermissions=
"true"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/sigmob_provider_paths"
/>
</provider>
<!-- sigmob end================== -->
<uses-library
<uses-library
android:name=
"org.apache.http.legacy"
android:name=
"org.apache.http.legacy"
...
@@ -268,10 +250,6 @@
...
@@ -268,10 +250,6 @@
<service
<service
android:name=
"com.qq.e.comm.DownloadService"
android:name=
"com.qq.e.comm.DownloadService"
android:exported=
"false"
/>
android:exported=
"false"
/>
<!-- 监听apk安装 -->
<service
android:name=
"cn.mingc.golden.common.install.InstallService"
android:exported=
"false"
/>
<!-- 广告 Activity -->
<!-- 广告 Activity -->
<activity
<activity
...
...
app/src/main/java/cn/mingc/golden/MintsApplication.java
View file @
73aa3a4b
...
@@ -12,6 +12,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
...
@@ -12,6 +12,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import
androidx.multidex.MultiDex
;
import
androidx.multidex.MultiDex
;
import
com.hjq.toast.ToastUtils
;
import
com.hjq.toast.ToastUtils
;
import
com.mints.fiveworld.BuildConfig
;
import
com.orhanobut.logger.AndroidLogAdapter
;
import
com.orhanobut.logger.AndroidLogAdapter
;
import
com.orhanobut.logger.FormatStrategy
;
import
com.orhanobut.logger.FormatStrategy
;
import
com.orhanobut.logger.Logger
;
import
com.orhanobut.logger.Logger
;
...
...
app/src/main/java/cn/mingc/golden/common/DeviceInfo.kt
View file @
73aa3a4b
...
@@ -20,7 +20,6 @@ import android.text.TextUtils
...
@@ -20,7 +20,6 @@ import android.text.TextUtils
import
cn.mingc.golden.MintsApplication
import
cn.mingc.golden.MintsApplication
import
com.mints.fiveworld.R
import
com.mints.fiveworld.R
import
cn.mingc.golden.ad.AdReportManager
import
cn.mingc.golden.ad.AdReportManager
import
cn.mingc.golden.mreceiver.appswitch.AntiAuditManager
import
cn.mingc.golden.utils.*
import
cn.mingc.golden.utils.*
import
cn.mingc.library.utils.json.JsonUtil
import
cn.mingc.library.utils.json.JsonUtil
import
java.io.*
import
java.io.*
...
@@ -1106,111 +1105,6 @@ class DeviceInfo private constructor() {
...
@@ -1106,111 +1105,6 @@ class DeviceInfo private constructor() {
* @param context
* @param context
* @return true-拉黑
* @return true-拉黑
*/
*/
fun
getAPPInstalledThreeDay
(
context
:
Context
,
sumCount
:
Int
):
Boolean
{
if
(
context
==
null
)
return
false
val
onedayItems
:
MutableList
<
String
?>
=
ArrayList
()
val
twodayItems
:
MutableList
<
String
?>
=
ArrayList
()
val
threedayItems
:
MutableList
<
String
?>
=
ArrayList
()
val
installTime
:
MutableMap
<
Long
,
String
>
=
HashMap
()
try
{
val
time
:
MutableList
<
Long
>
=
ArrayList
()
// 获取系统内的所有程序信息
val
mainintent
=
Intent
(
Intent
.
ACTION_MAIN
,
null
)
mainintent
.
addCategory
(
Intent
.
CATEGORY_LAUNCHER
)
val
packageinfo
=
context
.
packageManager
.
getInstalledPackages
(
0
)
var
pinfo
:
PackageInfo
?
val
count
=
packageinfo
.
size
for
(
i
in
0
until
count
)
{
pinfo
=
packageinfo
[
i
]
val
appInfo
=
pinfo
.
applicationInfo
if
(
appInfo
.
flags
and
ApplicationInfo
.
FLAG_SYSTEM
>
0
)
{
//系统程序 忽略
}
else
{
//非系统程序
time
.
add
(
pinfo
.
firstInstallTime
)
installTime
[
pinfo
.
firstInstallTime
]
=
pinfo
.
applicationInfo
.
loadLabel
(
context
.
packageManager
)
as
String
}
}
Collections
.
sort
(
time
,
Collections
.
reverseOrder
()
)
//降序
val
now
=
System
.
currentTimeMillis
()
val
sdfOne
=
SimpleDateFormat
(
"yyyy-MM-dd"
)
val
sdfTime
=
SimpleDateFormat
(
"yyyy-MM-dd HH-mm-ss"
)
// 今天已经过完的时间
val
overTime
:
Long
=
(
now
-
sdfOne
.
parse
(
sdfOne
.
format
(
now
)).
time
)
for
(
i
in
0
until
time
.
size
)
{
when
{
(
time
[
i
]
>
now
-
(
overTime
+
AntiAuditManager
.
ONE_DAY
*
2
)
&&
time
[
i
]
<
now
-
(
overTime
+
AntiAuditManager
.
ONE_DAY
))
->
{
// LogUtil.d(
// "前天安装 -> " + "包名:" + installTime[time[i]] + "-时间:" + sdfTime.format(
// time[i]
// )
// )
// 前三天共安装
threedayItems
.
add
(
"名称:"
+
installTime
[
time
[
i
]]
+
"-时间:"
+
sdfTime
.
format
(
time
[
i
]
)
)
}
(
time
[
i
]
>
now
-
(
overTime
+
AntiAuditManager
.
ONE_DAY
)
&&
time
[
i
]
<
now
-
overTime
)
->
{
// LogUtil.d(
// "昨天安装 -> " + "包名:" + installTime[time[i]] + "-时间:" + sdfTime.format(
// time[i]
// )
// )
twodayItems
.
add
(
"名称:"
+
installTime
[
time
[
i
]]
+
"-时间:"
+
sdfTime
.
format
(
time
[
i
]))
}
time
[
i
]
>
now
-
overTime
->
{
// LogUtil.d(
// "今天安装 -> " + "包名:" + installTime[time[i]] + "-时间:" + sdfTime.format(
// time[i]
// )
// )
onedayItems
.
add
(
"名称:"
+
installTime
[
time
[
i
]]
+
"-时间:"
+
sdfTime
.
format
(
time
[
i
]))
}
}
}
// val localApkCount = AntiAuditManager.instance.getCurrentDayCount()
// LogUtil.d("AntiAuditManager", "获取列表-本地个数 -> $localApkCount")
// AntiAuditManager.instance.setCurrentDayCount(if (localApkCount > onedayItems.size) localApkCount else onedayItems.size)
// AntiAuditManager.instance.setCurrentDayCount(onedayItems.size)
LogUtil
.
d
(
"AntiAuditManager"
,
"前天安装 -> $threedayItems"
)
LogUtil
.
d
(
"AntiAuditManager"
,
"昨天安装 -> $twodayItems"
)
LogUtil
.
d
(
"AntiAuditManager"
,
"今天安装 -> $onedayItems"
)
// 拉黑上传反策略打点
if
(
AntiAuditManager
.
instance
.
isBlack
())
{
AdReportManager
.
eventScene
(
AdReportManager
.
INNER_IN
,
System
.
currentTimeMillis
(),
Constant
.
CARRIER_ANTI_STRATEGY
,
"反策略阈值=${AntiAuditManager.instance.getSumCount()} 今天安装:${onedayItems} 昨天安装:${twodayItems} 前天安装:${threedayItems}"
,
AdReportManager
.
EVENT_TYPE_SCENCE_BLACK
)
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
return
onedayItems
.
size
>=
sumCount
||
twodayItems
.
size
>=
sumCount
||
threedayItems
.
size
>=
sumCount
}
companion
object
{
companion
object
{
...
...
app/src/main/java/cn/mingc/golden/common/install/InstallKeeper.kt
deleted
100644 → 0
View file @
228085c2
package
cn.mingc.golden.common.install
import
cn.mingc.golden.MintsApplication
/**
* @dep: 通过本应用下载并安装成功
*/
class
InstallKeeper
{
fun
test
()
{
val
installWatch
=
InstallWatch
(
MintsApplication
.
getContext
(),
object
:
InstallWatch
.
InstallCallback
{
override
fun
installSuc
(
pkg
:
String
?)
{
}
})
installWatch
.
start
<
InstallWatch
>()
installWatch
.
stop
()
}
}
\ No newline at end of file
app/src/main/java/cn/mingc/golden/common/install/InstallService.kt
deleted
100644 → 0
View file @
228085c2
package
cn.mingc.golden.common.install
import
android.app.Service
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
class
InstallService
:
Service
()
{
companion
object
{
const
val
APP_INSTALL_ACTION
=
"cn.mingc.golden.UPDATE_INSTALL_PKG"
const
val
APP_INSTALL_SCHEME
=
"package"
}
override
fun
onCreate
()
{
super
.
onCreate
()
createReceiver
()
}
private
fun
createReceiver
()
{
val
intentFilter
=
IntentFilter
()
intentFilter
.
addAction
(
Intent
.
ACTION_PACKAGE_ADDED
)
intentFilter
.
addDataScheme
(
APP_INSTALL_SCHEME
)
registerReceiver
(
broadcastReceiver
,
intentFilter
)
}
var
broadcastReceiver
:
BroadcastReceiver
=
object
:
BroadcastReceiver
()
{
override
fun
onReceive
(
param1Context
:
Context
,
param1Intent
:
Intent
)
{
var
str
=
param1Intent
.
data
.
toString
()
if
(
str
.
length
<=
8
)
return
str
=
str
.
substring
(
8
)
if
(
str
!=
this
@InstallService
.
packageName
)
{
try
{
val
intent
=
Intent
()
intent
.
action
=
APP_INSTALL_ACTION
intent
.
putExtra
(
"pkg"
,
str
)
this
@InstallService
.
sendBroadcast
(
intent
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
}
override
fun
onBind
(
intent
:
Intent
?):
Nothing
?
=
null
}
\ No newline at end of file
app/src/main/java/cn/mingc/golden/common/install/InstallWatch.kt
deleted
100644 → 0
View file @
228085c2
package
cn.mingc.golden.common.install
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
import
cn.mingc.golden.mreceiver.BaseWatch
import
cn.mingc.golden.mreceiver.BroadcastReceiver
import
cn.mingc.golden.mreceiver.WatcherHelper
class
InstallWatch
(
context
:
Context
?,
private
val
installCallback
:
InstallCallback
?)
:
BaseWatch
(
context
)
{
override
fun
onCreate
(
context
:
Context
?)
{
val
receivier
=
WatcherHelper
.
create
(
object
:
BroadcastReceiver
.
Callback
{
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
if
(
intent
==
null
)
{
return
}
intent
.
let
{
if
(
it
.
action
!!
.
contains
(
InstallService
.
APP_INSTALL_ACTION
))
{
val
pkg
=
intent
.
getStringExtra
(
"pkg"
)
installCallback
?.
installSuc
(
pkg
)
}
}
}
})
context
?.
let
{
it
.
startService
(
Intent
(
it
,
InstallService
::
class
.
java
))
val
intentFilter
=
IntentFilter
()
intentFilter
.
addAction
(
InstallService
.
APP_INSTALL_ACTION
)
register
(
it
,
receivier
,
intentFilter
)
}
}
fun
destroy
()
{
onDestroy
()
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
mContext
?.
let
{
it
.
stopService
(
Intent
(
it
,
InstallService
::
class
.
java
))
}
}
interface
InstallCallback
{
fun
installSuc
(
pkg
:
String
?)
}
}
\ No newline at end of file
app/src/main/java/cn/mingc/golden/mreceiver/BroadcastReceiver.kt
deleted
100644 → 0
View file @
228085c2
package
cn.mingc.golden.mreceiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
import
net.utils.Log
private
const
val
TAG
=
"core.BroadcastReceiver"
class
BroadcastReceiver
(
private
val
context
:
Context
,
private
val
callback
:
Callback
)
:
BroadcastReceiver
()
{
private
var
registered
=
false
interface
Callback
{
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
}
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
callback
.
onReceive
(
context
,
intent
)
}
fun
register
(
intentFilter
:
IntentFilter
)
{
try
{
context
.
registerReceiver
(
this
,
intentFilter
)
registered
=
true
}
catch
(
e
:
Exception
)
{
if
(
net
.
DebugConfig
.
DEBUG
)
Log
.
e
(
TAG
,
"[ERROR]"
,
e
)
}
}
fun
unregister
()
{
try
{
if
(
registered
)
{
context
.
unregisterReceiver
(
this
)
registered
=
false
}
}
catch
(
e
:
Exception
)
{
if
(
net
.
DebugConfig
.
DEBUG
)
Log
.
e
(
TAG
,
"[ERROR]"
,
e
)
}
}
}
\ No newline at end of file
app/src/main/java/cn/mingc/golden/mreceiver/NotificationService.java
deleted
100644 → 0
View file @
228085c2
package
cn
.
mingc
.
golden
.
mreceiver
;
import
android.app.Notification
;
import
android.app.NotificationManager
;
import
android.app.PendingIntent
;
import
android.app.Service
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.IBinder
;
import
android.util.Log
;
import
android.widget.RemoteViews
;
import
androidx.annotation.Nullable
;
import
androidx.core.app.NotificationCompat
;
import
com.KeepAliveHelper
;
import
com.mints.fiveworld.BuildConfig
;
import
com.mints.fiveworld.R
;
import
cn.mingc.golden.common.Constant
;
import
cn.mingc.golden.ui.activitys.IncreasespeedActivity
;
import
cn.mingc.golden.ui.activitys.MainActivity
;
import
cn.mingc.golden.ui.activitys.NetTestingActivity
;
import
com.squareup.module.legacy.alive.job.RegisterJobUtils
;
import
net.app.BaseApp
;
import
java.util.Timer
;
import
java.util.TimerTask
;
public
class
NotificationService
extends
Service
{
private
static
final
String
TAG
=
"hx.NotificationService"
;
public
final
String
CLICK_TYPE_HOME
=
"CLICK_TYPE_HOME"
;
public
final
String
CLICK_TYPE_CLEAN
=
"CLICK_TYPE_CLEAN"
;
public
final
String
CLICK_TYPE_TEST
=
"CLICK_TYPE_TEST"
;
public
static
boolean
mDestroyed
=
true
;
public
static
final
int
Notification_Id_Fixed
=
88
;
private
Timer
mTimer
;
public
static
final
String
FROM_TORCH_TOGGLE
=
"from_torch_toggle"
;
private
static
Notification
notification
;
private
static
int
update_count
=
0
;
@Override
public
void
onCreate
()
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onCreate() called"
);
mDestroyed
=
false
;
super
.
onCreate
();
try
{
notification
=
getFixedNotification
(
this
);
if
(
null
!=
notification
)
{
startForeground
(
Notification_Id_Fixed
,
notification
);
}
}
catch
(
Exception
e
)
{
BaseApp
.
instance
.
getEventLogger
().
reportError
(
e
);
}
IntentFilter
filter
=
new
IntentFilter
(
FROM_TORCH_TOGGLE
);
KeepAliveHelper
.
Companion
.
onMainServiceStart
(
this
);
}
@Override
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
startTimer
();
return
super
.
onStartCommand
(
intent
,
flags
,
startId
);
}
@Override
public
void
onDestroy
()
{
mDestroyed
=
true
;
super
.
onDestroy
();
stopForeground
(
true
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
RegisterJobUtils
.
scheduleRegisterJob
(
NotificationService
.
this
);
}
if
(
null
!=
mTimer
)
{
mTimer
.
cancel
();
}
// 服务被动销毁时,前台通知也会被销毁,但设置里的标记没变,所以此时新发一个普通通知,之后在关闭设置时要注意 cancel
if
(
true
/*ActionTime.getFixedNotificationOption(this)*/
)
{
try
{
if
(
notification
==
null
)
{
notification
=
getFixedNotification
(
this
);
}
if
(
null
!=
notification
)
{
NotificationManager
notificationManager
=
(
NotificationManager
)
getSystemService
(
Context
.
NOTIFICATION_SERVICE
);
notificationManager
.
notify
(
Notification_Id_Fixed
,
notification
);
}
}
catch
(
Exception
e
)
{
BaseApp
.
instance
.
getEventLogger
().
reportError
(
e
);
}
}
}
@Nullable
@Override
public
IBinder
onBind
(
Intent
intent
)
{
return
null
;
}
public
void
startTimer
()
{
if
(
mTimer
!=
null
)
{
mTimer
.
cancel
();
mTimer
=
null
;
}
mTimer
=
new
Timer
();
mTimer
.
schedule
(
new
TimerTask
()
{
@Override
public
void
run
()
{
update_count
++;
if
(
update_count
%
3
==
0
)
{
// 再次获取当前 mem 和 cpu 值,更新 notification,勉强把所有逻辑写在 cpuTemp 的回调里
}
else
{
updateNotification
(
false
);
}
}
},
1000
,
1000
*
20
);
// 1s 之后 每隔 20s 运行一次,假刷新,满 60s,真刷新一次
}
private
void
updateNotification
(
boolean
refresh
)
{
// 更新 notification,refresh 就重新构建一个 notification 对象,否则就沿用旧的 notification 对象
try
{
if
(
refresh
||
notification
==
null
)
{
notification
=
getFixedNotification
(
NotificationService
.
this
);
}
if
(
null
!=
notification
)
{
NotificationManager
notificationManager
=
(
NotificationManager
)
getSystemService
(
Context
.
NOTIFICATION_SERVICE
);
notificationManager
.
notify
(
Notification_Id_Fixed
,
notification
);
}
}
catch
(
Exception
e
)
{
BaseApp
.
instance
.
getEventLogger
().
reportError
(
e
);
}
}
private
Notification
getFixedNotification
(
Context
context
)
{
Notification
notification
=
null
;
RemoteViews
remoteViews
=
new
RemoteViews
(
context
.
getPackageName
(),
R
.
layout
.
notification_mints
);
remoteViews
.
setOnClickPendingIntent
(
R
.
id
.
remote_container
,
getPendingIntent
(
context
,
CLICK_TYPE_HOME
));
remoteViews
.
setOnClickPendingIntent
(
R
.
id
.
tv_clean
,
getPendingIntent
(
context
,
CLICK_TYPE_CLEAN
));
remoteViews
.
setOnClickPendingIntent
(
R
.
id
.
tv_speed_test
,
getPendingIntent
(
context
,
CLICK_TYPE_TEST
));
NotificationCompat
.
Builder
builder
=
new
NotificationCompat
.
Builder
(
context
,
cn
.
mingc
.
golden
.
mreceiver
.
NotificationUtil
.
Channel_Id_Core
)
.
setSmallIcon
(
R
.
mipmap
.
ic_wifi_notice
,
0
)
.
setOngoing
(
true
)
.
setContent
(
remoteViews
)
.
setGroup
(
NotificationUtil
.
Channel_Id_Core
);
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
O
)
{
builder
.
setPriority
(
NotificationCompat
.
PRIORITY_MAX
);
}
try
{
notification
=
builder
.
build
();
}
catch
(
NullPointerException
e
)
{
// 这里如果notification为NULL,后面会有连锁反应,尽量别null
try
{
Notification
.
Builder
builder2
=
null
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
builder2
=
new
Notification
.
Builder
(
context
,
NotificationUtil
.
Channel_Id_Core
);
}
else
{
builder2
=
new
Notification
.
Builder
(
context
);
}
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
O
)
{
builder2
.
setPriority
(
Notification
.
PRIORITY_MAX
);
}
notification
=
builder2
.
setSmallIcon
(
R
.
mipmap
.
ic_wifi_notice
,
0
)
.
setOngoing
(
true
)
.
setContent
(
remoteViews
)
.
setGroup
(
NotificationUtil
.
Channel_Id_Core
)
.
build
();
}
catch
(
Exception
ignore
)
{
}
}
return
notification
;
}
private
PendingIntent
getPendingIntent
(
Context
context
,
String
type
)
{
PendingIntent
mainPendingIntent
;
switch
(
type
)
{
case
CLICK_TYPE_HOME:
mainPendingIntent
=
PendingIntent
.
getActivity
(
context
,
0
,
new
Intent
(
context
,
MainActivity
.
class
),
PendingIntent
.
FLAG_UPDATE_CURRENT
);
break
;
case
CLICK_TYPE_CLEAN:
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constant
.
SCAN_TYPE
,
1
);
bundle
.
putBoolean
(
IncreasespeedActivity
.
ROUTER_FROM_OUT
,
true
);
bundle
.
putBoolean
(
IncreasespeedActivity
.
INCREASE_IS_LOAD_EXPRESS
,
true
);
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_BOOST
);
Intent
intent
=
new
Intent
(
context
,
IncreasespeedActivity
.
class
);
intent
.
putExtras
(
bundle
);
mainPendingIntent
=
PendingIntent
.
getActivity
(
context
,
0
,
intent
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
break
;
case
CLICK_TYPE_TEST:
Bundle
bundle2
=
new
Bundle
();
bundle2
.
putBoolean
(
IncreasespeedActivity
.
ROUTER_FROM_OUT
,
true
);
bundle2
.
putBoolean
(
IncreasespeedActivity
.
INCREASE_IS_LOAD_EXPRESS
,
true
);
Intent
intent2
=
new
Intent
(
context
,
NetTestingActivity
.
class
);
intent2
.
putExtras
(
bundle2
);
mainPendingIntent
=
PendingIntent
.
getActivity
(
context
,
0
,
intent2
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
break
;
default
:
mainPendingIntent
=
PendingIntent
.
getActivity
(
context
,
0
,
new
Intent
(
context
,
MainActivity
.
class
),
PendingIntent
.
FLAG_UPDATE_CURRENT
);
break
;
}
return
mainPendingIntent
;
}
}
app/src/main/java/cn/mingc/golden/mreceiver/WifiWatch.kt
deleted
100644 → 0
View file @
228085c2
package
cn.mingc.golden.mreceiver
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
import
android.net.wifi.WifiManager
import
android.util.Log
import
com.mints.fiveworld.BuildConfig
class
WifiWatch
(
context
:
Context
?,
private
val
mListener
:
OnWifiListener
?)
:
BaseWatch
(
context
)
{
override
fun
onCreate
(
context
:
Context
?)
{
val
receiver
=
WatcherHelper
.
create
(
object
:
BroadcastReceiver
.
Callback
{
/**
* copy from https://blog.csdn.net/qq_34773981/article/details/79163579
*/
/**
* copy from https://blog.csdn.net/qq_34773981/article/details/79163579
*/
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onReceive: intent action = "
+
intent
?.
action
)
when
(
intent
?.
action
)
{
WifiManager
.
WIFI_STATE_CHANGED_ACTION
->
{
val
wifiState
=
intent
.
getIntExtra
(
WifiManager
.
EXTRA_WIFI_STATE
,
WifiManager
.
WIFI_STATE_DISABLED
)
// EventLogUtils.logDetectionEvent("wifi")
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onReceive: wifiState=$wifiState"
)
when
(
wifiState
)
{
WifiManager
.
WIFI_STATE_DISABLED
->
{
wifiEnable
=
false
mListener
?.
onWifiDisabled
()
}
WifiManager
.
WIFI_STATE_ENABLED
->
if
(!
wifiEnable
)
{
wifiEnable
=
true
// EventLogUtils.logDetectionEvent("wifi2")
mListener
?.
onWifiEnabled
()
}
}
}
WifiManager
.
SCAN_RESULTS_AVAILABLE_ACTION
->
{
}
WifiManager
.
RSSI_CHANGED_ACTION
->
{
}
}
}
})
val
filter
=
IntentFilter
()
filter
.
addAction
(
WifiManager
.
WIFI_STATE_CHANGED_ACTION
)
// filter.addAction(WifiManager.RSSI_CHANGED_ACTION)
filter
.
addAction
(
WifiManager
.
SCAN_RESULTS_AVAILABLE_ACTION
)
register
(
context
!!
,
receiver
,
filter
)
}
interface
OnWifiListener
{
fun
onWifiEnabled
()
fun
onWifiDisabled
()
}
private
var
wifiEnable
=
true
}
\ No newline at end of file
app/src/main/java/cn/mingc/golden/ui/activitys/IncreasespeedActivity.kt
View file @
73aa3a4b
...
@@ -17,7 +17,6 @@ import com.bumptech.glide.Glide
...
@@ -17,7 +17,6 @@ import com.bumptech.glide.Glide
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.daimajia.androidanimations.library.YoYo
import
com.mints.fiveworld.R
import
com.mints.fiveworld.R
import
cn.mingc.golden.ad.express.OutSceneExpress
import
cn.mingc.golden.ad.express.ExpressAdCallback
import
cn.mingc.golden.ad.express.ExpressAdCallback
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.express.InSceneExpress
import
cn.mingc.golden.ad.express.InSceneExpress
...
@@ -123,11 +122,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -123,11 +122,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
else
->
"unknown"
else
->
"unknown"
}
}
// 应用外进入此页面加载当前场景信息流
if
(
mIsLoadExpress
&&
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
loadADFrameLayout
(
mCarrier
)
}
if
(
mIncreaseType
==
INCREASE_BOOST
&&
AppConfig
.
isCanBoost
)
{
if
(
mIncreaseType
==
INCREASE_BOOST
&&
AppConfig
.
isCanBoost
)
{
loadAd
()
loadAd
()
...
@@ -153,26 +147,16 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -153,26 +147,16 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
}
}
private
fun
loadAd
()
{
private
fun
loadAd
()
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
,
mCarrier
)
WifiAdManager
.
instance
.
loadNoticeAppOutAd
(
this
,
mCarrier
)
}
else
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
,
mCarrier
)
}
}
}
// 广告是否已经加载成功
// 广告是否已经加载成功
private
fun
getAdIsOk
():
Boolean
{
private
fun
getAdIsOk
():
Boolean
{
return
if
(
mIsFromAppOut
)
{
return
WifiAdManager
.
instance
.
getInCurrentAdStatus
()
WifiAdManager
.
instance
.
getOutCurrentAdStatus
()
}
else
{
WifiAdManager
.
instance
.
getInCurrentAdStatus
()
}
}
}
private
fun
showAd
()
{
private
fun
showAd
()
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
wifiAdStatusListener
)
WifiAdManager
.
instance
.
showNoticeAppOutInterstitial
(
this
,
mCarrier
)
}
else
{
}
else
{
WifiAdManager
.
instance
.
showInterstitial
(
this
,
mCarrier
,
wifiAdStatusListener
)
WifiAdManager
.
instance
.
showInterstitial
(
this
,
mCarrier
,
wifiAdStatusListener
)
}
}
...
@@ -231,9 +215,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -231,9 +215,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
if
(
Utils
.
canLoadAd
())
{
if
(
Utils
.
canLoadAd
())
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_CLEAN
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_CLEAN
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_CLEAN
)
...
@@ -252,9 +233,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -252,9 +233,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
if
(
Utils
.
canLoadAd
())
{
if
(
Utils
.
canLoadAd
())
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_BOOST
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_BOOST
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_BOOST
)
...
@@ -389,7 +367,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -389,7 +367,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
ExpressManager
.
loadExpress
(
false
,
mCarrier
)
ExpressManager
.
loadExpress
(
false
,
mCarrier
)
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
cmtClose
()
}
else
{
}
else
{
InSceneExpress
.
instance
.
cmtClose
()
InSceneExpress
.
instance
.
cmtClose
()
}
}
...
@@ -413,40 +390,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -413,40 +390,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
try
{
try
{
// 展示不同信息流广告
// 展示不同信息流广告
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
adView
?.
let
{
val
parent
=
it
.
parent
if
(
parent
!=
null
)
{
return
@let
}
else
{
frameLayout
?.
removeAllViews
()
frameLayout
?.
addView
(
it
)
}
}
}
override
fun
renderSuccess
(
adView
:
FrameLayout
?):
Boolean
{
if
(
this
@IncreasespeedActivity
.
isFinishing
)
return
false
adView
?.
let
{
val
parent
=
it
.
parent
return
if
(
parent
!=
null
&&
parent
is
FrameLayout
)
{
false
}
else
{
frameLayout
?.
removeAllViews
()
frameLayout
?.
addView
(
it
)
true
}
}
return
false
}
override
fun
loadFail
()
{}
},
mCarrier
)
}
else
{
}
else
{
ExpressManager
.
getExpressAd
(
false
,
object
:
ExpressAdCallback
{
ExpressManager
.
getExpressAd
(
false
,
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
...
@@ -563,10 +506,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -563,10 +506,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
if
(
Utils
.
canLoadAd
())
{
if
(
Utils
.
canLoadAd
())
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_BOOST
)
bundle
.
putBoolean
(
ROUTER_FROM_OUT
,
true
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_BOOST
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_BOOST
)
...
@@ -587,10 +526,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -587,10 +526,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
if
(
Utils
.
canLoadAd
())
{
if
(
Utils
.
canLoadAd
())
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_CLEAN
)
bundle
.
putBoolean
(
ROUTER_FROM_OUT
,
true
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_CLEAN
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_CLEAN
)
...
@@ -611,10 +546,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -611,10 +546,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
if
(
Utils
.
canLoadAd
())
{
if
(
Utils
.
canLoadAd
())
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_SAVE_POWER
)
bundle
.
putBoolean
(
ROUTER_FROM_OUT
,
true
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_SAVE_POWER
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_SAVE_POWER
)
...
...
app/src/main/java/cn/mingc/golden/ui/activitys/NetTestingActivity.kt
View file @
73aa3a4b
...
@@ -12,7 +12,6 @@ import android.view.animation.LinearInterpolator
...
@@ -12,7 +12,6 @@ import android.view.animation.LinearInterpolator
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
com.hjq.toast.ToastUtils
import
com.hjq.toast.ToastUtils
import
com.mints.fiveworld.R
import
com.mints.fiveworld.R
import
cn.mingc.golden.ad.express.OutSceneExpress
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.wifi.WifiAdManager
import
cn.mingc.golden.ad.wifi.WifiAdManager
import
cn.mingc.golden.ad.wifi.WifiAdStatusListener
import
cn.mingc.golden.ad.wifi.WifiAdStatusListener
...
@@ -66,10 +65,6 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -66,10 +65,6 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
loadAd
()
loadAd
()
// 应用外进入此页面加载当前场景信息流
if
(
mIsLoadExpress
&&
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_SPEED_TEST
)
}
initView
()
initView
()
...
@@ -80,7 +75,6 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -80,7 +75,6 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
private
fun
loadAd
()
{
private
fun
loadAd
()
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
loadNoticeAppOutAd
(
this
,
Constant
.
CARRIER_SPEED_TEST
)
}
else
{
}
else
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
,
Constant
.
CARRIER_SPEED_TEST
)
WifiAdManager
.
instance
.
loadWifiAd
(
this
,
Constant
.
CARRIER_SPEED_TEST
)
}
}
...
@@ -104,7 +98,6 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -104,7 +98,6 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
}
}
})
})
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
showNoticeAppOutInterstitial
(
this
,
Constant
.
CARRIER_SPEED_TEST
)
}
else
{
}
else
{
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_SPEED_TEST
)
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_SPEED_TEST
)
}
}
...
...
app/src/main/java/cn/mingc/golden/ui/activitys/OneCleanActivity.kt
View file @
73aa3a4b
...
@@ -111,11 +111,6 @@ class OneCleanActivity : BaseActivity(), View.OnClickListener {
...
@@ -111,11 +111,6 @@ class OneCleanActivity : BaseActivity(), View.OnClickListener {
}
}
})
})
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
if
(
scanMax
==
1
)
{
// 加速
WifiAdManager
.
instance
.
showNoticeAppOutInterstitial
(
this
,
Constant
.
CARRIER_BOOST
)
}
else
{
// 清理 清理多项
WifiAdManager
.
instance
.
showNoticeAppOutInterstitial
(
this
,
Constant
.
CARRIER_CLEAN
)
}
}
else
{
}
else
{
if
(
scanMax
==
1
)
{
// 加速 只清理一项
if
(
scanMax
==
1
)
{
// 加速 只清理一项
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_BOOST
)
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_BOOST
)
...
...
app/src/main/java/cn/mingc/golden/ui/activitys/SafeTestingActivity.kt
View file @
73aa3a4b
...
@@ -15,7 +15,6 @@ import com.bumptech.glide.Glide
...
@@ -15,7 +15,6 @@ import com.bumptech.glide.Glide
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.daimajia.androidanimations.library.YoYo
import
com.mints.fiveworld.R
import
com.mints.fiveworld.R
import
cn.mingc.golden.ad.express.OutSceneExpress
import
cn.mingc.golden.ad.express.ExpressAdCallback
import
cn.mingc.golden.ad.express.ExpressAdCallback
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.express.InSceneExpress
import
cn.mingc.golden.ad.express.InSceneExpress
...
@@ -103,7 +102,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -103,7 +102,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
private
fun
loadAd
()
{
private
fun
loadAd
()
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
loadNoticeAppOutAd
(
this
,
Constant
.
CARRIER_SAFE_CHECK
)
}
else
{
}
else
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
,
Constant
.
CARRIER_SAFE_CHECK
)
WifiAdManager
.
instance
.
loadWifiAd
(
this
,
Constant
.
CARRIER_SAFE_CHECK
)
}
}
...
@@ -133,7 +131,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -133,7 +131,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
}
}
})
})
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
showNoticeAppOutInterstitial
(
this
,
Constant
.
CARRIER_SAFE_CHECK
)
}
else
{
}
else
{
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_SAFE_CHECK
)
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_SAFE_CHECK
)
}
}
...
@@ -286,7 +283,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -286,7 +283,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
null
)
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
null
)
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
cmtClose
()
}
else
{
}
else
{
InSceneExpress
.
instance
.
cmtClose
()
InSceneExpress
.
instance
.
cmtClose
()
}
}
...
@@ -303,39 +299,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -303,39 +299,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
/**初始化信息iyc*/
/**初始化信息iyc*/
private
fun
initExpress
()
{
private
fun
initExpress
()
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
adView
?.
let
{
val
parent
=
it
.
parent
if
(
parent
!=
null
)
{
return
@let
}
else
{
frameLayout
?.
removeAllViews
()
frameLayout
?.
addView
(
it
)
}
}
}
override
fun
renderSuccess
(
adView
:
FrameLayout
?):
Boolean
{
if
(
this
@SafeTestingActivity
.
isFinishing
)
return
false
adView
?.
let
{
val
parent
=
it
.
parent
return
if
(
parent
!=
null
&&
parent
is
FrameLayout
)
{
false
}
else
{
frameLayout
?.
removeAllViews
()
frameLayout
?.
addView
(
it
)
true
}
}
return
false
}
override
fun
loadFail
()
{}
},
Constant
.
CARRIER_SAFE_CHECK
)
}
else
{
}
else
{
ExpressManager
.
getExpressAd
(
false
,
object
:
ExpressAdCallback
{
ExpressManager
.
getExpressAd
(
false
,
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
...
@@ -434,11 +397,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -434,11 +397,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_BOOST
)
bundle
.
putBoolean
(
IncreasespeedActivity
.
ROUTER_FROM_OUT
,
true
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_BOOST
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_BOOST
)
...
@@ -457,11 +415,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -457,11 +415,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_CLEAN
)
bundle
.
putBoolean
(
IncreasespeedActivity
.
ROUTER_FROM_OUT
,
true
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_CLEAN
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_CLEAN
)
...
@@ -480,11 +433,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
...
@@ -480,11 +433,6 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
// 预加载信息流
OutSceneExpress
.
instance
.
loadADFrameLayout
(
Constant
.
CARRIER_SAVE_POWER
)
bundle
.
putBoolean
(
IncreasespeedActivity
.
ROUTER_FROM_OUT
,
true
)
}
else
{
}
else
{
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_SAVE_POWER
)
ExpressManager
.
loadExpress
(
false
,
Constant
.
CARRIER_SAVE_POWER
)
...
...
app/src/main/java/cn/mingc/golden/ui/activitys/SignalStrengthActivity.kt
View file @
73aa3a4b
...
@@ -9,7 +9,6 @@ import androidx.core.content.ContextCompat
...
@@ -9,7 +9,6 @@ import androidx.core.content.ContextCompat
import
com.bumptech.glide.load.resource.gif.GifDrawable
import
com.bumptech.glide.load.resource.gif.GifDrawable
import
com.hjq.toast.ToastUtils
import
com.hjq.toast.ToastUtils
import
com.mints.fiveworld.R
import
com.mints.fiveworld.R
import
cn.mingc.golden.ad.express.OutSceneExpress
import
cn.mingc.golden.ad.express.ExpressAdCallback
import
cn.mingc.golden.ad.express.ExpressAdCallback
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.express.ExpressManager
import
cn.mingc.golden.ad.express.InSceneExpress
import
cn.mingc.golden.ad.express.InSceneExpress
...
@@ -69,7 +68,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
...
@@ -69,7 +68,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
private
fun
loadAd
()
{
private
fun
loadAd
()
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
loadNoticeAppOutAd
(
this
,
Constant
.
CARRIER_WIFI_BOOST
)
overridePendingTransition
(
0
,
0
)
overridePendingTransition
(
0
,
0
)
}
else
{
}
else
{
...
@@ -79,7 +77,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
...
@@ -79,7 +77,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
private
fun
showAd
()
{
private
fun
showAd
()
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
WifiAdManager
.
instance
.
showNoticeAppOutInterstitial
(
this
,
Constant
.
CARRIER_WIFI_BOOST
)
}
else
{
}
else
{
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_WIFI_BOOST
)
WifiAdManager
.
instance
.
showInterstitial
(
this
,
Constant
.
CARRIER_WIFI_BOOST
)
}
}
...
@@ -174,39 +171,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
...
@@ -174,39 +171,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
private
fun
initExpress
()
{
private
fun
initExpress
()
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
adView
?.
let
{
val
parent
=
it
.
parent
if
(
parent
!=
null
)
{
return
@let
}
else
{
frameLayout
?.
removeAllViews
()
frameLayout
?.
addView
(
it
)
}
}
}
override
fun
renderSuccess
(
adView
:
FrameLayout
?):
Boolean
{
if
(
this
@SignalStrengthActivity
.
isFinishing
)
return
false
adView
?.
let
{
val
parent
=
it
.
parent
return
if
(
parent
!=
null
&&
parent
is
FrameLayout
)
{
false
}
else
{
frameLayout
?.
removeAllViews
()
frameLayout
?.
addView
(
it
)
true
}
}
return
false
}
override
fun
loadFail
()
{}
},
Constant
.
CARRIER_WIFI_BOOST
)
}
else
{
}
else
{
ExpressManager
.
getExpressAd
(
false
,
object
:
ExpressAdCallback
{
ExpressManager
.
getExpressAd
(
false
,
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
...
@@ -244,7 +208,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
...
@@ -244,7 +208,6 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
if
(
Utils
.
canLoadAd
())
{
if
(
Utils
.
canLoadAd
())
{
if
(
mIsFromAppOut
)
{
if
(
mIsFromAppOut
)
{
OutSceneExpress
.
instance
.
cmtClose
()
}
else
{
}
else
{
InSceneExpress
.
instance
.
cmtClose
()
InSceneExpress
.
instance
.
cmtClose
()
}
}
...
...
app/src/main/java/cn/mingc/golden/ui/activitys/WebActivity.kt
View file @
73aa3a4b
...
@@ -103,7 +103,6 @@ class WebActivity : BaseActivity(), View.OnClickListener {
...
@@ -103,7 +103,6 @@ class WebActivity : BaseActivity(), View.OnClickListener {
if
(
registerFlag
&&
privacyFlag
)
{
if
(
registerFlag
&&
privacyFlag
)
{
isCmtBlackAgreementFlag
=
true
isCmtBlackAgreementFlag
=
true
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
AntiAuditManager
.
instance
.
cmtBlackToServier
(
AntiAuditManager
.
SENCE_AGREEMENT
)
}
}
}
}
}
}
...
@@ -137,7 +136,6 @@ class WebActivity : BaseActivity(), View.OnClickListener {
...
@@ -137,7 +136,6 @@ class WebActivity : BaseActivity(), View.OnClickListener {
val
registerFlag
=
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
REGISTER_FLAG
,
false
)
val
registerFlag
=
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
REGISTER_FLAG
,
false
)
if
(
bottomFlag
&&
registerFlag
)
{
if
(
bottomFlag
&&
registerFlag
)
{
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
AntiAuditManager
.
instance
.
cmtBlackToServier
(
AntiAuditManager
.
SENCE_AGREEMENT
)
}
}
}
else
if
(
url
.
equals
(
Constant
.
REGISTER_URL
))
{
}
else
if
(
url
.
equals
(
Constant
.
REGISTER_URL
))
{
AppPreferencesManager
.
get
().
put
(
Constant
.
REGISTER_FLAG
,
true
)
AppPreferencesManager
.
get
().
put
(
Constant
.
REGISTER_FLAG
,
true
)
...
@@ -145,7 +143,6 @@ class WebActivity : BaseActivity(), View.OnClickListener {
...
@@ -145,7 +143,6 @@ class WebActivity : BaseActivity(), View.OnClickListener {
val
privacyFlag
=
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
PRIVACY_FLAG
,
false
)
val
privacyFlag
=
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
PRIVACY_FLAG
,
false
)
if
(
bottomFlag
&&
privacyFlag
)
{
if
(
bottomFlag
&&
privacyFlag
)
{
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
AntiAuditManager
.
instance
.
cmtBlackToServier
(
AntiAuditManager
.
SENCE_AGREEMENT
)
}
}
}
}
}
}
...
...
app/src/main/java/cn/mingc/golden/ui/widgets/CircleCleanAnimationView.kt
View file @
73aa3a4b
...
@@ -28,7 +28,7 @@ class CircleCleanAnimationView @JvmOverloads constructor(
...
@@ -28,7 +28,7 @@ class CircleCleanAnimationView @JvmOverloads constructor(
private
lateinit
var
paintIn2
:
Paint
private
lateinit
var
paintIn2
:
Paint
private
lateinit
var
paintIn3
:
Paint
//内圈画笔
private
lateinit
var
paintIn3
:
Paint
//内圈画笔
private
lateinit
var
bitmap
:
Bitmap
private
lateinit
var
bitmap
:
Bitmap
private
var
centerDrawableId
=
R
.
mipmap
.
ic_launcher
//中心图片ID
private
var
centerDrawableId
=
R
.
drawable
.
ic_launcher_main
//中心图片ID
private
var
imCenter
:
ImageView
?
=
null
private
var
imCenter
:
ImageView
?
=
null
private
var
imIn
:
ImageView
?
=
null
private
var
imIn
:
ImageView
?
=
null
private
var
imOut
:
ImageView
?
=
null
//中心图片控件
private
var
imOut
:
ImageView
?
=
null
//中心图片控件
...
...
app/src/main/java/cn/mingc/golden/utils/AppUtil.kt
View file @
73aa3a4b
...
@@ -185,7 +185,7 @@ object AppUtil {
...
@@ -185,7 +185,7 @@ object AppUtil {
fun
getApkInfo2
(
fun
getApkInfo2
(
context
:
Context
,
pkgName
:
String
context
:
Context
,
pkgName
:
String
):
CacheListItem
{
):
CacheListItem
{
var
apkIcon
:
Drawable
=
context
.
getDrawable
(
R
.
mipmap
.
ic_launcher
)
!!
var
apkIcon
:
Drawable
=
context
.
getDrawable
(
R
.
drawable
.
ic_launcher_main
)
!!
var
apkLabel
=
""
var
apkLabel
=
""
var
info
:
PackageInfo
?
=
null
var
info
:
PackageInfo
?
=
null
...
@@ -214,7 +214,7 @@ object AppUtil {
...
@@ -214,7 +214,7 @@ object AppUtil {
fun
getApkInfo
(
fun
getApkInfo
(
context
:
Context
,
apkPath
:
String
context
:
Context
,
apkPath
:
String
):
CacheListItem
{
):
CacheListItem
{
var
apkIcon
:
Drawable
=
context
.
getDrawable
(
R
.
mipmap
.
ic_launcher
)
!!
var
apkIcon
:
Drawable
=
context
.
getDrawable
(
R
.
drawable
.
ic_launcher_main
)
!!
var
apkLabel
=
""
var
apkLabel
=
""
var
apkPkg
=
""
var
apkPkg
=
""
...
...
app/src/main/java/cn/mingc/golden/utils/ForegroundOrBackground.java
View file @
73aa3a4b
...
@@ -8,10 +8,8 @@ import android.text.TextUtils;
...
@@ -8,10 +8,8 @@ import android.text.TextUtils;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
cn.mingc.golden.ad.AdReportManager
;
import
cn.mingc.golden.ad.AdReportManager
;
import
cn.mingc.golden.mreceiver.AlarmManager
;
import
cn.mingc.golden.mreceiver.base.MintsAppInActivity
;
import
cn.mingc.golden.mreceiver.base.MintsAppInActivity
;
import
cn.mingc.golden.mvp.presenters.VersionUpdatePresenter
;
import
cn.mingc.golden.mvp.presenters.VersionUpdatePresenter
;
import
cn.mingc.golden.ui.activitys.anim.OutManagedActivity
;
import
java.lang.ref.WeakReference
;
import
java.lang.ref.WeakReference
;
...
@@ -186,17 +184,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -186,17 +184,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
if
(
activity
==
null
)
if
(
activity
==
null
)
return
;
return
;
if
(
activity
instanceof
OutManagedActivity
)
{
outActivityCount
++;
LogUtil
.
d
(
"BoostFastActivity"
,
"AlarmManagerManagedActivity_onActivityStarted 体外outActivityCount="
+
outActivityCount
);
}
if
(
activity
instanceof
AlarmManager
.
AlarmManagerManagedActivity
)
{
timeActivityCount
++;
LogUtil
.
d
(
"BoostFastActivity"
,
"AlarmManagerManagedActivity_onActivityStarted 定时timeActivityCount="
+
timeActivityCount
);
}
if
(
isFullADActivity
(
activity
.
getClass
().
getSimpleName
()))
{
if
(
isFullADActivity
(
activity
.
getClass
().
getSimpleName
()))
{
fullVideoActivityCount
++;
fullVideoActivityCount
++;
...
@@ -204,13 +191,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -204,13 +191,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
}
}
if
(
activity
instanceof
MintsAppInActivity
||
activity
instanceof
OutManagedActivity
||
activity
instanceof
AlarmManager
.
AlarmManagerManagedActivity
||
isFullADActivity
(
activity
.
getClass
().
getSimpleName
()))
{
count
++;
}
LogUtil
.
d
(
"AAAAA onActivityStarted -> "
+
activity
.
getClass
().
getSimpleName
()
+
" -- "
+
LogUtil
.
d
(
"AAAAA onActivityStarted -> "
+
activity
.
getClass
().
getSimpleName
()
+
" -- "
+
"outActivityCount "
+
outActivityCount
+
"outActivityCount "
+
outActivityCount
+
"timeActivityCount "
+
timeActivityCount
+
"timeActivityCount "
+
timeActivityCount
+
...
@@ -221,23 +201,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -221,23 +201,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
@Override
@Override
public
void
onActivityStopped
(
Activity
activity
)
{
public
void
onActivityStopped
(
Activity
activity
)
{
if
(
activity
instanceof
MintsAppInActivity
||
activity
instanceof
OutManagedActivity
||
activity
instanceof
AlarmManager
.
AlarmManagerManagedActivity
||
isFullADActivity
(
activity
.
getClass
().
getSimpleName
()))
{
count
--;
}
if
(
activity
instanceof
OutManagedActivity
)
{
outActivityCount
--;
LogUtil
.
d
(
"BoostFastActivity"
,
"AlarmManagerManagedActivity_onActivityStopped 体外outActivityCount="
+
outActivityCount
);
}
if
(
activity
instanceof
AlarmManager
.
AlarmManagerManagedActivity
&&
timeActivityCount
!=
0
)
{
timeActivityCount
--;
LogUtil
.
d
(
"BoostFastActivity"
,
"AlarmManagerManagedActivity_onActivityStopped 定时timeActivityCount="
+
timeActivityCount
);
}
if
(
isFullADActivity
(
activity
.
getClass
().
getSimpleName
())&&
fullVideoActivityCount
!=
0
)
{
if
(
isFullADActivity
(
activity
.
getClass
().
getSimpleName
())&&
fullVideoActivityCount
!=
0
)
{
fullVideoActivityCount
--;
fullVideoActivityCount
--;
...
...
app/src/main/java/cn/mingc/library/base/TransitionActivity.java
View file @
73aa3a4b
...
@@ -67,7 +67,7 @@ public abstract class TransitionActivity extends AppCompatActivity {
...
@@ -67,7 +67,7 @@ public abstract class TransitionActivity extends AppCompatActivity {
*/
*/
protected
void
finish2Bottom
()
{
protected
void
finish2Bottom
()
{
super
.
finish
();
super
.
finish
();
overridePendingTransition
(
R
.
anim
.
bottom_in
,
R
.
anim
.
alpha_out
);
//
overridePendingTransition(R.anim.bottom_in, R.anim.alpha_out);
}
}
/**
/**
...
...
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