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
7d7cbafb
Commit
7d7cbafb
authored
Dec 19, 2023
by
xujialang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加广播回调的动态代理
parent
30f3e9c9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
177 additions
and
70 deletions
+177
-70
NameInterfaceHelp.java
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
+53
-0
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+121
-69
EventUtils.java
app/src/main/java/com/zl/sdk/event/EventUtils.java
+2
-0
OutAdManager.java
app/src/main/java/com/zl/sdk/out/OutAdManager.java
+1
-1
No files found.
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
View file @
7d7cbafb
...
@@ -12,6 +12,7 @@ public class NameInterfaceHelp {
...
@@ -12,6 +12,7 @@ public class NameInterfaceHelp {
private
static
String
FG_Class_Path
=
""
;
private
static
String
FG_Class_Path
=
""
;
private
static
String
FG_StartCallback_Class_Path
=
""
;
private
static
String
FG_StartCallback_Class_Path
=
""
;
private
static
String
FG_NotificationConfig_Class_Path
=
""
;
private
static
String
FG_NotificationConfig_Class_Path
=
""
;
private
static
String
Action_Listener_Class_Path
=
""
;
private
static
String
FG_Start_Method_Name
=
""
;
private
static
String
FG_Start_Method_Name
=
""
;
public
static
String
getClassPath
()
{
public
static
String
getClassPath
()
{
...
@@ -126,6 +127,31 @@ public class NameInterfaceHelp {
...
@@ -126,6 +127,31 @@ public class NameInterfaceHelp {
return
FG_NotificationConfig_Class_Path
;
return
FG_NotificationConfig_Class_Path
;
}
}
/**
* 获取ActionListener类的路径
*/
public
static
String
getActionListenerClassPath
()
{
if
(
TextUtils
.
isEmpty
(
Action_Listener_Class_Path
))
{
try
{
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Method
fNameMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
GetFGStringMethod
,
String
.
class
);
Object
fgStr
=
fNameMethod
.
invoke
(
null
,
"ActionListener"
);
if
(
fgStr
==
null
)
{
Action_Listener_Class_Path
=
""
;
}
else
{
Action_Listener_Class_Path
=
(
String
)
fgStr
;
}
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
ignored
)
{
LogUtil
.
d
(
"OutShow 反射获取 getActionListenerClassPath (catch) "
+
ignored
);
}
}
LogUtil
.
d
(
"OutShow getActionListenerClassPath="
+
Action_Listener_Class_Path
);
return
Action_Listener_Class_Path
;
}
public
static
Object
getNewCallBack
()
{
public
static
Object
getNewCallBack
()
{
try
{
try
{
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
...
@@ -141,13 +167,40 @@ public class NameInterfaceHelp {
...
@@ -141,13 +167,40 @@ public class NameInterfaceHelp {
}
}
public
static
Object
getActionListener
()
{
try
{
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Method
callBackMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
GetActionListenerMethod
);
return
callBackMethod
.
invoke
(
null
);
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
ignored
)
{
LogUtil
.
d
(
"OutShow 反射获取 getActionListener (catch) "
+
ignored
);
}
return
null
;
}
/**
/**
* 获取FG相关名称或路径的方法名称
* 获取FG相关名称或路径的方法名称
*/
*/
public
static
String
GetFGStringMethod
=
"getFName"
;
public
static
String
GetFGStringMethod
=
"getFName"
;
/**
* 拉起弹窗的回调实例的方法名称
*/
public
static
String
GetNewCallBackMethod
=
"getNewCallBack"
;
public
static
String
GetNewCallBackMethod
=
"getNewCallBack"
;
/**
* 接收广播的回调实例的方法名称
*/
public
static
String
GetActionListenerMethod
=
"getActionListener"
;
/**
* 添加广告回调的方法名称
*/
public
static
String
RegisterActionMethod
=
"registerAction"
;
/**
/**
* 获取保活方法的方法名称
* 获取保活方法的方法名称
*/
*/
...
...
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
7d7cbafb
This diff is collapsed.
Click to expand it.
app/src/main/java/com/zl/sdk/event/EventUtils.java
View file @
7d7cbafb
...
@@ -9,6 +9,7 @@ import com.zl.sdk.bean.OutAdData;
...
@@ -9,6 +9,7 @@ import com.zl.sdk.bean.OutAdData;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.icon.IconHelp
;
import
com.zl.sdk.icon.IconHelp
;
import
com.zl.sdk.out.CheckHelper
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.LogUtil
;
import
org.json.JSONException
;
import
org.json.JSONException
;
...
@@ -247,6 +248,7 @@ public final class EventUtils {
...
@@ -247,6 +248,7 @@ public final class EventUtils {
hashMap
.
put
(
AdsParamsInfo
.
AD_CURRENCYCode
,
bean
.
currencyCode
);
hashMap
.
put
(
AdsParamsInfo
.
AD_CURRENCYCode
,
bean
.
currencyCode
);
hashMap
.
put
(
AdsParamsInfo
.
AD_VALUEMICROS
,
String
.
valueOf
(
bean
.
valueMicros
));
hashMap
.
put
(
AdsParamsInfo
.
AD_VALUEMICROS
,
String
.
valueOf
(
bean
.
valueMicros
));
hashMap
.
put
(
AdsParamsInfo
.
AD_SCENES
,
bean
.
ad_scenes
);
hashMap
.
put
(
AdsParamsInfo
.
AD_SCENES
,
bean
.
ad_scenes
);
hashMap
.
put
(
AdsParamsInfo
.
NET
,
CheckHelper
.
isNetworkAvailable
(
OutHelp
.
get
().
getContext
())
?
"1"
:
"0"
);
hashMap
.
put
(
"hide"
,
String
.
valueOf
(
IconHelp
.
get
().
isIconHide
()));
hashMap
.
put
(
"hide"
,
String
.
valueOf
(
IconHelp
.
get
().
isIconHide
()));
if
(!
TextUtils
.
isEmpty
(
bean
.
eventid
))
{
if
(!
TextUtils
.
isEmpty
(
bean
.
eventid
))
{
if
(!
bean
.
eventid
.
equals
(
AdsParamsInfo
.
F_REQUEST
))
{
if
(!
bean
.
eventid
.
equals
(
AdsParamsInfo
.
F_REQUEST
))
{
...
...
app/src/main/java/com/zl/sdk/out/OutAdManager.java
View file @
7d7cbafb
...
@@ -345,7 +345,6 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -345,7 +345,6 @@ public class OutAdManager extends BaseOutShowManager {
outDialogShowFail
(
context
,
actionFrom
,
remindersInfo
,
data
,
reason
);
outDialogShowFail
(
context
,
actionFrom
,
remindersInfo
,
data
,
reason
);
}
}
});
});
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtil
.
d
(
TAG
+
"广告弹窗 拉起失败 catch 不再重试"
);
LogUtil
.
d
(
TAG
+
"广告弹窗 拉起失败 catch 不再重试"
);
returnFailCallBack
(
"slk show fail"
);
returnFailCallBack
(
"slk show fail"
);
...
@@ -467,6 +466,7 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -467,6 +466,7 @@ public class OutAdManager extends BaseOutShowManager {
// LogUtil.d(TAG + "加载广告(原生) adData :" + normalAdData);
// LogUtil.d(TAG + "加载广告(原生) adData :" + normalAdData);
// TopOnAdLoadManager.getInstance().loadNativeAd(normalAdData, AdScenes.AD_SCENES_PURE);
// TopOnAdLoadManager.getInstance().loadNativeAd(normalAdData, AdScenes.AD_SCENES_PURE);
// } else
// } else
if
(
OutAdData
.
CP_AD_TYPE_CHAPING
.
equals
(
normalAdData
.
cpAdtype
))
{
if
(
OutAdData
.
CP_AD_TYPE_CHAPING
.
equals
(
normalAdData
.
cpAdtype
))
{
LogUtil
.
d
(
TAG
+
"加载广告(插屏) adData :"
+
normalAdData
);
LogUtil
.
d
(
TAG
+
"加载广告(插屏) adData :"
+
normalAdData
);
hadStartAdDialogFail
=
false
;
hadStartAdDialogFail
=
false
;
...
...
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