First base

This commit is contained in:
oxmc
2025-08-17 13:17:29 -07:00
commit 640edf73fa
2 changed files with 77 additions and 0 deletions

12
README.md Normal file
View File

@@ -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;

View File

@@ -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");
}
}