From 640edf73faade03def91d2206678536b41a8d7b0 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Sun, 17 Aug 2025 13:17:29 -0700 Subject: [PATCH] First base --- README.md | 12 ++++ .../java/android/os/oxmc/OxmcEnvironment.java | 65 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 README.md create mode 100644 frameworks/base/core/java/android/os/oxmc/OxmcEnvironment.java diff --git a/README.md b/README.md new file mode 100644 index 0000000..b495104 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# OxmcEnvironment Framework API + +This repository contains the PawletOS framework API under `android.os.oxmc`. + +## Features + +- System property access (`ro.oxmc.build.*`) +- API to check if running on PawletOS +- Access to branding, codename, welcome message +- Designed for apps and system code to import via: + ```java + import android.os.oxmc.OxmcEnvironment; \ No newline at end of file diff --git a/frameworks/base/core/java/android/os/oxmc/OxmcEnvironment.java b/frameworks/base/core/java/android/os/oxmc/OxmcEnvironment.java new file mode 100644 index 0000000..f34e24c --- /dev/null +++ b/frameworks/base/core/java/android/os/oxmc/OxmcEnvironment.java @@ -0,0 +1,65 @@ +package android.os.oxmc; + +import android.content.Context; +import android.os.Build; +import android.os.SystemProperties; + +/** + * PawletOS Environment API for apps running on PawletOS builds. + */ +public class OxmcEnvironment { + private static final String OXMC_OS_NAME = "PawletOS"; + private static final int OXMC_OS_VERSION = 16; + + /** + * Check if device is running PawletOS. + */ + public static boolean isPawletOS() { + return "PawletOS".equalsIgnoreCase(Build.MANUFACTURER) + || "PawletOS".equalsIgnoreCase(OXMC_OS_NAME); + } + + /** + * Get the PawletOS version. + */ + public static int getPawletVersion() { + return OXMC_OS_VERSION; + } + + /** + * Get a welcome message from framework resources. + */ + public static String getWelcomeMessage(Context ctx) { + return ctx.getString(android.R.string.oxmc_device_message); + } + + /** + * Get the brand name. + */ + public static String getBrandName(Context ctx) { + return ctx.getString(android.R.string.oxmc_brand_name); + } + + /** + * Get the codename (e.g., PV16). + */ + public static String getCodename(Context ctx) { + return ctx.getString(android.R.string.oxmc_codename); + } + + // ───────────────────────────── + // Custom build property access + // ───────────────────────────── + + public static String getManufactureDate() { + return SystemProperties.get("ro.oxmc.build.manufacture_date", "unknown"); + } + + public static String getWarrantyExclusion() { + return SystemProperties.get("ro.oxmc.build.warranty_exclusion", "none"); + } + + public static String getSeries() { + return SystemProperties.get("ro.oxmc.build.series", "generic"); + } +} \ No newline at end of file