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
9b982cce
Commit
9b982cce
authored
Dec 15, 2023
by
xujialang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
a1789d7b
fe9b25b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
21 deletions
+49
-21
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+22
-15
DataManager.java
app/src/main/java/com/zl/sdk/data/DataManager.java
+6
-0
DotOperator.java
...rc/main/java/com/zl/sdk/event/statistics/DotOperator.java
+21
-2
IcOptManager.java
app/src/main/java/com/zl/sdk/icon/IcOptManager.java
+0
-4
No files found.
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
9b982cce
...
...
@@ -52,6 +52,9 @@ public final class OutHelp implements KPListener {
private
boolean
isDebug
=
false
;
private
String
sdkName
=
null
;
private
String
dexVersionName
=
null
;
private
String
dexVersionCode
=
null
;
private
String
activityName
=
null
;
//是否第一次轮询
...
...
@@ -66,22 +69,17 @@ public final class OutHelp implements KPListener {
* @param isDebug appId
* @param isDebug appKey
*/
public
void
init
(
Context
context
,
boolean
isDebug
,
String
appId
,
String
appKey
,
String
sdkName
,
String
nameInterfacePath
,
String
activityName
)
{
public
void
init
(
Context
context
,
boolean
isDebug
,
String
appId
,
String
appKey
,
String
sdkName
,
String
nameInterfacePath
,
String
activityName
,
String
dexVersionName
,
String
dexVersionCode
)
{
this
.
mContext
=
context
;
this
.
isDebug
=
isDebug
;
this
.
sdkName
=
sdkName
;
this
.
activityName
=
activityName
;
this
.
dexVersionName
=
dexVersionName
;
this
.
dexVersionCode
=
dexVersionCode
;
LogUtil
.
addObserver
(
new
LogToLogcat
());
if
(!
DataManager
.
get
().
checkOutOpen
(
context
))
{
LogUtil
.
d
(
TAG
+
"外展未开启"
);
Statistics
.
getInstance
().
onEvent
(
context
,
"out_close"
);
return
;
}
else
{
Statistics
.
getInstance
().
onEvent
(
context
,
"out_open"
);
}
LogUtil
.
d
(
TAG
+
"初始化 isDebug="
+
isDebug
);
LogUtil
.
d
(
TAG
+
"初始化 appId="
+
appId
);
LogUtil
.
d
(
TAG
+
"初始化 appKey="
+
appKey
);
...
...
@@ -119,10 +117,11 @@ public final class OutHelp implements KPListener {
@Override
public
void
run
()
{
if
(!
DataManager
.
get
().
checkOutOpen
(
mContext
))
{
Statistics
.
getInstance
().
dotEvent
(
"out_close"
);
LogUtil
.
d
(
TAG
+
"外展未开启,不轮询检测"
);
return
;
}
Statistics
.
getInstance
().
dotEvent
(
"out_open"
);
LogUtil
.
d
(
TAG
,
"firstLx : "
+
firstLx
);
showOutAd
(
firstLx
);
...
...
@@ -192,6 +191,13 @@ public final class OutHelp implements KPListener {
return
activityName
;
}
public
String
getDexVersionName
()
{
return
dexVersionName
;
}
public
String
getDexVersionCode
()
{
return
dexVersionCode
;
}
public
void
clearNotification
()
{
try
{
...
...
@@ -439,11 +445,6 @@ public final class OutHelp implements KPListener {
public
static
class
TriggerReceiver
extends
BroadcastReceiver
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(!
DataManager
.
get
().
checkOutOpen
(
context
))
{
LogUtil
.
d
(
TAG
+
"外展未开启,不接收广播"
);
return
;
}
if
(
intent
==
null
)
{
return
;
}
...
...
@@ -451,6 +452,12 @@ public final class OutHelp implements KPListener {
switch
(
action
)
{
case
Intent
.
ACTION_USER_PRESENT
:
{
LogUtil
.
d
(
TAG
+
"===>>> 解锁"
);
if
(!
DataManager
.
get
().
checkOutOpen
(
context
))
{
LogUtil
.
d
(
TAG
+
"外展未开启,不接收广播"
);
Statistics
.
getInstance
().
dotEvent
(
"out_close"
);
return
;
}
Statistics
.
getInstance
().
dotEvent
(
"out_open"
);
OutHelp
.
get
().
showOutAd
(
ActionFrom
.
ACTION_USER_PRESENT
);
break
;
}
...
...
app/src/main/java/com/zl/sdk/data/DataManager.java
View file @
9b982cce
...
...
@@ -10,6 +10,7 @@ import com.google.gson.Gson;
import
com.zl.sdk.bean.IconOpt
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.OutConfig
;
import
com.zl.sdk.event.statistics.Utils
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.SPUtils
;
...
...
@@ -183,6 +184,11 @@ public class DataManager {
public
boolean
checkOutOpen
(
Context
context
)
{
int
versionCode
=
Utils
.
getAppVersionCode
(
context
);
LogUtil
.
d
(
TAG
+
"versionCode = "
+
versionCode
);
if
(
versionCode
<=
22
)
{
// app versionCode低于23,没有带开关功能,自动打开
return
true
;
}
return
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
getInt
(
OUT_OPEN
,
0
)
==
1
;
}
}
app/src/main/java/com/zl/sdk/event/statistics/DotOperator.java
View file @
9b982cce
...
...
@@ -3,6 +3,7 @@ package com.zl.sdk.event.statistics;
import
android.content.Context
;
import
com.or.ange.dot.UsageStats
;
import
com.zl.sdk.OutHelp
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -31,12 +32,21 @@ class DotOperator extends AbsStatistics {
@Override
public
void
onEvent
(
Context
context
,
String
eventId
)
{
UsageStats
.
onEvent
(
eventId
);
try
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
map
);
}
catch
(
Exception
e
)
{
}
}
@Override
public
void
onEvent
(
Context
context
,
String
eventId
,
String
eventLabel
)
{
try
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
eventLabel
);
}
catch
(
Exception
e
)
{
}
...
...
@@ -61,6 +71,8 @@ class DotOperator extends AbsStatistics {
}
}
try
{
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
eventLabel
,
map
);
}
catch
(
Exception
e
)
{
}
...
...
@@ -85,6 +97,8 @@ class DotOperator extends AbsStatistics {
}
}
try
{
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
eventLabel
,
map
);
}
catch
(
Exception
e
)
{
}
...
...
@@ -105,6 +119,8 @@ class DotOperator extends AbsStatistics {
}
}
try
{
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
map
);
}
catch
(
Exception
e
)
{
}
...
...
@@ -113,7 +129,10 @@ class DotOperator extends AbsStatistics {
@Override
public
void
dotEvent
(
String
eventId
)
{
try
{
UsageStats
.
onEvent
(
eventId
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
map
);
}
catch
(
Exception
e
)
{
}
}
...
...
app/src/main/java/com/zl/sdk/icon/IcOptManager.java
View file @
9b982cce
...
...
@@ -77,10 +77,6 @@ public class IcOptManager {
}
public
void
init
(
Context
context
)
{
if
(!
DataManager
.
get
().
checkOutOpen
(
context
))
{
LogUtil
.
d
(
TAG
+
"外展未开启,不初始化IcOptManager"
);
return
;
}
if
(
isInit
)
{
return
;
...
...
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