Skip to content

Commit

Permalink
Upgrade bytehook version number. Upgrade toolchain version.
Browse files Browse the repository at this point in the history
  • Loading branch information
caikelun committed Sep 27, 2022
1 parent 5c74c1a commit 23bf3c6
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 67 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -55,7 +55,7 @@ android {
}
dependencies {
implementation 'com.bytedance:bytehook:1.0.5'
implementation 'com.bytedance:bytehook:1.0.6'
}
```

Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -55,7 +55,7 @@ android {
}
dependencies {
implementation 'com.bytedance:bytehook:1.0.5'
implementation 'com.bytedance:bytehook:1.0.6'
}
```

Expand Down
30 changes: 9 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion bytehook/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18.1)
cmake_minimum_required(VERSION 3.22.1)
project(bytehook)

enable_language(ASM)
Expand Down
33 changes: 8 additions & 25 deletions bytehook_sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ android {
externalNativeBuild {
cmake {
abiFilters rootProject.ext.abiFilters.split(",")
if (rootProject.ext.dependencyOnLocalLibrary) {
arguments "-DDEPENDENCY_ON_LOCAL_LIBRARY=ON"
}
}
}
}
Expand All @@ -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')
}
}
}
17 changes: 2 additions & 15 deletions bytehook_sample/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 23bf3c6

Please sign in to comment.