diff --git a/README.md b/README.md index f4ab2fa..83f5412 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.1.0-red.svg?style=flat) +![](https://img.shields.io/badge/release-1.1.1-red.svg?style=flat) ![](https://img.shields.io/badge/Android-4.1%20--%2015-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) @@ -47,7 +47,7 @@ android { } dependencies { - implementation 'com.bytedance:bytehook:1.1.0' + implementation 'com.bytedance:bytehook:1.1.1' } ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index 6403ca5..473cc2d 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.1.0-red.svg?style=flat) +![](https://img.shields.io/badge/release-1.1.1-red.svg?style=flat) ![](https://img.shields.io/badge/Android-4.1%20--%2015-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) @@ -47,7 +47,7 @@ android { } dependencies { - implementation 'com.bytedance:bytehook:1.1.0' + implementation 'com.bytedance:bytehook:1.1.1' } ``` diff --git a/build.gradle b/build.gradle index 4ba1f19..7ce6032 100644 --- a/build.gradle +++ b/build.gradle @@ -16,14 +16,13 @@ ext { ndkVersion = "23.2.8568313" cmakeVersion = "3.30.5" shadowhookVersion = "1.1.1" -// abiFilters = "armeabi-v7a,arm64-v8a,x86,x86_64" 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.1.0" + POM_VERSION_NAME = "1.1.1" 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/include/bytehook.h b/bytehook/src/main/cpp/include/bytehook.h index 5763b8b..b918e1b 100644 --- a/bytehook/src/main/cpp/include/bytehook.h +++ b/bytehook/src/main/cpp/include/bytehook.h @@ -48,7 +48,7 @@ #include #include -#define BYTEHOOK_VERSION "1.1.0" +#define BYTEHOOK_VERSION "1.1.1" #define BYTEHOOK_STATUS_CODE_OK 0 #define BYTEHOOK_STATUS_CODE_UNINIT 1 diff --git a/bytehook_sample/build.gradle b/bytehook_sample/build.gradle index caf662a..96517e1 100644 --- a/bytehook_sample/build.gradle +++ b/bytehook_sample/build.gradle @@ -64,7 +64,7 @@ dependencies { if (rootProject.ext.dependencyOnLocalLibrary) { implementation project(':bytehook') } else { - implementation 'com.bytedance:bytehook:1.1.0' + implementation 'com.bytedance:bytehook:' + rootProject.ext.POM_VERSION_NAME } implementation project(':bytehook_systest') } diff --git a/bytehook_systest/build.gradle b/bytehook_systest/build.gradle index 4c07177..e3f41ff 100644 --- a/bytehook_systest/build.gradle +++ b/bytehook_systest/build.gradle @@ -58,7 +58,7 @@ dependencies { if (rootProject.ext.dependencyOnLocalLibrary) { implementation project(':bytehook') } else { - implementation 'com.bytedance:bytehook:1.1.0' + implementation 'com.bytedance:bytehook:' + rootProject.ext.POM_VERSION_NAME } } apply from: rootProject.file('gradle/prefab_bypass.gradle') \ No newline at end of file diff --git a/gradle/prefab_bypass.gradle b/gradle/prefab_bypass.gradle index 77f646a..a121f63 100644 --- a/gradle/prefab_bypass.gradle +++ b/gradle/prefab_bypass.gradle @@ -23,52 +23,43 @@ project.afterEvaluate { def archList = ["x86", "x86_64"] - for(arch in archList) { - def abiName = "$arch" - def dirName = "android.$arch" - tasks."configureCMakeDebug[$arch]".doFirst { - def prefabPackageFiles = abi.variant.prefabPackages.files - for (File file : prefabPackageFiles) { - def libsDir = findFirstLibsSubdirectory(file) - def libsArchDir = new File(libsDir, dirName) - if (!libsArchDir.exists()) { - libsArchDir.mkdirs() - def abiJsonFile = new File(libsArchDir, "abi.json") - def abiContent = "{\n" + - " \"abi\": \"$abiName\",\n" + - " \"api\": 16,\n" + - " \"ndk\": 23,\n" + - " \"stl\": \"none\",\n" + - " \"static\": false\n" + - "}" - abiJsonFile.write(abiContent) - def dummySoFile = new File(libsArchDir, "libshadowhook.so") - dummySoFile.createNewFile() - } - } - } - tasks."configureCMakeRelWithDebInfo[$arch]".doFirst { - def prefabPackageFiles = abi.variant.prefabPackages.files - for (File file : prefabPackageFiles) { - def libsDir = findFirstLibsSubdirectory(file) - def libsArchDir = new File(libsDir, dirName) - if (!libsArchDir.exists()) { - libsArchDir.mkdirs() - def abiJsonFile = new File(libsArchDir, "abi.json") - def abiContent = "{\n" + - " \"abi\": \"$abiName\",\n" + - " \"api\": 16,\n" + - " \"ndk\": 23,\n" + - " \"stl\": \"none\",\n" + - " \"static\": false\n" + - "}" - abiJsonFile.write(abiContent) - def dummySoFile = new File(libsArchDir, "libshadowhook.so") - dummySoFile.createNewFile() + + // Helper function to configure prefab for a specific task + def configurePrefabForTask = { taskName, arch, dirName, abiName -> + def task = tasks.findByName("${taskName}[$arch]") + if (task != null) { + task.doFirst { + def prefabPackageFiles = abi.variant.prefabPackages.files + for (File file : prefabPackageFiles) { + def libsDir = findFirstLibsSubdirectory(file) + def libsArchDir = new File(libsDir, dirName) + if (!libsArchDir.exists()) { + libsArchDir.mkdirs() + def abiJsonFile = new File(libsArchDir, "abi.json") + def abiContent = """ + { + "abi": "$abiName", + "api": 16, + "ndk": 23, + "stl": "none", + "static": false + }""".stripIndent() + abiJsonFile.write(abiContent) + def dummySoFile = new File(libsArchDir, "libshadowhook.so") + dummySoFile.createNewFile() + } } } } } + + // Configure tasks for each architecture + for(arch in archList) { + def abiName = "$arch" + def dirName = "android.$arch" + configurePrefabForTask("configureCMakeDebug", arch, dirName, abiName) + configurePrefabForTask("configureCMakeRelWithDebInfo", arch, dirName, abiName) + } } def findFirstLibsSubdirectory(File baseDir) { @@ -84,4 +75,4 @@ def findFirstLibsSubdirectory(File baseDir) { } } return result -} \ No newline at end of file +}