diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp index a50c01178083c..9210498f7d922 100644 --- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp +++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp @@ -174,6 +174,7 @@ sumFiles(JNIEnv*, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const char static install_status_t copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const char* fileName) { + static const size_t kPageSize = getpagesize(); void** args = reinterpret_cast(arg); jstring* javaNativeLibPath = (jstring*) args[0]; jboolean extractNativeLibs = *(jboolean*) args[1]; @@ -200,9 +201,9 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr return INSTALL_FAILED_INVALID_APK; } - if (offset % PAGE_SIZE != 0) { - ALOGE("Library '%s' is not page-aligned - will not be able to open it directly from" - " apk.\n", fileName); + if (offset % kPageSize != 0) { + ALOGE("Library '%s' is not PAGE(%zu)-aligned - will not be able to open it directly " + "from apk.\n", fileName, kPageSize); return INSTALL_FAILED_INVALID_APK; }