summaryrefslogtreecommitdiffstats
path: root/src/detection/host/host_android.c
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/detection/host/host_android.c
Add the files
Diffstat (limited to 'src/detection/host/host_android.c')
-rw-r--r--src/detection/host/host_android.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/detection/host/host_android.c b/src/detection/host/host_android.c
new file mode 100644
index 0000000..1157a92
--- /dev/null
+++ b/src/detection/host/host_android.c
@@ -0,0 +1,27 @@
+#include "host.h"
+#include "common/settings.h"
+
+#include <ctype.h>
+
+const char* ffDetectHost(FFHostResult* host) {
+ // http://newandroidbook.com/ddb/
+ ffSettingsGetAndroidProperty("ro.product.device", &host->family);
+
+ ffSettingsGetAndroidProperty("ro.product.marketname", &host->name) || ffSettingsGetAndroidProperty("ro.vendor.product.display", &host->name) || ffSettingsGetAndroidProperty("ro.vivo.market.name", &host->name) || ffSettingsGetAndroidProperty("ro.product.oppo_model", &host->name) || ffSettingsGetAndroidProperty("ro.oppo.market.name", &host->name) || ffSettingsGetAndroidProperty("ro.vendor.oplus.market.enname", &host->name) || ffSettingsGetAndroidProperty("ro.config.devicename", &host->name) || ffSettingsGetAndroidProperty("ro.config.marketing_name", &host->name) || ffSettingsGetAndroidProperty("ro.product.vendor.model", &host->name) || ffSettingsGetAndroidProperty("ro.product.brand", &host->name);
+
+ if (ffSettingsGetAndroidProperty("ro.product.model", &host->version)) {
+ if (ffStrbufStartsWithIgnCase(&host->version, &host->name)) {
+ ffStrbufSubstrAfter(&host->version, host->name.length);
+ ffStrbufTrimLeft(&host->version, ' ');
+ }
+ }
+
+ ffSettingsGetAndroidProperty("ro.product.manufacturer", &host->vendor);
+
+ if (host->vendor.length && !ffStrbufStartsWithIgnCase(&host->name, &host->vendor)) {
+ ffStrbufPrependS(&host->name, " ");
+ ffStrbufPrepend(&host->name, &host->vendor);
+ }
+
+ return NULL;
+}