# 获取当前目录路径
LOCAL_PATH := $(call my-dir)

# 预编译 Dobby 库
include $(CLEAR_VARS)
LOCAL_MODULE := dobby
LOCAL_SRC_FILES := Dobby/libdobby.a
include $(PREBUILT_STATIC_LIBRARY)

# 清除变量
include $(CLEAR_VARS)

# 设置模块名称
LOCAL_MODULE := HOOK

# 设置C语言编译器标志
LOCAL_CFLAGS := -w -s -Wno-error=format-security -fvisibility=hidden -fpermissive -fexceptions

# 设置C++语言编译器标志
LOCAL_CPPFLAGS := -w -s -Wno-error=format-security -fvisibility=hidden -std=c++17
LOCAL_CPPFLAGS += -Wno-error=c++11-narrowing -fpermissive -Wall -fexceptions

# 设置链接器标志
LOCAL_LDFLAGS += -Wl,--gc-sections,--strip-all

# 设置链接库
LOCAL_LDLIBS := -lm -ldl -lz -llog -landroid -lEGL -lGLESv1_CM -lGLESv2 -lGLESv3

# 设置C语言头文件目录
LOCAL_C_INCLUDES := $(LOCAL_PATH)/imgui $(LOCAL_PATH)/Dobby

# 设置源文件列表
LOCAL_SRC_FILES := \
    main.cpp \
    imgui/imgui.cpp \
    imgui/imgui_draw.cpp \
    imgui/imgui_tables.cpp \
    imgui/imgui_widgets.cpp \
    imgui/imgui_impl_android.cpp \
    imgui/imgui_impl_opengl3.cpp \
    SDK/PUBGM_Basic.cpp \
    SDK/PUBGM_Basic_functions.cpp \
    SDK/PUBGM_CoreUObject_functions.cpp \
    SDK/PUBGM_Engine_functions.cpp \
    SDK/PUBGM_ShadowTrackerExtra_functions.cpp \
    SDK/PUBGM_UnrealArchExt_functions.cpp \
    SDK/PUBGM_Gameplay_functions.cpp \
    SDK/PUBGM_Client_functions.cpp


# 设置静态库
LOCAL_STATIC_LIBRARIES := android_native_app_glue dobby

# 构建共享库
include $(BUILD_SHARED_LIBRARY)

# 导入模块
$(call import-module,android/native_app_glue)
