From ff34c8091032b196a4fb1373f59d586e105d9663 Mon Sep 17 00:00:00 2001 From: Seunghwan Lee Date: Thu, 23 Aug 2012 17:02:17 +0900 Subject: [PATCH] remove drm_trusted --- packaging/msg-service.spec | 1 - utils/CMakeLists.txt | 2 +- utils/MsgDrmWrapper.cpp | 119 ------------------------------------- 3 files changed, 1 insertion(+), 121 deletions(-) diff --git a/packaging/msg-service.spec b/packaging/msg-service.spec index 2323e92..3955bab 100755 --- a/packaging/msg-service.spec +++ b/packaging/msg-service.spec @@ -19,7 +19,6 @@ BuildRequires: pkgconfig(db-util) BuildRequires: pkgconfig(devman_haptic) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(drm-client) -BuildRequires: pkgconfig(drm-trusted) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libsystemd-daemon) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 8cf91be..3fcb101 100755 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -41,7 +41,7 @@ INCLUDE_DIRECTORIES( ) INCLUDE(FindPkgConfig) -pkg_check_modules(utils_pkgs REQUIRED glib-2.0 vconf db-util contacts-service dlog pmapi mm-session alarm-service notification phone-misc drm-client drm-trusted) +pkg_check_modules(utils_pkgs REQUIRED glib-2.0 vconf db-util contacts-service dlog pmapi mm-session alarm-service notification phone-misc drm-client) FOREACH(flag ${utils_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/utils/MsgDrmWrapper.cpp b/utils/MsgDrmWrapper.cpp index 7e0b88b..248738d 100755 --- a/utils/MsgDrmWrapper.cpp +++ b/utils/MsgDrmWrapper.cpp @@ -32,8 +32,6 @@ #include #include #include -#include -#include #define MSG_MAX_DRM_FILE_PATH MSG_FILEPATH_LEN_MAX @@ -106,123 +104,6 @@ bool MsgDrmIsDrmFile(const char *szFilePath) /*Added to convert the .dm files in to .dcf files since our platform supports only .dcf :: Start*/ bool MsgDrmConvertDmtoDcfType(char *inputFile, char *outputFile) { - if ((NULL == inputFile) || (NULL == outputFile)) { - MSG_DEBUG("Invalid Input parameters"); - return false; - } - - if (strstr(inputFile, ".dm")) { - MSG_DEBUG("Current File extension is .dm %s", inputFile); - int ret; - - FILE *fp = MsgOpenFile(inputFile, "rb");//Check fp - - if (fp == NULL) { - MSG_DEBUG("[File Open Fail(Errno=%d)][ErrStr=%s]", errno, strerror(errno)); - strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH); - return false; - } - - if (MsgFseek(fp, 0L, SEEK_END) < 0) { - MsgCloseFile(fp); - MSG_DEBUG("MsgFseek() returns negative value!!!"); - return false; - } - long retVal = MsgFtell(fp); - - if (retVal < 0) { - MsgCloseFile(fp); - MSG_DEBUG("ftell() returns negative value: [%ld]!!!", retVal); - strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH); - return false; - } - - unsigned long bufLen = retVal; - MSG_DEBUG("fopen buffer len = %d", bufLen); - if (MsgFseek(fp, 0, SEEK_SET) < 0) { - MsgCloseFile(fp); - MSG_DEBUG("MsgFseek() returns negative value!!!"); - return false; - } - - unsigned char *buffer = (unsigned char*)malloc(bufLen); - int readed_size = 0; - int pathLen = strlen(inputFile); - - if (buffer == NULL) { - MsgCloseFile(fp); - MSG_DEBUG("malloc is failed "); - strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH); - return false; - } - - strncpy(outputFile, inputFile, pathLen - 2); - strncat(outputFile, "dcf", 3); - - readed_size = MsgReadFile(buffer, 1, bufLen, fp);//Check for error - MSG_DEBUG("fread read size = %d", readed_size); - if (readed_size == 0) { - MsgCloseFile(fp); - free(buffer); - MSG_DEBUG("MsgReadFile returns 0"); - return false; - } - - DRM_TRUSTED_CONVERT_HANDLE hConvert = NULL; - drm_trusted_opn_conv_info_s trusted_open_conv_input; - bzero(&trusted_open_conv_input, sizeof(drm_trusted_opn_conv_info_s)); - - strncpy(trusted_open_conv_input.filePath, outputFile, DRM_TRUSTED_MAX_FILEPATH_LEN-1); - trusted_open_conv_input.install_RO = DRM_TRUSTED_TRUE; - - ret = drm_trusted_open_convert(&trusted_open_conv_input, &hConvert); - if (ret != DRM_RETURN_SUCCESS) { - free(buffer); - MsgCloseFile(fp); - MSG_DEBUG("drm_trusted_open_convert() return = failed (%d)", ret); - strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH); - return false; - } - - drm_trusted_write_conv_info_s trusted_write_conv_input; - drm_trusted_write_conv_resp_s trusted_write_conv_output; - - bzero(&trusted_write_conv_input, sizeof(drm_trusted_write_conv_info_s)); - bzero(&trusted_write_conv_output, sizeof(drm_trusted_write_conv_resp_s)); - - trusted_write_conv_input.data = buffer; - trusted_write_conv_input.data_len = bufLen; - - /*We can call drm_trusted_write_convert in loop if file size is large*/ - ret = drm_trusted_write_convert(&trusted_write_conv_input, &trusted_write_conv_output, hConvert); - if (ret != DRM_RETURN_SUCCESS) { - free(buffer); - MsgCloseFile(fp); - MSG_DEBUG("drm_trusted_write_convert() return = failed (%d)", ret); - strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH); - return false; - } - - ret = drm_trusted_close_convert(&hConvert); - if (ret != DRM_RETURN_SUCCESS) { - free(buffer); - MsgCloseFile(fp); - MSG_DEBUG("drm_trusted_close_convert() return = failed (%d)", ret); - strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH); - return false; - } - - MsgCloseFile(fp); - free(buffer); - } else { - MSG_DEBUG("Current File extension is not .dm"); - - MSG_DEBUG("inputFile = (%s)", inputFile); - strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH); - - return false; - } - return true; } -- 2.34.1