Skip to content

Commit

Permalink
Merge pull request #745 from Tencent/feature/dev
Browse files Browse the repository at this point in the history
Matrix 2.0.8 for Android
  • Loading branch information
gryamy authored May 7, 2022
2 parents d1462b8 + 2558f8e commit 7236934
Show file tree
Hide file tree
Showing 368 changed files with 28,691 additions and 3,557 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Matrix-icon](assets/img/readme/header.png)
[![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)
[![WeChat Approved](https://img.shields.io/badge/Wechat%20Approved-2.0.8-red.svg)](https://github.com/Tencent/matrix/wiki)
[![CircleCI](https://circleci.com/gh/Tencent/matrix.svg?style=shield)](https://app.circleci.com/pipelines/github/Tencent/matrix)

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

1. Configure `MATRIX_VERSION` in gradle.properties.
``` gradle
MATRIX_VERSION=2.0.5
MATRIX_VERSION=2.0.8
```

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

#### APK Checker Usage

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:
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:


```shell
java -jar matrix-apk-canary-2.0.5.jar
java -jar matrix-apk-canary-2.0.8.jar
Usages:
--config CONFIG-FILE-PATH
or
Expand Down Expand Up @@ -427,7 +427,7 @@ Matrix is under the BSD license. See the [LICENSE](https://github.com/Tencent/Ma
# <a name="matrix_cn">Matrix</a>
![Matrix-icon](assets/img/readme/header.png)
[![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)
[![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)
**Matrix** 是一款微信研发并日常使用的应用性能接入框架,支持iOS, macOS和Android。
Matrix 通过接入各种性能监控方案,对性能监控项的异常数据进行采集和分析,输出相应的问题分析、定位与优化建议,从而帮助开发者开发出更高质量的应用。
Expand Down Expand Up @@ -628,7 +628,7 @@ Matrix-android 当前监控范围包括:应用安装包大小,帧率变化

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

2. 在你项目根目录下的 build.gradle 文件添加 Matrix 依赖,如:
Expand Down Expand Up @@ -774,10 +774,10 @@ WeChatBacktrace.instance().configure(getApplicationContext()).commit();
#### APK Checker
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)),你可以运行:
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)),你可以运行:
```cmd
java -jar matrix-apk-canary-2.0.5.jar
java -jar matrix-apk-canary-2.0.8.jar
```
查看 Usages 来使用它。
Expand Down
3 changes: 2 additions & 1 deletion matrix/matrix-android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
.idea/
**/.*
**/bin/
/gradle/oss-android-template.gradle
/gradle/oss-android-template.gradle
local.gradle
6 changes: 4 additions & 2 deletions matrix/matrix-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}

gradle.ext.KOTLIN_VERSION = "1.3.72"
gradle.ext.KOTLIN_VERSION = "1.4.32"

dependencies {
// classpath
Expand Down Expand Up @@ -52,7 +52,7 @@ ext {
// For android sub-projects
minSdkVersion = 19
targetSdkVersion = 29
compileSdkVersion = 29
compileSdkVersion = 31
buildToolsVersion = '29.0.2'

MIN_SDK_VERSION_FOR_HOOK = 21
Expand Down Expand Up @@ -86,6 +86,8 @@ ext {

ABI_FILTERS = ['armeabi-v7a', 'arm64-v8a']
LOGGER_VERSION = 1.1 // fixme logger

LIFECYCLE_VERSION = '2.3.1'
}

// Build sample project
Expand Down
2 changes: 1 addition & 1 deletion matrix/matrix-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
# org.gradle.parallel=true
#Tue Jun 20 10:24:33 CST 2017

VERSION_NAME_PREFIX=2.0.5
VERSION_NAME_PREFIX=2.0.8
VERSION_NAME_SUFFIX=
## two options: Internal (for wechat), External (for public repo)
PUBLISH_CHANNEL=Internal
Expand Down
9 changes: 7 additions & 2 deletions matrix/matrix-android/matrix-android-commons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.4.1)
project(android-commons C)
project(android-commons)

option(EnableLOG "Enable Logs" ON)
if(EnableLOG)
add_definitions(-DEnableLOG)
endif()

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libsemi_dlfcn)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libenhance_dlsym)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libsemi_dlfcn)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libxhook)
1 change: 1 addition & 0 deletions matrix/matrix-android/matrix-android-commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android {
externalNativeBuild {
cmake {
targets = ['xhook', 'semi_dlfcn', 'enhance_dlsym']
arguments = ["-DEnableLOG=${gradle.enableLog() ? "ON" : "OFF"}" as String]
}
exportHeaders {
from('src/main/cpp/libxhook') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tencent.matrix.android.commoms"
package="com.tencent.matrix.android.commons"
>

<application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ project(libenhance_dlsym CXX)

set(enhance_dlsym_source_dir ${CMAKE_CURRENT_SOURCE_DIR})

set(enhance_dlsym_source
${enhance_dlsym_source_dir}/EnhanceDlsym.cpp)
set(
enhance_dlsym_source
${enhance_dlsym_source_dir}/EnhanceDlsym.cpp
)

add_library(enhance_dlsym STATIC ${enhance_dlsym_source})

find_library(log-lib log)

target_include_directories(
enhance_dlsym
PUBLIC ${enhance_dlsym_source_dir}
enhance_dlsym
PUBLIC ${enhance_dlsym_source_dir}
)

target_link_libraries(
enhance_dlsym
PUBLIC ${log-lib}
enhance_dlsym
PUBLIC ${log-lib}
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ project(libsemi_dlfcn C)

set(semi_dlfcn_source_dir ${CMAKE_CURRENT_SOURCE_DIR})

set(semi_dlfcn_source
${semi_dlfcn_source_dir}/semi_dlfcn.c
${semi_dlfcn_source_dir}/sd_log.c)
set(
semi_dlfcn_source
${semi_dlfcn_source_dir}/semi_dlfcn.c
${semi_dlfcn_source_dir}/sd_log.c
)

add_library(semi_dlfcn STATIC ${semi_dlfcn_source})

find_library(log-lib log)

target_include_directories(
semi_dlfcn
PUBLIC ${semi_dlfcn_source_dir}
semi_dlfcn
PUBLIC ${semi_dlfcn_source_dir}
)

target_link_libraries(
semi_dlfcn
PUBLIC ${log-lib}
semi_dlfcn
PUBLIC ${log-lib}
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@

#include "sd_log.h"

#ifdef EnableLOG
bool g_semi_dlfcn_log_enabled = true;
#else
bool g_semi_dlfcn_log_enabled = false;
#endif

int g_semi_dlfcn_log_level = ANDROID_LOG_DEBUG;
Loading

0 comments on commit 7236934

Please sign in to comment.