From: Kim Gunsoo Date: Wed, 17 Feb 2016 02:45:02 +0000 (+0900) Subject: Add check rule for is_support_debug_option(). X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fde83e2f5c3860174ccaab0232190b5e51ebabc1;p=sdk%2Ftools%2Fsdb.git Add check rule for is_support_debug_option(). - For 2.4 Emulator, Added check rule that the profile_command version is 4.0 or higher. Change-Id: I83cf2f160be412a17b1cba1e267c3b4d9162fcc3 Signed-off-by: Kim Gunsoo --- diff --git a/src/command_function.c b/src/command_function.c index d0697cf..df86a37 100644 --- a/src/command_function.c +++ b/src/command_function.c @@ -650,8 +650,43 @@ static int is_support_debug_option(void){ readx(fd, cap_buffer, len); sdb_close(fd); + /* This routine is temporarily coded in a state that the app + * protocol version design is not complete. + * To suppurt 2.3.1 WC payment, this logic MUST be still remained. + * This routine is also coded in sdblib. */ ret = match_capability_key_value(cap_buffer, "sdbd_rootperm", "disabled"); + if (ret == 1) { + return ret; + } + } + + /* This routine is temporarily coded in a state that the app + * protocol version design is not complete. + * To suppurt 2.4 Emulator, this logic MUST be still remained. + * This routine is also coded in sdblib. */ + /* try to check profile_command version */ + D("sdbd_rootperm is NOT available. try to check profile_command version\n"); + char buf[512] = {}; + + const char* SHELL_GET_PROFILE_VER_CMD ="shell:/usr/bin/profile_command getversion"; + fd = sdb_connect(SHELL_GET_PROFILE_VER_CMD); + + if(fd < 0) { + // default : not support -G option. + return -1; } + if (read_line(fd, buf, sizeof(buf)) > 0) { + int major = 0; + int minor = 0; + if (sscanf(buf, "%d.%d", &major, &minor) == 2) { + // major version number at least 4 + if (major >= 4) { + ret = 1; + } + } + } + sdb_close(fd); + return ret; }