Skip to content

Commit

Permalink
Merge pull request #74 from hangedfish/main
Browse files Browse the repository at this point in the history
cmake fetch dependencies
  • Loading branch information
luoyesiqiu authored Dec 10, 2024
2 parents b0aeb2e + e6c5057 commit 2a4364d
Show file tree
Hide file tree
Showing 56 changed files with 60 additions and 13,161 deletions.
2 changes: 1 addition & 1 deletion shell/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.18.1"
version "3.31.1"
}
}
compileOptions {
Expand Down
35 changes: 24 additions & 11 deletions shell/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
cmake_minimum_required(VERSION 3.18.1)
cmake_minimum_required(VERSION 3.31.1)

project("dpt")

include(FetchContent)

FetchContent_Declare(
minizip_ng
GIT_REPOSITORY https://github.com/zlib-ng/minizip-ng.git
GIT_TAG 4.0.7
)
set(MZ_LZMA OFF CACHE BOOL "" FORCE)
set(MZ_ZSTD OFF CACHE BOOL "" FORCE)
set(MZ_OPENSSL OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(minizip_ng)

set(patch_book git apply ${CMAKE_CURRENT_SOURCE_DIR}/patches/bhook_add_static_lib.patch)
FetchContent_Declare(
bhook
GIT_REPOSITORY https://github.com/bytedance/bhook.git
GIT_TAG v1.0.5
PATCH_COMMAND ${patch_book}
SOURCE_SUBDIR bytehook/src/main/cpp
)
FetchContent_MakeAvailable(bhook)


set(DPT_NATIVE_SOURCE
dpt.cpp
dpt_hook.cpp
Expand Down Expand Up @@ -40,15 +63,8 @@ else()
message("closed log & stripped so symbols")
endif()


option(MZ_LZMA "Enables LZMA & XZ compression" OFF)
option(MZ_ZSTD "Enables ZSTD compression" OFF)
option(MZ_OPENSSL "Enables OpenSSL for encryption" OFF)

include_directories(./ )
include_directories(./common)
include_directories(./bhook/include)
include_directories(./minizip-ng)

add_library(dpt
SHARED
Expand All @@ -59,9 +75,6 @@ include_directories(
dobby
)

add_subdirectory(bhook)
add_subdirectory(minizip-ng)

add_library(local_dobby STATIC IMPORTED)
set_target_properties(local_dobby PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${ANDROID_ABI}/libdobby.a)

Expand Down
18 changes: 0 additions & 18 deletions shell/src/main/cpp/bhook/CMakeLists.txt

This file was deleted.

83 changes: 0 additions & 83 deletions shell/src/main/cpp/bhook/bh_cfi.c

This file was deleted.

26 changes: 0 additions & 26 deletions shell/src/main/cpp/bhook/bh_cfi.h

This file was deleted.

51 changes: 0 additions & 51 deletions shell/src/main/cpp/bhook/bh_const.h

This file was deleted.

Loading

0 comments on commit 2a4364d

Please sign in to comment.