From 9d96f458a8a03c4d5baf2d675b97529067f49049 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Mon, 18 Aug 2025 23:43:02 -0700 Subject: [PATCH] Read docs lol --- Android.bp | 42 ++++++++++++++++++++++++++++++++++---- api/current.txt | 15 ++++++++++++++ sepolicy/file_contexts | 2 ++ sepolicy/pawlet_device.te | 14 +++++++++++++ sepolicy/property_contexts | 4 ++++ 5 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 api/current.txt create mode 100644 sepolicy/file_contexts create mode 100644 sepolicy/pawlet_device.te create mode 100644 sepolicy/property_contexts diff --git a/Android.bp b/Android.bp index e2cde07..a4fed03 100644 --- a/Android.bp +++ b/Android.bp @@ -1,10 +1,44 @@ +# Primary SDK Library java_sdk_library { name: "pawlet-device", srcs: ["core/java/**/*.java"], api_packages: ["pawletos.device"], - libs: ["core-libart"], - sdk_version: "current", - installable: true, + + # Dependencies + libs: ["android_stubs_current"], + static_libs: ["framework-minus-apex"], + + # Build config + sdk_version: "system_current", product_specific: true, - visibility: ["//packages/apps/..."] + installable: true, + resource_dirs: ["res"], + + # Visibility + visibility: [ + "//frameworks/base/...", + "//packages/apps/...", + "//vendor/...", + ], + stability: "stable", +} + +# SELinux Policy Module +se_policy { + name: "pawlet-device-sepolicy", + srcs: [ + "sepolicy/pawlet_device.te", + "sepolicy/file_contexts", + "sepolicy/property_contexts", + ], + installable: true, +} + +# Combined Module +android_module { + name: "pawlet-device-full", + srcs: [":pawlet-device"], + policy_deps: [":pawlet-device-sepolicy"], + product_specific: true, + installable: true, } \ No newline at end of file diff --git a/api/current.txt b/api/current.txt new file mode 100644 index 0000000..2d01a51 --- /dev/null +++ b/api/current.txt @@ -0,0 +1,15 @@ +package pawletos.device { + @SystemApi + public class PawletDevice { + method public static String getBrandName(Context); + method public static String getCodename(Context); + method public static String getCurrentLocale(Context); + method public static String getManufactureDate(); + method public static double getPawletSDKVersion(); + method public static String getSeries(); + method public static String getWarrantyExclusion(); + method public static boolean isEmulator(); + method public static boolean isPawletOS(); + method public static boolean isRooted(); + } +} \ No newline at end of file diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts new file mode 100644 index 0000000..1300cdd --- /dev/null +++ b/sepolicy/file_contexts @@ -0,0 +1,2 @@ +# Label the JAR file +/system/framework/pawlet-device.jar u:object_r:pawlet_device_exec:s0 \ No newline at end of file diff --git a/sepolicy/pawlet_device.te b/sepolicy/pawlet_device.te new file mode 100644 index 0000000..e821659 --- /dev/null +++ b/sepolicy/pawlet_device.te @@ -0,0 +1,14 @@ +# Type declarations +type pawlet_device, domain; +type pawlet_device_exec, exec_type, file_type, system_file_type; + +# Inherit from core domain +typeattribute pawlet_device coredomain; + +# Property access +get_prop(pawlet_device, oxmc_prop) +set_prop(pawlet_device, oxmc_prop) + +# Framework interactions +allow pawlet_device framework_res:file { read getattr }; +allow pawlet_device system_server:service_manager find; \ No newline at end of file diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts new file mode 100644 index 0000000..453529e --- /dev/null +++ b/sepolicy/property_contexts @@ -0,0 +1,4 @@ +# Custom properties +ro.oxmc..* u:object_r:oxmc_prop:s0 +ro.pawlet..* u:object_r:oxmc_prop:s0 +persist.pawlet..* u:object_r:oxmc_prop:s0 \ No newline at end of file