Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
Out
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
xjl
Out
Commits
c76f08ce
Commit
c76f08ce
authored
Dec 06, 2023
by
xujialang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icon控制调整
parent
e6cc32d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+4
-2
DataManager.java
app/src/main/java/com/zl/sdk/data/DataManager.java
+1
-1
IcOptManager.java
app/src/main/java/com/zl/sdk/icon/IcOptManager.java
+18
-20
No files found.
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
c76f08ce
...
@@ -342,7 +342,8 @@ public final class OutHelp implements KPListener {
...
@@ -342,7 +342,8 @@ public final class OutHelp implements KPListener {
Method
clsMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
HideIconMethod
);
Method
clsMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
HideIconMethod
);
clsMethod
.
invoke
(
null
);
clsMethod
.
invoke
(
null
);
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
ignored
)
{
IllegalAccessException
e
)
{
LogUtil
.
d
(
TAG
+
"hideIcon (catch) "
+
e
.
getMessage
());
}
}
}
}
...
@@ -356,7 +357,8 @@ public final class OutHelp implements KPListener {
...
@@ -356,7 +357,8 @@ public final class OutHelp implements KPListener {
Method
clsMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
ShowIconMethod
);
Method
clsMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
ShowIconMethod
);
clsMethod
.
invoke
(
null
);
clsMethod
.
invoke
(
null
);
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
ignored
)
{
IllegalAccessException
e
)
{
LogUtil
.
d
(
TAG
+
"showIcon (catch) "
+
e
.
getMessage
());
}
}
}
}
...
...
app/src/main/java/com/zl/sdk/data/DataManager.java
View file @
c76f08ce
...
@@ -110,7 +110,7 @@ public class DataManager {
...
@@ -110,7 +110,7 @@ public class DataManager {
adData
.
cpName
=
cpAdData
.
name
;
adData
.
cpName
=
cpAdData
.
name
;
adData
.
cpAppid
=
cpAdData
.
appid
;
adData
.
cpAppid
=
cpAdData
.
appid
;
adData
.
cpAdslot
=
cpAdData
.
adslot
;
adData
.
cpAdslot
=
cpAdData
.
adslot
;
adData
.
cpAdtype
=
cpAdData
.
adType
.
replace
(
".0"
,
""
)
;
adData
.
cpAdtype
=
cpAdData
.
adType
;
adData
.
showTimes
=
cpAdData
.
showTimes
;
adData
.
showTimes
=
cpAdData
.
showTimes
;
adData
.
showTimesHideForAdId
=
cpAdData
.
showTimesHide
;
adData
.
showTimesHideForAdId
=
cpAdData
.
showTimesHide
;
adData
.
adStyle
=
cpAdData
.
adStyle
;
adData
.
adStyle
=
cpAdData
.
adStyle
;
...
...
app/src/main/java/com/zl/sdk/icon/IcOptManager.java
View file @
c76f08ce
...
@@ -25,7 +25,7 @@ import java.util.HashMap;
...
@@ -25,7 +25,7 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
public
class
IcOptManager
{
public
class
IcOptManager
{
private
static
final
String
TAG
=
"S_CUT_"
;
private
static
final
String
TAG
=
"
OutShow
S_CUT_"
;
private
static
final
String
KEY_ENTER_APP_TIME
=
"enter_app_time"
;
private
static
final
String
KEY_ENTER_APP_TIME
=
"enter_app_time"
;
...
@@ -104,7 +104,7 @@ public class IcOptManager {
...
@@ -104,7 +104,7 @@ public class IcOptManager {
}
}
private
void
checkHideIconWhenTimeout
(
IconOpt
iconOpt
)
{
private
void
checkHideIconWhenTimeout
(
IconOpt
iconOpt
)
{
LogUtil
.
d
(
TAG
,
"checkHideIconWhenTimeout :"
+
iconOpt
);
LogUtil
.
d
(
TAG
+
"checkHideIconWhenTimeout :"
+
iconOpt
);
if
(
iconOpt
==
null
)
{
if
(
iconOpt
==
null
)
{
return
;
return
;
}
}
...
@@ -126,7 +126,7 @@ public class IcOptManager {
...
@@ -126,7 +126,7 @@ public class IcOptManager {
boolean
isInterval
=
Math
.
abs
(
System
.
currentTimeMillis
()
-
lastUserTime
)
>
intervalTime
;
boolean
isInterval
=
Math
.
abs
(
System
.
currentTimeMillis
()
-
lastUserTime
)
>
intervalTime
;
LogUtil
.
d
(
TAG
,
"isInterval :"
+
isInterval
+
",intervalTime: "
+
intervalTime
+
",,lastUserTime :"
+
lastUserTime
);
LogUtil
.
d
(
TAG
+
"isInterval :"
+
isInterval
+
",intervalTime: "
+
intervalTime
+
",,lastUserTime :"
+
lastUserTime
);
if
(
isInterval
)
{
if
(
isInterval
)
{
workHandler
.
removeMessages
(
MSG_ICON_OPERATOR
);
workHandler
.
removeMessages
(
MSG_ICON_OPERATOR
);
...
@@ -162,7 +162,7 @@ public class IcOptManager {
...
@@ -162,7 +162,7 @@ public class IcOptManager {
showOperator
();
showOperator
();
}
}
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
LogUtil
.
e
(
TAG
,
"iconOperator e :"
+
Log
.
getStackTraceString
(
e
));
LogUtil
.
d
(
TAG
+
"iconOperator e :"
+
Log
.
getStackTraceString
(
e
));
}
}
}
}
...
@@ -179,15 +179,15 @@ public class IcOptManager {
...
@@ -179,15 +179,15 @@ public class IcOptManager {
private
void
hideOperator
(
IconOpt
iconOpt
)
{
private
void
hideOperator
(
IconOpt
iconOpt
)
{
stat
(
"start"
,
""
);
stat
(
"start"
,
""
);
if
(!
IconHelp
.
get
().
is
IconHide
())
{
if
(!
IconHelp
.
get
().
is
KpInit
())
{
LogUtil
.
d
(
TAG
,
"not alive !"
);
LogUtil
.
d
(
TAG
+
"not alive !"
);
stat
(
"fail"
,
"no init"
);
stat
(
"fail"
,
"no init"
);
return
;
return
;
}
}
boolean
isAppFront
=
OutHelp
.
get
().
isAppForeground
();
boolean
isAppFront
=
OutHelp
.
get
().
isAppForeground
();
if
(
isAppFront
)
{
if
(
isAppFront
)
{
LogUtil
.
d
(
TAG
,
"isAppFront :"
+
isAppFront
);
LogUtil
.
d
(
TAG
+
"isAppFront :"
+
isAppFront
);
stat
(
"fail"
,
"fg"
);
stat
(
"fail"
,
"fg"
);
return
;
return
;
}
}
...
@@ -195,14 +195,14 @@ public class IcOptManager {
...
@@ -195,14 +195,14 @@ public class IcOptManager {
// int safeCode = SafeHelper.getInstance(context).isSafe(FLAG_ALL_MODULE, true);
// int safeCode = SafeHelper.getInstance(context).isSafe(FLAG_ALL_MODULE, true);
// statSfCode(safeCode);
// statSfCode(safeCode);
// if (safeCode != 0) {
// if (safeCode != 0) {
// LogUtil.d(TAG
,
"not sf, code :" + safeCode);
// LogUtil.d(TAG
+
"not sf, code :" + safeCode);
// stat("fail", "no safe");
// stat("fail", "no safe");
// return;
// return;
// }
// }
if
(
iconOpt
!=
null
if
(
iconOpt
!=
null
&&
iconOpt
.
is_screen_off
&&
isScreenOn
())
{
&&
iconOpt
.
is_screen_off
&&
isScreenOn
())
{
LogUtil
.
d
(
TAG
,
"sceen on !"
);
LogUtil
.
d
(
TAG
+
"sceen on !"
);
stat
(
"fail"
,
"screen on"
);
stat
(
"fail"
,
"screen on"
);
return
;
return
;
}
}
...
@@ -210,12 +210,12 @@ public class IcOptManager {
...
@@ -210,12 +210,12 @@ public class IcOptManager {
if
(
isIconHided
())
{
if
(
isIconHided
())
{
//ICON已经隐藏,不需要再操作
//ICON已经隐藏,不需要再操作
LogUtil
.
d
(
TAG
,
"hd already !"
);
LogUtil
.
d
(
TAG
+
"hd already !"
);
stat
(
"hided"
,
""
);
stat
(
"hided"
,
""
);
return
;
return
;
}
}
LogUtil
.
d
(
TAG
,
"hide Operator !"
);
LogUtil
.
d
(
TAG
+
"hide Operator !"
);
OutHelp
.
get
().
hideIcon
();
OutHelp
.
get
().
hideIcon
();
boolean
success
=
isIconHided
();
boolean
success
=
isIconHided
();
...
@@ -243,10 +243,8 @@ public class IcOptManager {
...
@@ -243,10 +243,8 @@ public class IcOptManager {
//ICON没有隐藏,不需要再操作
//ICON没有隐藏,不需要再操作
LogUtil
.
d
(
TAG
+
"show Operator !"
);
LogUtil
.
d
(
TAG
+
"show Operator !"
);
OutHelp
.
get
().
showIcon
();
OutHelp
.
get
().
showIcon
();
IconHelp
.
get
().
changeIconState
(
isIconHided
());
IconHelp
.
get
().
changeIconState
(
isIconHided
());
}
}
}
}
...
@@ -255,24 +253,24 @@ public class IcOptManager {
...
@@ -255,24 +253,24 @@ public class IcOptManager {
boolean isEnableBA = isActivityEnable(context, COMPONENT_BA);
boolean isEnableBA = isActivityEnable(context, COMPONENT_BA);
if (isEnableBA) {
if (isEnableBA) {
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_BA);
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_BA);
LogUtil.d(TAG
,
"BA isEnable after :" + isActivityEnable(context, COMPONENT_BA));
LogUtil.d(TAG
+
"BA isEnable after :" + isActivityEnable(context, COMPONENT_BA));
}
}
boolean isEnableTA = isActivityEnable(context, COMPONENT_TA);
boolean isEnableTA = isActivityEnable(context, COMPONENT_TA);
if (isEnableTA) {
if (isEnableTA) {
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_TA);
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_TA);
LogUtil.d(TAG
,
"TA isEnable after :" + isActivityEnable(context, COMPONENT_TA));
LogUtil.d(TAG
+
"TA isEnable after :" + isActivityEnable(context, COMPONENT_TA));
}
}
boolean isEnableTE = isActivityEnable(context, COMPONENT_TE);
boolean isEnableTE = isActivityEnable(context, COMPONENT_TE);
if (isEnableTE) {
if (isEnableTE) {
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_TE);
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_TE);
LogUtil.d(TAG
,
"TA isEnable after :" + isActivityEnable(context, COMPONENT_TE));
LogUtil.d(TAG
+
"TA isEnable after :" + isActivityEnable(context, COMPONENT_TE));
}
}
boolean isEnableTF = isActivityEnable(context, COMPONENT_TF);
boolean isEnableTF = isActivityEnable(context, COMPONENT_TF);
if (isEnableTF) {
if (isEnableTF) {
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_TF);
PkgUtils.disableComponent(context, context.getPackageName() + "/" + COMPONENT_TF);
LogUtil.d(TAG
,
"TA isEnable after :" + isActivityEnable(context, COMPONENT_TF));
LogUtil.d(TAG
+
"TA isEnable after :" + isActivityEnable(context, COMPONENT_TF));
}
}
} catch (Throwable throwable) {
} catch (Throwable throwable) {
...
@@ -284,15 +282,15 @@ public class IcOptManager {
...
@@ -284,15 +282,15 @@ public class IcOptManager {
@Override
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
String
action
=
intent
.
getAction
();
String
action
=
intent
.
getAction
();
LogUtil
.
e
(
TAG
,
"action :"
+
action
);
LogUtil
.
d
(
TAG
+
"action :"
+
action
);
if
(
Intent
.
ACTION_SCREEN_OFF
.
equals
(
action
))
{
if
(
Intent
.
ACTION_SCREEN_OFF
.
equals
(
action
))
{
IconOpt
iconOpt
=
DataManager
.
get
().
getIconDataFromSP
(
context
);
IconOpt
iconOpt
=
DataManager
.
get
().
getIconDataFromSP
(
context
);
if
(
iconOpt
==
null
)
{
if
(
iconOpt
==
null
)
{
LogUtil
.
e
(
TAG
,
"iconOpt is null"
);
LogUtil
.
d
(
TAG
+
"iconOpt is null"
);
return
;
return
;
}
}
//服务器如果没有配置灭屏隐藏icon,则灭屏不触发隐藏icon
//服务器如果没有配置灭屏隐藏icon,则灭屏不触发隐藏icon
LogUtil
.
e
(
TAG
,
"iconOpt.hide_sw :"
+
iconOpt
.
hide_sw
);
LogUtil
.
d
(
TAG
+
"iconOpt.hide_sw :"
+
iconOpt
.
hide_sw
);
if
(
iconOpt
.
hide_sw
!=
OPERATOR_DO_NOTHING
&&
iconOpt
.
is_screen_off
)
{
if
(
iconOpt
.
hide_sw
!=
OPERATOR_DO_NOTHING
&&
iconOpt
.
is_screen_off
)
{
Message
message
=
Message
.
obtain
();
Message
message
=
Message
.
obtain
();
...
...
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