Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
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_flowbox
Commits
512861d1
Commit
512861d1
authored
Jul 23, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
10b72a82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
12 deletions
+37
-12
AntiAuditManager.kt
...com/mints/flowbox/keepalive/appswitch/AntiAuditManager.kt
+36
-12
IncreasespeedActivity.kt
...a/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
+1
-0
No files found.
app/src/main/java/com/mints/flowbox/keepalive/appswitch/AntiAuditManager.kt
View file @
512861d1
...
...
@@ -43,13 +43,20 @@ class AntiAuditManager private constructor() {
val
sp
by
lazy
{
AppPreferencesManager
.
get
()
}
/**
* 更新新安装的apk个数
* 更新
新安装的apk个数
*/
fun
updateInstallApkCount
()
{
// 若是黑名称则返回
val
isBlack
=
sp
.
getBoolean
(
APP_OUT_BLACK
,
false
)
if
(
isBlack
)
{
return
}
val
count
=
sp
.
getInt
(
TODAY_INSTALL_APK_COUNT
,
0
)
val
sumCount
=
count
+
1
sp
.
put
(
TODAY_INSTALL_APK_COUNT
,
sumCount
)
sp
.
put
(
TODAY_INSTALL_APK_COUNT
,
sumCount
)
if
(
sumCount
>=
N
)
{
cmtBlackToServier
()
sp
.
put
(
APP_OUT_BLACK
,
true
)
}
}
...
...
@@ -58,6 +65,15 @@ class AntiAuditManager private constructor() {
* 获取所有以安装列表,除系统应用,归类到自然日
*/
fun
antiAudit
()
{
// 若是黑名称则返回
val
isBlack
=
sp
.
getBoolean
(
APP_OUT_BLACK
,
false
)
LogUtil
.
d
(
TAG
,
"获取所有以安装列表 是否黑名称 -> $isBlack"
)
if
(
isBlack
)
{
return
}
RxjavaUtil
.
executeRxTask
(
object
:
CommonRxTask
<
Boolean
>()
{
override
fun
doInIOThread
()
{
t
=
getLastThreeDayApkInstallInfo
(
MintsApplication
.
getContext
())
...
...
@@ -65,10 +81,10 @@ class AntiAuditManager private constructor() {
override
fun
doInUIThread
()
{
if
(
t
==
true
)
{
cmtBlackToServier
()
sp
.
put
(
APP_OUT_BLACK
,
true
)
}
}
})
}
...
...
@@ -87,19 +103,19 @@ class AntiAuditManager private constructor() {
*/
private
fun
getAPPInstalled
(
context
:
Context
):
Boolean
{
val
onedayItems
:
MutableList
<
String
?>
=
ArrayList
()
ArrayList
()
val
twodayItems
:
MutableList
<
String
?>
=
ArrayList
()
ArrayList
()
val
threedayItems
:
MutableList
<
String
?>
=
ArrayList
()
ArrayList
()
val
installTime
:
MutableMap
<
Long
,
String
>
=
HashMap
()
HashMap
()
val
time
:
MutableList
<
Long
>
=
ArrayList
()
// 获取系统内的所有程序信息
val
mainintent
=
Intent
(
Intent
.
ACTION_MAIN
,
null
)
mainintent
.
addCategory
(
Intent
.
CATEGORY_LAUNCHER
)
val
packageinfo
=
context
.
packageManager
.
getInstalledPackages
(
0
)
context
.
packageManager
.
getInstalledPackages
(
0
)
var
pinfo
:
PackageInfo
?
val
count
=
packageinfo
.
size
for
(
i
in
0
until
count
)
{
...
...
@@ -111,12 +127,12 @@ class AntiAuditManager private constructor() {
//非系统程序
time
.
add
(
pinfo
.
firstInstallTime
)
installTime
[
pinfo
.
firstInstallTime
]
=
pinfo
.
applicationInfo
.
loadLabel
(
context
.
packageManager
)
as
String
pinfo
.
applicationInfo
.
loadLabel
(
context
.
packageManager
)
as
String
}
}
Collections
.
sort
(
time
,
Collections
.
reverseOrder
()
time
,
Collections
.
reverseOrder
()
)
//降序
val
now
=
System
.
currentTimeMillis
()
...
...
@@ -138,7 +154,8 @@ class AntiAuditManager private constructor() {
}
}
val
localApkCount
=
sp
.
getInt
(
TODAY_INSTALL_APK_COUNT
,
0
)
sp
.
put
(
TODAY_INSTALL_APK_COUNT
,
if
(
localApkCount
>
onedayItems
.
size
)
localApkCount
else
onedayItems
.
size
)
LogUtil
.
d
(
TAG
,
"获取列表-本地个数 -> $localApkCount"
)
sp
.
put
(
TODAY_INSTALL_APK_COUNT
,
if
(
localApkCount
>
onedayItems
.
size
)
localApkCount
else
onedayItems
.
size
)
LogUtil
.
d
(
TAG
,
"ThreeDay -> $threedayItems"
)
LogUtil
.
d
(
TAG
,
"TwoDay -> $twodayItems"
)
...
...
@@ -146,4 +163,11 @@ class AntiAuditManager private constructor() {
return
onedayItems
.
size
>=
N
||
twodayItems
.
size
>=
N
||
threedayItems
.
size
>=
N
}
/**
* 提交黑名单接口
*/
private
fun
cmtBlackToServier
(){
}
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
View file @
512861d1
...
...
@@ -258,6 +258,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
mTimer
=
null
fl_ad
?.
removeAllViews
()
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
null
)
super
.
onDestroy
()
}
...
...
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