Skip to content

Commit

Permalink
Move to standalone hashlib
Browse files Browse the repository at this point in the history
  • Loading branch information
Royna2544 committed Dec 13, 2024
1 parent 536e9c0 commit fd81e36
Show file tree
Hide file tree
Showing 61 changed files with 251 additions and 16,506 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
[submodule "src/third-party/cpp-httplib"]
path = src/third-party/cpp-httplib
url = https://github.com/yhirose/cpp-httplib
[submodule "clientapp/android/app/src/main/cpp/external/openssl"]
path = clientapp/android/app/src/main/cpp/external/openssl
url = https://github.com/openssl/openssl
[submodule "clientapp/android/app/src/main/cpp/abseil-cpp"]
path = src/third-party/abseil-cpp
url = https://github.com/abseil/abseil-cpp/
Expand All @@ -22,3 +19,6 @@
[submodule "src/third-party/googletest"]
path = src/third-party/googletest
url = https://github.com/google/googletest/
[submodule "src/hash/third-party/sha-2"]
path = src/hash/sha-2
url = https://github.com/amosnier/sha-2/
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@ endif()
#####################################################################

############################# Check lib #############################
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Protobuf)
find_package(fmt REQUIRED)
find_package(jsoncpp REQUIRED) # Required by tgbot-cpp anyways...
Expand Down Expand Up @@ -426,6 +424,7 @@ endif()
add_subdirectory(src/api)
add_subdirectory(src/database)
add_subdirectory(src/random)
add_subdirectory(src/hash)
add_subdirectory(src/imagep)
add_subdirectory(src/stringres)
add_subdirectory(src/logging)
Expand Down
1 change: 1 addition & 0 deletions clientapp/android/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions clientapp/android/.idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions clientapp/android/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions clientapp/android/.idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions clientapp/android/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions clientapp/android/.idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions clientapp/android/.idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions clientapp/android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions clientapp/android/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions clientapp/android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ project("tgbotclient")
# System.loadLibrary() and pass the name of the library defined here;
# for GameActivity/NativeActivity derived applications, the same library name must be
# used in the AndroidManifest.xml file.
set(SOURCE_DIR ../../../../../../src)
add_library(${CMAKE_PROJECT_NAME} SHARED
# List C/C++ source files with relative paths to this CMakeLists.txt.
tgbotclient.cpp
../../../../../../src/socket/bot/TgBotSocketFileHelperNew.cpp)
${SOURCE_DIR}/socket/bot/TgBotSocketFileHelperNew.cpp
${SOURCE_DIR}/hash/crc32.cpp ${SOURCE_DIR}/hash/sha256.cpp ${SOURCE_DIR}/hash/sha-2/sha-256.c)

set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(../../../../../../src/third-party/abseil-cpp abseil-cpp)

add_library(crypto_openssl SHARED IMPORTED)
set_target_properties(crypto_openssl PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}/libcrypto.so)
add_subdirectory(${SOURCE_DIR}/third-party/abseil-cpp abseil-cpp)

# Specifies libraries CMake should link to your target library. You
# can link libraries from various origins, such as libraries defined in this
Expand All @@ -43,11 +42,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
# List libraries link to the target library
android
log
z
crypto_openssl
absl::log_initialize absl::log absl::check)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE include)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE external/openssl/include)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ../../../../../../src/socket/include ../../../../../../src/include)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${SOURCE_DIR}/socket/include ${SOURCE_DIR}/include)
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=)
1 change: 0 additions & 1 deletion clientapp/android/app/src/main/cpp/external/openssl
Submodule openssl deleted from db2ac4
Loading

0 comments on commit fd81e36

Please sign in to comment.