From 78184fd6ccac6c8e7f210f017e766f210d87e0f2 Mon Sep 17 00:00:00 2001 From: Rusty Lynch Date: Mon, 17 Jun 2013 19:09:48 -0700 Subject: [PATCH] Add build config for decrypt support --- CMakeLists.txt | 4 ++++ packaging/wrt.spec | 12 ++++++++++-- src/view/webkit/injected-bundle/CMakeLists.txt | 17 +++++++++++++++++ src/view/webkit/injected-bundle/wrt-injected-bundle.cpp | 6 ++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b849ec..3097d32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,10 @@ OPTION(APP_SCHEME_SUPPORT "Support for app:// scheme" OFF) OPTION(CORS_WHITELISTING_SUPPORT "CORS white listing for access positions" OFF) OPTION(MULTIPROCESS_SERVICE_SUPPORT "Process per service" OFF) OPTION(MULTIPROCESS_SERVICE_SUPPORT_INLINE "Process per service - inline mode support" OFF) +OPTION(DECRYPT_SUPPORT "Enable appmanager capabilities" ON) +IF(DECRYPT_SUPPORT) + ADD_DEFINITIONS("-DDECRYPT") +ENDIF(DECRYPT_SUPPORT) IF(CSP_SUPPORT) ADD_DEFINITIONS("-DCSP_ENABLED") ENDIF(CSP_SUPPORT) diff --git a/packaging/wrt.spec b/packaging/wrt.spec index 96e508e..8ae66df 100644 --- a/packaging/wrt.spec +++ b/packaging/wrt.spec @@ -1,3 +1,4 @@ +%bcond_with wayland Name: wrt Summary: Web runtime Version: 0.8.198.3 @@ -44,11 +45,13 @@ BuildRequires: pkgconfig(dpl-encryption) BuildRequires: pkgconfig(wrt-popup-wrt-runner) BuildRequires: pkgconfig(wrt-popup-ace-runner) BuildRequires: pkgconfig(sysman) -BuildRequires: pkgconfig(osp-appfw) BuildRequires: pkgconfig(app2sd) BuildRequires: pkgconfig(capi-system-system-settings) +%if !%{with wayland} +BuildRequires: pkgconfig(osp-appfw) BuildRequires: osp-appfw-internal-devel Requires: osp-appfw +%endif Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -86,8 +89,13 @@ wrt library development headers export LDFLAGS+="-Wl,--rpath=%{_libdir}" %cmake . -DDPL_LOG="ON" \ - -DPROJECT_VERSION=%{version} \ + -DPROJECT_VERSION=%{version} \ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \ +%if %{with wayland} + -DDECRYPT_SUPPORT=Off \ +%else + -DDECRYPT_SUPPORT=On \ +%endif %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS} make %{?jobs:-j%jobs} diff --git a/src/view/webkit/injected-bundle/CMakeLists.txt b/src/view/webkit/injected-bundle/CMakeLists.txt index 8cffe57..c388fb5 100644 --- a/src/view/webkit/injected-bundle/CMakeLists.txt +++ b/src/view/webkit/injected-bundle/CMakeLists.txt @@ -20,6 +20,7 @@ include(FindPkgConfig) +IF(DECRYPT_SUPPORT) PKG_CHECK_MODULES(INJECTED_BUNDLE_DEP dpl-efl dpl-utils-efl @@ -33,6 +34,20 @@ PKG_CHECK_MODULES(INJECTED_BUNDLE_DEP libpcrecpp REQUIRED ) +ELSE(DECRYPT_SUPPORT) +PKG_CHECK_MODULES(INJECTED_BUNDLE_DEP + dpl-efl + dpl-utils-efl + dpl-wrt-dao-ro + dpl-encryption + ewebkit2 + vconf + libprivilege-control + libiri + libpcrecpp + REQUIRED +) +ENDIF(DECRYPT_SUPPORT) SET(INJECTED_BUNDLE_SOURCES ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp @@ -62,8 +77,10 @@ TARGET_LINK_LIBRARIES( ${PROF_LIB} ) +IF(DECRYPT_SUPPORT) # for encryption TARGET_LINK_LIBRARIES(${TARGET_INJECTED_BUNDLE_LIB} -L${LIB_INSTALL_DIR}/osp -losp-appfw) +ENDIF(DECRYPT_SUPPORT) SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE_LIB} PROPERTIES VERSION ${PROJECT_VERSION} diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp index 078a1c1..c4c87d1 100644 --- a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp +++ b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp @@ -56,8 +56,10 @@ #include #include #include +#ifdef DECRYPT #include #include +#endif #include #include @@ -109,6 +111,7 @@ const char * const PRIVILEGE_APP_TYPE = "wgt"; const char * const warpAllowProtocolsForWildcard[] = { "http", "https" }; #endif +#ifdef DECRYPT static bool m_initWebApp = false; Tizen::Base::ByteBuffer *DecryptChunkByTrustZone( @@ -144,6 +147,7 @@ Tizen::Base::ByteBuffer *DecryptChunkByTrustZone( return pInstance->_TrustZoneService::DecryptN(*appInfo, pBuf); } +#endif // DECRYPT } @@ -1041,6 +1045,7 @@ bool Bundle::isEncryptedResource(std::string Url, int &size) std::string Bundle::DecryptResource(std::string resource, int size) { +#ifdef DECRYPT std::string filePath; size_t pos = resource.find_first_not_of(SCHEME_FILE_SLASH); @@ -1119,6 +1124,7 @@ std::string Bundle::DecryptResource(std::string resource, int size) return base64Enc; } +#endif return std::string(); } -- 2.7.4