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
78bb115d
Commit
78bb115d
authored
Jul 23, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限优化
parent
db6c1e31
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
10 deletions
+36
-10
AlarmManager.java
...c/main/java/com/mints/flowbox/keepalive/AlarmManager.java
+2
-1
WifiDataManager.kt
...in/java/com/mints/flowbox/manager/wifi/WifiDataManager.kt
+5
-1
MainActivity.kt
.../main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
+15
-4
WifiFragment.kt
...c/main/java/com/mints/flowbox/ui/fragment/WifiFragment.kt
+14
-4
No files found.
app/src/main/java/com/mints/flowbox/keepalive/AlarmManager.java
View file @
78bb115d
...
@@ -95,7 +95,8 @@ public class AlarmManager implements WeakHandler.IHandler {
...
@@ -95,7 +95,8 @@ public class AlarmManager implements WeakHandler.IHandler {
if
(
userTime
%
APP_OUT_TIMING_MINTER
==
0
)
{
if
(
userTime
%
APP_OUT_TIMING_MINTER
==
0
)
{
// 应用在前台时,不弹出应用外广告
// 应用在前台时,不弹出应用外广告
if
(
ForegroundOrBackground
.
isForeground2
()
||
ScreenLockerUtils
.
INSTANCE
.
canShowScreenLocker
(
MintsApplication
.
getContext
()))
{
if
(
ForegroundOrBackground
.
isForeground2
()
||
ScreenLockerUtils
.
INSTANCE
.
canShowScreenLocker
(
MintsApplication
.
getContext
()))
{
return
;
return
;
}
}
...
...
app/src/main/java/com/mints/flowbox/manager/wifi/WifiDataManager.kt
View file @
78bb115d
...
@@ -459,11 +459,15 @@ object WifiDataManager {
...
@@ -459,11 +459,15 @@ object WifiDataManager {
*
*
* APP_OUT_MAIN_SWITCH=false 表示 关闭总开关
* APP_OUT_MAIN_SWITCH=false 表示 关闭总开关
* isBlack=true 表示 是反策略黑名单
* isBlack=true 表示 是反策略黑名单
* @return true 不弹 false 弹
*/
*/
private
fun
isBlackOrClose
():
Boolean
{
private
fun
isBlackOrClose
():
Boolean
{
val
isBlack
=
AntiAuditManager
.
instance
.
isBlack
()
val
isBlack
=
AntiAuditManager
.
instance
.
isBlack
()
LogUtil
.
d
(
TAG
,
"isBlackOrClose() 是否黑名单: -> !APP_OUT_MAIN_SWITCH=${!APP_OUT_MAIN_SWITCH} , isBlack=${isBlack}"
)
LogUtil
.
d
(
TAG
,
"isBlackOrClose() 是否黑名单: -> !APP_OUT_MAIN_SWITCH=${!APP_OUT_MAIN_SWITCH} , isBlack=${isBlack}"
)
return
(!
APP_OUT_MAIN_SWITCH
||
isBlack
)
return
(!
APP_OUT_MAIN_SWITCH
||
isBlack
)
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
View file @
78bb115d
...
@@ -35,7 +35,9 @@ import com.mints.flowbox.ui.widgets.dialog.PowerDialog
...
@@ -35,7 +35,9 @@ import com.mints.flowbox.ui.widgets.dialog.PowerDialog
import
com.mints.flowbox.utils.WifiUtils
import
com.mints.flowbox.utils.WifiUtils
import
com.mints.library.utils.GlideUtils
import
com.mints.library.utils.GlideUtils
import
com.tbruyelle.rxpermissions.RxPermissions
import
com.tbruyelle.rxpermissions.RxPermissions
import
com.yilan.sdk.common.util.PhoneUtil
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.android.synthetic.main.activity_main.*
import
net.phone.PhoneBrandUtils
import
rx.Observable
import
rx.Observable
/**
/**
...
@@ -453,10 +455,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -453,10 +455,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
private
fun
checkPermission
()
{
private
fun
checkPermission
()
{
val
request
:
Observable
<
Boolean
>
=
val
request
:
Observable
<
Boolean
>
=
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
RxPermissions
(
this
)
if
(
PhoneBrandUtils
.
isXiaomi
())
{
.
request
(
RxPermissions
(
this
)
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
.
request
(
)
Manifest
.
permission
.
ACCESS_FINE_LOCATION
)
}
else
{
RxPermissions
(
this
)
.
request
(
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
,
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
Manifest
.
permission
.
ACCESS_FINE_LOCATION
)
}
}
else
{
}
else
{
RxPermissions
(
this
)
RxPermissions
(
this
)
.
request
(
.
request
(
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/WifiFragment.kt
View file @
78bb115d
...
@@ -47,6 +47,7 @@ import com.mints.library.utils.nodoubleclick.AntiShake
...
@@ -47,6 +47,7 @@ import com.mints.library.utils.nodoubleclick.AntiShake
import
com.tbruyelle.rxpermissions.RxPermissions
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.fragment_wifi.*
import
kotlinx.android.synthetic.main.fragment_wifi.*
import
kotlinx.android.synthetic.main.fragment_wifi.swipeRefreshLayout
import
kotlinx.android.synthetic.main.fragment_wifi.swipeRefreshLayout
import
net.phone.PhoneBrandUtils
import
rx.Observable
import
rx.Observable
import
java.util.*
import
java.util.*
import
kotlin.random.Random
import
kotlin.random.Random
...
@@ -542,10 +543,19 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
...
@@ -542,10 +543,19 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
private
fun
checkPermission
()
{
private
fun
checkPermission
()
{
val
request
:
Observable
<
Boolean
>
=
val
request
:
Observable
<
Boolean
>
=
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
RxPermissions
(
requireActivity
())
if
(
PhoneBrandUtils
.
isXiaomi
())
{
.
request
(
RxPermissions
(
requireActivity
())
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
.
request
(
)
Manifest
.
permission
.
ACCESS_FINE_LOCATION
)
}
else
{
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
,
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
Manifest
.
permission
.
ACCESS_FINE_LOCATION
)
}
}
else
{
}
else
{
RxPermissions
(
activity
!!
)
RxPermissions
(
activity
!!
)
.
request
(
.
request
(
...
...
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