From e3a8a1f873fd566ff0f4ae66f50300030dcaa254 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Fri, 28 Mar 2025 11:19:51 +0500 Subject: [PATCH] Added: Add info to device info for supported ABIs for armv8l and 64-bit-only aarch64 devices and `PAGE_SIZE` for `16KB` page size devices - https://source.android.com/docs/core/architecture/16kb-page-size/16kb --- .../com/termux/shared/android/AndroidUtils.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/termux-shared/src/main/java/com/termux/shared/android/AndroidUtils.java b/termux-shared/src/main/java/com/termux/shared/android/AndroidUtils.java index bca47578..2d3b0fea 100644 --- a/termux-shared/src/main/java/com/termux/shared/android/AndroidUtils.java +++ b/termux-shared/src/main/java/com/termux/shared/android/AndroidUtils.java @@ -5,6 +5,8 @@ import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.os.Build; +import android.system.Os; +import android.system.OsConstants; import androidx.annotation.NonNull; @@ -158,7 +160,19 @@ public class AndroidUtils { appendPropertyToMarkdown(markdownString, "BOARD", Build.BOARD); appendPropertyToMarkdown(markdownString, "HARDWARE", Build.HARDWARE); appendPropertyToMarkdown(markdownString, "DEVICE", Build.DEVICE); + appendPropertyToMarkdown(markdownString, "SUPPORTED_ABIS", Joiner.on(", ").skipNulls().join(Build.SUPPORTED_ABIS)); + appendPropertyToMarkdown(markdownString, "SUPPORTED_32_BIT_ABIS", Joiner.on(", ").skipNulls().join(Build.SUPPORTED_32_BIT_ABIS)); + appendPropertyToMarkdown(markdownString, "SUPPORTED_64_BIT_ABIS", Joiner.on(", ").skipNulls().join(Build.SUPPORTED_64_BIT_ABIS)); + + // If on Android >= 15 + if (Build.VERSION.SDK_INT >= 35) { + try { + appendPropertyToMarkdownIfSet(markdownString, "PAGE_SIZE", Os.sysconf(OsConstants._SC_PAGESIZE)); + } catch (Throwable t) { + // Ignore + } + } markdownString.append("\n##\n");