Add build config for decrypt support 30/4230/1
authorRusty Lynch <rusty.lynch@intel.com>
Tue, 18 Jun 2013 02:09:48 +0000 (19:09 -0700)
committerRusty Lynch <rusty.lynch@intel.com>
Mon, 24 Jun 2013 22:58:59 +0000 (15:58 -0700)
CMakeLists.txt
packaging/wrt.spec
src/view/webkit/injected-bundle/CMakeLists.txt
src/view/webkit/injected-bundle/wrt-injected-bundle.cpp

index 7b849ec..3097d32 100644 (file)
@@ -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)
index 96e508e..8ae66df 100644 (file)
@@ -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}
index 8cffe57..c388fb5 100644 (file)
@@ -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}
index 078a1c1..c4c87d1 100644 (file)
 #include <dpl/utils/mime_type_utils.h>
 #include <dpl/localization/LanguageTagsProvider.h>
 #include <dpl/event/main_event_dispatcher.h>
+#ifdef DECRYPT
 #include <FBaseByteBuffer.h>
 #include <security/FSecCrypto_TrustZoneService.h>
+#endif
 
 #include <wrt_plugin_module.h>
 #include <profiling_util.h>
@@ -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();
 }