SET(ETC_DIR ${PROJECT_SOURCE_DIR}/etc)
INSTALL(PROGRAMS ${ETC_DIR}/wrt_preinstall_widgets.sh DESTINATION /etc/rc.d/init.d)
-
-# Below Code is temporary. When DRM engine is provided it will be removed.
-IF("${ARCH}" MATCHES "arm")
- INSTALL(FILES ${ETC_DIR}/drm/armv7l/libdrm-service-core-intel.so.0.0.3 DESTINATION lib)
-ELSE("${ARCH}" MATCHES "arm")
- INSTALL(FILES ${ETC_DIR}/drm/ix86/libdrm-service-core-intel.so.0.0.3 DESTINATION lib)
-ENDIF("${ARCH}" MATCHES "arm")
+++ /dev/null
-libdrm-service-core-intel.so.0
\ No newline at end of file
+++ /dev/null
-libdrm-service-core-intel.so.0.0.3
\ No newline at end of file
+++ /dev/null
-libdrm-service-core-intel.so.0
\ No newline at end of file
+++ /dev/null
-libdrm-service-core-intel.so.0.0.3
\ No newline at end of file
BuildRequires: pkgconfig(shortcut)
BuildRequires: pkgconfig(dpl-encryption)
BuildRequires: pkgconfig(capi-appfw-app-manager)
-BuildRequires: pkgconfig(drm-client)
+BuildRequires: pkgconfig(drm-service-core-intel)
Requires: xmlsec1
-Provides: libdrm-service-core-intel.so.0
-
%description
Description: Wrt Installer for Tizen apps and Wac apps
%setup -q
%build
-# for drm temporary code
-%ifarch %{ix86}
-BUILD_ARCH_=x86
-%else
-BUILD_ARCH_=arm
-%endif
export LDFLAGS+="-Wl,--rpath=/usr/lib -Wl,--hash-style=both -Wl,--as-needed"
LDFLAGS="$LDFLAGS"
cmake . -DCMAKE_INSTALL_PREFIX=/usr \
-DDPL_LOG=ON \
-DCMAKE_PACKAGE_VERSION=%{version} \
- -DARCH="$BUILD_ARCH_" \
-DCMAKE_BUILD_TYPE=%{?build_type:%build_type}
make %{?jobs:-j%jobs}
ln -s /etc/rc.d/init.d/wrt_preinstall_widgets.sh /etc/rc.d/rc3.d/S46lwrt_preinstall_widgets.sh
ln -s /etc/rc.d/init.d/wrt_preinstall_widgets.sh /etc/rc.d/rc5.d/S46lwrt_preinstall_widgets.sh
-# for drm temporary code
-mkdir -p /opt/var/drm/inteldrm
-mkdir -p own 0:5000 /opt/var/drm/inteldrm
-chmod 755 /opt/var/drm/inteldrm
-
-[ -h /usr/lib/libdrm-service-core-intel.so.0 ] && rm /usr/lib/libdrm-service-core-intel.so.0
-[ -h /usr/lib/libdrm-service-core-intel.so ] && rm /usr/lib/libdrm-service-core-intel.so
-
-ln -s /usr/lib/libdrm-service-core-intel.so.0.0.3 /usr/lib/libdrm-service-core-intel.so.0
-ln -s /usr/lib/libdrm-service-core-intel.so.0 /usr/lib/libdrm-service-core-intel.so
-
# for downloadable Application icons path
mkdir -p /opt/share/icons/default/small
%attr(644,root,root) %{_datadir}/edje/wrt/*
/usr/etc/package-manager/backendlib/libwgt.so
%{_datadir}/license/%{name}
-# for drm temporary code
-/usr/lib/*.so*
${INSTALLER_SRC_DIR}/configuration_parser
${INSTALLER_SRC_DIR}/wrt-installer
${INSTALLER_SRC_DIR}/commons
- ${INSTALLER_SRC_DIR}/commons/drm #this is temporary code for drm
${INSTALLER_SRC_DIR}/pkg-manager
)
tapi
shortcut
capi-appfw-app-manager
- drm-client
+ drm-service-core-intel
REQUIRED
)
${INSTALLER_STATIC_DEP_LIBRARIES} "-ldl"
)
-
-# Below Code is temporary. When DRM engine is provided it will be removed.
-MESSAGE("ARCH ${ARCH}")
-IF("${ARCH}" MATCHES "arm")
- TARGET_LINK_LIBRARIES(${TARGET_INSTALLER_STATIC}
- "-L${PROJECT_SOURCE_DIR}/etc/drm/armv7l -ldrm-service-core-intel" -Wl,--allow-shlib-undefine)
-ELSE("${ARCH}" MATCHES "arm")
- TARGET_LINK_LIBRARIES(${TARGET_INSTALLER_STATIC}
- "-L${PROJECT_SOURCE_DIR}/etc/drm/ix86 -ldrm-service-core-intel" -Wl,--allow-shlib-undefine)
-ENDIF("${ARCH}" MATCHES "arm")
-
-SET_TARGET_PROPERTIES(${TARGET_INSTALLER_STATIC} PROPERTIES
- COMPILE_FLAGS -fPIC)
-
ADD_SUBDIRECTORY(pkg-manager)
ADD_SUBDIRECTORY(wrt-installer)
+++ /dev/null
-\r
-/********************************************************************************\r
-* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
-* All rights reserved. * \r
-* * \r
-* No parts of this source code may be in any way copied, reproduced, modified *\r
-* or distributed without the prior written consent of INKA Entworks, Inc. *\r
-* CPointerArray.h: interface for the CPointerArray class. *\r
-*********************************************************************************/ \r
-\r
-#ifndef __CPOINTERARRAY_H__\r
-#define __CPOINTERARRAY_H__\r
-\r
-\r
-#if !defined(AFX_CPOINTERARRAY_H__AB67E4BE_A233_4E3E_B257_9830D90326EE__INCLUDED_)\r
-#define AFX_CPOINTERARRAY_H__AB67E4BE_A233_4E3E_B257_9830D90326EE__INCLUDED_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif // _MSC_VER > 1000\r
-\r
-//#include "Shp.h"\r
-#include "InkaTypes.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif /* __cplusplus */\r
-\r
-class CPointerArray \r
-{\r
-protected:\r
- LPVOID* m_ppData;\r
- int m_nMaxSize;\r
- int m_nNumOfData;\r
-\r
-public:\r
- CPointerArray();\r
- virtual ~CPointerArray();\r
-\r
- int Add( LPVOID pData );\r
- int Remove( int nIndex );\r
- LPVOID Get( int nIndex );\r
- inline int GetCount() { return m_nNumOfData; }\r
- inline void RemoveAll() { m_nNumOfData = 0; }\r
-};\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif /* __cplusplus */\r
-\r
-#endif // !defined(AFX_CPOINTERARRAY_H__AB67E4BE_A233_4E3E_B257_9830D90326EE__INCLUDED_)\r
-#endif /* __CPOINTERARRAY_H__ */\r
+++ /dev/null
-\r
-/********************************************************************************\r
-* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
-* All rights reserved. * \r
-* * \r
-* No parts of this source code may be in any way copied, reproduced, modified *\r
-* or distributed without the prior written consent of INKA Entworks, Inc. *\r
-* CXMLAttribute.h: interface for the CXMLAttribute class. *\r
-*********************************************************************************/ \r
-//#include "Shp.h"\r
-#include "InkaTypes.h"\r
-\r
-#if !defined(AFX_CXMLATTRIBUTE_H__2B925786_3613_47B0_B85D_CAF2053F46DB__INCLUDED_)\r
-#define AFX_CXMLATTRIBUTE_H__2B925786_3613_47B0_B85D_CAF2053F46DB__INCLUDED_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif // _MSC_VER > 1000\r
-\r
-class CXMLAttribute \r
-{\r
-protected:\r
- LPTSTR m_pszName;\r
- LPTSTR m_pszValue;\r
-\r
-public:\r
- CXMLAttribute();\r
- virtual ~CXMLAttribute();\r
-\r
- int SetName( LPCTSTR pszName );\r
- int SetValue( LPCTSTR pszValue );\r
-\r
- inline LPCTSTR GetName() { return m_pszName; }\r
- inline LPCTSTR GetValue() { return m_pszValue; }\r
-};\r
-\r
-#endif // !defined(AFX_CXMLATTRIBUTE_H__2B925786_3613_47B0_B85D_CAF2053F46DB__INCLUDED_)\r
+++ /dev/null
-\r
-/********************************************************************************\r
-* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
-* All rights reserved. * \r
-* * \r
-* No parts of this source code may be in any way copied, reproduced, modified *\r
-* or distributed without the prior written consent of INKA Entworks, Inc. *\r
-* CXMLElement.h: interface for the CXMLElement class. *\r
-*********************************************************************************/ \r
-\r
-#if !defined(AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_)\r
-#define AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_\r
-\r
-//#include "Shp.h"\r
-#include "InkaTypes.h"\r
-#include "CXMLAttribute.h"\r
-#include "CPointerArray.h"\r
-\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif // _MSC_VER > 1000\r
-\r
-class CXMLElement \r
-{\r
-protected:\r
- LPTSTR m_pszName;\r
- LPTSTR m_pszValue;\r
- \r
- CPointerArray m_pChilds;\r
- CPointerArray m_pAttributes;\r
- \r
- int _SearchNodes( CPointerArray* ppaChildNodes, CXMLElement* pCurrent, LPCTSTR pszTagName, va_list args );\r
-\r
-public:\r
- CXMLElement();\r
- virtual ~CXMLElement();\r
-\r
- int SetName( LPCTSTR pszName );\r
- int SetValue( LPCTSTR pszValue );\r
- int AddAttribute( LPCTSTR pszName, LPCTSTR pszValue );\r
-\r
- inline LPCTSTR GetName() { return m_pszName; }\r
- inline LPCTSTR GetValue() { return m_pszValue; }\r
-\r
- int AddChild( CXMLElement* pChild );\r
- LPCTSTR GetAttribute( LPCTSTR pszName );\r
-\r
- inline int GetChildCount() { return m_pChilds.GetCount(); }\r
- inline int GetAttributeCount() { return m_pAttributes.GetCount(); }\r
- inline CXMLElement* GetChild( int nIndex ) { return (CXMLElement*)m_pChilds.Get( nIndex ); }\r
- inline CXMLAttribute* GetAttribute( int nIndex ) { return (CXMLAttribute*)m_pAttributes.Get( nIndex ); }\r
-\r
- int Find( CPointerArray* pSearchedChild, LPCTSTR pszChildName, ... );\r
-};\r
-\r
-#endif // !defined(AFX_CXMLELEMENT_H__B6A6A39B_1980_4A4F_B68B_E87B53A3EE9B__INCLUDED_)\r
+++ /dev/null
-\r
-/********************************************************************************\r
-* Copyright ? 2004-2009 by INKA Entworks, Inc (www.inka.co.kr). *\r
-* All rights reserved. * \r
-* * \r
-* No parts of this source code may be in any way copied, reproduced, modified *\r
-* or distributed without the prior written consent of INKA Entworks, Inc. *\r
-* CXMLFile.h: interface for the CXMLFile class. *\r
-*********************************************************************************/ \r
-\r
-#if !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)\r
-#define AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_\r
-\r
-//#include "Shp.h"\r
-#include "InkaTypes.h"\r
-#include "CXMLElement.h"\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif // _MSC_VER > 1000\r
-\r
-#ifndef IN\r
- #define IN\r
-#endif\r
-\r
-#ifndef OUT\r
- #define OUT\r
-#endif\r
-\r
-#define ELEMENT_QUEUE_MAX 2048\r
-class CXMLFile \r
-{\r
-protected:\r
- LPCTSTR m_pszXML;\r
- CXMLElement* m_paElementQueue[ ELEMENT_QUEUE_MAX ];\r
- int m_nQueueIndex;\r
- CXMLElement* m_pRoot;\r
- \r
- int _Parse();\r
- int _GetElementName( LPTSTR pszElementName );\r
- CXMLElement* _Pop();\r
- int _Push( CXMLElement* p );\r
- int _GetAttributeNameAndValue( LPTSTR pszName, LPTSTR pszValue );\r
-\r
-public:\r
- CXMLFile();\r
- virtual ~CXMLFile();\r
-\r
- int LoadFromStream( LPCTSTR pszXML );\r
- int LoadFromFile( LPCTSTR pszFileName );\r
- inline CXMLElement* GetRoot() { return m_pRoot; }\r
-};\r
-\r
-#endif // !defined(AFX_CXMLFILE_H__21F76587_B9C8_4407_9C16_186F3D47ADE1__INCLUDED_)\r
+++ /dev/null
-/*\r
- * SHP\r
- * Copyright (c) 2000-2007 UMTS Software Lab, Mobile Communication Division,\r
- * Telecommunication Network Business, Samsung Electronics, Inc.\r
- * All rights reserved.\r
- *\r
- * This software is the confidential and proprietary information\r
- * of Samsung Electronics, Inc. ("Confidential Information"). You\r
- * shall not disclose such Confidential Information and shall use\r
- * it only in accordance with the terms of the license agreement\r
- * you entered into with Samsung Electronics. \r
- */\r
-\r
-/** \r
- * @file InkaTypes.h\r
- * @brief This file includes definitions of constants, \r
- * enumerations, and datastructures for the Inka DRM service.\r
-# @author Jihyun Lee(ezhyun.lee@samsung.com)\r
-# @author Donghyun Yoo(marku.yoo@samsung.com)\r
- * @version 1.0\r
- */\r
-\r
-#ifndef INKA_DRM_TYPES_H\r
-#define INKA_DRM_TYPES_H\r
-\r
-//#include "shp.h"\r
-//#include "FileMgr.h"\r
-#include <stdio.h>\r
-#include <stdarg.h>\r
-\r
-#define _T\r
-#define IF_ERROR_GOTO( error ) if( FAILED( HRESULT_FROM_WIN32( error ) ) ) { nResult = ERRORMSG( error, NULL ); goto finish; }\r
-#define IF_TRUE_GOTO( cond, error ) if( cond ) { nResult = -1; goto finish; }\r
-\r
-#if defined(_WIN32) || defined(_WIN64) \r
- #define snprintf _snprintf \r
- #define vsnprintf _vsnprintf \r
- #define strcasecmp _stricmp \r
- #define strncasecmp _strnicmp \r
-#endif\r
-\r
-#ifndef _SHP_SIMUL\r
-typedef void* LPVOID;\r
-typedef const char* LPCTSTR;\r
-typedef unsigned char* LPBYTE;\r
-typedef char TCHAR;\r
-typedef char* LPTSTR;\r
-typedef LPTSTR LPSTR;\r
-typedef LPCTSTR LPCTSTR;\r
-typedef LPCTSTR LPCSTR;\r
-\r
-#define DWORD unsigned long\r
-#define LPBYTE unsigned char*\r
-#define BYTE unsigned char\r
-#define UINT unsigned int\r
-#define ULONG unsigned long\r
-#define INT32 long\r
-#define INT64 long long\r
-#define TRUE 1\r
-#define FALSE 0\r
-\r
-\r
-typedef char CHAR;\r
-typedef bool BOOL;\r
-\r
-\r
-//typedef HFile HANDLE;\r
-#define ERROR_INVALID_DATA 13L\r
-#define ERROR_INSUFFICIENT_BUFFER 122L // dderror\r
-//#define CopyMemory AcMemcpy\r
-#define INVALID_HOBJ NULL\r
-\r
-#endif\r
-\r
-\r
-#endif //INKA_DRM_TYPES_H\r
+++ /dev/null
-//typedef char CHAR;\r
-//typedef bool BOOL;\r
-\r
-typedef struct t_cek\r
-{\r
- char *CID; // Content ID ¹öÆÛ Æ÷ÀÎÅÍ\r
- char *CEK; // Content Encryption Key ¹öÆÛ Æ÷ÀÎÅÍ\r
- char *EncryptionMethod; // CEK ¾Ë°í¸®Áò\r
-}T_CEK;\r
-\r
-typedef struct t_dro\r
-{\r
- char *CID; // Content ID ¹öÆÛ Æ÷ÀÎÅÍ\r
- char *deviceId; // »ç¿ëÀÚ ½Äº° ¹ÙÀεù. IMEI, MIN °ª ¹ÙÀεù Á¦¾î\r
- char *digestValue; // »ç¿ëÀÚ ½Äº° ¹ÙÀεù. IMEI, MIN °ª ¹ÙÀεù Á¦¾î\r
- char *signedValue; // »ç¿ëÀÚ ½Äº° ¹ÙÀεù. IMEI, MIN °ª ¹ÙÀεù Á¦¾î\r
- char *cert; // »ç¿ëÀÚ ½Äº° ¹ÙÀεù. IMEI, MIN °ª ¹ÙÀεù Á¦¾î\r
- int Count; // »ç¿ë ȸ¼ö\r
- char *CreatedTimestamp; // »ç¿ë °¡´É ½ÃÀÛ ÀϽà ¹öÆÛ Æ÷ÀÎÅÍ. GMT Ç¥±â\r
- char *ExpiredTimeStamp; // »ç¿ë °¡´É ¸¸±â ÀϽà ¹öÆÛ Æ÷ÀÎÅÍ. GMT Ç¥±â\r
- char *ExpirationDate; // ÃÖÃÊ »ç¿ë ÀÌÈÄ »ç¿ë °¡´É ½Ã°£. ½Ã°£ ´ÜÀ§ \r
-}T_DRO;\r
-\r
-typedef struct t_dcf_file_header\r
-{\r
- unsigned char Version;\r
- unsigned char ContentTypeLen;\r
- unsigned char ContentURILen;\r
- char *ContentType;\r
- char *ContentURI;\r
- unsigned int HeadersLen;\r
- unsigned int DataLen;\r
- char *Headers;\r
- unsigned int DataOffset;\r
-}T_DCF_FILE_HEADER;\r
-\r
-// DRO Value size\r
-#define APPID_SIZE 16\r
-#define CEK_SIZE 512\r
-#define ENCRYPTION_METHOD_SIZE 512\r
-#define DEVICEID_SIZE 256\r
-#define TIMESTAMP_SIZE 256\r
-#define DIGESTVALUE_SIZE 256\r
-#define SIGNATUREVALUE_SIZE 1024\r
-#define CERT_SIZE 1024 * 4\r
-#define AES_BLOCK_SIZE 16\r
+++ /dev/null
-#include "InkaTypes.h"\r
-//#include "IntelDrm_Core.h"\r
-\r
-#include "stdlib.h"\r
-#include "string.h"\r
-#include "stdio.h"\r
-\r
-#define AES_BLOCK_SIZE 16\r
-\r
-LPSTR Base64Encode(LPBYTE pbData, int nLength);\r
-LPBYTE Base64Decode(LPCSTR pszString, int* pnLength);\r
-\r
-int decrypt_block(unsigned char *iv, unsigned char *cipherText, int cipherTextLen, unsigned char *cek, int cekLen, unsigned char *plainText);\r
+++ /dev/null
-#include "CPointerArray.h"\r
-#include "CXMLAttribute.h"\r
-#include "CXMLElement.h"\r
-#include "CXMLFile.h"\r
-#include "InkaTypes.h"\r
-#include "IntelDrm_Core.h"\r
-#include "drm-intel-crypto-util.h"\r
-\r
-#include "stdlib.h"\r
-#include "string.h"\r
-#include "stdio.h"\r
-\r
-/** \r
- * An application can parse CEK XML Foramt.\r
- * \r
- * @param[in] pszXML Data String of the CEK information\r
- * @param[out] t_cek parsing result to be saved\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int parse_intel_cek(const char* pszXML, T_CEK* t_cek);\r
-\r
-/** \r
- * An application can parse DRO XML Foramt.\r
- * \r
- * @param[in] pszXML Data String of the DRO information\r
- * @param[out] t_cek parsing result to be saved\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int parse_intel_dro(const char* pszXML, T_DRO* t_RO);\r
-\r
-int parse_intel_dro2(const char* pszXML, T_DRO* t_RO);\r
-\r
-/** \r
- * An application can parse stored dro.\r
- * \r
- * @param[in] pFilepath file path of the internal dro\r
- * @param[out] t_ro parsing result to be saved\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int get_internal_dro(char *pFilepath, T_DRO* t_ro);\r
-\r
-/** \r
- * An application can parse stored cek.\r
- * \r
- * @param[in] pFilepath file path of the internal cek\r
- * @param[out] t_cek parsing result to be saved\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int get_internal_cek(char *pFilepath, T_CEK* t_cek);\r
-\r
-int delete_internal_cek(char *pAppId);\r
-\r
-int get_dcf_header_info(char *pFilePath, T_DCF_FILE_HEADER *pTdcfHeader);\r
-\r
-bool get_Uintvar(unsigned int *nValue, FILE *pFile);\r
-\r
-int decrypt_package(char *pDcfPath, char *pDecryptedFilePath, unsigned char *pCEK, int cekLen, T_DCF_FILE_HEADER *t_dcf_header);\r
+++ /dev/null
-/*\r
- * drm-intel\r
- *\r
- * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: Sunggun Jung <sunggun.jung@samsung.com>\r
- * \r
- * This library is free software; you can redistribute it and/or modify it under\r
- * the terms of the GNU Lesser General Public License as published by the\r
- * Free Software Foundation; either version 2.1 of the License, or (at your option)\r
- * any later version.\r
- * \r
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY\r
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\r
- * License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public License\r
- * along with this library; if not, write to the Free Software Foundation, Inc., 51\r
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
- *\r
- */\r
-\r
-/**\r
-* @internal\r
-* @defgroup DRM-INTEL drm-intel\r
-* @{ \r
-*/\r
-#include "drm-intel-util.h"\r
-//#include "drm-intel-crypto-util.h"\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <string.h>\r
-\r
-/** \r
- * An application can install Intel DRM license(DRO).\r
- * \r
- * @param[in] pDroXML Data String of the Rights Request\r
- * @param[in] droBufLen pDroXML Length\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int drm_oem_intel_install_license(char *pDroXML, int droBufLen);\r
-\r
-/** \r
- * An application can uninstall Intel DRM license(DRO).\r
- * \r
- * @param[in] pAppId App-id of the rigths which want to un-install\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int drm_oem_intel_uninstall_license(char *pAppId);\r
-\r
-/** \r
- * An application can install CEK(Contents Encryption Key).\r
- * \r
- * @param[in] pCekXML Data String of the Rights Request\r
- * @param[in] cekBufLen pDroXML Length\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int drm_oem_intel_install_cek(char *pCekXML, int cekBufLen);\r
-\r
-/** \r
- * An application can get decrypted contents(Apps) which is encrypted\r
- * \r
- * @param[in] pDcfPath Intel DRM Package File Path \r
- * @param[in] pDecryptedFile Decrypted File Path\r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see\r
- * @since\r
- */\r
-int drm_oem_intel_decrypt_package(char *pDcfPath, char *pDecryptedFile);\r
-\r
-/** \r
- * An application can get informations of rights (DRO).\r
- * \r
- * @param[in] pAppId App-id of the rights which want to know\r
- * @param[out] pDro The rights information about the app-id\r
- * @return This function can return any of the following codes\r
- * DRM_INTEL_SUCCESS = 0 <success \r
- * DRM_INTEL_LIC_VALID = 1 <License is valid \r
- * DRM_INTEL_LIC_SUSPEND = 2 <License is valid but for future use \r
- * DRM_INTEL_INVALID_ARG = -1000 <invalid argument\r
- * DRM_INTEL_PARSING_ERROR = -999 <parsing contents or rights error\r
- * DRM_INTEL_DB_ERROR = -998 <data base error \r
- * DRM_INTEL_INSUFFICIENT_MEMORY = -997 <memory error \r
- * DRM_INTEL_INTERNAL_ERROR = -996 <processing error\r
- * DRM_INTEL_FILE_ERROR = -995 <file error\r
- * DRM_INTEL_LIC_EXPIRED_DATETIME = -994 <Datetime License is expired\r
- * DRM_INTEL_LIC_EXPIRED_COUNT = -993 <Count License is expired \r
- * DRM_INTEL_LIC_NO_LICENCE = -992 <No License\r
- * DRM_INTEL_LIC_IMEI_MISMATCH = -991 <IMEI is mismatching \r
- * DRM_INTEL_LIC_PNUM_MISMATCH = -990 <PNUM is mismatching \r
- * DRM_INTEL_UNKNOWN_ERROR = -1 <dummy error value\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int drm_oem_intel_getLicenseInfo(char *pAppId, T_DRO *pDro);\r
-\r
-/** \r
- * An application can get informations of rights (DRO).\r
- * \r
- * @param[in] pAppId App-id of the rights which want to know\r
- * @return This function can return any of the following codes\r
- * DRM_INTEL_SUCCESS = 0 <success \r
- * DRM_INTEL_LIC_VALID = 1 <License is valid \r
- * DRM_INTEL_LIC_SUSPEND = 2 <License is valid but for future use \r
- * DRM_INTEL_INVALID_ARG = -1000 <invalid argument\r
- * DRM_INTEL_PARSING_ERROR = -999 <parsing contents or rights error\r
- * DRM_INTEL_DB_ERROR = -998 <data base error \r
- * DRM_INTEL_INSUFFICIENT_MEMORY = -997 <memory error \r
- * DRM_INTEL_INTERNAL_ERROR = -996 <processing error\r
- * DRM_INTEL_FILE_ERROR = -995 <file error\r
- * DRM_INTEL_LIC_EXPIRED_DATETIME = -994 <Datetime License is expired\r
- * DRM_INTEL_LIC_EXPIRED_COUNT = -993 <Count License is expired \r
- * DRM_INTEL_LIC_NO_LICENCE = -992 <No License\r
- * DRM_INTEL_LIC_IMEI_MISMATCH = -991 <IMEI is mismatching \r
- * DRM_INTEL_LIC_PNUM_MISMATCH = -990 <PNUM is mismatching \r
- * DRM_INTEL_UNKNOWN_ERROR = -1 <dummy error value \r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int drm_oem_intel_consume_license(char *pAppID);\r
-\r
-/** \r
- * An application can veify the app's rights.\r
- * \r
- * @param[in] pAppId App-id of the rights which want to know\r
- * @return This function can return any of the following codes\r
- * DRM_INTEL_SUCCESS = 0 <success \r
- * DRM_INTEL_LIC_VALID = 1 <License is valid \r
- * DRM_INTEL_LIC_SUSPEND = 2 <License is valid but for future use \r
- * DRM_INTEL_INVALID_ARG = -1000 <invalid argument\r
- * DRM_INTEL_PARSING_ERROR = -999 <parsing contents or rights error\r
- * DRM_INTEL_DB_ERROR = -998 <data base error \r
- * DRM_INTEL_INSUFFICIENT_MEMORY = -997 <memory error \r
- * DRM_INTEL_INTERNAL_ERROR = -996 <processing error\r
- * DRM_INTEL_FILE_ERROR = -995 <file error\r
- * DRM_INTEL_LIC_EXPIRED_DATETIME = -994 <Datetime License is expired\r
- * DRM_INTEL_LIC_EXPIRED_COUNT = -993 <Count License is expired \r
- * DRM_INTEL_LIC_NO_LICENCE = -992 <No License\r
- * DRM_INTEL_LIC_IMEI_MISMATCH = -991 <IMEI is mismatching \r
- * DRM_INTEL_LIC_PNUM_MISMATCH = -990 <PNUM is mismatching \r
- * DRM_INTEL_UNKNOWN_ERROR = -1 <dummy error value \r
-\r
- * @remarks \r
- * @see \r
- * @since \r
- */\r
-int drm_oem_intel_has_valid_license(char *pAppID);\r
-\r
-/** \r
- * An application can check the file is drm enabled or not\r
- * \r
- * @param[in] pDcfPath The file path which want to check \r
- * @return This function returns 1 on success or 0 on failure.\r
- * @remarks \r
- * @see\r
- * @since\r
- */\r
-int drm_oem_intel_isDrmFile(char *pDcfPath);\r
#include <libiriwrapper.h>
#include <pkg-manager/pkgmgr_signal.h>
#include <app_manager.h>
-#include <drm_client.h>
+//#include <drm_client.h>
#include <drm-oem-intel.h> //temporary code
#include "root_parser.h"
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * @file widget_unzip.cpp
- * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version 1.0
- * @brief Implementation file for installer task unzip
- */
-#include <widget_install/widget_unzip.h>
-#include <widget_install/widget_install_errors.h>
-#include <widget_install/widget_install_context.h>
-#include <widget_install/job_widget_install.h>
-#include <dpl/log/log.h>
-#include <dpl/copy.h>
-#include <dpl/file_output.h>
-#include <dpl/abstract_waitable_input_adapter.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-#include <task_commons.h>
-#include <sys/stat.h>
-#include <drm_trusted_client.h>
-
-using namespace WrtDB;
-
-namespace {
-struct PathAndFilePair
-{
- std::string path;
- std::string file;
-
- PathAndFilePair(const std::string &p,
- const std::string &f) :
- path(p),
- file(f)
- {
- }
-};
-
-PathAndFilePair SplitFileAndPath(const std::string &filePath)
-{
- std::string::size_type position = filePath.rfind('/');
-
- // Is this only a file without a path ?
- if (position == std::string::npos) {
- return PathAndFilePair(std::string(), filePath);
- }
-
- // This is full file-path pair
- return PathAndFilePair(filePath.substr(0,
- position),
- filePath.substr(position + 1));
-}
-}
-
-namespace Jobs {
-namespace WidgetInstall {
-WidgetUnzip::WidgetUnzip(std::string source, std::string path) :
- m_source(source),
- m_destPath(path)
-{
- LogDebug("WidgetUnzip");
-}
-
-void WidgetUnzip::ExtractFile(DPL::ZipInput::File *input,
- const std::string &destFileName)
-{
- Try
- {
- DPL::AbstractWaitableInputAdapter inputAdapter(input);
- DPL::FileOutput output(destFileName);
-
- DPL::Copy(&inputAdapter, &output);
- }
- Catch(DPL::FileOutput::Exception::OpenFailed)
- {
- ReThrowMsg(Exceptions::ExtractFileFailed, destFileName);
- }
- Catch(DPL::CopyFailed)
- {
- ReThrowMsg(Exceptions::ExtractFileFailed, destFileName);
- }
-}
-
-void WidgetUnzip::UnzipWidget()
-{
- UnzipPrepare();
- UnzipProgress();
-}
-
-void WidgetUnzip::UnzipPrepare()
-{
- LogInfo("Prepare to unzip...");
-
- Try
- {
- m_zip.reset(new DPL::ZipInput(m_source));
- LogInfo("Widget package comment: " << m_zip->GetGlobalComment());
-
- // Widget package must not be empty
- if (m_zip->empty()) {
- ThrowMsg(Exceptions::ZipEmpty, m_source);
- }
-
- // Set iterator to first file
- m_zipIterator = m_zip->begin();
- }
- Catch(DPL::ZipInput::Exception::OpenFailed)
- {
- ReThrowMsg(Exceptions::OpenZipFailed, m_source);
- }
-}
-
-void WidgetUnzip::UnzipProgress()
-{
-
- // Show file info
- LogInfo("Unzipping: '" << m_zipIterator->name <<
- "', Comment: '" << m_zipIterator->comment <<
- "', Compressed size: " << m_zipIterator->compressedSize <<
- ", Uncompressed size: " << m_zipIterator->uncompressedSize);
-
-
- // Normalize file paths
- // FIXME: Implement checking for invalid characters
-
- // Extract file or path
- std::string fileName = m_zipIterator->name;
-
- if (fileName[fileName.size() - 1] == '/') {
- // This is path
- std::string newPath = m_destPath + "/" +
- fileName.substr(0, fileName.size() - 1);
- LogPedantic("Path to extract: " << newPath);
-
- // Create path in case of it is empty
- createTempPath(newPath);
- } else {
- // This is regular file
- std::string fileExtractPath = m_destPath + "/" + fileName;
-
- LogPedantic("File to extract: " << fileExtractPath);
-
- // Split into pat & file pair
- PathAndFilePair pathAndFile = SplitFileAndPath(fileExtractPath);
-
- LogPedantic("Path and file: " <<
- pathAndFile.path <<
- " : " << pathAndFile.file);
-
- // First, ensure that path exists
- createTempPath(pathAndFile.path);
-
- Try
- {
- // Open file
- std::unique_ptr<DPL::ZipInput::File> file(
- m_zip->OpenFile(fileName));
-
- // Extract single file
- ExtractFile(file.get(), fileExtractPath);
- }
- Catch(DPL::ZipInput::Exception::OpenFileFailed)
- {
- ThrowMsg(Exceptions::ExtractFileFailed, fileName);
- }
- }
-
- // Check whether there are more files to extract
- if (++m_zipIterator == m_zip->end()) {
- LogInfo("Unzip progress finished successfuly");
- m_zip.reset();
- } else {
- UnzipProgress();
- }
-}
-
-void WidgetUnzip::UnzipDRMWidget()
-{
- LogDebug("Decrypt drm widget");
- drm_trusted_sapps_decrypt_package_info_s package_info;
-
- strncpy(package_info.sadcf_filepath, m_source.c_str(),
- sizeof(package_info.sadcf_filepath));
- strncpy(package_info.decrypt_filepath, m_destPath.c_str(),
- sizeof(package_info.decrypt_filepath));
-
- drm_trusted_request_type_e requestType =
- DRM_TRUSTED_REQ_TYPE_SAPPS_DECRYPT_PACKAGE;
-
- int ret = drm_trusted_handle_request(requestType,
- (void *)&package_info, NULL);
- if (DRM_TRUSTED_RETURN_SUCCESS != ret) {
- LogDebug("Failed unzip drm widget");
- ThrowMsg(Exceptions::ExtractFileFailed, m_destPath);
- }
-}
-} //namespace WidgetInstall
-} //namespace Jobs
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * @file widget_unzip.cpp
- * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version 1.0
- * @brief Implementation file for installer task unzip
- */
-#ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_WIDGET_UNZIP_H
-#define INSTALLER_CORE_JOS_WIDGET_INSTALL_WIDGET_UNZIP_H
-
-#include <string>
-#include <memory>
-
-#include <dpl/zip_input.h>
-
-class InstallerContext;
-
-namespace Jobs {
-namespace WidgetInstall {
-class WidgetUnzip
-{
- private:
- // Installation context
- std::string m_source;
- std::string m_destPath;
-
- // Unzip state
- std::unique_ptr<DPL::ZipInput> m_zip;
- DPL::ZipInput::const_iterator m_zipIterator;
-
- void ExtractFile(DPL::ZipInput::File *input,
- const std::string &destFileName);
-
- void UnzipPrepare();
- void UnzipProgress();
-
- public:
- WidgetUnzip(std::string m_source, std::string m_destPath);
- void UnzipWidget();
- void UnzipDRMWidget();
-};
-} //namespace WidgetInstall
-} //namespace Jobs
-
-#endif // INSTALLER_CORE_JOS_WIDGET_INSTALL_WIDGET_UNZIP_H