#ifndef COMMON_PKGMGR_INTERFACE_H_
#define COMMON_PKGMGR_INTERFACE_H_
+#include <boost/filesystem/path.hpp>
#include <manifest_parser/utils/logging.h>
#include <pkgmgr_installer.h>
-
-#include <boost/filesystem/path.hpp>
#include <memory>
#include "common/app_query_interface.h"
#include <manifest_parser/utils/logging.h>
#include <pkgmgr_installer.h>
+#include <pkgmgr_parser_db.h>
#include <tzplatform_config.h>
#include <unistd.h>
namespace {
-// TODO(sdi2): Check if data->removable is correctly setting
-// during parsing step.
-// Same check should be done for preload field.
-
-// Having a specific step to implement a installer commandline tool
-// for image build could be usefull also.
-const char* const kAppinstTags[] = {"removable=true", nullptr, };
-
bool RegisterAuthorCertificate(
const common_installer::CertificateInfo& cert_info,
const std::string& pkgid, uid_t uid) {
return PMINFO_R_OK;
}
-} // anonymous namespace
-
-namespace common_installer {
-
-bool RegisterAppInPkgmgrWithTep(const bf::path& tep_path,
- const bf::path& xml_path,
- const std::string & pkgid,
- const CertificateInfo & cert_info,
- uid_t uid,
- RequestMode request_mode) {
- int ret = request_mode != RequestMode::GLOBAL ?
- pkgmgr_parser_parse_usr_manifest_for_installation_withtep(
- xml_path.c_str(), tep_path.c_str(),
- uid, const_cast<char* const*>(kAppinstTags)) :
- pkgmgr_parser_parse_manifest_for_installation_withtep(
- xml_path.c_str(), tep_path.c_str(),
- const_cast<char* const*>(kAppinstTags));
-
- if (ret) {
- LOG(ERROR) << "Failed to register package: " << xml_path << ", "
- "error code=" << ret;
+bool AssignPackageTags(const std::string& pkgid, manifest_x* manifest,
+ common_installer::RequestMode request_mode,
+ bool is_update) {
+ int ret = pkgmgr_parser_preload_package_type(pkgid.c_str());
+ if (ret == -1) {
+ LOG(ERROR) << "pkgmgr_parser_preload_package_type failed";
return false;
}
-
- if (!!cert_info.author_certificate.get()) {
- if (!RegisterAuthorCertificate(cert_info, pkgid, uid)) {
- LOG(ERROR) << "Failed to register author certificate";
+ // this flag is actually set by preloaded app update to "true" but it is never
+ // read anyway.
+ if (request_mode == common_installer::RequestMode::GLOBAL && is_update)
+ manifest->update = strdup("true");
+ else
+ manifest->update = strdup("false");
+ // external installation should alter this flag
+ manifest->installed_storage = strdup("installed_internal");
+
+ if (request_mode == common_installer::RequestMode::USER) {
+ manifest->preload = strdup("false");
+ manifest->removable = strdup("true");
+ manifest->readonly = strdup("false");
+ manifest->system = strdup("false");
+ } else {
+ switch (ret) {
+ case PM_PRELOAD_NONE:
+ manifest->preload = strdup("false");
+ manifest->removable = strdup("true");
+ manifest->readonly = strdup("false");
+ manifest->system = strdup("false");
+ break;
+ case PM_PRELOAD_RW_NORM:
+ manifest->preload = strdup("true");
+ manifest->removable = strdup("false");
+ manifest->readonly = strdup("true");
+ manifest->system = strdup("true");
+ break;
+ case PM_PRELOAD_RW_RM:
+ manifest->preload = strdup("true");
+ manifest->removable = strdup("true");
+ manifest->readonly = strdup("true");
+ manifest->system = strdup("false");
+ break;
+ default:
+ LOG(ERROR) <<
+ "Unknown value returned by pkgmgr_parser_preload_package_type";
return false;
}
}
-
return true;
}
-bool RegisterAppInPkgmgr(const bf::path& xml_path,
+} // anonymous namespace
+
+namespace common_installer {
+
+bool RegisterAppInPkgmgr(manifest_x* manifest,
+ const bf::path& xml_path,
const std::string& pkgid,
const CertificateInfo& cert_info,
uid_t uid,
- RequestMode request_mode) {
+ RequestMode request_mode,
+ const boost::filesystem::path& tep_path) {
+ // Fill "non-xml" elements
+ if (!tep_path.empty())
+ manifest->tep_name = strdup(tep_path.c_str());
+
+ if (!AssignPackageTags(pkgid, manifest, request_mode, false))
+ return false;
+
int ret = request_mode != RequestMode::GLOBAL ?
- pkgmgr_parser_parse_usr_manifest_for_installation(
- xml_path.c_str(), uid, const_cast<char* const*>(kAppinstTags)) :
- pkgmgr_parser_parse_manifest_for_installation(
- xml_path.c_str(), const_cast<char* const*>(kAppinstTags));
+ pkgmgr_parser_process_usr_manifest_x_for_installation(manifest,
+ xml_path.c_str(), uid) :
+ pkgmgr_parser_process_manifest_x_for_installation(manifest,
+ xml_path.c_str());
if (ret) {
- LOG(ERROR) << "Failed to register package: " << xml_path << ", "
- "error code=" << ret;
+ LOG(ERROR) << "Failed to insert manifest into pkgmgr, error code=" << ret;
return false;
}
return true;
}
-bool UpgradeAppInPkgmgr(const bf::path& xml_path, const std::string& pkgid,
- const CertificateInfo& cert_info, uid_t uid,
+bool UpgradeAppInPkgmgr(manifest_x* manifest,
+ const bf::path& xml_path,
+ const std::string& pkgid,
+ const CertificateInfo& cert_info,
+ uid_t uid,
RequestMode request_mode) {
+ if (!AssignPackageTags(pkgid, manifest, request_mode, true))
+ return false;
+
int ret = request_mode != RequestMode::GLOBAL ?
- pkgmgr_parser_parse_usr_manifest_for_upgrade(
- xml_path.string().c_str(), uid,
- const_cast<char* const*>(kAppinstTags)) :
- pkgmgr_parser_parse_manifest_for_upgrade(
- xml_path.string().c_str(),
- const_cast<char* const*>(kAppinstTags));
+ pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest,
+ xml_path.c_str(), uid) :
+ pkgmgr_parser_process_manifest_x_for_upgrade(manifest, xml_path.c_str());
if (ret != 0) {
- LOG(ERROR) << "Failed to upgrade package: " << xml_path;
+ LOG(ERROR) << "Failed to update manifest in pkgmgr, error code=" << ret;
return false;
}
return true;
}
-bool UnregisterAppInPkgmgr(const bf::path& xml_path,
+bool UnregisterAppInPkgmgr(manifest_x* manifest,
+ const bf::path& xml_path,
const std::string& pkgid,
uid_t uid,
RequestMode request_mode) {
int ret = request_mode != RequestMode::GLOBAL ?
- pkgmgr_parser_parse_usr_manifest_for_uninstallation(
- xml_path.string().c_str(), uid,
- const_cast<char* const*>(kAppinstTags)) :
- pkgmgr_parser_parse_manifest_for_uninstallation(
- xml_path.string().c_str(), const_cast<char* const*>(kAppinstTags));
+ pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest,
+ xml_path.c_str(), uid) :
+ pkgmgr_parser_process_manifest_x_for_uninstallation(manifest,
+ xml_path.c_str());
if (ret) {
- LOG(ERROR) << "Failed to unregister package: " << xml_path;
+ LOG(ERROR) << "Failed to delete manifest from pkgmgr, error code=" << ret;
return false;
}
*
* \return true if success
*/
-bool RegisterAppInPkgmgr(const boost::filesystem::path& xml_path,
- const std::string& pkgid,
- const CertificateInfo& cert_info,
- uid_t uid,
- RequestMode request_mode);
-
-bool RegisterAppInPkgmgrWithTep(const boost::filesystem::path& tep_path,
+bool RegisterAppInPkgmgr(manifest_x* manifest,
const boost::filesystem::path& xml_path,
const std::string& pkgid,
const CertificateInfo& cert_info,
uid_t uid,
- RequestMode request_mode);
+ RequestMode request_mode,
+ const boost::filesystem::path& tep_path =
+ boost::filesystem::path());
/**
* \brief Adapter interface for external PkgMgr module used for upgrading
*
* \return true if success
*/
-bool UpgradeAppInPkgmgr(const boost::filesystem::path& xml_path,
+bool UpgradeAppInPkgmgr(manifest_x* manifest,
+ const boost::filesystem::path& xml_path,
const std::string& pkgid,
const CertificateInfo& cert_info,
uid_t uid,
*
* \return true if success
*/
-bool UnregisterAppInPkgmgr(const boost::filesystem::path& xml_path,
+bool UnregisterAppInPkgmgr(manifest_x* manifest,
+ const boost::filesystem::path& xml_path,
const std::string& pkgid,
uid_t uid,
RequestMode request_mode);
context_->root_application_path.get() / context_->pkgid.get());
bf::path tep_path =
- context_->pkg_path.get() / "res" / context_->tep_path.get().filename();
+ context_->pkg_path.get() / "res" / context_->tep_path.get().filename();
bs::error_code error;
if (context_->is_tep_move.get()) {
if (app->nodisplay)
xmlTextWriterWriteAttribute(writer, BAD_CAST "nodisplay",
BAD_CAST app->nodisplay);
+ if (app->multiple)
+ xmlTextWriterWriteAttribute(writer, BAD_CAST "multiple",
+ BAD_CAST app->multiple);
if (app->launch_mode && strlen(app->launch_mode))
xmlTextWriterWriteAttribute(writer, BAD_CAST "launch_mode",
BAD_CAST app->launch_mode);
for (label_x* label : GListRange<label_x*>(app->label)) {
xmlTextWriterStartElement(writer, BAD_CAST "label");
- if (label->lang && strlen(label->lang)) {
+ if (label->lang && strcmp(DEFAULT_LOCALE, label->lang) != 0) {
xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
BAD_CAST label->lang);
}
xmlTextWriterStartElement(writer, BAD_CAST "image");
xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
BAD_CAST image->name);
- if (image->lang) {
+ if (image->lang && strcmp(DEFAULT_LOCALE, image->lang) != 0) {
xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+
BAD_CAST image->lang);
}
+ if (image->section)
+ xmlTextWriterWriteAttribute(writer, BAD_CAST "section",
+ BAD_CAST image->section);
xmlTextWriterEndElement(writer);
}
for (label_x* label :
GListRange<label_x*>(context_->manifest_data.get()->label)) {
xmlTextWriterStartElement(writer, BAD_CAST "label");
- if (label->lang && strlen(label->lang)) {
+ if (label->lang && strcmp(DEFAULT_LOCALE, label->lang) != 0) {
xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
BAD_CAST label->lang);
}
for (description_x* description :
GListRange<description_x*>(context_->manifest_data.get()->description)) {
xmlTextWriterStartElement(writer, BAD_CAST "description");
- if (description->lang && strlen(description->lang)) {
+ if (description->lang && strcmp(DEFAULT_LOCALE, description->lang) != 0) {
xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
BAD_CAST description->lang);
}
- xmlTextWriterWriteString(writer, BAD_CAST description->name);
+ xmlTextWriterWriteString(writer, BAD_CAST description->text);
xmlTextWriterEndElement(writer);
}
Step::Status StepRecoverApplication::RecoveryNew() {
if (!SetXmlPaths())
return Status::OK;
- UnregisterAppInPkgmgr(context_->xml_path.get(),
+ UnregisterAppInPkgmgr(context_->manifest_data.get(),
+ context_->xml_path.get(),
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get());
}
bf::path xml_path = bf::exists(context_->backup_xml_path.get()) ?
context_->backup_xml_path.get() : context_->xml_path.get();
- UnregisterAppInPkgmgr(xml_path,
+ UnregisterAppInPkgmgr(context_->manifest_data.get(),
+ xml_path,
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get());
- if (!RegisterAppInPkgmgr(xml_path,
+ if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
+ xml_path,
context_->pkgid.get(),
context_->certificate_info.get(),
context_->uid.get(),
}
Step::Status StepRegisterApplication::process() {
- if (!RegisterAppInPkgmgrWithTep(context_->tep_path.get(),
- context_->xml_path.get(),
- context_->pkgid.get(),
- context_->certificate_info.get(),
- context_->uid.get(),
- context_->request_mode.get())) {
+ if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
+ context_->xml_path.get(),
+ context_->pkgid.get(),
+ context_->certificate_info.get(),
+ context_->uid.get(),
+ context_->request_mode.get(),
+ context_->tep_path.get())) {
LOG(ERROR) << "Failed to register the app";
return Step::Status::ERROR;
}
}
Step::Status StepRegisterApplication::undo() {
- if (!UnregisterAppInPkgmgr(context_->xml_path.get(),
+ if (!UnregisterAppInPkgmgr(context_->manifest_data.get(),
+ context_->xml_path.get(),
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get())) {
return Status::ERROR;
}
- if (!UnregisterAppInPkgmgr(context_->xml_path.get(),
+ if (!UnregisterAppInPkgmgr(context_->manifest_data.get(),
+ context_->xml_path.get(),
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get())) {
}
Step::Status StepUnregisterApplication::undo() {
- if (!RegisterAppInPkgmgr(context_->backup_xml_path.get(),
+ if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
+ context_->backup_xml_path.get(),
context_->pkgid.get(),
context_->certificate_info.get(),
context_->uid.get(),
}
Step::Status StepUpdateApplication::process() {
- if (!UpgradeAppInPkgmgr(context_->xml_path.get(),
+ if (!UpgradeAppInPkgmgr(context_->manifest_data.get(),
+ context_->xml_path.get(),
context_->pkgid.get(),
context_->certificate_info.get(),
context_->uid.get(),
}
}
- if (!UpgradeAppInPkgmgr(context_->backup_xml_path.get(),
+ if (!UpgradeAppInPkgmgr(context_->old_manifest_data.get(),
+ context_->backup_xml_path.get(),
context_->pkgid.get(), certificate_info,
context_->uid.get(),
context_->request_mode.get())) {
}
// Give an execution permission to the original executable
- bf::path exec_path = bindir / bf::path(app->exec);
- LOG(DEBUG) << "Giving exec permission to " << exec_path;
- bf::permissions(exec_path, bf::owner_all |
+ LOG(DEBUG) << "Giving exec permission to " << app->exec;
+ bf::permissions(bf::path(app->exec), bf::owner_all |
bf::group_read | bf::group_exe |
bf::others_read | bf::others_exe, boost_error);
if (boost_error) {
#include <pkgmgr/pkgmgr_parser.h>
+#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
return path;
}
+bool StepParse::FillInstallationInfo(manifest_x* manifest) {
+ manifest->root_path = strdup(
+ (context_->root_application_path.get() / manifest->package).c_str());
+ manifest->installed_time =
+ strdup(std::to_string(std::chrono::system_clock::to_time_t(
+ std::chrono::system_clock::now())).c_str());
+ return true;
+}
+
bool StepParse::FillPackageInfo(manifest_x* manifest) {
std::shared_ptr<const PackageInfo> pkg_info =
std::static_pointer_cast<const PackageInfo>(
manifest->package = strdup(pkg_info->package().c_str());
manifest->nodisplay_setting = strdup(pkg_info->nodisplay_setting().c_str());
manifest->type = strdup("tpk");
+ manifest->appsetting = strdup("false");
+ manifest->support_disable = strdup("false");
manifest->version = strdup(pkg_info->version().c_str());
manifest->installlocation = strdup(pkg_info->install_location().c_str());
manifest->api_version = strdup(pkg_info->api_version().c_str());
label_x* label = reinterpret_cast<label_x*>(calloc(1, sizeof(label_x)));
if (!pair.first.empty())
label->lang = strdup(pair.first.c_str());
+ else
+ label->lang = strdup(DEFAULT_LOCALE);
label->name = strdup(pair.second.c_str());
manifest->label = g_list_append(manifest->label, label);
}
author->text = strdup(author_info->name().c_str());
author->email = strdup(author_info->email().c_str());
author->href = strdup(author_info->href().c_str());
+ author->lang = strdup(DEFAULT_LOCALE);
manifest->author = g_list_append(manifest->author, author);
return true;
}
description_x* description = reinterpret_cast<description_x*>
(calloc(1, sizeof(description_x)));
- description->name = strdup(description_info->description().c_str());
- description->lang = strdup(description_info->xml_lang().c_str());
+ description->text = strdup(description_info->description().c_str());
+ description->lang = !description_info->xml_lang().empty() ?
+ strdup(description_info->xml_lang().c_str()) : strdup(DEFAULT_LOCALE);
manifest->description = g_list_append(manifest->description, description);
return true;
}
return true;
for (const auto& application : service_application_list->items) {
+ // if there is no app yet, set this app as mainapp
+ bool main_app = manifest->application == nullptr;
+
application_x* service_app =
static_cast<application_x*>(calloc(1, sizeof(application_x)));
service_app->appid = strdup(application.sa_info.appid().c_str());
service_app->autorestart =
strdup(application.sa_info.auto_restart().c_str());
- service_app->exec = strdup(application.sa_info.exec().c_str());
+ service_app->exec = strdup((context_->root_application_path.get()
+ / manifest->package / "bin"
+ / application.sa_info.exec()).c_str());
service_app->onboot = strdup(application.sa_info.on_boot().c_str());
service_app->type = strdup(application.sa_info.type().c_str());
service_app->process_pool =
strdup(application.sa_info.process_pool().c_str());
-
service_app->component_type = strdup("svcapp");
+ service_app->mainapp = main_app ? strdup("true") : strdup("false");
+ service_app->enabled = strdup("true");
+ service_app->hwacceleration = strdup("default");
+ service_app->screenreader = strdup("use-system-setting");
+ service_app->recentimage = strdup("false");
+ service_app->launchcondition = strdup("false");
+ service_app->indicatordisplay = strdup("true");
+ service_app->effectimage_type = strdup("image");
+ service_app->guestmode_visibility = strdup("true");
+ service_app->permission_type = strdup("normal");
+ service_app->submode = strdup("false");
+ service_app->process_pool = strdup("false");
+ service_app->ambient_support = strdup("false");
+ service_app->package = strdup(manifest->package);
+ service_app->support_disable = strdup(manifest->support_disable);
manifest->application = g_list_append(manifest->application, service_app);
if (!FillAppControl(service_app, application.app_control))
return true;
for (const auto& application : ui_application_list->items) {
+ // if there is no app yet, set this app as mainapp
+ bool main_app = manifest->application == nullptr;
+
application_x* ui_app =
static_cast<application_x*>(calloc(1, sizeof(application_x)));
ui_app->appid = strdup(application.ui_info.appid().c_str());
- ui_app->exec = strdup(application.ui_info.exec().c_str());
+ ui_app->exec = strdup((context_->root_application_path.get()
+ / manifest->package / "bin"
+ / application.ui_info.exec()).c_str());
ui_app->launch_mode = strdup(application.ui_info.launch_mode().c_str());
ui_app->multiple = strdup(application.ui_info.multiple().c_str());
ui_app->nodisplay = strdup(application.ui_info.nodisplay().c_str());
strdup(application.ui_info.submode_mainid().c_str());
ui_app->hwacceleration =
strdup(application.ui_info.hwacceleration().c_str());
+ ui_app->onboot = strdup("false");
+ ui_app->autorestart = strdup("false");
+ ui_app->component_type = strdup("uiapp");
+ ui_app->mainapp = main_app ? strdup("true") : strdup("false");
+ ui_app->enabled = strdup("true");
+ ui_app->screenreader = strdup("use-system-setting");
+ ui_app->recentimage = strdup("false");
+ ui_app->launchcondition = strdup("false");
+ ui_app->guestmode_visibility = strdup("true");
+ ui_app->permission_type = strdup("normal");
+ ui_app->ambient_support = strdup("false");
+ ui_app->package = strdup(manifest->package);
+ ui_app->support_disable = strdup(manifest->support_disable);
manifest->application = g_list_append(manifest->application, ui_app);
if (!FillAppControl(ui_app, application.app_control))
// Current implementation is just for compatibility.
icon->text = strdup(application_icon.path().c_str());
icon->name = strdup(application_icon.path().c_str());
+ icon->lang = strdup(DEFAULT_LOCALE);
app->icon = g_list_append(app->icon, icon);
}
return true;
// Current implementation is just for compatibility.
label->text = strdup(control.text().c_str());
label->name = strdup(control.name().c_str());
- label->lang = strdup(control.xml_lang().c_str());
+ label->lang = !control.xml_lang().empty() ?
+ strdup(control.xml_lang().c_str()) : strdup(DEFAULT_LOCALE);
app->label = g_list_append(app->label, label);
}
return true;
image_x* image =
static_cast<image_x*>(calloc(1, sizeof(image_x)));
image->name = strdup(app_image.name().c_str());
- std::string lang = app_image.lang();
+ const std::string& lang = app_image.lang();
if (!lang.empty())
image->lang = strdup(lang.c_str());
+ else
+ image->lang = strdup(DEFAULT_LOCALE);
+ if (!app_image.section().empty())
+ image->section = strdup(app_image.section().c_str());
app->image = g_list_append(app->image, image);
}
return true;
bool StepParse::FillManifestX(manifest_x* manifest) {
if (!FillPackageInfo(manifest))
return false;
+ if (!FillInstallationInfo(manifest))
+ return false;
if (!FillUIApplication(manifest))
return false;
if (!FillServiceApplication(manifest))
boost::filesystem::path path_;
private:
+ bool FillInstallationInfo(manifest_x* manifest);
bool FillPackageInfo(manifest_x* manifest);
bool FillAuthorInfo(manifest_x* manifest);
bool FillDescription(manifest_x* manifest);
#include <string.h>
+#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <memory>
namespace {
const std::string kManifestVersion = "1.0.0";
+const char kTizenPackageXmlNamespace[] = "http://tizen.org/ns/packages";
GList* GenerateMetadataListX(const wgt::parse::MetaDataInfo& meta_info) {
GList* list = nullptr;
return list;
}
+void SetApplicationXDefaults(application_x* application) {
+ application->ambient_support = strdup("false");
+ application->effectimage_type = strdup("image");
+ application->enabled = strdup("true");
+ application->guestmode_visibility = strdup("true");
+ application->hwacceleration = strdup("default");
+ application->indicatordisplay = strdup("true");
+ application->launchcondition = strdup("false");
+ application->permission_type = strdup("normal");
+ application->process_pool = strdup("false");
+ application->recentimage = strdup("false");
+ application->screenreader = strdup("use-system-setting");
+ application->submode = strdup("false");
+ application->support_disable = strdup("false");
+ application->taskmanage = strdup("true");
+ application->ui_gadget = strdup("false");
+}
+
} // namespace
namespace wgt {
namespace parse {
namespace app_keys = wgt::application_widget_keys;
+namespace sc = std::chrono;
StepParse::StepParse(common_installer::InstallerContext* context,
bool check_start_file)
return kManifestVersion;
}
+bool StepParse::FillInstallationInfo(manifest_x* manifest) {
+ manifest->root_path = strdup(
+ (context_->root_application_path.get() / manifest->package).c_str());
+ manifest->installed_time =
+ strdup(std::to_string(sc::system_clock::to_time_t(
+ sc::system_clock::now())).c_str());
+ return true;
+}
+
bool StepParse::FillIconPaths(manifest_x* manifest) {
std::shared_ptr<const ApplicationIconsInfo> icons_info =
std::static_pointer_cast<const ApplicationIconsInfo>(
for (auto& application_icon : icons_info->icons()) {
icon_x* icon = reinterpret_cast<icon_x*> (calloc(1, sizeof(icon_x)));
icon->text = strdup(application_icon.path().c_str());
+ icon->lang = strdup(DEFAULT_LOCALE);
manifest->icon = g_list_append(manifest->icon, icon);
}
}
const std::string& version = wgt_info->version();
+ manifest->ns = strdup(kTizenPackageXmlNamespace);
manifest->version = strdup(GetPackageVersion(version).c_str());
for (auto& item : wgt_info->description_set()) {
description_x* description = reinterpret_cast<description_x*>
(calloc(1, sizeof(description_x)));
- description->name = strdup(item.second.c_str());
- description->lang = strdup(item.first.c_str());
+ description->text = strdup(item.second.c_str());
+ description->lang = item.first.c_str() ?
+ strdup(item.first.c_str()) : strdup(DEFAULT_LOCALE);
manifest->description = g_list_append(manifest->description, description);
}
for (auto& item : wgt_info->name_set()) {
label_x* label = reinterpret_cast<label_x*>(calloc(1, sizeof(label_x)));
label->name = strdup(item.second.c_str());
- label->lang = strdup(item.first.c_str());
+ label->text = strdup(item.second.c_str());
+ label->lang = !item.first.empty() ?
+ strdup(item.first.c_str()) : strdup(DEFAULT_LOCALE);
manifest->label = g_list_append(manifest->label, label);
}
manifest->type = strdup("wgt");
+ manifest->appsetting = strdup("false");
manifest->nodisplay_setting = strdup("false");
// For wgt package use the long name
reinterpret_cast<application_x*>(manifest->application->data);
label_x* label = reinterpret_cast<label_x*>(calloc(1, sizeof(label_x)));
label->name = strdup(item.second.c_str());
- label->lang = strdup(item.first.c_str());
+ label->text = strdup(item.second.c_str());
+ label->lang = !item.first.empty() ?
+ strdup(item.first.c_str()) : strdup(DEFAULT_LOCALE);
app->label = g_list_append(app->label, label);
}
author->email = strdup(wgt_info->author_email().c_str());
if (!wgt_info->author_href().empty())
author->href = strdup(wgt_info->author_href().c_str());
+ author->lang = strdup(DEFAULT_LOCALE);
manifest->author = g_list_append(manifest->author, author);
std::shared_ptr<const SettingInfo> settings_info =
application_x* application = reinterpret_cast<application_x*>(
calloc(1, sizeof(application_x)));
application->component_type = strdup("uiapp");
+ application->mainapp = strdup("true");
+ application->nodisplay = strdup("false");
+ application->multiple = strdup("false");
application->appid = strdup(app_info->id().c_str());
+ SetApplicationXDefaults(application);
+ application->package = strdup(app_info->package().c_str());
+
+ application->exec =
+ strdup((context_->root_application_path.get() / app_info->package()
+ / "bin" / application->appid).c_str());
application->type = strdup("webapp");
+ application->onboot = strdup("false");
+ application->autorestart = strdup("false");
+
application->launch_mode = strdup(app_info->launch_mode().c_str());
if (manifest->icon) {
icon_x* icon = reinterpret_cast<icon_x*>(manifest->icon->data);
icon_x* app_icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
app_icon->text = strdup(icon->text);
+ app_icon->lang = strdup(icon->lang);
application->icon = g_list_append(application->icon, app_icon);
}
manifest->application = g_list_append(manifest->application, application);
application_x* application = reinterpret_cast<application_x*>
(calloc(1, sizeof(application_x)));
application->component_type = strdup("svcapp");
+ application->mainapp = strdup("false");
+ application->nodisplay = strdup("false");
+ application->multiple = strdup("false");
application->appid = strdup(service_info.id().c_str());
+ application->exec =
+ strdup((context_->root_application_path.get() / manifest->package
+ / "bin" / application->appid).c_str());
application->type = strdup("webapp");
application->onboot =
service_info.on_boot() ? strdup("true") : strdup("false");
application->autorestart =
service_info.auto_restart() ? strdup("true") : strdup("false");
+ SetApplicationXDefaults(application);
+ application->package = strdup(manifest->package);
for (auto& pair : service_info.names()) {
label_x* label = reinterpret_cast<label_x*>(calloc(1, sizeof(label_x)));
- if (!pair.first.empty())
- label->lang = strdup(pair.first.c_str());
+ label->lang = !pair.first.empty() ?
+ strdup(pair.first.c_str()) : strdup(DEFAULT_LOCALE);
label->name = strdup(pair.second.c_str());
+ label->text = strdup(pair.second.c_str());
application->label = g_list_append(application->label, label);
}
if (!service_info.icon().empty()) {
icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
icon->text = strdup(service_info.icon().c_str());
+ icon->lang = strdup(DEFAULT_LOCALE);
application->icon = g_list_append(application->icon, icon);
}
return false;
if (!FillWidgetInfo(manifest))
return false;
+ if (!FillInstallationInfo(manifest))
+ return false;
if (!FillPrivileges(manifest))
return false;
if (!FillAppControl(manifest))
const std::string& GetPackageVersion(const std::string& manifest_version);
+ bool FillInstallationInfo(manifest_x* manifest);
bool FillIconPaths(manifest_x* manifest);
bool FillWidgetInfo(manifest_x* manifest);
bool FillUIApplicationInfo(manifest_x* manifest);