From c712da813961886e31950ab9a77a60eed872be17 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 1 Jun 2023 10:36:09 -0700 Subject: [PATCH] Improve readability Bug: 276930343 Change-Id: I9041e9d76bd63a6033393f8dee05010586b406dd --- .../com_android_internal_content_NativeLibraryHelper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp index 791d463328685..9017d58913b3c 100644 --- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp +++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp @@ -149,7 +149,12 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr return INSTALL_FAILED_INVALID_APK; } - if (!extractNativeLibs && (!debuggable || strcmp(fileName, "wrap.sh") != 0)) { + // Always extract wrap.sh for debuggable, even if extractNativeLibs=false. This makes it + // easier to use wrap.sh because it only works when it is extracted, see + // frameworks/base/services/core/java/com/android/server/am/ProcessList.java. + bool forceExtractCurrentFile = debuggable && strcmp(fileName, "wrap.sh") == 0; + + if (!extractNativeLibs && !forceExtractCurrentFile) { // check if library is uncompressed and page-aligned if (method != ZipFileRO::kCompressStored) { ALOGE("Library '%s' is compressed - will not be able to open it directly from apk.\n",