-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #648 from Tencent/feature/dev
Matrix v2.0.1
- Loading branch information
Showing
99 changed files
with
6,446 additions
and
1,524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 3 additions & 30 deletions
33
matrix/matrix-android/matrix-android-commons/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,5 @@ | ||
cmake_minimum_required(VERSION 3.4.1) | ||
project(libxhook C) | ||
|
||
set(xhook_source_dir src/main/cpp/libxhook) | ||
|
||
set(xhook_source | ||
${xhook_source_dir}/xh_core.c | ||
${xhook_source_dir}/xh_elf.c | ||
${xhook_source_dir}/xh_jni.c | ||
${xhook_source_dir}/xh_log.c | ||
${xhook_source_dir}/xh_util.c | ||
${xhook_source_dir}/xh_version.c | ||
${xhook_source_dir}/xhook.c | ||
${xhook_source_dir}/xhook_ext.c) | ||
|
||
add_library(xhook STATIC ${xhook_source}) | ||
|
||
find_library( | ||
log-lib | ||
log | ||
) | ||
|
||
target_include_directories( | ||
xhook | ||
PUBLIC ${xhook_source_dir} | ||
) | ||
|
||
target_link_libraries( | ||
xhook | ||
${log-lib} | ||
) | ||
project(android-commons C) | ||
|
||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libsemi_dlfcn) | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/libxhook) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
matrix/matrix-android/matrix-android-commons/src/main/cpp/libsemi_dlfcn/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
cmake_minimum_required(VERSION 3.4.1) | ||
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) | ||
|
||
add_library(semi_dlfcn STATIC ${semi_dlfcn_source}) | ||
|
||
target_include_directories( | ||
semi_dlfcn | ||
PUBLIC ${semi_dlfcn_source_dir} | ||
) | ||
|
||
target_link_libraries( | ||
semi_dlfcn | ||
PUBLIC ${log-lib} | ||
) |
8 changes: 8 additions & 0 deletions
8
matrix/matrix-android/matrix-android-commons/src/main/cpp/libsemi_dlfcn/sd_log.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// Created by YinSheng Tang on 2021/7/21. | ||
// | ||
|
||
#include "sd_log.h" | ||
|
||
bool g_semi_dlfcn_log_enabled = true; | ||
int g_semi_dlfcn_log_level = ANDROID_LOG_DEBUG; |
51 changes: 51 additions & 0 deletions
51
matrix/matrix-android/matrix-android-commons/src/main/cpp/libsemi_dlfcn/sd_log.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// Created by YinSheng Tang on 2021/7/21. | ||
// | ||
|
||
#ifndef MATRIX_ANDROID_SD_LOG_H | ||
#define MATRIX_ANDROID_SD_LOG_H | ||
|
||
|
||
#include <stdbool.h> | ||
#include <android/log.h> | ||
|
||
extern bool g_semi_dlfcn_log_enabled; | ||
extern int g_semi_dlfcn_log_level; | ||
|
||
#define LOGV(tag, fmt, args...) \ | ||
do { \ | ||
if (g_semi_dlfcn_log_enabled && (g_semi_dlfcn_log_level <= ANDROID_LOG_VERBOSE)) { \ | ||
__android_log_print(ANDROID_LOG_VERBOSE, tag, fmt, ##args); \ | ||
} \ | ||
} while (false) | ||
|
||
#define LOGD(tag, fmt, args...) \ | ||
do { \ | ||
if (g_semi_dlfcn_log_enabled && (g_semi_dlfcn_log_level <= ANDROID_LOG_DEBUG)) { \ | ||
__android_log_print(ANDROID_LOG_DEBUG, tag, fmt, ##args); \ | ||
} \ | ||
} while (false) | ||
|
||
#define LOGI(tag, fmt, args...) \ | ||
do { \ | ||
if (g_semi_dlfcn_log_enabled && (g_semi_dlfcn_log_level <= ANDROID_LOG_INFO)) { \ | ||
__android_log_print(ANDROID_LOG_INFO, tag, fmt, ##args); \ | ||
} \ | ||
} while (false) | ||
|
||
#define LOGW(tag, fmt, args...) \ | ||
do { \ | ||
if (g_semi_dlfcn_log_enabled && (g_semi_dlfcn_log_level <= ANDROID_LOG_WARN)) { \ | ||
__android_log_print(ANDROID_LOG_WARN, tag, fmt, ##args); \ | ||
} \ | ||
} while (false) | ||
|
||
#define LOGE(tag, fmt, args...) \ | ||
do { \ | ||
if (g_semi_dlfcn_log_enabled && (g_semi_dlfcn_log_level <= ANDROID_LOG_ERROR)) { \ | ||
__android_log_print(ANDROID_LOG_ERROR, tag, fmt, ##args); \ | ||
} \ | ||
} while (false) | ||
|
||
|
||
#endif //MATRIX_ANDROID_SD_LOG_H |
Oops, something went wrong.