bool RegisterSecurityContextForApps(
const std::string& pkg_id, const boost::filesystem::path& path,
manifest_x* manifest) {
- for (uiapplication_x* ui = manifest->uiapplication;
- ui != nullptr; ui = ui->next) {
- if (!ui->appid) {
+ for (application_x* app = manifest->application;
+ app != nullptr; app = app->next) {
+ if (!app->appid) {
return false;
}
- if (!RegisterSecurityContext(ui->appid, pkg_id,
- path, manifest)) {
- return false;
- }
- }
-
- for (serviceapplication_x* svc =
- manifest->serviceapplication;
- svc != nullptr; svc = svc->next) {
- if (!svc->appid) {
- return false;
- }
- if (!RegisterSecurityContext(svc->appid, pkg_id,
+ if (!RegisterSecurityContext(app->appid, pkg_id,
path, manifest)) {
return false;
}
bool UnregisterSecurityContextForApps(
const std::string& pkg_id, manifest_x* manifest) {
- for (uiapplication_x* ui = manifest->uiapplication;
- ui != nullptr; ui = ui->next) {
- if (!ui->appid) {
- return false;
- }
- if (!UnregisterSecurityContext(ui->appid, pkg_id)) {
- return false;
- }
- }
-
- for (serviceapplication_x* svc =
- manifest->serviceapplication;
- svc != nullptr; svc = svc->next) {
- if (!svc->appid) {
+ for (application_x* app = manifest->application;
+ app != nullptr; app = app->next) {
+ if (!app->appid) {
return false;
}
- if (!UnregisterSecurityContext(svc->appid, pkg_id)) {
+ if (!UnregisterSecurityContext(app->appid, pkg_id)) {
return false;
}
}
namespace backup {
Step::Status StepBackupIcons::process() {
- uiapplication_x* ui = context_->old_manifest_data.get()->uiapplication;
+ application_x* app = context_->old_manifest_data.get()->application;
// gather icon info
- for (; ui != nullptr; ui = ui->next) {
+ for (; app != nullptr; app = app->next) {
+ if (strcmp(app->component_type, "uiapp") != 0)
+ continue;
+
bf::path app_icon = bf::path(getIconPath(context_->uid.get()))
- / bf::path(ui->appid);
- if (ui->icon && ui->icon->text)
- app_icon += bf::path(ui->icon->text).extension();
+ / bf::path(app->appid);
+ if (app->icon && app->icon->text)
+ app_icon += bf::path(app->icon->text).extension();
else
app_icon += ".png";
bf::path icon_backup = GetBackupPathForIconFile(app_icon);
}
}
- uiapplication_x* ui = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->uiapplication,
- ui);
- for (; ui; ui = ui->next) {
+ application_x* app = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->application,
+ app);
+ for (; app; app = app->next) {
+ if (strcmp(app->component_type, "uiapp") != 0)
+ continue;
+
// TODO(t.iwanek): this is ignoring icon locale as well as other steps
// icons should be localized
- if (ui->icon && ui->icon->text) {
- bf::path source = GetIconRoot() / ui->icon->text;
+ if (app->icon && app->icon->text) {
+ bf::path source = GetIconRoot() / app->icon->text;
if (bf::exists(source)) {
- bf::path destination = icons_directory / ui->appid;
+ bf::path destination = icons_directory / app->appid;
if (source.has_extension())
destination += source.extension();
else
namespace bs = boost::system;
namespace bf = boost::filesystem;
-namespace common_installer {
-namespace pkgmgr {
-
-static void _writeUIApplicationAttributes(
- xmlTextWriterPtr writer, uiapplication_x */*app*/) {
- xmlTextWriterWriteAttribute(writer, BAD_CAST "taskmanage",
- BAD_CAST "true");
+namespace {
+
+void WriteUIApplicationAttributes(
+ xmlTextWriterPtr writer, application_x *app) {
+ xmlTextWriterWriteAttribute(writer, BAD_CAST "taskmanage",
+ BAD_CAST "true");
+ if (app->nodisplay)
+ xmlTextWriterWriteAttribute(writer, BAD_CAST "nodisplay",
+ BAD_CAST app->nodisplay);
}
-static void _writeServiceApplicationAttributes(
- xmlTextWriterPtr writer, serviceapplication_x *app) {
+void WriteServiceApplicationAttributes(
+ xmlTextWriterPtr writer, application_x *app) {
xmlTextWriterWriteAttribute(writer, BAD_CAST "auto-restart",
BAD_CAST(app->autorestart ? app->autorestart : "false"));
xmlTextWriterWriteAttribute(writer, BAD_CAST "on-boot",
BAD_CAST(app->permission_type ? app->permission_type : ""));
}
-template <typename T>
+} // namespace
+
+namespace common_installer {
+namespace pkgmgr {
+
common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml(
- T* app, xmlTextWriterPtr writer) {
- // common appributes among uiapplication_x and serviceapplication_x
+ application_x* app, xmlTextWriterPtr writer, bool is_service) {
xmlTextWriterWriteAttribute(writer, BAD_CAST "appid", BAD_CAST app->appid);
// binary is a symbolic link named <appid> and is located in <pkgid>/<appid>
xmlTextWriterWriteAttribute(writer, BAD_CAST "type", BAD_CAST "capp");
// app-specific attributes
- if (std::is_same<T, uiapplication_x>::value)
- _writeUIApplicationAttributes(
- writer, reinterpret_cast<uiapplication_x *>(app));
- if (std::is_same<T, serviceapplication_x>::value)
- _writeServiceApplicationAttributes(
- writer, reinterpret_cast<serviceapplication_x *>(app));
+ if (is_service)
+ WriteServiceApplicationAttributes(writer, app);
+ else
+ WriteUIApplicationAttributes(writer, app);
if (app->label) {
label_x* label = nullptr;
LISTHEAD(app->label, label);
LOG(ERROR) << "pkgid attribute is empty";
return Step::Status::INVALID_VALUE; }
- if ((!context_->manifest_data.get()->uiapplication) &&
- (!context_->manifest_data.get()->serviceapplication)) {
- LOG(ERROR) << "There is neither UI applications nor"
- << "Services applications described!";
+ if (!context_->manifest_data.get()->application) {
+ LOG(ERROR) << "No application in package";
return Step::Status::INVALID_VALUE;
}
// TODO(p.sikorski) check context_->uid.get()
}
}
- // add ui-application element per ui application
- uiapplication_x* ui = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->uiapplication,
- ui);
- for (; ui; ui = ui->next) {
- xmlTextWriterStartElement(writer, BAD_CAST "ui-application");
- if (ui->nodisplay)
- xmlTextWriterWriteAttribute(writer, BAD_CAST "nodisplay",
- BAD_CAST ui->nodisplay);
- GenerateApplicationCommonXml(ui, writer);
- xmlTextWriterEndElement(writer);
- }
- // add service-application element per service application
- serviceapplication_x* svc = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(
- context_->manifest_data.get()->serviceapplication, svc);
- for (; svc; svc = svc->next) {
- xmlTextWriterStartElement(writer, BAD_CAST "service-application");
- GenerateApplicationCommonXml(svc, writer);
+ // add application
+ application_x* app = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->application,
+ app);
+ for (; app; app = app->next) {
+ bool is_service = false;
+ if (strcmp(app->component_type, "uiapp") == 0) {
+ xmlTextWriterStartElement(writer, BAD_CAST "ui-application");
+ } else if (strcmp(app->component_type, "svcapp") == 0) {
+ is_service = true;
+ xmlTextWriterStartElement(writer, BAD_CAST "svc-application");
+ } else {
+ LOG(ERROR) << "Unknown application component_type";
+ xmlFreeTextWriter(writer);
+ return Status::ERROR;
+ }
+ GenerateApplicationCommonXml(app, writer, is_service);
xmlTextWriterEndElement(writer);
}
Status precheck() override;
private:
- // This function is used to generate common xml data
- // for uiapplication_x and applicationservice_x, as these
- // structures contain common elements
- template <typename T>
- Step::Status GenerateApplicationCommonXml(T* app, xmlTextWriterPtr writer);
+ Step::Status GenerateApplicationCommonXml(application_x* app,
+ xmlTextWriterPtr writer,
+ bool is_service);
SCOPE_LOG_TAG(GenerateXML)
};
Step::Status StepKillApps::process() {
manifest_x* old_manifest = context_->old_manifest_data.get() ?
context_->old_manifest_data.get() : context_->manifest_data.get();
- uiapplication_x* ui = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(old_manifest->uiapplication, ui);
+ application_x* ui = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(old_manifest->application, ui);
for (; ui; ui = ui->next) {
if (!ui->appid)
continue;
(void) KillApp(ui->appid);
}
- serviceapplication_x * svc = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(old_manifest->serviceapplication, svc);
- for (; svc; svc = svc->next) {
- if (!svc->appid)
- continue;
- (void) KillApp(svc->appid);
- }
return Status::OK;
}
bool StepRecoverIcons::TryGatherIcons() {
if (!context_->manifest_data.get())
return false;
- uiapplication_x* ui = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->uiapplication,
- ui);
- for (; ui != nullptr; ui = ui->next) {
+ application_x* app = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->application,
+ app);
+ for (; app != nullptr; app = app->next) {
+ if (strcmp(app->component_type, "uiapp") != 0)
+ continue;
+
bf::path app_icon = bf::path(getIconPath(context_->uid.get()))
- / bf::path(ui->appid);
- if (ui->icon && ui->icon->text)
- app_icon += bf::path(ui->icon->text).extension();
+ / bf::path(app->appid);
+ if (app->icon && app->icon->text)
+ app_icon += bf::path(app->icon->text).extension();
else
app_icon += ".png";
bf::path icon_backup = GetBackupPathForIconFile(app_icon);
}
Step::Status StepRemoveIcons::process() {
- uiapplication_x* ui = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->uiapplication,
- ui);
- for (; ui != nullptr; ui = ui->next) {
+ application_x* app = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(context_->manifest_data.get()->application,
+ app);
+ for (; app != nullptr; app = app->next) {
+ if (strcmp(app->component_type, "uiapp") != 0)
+ continue;
+
bf::path app_icon = bf::path(getIconPath(context_->uid.get()))
- / bf::path(ui->appid);
- if (ui->icon && ui->icon->text)
- app_icon += bf::path(ui->icon->text).extension();
+ / bf::path(app->appid);
+ if (app->icon && app->icon->text)
+ app_icon += bf::path(app->icon->text).extension();
else
app_icon += ".png";
if (bf::exists(app_icon)) {
#include "common/step/step.h"
#include "common/app_installer.h"
#include "common/context_installer.h"
+#include "common/utils/clist_helpers.h"
#include "common/utils/file_util.h"
#include "common/utils/logging.h"
-
namespace tpk {
namespace filesystem {
namespace {
-template <typename T>
-bool CreateSymLink(T *app, ContextInstaller* context) {
+bool CreateSymLink(application_x* app, ContextInstaller* context) {
boost::system::error_code boost_error;
+ bf::path bindir = context->pkg_path.get() /
+ bf::path("bin");
+ LOG(DEBUG) << "Creating dir: " << bindir;
+ if (!common_installer::CreateDir(bindir)) {
+ LOG(ERROR) << "Directory creation failure: " << bindir;
+ return false;
+ }
+
+ // Exec path
+ // Make a symlink with the name of appid, pointing exec file
+ bf::path symlink_path = bindir / bf::path(app->appid);
+ LOG(DEBUG) << "Creating symlink " << symlink_path << " pointing " <<
+ app->exec;
+ bf::create_symlink(bf::path(app->exec), symlink_path, boost_error);
+ if (boost_error) {
+ LOG(ERROR) << "Symlink creation failure: " << symlink_path;
+ return false;
+ }
- for (; app != nullptr; app=app->next) {
- bf::path bindir = context->pkg_path.get() /
- bf::path("bin");
- LOG(INFO) << "Creating dir: " << bindir;
- if (!common_installer::CreateDir(bindir)) {
- LOG(ERROR) << "Directory creation failure: " << bindir;
- return false;
- }
-
- // Exec path
- // Make a symlink with the name of appid, pointing exec file
- bf::path symlink_path = bindir / bf::path(app->appid);
- LOG(INFO) << "Creating symlink " << symlink_path << " pointing " <<
- app->exec;
- bf::create_symlink(bf::path(app->exec), symlink_path, boost_error);
- if (boost_error) {
- LOG(ERROR) << "Symlink creation failure: " << symlink_path;
- return false;
- }
-
- // Give an execution permission to the original executable
- bf::path exec_path = bindir / bf::path(app->exec);
- LOG(INFO) << "Giving exec permission to " << exec_path;
- bf::permissions(exec_path, bf::owner_all |
- bf::group_read | bf::group_exe |
- bf::others_read | bf::others_exe, boost_error);
- if (boost_error) {
- LOG(ERROR) << "Permission change failure";
- return false;
- }
+ // 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 |
+ bf::group_read | bf::group_exe |
+ bf::others_read | bf::others_exe, boost_error);
+ if (boost_error) {
+ LOG(ERROR) << "Permission change failure";
+ return false;
}
return true;
}
-
-template <typename T>
-bool RemoveSymLink(T *app, ContextInstaller* context) {
+bool RemoveSymLink(application_x* app, ContextInstaller* context) {
/* NOTE: Unlike WRT app, tpk apps have bin/ directory by default.
* So we don't remove the bin/ directory.
*/
- for (; app != nullptr; app=app->next) {
- bf::path exec_path = bf::path(context->pkg_path.get()) / bf::path("bin");
- bf::remove_all(exec_path / bf::path(app->appid));
- }
+ bf::path exec_path = bf::path(context->pkg_path.get()) / bf::path("bin");
+ bf::remove_all(exec_path / bf::path(app->appid));
return true;
}
LOG(ERROR) << "manifest_data attribute is empty";
return Step::Status::INVALID_VALUE;
}
- if (!(m->uiapplication || m->serviceapplication)) {
- LOG(ERROR) << "Neither ui-application nor service-application exists";
+ if (!m->application) {
+ LOG(ERROR) << "No application exists";
return Step::Status::ERROR;
}
}
Status StepCreateSymbolicLink::process() {
- // Get manifest_x
- manifest_x *m = context_->manifest_data.get();
-
- // get ui-app and service-app
- uiapplication_x *uiapp = m->uiapplication;
- serviceapplication_x *svcapp = m->serviceapplication;
-
- if (!CreateSymLink(uiapp, context_)) return Status::ERROR;
- if (!CreateSymLink(svcapp, context_)) return Status::ERROR;
+ manifest_x* m = context_->manifest_data.get();
+ application_x* app = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(m->application, app);
+ for (; app; app = app->next) {
+ if (!CreateSymLink(app, context_))
+ return Status::ERROR;
+ }
return Status::OK;
}
Status StepCreateSymbolicLink::undo() {
manifest_x* m = context_->manifest_data.get();
- uiapplication_x *uiapp = m->uiapplication;
- serviceapplication_x *svcapp = m->serviceapplication;
-
Step::Status ret = Status::OK;
- if (!RemoveSymLink(uiapp, context_)) {
- LOG(ERROR) << "Cannot remove Symboliclink for uiapp";
- ret = Status::ERROR;
- }
- if (!RemoveSymLink(svcapp, context_)) {
- LOG(ERROR) << "Cannot remove Symboliclink for svcapp";
- ret = Status::ERROR;
+ application_x* app = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(m->application, app);
+ for (; app; app = app->next) {
+ if (!CreateSymLink(app, context_))
+ ret = Status::ERROR;
}
-
return ret;
}
return true;
for (const auto& application : service_application_list->items) {
- serviceapplication_x* service_app =
- static_cast<serviceapplication_x*>
- (calloc(1, sizeof(serviceapplication_x)));
+ 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->onboot = strdup(application.sa_info.on_boot().c_str());
service_app->type = strdup(application.sa_info.type().c_str());
- LISTADD(manifest->serviceapplication, service_app);
+ service_app->component_type = strdup("svcapp");
+ LISTADD(manifest->application, service_app);
if (!FillAppControl(service_app, application.app_control))
return false;
return true;
for (const auto& application : ui_application_list->items) {
- uiapplication_x* ui_app =
- static_cast<uiapplication_x*>
- (calloc(1, sizeof(uiapplication_x)));
+ 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->multiple = strdup(application.ui_info.multiple().c_str());
ui_app->nodisplay = strdup(application.ui_info.nodisplay().c_str());
ui_app->taskmanage = strdup(application.ui_info.taskmanage().c_str());
ui_app->type = strdup(application.ui_info.type().c_str());
- LISTADD(manifest->uiapplication, ui_app);
+ ui_app->component_type = strdup("uiapp");
+ LISTADD(manifest->application, ui_app);
if (!FillAppControl(ui_app, application.app_control))
return false;
return true;
}
-template <typename T1, typename T2>
-bool StepParse::FillAppControl(T1* app, const T2& app_control_list) {
- static_assert(
- std::is_same<typename std::remove_pointer<T1>::type,
- uiapplication_x>::value ||
- std::is_same<typename std::remove_pointer<T1>::type,
- serviceapplication_x>::value,
- "T1 should be uiapplication_x or serviceapplication_x");
+template <typename T>
+bool StepParse::FillAppControl(application_x* app, const T& app_control_list) {
if (app_control_list.empty())
return true;
return true;
}
-template <typename T1, typename T2>
-bool StepParse::FillDataControl(T1* app, const T2& data_control_list) {
- static_assert(
- std::is_same<typename std::remove_pointer<T1>::type,
- uiapplication_x>::value ||
- std::is_same<typename std::remove_pointer<T1>::type,
- serviceapplication_x>::value,
- "T1 should be uiapplication_x or serviceapplication_x");
+template <typename T>
+bool StepParse::FillDataControl(application_x* app,
+ const T& data_control_list) {
if (data_control_list.empty())
return true;
return true;
}
-template <typename T1, typename T2>
-bool StepParse::FillApplicationIconPaths(T1* app, const T2& icons_info) {
- static_assert(
- std::is_same<typename std::remove_pointer<T1>::type,
- uiapplication_x>::value ||
- std::is_same<typename std::remove_pointer<T1>::type,
- serviceapplication_x>::value,
- "T1 should be uiapplication_x or serviceapplication_x");
+template <typename T>
+bool StepParse::FillApplicationIconPaths(application_x* app,
+ const T& icons_info) {
for (auto& application_icon : icons_info.icons()) {
icon_x* icon = reinterpret_cast<icon_x*> (calloc(1, sizeof(icon_x)));
// NOTE: name is an attribute, but the xml writer uses it as text.
return true;
}
-template <typename T1, typename T2>
-bool StepParse::FillLabel(T1* app, const T2& label_list) {
- static_assert(
- std::is_same<typename std::remove_pointer<T1>::type,
- uiapplication_x>::value ||
- std::is_same<typename std::remove_pointer<T1>::type,
- serviceapplication_x>::value,
- "T1 should be uiapplication_x or serviceapplication_x");
+template <typename T>
+bool StepParse::FillLabel(application_x* app, const T& label_list) {
if (label_list.empty())
return true;
return true;
}
-template <typename T1, typename T2>
-bool StepParse::FillMetadata(T1* app, const T2& meta_data_list) {
- static_assert(
- std::is_same<typename std::remove_pointer<T1>::type,
- uiapplication_x>::value ||
- std::is_same<typename std::remove_pointer<T1>::type,
- serviceapplication_x>::value,
- "T1 should be uiapplication_x or serviceapplication_x");
+template <typename T>
+bool StepParse::FillMetadata(application_x* app, const T& meta_data_list) {
if (meta_data_list.empty())
return true;
bool FillPrivileges(manifest_x* manifest);
bool FillServiceApplication(manifest_x* manifest);
bool FillUIApplication(manifest_x* manifest);
- template <typename T1, typename T2>
- bool FillAppControl(T1* manifest, const T2& app_control_list);
- template <typename T1, typename T2> bool
- FillDataControl(T1* manifest, const T2& data_control_list);
- template <typename T1, typename T2>
- bool FillApplicationIconPaths(T1* manifest, const T2& icons_info);
- template <typename T1, typename T2>
- bool FillLabel(T1* manifest, const T2& label_list);
- template <typename T1, typename T2>
- bool FillMetadata(T1* manifest, const T2& meta_data_list);
+ template <typename T>
+ bool FillAppControl(application_x* manifest, const T& app_control_list);
+ template <typename T>
+ bool FillDataControl(application_x* manifest, const T& data_control_list);
+ template <typename T>
+ bool FillApplicationIconPaths(application_x* manifest,
+ const T& icons_info);
+ template <typename T>
+ bool FillLabel(application_x* manifest, const T& label_list);
+ template <typename T>
+ bool FillMetadata(application_x* manifest, const T& meta_data_list);
bool FillAccounts();
bool FillManifestX(manifest_x* manifest);
common_installer::Step::Status StepCreateSymbolicLink::process() {
assert(context_->manifest_data.get());
boost::system::error_code error;
- uiapplication_x* ui = context_->manifest_data.get()->uiapplication;
- serviceapplication_x* svc =
- context_->manifest_data.get()->serviceapplication;
- if ((!ui) && (!svc)) {
- LOG(ERROR) << "There is neither UI applications nor"
- << "Services applications described!";
+ application_x* app = context_->manifest_data.get()->application;
+ if (!app) {
+ LOG(ERROR) << "There is no application described!";
return Step::Status::ERROR;
}
// add ui-application element per ui application
- for (; ui != nullptr; ui = ui->next) {
+ for (; app != nullptr; app = app->next) {
// binary is a symbolic link named <appid> and is located in <pkgid>/<appid>
bf::path exec_path =
context_->pkg_path.get()
/ bf::path("bin");
common_installer::CreateDir(exec_path);
- exec_path /= bf::path(ui->appid);
-
- bf::create_symlink(bf::path(WRT_LAUNCHER), exec_path, error);
- if (error) {
- LOG(ERROR) << "Failed to set symbolic link "
- << boost::system::system_error(error).what();
- return Step::Status::ERROR;
- }
- }
- for (; svc != nullptr; svc = svc->next) {
- // binary is a symbolic link named <appid> and is located in <pkgid>/<appid>
- bf::path exec_path = context_->pkg_path.get() / bf::path("bin");
- common_installer::CreateDir(exec_path);
-
- exec_path /= bf::path(svc->appid);
+ exec_path /= bf::path(app->appid);
bf::create_symlink(bf::path(WRT_LAUNCHER), exec_path, error);
if (error) {
}
common_installer::Step::Status StepCreateSymbolicLink::undo() {
- uiapplication_x* ui = context_->manifest_data.get()->uiapplication;
- serviceapplication_x* svc = context_->manifest_data.get()->serviceapplication;
+ application_x* app = context_->manifest_data.get()->application;
- for (; ui != nullptr; ui = ui->next) {
- bf::path exec_path = context_->pkg_path.get() / bf::path("bin");
- if (bf::exists(exec_path))
- bf::remove_all(exec_path);
- }
- for (; svc != nullptr; svc = svc->next) {
+ for (; app != nullptr; app = app->next) {
bf::path exec_path = context_->pkg_path.get() / bf::path("bin");
if (bf::exists(exec_path))
bf::remove_all(exec_path);
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());
- LISTADD(manifest->uiapplication->label, label);
+ LISTADD(manifest->application->label, label);
}
author_x* author = reinterpret_cast<author_x*>(calloc(1, sizeof(author_x)));
return false;
}
// application data
- manifest->serviceapplication = nullptr;
- manifest->uiapplication = reinterpret_cast<uiapplication_x*>
- (calloc (1, sizeof(uiapplication_x)));
- manifest->uiapplication->appcontrol = nullptr;
- manifest->uiapplication->icon =
+ manifest->application = reinterpret_cast<application_x*>
+ (calloc (1, sizeof(application_x)));
+ manifest->application->component_type = strdup("uiapp");
+ manifest->application->icon =
reinterpret_cast<icon_x*> (calloc(1, sizeof(icon_x)));
-
- manifest->uiapplication->appid = strdup(app_info->id().c_str());
- manifest->uiapplication->type = strdup("webapp");
-
+ manifest->application->appid = strdup(app_info->id().c_str());
+ manifest->application->type = strdup("webapp");
+ manifest->package = strdup(app_info->package().c_str());
+ manifest->mainapp_id = strdup(app_info->id().c_str());
if (manifest->icon) {
icon_x* icon = nullptr;
LISTHEAD(manifest->icon, icon);
- manifest->uiapplication->icon->text = strdup(icon->text);
+ manifest->application->icon->text = strdup(icon->text);
}
- manifest->uiapplication->next = nullptr;
-
- manifest->package = strdup(app_info->package().c_str());
- manifest->mainapp_id = strdup(app_info->id().c_str());
return true;
}
app_control->operation = strdup(control.operation().c_str());
app_control->mime = strdup(control.mime().c_str());
app_control->uri = strdup(control.uri().c_str());
- LISTADD(manifest->uiapplication->appcontrol, app_control);
+ LISTADD(manifest->application->appcontrol, app_control);
}
}
return true;
if (!meta_info)
return true;
- uiapplication_x* ui_app = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(manifest->uiapplication, ui_app);
- for (; ui_app; ui_app = ui_app->next) {
- manifest->uiapplication->metadata =
- GenerateMetadataListX(*meta_info, manifest->uiapplication->metadata);
- }
- serviceapplication_x* svc_app = nullptr;
- PKGMGR_LIST_MOVE_NODE_TO_HEAD(manifest->serviceapplication, svc_app);
- for (; svc_app; svc_app = svc_app->next) {
- manifest->serviceapplication->metadata =
- GenerateMetadataListX(*meta_info,
- manifest->serviceapplication->metadata);
+ application_x* app = nullptr;
+ PKGMGR_LIST_MOVE_NODE_TO_HEAD(manifest->application, app);
+ for (; app; app = app->next) {
+ manifest->application->metadata =
+ GenerateMetadataListX(*meta_info, manifest->application->metadata);
}
return true;
}
LOG(DEBUG) << " name = " << name;
LOG(DEBUG) << " short_name = " << short_name;
LOG(DEBUG) << " aplication version = " << package_version;
- LOG(DEBUG) << " icon = " << manifest->uiapplication->icon->text;
+ LOG(DEBUG) << " icon = " << manifest->application->icon->text;
LOG(DEBUG) << " api_version = " << info->required_version();
LOG(DEBUG) << " privileges -[";
for (const auto& p : permissions) {