diff --git a/packages/aapt/aapt2-cmd-Compile.h.patch b/packages/aapt/aapt2-cmd-Compile.h.patch deleted file mode 100644 index 236901c1e..000000000 --- a/packages/aapt/aapt2-cmd-Compile.h.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/base/tools/aapt2/cmd/Compile.h -+++ b/base/tools/aapt2/cmd/Compile.h -@@ -35,6 +35,7 @@ - bool pseudolocalize = false; - bool no_png_crunch = false; - bool legacy_mode = false; -+ bool source_path = false; - // See comments on aapt::ResourceParserOptions. - bool preserve_visibility_of_styleables = false; - bool verbose = false; -@@ -58,6 +59,8 @@ - AddOptionalSwitch("--no-crunch", "Disables PNG processing", &options_.no_png_crunch); - AddOptionalSwitch("--legacy", "Treat errors that used to be valid in AAPT as warnings", - &options_.legacy_mode); -+ AddOptionalSwitch("--source-path", "Ignored for compatibility", -+ &options_.source_path); - AddOptionalSwitch("--preserve-visibility-of-styleables", - "If specified, apply the same visibility rules for\n" - "styleables as are used for all other resources.\n" diff --git a/packages/aapt/aapt2-util-Util.cpp.patch b/packages/aapt/aapt2-util-Util.cpp.patch index e9bfd6b32..b8758586f 100644 --- a/packages/aapt/aapt2-util-Util.cpp.patch +++ b/packages/aapt/aapt2-util-Util.cpp.patch @@ -8,7 +8,7 @@ #include "text/Unicode.h" #include "text/Utf8Iterator.h" -@@ -214,10 +213,7 @@ +@@ -231,10 +230,7 @@ // Update minor version whenever a feature or flag is added. static const char* const sMinorVersion = "19"; diff --git a/packages/aapt/aidl.subpackage.sh b/packages/aapt/aidl.subpackage.sh index a0848882c..8e7104365 100644 --- a/packages/aapt/aidl.subpackage.sh +++ b/packages/aapt/aidl.subpackage.sh @@ -1,2 +1,3 @@ TERMUX_SUBPKG_INCLUDE="bin/aidl" TERMUX_SUBPKG_DESCRIPTION="Android Interface Definition Language (AIDL)" +TERMUX_SUBPKG_DEPENDS="libgtest" diff --git a/packages/aapt/androidfw-Asset.cpp.patch b/packages/aapt/androidfw-Asset.cpp.patch new file mode 100644 index 000000000..b146c4abe --- /dev/null +++ b/packages/aapt/androidfw-Asset.cpp.patch @@ -0,0 +1,18 @@ +--- a/base/libs/androidfw/Asset.cpp ++++ b/base/libs/androidfw/Asset.cpp +@@ -455,7 +455,6 @@ + { + assert(mFp == NULL); // no reopen + assert(!mMap.has_value()); +- assert(dataMap != NULL); + + mMap = std::move(dataMap); + mStart = -1; // not used +@@ -800,7 +799,6 @@ + { + assert(mFd < 0); // no re-open + assert(!mMap.has_value()); +- assert(dataMap != NULL); + + mMap = std::move(dataMap); + mStart = -1; // not used diff --git a/packages/aapt/androidfw-ResourceTypes.cpp.patch b/packages/aapt/androidfw-ResourceTypes.cpp.patch index 2f1564f06..defd7df32 100644 --- a/packages/aapt/androidfw-ResourceTypes.cpp.patch +++ b/packages/aapt/androidfw-ResourceTypes.cpp.patch @@ -1,11 +1,11 @@ --- a/base/libs/androidfw/ResourceTypes.cpp +++ b/base/libs/androidfw/ResourceTypes.cpp -@@ -42,7 +42,7 @@ +@@ -43,7 +43,7 @@ #include #include -#ifdef __ANDROID__ +#if defined __ANDROID__ && !defined __TERMUX__ #include - #endif + #endif diff --git a/packages/aapt/base-liblog_symbols.cpp.patch b/packages/aapt/base-liblog_symbols.cpp.patch deleted file mode 100644 index 1dbf09624..000000000 --- a/packages/aapt/base-liblog_symbols.cpp.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/core/base/liblog_symbols.cpp -+++ b/core/base/liblog_symbols.cpp -@@ -55,6 +55,7 @@ - DLSYM(__android_log_set_minimum_priority); - DLSYM(__android_log_get_minimum_priority); - DLSYM(__android_log_set_default_tag); -+ DLSYM(__android_log_is_loggable); - #undef DLSYM - - return real_liblog_functions; -@@ -78,6 +79,7 @@ - .__android_log_set_minimum_priority = __android_log_set_minimum_priority, - .__android_log_get_minimum_priority = __android_log_get_minimum_priority, - .__android_log_set_default_tag = __android_log_set_default_tag, -+ .__android_log_is_loggable = __android_log_is_loggable, - }; - }(); - return liblog_functions; diff --git a/packages/aapt/base-liblog_symbols.h.patch b/packages/aapt/base-liblog_symbols.h.patch deleted file mode 100644 index 95363898b..000000000 --- a/packages/aapt/base-liblog_symbols.h.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/core/base/liblog_symbols.h -+++ b/core/base/liblog_symbols.h -@@ -36,6 +36,7 @@ - int32_t (*__android_log_set_minimum_priority)(int32_t priority); - int32_t (*__android_log_get_minimum_priority)(); - void (*__android_log_set_default_tag)(const char* tag); -+ int (*__android_log_is_loggable)(int prio, const char* tag, int default_prio); - }; - - const std::optional& GetLibLogFunctions(); diff --git a/packages/aapt/base-logging.cpp.patch b/packages/aapt/base-logging.cpp.patch deleted file mode 100644 index bd505f2c1..000000000 --- a/packages/aapt/base-logging.cpp.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/core/base/logging.cpp -+++ b/core/base/logging.cpp -@@ -555,7 +555,7 @@ - // take into consideration the value from SetMinimumLogSeverity(). - if (liblog_functions) { - int32_t priority = LogSeverityToPriority(severity); -- return __android_log_is_loggable(priority, tag, ANDROID_LOG_INFO); -+ return liblog_functions->__android_log_is_loggable(priority, tag, ANDROID_LOG_INFO); - } else { - return severity >= gMinimumLogSeverity; - } diff --git a/packages/aapt/build.sh b/packages/aapt/build.sh index 94a40bbfa..834c85fed 100644 --- a/packages/aapt/build.sh +++ b/packages/aapt/build.sh @@ -2,21 +2,30 @@ TERMUX_PKG_HOMEPAGE=https://elinux.org/Android_aapt TERMUX_PKG_DESCRIPTION="Android Asset Packaging Tool" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="@termux" -_TAG_VERSION=11.0.0 -_TAG_REVISION=48 +_TAG_VERSION=12.0.0 +_TAG_REVISION=27 TERMUX_PKG_VERSION=${_TAG_VERSION}.${_TAG_REVISION} TERMUX_PKG_SRCURL=(https://android.googlesource.com/platform/frameworks/base https://android.googlesource.com/platform/system/core + https://android.googlesource.com/platform/system/libbase + https://android.googlesource.com/platform/system/libziparchive + https://android.googlesource.com/platform/system/logging + https://android.googlesource.com/platform/system/incremental_delivery https://android.googlesource.com/platform/build https://android.googlesource.com/platform/system/tools/aidl) TERMUX_PKG_GIT_BRANCH=android-${_TAG_VERSION}_r${_TAG_REVISION} TERMUX_PKG_SHA256=(SKIP_CHECKSUM + SKIP_CHECKSUM + SKIP_CHECKSUM + SKIP_CHECKSUM + SKIP_CHECKSUM SKIP_CHECKSUM SKIP_CHECKSUM SKIP_CHECKSUM) TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_DEPENDS="libc++, libexpat, libpng, libzopfli, zlib" +TERMUX_PKG_BUILD_DEPENDS="fmt, libgtest" TERMUX_PKG_HOSTBUILD=true termux_step_post_get_source() { @@ -92,10 +101,13 @@ termux_step_make() { . $TERMUX_PKG_BUILDER_DIR/sources.sh local CORE_INCDIR=$TERMUX_PKG_SRCDIR/core/include - local LIBBASE_SRCDIR=$TERMUX_PKG_SRCDIR/core/base + local LIBLOG_INCDIR=$TERMUX_PKG_SRCDIR/logging/liblog/include + local LIBBASE_SRCDIR=$TERMUX_PKG_SRCDIR/libbase local LIBCUTILS_SRCDIR=$TERMUX_PKG_SRCDIR/core/libcutils local LIBUTILS_SRCDIR=$TERMUX_PKG_SRCDIR/core/libutils - local LIBZIPARCHIVE_SRCDIR=$TERMUX_PKG_SRCDIR/core/libziparchive + local INCFS_SUPPORT_INCDIR=$TERMUX_PKG_SRCDIR/libziparchive/incfs_support/include + local LIBZIPARCHIVE_SRCDIR=$TERMUX_PKG_SRCDIR/libziparchive + local INCFS_UTIL_SRCDIR=$TERMUX_PKG_SRCDIR/incremental_delivery/incfs/util local ANDROIDFW_SRCDIR=$TERMUX_PKG_SRCDIR/base/libs/androidfw local AAPT_SRCDIR=$TERMUX_PKG_SRCDIR/base/tools/aapt local LIBIDMAP2_POLICIES_INCDIR=$TERMUX_PKG_SRCDIR/base/cmds/idmap2/libidmap2_policies/include @@ -103,7 +115,10 @@ termux_step_make() { local ZIPALIGN_SRCDIR=$TERMUX_PKG_SRCDIR/build/tools/zipalign local AIDL_SRCDIR=$TERMUX_PKG_SRCDIR/aidl - CPPFLAGS+=" -I. -I./include -I$LIBBASE_SRCDIR/include -I$CORE_INCDIR" + CPPFLAGS+=" -I. -I./include + -I$LIBBASE_SRCDIR/include + -I$LIBLOG_INCDIR + -I$CORE_INCDIR" # Build libcutils: cd $LIBCUTILS_SRCDIR @@ -133,7 +148,7 @@ termux_step_make() { # Build libziparchive: cd $LIBZIPARCHIVE_SRCDIR for f in $libziparchive_sources; do - $CXX $CXXFLAGS $CPPFLAGS $f -c + $CXX $CXXFLAGS -std=c++20 $CPPFLAGS -I$INCFS_SUPPORT_INCDIR $f -c done $CXX $CXXFLAGS *.o -shared $LDFLAGS \ -landroid-base \ @@ -142,13 +157,16 @@ termux_step_make() { CPPFLAGS+=" -I$LIBZIPARCHIVE_SRCDIR/include" + CPPFLAGS+=" -I$INCFS_UTIL_SRCDIR/include" + # Build libandroidfw: cd $ANDROIDFW_SRCDIR - for f in $androidfw_sources; do + for f in $androidfw_sources $INCFS_UTIL_SRCDIR/map_ptr.cpp; do $CXX $CXXFLAGS $CPPFLAGS $f -c done $CXX $CXXFLAGS *.o -shared $LDFLAGS \ -landroid-base \ + -landroid-cutils \ -landroid-ziparchive \ -o $_TMP_LIBDIR/libandroid-fw.so @@ -211,6 +229,8 @@ termux_step_make() { done $CXX $CXXFLAGS *.o $LDFLAGS \ -landroid-base \ + -lfmt \ + -lgtest \ -o $_TMP_BINDIR/aidl } diff --git a/packages/aapt/incfs-util-map_ptr.cpp.patch b/packages/aapt/incfs-util-map_ptr.cpp.patch new file mode 100644 index 000000000..f89cb64ba --- /dev/null +++ b/packages/aapt/incfs-util-map_ptr.cpp.patch @@ -0,0 +1,20 @@ +--- a/incremental_delivery/incfs/util/map_ptr.cpp ++++ b/incremental_delivery/incfs/util/map_ptr.cpp +@@ -18,7 +18,7 @@ + #include + #include + +-#ifdef __ANDROID__ ++#if defined __ANDROID__ && !defined __TERMUX__ + #include "incfs_inline.h" + #endif + +@@ -50,7 +50,7 @@ + return Create(fd, offset, length, file_name, true /* verify */); + } + +-#ifdef __ANDROID__ ++#if defined __ANDROID__ && !defined __TERMUX__ + static bool IsVerificationEnabled(int fd) { + return isIncFsFd(fd) && isFullyLoaded(fd) != LoadingState::Full; + } diff --git a/packages/aapt/base-include-android-base-unique_fd.h.patch b/packages/aapt/include-android-base-unique_fd.h.patch similarity index 86% rename from packages/aapt/base-include-android-base-unique_fd.h.patch rename to packages/aapt/include-android-base-unique_fd.h.patch index becd70ecd..ae78a141d 100644 --- a/packages/aapt/base-include-android-base-unique_fd.h.patch +++ b/packages/aapt/include-android-base-unique_fd.h.patch @@ -1,5 +1,5 @@ ---- a/core/base/include/android-base/unique_fd.h -+++ b/core/base/include/android-base/unique_fd.h +--- a/libbase/include/android-base/unique_fd.h ++++ b/libbase/include/android-base/unique_fd.h @@ -46,7 +46,7 @@ // unique_fd is also known as ScopedFd/ScopedFD/scoped_fd; mentioned here to help // you find this class if you're searching for one of those names. diff --git a/packages/aapt/include-utils-CallStack.h.patch b/packages/aapt/include-utils-CallStack.h.patch new file mode 100644 index 000000000..bc4d96ed0 --- /dev/null +++ b/packages/aapt/include-utils-CallStack.h.patch @@ -0,0 +1,11 @@ +--- a/core/libutils/include/utils/CallStack.h ++++ b/core/libutils/include/utils/CallStack.h +@@ -20,7 +20,7 @@ + #include + + #include +-#include ++#define BACKTRACE_CURRENT_THREAD -1 + #include + #include + diff --git a/packages/aapt/libbase-logging.cpp.patch b/packages/aapt/libbase-logging.cpp.patch new file mode 100644 index 000000000..c264ff133 --- /dev/null +++ b/packages/aapt/libbase-logging.cpp.patch @@ -0,0 +1,148 @@ +--- a/libbase/logging.cpp ++++ b/libbase/logging.cpp +@@ -209,9 +209,9 @@ + static std::string* gDefaultTag; + + void SetDefaultTag(const std::string& tag) { +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + __android_log_set_default_tag(tag.c_str()); +- } else { ++#else + std::lock_guard lock(TagLock()); + if (gDefaultTag != nullptr) { + delete gDefaultTag; +@@ -220,7 +220,7 @@ + if (!tag.empty()) { + gDefaultTag = new std::string(tag); + } +- } ++#endif + } + + static bool gInitialized = false; +@@ -314,13 +314,13 @@ + int32_t lg_id = LogIdTolog_id_t(id); + int32_t priority = LogSeverityToPriority(severity); + +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + __android_log_message log_message = {sizeof(__android_log_message), lg_id, priority, tag, + static_cast(nullptr), 0, message}; + __android_log_logd_logger(&log_message); +- } else { ++#else + __android_log_buf_print(lg_id, priority, tag, "%s", message); +- } ++#endif + } + + LogdLogger::LogdLogger(LogId default_log_id) : default_log_id_(default_log_id) {} +@@ -396,7 +396,7 @@ + LogFunction old_logger = std::move(Logger()); + Logger() = std::move(logger); + +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + __android_log_set_logger([](const struct __android_log_message* log_message) { + auto log_id = log_id_tToLogId(log_message->buffer_id); + auto severity = PriorityToLogSeverity(log_message->priority); +@@ -404,7 +404,7 @@ + Logger()(log_id, severity, log_message->tag, log_message->file, log_message->line, + log_message->message); + }); +- } ++#endif + return old_logger; + } + +@@ -412,9 +412,9 @@ + AbortFunction old_aborter = std::move(Aborter()); + Aborter() = std::move(aborter); + +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + __android_log_set_aborter([](const char* abort_message) { Aborter()(abort_message); }); +- } ++#endif + return old_aborter; + } + +@@ -500,11 +500,11 @@ + + // Abort if necessary. + if (data_->GetSeverity() == FATAL) { +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + __android_log_call_aborter(msg.c_str()); +- } else { ++#else + Aborter()(msg.c_str()); +- } ++#endif + } + } + +@@ -515,11 +515,11 @@ + void LogMessage::LogLine(const char* file, unsigned int line, LogSeverity severity, const char* tag, + const char* message) { + int32_t priority = LogSeverityToPriority(severity); +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + __android_log_message log_message = { + sizeof(__android_log_message), LOG_ID_DEFAULT, priority, tag, file, line, message}; + __android_log_write_log_message(&log_message); +- } else { ++#else + if (tag == nullptr) { + std::lock_guard lock(TagLock()); + if (gDefaultTag == nullptr) { +@@ -530,38 +530,38 @@ + } else { + Logger()(DEFAULT, severity, tag, file, line, message); + } +- } ++#endif + } + + LogSeverity GetMinimumLogSeverity() { +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + return PriorityToLogSeverity(__android_log_get_minimum_priority()); +- } else { ++#else + return gMinimumLogSeverity; +- } ++#endif + } + + bool ShouldLog(LogSeverity severity, const char* tag) { + // Even though we're not using the R liblog functions in this function, if we're running on Q, + // we need to fall back to using gMinimumLogSeverity, since __android_log_is_loggable() will not + // take into consideration the value from SetMinimumLogSeverity(). +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + int32_t priority = LogSeverityToPriority(severity); + return __android_log_is_loggable(priority, tag, ANDROID_LOG_INFO); +- } else { ++#else + return severity >= gMinimumLogSeverity; +- } ++#endif + } + + LogSeverity SetMinimumLogSeverity(LogSeverity new_severity) { +- if (__builtin_available(android 30, *)) { ++#if defined __ANDROID__ && __ANDROID_API__ >= 30 + int32_t priority = LogSeverityToPriority(new_severity); + return PriorityToLogSeverity(__android_log_set_minimum_priority(priority)); +- } else { ++#else + LogSeverity old_severity = gMinimumLogSeverity; + gMinimumLogSeverity = new_severity; + return old_severity; +- } ++#endif + } + + ScopedLogSeverity::ScopedLogSeverity(LogSeverity new_severity) { diff --git a/packages/aapt/base-properties.cpp.patch b/packages/aapt/libbase-properties.cpp.patch similarity index 50% rename from packages/aapt/base-properties.cpp.patch rename to packages/aapt/libbase-properties.cpp.patch index bf36df244..3bf0acb9d 100644 --- a/packages/aapt/base-properties.cpp.patch +++ b/packages/aapt/libbase-properties.cpp.patch @@ -1,15 +1,33 @@ ---- a/core/base/properties.cpp -+++ b/core/base/properties.cpp -@@ -73,7 +73,7 @@ - template uint32_t GetUintProperty(const std::string&, uint32_t, uint32_t); - template uint64_t GetUintProperty(const std::string&, uint64_t, uint64_t); +--- a/libbase/properties.cpp ++++ b/libbase/properties.cpp +@@ -32,7 +32,7 @@ + #include + #include -#if !defined(__BIONIC__) +#if !defined(__BIONIC__) || defined(__TERMUX__) - static std::map& g_properties = *new std::map; - static int __system_property_set(const char* key, const char* value) { - g_properties[key] = value; -@@ -83,7 +83,7 @@ + + #define PROP_VALUE_MAX 92 + +@@ -53,6 +53,9 @@ + return 0; + } + ++#endif ++ ++#if !defined(__BIONIC__) + int __system_property_get(const char* key, char* value) { + auto it = g_properties.find(key); + if (it == g_properties.end()) { +@@ -62,7 +65,6 @@ + snprintf(value, PROP_VALUE_MAX, "%s", it->second.c_str()); + return strlen(value); + } +- + #endif + + namespace android { +@@ -108,7 +110,7 @@ std::string GetProperty(const std::string& key, const std::string& default_value) { std::string property_value; @@ -18,7 +36,7 @@ const prop_info* pi = __system_property_find(key.c_str()); if (pi == nullptr) return default_value; -@@ -108,7 +108,7 @@ +@@ -134,7 +136,7 @@ return (__system_property_set(key.c_str(), value.c_str()) == 0); } diff --git a/packages/aapt/libcutils-properties.cpp.patch b/packages/aapt/libcutils-properties.cpp.patch index f48df1570..a805fdb07 100644 --- a/packages/aapt/libcutils-properties.cpp.patch +++ b/packages/aapt/libcutils-properties.cpp.patch @@ -1,6 +1,6 @@ --- a/core/libcutils/properties.cpp +++ b/core/libcutils/properties.cpp -@@ -134,6 +134,7 @@ +@@ -106,6 +106,7 @@ data->callback(name, value, data->cookie); } @@ -8,8 +8,10 @@ static void property_list_callback(const prop_info* pi, void* data) { __system_property_read_callback(pi, trampoline, data); } -@@ -142,3 +143,4 @@ - callback_data data = { fn, cookie }; +@@ -114,5 +115,6 @@ + callback_data data = {fn, cookie}; return __system_property_foreach(property_list_callback, &data); } +#endif + + #endif diff --git a/packages/aapt/libutils-Threads.cpp.patch b/packages/aapt/libutils-Threads.cpp.patch index 37c26cbd8..04593fa22 100644 --- a/packages/aapt/libutils-Threads.cpp.patch +++ b/packages/aapt/libutils-Threads.cpp.patch @@ -18,7 +18,7 @@ struct thread_data_t { thread_func_t entryFunction; void* userData; -@@ -131,7 +131,7 @@ +@@ -133,7 +133,7 @@ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); @@ -27,7 +27,7 @@ if (threadPriority != PRIORITY_DEFAULT || threadName != NULL) { // Now that the pthread_t has a method to find the associated // android_thread_id_t (pid) from pthread_t, it would be possible to avoid -@@ -175,7 +175,7 @@ +@@ -177,7 +177,7 @@ return 1; } @@ -36,7 +36,7 @@ static pthread_t android_thread_id_t_to_pthread(android_thread_id_t thread) { return (pthread_t) thread; -@@ -301,7 +301,7 @@ +@@ -303,7 +303,7 @@ gCreateThreadFn = func; } @@ -45,7 +45,7 @@ int androidSetThreadPriority(pid_t tid, int pri) { int rc = 0; -@@ -843,7 +843,7 @@ +@@ -845,7 +845,7 @@ return mRunning; } diff --git a/packages/aapt/libziparchive-include-ziparchive-zip_writer.h.patch b/packages/aapt/libziparchive-include-ziparchive-zip_writer.h.patch deleted file mode 100644 index b473c47e3..000000000 --- a/packages/aapt/libziparchive-include-ziparchive-zip_writer.h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/core/libziparchive/include/ziparchive/zip_writer.h -+++ b/core/libziparchive/include/ziparchive/zip_writer.h -@@ -19,7 +19,6 @@ - #include - #include - --#include - #include - #include - #include -@@ -184,6 +183,4 @@ - - std::unique_ptr z_stream_; - std::vector buffer_; -- -- FRIEND_TEST(zipwriter, WriteToUnseekableFile); - }; diff --git a/packages/aapt/libziparchive-zip_archive.cc.patch b/packages/aapt/libziparchive-zip_archive.cc.patch index cbf8a6c2b..1e26e5254 100644 --- a/packages/aapt/libziparchive-zip_archive.cc.patch +++ b/packages/aapt/libziparchive-zip_archive.cc.patch @@ -1,6 +1,6 @@ ---- a/core/libziparchive/zip_archive.cc -+++ b/core/libziparchive/zip_archive.cc -@@ -38,7 +38,7 @@ +--- a/libziparchive/zip_archive.cc ++++ b/libziparchive/zip_archive.cc +@@ -40,7 +40,7 @@ #define lseek64 lseek #endif @@ -9,25 +9,25 @@ #include #endif -@@ -155,7 +155,7 @@ - return 0; - } +@@ -91,7 +91,7 @@ + * of the string length into the hash table entry. + */ -#if defined(__BIONIC__) +#if defined(__BIONIC__) && __ANDROID_API__ >= 29 uint64_t GetOwnerTag(const ZipArchive* archive) { return android_fdsan_create_owner_tag(ANDROID_FDSAN_OWNER_TYPE_ZIPARCHIVE, reinterpret_cast(archive)); -@@ -171,7 +171,7 @@ - num_entries(0), - hash_table_size(0), - hash_table(nullptr) { +@@ -105,7 +105,7 @@ + central_directory(), + directory_map(), + num_entries(0) { -#if defined(__BIONIC__) +#if defined(__BIONIC__) && __ANDROID_API__ >= 29 if (assume_ownership) { CHECK(mapped_zip.HasFd()); android_fdsan_exchange_owner_tag(mapped_zip.GetFileDescriptor(), 0, GetOwnerTag(this)); -@@ -191,7 +191,7 @@ +@@ -123,7 +123,7 @@ ZipArchive::~ZipArchive() { if (close_file && mapped_zip.GetFileDescriptor() >= 0) { diff --git a/packages/aapt/libziparchive-zip_writer.cc.patch b/packages/aapt/libziparchive-zip_writer.cc.patch index 0409bed80..d475e9e8f 100644 --- a/packages/aapt/libziparchive-zip_writer.cc.patch +++ b/packages/aapt/libziparchive-zip_writer.cc.patch @@ -1,5 +1,5 @@ ---- a/core/libziparchive/zip_writer.cc -+++ b/core/libziparchive/zip_writer.cc +--- a/libziparchive/zip_writer.cc ++++ b/libziparchive/zip_writer.cc @@ -389,7 +389,7 @@ CHECK(z_stream_->avail_out != 0); diff --git a/packages/aapt/sources.sh b/packages/aapt/sources.sh index 6dc35b11f..ce634bab0 100644 --- a/packages/aapt/sources.sh +++ b/packages/aapt/sources.sh @@ -41,9 +41,9 @@ local libutils_sources=" Errors.cpp FileMap.cpp JenkinsHash.cpp + LightRefBase.cpp NativeHandle.cpp Printer.cpp - PropertyMap.cpp RefBase.cpp SharedBuffer.cpp StopWatch.cpp @@ -69,7 +69,6 @@ local libbase_sources=" chrono_utils.cpp cmsg.cpp file.cpp - liblog_symbols.cpp logging.cpp mapped_file.cpp parsebool.cpp @@ -86,8 +85,13 @@ local libbase_sources=" local libziparchive_sources=" zip_archive.cc zip_archive_stream_entry.cc + zip_cd_entry_map.cc + zip_error.cpp zip_writer.cc " +libziparchive_sources+=" + incfs_support/signal_handling.cpp +" # androidfw local androidfw_sources=" @@ -96,6 +100,7 @@ local androidfw_sources=" AssetDir.cpp AssetManager.cpp AssetManager2.cpp + AssetsProvider.cpp AttributeResolution.cpp ChunkIterator.cpp ConfigDescription.cpp @@ -195,6 +200,7 @@ local libaapt2_sources=" xml/XmlDom.cpp xml/XmlPullParser.cpp xml/XmlUtil.cpp + ValueTransformer.cpp " local aapt2_tool_sources=" cmd/Command.cpp @@ -214,27 +220,35 @@ local aapt2_sources=" # aidl local libaidl_sources=" - aidl.cpp aidl_checkapi.cpp aidl_const_expressions.cpp + aidl_dumpapi.cpp aidl_language.cpp - aidl_typenames.cpp + aidl_to_cpp_common.cpp aidl_to_cpp.cpp aidl_to_java.cpp aidl_to_ndk.cpp + aidl_to_rust.cpp + aidl_typenames.cpp + aidl.cpp ast_cpp.cpp ast_java.cpp code_writer.cpp - generate_cpp.cpp - aidl_to_cpp_common.cpp - generate_ndk.cpp - generate_java.cpp - generate_java_binder.cpp + comments.cpp + diagnostics.cpp generate_aidl_mappings.cpp + generate_cpp.cpp + generate_java_binder.cpp + generate_java.cpp + generate_ndk.cpp + generate_rust.cpp import_resolver.cpp - line_reader.cpp io_delegate.cpp + line_reader.cpp + location.cpp + logging.cpp options.cpp + parser.cpp " libaidl_sources+=" lex.yy.c