Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/device_info_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## NEXT

* Use wrapper API.


## 1.4.3

* Add `DeviceInfoPluginTizen.duid` to retrieve the device's DUID (Device Unique ID).
Expand Down
17 changes: 17 additions & 0 deletions packages/device_info_plus/tizen/inc/ftpw_device_info_plus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_TIZEN_PLUGINS_WRAPPER_DEVICE_INFO_PLUS_H_
#define FLUTTER_TIZEN_PLUGINS_WRAPPER_DEVICE_INFO_PLUS_H_

#ifdef __cplusplus
extern "C" {
#endif

char *ftpw_device_info_plus_get_duid(void);

#ifdef __cplusplus
}
#endif

#endif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions packages/device_info_plus/tizen/project_def.prop
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ USER_CPP_UNDEFS =
USER_INC_DIRS = inc src
USER_INC_FILES =
USER_CPP_INC_FILES =

# User libraries
USER_LIB_DIRS += lib/${BUILD_ARCH}
USER_LIBS += ftpw_device_info_plus
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

#include "device_info_plus_tizen_plugin.h"

#ifdef TV_PROFILE
#include <dlfcn.h>
#endif
#include <flutter/method_channel.h>
#include <flutter/plugin_registrar.h>
#include <flutter/standard_method_codec.h>
Expand All @@ -21,6 +18,7 @@
#include <optional>
#include <string>

#include "ftpw_device_info_plus.h"
#include "log.h"

namespace {
Expand All @@ -33,26 +31,9 @@ std::optional<std::string> GetDuid() {
#ifndef TV_PROFILE
return std::string();
#else
using FuncVconfGetStr = char *(*)(const char *);

void *handle = dlopen("libvconf.so.0", RTLD_LAZY);
if (!handle) {
LOG_ERROR("Failed to open libvconf.so.0.");
return std::nullopt;
}

auto vconf_get_str =
reinterpret_cast<FuncVconfGetStr>(dlsym(handle, "vconf_get_str"));
if (!vconf_get_str) {
LOG_ERROR("Failed to find the vconf_get_str symbol.");
dlclose(handle);
return std::nullopt;
}

char *value = vconf_get_str("db/comss/duid");
dlclose(handle);
char *value = ftpw_device_info_plus_get_duid();
if (!value) {
LOG_ERROR("Failed to read db/comss/duid.");
LOG_ERROR("Failed to read DUID.");
return std::nullopt;
}
std::string duid = value;
Expand Down
Loading