Skip to content

Commit 7236934

Browse files
authored
Merge pull request #745 from Tencent/feature/dev
Matrix 2.0.8 for Android
2 parents d1462b8 + 2558f8e commit 7236934

File tree

368 files changed

+28691
-3557
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+28691
-3557
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![Matrix-icon](assets/img/readme/header.png)
22
[![license](http://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat)](https://github.com/Tencent/matrix/blob/master/LICENSE)
33
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/matrix/pulls)
4-
[![WeChat Approved](https://img.shields.io/badge/Wechat%20Approved-2.0.5-red.svg)](https://github.com/Tencent/matrix/wiki)
4+
[![WeChat Approved](https://img.shields.io/badge/Wechat%20Approved-2.0.8-red.svg)](https://github.com/Tencent/matrix/wiki)
55
[![CircleCI](https://circleci.com/gh/Tencent/matrix.svg?style=shield)](https://app.circleci.com/pipelines/github/Tencent/matrix)
66

77
(中文版本请参看[这里](#matrix_cn))
@@ -215,7 +215,7 @@ At this point, Matrix has been integrated into the app and is beginning to colle
215215

216216
1. Configure `MATRIX_VERSION` in gradle.properties.
217217
``` gradle
218-
MATRIX_VERSION=2.0.5
218+
MATRIX_VERSION=2.0.8
219219
```
220220

221221
2. Add `matrix-gradle-plugin` in your build.gradle:
@@ -364,11 +364,11 @@ Then other components in Matrix could use Quikcen Backtrace to unwind stacktrace
364364

365365
#### APK Checker Usage
366366

367-
APK Checker can run independently in Jar ([matrix-apk-canary-2.0.5.jar](https://repo.maven.apache.org/maven2/com/tencent/matrix/matrix-apk-canary/2.0.5/matrix-apk-canary-2.0.5.jar)) mode, usage:
367+
APK Checker can run independently in Jar ([matrix-apk-canary-2.0.8.jar](https://repo.maven.apache.org/maven2/com/tencent/matrix/matrix-apk-canary/2.0.8/matrix-apk-canary-2.0.8.jar)) mode, usage:
368368

369369

370370
```shell
371-
java -jar matrix-apk-canary-2.0.5.jar
371+
java -jar matrix-apk-canary-2.0.8.jar
372372
Usages:
373373
--config CONFIG-FILE-PATH
374374
or
@@ -427,7 +427,7 @@ Matrix is under the BSD license. See the [LICENSE](https://github.com/Tencent/Ma
427427
428428
# <a name="matrix_cn">Matrix</a>
429429
![Matrix-icon](assets/img/readme/header.png)
430-
[![license](http://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat)](https://github.com/Tencent/matrix/blob/master/LICENSE)[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/matrix/pulls) [![WeChat Approved](https://img.shields.io/badge/Wechat%20Approved-2.0.5-red.svg)](https://github.com/Tencent/matrix/wiki)
430+
[![license](http://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat)](https://github.com/Tencent/matrix/blob/master/LICENSE)[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/matrix/pulls) [![WeChat Approved](https://img.shields.io/badge/Wechat%20Approved-2.0.8-red.svg)](https://github.com/Tencent/matrix/wiki)
431431
432432
**Matrix** 是一款微信研发并日常使用的应用性能接入框架,支持iOS, macOS和Android。
433433
Matrix 通过接入各种性能监控方案,对性能监控项的异常数据进行采集和分析,输出相应的问题分析、定位与优化建议,从而帮助开发者开发出更高质量的应用。
@@ -628,7 +628,7 @@ Matrix-android 当前监控范围包括:应用安装包大小,帧率变化
628628

629629
1. 在你项目根目录下的 gradle.properties 中配置要依赖的 Matrix 版本号,如:
630630
``` gradle
631-
MATRIX_VERSION=2.0.5
631+
MATRIX_VERSION=2.0.8
632632
```
633633

634634
2. 在你项目根目录下的 build.gradle 文件添加 Matrix 依赖,如:
@@ -774,10 +774,10 @@ WeChatBacktrace.instance().configure(getApplicationContext()).commit();
774774
775775
#### APK Checker
776776
777-
APK Check 以独立的 jar 包提供 ([matrix-apk-canary-2.0.5.jar](https://repo.maven.apache.org/maven2/com/tencent/matrix/matrix-apk-canary/2.0.5/matrix-apk-canary-2.0.5.jar)),你可以运行:
777+
APK Check 以独立的 jar 包提供 ([matrix-apk-canary-2.0.8.jar](https://repo.maven.apache.org/maven2/com/tencent/matrix/matrix-apk-canary/2.0.8/matrix-apk-canary-2.0.8.jar)),你可以运行:
778778
779779
```cmd
780-
java -jar matrix-apk-canary-2.0.5.jar
780+
java -jar matrix-apk-canary-2.0.8.jar
781781
```
782782
783783
查看 Usages 来使用它。

matrix/matrix-android/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
.idea/
99
**/.*
1010
**/bin/
11-
/gradle/oss-android-template.gradle
11+
/gradle/oss-android-template.gradle
12+
local.gradle

matrix/matrix-android/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88

99
}
1010

11-
gradle.ext.KOTLIN_VERSION = "1.3.72"
11+
gradle.ext.KOTLIN_VERSION = "1.4.32"
1212

1313
dependencies {
1414
// classpath
@@ -52,7 +52,7 @@ ext {
5252
// For android sub-projects
5353
minSdkVersion = 19
5454
targetSdkVersion = 29
55-
compileSdkVersion = 29
55+
compileSdkVersion = 31
5656
buildToolsVersion = '29.0.2'
5757

5858
MIN_SDK_VERSION_FOR_HOOK = 21
@@ -86,6 +86,8 @@ ext {
8686

8787
ABI_FILTERS = ['armeabi-v7a', 'arm64-v8a']
8888
LOGGER_VERSION = 1.1 // fixme logger
89+
90+
LIFECYCLE_VERSION = '2.3.1'
8991
}
9092

9193
// Build sample project

matrix/matrix-android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
1414
# org.gradle.parallel=true
1515
#Tue Jun 20 10:24:33 CST 2017
1616

17-
VERSION_NAME_PREFIX=2.0.5
17+
VERSION_NAME_PREFIX=2.0.8
1818
VERSION_NAME_SUFFIX=
1919
## two options: Internal (for wechat), External (for public repo)
2020
PUBLISH_CHANNEL=Internal
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
cmake_minimum_required(VERSION 3.4.1)
2-
project(android-commons C)
2+
project(android-commons)
3+
4+
option(EnableLOG "Enable Logs" ON)
5+
if(EnableLOG)
6+
add_definitions(-DEnableLOG)
7+
endif()
38

4-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libsemi_dlfcn)
59
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libenhance_dlsym)
10+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libsemi_dlfcn)
611
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libxhook)

matrix/matrix-android/matrix-android-commons/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ android {
1919
externalNativeBuild {
2020
cmake {
2121
targets = ['xhook', 'semi_dlfcn', 'enhance_dlsym']
22+
arguments = ["-DEnableLOG=${gradle.enableLog() ? "ON" : "OFF"}" as String]
2223
}
2324
exportHeaders {
2425
from('src/main/cpp/libxhook') {

matrix/matrix-android/matrix-android-commons/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.tencent.matrix.android.commoms"
2+
package="com.tencent.matrix.android.commons"
33
>
44

55
<application>

matrix/matrix-android/matrix-android-commons/src/main/cpp/libenhance_dlsym/CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ project(libenhance_dlsym CXX)
33

44
set(enhance_dlsym_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
55

6-
set(enhance_dlsym_source
7-
${enhance_dlsym_source_dir}/EnhanceDlsym.cpp)
6+
set(
7+
enhance_dlsym_source
8+
${enhance_dlsym_source_dir}/EnhanceDlsym.cpp
9+
)
810

911
add_library(enhance_dlsym STATIC ${enhance_dlsym_source})
1012

13+
find_library(log-lib log)
14+
1115
target_include_directories(
12-
enhance_dlsym
13-
PUBLIC ${enhance_dlsym_source_dir}
16+
enhance_dlsym
17+
PUBLIC ${enhance_dlsym_source_dir}
1418
)
1519

1620
target_link_libraries(
17-
enhance_dlsym
18-
PUBLIC ${log-lib}
21+
enhance_dlsym
22+
PUBLIC ${log-lib}
1923
)

matrix/matrix-android/matrix-android-commons/src/main/cpp/libsemi_dlfcn/CMakeLists.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@ project(libsemi_dlfcn C)
33

44
set(semi_dlfcn_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
55

6-
set(semi_dlfcn_source
7-
${semi_dlfcn_source_dir}/semi_dlfcn.c
8-
${semi_dlfcn_source_dir}/sd_log.c)
6+
set(
7+
semi_dlfcn_source
8+
${semi_dlfcn_source_dir}/semi_dlfcn.c
9+
${semi_dlfcn_source_dir}/sd_log.c
10+
)
911

1012
add_library(semi_dlfcn STATIC ${semi_dlfcn_source})
1113

14+
find_library(log-lib log)
15+
1216
target_include_directories(
13-
semi_dlfcn
14-
PUBLIC ${semi_dlfcn_source_dir}
17+
semi_dlfcn
18+
PUBLIC ${semi_dlfcn_source_dir}
1519
)
1620

1721
target_link_libraries(
18-
semi_dlfcn
19-
PUBLIC ${log-lib}
22+
semi_dlfcn
23+
PUBLIC ${log-lib}
2024
)

matrix/matrix-android/matrix-android-commons/src/main/cpp/libsemi_dlfcn/sd_log.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
#include "sd_log.h"
66

7+
#ifdef EnableLOG
78
bool g_semi_dlfcn_log_enabled = true;
9+
#else
10+
bool g_semi_dlfcn_log_enabled = false;
11+
#endif
12+
813
int g_semi_dlfcn_log_level = ANDROID_LOG_DEBUG;

0 commit comments

Comments
 (0)