From 22182420ea5608e681b50d097011c68ab6d52169 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sun, 18 Nov 2018 07:12:30 +0200 Subject: move system_get_property to libc --- src/libandroid.c | 11 ----------- src/libc.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/libandroid.c b/src/libandroid.c index cfcc09f..52effae 100644 --- a/src/libandroid.c +++ b/src/libandroid.c @@ -13,17 +13,6 @@ // https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md typedef uint32_t bionic_off_t; -// System - -#define PROP_NAME_MAX 32 -#define PROP_VALUE_MAX 92 - -int -__system_property_get(const char *name, char *value) -{ - return 0; -} - // AAsset struct AAsset { diff --git a/src/libc.c b/src/libc.c index 9bc9b8f..c64ccb1 100644 --- a/src/libc.c +++ b/src/libc.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,21 @@ struct bionic_sigaction { // Stuff that doesn't exist in glibc +#define PROP_NAME_MAX 32 +#define PROP_VALUE_MAX 92 + +int +__system_property_get(const char *name, char *value) +{ + verbose("%s", name); + + if (!strcmp(name, "ro.build.version.sdk")) + return snprintf(value, PROP_VALUE_MAX, "28"); + + *value = 0; + return 0; +} + void __assert2(const char* file, int line, const char* function, const char* failed_expression) { -- cgit v1.2.3-70-g09d2