2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file job_widget_install.cpp
18 * @author Radoslaw Wicik r.wicik@samsung.com
19 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
21 * @brief Implementation file for main installer task
23 #include <dpl/noncopyable.h>
24 #include <dpl/abstract_waitable_input_adapter.h>
25 #include <dpl/abstract_waitable_output_adapter.h>
26 #include <dpl/zip_input.h>
27 #include <dpl/scoped_ptr.h>
28 #include <dpl/binary_queue.h>
30 #include <dpl/assert.h>
31 #include <dpl/sstream.h>
32 #include <dpl/wrt-dao-ro/common_dao_types.h>
33 #include "root_parser.h"
34 #include "widget_parser.h"
35 #include "parser_runner.h"
36 #include <widget_install/job_widget_install.h>
37 #include <widget_install/task_unzip.h>
38 #include <widget_install/task_certify.h>
39 #include <widget_install/task_widget_config.h>
40 #include <widget_install/task_db_update.h>
41 #include <widget_install/task_ace_check.h>
42 #include <widget_install/task_smack.h>
43 #include <widget_install/task_manifest_file.h>
44 #include <widget_install/task_private_storage.h>
45 #include <widget_install/task_prepare_files.h>
46 #include <widget_install/task_recovery.h>
47 #include <widget_install/task_install_ospsvc.h>
48 #include <widget_install/task_update_files.h>
49 #include <widget_install/task_new_db_insert.h>
50 #include <widget_install/task_remove_backup.h>
51 #include <widget_install/task_encrypt_resource.h>
52 #include <widget_install/widget_install_errors.h>
53 #include <widget_install/widget_install_context.h>
60 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
61 #include <dpl/wrt-dao-ro/global_config.h>
62 #include <dpl/wrt-dao-rw/global_dao.h> // TODO remove
64 #include <dpl/localization/w3c_file_localization.h>
65 #include <libiriwrapper.h>
66 #include <pkg-manager/pkgmgr_signal.h>
68 using namespace WrtDB;
70 namespace // anonymous
72 const char * const CONFIG_XML = "config.xml";
73 const char * const WITH_OSP_XML = "res/wgt/config.xml";
75 //allowed: a-z, A-Z, 0-9, '.', '-', '_', ' '
76 const char* REG_TIZENID_PATTERN = "^[-. a-zA-Z0-9_@+=]*$";
77 const int RESERVED_COUNT = 20; //number of chars reserved in name (e.g. for '.desktop')
78 const int MAX_TIZENID_LENTH = 255 - RESERVED_COUNT;
80 static const DPL::String SETTING_VALUE_ENCRYPTION = L"encryption";
81 static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE = L"enable";
83 class InstallerTaskFail :
84 public DPL::TaskDecl<InstallerTaskFail>
92 ThrowMsg(Jobs::WidgetInstall::Exceptions::Deferred,
93 "Widget installation or update deferred!");
95 ThrowMsg(Jobs::WidgetInstall::Exceptions::NotAllowed,
96 "Widget installation or update not allowed!");
101 InstallerTaskFail(bool deferred) :
102 DPL::TaskDecl<InstallerTaskFail>(this),
105 AddStep(&InstallerTaskFail::StepFail);
109 const std::string XML_EXTENSION = ".xml";
111 bool hasExtension(const std::string& filename, const std::string& extension) {
112 LogDebug("Looking for extension " << extension << " in: " << filename);
113 size_t fileLen = filename.length();
114 size_t extLen = extension.length();
115 if (fileLen < extLen) {
116 LogError("Filename " << filename << " is shorter than extension "
120 return (0 == filename.compare(fileLen-extLen, extLen, extension));
122 } // namespace anonymous
125 namespace WidgetInstall {
126 JobWidgetInstall::JobWidgetInstall(std::string const &widgetPath,
127 const WidgetInstallationStruct &installerStruct) :
129 JobContextBase<WidgetInstallationStruct>(installerStruct),
130 m_exceptionCaught(Exceptions::Success)
132 // Check installation type (config.xml or widget.wgt)
133 m_installerContext.browserRequest = hasExtension(widgetPath, XML_EXTENSION);
135 LogInfo("Hosted app installation: " << m_installerContext.browserRequest);
138 gettimeofday(&tv, NULL);
139 srand(time(NULL) + tv.tv_usec);
140 WrtDB::DbWidgetHandle handle;
142 handle = rand() % INT_MAX + 1;
143 LogInfo("Random widget handle: " << handle);
144 } while (WidgetDAOReadOnly::isWidgetInstalled(handle));
146 m_installerContext.widgetHandle = handle;
147 m_installerContext.m_quiet = m_jobStruct.m_quiet;
149 m_installerContext.widgetConfig.pType = checkPackageType(widgetPath);
151 ConfigParserData configData = getWidgetDataFromXML(widgetPath,
152 m_installerContext.browserRequest,
153 m_installerContext.widgetConfig.pType);
154 WidgetUpdateInfo update = detectWidgetUpdate(configData);
155 bool needEncryption = detectResourceEncryption(configData);
157 // Configure installation
158 ConfigureResult result = ConfigureInstallation(widgetPath,
159 m_installerContext.browserRequest, update);
160 if (!setTizenId(configData)) {
161 result = ConfigureResult::Failed;
163 using namespace PackageManager;
164 LogInfo("WidgetHandle: " << m_installerContext.widgetHandle);
165 LogInfo("Tizen Id: " << m_installerContext.widgetConfig.pkgname);
167 // send start signal of pkgmgr
168 PkgmgrSignalSingleton::Instance().setPkgname(
170 *m_installerContext.widgetConfig.pkgname));
171 PkgmgrSignalSingleton::Instance().sendSignal(
173 PKGMGR_START_INSTALL);
176 if (result == ConfigureResult::Ok) {
177 LogInfo("Configure installation succeeded");
179 AddTask(new TaskRecovery(m_installerContext));
181 // Create installation tasks
182 if (!m_installerContext.browserRequest) {
183 AddTask(new TaskUnzip(m_installerContext));
185 AddTask(new TaskWidgetConfig(m_installerContext));
186 AddTask(new TaskCertify(m_installerContext));
187 if (needEncryption) {
188 AddTask(new TaskEncryptResource(m_installerContext));
190 AddTask(new TaskDbUpdate(m_installerContext));
191 // TODO: Update progress information for this task
193 AddTask(new TaskPrivateStorage(m_installerContext));
194 AddTask(new TaskAceCheck(m_installerContext));
195 //This is sort of quick solution, because ACE verdicts are based upon
196 //data from DAO (DB). So AceCheck for now has to be AFTER DbUpdate
198 AddTask(new TaskSmack(m_installerContext));
200 AddTask(new TaskManifestFile(m_installerContext));
201 if (m_installerContext.widgetConfig.pType ==
202 PKG_TYPE_TIZEN_WITHSVCAPP) {
203 AddTask(new TaskInstallOspsvc(m_installerContext));
205 } else if (result == ConfigureResult::Updated) {
206 LogInfo("Configure installation updated");
207 LogInfo("Widget Update");
209 if (!m_installerContext.browserRequest) {
210 AddTask(new TaskUnzip(m_installerContext));
212 AddTask(new TaskWidgetConfig(m_installerContext));
214 AddTask(new TaskCertify(m_installerContext));
215 AddTask(new TaskUpdateFiles(m_installerContext));
216 AddTask(new TaskNewDbInsert(m_installerContext));
218 /* TODO : To backup file, save md5 values */
219 AddTask(new TaskAceCheck(m_installerContext));
220 AddTask(new TaskSmack(m_installerContext));
222 AddTask(new TaskManifestFile(m_installerContext));
223 AddTask(new TaskRemoveBackupFiles(m_installerContext));
224 if (m_installerContext.widgetConfig.pType ==
225 PKG_TYPE_TIZEN_WITHSVCAPP) {
226 AddTask(new TaskInstallOspsvc(m_installerContext));
228 } else if (result == ConfigureResult::Deferred) {
229 // Installation is deferred
230 LogInfo("Configure installation deferred");
232 AddTask(new InstallerTaskFail(true));
233 } else if (result == ConfigureResult::Failed) {
234 // Installation is not allowed to proceed due to widget update policy
235 LogWarning("Configure installation failed!");
237 AddTask(new InstallerTaskFail(false));
239 Assert(false && "Invalid configure result!");
243 bool JobWidgetInstall::setTizenId(
244 const WrtDB::ConfigParserData &configInfo)
246 Assert(!!m_installerContext.widgetHandle
247 && "Widget Handle should be initialized");
250 regcomp(®, REG_TIZENID_PATTERN, REG_NOSUB);
252 if(!!configInfo.tizenId) {
253 LogDebug("Setting tizenId provided in config.xml");
254 if ((regexec(®, DPL::ToUTF8String(*(configInfo.tizenId)).c_str(),
255 static_cast<size_t>(0), NULL, 0) != 0) ||
256 (DPL::ToUTF8String(*(configInfo.tizenId)).size() > MAX_TIZENID_LENTH) ||
257 (stat((std::string(GlobalConfig::GetUserInstalledWidgetPath()) + "/"
258 + DPL::ToUTF8String(*(configInfo.tizenId))).c_str(), &dirStat) == 0))
260 //it is true when tizenId does not fit REG_TIZENID_PATTERN
261 LogError("pkgName provided but not proper.");
265 m_installerContext.widgetConfig.pkgname = configInfo.tizenId;
268 LogInfo("package name is generated by WRT");
269 // tizen id should be generated by secure random algorithm
270 std::string pkgName = WrtDB::GlobalConfig::GetPkgnamePrefix();
273 FOREACH(it, configInfo.localizedDataSet)
275 if (!!((it->second).name)) {
276 //there is a name provided
277 std::string name = DPL::ToUTF8String(*(it->second).name);
278 //cut very long widget's name
279 name = name.substr(0, MAX_TIZENID_LENTH - strlen(
280 WrtDB::GlobalConfig::GetPkgnamePrefix()));
281 //check name if all characters are supported by filesystem
282 if (regexec(®, name.c_str(), static_cast<size_t>(0), NULL, 0)
285 //WidgetName is ok and can be used as package name
286 //replace all spaces with '_'
288 while((pos = name.find(" ", pos)) != std::string::npos) {
289 name.replace(pos, 1, "_");
299 if (!named) // there is no widget name provided, use widgetHandle
301 pkgName += std::to_string(*(m_installerContext.widgetHandle));
304 //check if there is package with same name and if generate different name
305 std::string path = GlobalConfig::GetUserInstalledWidgetPath();
308 std::ostringstream newPath;
309 newPath << path << pkgName;
312 for (int i = 0;; ++i) {
313 if (stat(newPath.str().c_str(), &dirStat) == 0) {
314 //path exist, chose another one, eg. widgetName1
315 suffix = std::to_string(i + 1);
316 pkgName = pkgName.substr(
317 0, MAX_TIZENID_LENTH - suffix.size());
319 newPath << path << pkgName << suffix;
326 m_installerContext.widgetConfig.pkgname =
327 DPL::FromUTF8String(pkgName);
332 LogInfo("Tizen Id : " << m_installerContext.widgetConfig.pkgname);
333 LogInfo("W3C Widget GUID : " << m_installerContext.widgetConfig.guid);
337 DPL::Optional<WidgetHandle> JobWidgetInstall::getNewWidgetHandle() const
339 return m_installerContext.widgetHandle;
342 JobWidgetInstall::ConfigureResult JobWidgetInstall::ConfigureInstallation(
343 const std::string &widgetSource,
345 const WidgetUpdateInfo &update)
348 "Widget install/update: incoming guid = '" <<
349 update.incomingGUID << "'");
351 "Widget install/update: incoming version = '" <<
352 update.incomingVersion << "'");
355 WidgetUpdateMode::Type updateTypeCheckBit;
357 if (update.existingWidgetInfo.isExist == false) {
358 LogInfo("Widget info does not exist");
359 updateTypeCheckBit = WidgetUpdateMode::NotInstalled;
361 LogInfo("Widget info exists. Handle: " <<
362 update.existingWidgetInfo.existingHandle);
364 DPL::OptionalString pkgname =
365 WidgetDAOReadOnly(update.existingWidgetInfo.existingHandle).getPkgname();
367 if(pkgname.IsNull()) {
368 LogInfo("But package name doesn't exist");
369 return ConfigureResult::Failed;
372 LogInfo("Widget model exists. package name: " << pkgname);
373 if (aul_app_is_running(DPL::ToUTF8String(*pkgname).c_str())) {
374 // Must be deferred when update in progress
375 if (m_jobStruct.updateMode == WidgetUpdateMode::PolicyWac) {
377 "Widget is already running. Policy is update according to WAC");
379 return ConfigureResult::Deferred;
382 "Widget is already running. Policy is not update according to WAC");
383 LogInfo("Installation aborted: " << widgetSource);
385 return ConfigureResult::Failed;
389 m_installerContext.widgetConfig.pkgname = pkgname;
390 OptionalWidgetVersion existingVersion;
391 existingVersion = update.existingWidgetInfo.existingVersion;
392 OptionalWidgetVersion incomingVersion = update.incomingVersion;
394 updateTypeCheckBit = CalcWidgetUpdatePolicy(existingVersion,
399 bool canProceed = (m_jobStruct.updateMode & updateTypeCheckBit) > 0;
401 LogInfo("Whether widget policy allow proceed: " << canProceed);
403 // Init installer context
404 m_installerContext.widgetSource = widgetSource;
405 m_installerContext.tempWidgetPath = std::string();
407 // setup config xml path
409 LogInfo("widgetSource " << widgetSource);
410 size_t slash = widgetSource.find_last_of("\\/");
411 if (std::string::npos != slash) {
412 m_installerContext.tempWidgetPath = widgetSource.substr(0, slash+1);
414 m_installerContext.tempWidgetPath = ".";
418 m_installerContext.installStep = InstallerContext::INSTALL_START;
419 m_installerContext.job = this;
420 m_installerContext.existingWidgetInfo = update.existingWidgetInfo;
421 m_installerContext.widgetConfig.shareHref = std::string();
423 if (m_installerContext.existingWidgetInfo.isExist) {
424 return canProceed ? ConfigureResult::Updated : ConfigureResult::Failed;
428 return canProceed ? ConfigureResult::Ok : ConfigureResult::Failed;
431 WidgetUpdateMode::Type JobWidgetInstall::CalcWidgetUpdatePolicy(
432 const OptionalWidgetVersion &existingVersion,
433 const OptionalWidgetVersion &incomingVersion) const
435 // Widget is installed, check versions
436 if (!existingVersion && !incomingVersion) {
437 return WidgetUpdateMode::ExistingVersionEqual;
438 } else if (!existingVersion && !!incomingVersion) {
439 return WidgetUpdateMode::ExistingVersionNewer;
440 } else if (!!existingVersion && !incomingVersion) {
441 return WidgetUpdateMode::ExistingVersionOlder;
443 LogInfo("Existing widget: version = '" << *existingVersion << "'");
445 if (!existingVersion->IsWac() && !incomingVersion->IsWac()) {
446 return WidgetUpdateMode::BothVersionsNotStd;
447 } else if (!existingVersion->IsWac()) {
448 return WidgetUpdateMode::ExistingVersionNotStd;
449 } else if (!incomingVersion->IsWac()) {
450 return WidgetUpdateMode::IncomingVersionNotStd;
452 // Both versions are WAC-comparable. Do compare.
453 if (*incomingVersion == *existingVersion) {
454 return WidgetUpdateMode::ExistingVersionEqual;
455 } else if (*incomingVersion > *existingVersion) {
456 return WidgetUpdateMode::ExistingVersionOlder;
458 return WidgetUpdateMode::ExistingVersionNewer;
464 ConfigParserData JobWidgetInstall::getWidgetDataFromXML(
465 const std::string &widgetSource,
466 bool fromBrowser, WrtDB::PkgType isOspsvc)
472 ConfigParserData configInfo;
475 parser.Parse(widgetSource,
477 new RootParser<WidgetParser>(configInfo,
478 DPL::FromUTF32String(
483 DPL::ScopedPtr<DPL::ZipInput> zipFile(
484 new DPL::ZipInput(widgetSource));
486 DPL::ScopedPtr<DPL::ZipInput::File> configFile;
488 // Open config.xml file
489 if (isOspsvc == PKG_TYPE_TIZEN_WITHSVCAPP) {
490 configFile.Reset(zipFile->OpenFile(WITH_OSP_XML));
492 configFile.Reset(zipFile->OpenFile(CONFIG_XML));
496 DPL::BinaryQueue buffer;
497 DPL::AbstractWaitableInputAdapter inputAdapter(configFile.Get());
498 DPL::AbstractWaitableOutputAdapter outputAdapter(&buffer);
499 DPL::Copy(&inputAdapter, &outputAdapter);
500 parser.Parse(&buffer,
502 new RootParser<WidgetParser>(configInfo,
503 DPL::FromUTF32String(
509 Catch(DPL::ZipInput::Exception::OpenFailed)
511 LogDebug("Failed to open widget package");
512 return ConfigParserData();
514 Catch(DPL::ZipInput::Exception::OpenFileFailed)
516 LogDebug("Failed to open config.xml file");
517 return ConfigParserData();
519 Catch(DPL::CopyFailed)
521 LogDebug("Failed to extract config.xml file");
522 return ConfigParserData();
524 Catch(ElementParser::Exception::ParseError)
526 LogDebug("Failed to parse config.xml file");
527 return ConfigParserData();
531 WidgetUpdateInfo JobWidgetInstall::detectWidgetUpdate(
532 const ConfigParserData &configInfo)
534 LogInfo("Checking up widget package for config.xml...");
536 DPL::OptionalString widgetGUID;
537 OptionalWidgetVersion widgetVersion;
540 widgetGUID = configInfo.widget_id;
542 if (widgetGUID.IsNull()) {
543 LogDebug("Installed widget has no GUID");
544 return WidgetUpdateInfo();
547 LogDebug("Installed widget GUID: " << *widgetGUID);
549 // Locate widget ID with this GUID
550 // Incoming widget version
551 if (!configInfo.version.IsNull()) {
553 DPL::Optional<WidgetVersion>(
554 WidgetVersion(*configInfo.version));
559 // Search widget handle by GUID
560 WidgetDAOReadOnly dao(widgetGUID);
561 return WidgetUpdateInfo(
564 WidgetUpdateInfo::ExistingWidgetInfo(
565 dao.getHandle(), dao.getVersion()));
567 Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
569 // GUID isn't installed
570 return WidgetUpdateInfo(
573 WidgetUpdateInfo::ExistingWidgetInfo());
577 void JobWidgetInstall::SendProgress()
579 using namespace PackageManager;
580 if (GetProgressFlag() != false) {
581 if (getInstallerStruct().progressCallback != NULL) {
582 // send progress signal of pkgmgr
583 std::ostringstream percent;
584 percent << static_cast<int>(GetProgressPercent());
585 PkgmgrSignalSingleton::Instance().sendSignal(
589 LogDebug("Call widget install progressCallbak");
590 getInstallerStruct().progressCallback(getInstallerStruct().userParam,
591 GetProgressPercent(),GetProgressDescription());
596 void JobWidgetInstall::SendFinishedSuccess()
598 using namespace PackageManager;
599 // TODO : sync should move to separate task.
602 // remove widget install information file
603 unlink(m_installerContext.installInfo.c_str());
606 JobWidgetInstall::displayWidgetInfo();
608 DPL::Optional<WidgetHandle> handle = getNewWidgetHandle();
610 // send signal of pkgmgr
611 PkgmgrSignalSingleton::Instance().sendSignal(
615 LogDebug("Call widget install successfinishedCallback");
616 getInstallerStruct().finishedCallback(getInstallerStruct().userParam,
617 !!handle ? *handle : WrtDB::INVALID_WIDGET_HANDLE, Exceptions::Success);
620 void JobWidgetInstall::SendFinishedFailure()
622 using namespace PackageManager;
623 // remove widget install information file
624 unlink(m_installerContext.installInfo.c_str());
626 LogError("Error in installation step: " << m_exceptionCaught);
627 LogError("Message: " << m_exceptionMessage);
628 DPL::Optional<WidgetHandle> handle = getNewWidgetHandle();
630 LogDebug("Call widget install failure finishedCallback");
632 // send signal of pkgmgr
633 PkgmgrSignalSingleton::Instance().sendSignal(
637 getInstallerStruct().finishedCallback(getInstallerStruct().userParam,
638 !!handle ? *handle : WrtDB::INVALID_WIDGET_HANDLE, m_exceptionCaught);
641 void JobWidgetInstall::SaveExceptionData(const Jobs::JobExceptionBase &e)
643 m_exceptionCaught = static_cast<Exceptions::Type>(e.getParam());
644 m_exceptionMessage = e.GetMessage();
647 void JobWidgetInstall::displayWidgetInfo()
649 DPL::Optional<WidgetHandle> handle = getNewWidgetHandle();
652 WidgetDAOReadOnly dao(*handle);
654 std::ostringstream out;
655 WidgetLocalizedInfo localizedInfo =
656 W3CFileLocalization::getLocalizedInfo(*handle);
659 "===================================== INSTALLED WIDGET INFO ========="\
660 "============================";
661 out << std::endl << "Name: " << localizedInfo.name;
662 out << std::endl << "PkgName: " << dao.getPkgname();
663 WidgetSize size = dao.getPreferredSize();
664 out << std::endl << "Width: " << size.width;
665 out << std::endl << "Height: " << size.height;
666 out << std::endl << "Start File: " <<
667 W3CFileLocalization::getStartFile(*handle);
668 out << std::endl << "Version: " << dao.getVersion();
669 out << std::endl << "Licence: " <<
670 localizedInfo.license;
671 out << std::endl << "Licence Href: " <<
672 localizedInfo.licenseHref;
673 out << std::endl << "Description: " <<
674 localizedInfo.description;
675 out << std::endl << "Widget Id: " << dao.getGUID();
676 out << std::endl << "Widget recognized: " << dao.isRecognized();
677 out << std::endl << "Widget wac signed: " << dao.isWacSigned();
678 out << std::endl << "Widget distributor signed: " <<
679 dao.isDistributorSigned();
680 out << std::endl << "Widget trusted: " << dao.isTrusted();
682 OptionalWidgetIcon icon = W3CFileLocalization::getIcon(*handle);
683 DPL::OptionalString iconSrc =
684 !!icon ? icon->src : DPL::OptionalString::Null;
685 out << std::endl << "Icon: " << iconSrc;
687 out << std::endl << "Preferences:";
689 PropertyDAOReadOnly::WidgetPreferenceList list = dao.getPropertyList();
692 out << std::endl << " Key: " <<
694 out << std::endl << " Readonly: " <<
699 out << std::endl << "Features:";
701 WidgetFeatureSet list = dao.getFeaturesList();
704 out << std::endl << " Name: " << it->name;
705 out << std::endl << " Required: " << it->required;
706 out << std::endl << " Params:";
715 WrtDB::PackagingType JobWidgetInstall::checkPackageType(
716 const std::string &widgetSource)
718 using namespace WrtDB;
720 PackagingType pType = PKG_TYPE_UNKNOWN;
721 DPL::ScopedPtr<DPL::ZipInput> zipFile;
726 zipFile.Reset(new DPL::ZipInput(widgetSource));
729 Catch(DPL::ZipInput::Exception::OpenFailed)
731 LogDebug("Failed to open widget package");
732 return PKG_TYPE_UNKNOWN;
737 // Open config.xml file in package root
738 DPL::ScopedPtr<DPL::ZipInput::File> configFile(
739 zipFile->OpenFile(CONFIG_XML));
740 pType = PKG_TYPE_TIZEN_WEBAPP;
742 Catch(DPL::ZipInput::Exception::OpenFileFailed)
744 LogDebug("Could not find config.xml");
749 // Open config.xml file in package root
750 DPL::ScopedPtr<DPL::ZipInput::File> configFile(
751 zipFile->OpenFile(WITH_OSP_XML));
752 if (pType == PKG_TYPE_TIZEN_WEBAPP) {
753 return PKG_TYPE_UNKNOWN;
756 pType = PKG_TYPE_TIZEN_WITHSVCAPP;
758 Catch(DPL::ZipInput::Exception::OpenFileFailed)
760 LogDebug("Could not find wgt/config.xml");
761 return PKG_TYPE_UNKNOWN;
767 bool JobWidgetInstall::detectResourceEncryption(const WrtDB::ConfigParserData &configData)
769 FOREACH(it, configData.settingsList)
771 if (it->m_name == SETTING_VALUE_ENCRYPTION &&
772 it->m_value == SETTING_VALUE_ENCRYPTION_ENABLE) {
773 LogDebug("resource need encryption");
780 } //namespace WidgetInstall