Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions native/include/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
22 changes: 19 additions & 3 deletions zygisk/src/main/cpp/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}
}
Expand Down