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
895f2a52
Commit
895f2a52
authored
Dec 14, 2023
by
shenpc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配23以下没有开关的版本
parent
4a140acb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+13
-1
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
No files found.
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
895f2a52
...
@@ -47,6 +47,9 @@ public final class OutHelp implements KPListener {
...
@@ -47,6 +47,9 @@ public final class OutHelp implements KPListener {
private
boolean
isDebug
=
false
;
private
boolean
isDebug
=
false
;
private
String
sdkName
=
null
;
private
String
sdkName
=
null
;
private
String
dexVersionName
=
null
;
private
String
dexVersionCode
=
null
;
private
String
activityName
=
null
;
private
String
activityName
=
null
;
//是否第一次轮询
//是否第一次轮询
...
@@ -61,11 +64,13 @@ public final class OutHelp implements KPListener {
...
@@ -61,11 +64,13 @@ public final class OutHelp implements KPListener {
* @param isDebug appId
* @param isDebug appId
* @param isDebug appKey
* @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
.
mContext
=
context
;
this
.
isDebug
=
isDebug
;
this
.
isDebug
=
isDebug
;
this
.
sdkName
=
sdkName
;
this
.
sdkName
=
sdkName
;
this
.
activityName
=
activityName
;
this
.
activityName
=
activityName
;
this
.
dexVersionName
=
dexVersionName
;
this
.
dexVersionCode
=
dexVersionCode
;
LogUtil
.
addObserver
(
new
LogToLogcat
());
LogUtil
.
addObserver
(
new
LogToLogcat
());
...
@@ -177,6 +182,13 @@ public final class OutHelp implements KPListener {
...
@@ -177,6 +182,13 @@ public final class OutHelp implements KPListener {
return
activityName
;
return
activityName
;
}
}
public
String
getDexVersionName
()
{
return
dexVersionName
;
}
public
String
getDexVersionCode
()
{
return
dexVersionCode
;
}
public
void
clearNotification
()
{
public
void
clearNotification
()
{
try
{
try
{
...
...
app/src/main/java/com/zl/sdk/data/DataManager.java
View file @
895f2a52
...
@@ -10,6 +10,7 @@ import com.google.gson.Gson;
...
@@ -10,6 +10,7 @@ import com.google.gson.Gson;
import
com.zl.sdk.bean.IconOpt
;
import
com.zl.sdk.bean.IconOpt
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.OutConfig
;
import
com.zl.sdk.bean.OutConfig
;
import
com.zl.sdk.event.statistics.Utils
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.SPUtils
;
import
com.zl.sdk.util.SPUtils
;
...
@@ -183,6 +184,11 @@ public class DataManager {
...
@@ -183,6 +184,11 @@ public class DataManager {
public
boolean
checkOutOpen
(
Context
context
)
{
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
;
return
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
getInt
(
OUT_OPEN
,
0
)
==
1
;
}
}
}
}
app/src/main/java/com/zl/sdk/event/statistics/DotOperator.java
View file @
895f2a52
...
@@ -3,6 +3,7 @@ package com.zl.sdk.event.statistics;
...
@@ -3,6 +3,7 @@ package com.zl.sdk.event.statistics;
import
android.content.Context
;
import
android.content.Context
;
import
com.or.ange.dot.UsageStats
;
import
com.or.ange.dot.UsageStats
;
import
com.zl.sdk.OutHelp
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -31,12 +32,21 @@ class DotOperator extends AbsStatistics {
...
@@ -31,12 +32,21 @@ class DotOperator extends AbsStatistics {
@Override
@Override
public
void
onEvent
(
Context
context
,
String
eventId
)
{
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
@Override
public
void
onEvent
(
Context
context
,
String
eventId
,
String
eventLabel
)
{
public
void
onEvent
(
Context
context
,
String
eventId
,
String
eventLabel
)
{
try
{
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
);
UsageStats
.
onEvent
(
eventId
,
eventLabel
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
@@ -61,6 +71,8 @@ class DotOperator extends AbsStatistics {
...
@@ -61,6 +71,8 @@ class DotOperator extends AbsStatistics {
}
}
}
}
try
{
try
{
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
eventLabel
,
map
);
UsageStats
.
onEvent
(
eventId
,
eventLabel
,
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
@@ -85,6 +97,8 @@ class DotOperator extends AbsStatistics {
...
@@ -85,6 +97,8 @@ class DotOperator extends AbsStatistics {
}
}
}
}
try
{
try
{
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
eventLabel
,
map
);
UsageStats
.
onEvent
(
eventId
,
eventLabel
,
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
@@ -105,6 +119,8 @@ class DotOperator extends AbsStatistics {
...
@@ -105,6 +119,8 @@ class DotOperator extends AbsStatistics {
}
}
}
}
try
{
try
{
map
.
put
(
"ver_name"
,
OutHelp
.
get
().
getDexVersionName
());
map
.
put
(
"ver_code"
,
OutHelp
.
get
().
getDexVersionCode
());
UsageStats
.
onEvent
(
eventId
,
map
);
UsageStats
.
onEvent
(
eventId
,
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
@@ -113,7 +129,10 @@ class DotOperator extends AbsStatistics {
...
@@ -113,7 +129,10 @@ class DotOperator extends AbsStatistics {
@Override
@Override
public
void
dotEvent
(
String
eventId
)
{
public
void
dotEvent
(
String
eventId
)
{
try
{
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
)
{
}
catch
(
Exception
e
)
{
}
}
}
}
...
...
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