4 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
23 #include "app2ext_utils.h"
25 int _is_global(uid_t uid)
27 if (uid == OWNER_ROOT || uid == GLOBAL_USER)
33 char *_app2sd_get_encoded_name(const char *pkgid, uid_t uid)
35 char *new_name = NULL;
36 char *temp_string = NULL;
37 char source_name[FILENAME_MAX] = { 0, };
40 snprintf(source_name, FILENAME_MAX - 1, "%s_%d", pkgid, uid);
41 checksum = g_checksum_new(G_CHECKSUM_MD5);
42 g_checksum_update(checksum, (const guchar *)source_name, strlen(source_name));
43 temp_string = (char *)g_checksum_get_string(checksum);
44 _D("temp_string(%s)", temp_string);
45 new_name = strdup(temp_string);
46 g_checksum_free(checksum);
48 _D("new_name(%s)", new_name);