Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
bp
ShenghuoquanBusiness
Commits
ff289290
Commit
ff289290
authored
Jun 15, 2021
by
shiyuelong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集成友盟统计
parent
9554bd68
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
112 deletions
+120
-112
AppConfig.kt
...onLib/Common/src/main/java/com/yidian/common/AppConfig.kt
+4
-4
UMConfigUtils.kt
...on/src/main/java/com/yidian/common/utils/UMConfigUtils.kt
+91
-86
icon_black_add.webp
...scontent/src/main/res/drawable-xxhdpi/icon_black_add.webp
+0
-0
svg_baseline_add_24.xml
...newscontent/src/main/res/drawable/svg_baseline_add_24.xml
+0
-10
activity_my_staff.xml
...nts/newscontent/src/main/res/layout/activity_my_staff.xml
+1
-1
proguard-rules.pro
app/proguard-rules.pro
+10
-7
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
config.gradle
config/config.gradle
+13
-3
No files found.
CommonLib/Common/src/main/java/com/yidian/common/AppConfig.kt
View file @
ff289290
...
...
@@ -9,7 +9,7 @@ class AppConfig {
const
val
appid
=
"merchant-b"
const
val
cv
=
BuildConfig
.
VERSION_NAME
const
val
cv
=
"1.0.0"
const
val
version
=
"000100"
const
val
distribution
=
"official"
const
val
platform
=
"1"
...
...
@@ -23,15 +23,15 @@ class AppConfig {
const
val
SinaAppKey
=
"4157874278"
const
val
SinaAppSecret
=
"85c422bc0a1e0553e6a6a075701422a7"
const
val
SinaCallBackUrl
=
"https://api.weibo.com/oauth2/default.html"
const
val
FileProvider
=
"com.
yidian.subway
.provider"
const
val
FileProvider
=
"com.
shenghuoquan.business
.provider"
const
val
privacyPolicyStatement
=
"http://www.yidianzixun.com/landing_privacy?yidian_fs=2"
const
val
userProtocol
=
"http://www.yidianzixun.com/landing_agreement?yidian_fs=2"
const
val
UMAppKey
=
"60
acaec453b67264990ecdc2
"
//umeng统计key注释
const
val
UMAppKey
=
"60
c8479fe044530ff0a49936
"
//umeng统计key注释
const
val
UMChannel
=
"ANDROID_CHANNEL"
const
val
UMType
=
"metro"
const
val
UMSecret
=
"
8bb06c17a90d727c26bdd95b0e27a436
"
const
val
UMSecret
=
"
e78446e86d153e2891ae7523e1532f13
"
const
val
PUSH_XIAOMI_SUPPORT_MASK
=
0
x40000000
const
val
PUSH_UMENG_SUPPORT_MASK
=
0
x20000000
const
val
PUSH_GETUI_SUPPORT_MASK
=
0
x10000000
...
...
CommonLib/Common/src/main/java/com/yidian/common/utils/UMConfigUtils.kt
View file @
ff289290
...
...
@@ -5,6 +5,7 @@ import android.os.Bundle
import
android.util.Log
import
android.widget.Toast
import
com.orhanobut.hawk.Hawk
import
com.umeng.analytics.MobclickAgent
import
com.umeng.commonsdk.UMConfigure
import
com.umeng.message.IUmengRegisterCallback
import
com.umeng.message.PushAgent
...
...
@@ -22,101 +23,105 @@ import com.yidian.xpage.XPageManager
* 友盟错误统计、push辅助类
* */
class
UMConfigUtils
{
companion
object
{
fun
init
(
context
:
Context
)
{
// when (BuildConfig.DEBUG) {
// false -> {
//release环境上报错误信息,参数有:上下文、APPkey、渠道号、设备类型、推送密钥
UMConfigure
.
init
(
context
,
AppConfig
.
UMAppKey
,
AppConfig
.
UMChannel
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
AppConfig
.
UMSecret
)
PlatformConfig
.
setWeixin
(
AppConfig
.
WeChatAppKey
,
AppConfig
.
WeChatAppSecret
)
PlatformConfig
.
setWXFileProvider
(
AppConfig
.
FileProvider
)
PlatformConfig
.
setQQZone
(
AppConfig
.
QQAppKey
,
AppConfig
.
QQAppSecret
)
PlatformConfig
.
setQQFileProvider
(
AppConfig
.
FileProvider
)
PlatformConfig
.
setSinaWeibo
(
AppConfig
.
SinaAppKey
,
AppConfig
.
SinaAppSecret
,
AppConfig
.
SinaCallBackUrl
)
val
mPushAgent
=
PushAgent
.
getInstance
(
context
)
mPushAgent
.
register
(
object
:
IUmengRegisterCallback
{
override
fun
onSuccess
(
deviceToken
:
String
)
{
//注册成功会返回deviceToken deviceToken是推送消息的唯一标志
Log
.
i
(
"umpush"
,
"注册成功:deviceToken:--------> $deviceToken"
)
Hawk
.
put
(
HawkConfig
.
UmToken
,
deviceToken
)
addAlias
()
}
private
fun
addAlias
()
{
val
token
=
ToolsUtil
.
getYDEncryptionToken
()
mPushAgent
.
addAlias
(
token
,
AppConfig
.
UMType
)
{
isSuccess
,
message
->
Log
.
d
(
"song_test"
,
"addAlias 绑定成功与否 = $isSuccess message = $message"
)
}
}
override
fun
onFailure
(
s
:
String
,
s1
:
String
)
{
Log
.
e
(
"umpush"
,
"注册失败:--------> s:$s,s1:$s1"
)
}
})
val
messageHandler
=
object
:
UmengMessageHandler
()
{
override
fun
dealWithCustomMessage
(
p0
:
Context
?,
p1
:
UMessage
?)
{
super
.
dealWithCustomMessage
(
p0
,
p1
)
Log
.
e
(
"umpush"
,
"dealWithCustomMessage接收自定义消息:--------> ${p1!!.custom}"
)
}
}
val
notificationClickHandler
:
UmengNotificationClickHandler
=
object
:
UmengNotificationClickHandler
()
{
override
fun
dealWithCustomAction
(
context
:
Context
,
msg
:
UMessage
)
{
super
.
dealWithCustomAction
(
context
,
msg
)
Toast
.
makeText
(
context
,
msg
.
custom
,
Toast
.
LENGTH_LONG
).
show
()
Log
.
e
(
"umpush"
,
"dealWithCustomAction接收消息:--------> ${msg.custom}"
)
}
override
fun
launchApp
(
p0
:
Context
?,
p1
:
UMessage
?)
{
super
.
launchApp
(
p0
,
p1
)
goToJump
(
p1
)
}
override
fun
openUrl
(
p0
:
Context
?,
p1
:
UMessage
?)
{
super
.
openUrl
(
p0
,
p1
)
Log
.
e
(
"umpush"
,
"openUrl接收自定义消息:--------> ${p1!!.custom}"
)
}
override
fun
openActivity
(
p0
:
Context
?,
p1
:
UMessage
?)
{
super
.
openActivity
(
p0
,
p1
)
Log
.
e
(
"umpush"
,
"openActivity接收自定义消息:--------> ${p1!!.custom}"
)
}
companion
object
{
fun
init
(
context
:
Context
)
{
//release环境上报错误信息,参数有:上下文、APPkey、渠道号、设备类型、推送密钥
UMConfigure
.
init
(
context
,
AppConfig
.
UMAppKey
,
AppConfig
.
UMChannel
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
AppConfig
.
UMSecret
)
//
// // 推送设置
// PlatformConfig.setWeixin(AppConfig.WeChatAppKey, AppConfig.WeChatAppSecret)
// PlatformConfig.setWXFileProvider(AppConfig.FileProvider)
// PlatformConfig.setQQZone(AppConfig.QQAppKey, AppConfig.QQAppSecret)
// PlatformConfig.setQQFileProvider(AppConfig.FileProvider)
// PlatformConfig.setSinaWeibo(AppConfig.SinaAppKey, AppConfig.SinaAppSecret, AppConfig.SinaCallBackUrl)
// val mPushAgent = PushAgent.getInstance(context)
// mPushAgent.register(object : IUmengRegisterCallback {
// override fun onSuccess(deviceToken: String) {
// //注册成功会返回deviceToken deviceToken是推送消息的唯一标志
// Log.i("umpush", "注册成功:deviceToken:--------> $deviceToken")
// Hawk.put(HawkConfig.UmToken, deviceToken)
// addAlias()
// }
//
// private fun addAlias() {
// val token = ToolsUtil.getYDEncryptionToken()
// mPushAgent.addAlias(token, AppConfig.UMType) { isSuccess, message ->
// Log.d("song_test", "addAlias 绑定成功与否 = $isSuccess message = $message")
// }
// }
//
// override fun onFailure(s: String, s1: String) {
// Log.e("umpush", "注册失败:--------> s:$s,s1:$s1")
// }
// })
//
// // 接收自定义消息
// val messageHandler = object : UmengMessageHandler() {
// override fun dealWithCustomMessage(p0: Context?, p1: UMessage?) {
// super.dealWithCustomMessage(p0, p1)
// Log.e("umpush", "dealWithCustomMessage接收自定义消息:--------> ${p1!!.custom}")
// }
// }
//
// val notificationClickHandler: UmengNotificationClickHandler = object : UmengNotificationClickHandler() {
// override fun dealWithCustomAction(context: Context, msg: UMessage) {
// super.dealWithCustomAction(context, msg)
// Toast.makeText(context, msg.custom, Toast.LENGTH_LONG).show()
// Log.e("umpush", "dealWithCustomAction接收消息:--------> ${msg.custom}")
// }
//
// override fun launchApp(p0: Context?, p1: UMessage?) {
// super.launchApp(p0, p1)
// goToJump(p1)
// }
//
// override fun openUrl(p0: Context?, p1: UMessage?) {
// super.openUrl(p0, p1)
// Log.e("umpush", "openUrl接收自定义消息:--------> ${p1!!.custom}")
// }
//
// override fun openActivity(p0: Context?, p1: UMessage?) {
// super.openActivity(p0, p1)
// Log.e("umpush", "openActivity接收自定义消息:--------> ${p1!!.custom}")
// }
//
//
// }
// mPushAgent.notificationClickHandler = notificationClickHandler
// mPushAgent.messageHandler = messageHandler
//选择AUTO页面采集模式,统计SDK基础指标无需手动埋点可自动采集。建议在宿主App的Application.onCreate函数中调用此函数。
MobclickAgent
.
setPageCollectionMode
(
MobclickAgent
.
PageMode
.
AUTO
);
}
}
mPushAgent
.
notificationClickHandler
=
notificationClickHandler
mPushAgent
.
messageHandler
=
messageHandler
private
fun
goToJump
(
p1
:
UMessage
?)
{
//点击跳转参数
val
paramsMap
=
HashMap
<
String
,
Any
?>()
//接收到的参数
val
extras
:
Map
<
String
,
String
>?
=
p1
?.
extra
val
b
=
Bundle
()
if
(
extras
!=
null
)
{
for
(
key
in
extras
.
keys
)
{
b
.
putString
(
key
,
extras
[
key
])
}
}
private
fun
goToJump
(
p1
:
UMessage
?)
{
//点击跳转参数
val
paramsMap
=
HashMap
<
String
,
Any
?>()
//接收到的参数
val
extras
:
Map
<
String
,
String
>?
=
p1
?.
extra
val
b
=
Bundle
()
if
(
extras
!=
null
)
{
for
(
key
in
extras
.
keys
)
{
b
.
putString
(
key
,
extras
[
key
])
}
}
//配置数据
if
(
b
.
get
(
"rstype"
)
!=
null
&&
b
.
get
(
"docid"
)
!=
null
)
{
paramsMap
[
"jumpFrom"
]
=
"PushJump"
paramsMap
[
"doc_id"
]
=
b
.
get
(
"docid"
)
when
(
b
.
get
(
"rstype"
))
{
"normal"
->
paramsMap
[
"content_type"
]
=
"text_detail"
"video"
->
paramsMap
[
"content_type"
]
=
"video_detail"
}
XPageManager
.
push
(
XRouterPathConstants
.
NEWS_MAIN
,
paramsMap
)
}
//配置数据
if
(
b
.
get
(
"rstype"
)
!=
null
&&
b
.
get
(
"docid"
)
!=
null
)
{
paramsMap
[
"jumpFrom"
]
=
"PushJump"
paramsMap
[
"doc_id"
]
=
b
.
get
(
"docid"
)
when
(
b
.
get
(
"rstype"
))
{
"normal"
->
paramsMap
[
"content_type"
]
=
"text_detail"
"video"
->
paramsMap
[
"content_type"
]
=
"video_detail"
}
XPageManager
.
push
(
XRouterPathConstants
.
NEWS_MAIN
,
paramsMap
)
}
}
// true -> {
// //debug环境打开日志输出,默认关闭
// UMConfigure.setLogEnabled(true)
// }
// }
// }
}
}
}
Components/newscontent/src/main/res/drawable-xxhdpi/icon_black_add.webp
0 → 100644
View file @
ff289290
File added
Components/newscontent/src/main/res/drawable/svg_baseline_add_24.xml
deleted
100644 → 0
View file @
9554bd68
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
android:tint=
"?attr/colorControlNormal"
>
<path
android:fillColor=
"@android:color/black"
android:pathData=
"M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
/>
</vector>
Components/newscontent/src/main/res/layout/activity_my_staff.xml
View file @
ff289290
...
...
@@ -110,7 +110,7 @@
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_marginEnd=
"30dp"
android:drawableStart=
"@drawable/
svg_baseline_add_24
"
android:drawableStart=
"@drawable/
icon_black_add
"
android:text=
"添加"
android:textColor=
"@color/black_333333"
android:textSize=
"16sp"
/>
...
...
app/proguard-rules.pro
View file @
ff289290
...
...
@@ -91,16 +91,19 @@ public static final int *;
@android.webkit.JavascriptInterface <methods>;
}
-keep class com.umeng.
*
* {*;}
# 友盟混淆统计
-keep class com.umeng.
*
* { *; }
-keep class com.uc.
*
* {
*;
}
-keep class com.uc.
*
* {
*;
}
-keepclassmembers class * {
public <init> (org.json.JSONObject);
-keep class com.efs.
*
* { *; }
-keepclassmembers class*{
public<init>(org.json.JSONObject);
}
-keepclassmembers enum
*
{
public static
*
*[] values();
public static
*
* valueOf(java.lang.String);
-keepclassmembers enum
*
{
publicstatic
*
*[] values();
publicstatic
*
* valueOf(java.lang.String);
}
#umeng
...
...
app/src/main/AndroidManifest.xml
View file @
ff289290
...
...
@@ -229,7 +229,7 @@
<provider
android:name=
"com.umeng.message.provider.MessageProvider"
android:authorities=
"com.
yidian.subway
.umeng.message"
android:authorities=
"com.
shenghuoquan.business
.umeng.message"
android:exported=
"false"
>
<grant-uri-permission
android:pathPattern=
".*"
/>
</provider>
...
...
config/config.gradle
View file @
ff289290
...
...
@@ -27,25 +27,35 @@ ext.dependencies = [
'com.yidian.pmcomponents:appupdate:0.0.7'
,
'com.yidian.xpage:xpagenative:0.0.1'
,
// 友盟基础组件(必选)
'com.umeng.umsdk:common:9.3.8'
,
'com.umeng.umsdk:asms:1.2.2'
,
'com.umeng.umsdk:crash:0.0.4'
,
// 友盟apm
'com.umeng.umsdk:apm:1.2.0'
,
// 友盟分享SDK核心库(使用U-Share必选)
'com.umeng.umsdk:share-core:7.1.4'
,
// 友盟分享面板核心库(使用U-Share必选)
'com.umeng.umsdk:share-board:7.1.4'
,
// 友盟分享模块
'com.umeng.umsdk:share-qq:7.1.4'
,
'com.umeng.umsdk:share-wx:7.1.4'
,
'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5'
,
'com.umeng.umsdk:share-sina:7.1.4'
,
// PushSDK核心库
'com.umeng.umsdk:push:6.3.3'
,
// PushSDK必须依赖utdid库,所以需要加入对应依赖
'com.umeng.umsdk:utdid:1.5.2.1'
,
// httpdns支持库,必须添加
'com.umeng.umsdk:alicloud-httpdns:1.3.2.3'
,
'com.umeng.umsdk:alicloud-utils:2.0.0'
,
'com.umeng.umsdk:alicloud_beacon:1.0.5'
,
// 消息推送核心库,必须添加
'com.umeng.umsdk:agoo-accs:3.4.2.7'
,
// 消息推送网络核心库,必须添加
'com.umeng.umsdk:agoo_networksdk:3.5.8'
,
// 消息推送日志核心库,必须添加
'com.umeng.umsdk:agoo_tlog:3.0.0.17'
,
// 消息推送网络核心库,必须添加
'com.umeng.umsdk:agoo_tnet4android:3.1.14.10'
,
'cn.jiguang.sdk:jverification:2.6.4'
,
...
...
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