*/
#include "ode-app.h"
+#include "ode-password.h"
#include <ode/external-encryption.h>
#include <ode/internal-encryption.h>
extern char *encrypt_header_text[];
static int sdcard_option_selected = 0;
static int device_full_encryption_state = 0;
+popup_data_s popup_data; /* for temporary */
#define sdcard_option_num 2
+
static void _confirm_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
int ret = 0;
switch (ad->view_type) {
case ENCRYPT_DEVICE:
dlog_print(DLOG_DEBUG, LOG_TAG, "encrypt device confirm");
- ret = ode_internal_encryption_encrypt("tizen", 0);
- if (ret != 0) {
- dlog_print(DLOG_DEBUG, LOG_TAG, "internal encryption failed");
- }
- ui_app_exit();
+ if (device_full_encryption_state == 0)
+ ad->device_info.device_option = 0;
+ else
+ ad->device_info.device_option = 1;
+ popup_data.parent = ad->base;
+ popup_data.popup = NULL;
+ popup_data.mode = INTERNAL_ENCRYPT_PASSWORD;
+ popup_data.callback_data = ad;
+ create_confirm_password_popup(&popup_data);
break;
case DECRYPT_DEVICE:
dlog_print(DLOG_DEBUG, LOG_TAG, "decrypt device confirm");
- ret = ode_internal_encryption_decrypt("tizen");
- if (ret != 0) {
- dlog_print(DLOG_DEBUG, LOG_TAG, "internal decryption failed");
- }
- ui_app_exit();
+ popup_data.parent = ad->base;
+ popup_data.popup = NULL;
+ popup_data.mode = INTERNAL_DECRYPT_PASSWORD;
+ create_confirm_password_popup(&popup_data);
break;
case ENCRYPT_SD_CARD:
dlog_print(DLOG_DEBUG, LOG_TAG, "encrypt sd card confrim");
bool result = 0;
popup_data_s *popup_data = (popup_data_s *)data;
+ /* for temporary start */
+ if (popup_data->mode == INTERNAL_ENCRYPT_PASSWORD || popup_data->mode == INTERNAL_DECRYPT_PASSWORD) {
+ snprintf(popup_data->entry_data, PATH_MAX, "%s", elm_entry_entry_get(confirm_entry));
+ evas_object_del(popup_data->popup);
+ password_result_callback(popup_data, "success");
+ return;
+ }
+ /* for temporary end */
ret = ode_external_encryption_verify_password(elm_entry_entry_get(confirm_entry), &result);
if (ret != ODE_ERROR_NONE) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to verify password");
*/
#include <ode/external-encryption.h>
+#include <ode/internal-encryption.h>
#include "ode-password.h"
static popup_data_s popup_data = {0,};
return;
}
break;
+ /* for temporary start */
+ case INTERNAL_ENCRYPT_PASSWORD:
+ ret = ode_internal_encryption_init_password(data->entry_data);
+ if (ret != ODE_ERROR_NONE) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to create internal data");
+ return;
+ }
+ ret = ode_internal_encryption_encrypt(data->entry_data, ad->device_info.device_option);
+ if (ret != 0) {
+ dlog_print(DLOG_DEBUG, LOG_TAG, "failed to encrypt internal storage");
+ return;
+ }
+ break;
+ case INTERNAL_DECRYPT_PASSWORD:
+ ret = ode_internal_encryption_decrypt(data->entry_data);
+ if (ret != 0) {
+ dlog_print(DLOG_DEBUG, LOG_TAG, "failed to decrypt internal storage");
+ return;
+ }
+ break;
+ /* for temporary end */
default:
break;
}