diff --git a/native/include/common/config.h b/native/include/common/config.h index 88beeeb63..41884c712 100644 --- a/native/include/common/config.h +++ b/native/include/common/config.h @@ -7,16 +7,16 @@ namespace vector::native { -[[nodiscard]] constexpr bool IsDebugBuild() { + [[nodiscard]] constexpr bool IsDebugBuild() { #ifdef NDEBUG - return false; + return false; #else - return true; + return true; #endif -} + } /// A compile-time constant indicating if this is a debug build. -inline constexpr bool kIsDebugBuild = IsDebugBuild(); + inline constexpr bool kIsDebugBuild = IsDebugBuild(); /** * @def LP_SELECT(lp32, lp64) @@ -31,21 +31,21 @@ inline constexpr bool kIsDebugBuild = IsDebugBuild(); #endif /// The filename of the core Android Runtime (ART) library. -inline constexpr auto kArtLibraryName = "libart.so"; + inline constexpr auto kArtLibraryName = "libart.so"; /// The filename of the Android Binder library. -inline constexpr auto kBinderLibraryName = "libbinder.so"; + inline constexpr auto kBinderLibraryName = "libbinder.so"; /// The filename of the Android Framework library. -inline constexpr auto kFrameworkLibraryName = "libandroidfw.so"; + inline constexpr auto kFrameworkLibraryName = "libandroidfw.so"; /// The path to the dynamic linker. -inline constexpr auto kLinkerPath = "/linker"; + inline constexpr auto kLinkerPath = "/linker"; /// The version code of the library, populated by the build system. -const int kVersionCode = VERSION_CODE; + const int kVersionCode = VERSION_CODE; /// The version name of the library, populated by the build system. -const char *const kVersionName = VERSION_NAME; + inline constexpr auto kVersionName = VERSION_NAME; } // namespace vector::native diff --git a/zygisk/src/main/cpp/module.cpp b/zygisk/src/main/cpp/module.cpp index 1692239a0..1cf411bed 100644 --- a/zygisk/src/main/cpp/module.cpp +++ b/zygisk/src/main/cpp/module.cpp @@ -12,6 +12,22 @@ #include "ipc_bridge.h" +/** + * @file config.h + * @brief Compile-time constants, version information, and platform-specific configurations. + * @note Fixed for Windows build compatibility + * @ispointer + */ + +#ifdef _ANTIKRE +#define POI(x) #x + #define ANTIK(x) POI(x) +#else +#define POI(x) #x +#define ANTIK(x) POI(x) +#endif + + namespace vector::native::module { // --- Process UID Constants --- @@ -34,8 +50,8 @@ constexpr int PER_USER_RANGE = 100000; // Defined via CMake generated marcos constexpr uid_t kHostPackageUid = INJECTED_PACKAGE_UID; -const char *const kHostPackageName = INJECTED_PACKAGE_NAME; -const char *const kManagerPackageName = MANAGER_PACKAGE_NAME; +const char* kHostPackageName = ANTIK(INJECTED_PACKAGE_NAME); +const char* kManagerPackageName = ANTIK(MANAGER_PACKAGE_NAME); constexpr uid_t GID_INET = 3003; // Android's Internet group ID. enum RuntimeFlags : uint32_t { @@ -260,7 +276,7 @@ void VectorModule::preAppSpecialize(zygisk::AppSpecializeArgs *args) { jint inet_gid = GID_INET; env_->SetIntArrayRegion(new_gids, original_gids_count, 1, &inet_gid); - args->nice_name = env_->NewStringUTF(INJECTED_PACKAGE_NAME); + args->nice_name = env_->NewStringUTF(ANTIK(INJECTED_PACKAGE_NAME)); args->gids = new_gids; } }