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
79889eec
Commit
79889eec
authored
Dec 04, 2023
by
xujialang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新-添加输出日志
parent
c8b3abe2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
13 deletions
+50
-13
NameInterfaceHelp.java
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
+3
-0
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+33
-11
TopOnAdManager.java
app/src/main/java/com/zl/sdk/ad/topOn/TopOnAdManager.java
+3
-1
AdAppInfo.java
app/src/main/java/com/zl/sdk/bean/AdAppInfo.java
+8
-0
IcOptManager.java
app/src/main/java/com/zl/sdk/icon/IcOptManager.java
+2
-0
IconHelp.java
app/src/main/java/com/zl/sdk/icon/IconHelp.java
+1
-1
No files found.
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
View file @
79889eec
...
...
@@ -2,6 +2,8 @@ package com.zl.sdk;
import
android.text.TextUtils
;
import
com.zl.sdk.util.LogUtil
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
...
...
@@ -17,6 +19,7 @@ public class NameInterfaceHelp {
}
public
static
void
setClassPath
(
String
class_Path
)
{
LogUtil
.
d
(
"OutShow 初始化:中间类路径:"
+
class_Path
);
Class_Path
=
class_Path
;
}
...
...
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
79889eec
...
...
@@ -9,8 +9,6 @@ import android.content.IntentFilter;
import
com.zl.sdk.ad.topOn.TopOnAdManager
;
import
com.zl.sdk.bean.AdAppInfo
;
import
com.zl.sdk.bean.IconOpt
;
import
com.zl.sdk.data.DataManager
;
import
com.zl.sdk.icon.IcOptManager
;
import
com.zl.sdk.icon.IconHelp
;
import
com.zl.sdk.out.ActionFrom
;
...
...
@@ -63,10 +61,16 @@ public final class OutHelp implements KPListener {
this
.
isDebug
=
isDebug
;
this
.
sdkName
=
sdkName
;
NameInterfaceHelp
.
setClassPath
(
nameInterfacePath
);
LogUtil
.
d
(
TAG
+
"初始化 isDebug="
+
isDebug
);
LogUtil
.
d
(
TAG
+
"初始化 appId="
+
appId
);
LogUtil
.
d
(
TAG
+
"初始化 appKey="
+
appKey
);
LogUtil
.
d
(
TAG
+
"初始化 sdkName="
+
sdkName
);
LogUtil
.
d
(
TAG
+
"初始化 nameInterfacePath="
+
nameInterfacePath
);
LogUtil
.
addObserver
(
new
LogToLogcat
());
NameInterfaceHelp
.
setClassPath
(
nameInterfacePath
);
//初始化广告SDK
AdAppInfo
appInfo
=
new
AdAppInfo
(
appId
,
appKey
);
TopOnAdManager
.
get
().
initSDK
(
context
,
appInfo
);
...
...
@@ -87,6 +91,7 @@ public final class OutHelp implements KPListener {
private
Timer
timer
;
private
void
initTimer
()
{
LogUtil
.
d
(
TAG
+
"初始化:initTimer"
);
timer
=
new
Timer
();
timer
.
schedule
(
new
TimerTask
()
{
@Override
...
...
@@ -97,10 +102,11 @@ public final class OutHelp implements KPListener {
firstLx
=
false
;
}
}
},
0
,
60
*
1000
);
},
0
,
60
*
1000
);
}
private
void
initReceiver
()
{
LogUtil
.
d
(
TAG
+
"初始化:initReceiver"
);
TriggerReceiver
triggerReceiver
=
new
TriggerReceiver
();
IntentFilter
intentfilter
=
new
IntentFilter
();
intentfilter
.
addAction
(
Intent
.
ACTION_USER_PRESENT
);
...
...
@@ -116,6 +122,7 @@ public final class OutHelp implements KPListener {
* @param actionFrom 动作来源
*/
public
void
showOutAd
(
ActionFrom
actionFrom
)
{
LogUtil
.
d
(
TAG
+
"showOutAd(解锁)actionFrom="
+
actionFrom
);
OutAdManager
.
get
().
startShowOutAd
(
actionFrom
);
}
...
...
@@ -126,6 +133,7 @@ public final class OutHelp implements KPListener {
* @param isFirst 是否第一次检查
*/
private
void
showOutAd
(
boolean
isFirst
)
{
LogUtil
.
d
(
TAG
+
"showOutAd(轮询) isFirst="
+
isFirst
);
OutAdManager
.
get
().
checkShowOutAd
(
isFirst
);
}
...
...
@@ -161,19 +169,22 @@ public final class OutHelp implements KPListener {
*/
@Override
public
boolean
isInit
()
{
LogUtil
.
d
(
TAG
+
"isInit"
);
LogUtil
.
d
(
TAG
+
"
获取保活
isInit"
);
try
{
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Method
isInitMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
GetKPInitMethod
);
Object
isInit
=
isInitMethod
.
invoke
(
null
);
if
(
isInit
!=
null
)
{
LogUtil
.
d
(
TAG
+
"获取保活: isInit="
+
isInit
);
return
(
boolean
)
isInit
;
}
else
{
LogUtil
.
d
(
TAG
+
"获取保活:(null) isInit=false"
);
return
false
;
}
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
e
)
{
LogUtil
.
d
(
TAG
+
"获取保活:(catch) isInit=false"
);
return
false
;
}
}
...
...
@@ -184,19 +195,22 @@ public final class OutHelp implements KPListener {
*/
@Override
public
boolean
iconIsHide
()
{
LogUtil
.
d
(
TAG
+
"iconIsHide"
);
LogUtil
.
d
(
TAG
+
"
获取icon状态:
iconIsHide"
);
try
{
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Method
isHideMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
GetIconStateMethod
);
Object
isHide
=
isHideMethod
.
invoke
(
null
);
if
(
isHide
!=
null
)
{
LogUtil
.
d
(
TAG
+
"获取icon状态: isHide="
+
isHide
);
return
(
boolean
)
isHide
;
}
else
{
LogUtil
.
d
(
TAG
+
"获取icon状态:(null) isHide=false"
);
return
false
;
}
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
e
)
{
LogUtil
.
d
(
TAG
+
"获取icon状态:(catch) isHide=false"
);
return
false
;
}
}
...
...
@@ -209,19 +223,22 @@ public final class OutHelp implements KPListener {
*/
@Override
public
boolean
isAppForeground
()
{
LogUtil
.
d
(
TAG
+
"isAppForeground"
);
LogUtil
.
d
(
TAG
+
"
获取前后台:
isAppForeground"
);
try
{
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Method
clsMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
GetAppRunForegroundMethod
);
Object
isAppInFront
=
clsMethod
.
invoke
(
null
);
if
(
isAppInFront
!=
null
)
{
LogUtil
.
d
(
TAG
+
"获取前后台: isAppInFront="
+
isAppInFront
);
return
(
boolean
)
isAppInFront
;
}
else
{
LogUtil
.
d
(
TAG
+
"获取前后台:(null) isAppInFront=false"
);
return
false
;
}
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
e
)
{
LogUtil
.
d
(
TAG
+
"获取前后台:(catch) isAppInFront=false"
);
return
false
;
}
}
...
...
@@ -233,7 +250,7 @@ public final class OutHelp implements KPListener {
*/
@Override
public
void
startOutDialog
(
Intent
intent
,
DialogShowStatusCallback
callback
)
{
LogUtil
.
d
(
TAG
+
"
startOutDialog
"
);
LogUtil
.
d
(
TAG
+
"
拉起外展
"
);
try
{
Class
<?>
fgClass
=
Class
.
forName
(
NameInterfaceHelp
.
getFGClassPath
());
...
...
@@ -269,6 +286,7 @@ public final class OutHelp implements KPListener {
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
|
InstantiationException
e
)
{
LogUtil
.
d
(
TAG
+
"拉起外展:(catch) fail="
+
e
);
if
(
callback
!=
null
)
{
callback
.
fail
(
"执行失败"
);
}
...
...
@@ -317,11 +335,15 @@ public final class OutHelp implements KPListener {
public
Object
invoke
(
Object
o
,
Method
method
,
Object
[]
objects
)
throws
Throwable
{
if
(
callback
!=
null
)
{
if
(
"onSuccess"
.
equals
(
method
.
getName
())
||
objects
.
length
==
1
)
{
LogUtil
.
d
(
TAG
+
"拉起外展:onSuccess"
);
callback
.
success
();
}
else
if
(
"onFail"
.
equals
(
method
.
getName
())
||
objects
.
length
==
2
)
{
LogUtil
.
d
(
TAG
+
"拉起外展:onFail"
);
if
(
objects
.
length
>=
2
)
{
LogUtil
.
d
(
TAG
+
"拉起外展:onFail reason="
+
objects
[
1
]);
callback
.
fail
((
String
)
objects
[
1
]);
}
else
{
LogUtil
.
d
(
TAG
+
"拉起外展:onFail reason=unknown"
);
callback
.
fail
(
"unknown"
);
}
}
...
...
@@ -339,16 +361,16 @@ public final class OutHelp implements KPListener {
String
action
=
intent
.
getAction
();
switch
(
action
)
{
case
Intent
.
ACTION_USER_PRESENT
:
{
LogUtil
.
d
(
"OutShow
===>>> 解锁"
);
LogUtil
.
d
(
TAG
+
"
===>>> 解锁"
);
OutHelp
.
get
().
showOutAd
(
ActionFrom
.
ACTION_USER_PRESENT
);
break
;
}
case
Intent
.
ACTION_SCREEN_ON
:
{
LogUtil
.
d
(
"OutShow
===>>> 亮屏"
);
LogUtil
.
d
(
TAG
+
"
===>>> 亮屏"
);
break
;
}
case
Intent
.
ACTION_CLOSE_SYSTEM_DIALOGS
:
{
LogUtil
.
d
(
"OutShow
===>>> 桌面"
);
LogUtil
.
d
(
TAG
+
"
===>>> 桌面"
);
break
;
}
default
:
{
...
...
app/src/main/java/com/zl/sdk/ad/topOn/TopOnAdManager.java
View file @
79889eec
...
...
@@ -26,8 +26,10 @@ public class TopOnAdManager {
return
;
}
LogUtil
.
d
(
TAG
+
"初始化:topon应用信息:"
+
appInfo
);
//SDK日志功能,集成测试阶段建议开启,上线前必须关闭
ATSDK
.
setNetworkLogDebug
(
fals
e
);
ATSDK
.
setNetworkLogDebug
(
tru
e
);
// //检查广告平台的集成状态,提交审核时需注释此API
// ATSDK.integrationChecking(context);
//
...
...
app/src/main/java/com/zl/sdk/bean/AdAppInfo.java
View file @
79889eec
...
...
@@ -8,4 +8,12 @@ public class AdAppInfo {
this
.
app_id
=
app_id
;
this
.
app_key
=
app_key
;
}
@Override
public
String
toString
()
{
return
"AdAppInfo{"
+
"app_id='"
+
app_id
+
'\''
+
", app_key='"
+
app_key
+
'\''
+
'}'
;
}
}
app/src/main/java/com/zl/sdk/icon/IcOptManager.java
View file @
79889eec
...
...
@@ -82,6 +82,8 @@ public class IcOptManager {
return
;
}
LogUtil
.
d
(
TAG
+
"初始化:IcOptManager"
);
this
.
context
=
context
.
getApplicationContext
();
screenBroadcastReceiver
=
new
ScreenBroadcastReceiver
();
IntentFilter
intentFilter
=
new
IntentFilter
();
...
...
app/src/main/java/com/zl/sdk/icon/IconHelp.java
View file @
79889eec
...
...
@@ -54,7 +54,7 @@ public class IconHelp {
public
void
init
()
{
iconHide
=
OutHelp
.
get
().
iconIsHide
();
LogUtil
.
d
(
TAG
+
"
检查icon状态:
iconHide="
+
iconHide
);
LogUtil
.
d
(
TAG
+
"
初始化:检查icon状态
iconHide="
+
iconHide
);
if
(
iconHide
)
{
iconHadHide
();
...
...
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