Pangu-Immortal / KeepAlivePerfect

💰Android终极保活:Android4.1 到 Android15.0 完美的保活方案
Other
757 stars 294 forks source link

Compile Fail with NDK 24.0.8215888 #8

Open lt3stus3el opened 2 years ago

lt3stus3el commented 2 years ago

Cloned and compiled with NDK 24.0.8215888 in linux. error log:

KeepAlivePerfect/library/src/main/cpp/binder_libs/armeabi-v7a/libbinder.so: invalid sh_info in symbol table
lt3stus3el commented 2 years ago

same result in windows! missing some libraries?

lt3stus3el commented 2 years ago

Compiled with following CMakeLists.txt:

  1. Changed SHARED to STATIC
  2. add set_target_properties to so files.
# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.4.1)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)

add_compile_options(-fno-rtti -O3 -v)

message(@@@${CMAKE_CURRENT_SOURCE_DIR})

link_directories(binder_libs/${CMAKE_ANDROID_ARCH_ABI})

aux_source_directory(. SRC_LIST) # 搜索当前目录下的所有.cpp文件

add_library( # Sets the name of the library.
        keep_alive

        # Sets the library as a shared library.
        STATIC

        # 提供源文件的相对路径。
        ${SRC_LIST} main.cpp art.cpp)

set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libutils.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libc.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libcutils.so)
set_target_properties(keep_alive PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/binder_libs/${ANDROID_ABI}/libutils.so)

find_library(log-lib log)

target_link_libraries(
        keep_alive
        ${log-lib}
)
MIkeeJY commented 5 months ago

@lt3stus3el still missing java.lang.UnsatisfiedLinkError: dlopen failed: library "libkeep_alive.so" not found