- Remove launchpad and app-bundle to remove dependence on aul and bundle.
- Using launchpad is replaced with using ode-password service.
- ode-key-storage-plugin : need to dependency of capi-base-common by this change.
Change-Id: I5fe07b951738ab72deec80b271f7714929269a24
Signed-off-by: seolheui kim <s414.kim@samsung.com>
SET(PC_FILE "${PROJECT_NAME}-key-storage-plugin.pc")
+SET(DEPENDENCY capi-base-common)
+PKG_CHECK_MODULES(PC_DEPS REQUIRED ${DEPENDENCY})
+INCLUDE_DIRECTORIES(SYSTEM ${PC_DEPS_INCLUDE_DIRS})
+
CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_BINARY_DIR}/${PC_FILE} @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/${PC_FILE} DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
BuildRequires: cmake
BuildRequires: gettext-tools
BuildRequires: pkgconfig(klay)
+BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(aul)
-BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(libcrypto)
%package ksp-devel
Summary: Header files for key storage plugin development
Group: Development/Libraries
+BuildRequires: pkgconfig(capi-base-common)
%description ksp-devel
The ode-ksp-devel package includes header files necessary for key storage
#
SET(SERVER_SRCS main.cpp
server.cpp
- launchpad.cpp
misc.cpp
ext4-tool.cpp
- app-bundle.cpp
file-footer.cpp
secure-erase.cpp
progress-bar.cpp
)
SET(DEPENDENCY klay
+ vconf
glib-2.0
gio-2.0
- aul
- bundle
libtzplatform-config
cynara-client
libcrypto
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-#include <memory>
-
-#include <klay/exception.h>
-
-#include "app-bundle.h"
-
-AppBundle::AppBundle() :
- handle(nullptr)
-{
- handle = ::bundle_create();
- if (handle == nullptr) {
- throw runtime::Exception("Failed to create bundle");
- }
-}
-
-AppBundle::~AppBundle()
-{
- ::bundle_free(handle);
-}
-
-void AppBundle::addInternal(const std::string& key, const std::string& value)
-{
- ::bundle_add_str(handle, key.c_str(), value.c_str());
-}
-
-void AppBundle::addArrayInternal(const std::string& key, const std::vector<std::string>& array)
-{
- std::unique_ptr<const char*[]> arrayptr(new const char*[array.size()]);
-
- int index = 0;
- for (const std::string& data : array) {
- arrayptr.get()[index++] = data.c_str();
- }
-
- ::bundle_add_str_array(handle, key.c_str(), arrayptr.get(), array.size());
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-#ifndef __DPM_APP_BUNDLE_H__
-#define __DPM_APP_BUNDLE_H__
-
-#include <string>
-#include <vector>
-
-#include <bundle.h>
-
-class AppBundle {
-public:
- AppBundle();
- ~AppBundle();
-
- template<typename T>
- void add(const std::string& key, const std::vector<T>& value)
- {
- addArrayInternal(key, value);
- }
-
- template<typename T>
- void add(const std::string& key, const T& value)
- {
- addInternal(key, value);
- }
-
- bundle* get() const
- {
- return handle;
- }
-
-private:
- void addInternal(const std::string& key, const std::string& value);
- void addArrayInternal(const std::string& key, const std::vector<std::string>& array);
-
-private:
- bundle* handle;
-};
-
-#endif //__DPM_APP_BUNDLE_H__
#include "misc.h"
#include "logger.h"
-#include "launchpad.h"
-#include "app-bundle.h"
#include "progress-bar.h"
#include "rmi/common.h"
#include "file-footer.h"
{
INFO(SINK, "Launching SD card password popup.");
try {
- AppBundle bundle;
- bundle.add("viewtype", "SD_CARD_PASSWORD");
-
- Launchpad launchpad(::tzplatform_getuid(TZ_SYS_DEFAULT_USER));
- launchpad.launch("org.tizen.ode", bundle);
+ dbus::Connection &systemDBus = dbus::Connection::getSystem();
+ std::string unit("ode-password@external.service");
+
+ systemDBus.methodcall("org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "StartUnit",
+ -1, "", "(ss)", unit.c_str(), "replace");
} catch (runtime::Exception &e) {
ERROR(SINK, "Failed to launch SD card password popup: " + std::string(e.what()));
}
externalCallback);
systemDBus.subscribeSignal("",
- "/Org/Tizen/System/Pass/Core",
- "org.tizen.system.pass.core",
+ "/Org/Tizen/System/DeviceD/Core",
+ "org.tizen.system.deviced.core",
"BootingDone",
bootCompletionCallback);
}
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-
-#include <aul.h>
-#include <klay/exception.h>
-
-#include "logger.h"
-#include "launchpad.h"
-
-Launchpad::Launchpad(const uid_t uid) :
- user(uid)
-{
- if (user == 0) {
- throw runtime::Exception("No logined user for launching app");
- }
-}
-
-bool Launchpad::isRunning(const std::string& appid)
-{
- return ::aul_app_is_running_for_uid(appid.c_str(), user);
-}
-
-void Launchpad::launch(const std::string& appid)
-{
- launch(appid, AppBundle());
-}
-
-void Launchpad::launch(const std::string& appid, const AppBundle& bundle)
-{
- if (::aul_launch_app_for_uid(appid.c_str(), bundle.get(), user) < 0) {
- throw runtime::Exception("Failed to launch app " + appid);
- }
-}
-
-void Launchpad::resume(const std::string& appid)
-{
- if (::aul_resume_app_for_uid(appid.c_str(), user) < 0) {
- throw runtime::Exception("Failed to resume app " + appid);
- }
-}
-
-void Launchpad::terminate(const std::string& appid)
-{
- int pid = ::aul_app_get_pid_for_uid(appid.c_str(), user);
- if (pid > 0) {
- if (::aul_terminate_pid_for_uid(pid, user) < 0) {
- WARN(SINK, "Failed to terminate app PID=" + std::to_string(pid));
- ::kill(pid, SIGKILL);
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-#ifndef __DPM_LAUNCHPAD_H__
-#define __DPM_LAUNCHPAD_H__
-
-#include <string>
-
-#include "app-bundle.h"
-
-class Launchpad {
-public:
- Launchpad(const uid_t uid = 0);
- Launchpad(const Launchpad&) = delete;
- Launchpad(Launchpad&&) = delete;
-
- void launch(const std::string& appid);
- void launch(const std::string& appid, const AppBundle& bundle);
- void resume(const std::string& appid);
- bool isRunning(const std::string& appid);
- void terminate(const std::string& appid);
-
-private:
- uid_t user;
-};
-
-#endif //__DPM_LAUNCHPAD_H__