From 5e466e88df4abaac25922f4c2643559a4318b685 Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Mon, 14 Sep 2026 20:19:34 +0900 Subject: [PATCH 1/4] [in_app_purchase] Fix SSO result handling and vconf country code read Declare sso_get_login_info() with its actual SSORESULT (int) return type instead of bool, and compare against 0 explicitly so the success condition is readable. The previous bool typedef happened to work because -1 is truthy, but the declaration did not match the callee. Zero-initialize the login info struct and wipe it after use, since it carries the account password in plaintext while only uid is needed. The wipe writes through a volatile pointer; a plain memset is eliminated by the optimizer because the struct is dead afterwards. GetCountryCode() returned vconf_get_str()'s result without checking it, so a missing or unreadable db/comss/countrycode key constructed a std::string from nullptr and crashed. It also never freed the string, which vconf_get_str() hands to the caller, leaking on every call. Follow the pattern device_info_plus already uses for the same API. Load libvconf and libcapi-system-info by their major SONAME, matching the other plugins in this repository, so the lookup survives a platform library update. Drop the unused private system info keys and keep only the one key this plugin reads. --- packages/in_app_purchase/CHANGELOG.md | 6 +- packages/in_app_purchase/README.md | 2 +- packages/in_app_purchase/pubspec.yaml | 2 +- .../tizen/src/billing_manager.cc | 36 +++++--- .../tizen/src/billing_manager.h | 92 +------------------ 5 files changed, 34 insertions(+), 104 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index 47919423f..a6188e67b 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,5 +1,9 @@ -## NEXT +## 0.1.9 +* Fix the return type of `sso_get_login_info` and clear the login info after use. +* Fix a crash and a memory leak when reading the country code. +* Load `libvconf` and `libcapi-system-info` by their major SONAME. +* Remove unused private system info keys. * Resolve `unintended_html_in_doc_comment` lint. ## 0.1.8 diff --git a/packages/in_app_purchase/README.md b/packages/in_app_purchase/README.md index 26705f89e..879bba61f 100644 --- a/packages/in_app_purchase/README.md +++ b/packages/in_app_purchase/README.md @@ -35,7 +35,7 @@ This package is not an _endorsed_ implementation of `in_app_purchase`. Therefore ```yaml dependencies: in_app_purchase: ^3.3.0 - in_app_purchase_tizen: ^0.1.8 + in_app_purchase_tizen: ^0.1.9 ``` Then you can import `in_app_purchase` and `in_app_purchase_tizen` in your Dart code: diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 9a7d66089..94b873174 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_tizen description: Tizen implementation of the in_app_purchase plugin for Samsung Smart TV. homepage: https://github.com/flutter-tizen/plugins repository: https://github.com/flutter-tizen/plugins/tree/main/packages/in_app_purchase -version: 0.1.8 +version: 0.1.9 environment: sdk: ^3.10.0 diff --git a/packages/in_app_purchase/tizen/src/billing_manager.cc b/packages/in_app_purchase/tizen/src/billing_manager.cc index 04631695e..cacdfde41 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.cc +++ b/packages/in_app_purchase/tizen/src/billing_manager.cc @@ -8,6 +8,8 @@ #include #include +#include +#include #include #include #include @@ -63,10 +65,16 @@ std::string BillingManager::GetCustomId() { reinterpret_cast( dlsym(handle, "sso_get_login_info")); if (sso_get_login_info) { - sso_login_info_s login_info; - if (!sso_get_login_info(&login_info)) { + sso_login_info_s login_info = {}; + if (sso_get_login_info(&login_info) == 0) { custom_id = login_info.uid; } + // NOTE: written through volatile because a plain memset on a struct that + // is dead afterwards is dropped by the optimizer. + auto *bytes = reinterpret_cast(&login_info); + for (std::size_t i = 0; i < sizeof(login_info); ++i) { + bytes[i] = 0; + } } dlclose(handle); } @@ -74,25 +82,31 @@ std::string BillingManager::GetCustomId() { } std::string BillingManager::GetCountryCode() { - void *handle = dlopen("libvconf.so.0.3.1", RTLD_LAZY); - char *country_code = ""; + std::string country_code; + void *handle = dlopen("libvconf.so.0", RTLD_LAZY); if (!handle) { LOG_ERROR("[BillingManager] Fail to open vconf APIs."); - } else { - FuncVconfGetStr vconf_get_str = - reinterpret_cast(dlsym(handle, "vconf_get_str")); - if (vconf_get_str) { - country_code = vconf_get_str("db/comss/countrycode"); + return country_code; + } + FuncVconfGetStr vconf_get_str = + reinterpret_cast(dlsym(handle, "vconf_get_str")); + if (vconf_get_str) { + char *value = vconf_get_str("db/comss/countrycode"); + if (value) { + country_code = value; + free(value); + } else { + LOG_ERROR("[BillingManager] Fail to read db/comss/countrycode."); } - dlclose(handle); } + dlclose(handle); return country_code; } bool BillingManager::IsAvailable(FunctionResult result) { LOG_INFO("[BillingManager] Check billing server is available."); - void *handle = dlopen("libcapi-system-info.so.0.2.1", RTLD_LAZY); + void *handle = dlopen("libcapi-system-info.so.0", RTLD_LAZY); if (!handle) { LOG_ERROR("[BillingManager] Fail to open system APIs."); } else { diff --git a/packages/in_app_purchase/tizen/src/billing_manager.h b/packages/in_app_purchase/tizen/src/billing_manager.h index 7146f4353..2d54baa67 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.h +++ b/packages/in_app_purchase/tizen/src/billing_manager.h @@ -50,99 +50,11 @@ typedef enum { } system_info_error_e; typedef enum { - SYSTEM_INFO_KEY_NUM_OF_TUNER = 18, - SYSTEM_INFO_KEY_STAMRT_HUB_HBBTV_SUPPORTED = 41, - SYSTEM_INFO_KEY_SMART_LED_SUPPORTED = 56, - SYSTEM_INFO_KEY_KR_CABLE_QAM_SUPPORTED = 59, - SYSTEM_INFO_KEY_SMART_LED_DEMO_POSITION = 63, - SYSTEM_INFO_KEY_PANEL_SIZE = 69, - SYSTEM_INFO_KEY_PANEL_TYPE = 73, - SYSTEM_INFO_KEY_PANEL_TYPE_STRING = 74, - SYSTEM_INFO_KEY_LOCAL_SET = 90, - SYSTEM_INFO_KEY_WIFI_REGION = 109, - SYSTEM_INFO_KEY_NUM_OF_DTV = 110, - SYSTEM_INFO_KEY_NUM_OF_ATV = 112, - SYSTEM_INFO_KEY_NUM_OF_RVU = 121, - SYSTEM_INFO_KEY_NUM_OF_HDMI = 122, SYSTEM_INFO_KEY_INFO_LINK_SERVER_TYPE = 126, - SYSTEM_INFO_KEY_REGION_KIND = 127, - SYSTEM_INFO_KEY_SW_VERSION = 128, - SYSTEM_INFO_KEY_TUNER_TYPE = 131, - SYSTEM_INFO_KEY_VERSION_MICOM = 133, - SYSTEM_INFO_KEY_VERSION_EMANUAL = 138, - SYSTEM_INFO_KEY_AUTOSTORE = 174, - SYSTEM_INFO_KEY_SERIAL_NUMBER = 187, - SYSTEM_INFO_KEY_SW_VERSION_MODEL = 199, - SYSTEM_INFO_KEY_TARGET_LOCATION = 201, - SYSTEM_INFO_KEY_PANEL_VFREQ = 204, - SYSTEM_INFO_KEY_PANEL_ASPECT_RATIO = 205, - SYSTEM_INFO_KEY_VERSION_EPOP_APP = 209, - SYSTEM_INFO_KEY_VERSION_WIFI = 216, - SYSTEM_INFO_KEY_SATELLITE_MASK = 220, - SYSTEM_INFO_KEY_LANGUAGE_LIST = 227, - SYSTEM_INFO_KEY_USB_COPY_FORMAT_SUPPORTED = 236, - SYSTEM_INFO_KEY_NUM_OF_PVR_RECORD = 238, - SYSTEM_INFO_KEY_CERT_OPTION = 240, - SYSTEM_INFO_KEY_GET_JP_MIGRATION_BACKUP_SOURCE_PATH = 247, - SYSTEM_INFO_KEY_GET_JP_MIGRATION_RESTORE_SOURCE_PATH = 248, - SYSTEM_INFO_KEY_AUTOMOTIONPLUS_CLEAR_BLUR_SUPPORTED = 258, - SYSTEM_INFO_KEY_CHECK_SKIP_LOCALSET = 280, - SYSTEM_INFO_KEY_CHECK_WIFI_VENDOR = 281, - SYSTEM_INFO_KEY_LOCAL_SET_ENUM = 284, - SYSTEM_INFO_KEY_REGION_KIND_ENUM = 285, - SYSTEM_INFO_KEY_PRODUCT_CODE_SW = 291, - SYSTEM_INFO_KEY_PRODUCT_CODE_BOM = 292, - SYSTEM_INFO_KEY_ONTV_SUPPORTED = 304, - SYSTEM_INFO_KEY_HOTEL_TV_SUPPORTED = 315, - SYSTEM_INFO_KEY_ERROR_POPUP_ON_OFF = 320, - SYSTEM_INFO_KEY_TUNER_SHAPE = 325, - SYSTEM_INFO_KEY_PANEL_DEFAULT_VFREQ = 326, - SYSTIM_INFO_KEY_DTV_TYPE = 333, - SYSTEM_INFO_KEY_TUNER_SUP_EPOP = 342, - SYSTEM_INFO_KEY_CES_OPTION = 343, - SYSTEM_INFO_KEY_UPDATE_SUP_EMANUAL = 352, - SYSTEM_INFO_KEY_ENERGY_STAR_LOGO_SUPPORTED = 360, - SYSTEM_INFO_KEY_FHD_EVK_TV_YEAR = 362, - SYSTEM_INFO_KEY_TV_CURRENT_YEAR = 367, - SYSTEM_INFO_KEY_PC_DIMMING_SUPPORT = 370, - SYSTEM_INFO_KEY_EVK_SW_VERSION = 378, - SYSTEM_INFO_KEY_PNP_COUNTRY_LIST = 388, - SYSTEM_INFO_KEY_DIGITAL_COUNTRY_LIST = 389, - SYSTEM_INFO_KEY_ANALOG_COUNTRY_LIST = 390, - SYSTEM_INFO_KEY_VERSION_CAMERA = 457, - SYSTEM_INFO_KEY_VERSION_MIC = 458, - SYSTEM_INFO_KEY_ALWAYS_INSTANT_ON_SUPPORT = 466, - SYSTEM_INFO_KEY_APP_BOOTING_SUPPORT = 488, - SYSTEM_INFO_KEY_PNP_LANGUAGE_LIST = 498, - SYSTEM_INFO_KEY_MODEL_SERIES_INFO = 505, - SYSTEM_INFO_KEY_IOT_HUB_SUPPORTED = 510, - SYSTEM_INFO_KEY_DEFAULT_DIGITAL_COUNTRY = 511, - SYSTEM_INFO_KEY_DEFAULT_ANALOG_COUNTRY = 512, - SYSTEM_INFO_KEY_CH_MAP = 517, - SYSTEM_INFO_KEY_A_PICTURE_DIRECT = 518, - SYSTEM_INFO_KEY_MIN_BACKLIGHT = 532, - SYSTEM_INFO_KEY_CLOUD_SCAN_UPLOAD = 537, - SYSTEM_INFO_KEY_DEFAULT_HDMI_1_BOOTING = 538, - SYSTEM_INFO_KEY_PLATFORM_TYPE = 564, - SYSTEM_INFO_KEY_FRAME_TV = 583, - SYSTEM_INFO_KEY_360VR_SUPPORT = 589, - SYSTEM_INFO_KEY_DYNAMIC_CONTRAST = 590, - SYSTEM_INFO_KEY_RUN_EW = 600, - SYSTEM_INFO_KEY_EXHIBITION_MODE = 601, - SYSTEM_INFO_KEY_ATSC3_SUPPORTED = 604, - SYSTEM_INFO_KEY_PANEL_TIME = 605, - SYSTEM_INFO_KEY_CN_WEB_MODEL = 620, - SYSTEM_INFO_KEY_HOTEL_MIN_VOLUME = 645, - SYSTEM_INFO_KEY_HOTEL_MAX_VOLUME = 646, - SYSTEM_INFO_KEY_HOTEL_MODE = 647, - SYSTEM_INFO_KEY_HOTEL_POWER_ON_VOLUME = 648, - SYSTEM_INFO_KEY_NUM_OF_DISPLAY = 656, - SYSTEM_INFO_KEY_STD_HDR_BL = 668, - SYSTEM_INFO_KEY_HARDWARE_VERSION = 669, - SYSTEM_INFO_KEY_PANEL_TYPE_82INCH_SDC = 670, } system_info_key_e; -typedef bool (*FuncSsoGetLoginInfo)(sso_login_info_s *login_info); +// Returns SSORESULT: 0 on success, -1 on failure. +typedef int (*FuncSsoGetLoginInfo)(sso_login_info_s *login_info); typedef char *(*FuncVconfGetStr)(const char *in_key); typedef int (*FuncSystemInfGetValueInt)(system_info_key_e key, int *value); From 366f872faa508ff3a1ec0048734a21d54a7b9535 Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Mon, 14 Sep 2026 20:55:00 +0900 Subject: [PATCH 2/4] [in_app_purchase] Report an error when the SSO login info is unavailable GetCustomId() returned an empty string when libsso_api.so could not be opened, when the symbol was missing, or when sso_get_login_info() failed. The plugin passed that empty string to Dart as a successful result, so requestPurchases() computed its HMAC check value over the wrong string and called the billing server with an empty custom id, which fails server-side with no indication of the real cause. Return std::optional like device_info_plus does for the same kind of lookup, log each failure path, and surface a FlutterError to Dart. --- packages/in_app_purchase/CHANGELOG.md | 1 + .../tizen/src/billing_manager.cc | 43 +++++++++++-------- .../tizen/src/billing_manager.h | 3 +- .../tizen/src/in_app_purchase_tizen_plugin.cc | 6 ++- 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index a6188e67b..e747fbed2 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -2,6 +2,7 @@ * Fix the return type of `sso_get_login_info` and clear the login info after use. * Fix a crash and a memory leak when reading the country code. +* Report an error from `getCustomId` when the SSO login info is unavailable. * Load `libvconf` and `libcapi-system-info` by their major SONAME. * Remove unused private system info keys. * Resolve `unintended_html_in_doc_comment` lint. diff --git a/packages/in_app_purchase/tizen/src/billing_manager.cc b/packages/in_app_purchase/tizen/src/billing_manager.cc index cacdfde41..47be2eb13 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.cc +++ b/packages/in_app_purchase/tizen/src/billing_manager.cc @@ -55,29 +55,36 @@ bool BillingManager::Init() { return true; } -std::string BillingManager::GetCustomId() { +std::optional BillingManager::GetCustomId() { void *handle = dlopen("libsso_api.so", RTLD_LAZY); - std::string custom_id = ""; if (!handle) { LOG_ERROR("[BillingManager] Fail to open sso APIs."); - } else { - FuncSsoGetLoginInfo sso_get_login_info = - reinterpret_cast( - dlsym(handle, "sso_get_login_info")); - if (sso_get_login_info) { - sso_login_info_s login_info = {}; - if (sso_get_login_info(&login_info) == 0) { - custom_id = login_info.uid; - } - // NOTE: written through volatile because a plain memset on a struct that - // is dead afterwards is dropped by the optimizer. - auto *bytes = reinterpret_cast(&login_info); - for (std::size_t i = 0; i < sizeof(login_info); ++i) { - bytes[i] = 0; - } - } + return std::nullopt; + } + FuncSsoGetLoginInfo sso_get_login_info = + reinterpret_cast( + dlsym(handle, "sso_get_login_info")); + if (!sso_get_login_info) { + LOG_ERROR("[BillingManager] Fail to find the sso_get_login_info symbol."); dlclose(handle); + return std::nullopt; } + + std::optional custom_id; + sso_login_info_s login_info = {}; + int ret = sso_get_login_info(&login_info); + if (ret == 0) { + custom_id = login_info.uid; + } else { + LOG_ERROR("[BillingManager] Fail to get the login info. (%d)", ret); + } + // NOTE: written through volatile because a plain memset on a struct that + // is dead afterwards is dropped by the optimizer. + auto *bytes = reinterpret_cast(&login_info); + for (std::size_t i = 0; i < sizeof(login_info); ++i) { + bytes[i] = 0; + } + dlclose(handle); return custom_id; } diff --git a/packages/in_app_purchase/tizen/src/billing_manager.h b/packages/in_app_purchase/tizen/src/billing_manager.h index 2d54baa67..2a67c9f4f 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.h +++ b/packages/in_app_purchase/tizen/src/billing_manager.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -116,7 +117,7 @@ class BillingManager { bool VerifyInvoice(const char *app_id, const char *custom_id, const char *invoice_id, const char *country_code, FunctionResult result); - std::string GetCustomId(); + std::optional GetCustomId(); std::string GetCountryCode(); private: diff --git a/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc b/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc index 8a99da1dc..0ad51ac3e 100644 --- a/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc +++ b/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc @@ -168,7 +168,11 @@ void InAppPurchaseTizenPlugin::IsServiceAvailable( } ErrorOr InAppPurchaseTizenPlugin::GetCustomId() { - return billing_->GetCustomId(); + std::optional custom_id = billing_->GetCustomId(); + if (!custom_id.has_value()) { + return FlutterError("Operation failed", "get custom id failed"); + } + return *custom_id; } ErrorOr InAppPurchaseTizenPlugin::GetCountryCode() { From a60350a190b7374ab32dd2d0f43edd7b56502ab8 Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Mon, 14 Sep 2026 21:30:29 +0900 Subject: [PATCH 3/4] [in_app_purchase] Report an error when the country code is unavailable Apply the same fix to GetCountryCode() that the previous commit applied to GetCustomId(). An unreadable db/comss/countrycode key was logged but still returned to Dart as a successful empty string, which requestProducts() and requestPurchases() feed into the HMAC check value and send to the billing server, turning a local lookup failure into an opaque server-side error. Also log the missing-symbol path, which had no message. --- packages/in_app_purchase/CHANGELOG.md | 2 +- .../tizen/src/billing_manager.cc | 26 +++++++++++-------- .../tizen/src/billing_manager.h | 2 +- .../tizen/src/in_app_purchase_tizen_plugin.cc | 6 ++++- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index e747fbed2..2955aa8ba 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -2,7 +2,7 @@ * Fix the return type of `sso_get_login_info` and clear the login info after use. * Fix a crash and a memory leak when reading the country code. -* Report an error from `getCustomId` when the SSO login info is unavailable. +* Report an error from `getCustomId` and `getCountryCode` when the lookup fails. * Load `libvconf` and `libcapi-system-info` by their major SONAME. * Remove unused private system info keys. * Resolve `unintended_html_in_doc_comment` lint. diff --git a/packages/in_app_purchase/tizen/src/billing_manager.cc b/packages/in_app_purchase/tizen/src/billing_manager.cc index 47be2eb13..c329f458b 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.cc +++ b/packages/in_app_purchase/tizen/src/billing_manager.cc @@ -88,23 +88,27 @@ std::optional BillingManager::GetCustomId() { return custom_id; } -std::string BillingManager::GetCountryCode() { - std::string country_code; +std::optional BillingManager::GetCountryCode() { void *handle = dlopen("libvconf.so.0", RTLD_LAZY); if (!handle) { LOG_ERROR("[BillingManager] Fail to open vconf APIs."); - return country_code; + return std::nullopt; } FuncVconfGetStr vconf_get_str = reinterpret_cast(dlsym(handle, "vconf_get_str")); - if (vconf_get_str) { - char *value = vconf_get_str("db/comss/countrycode"); - if (value) { - country_code = value; - free(value); - } else { - LOG_ERROR("[BillingManager] Fail to read db/comss/countrycode."); - } + if (!vconf_get_str) { + LOG_ERROR("[BillingManager] Fail to find the vconf_get_str symbol."); + dlclose(handle); + return std::nullopt; + } + + std::optional country_code; + char *value = vconf_get_str("db/comss/countrycode"); + if (value) { + country_code = value; + free(value); + } else { + LOG_ERROR("[BillingManager] Fail to read db/comss/countrycode."); } dlclose(handle); return country_code; diff --git a/packages/in_app_purchase/tizen/src/billing_manager.h b/packages/in_app_purchase/tizen/src/billing_manager.h index 2a67c9f4f..4e7582b8d 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.h +++ b/packages/in_app_purchase/tizen/src/billing_manager.h @@ -118,7 +118,7 @@ class BillingManager { const char *invoice_id, const char *country_code, FunctionResult result); std::optional GetCustomId(); - std::string GetCountryCode(); + std::optional GetCountryCode(); private: static void OnProducts(const char *detail_result, void *user_data); diff --git a/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc b/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc index 0ad51ac3e..f9a29dba6 100644 --- a/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc +++ b/packages/in_app_purchase/tizen/src/in_app_purchase_tizen_plugin.cc @@ -176,7 +176,11 @@ ErrorOr InAppPurchaseTizenPlugin::GetCustomId() { } ErrorOr InAppPurchaseTizenPlugin::GetCountryCode() { - return billing_->GetCountryCode(); + std::optional country_code = billing_->GetCountryCode(); + if (!country_code.has_value()) { + return FlutterError("Operation failed", "get country code failed"); + } + return *country_code; } } // namespace in_app_purchase_tizen From f493f4fd606c095dcef712dabfb098366468935a Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Tue, 15 Sep 2026 11:20:55 +0900 Subject: [PATCH 4/4] [in_app_purchase] Use SSO_SUCCESS for the sso_get_login_info result SSO_SUCCESS is how the VD header spells the success value, so compare against it instead of a bare 0. --- packages/in_app_purchase/tizen/src/billing_manager.cc | 2 +- packages/in_app_purchase/tizen/src/billing_manager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/in_app_purchase/tizen/src/billing_manager.cc b/packages/in_app_purchase/tizen/src/billing_manager.cc index c329f458b..bee580e7b 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.cc +++ b/packages/in_app_purchase/tizen/src/billing_manager.cc @@ -73,7 +73,7 @@ std::optional BillingManager::GetCustomId() { std::optional custom_id; sso_login_info_s login_info = {}; int ret = sso_get_login_info(&login_info); - if (ret == 0) { + if (ret == SSO_SUCCESS) { custom_id = login_info.uid; } else { LOG_ERROR("[BillingManager] Fail to get the login info. (%d)", ret); diff --git a/packages/in_app_purchase/tizen/src/billing_manager.h b/packages/in_app_purchase/tizen/src/billing_manager.h index 4e7582b8d..7a140b7ce 100644 --- a/packages/in_app_purchase/tizen/src/billing_manager.h +++ b/packages/in_app_purchase/tizen/src/billing_manager.h @@ -19,6 +19,7 @@ #include "rapidjson/document.h" #define SSO_API_MAX_STRING_LEN 128 +#define SSO_SUCCESS 0 namespace in_app_purchase_tizen { @@ -54,7 +55,6 @@ typedef enum { SYSTEM_INFO_KEY_INFO_LINK_SERVER_TYPE = 126, } system_info_key_e; -// Returns SSORESULT: 0 on success, -1 on failure. typedef int (*FuncSsoGetLoginInfo)(sso_login_info_s *login_info); typedef char *(*FuncVconfGetStr)(const char *in_key); typedef int (*FuncSystemInfGetValueInt)(system_info_key_e key, int *value);