diff --git a/README.md b/README.md index 041ba8a..c2fb147 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ByteHook ![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat) -![](https://img.shields.io/badge/release-1.0.5-red.svg?style=flat) +![](https://img.shields.io/badge/release-1.0.6-red.svg?style=flat) ![](https://img.shields.io/badge/Android-4.1%20--%2013-blue.svg?style=flat) ![](https://img.shields.io/badge/arch-armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat) @@ -55,7 +55,7 @@ android { } dependencies { - implementation 'com.bytedance:bytehook:1.0.5' + implementation 'com.bytedance:bytehook:1.0.6' } ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index a41c6b8..a9aa0d8 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,7 +1,7 @@ # ByteHook ![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat) -![](https://img.shields.io/badge/release-1.0.5-red.svg?style=flat) +![](https://img.shields.io/badge/release-1.0.6-red.svg?style=flat) ![](https://img.shields.io/badge/Android-4.1%20--%2013-blue.svg?style=flat) ![](https://img.shields.io/badge/arch-armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat) @@ -55,7 +55,7 @@ android { } dependencies { - implementation 'com.bytedance:bytehook:1.0.5' + implementation 'com.bytedance:bytehook:1.0.6' } ``` diff --git a/build.gradle b/build.gradle index 6de4524..d92cbd0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,6 @@ -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' - } -} - -allprojects { - repositories { - google() - mavenCentral() - } +plugins { + id 'com.android.application' version '7.2.2' apply false + id 'com.android.library' version '7.2.2' apply false } task clean(type: Delete) { @@ -21,19 +9,19 @@ task clean(type: Delete) { ext { minSdkVersion = 16 - compileSdkVersion = 31 - targetSdkVersion = 31 - buildToolsVersion = "31.0.0" + compileSdkVersion = 33 + targetSdkVersion = 33 + buildToolsVersion = "33.0.0" javaVersion = JavaVersion.VERSION_1_7 - ndkVersion = "23.1.7779620" - cmakeVersion = "3.18.1" + ndkVersion = "23.2.8568313" + cmakeVersion = "3.22.1" abiFilters = "armeabi-v7a,arm64-v8a,x86,x86_64" useASAN = false dependencyOnLocalLibrary = true POM_GROUP_ID = "com.bytedance" POM_ARTIFACT_ID = "bytehook" - POM_VERSION_NAME = "1.0.5" + POM_VERSION_NAME = "1.0.6" POM_NAME = "bytehook" POM_DESCRIPTION = "ByteHook is an Android PLT hook library which supports armeabi-v7a, arm64-v8a, x86 and x86_64." diff --git a/bytehook/src/main/cpp/CMakeLists.txt b/bytehook/src/main/cpp/CMakeLists.txt index 9608bd3..38f81a1 100644 --- a/bytehook/src/main/cpp/CMakeLists.txt +++ b/bytehook/src/main/cpp/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.18.1) +cmake_minimum_required(VERSION 3.22.1) project(bytehook) enable_language(ASM) diff --git a/bytehook_sample/build.gradle b/bytehook_sample/build.gradle index 4b12db8..badec1b 100644 --- a/bytehook_sample/build.gradle +++ b/bytehook_sample/build.gradle @@ -18,9 +18,6 @@ android { externalNativeBuild { cmake { abiFilters rootProject.ext.abiFilters.split(",") - if (rootProject.ext.dependencyOnLocalLibrary) { - arguments "-DDEPENDENCY_ON_LOCAL_LIBRARY=ON" - } } } } @@ -46,39 +43,25 @@ android { jniLibs { pickFirsts += ['**/libbytehook.so'] } - } - if (!rootProject.ext.dependencyOnLocalLibrary) { - buildFeatures { - prefab true - } - } - if (rootProject.ext.useASAN) { - packagingOptions { + if (rootProject.ext.useASAN) { doNotStrip "**/*.so" } } + buildFeatures { + prefab true + } } dependencies { - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.google.android.material:material:1.5.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' if (rootProject.ext.dependencyOnLocalLibrary) { implementation project(':bytehook') } else { - implementation 'com.bytedance:bytehook:1.0.5' + implementation 'com.bytedance:bytehook:1.0.6' } } apply from: rootProject.file('gradle/sanitizer.gradle') - -if (rootProject.ext.dependencyOnLocalLibrary) { - tasks.whenTaskAdded { task -> - if (task.name.startsWith('buildCMakeDebug[')) { - task.dependsOn(':bytehook:mergeDebugNativeLibs') - } else if (task.name.startsWith('buildCMakeRelWithDebInfo[')) { - task.dependsOn(':bytehook:stripReleaseDebugSymbols') - } - } -} diff --git a/bytehook_sample/src/main/cpp/CMakeLists.txt b/bytehook_sample/src/main/cpp/CMakeLists.txt index 443259a..2621d6e 100644 --- a/bytehook_sample/src/main/cpp/CMakeLists.txt +++ b/bytehook_sample/src/main/cpp/CMakeLists.txt @@ -1,20 +1,7 @@ -cmake_minimum_required(VERSION 3.18.1) +cmake_minimum_required(VERSION 3.22.1) project(sample) -if(DEPENDENCY_ON_LOCAL_LIBRARY) - set(BYTEHOOK_BASE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bytehook) - if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") - set(BYTEHOOK_LIB_BASE ${BYTEHOOK_BASE}/build/intermediates/merged_native_libs/debug) - else() - set(BYTEHOOK_LIB_BASE ${BYTEHOOK_BASE}/build/intermediates/stripped_native_libs/release) - endif() - add_library(bytehook::bytehook SHARED IMPORTED) - set_target_properties(bytehook::bytehook PROPERTIES - IMPORTED_LOCATION ${BYTEHOOK_LIB_BASE}/out/lib/${ANDROID_ABI}/libbytehook.so - INTERFACE_INCLUDE_DIRECTORIES ${BYTEHOOK_BASE}/src/main/cpp/include) -else() - find_package(bytehook REQUIRED CONFIG) -endif() +find_package(bytehook REQUIRED CONFIG) # libhacker.so add_library(hacker SHARED hacker.c) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7512298..61a1e7f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip diff --git a/settings.gradle b/settings.gradle index fe4ecca..dd68aac 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} rootProject.name = "bhook" include ':bytehook' include ':bytehook_sample'