<commit_before>package com.kii.cloud.sync;

import java.io.IOException;

import org.json.JSONException;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;

import com.kii.cloud.storage.EasyClient;
import com.kii.cloud.storage.dataType.KiiUser;
import com.kii.cloud.storage.manager.AuthManager;
import com.kii.cloud.storage.response.CloudExecutionException;
import com.kii.cloud.storage.response.UserResult;
import com.kii.mobilesdk.bridge.AppUtil;
import com.kii.mobilesdk.bridge.KiiUMInfo;
import com.kii.sync.KiiClient;
import com.kii.sync.SyncMsg;

/**
 * The Authentication is using the Cloud Storage
 */
public class CloudStorage implements Authentication {

    static final String TAG = "CloudStorageAuthentication";

    static final String PROPERTY_COUNTRY = "country";

    static final String URL_PFS = "/app/sync/pfs";
    static final String URL_RESOURCE = "/app/resource";
    static final String URL_USERGRID = ":12110";

    final String mBaseURL;

    KiiClient mSyncClient = null;
    AuthManager mUserMgr = null;
    Context mContext;

    public CloudStorage(Context context, KiiClient client, String baseURL) {
        mSyncClient = client;
        mContext = context;

        mBaseURL = baseURL;

        Bundle data = AppUtil.getAppInfo(context);
        String appId = data.getString(AppUtil.PREF_UM_APP_ID);
        if (TextUtils.isEmpty(appId)) {
            throw new RuntimeException(AppUtil.PREF_UM_APP_ID
                    + " meta data is not found in Manifest");
        }
        String appKey = data.getString(AppUtil.PREF_UM_APP_KEY);<commit_msg>TianYang: don't use AppUtils, use KiiUMInfo instead<commit_after>package com.kii.cloud.sync;

import java.io.IOException;

import org.json.JSONException;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;

import com.kii.cloud.storage.EasyClient;
import com.kii.cloud.storage.dataType.KiiUser;
import com.kii.cloud.storage.manager.AuthManager;
import com.kii.cloud.storage.response.CloudExecutionException;
import com.kii.cloud.storage.response.UserResult;
import com.kii.mobilesdk.bridge.AppUtil;
import com.kii.mobilesdk.bridge.KiiUMInfo;
import com.kii.sync.KiiClient;
import com.kii.sync.SyncMsg;

/**
 * The Authentication is using the Cloud Storage
 */
public class CloudStorage implements Authentication {

    static final String TAG = "CloudStorageAuthentication";

    static final String PROPERTY_COUNTRY = "country";

    static final String URL_PFS = "/app/sync/pfs";
    static final String URL_RESOURCE = "/app/resource";
    static final String URL_USERGRID = ":12110";

    final String mBaseURL;

    KiiClient mSyncClient = null;
    AuthManager mUserMgr = null;
    Context mContext;

    public CloudStorage(Context context, KiiClient client, String baseURL) {
        mSyncClient = client;
        mContext = context;

        mBaseURL = baseURL;

        KiiUMInfo um = mSyncClient.getKiiUMInfo();
        String appId = um.getAppId();
        if (TextUtils.isEmpty(appId)) {
            throw new RuntimeException(AppUtil.PREF_UM_APP_ID
                    + " meta data is not found in Manifest");
        }
        String appKey = um.getAppKey();
{'fraction_non_alphanumeric': 0.09330877839165132, 'fraction_numerical': 0.003069367710251688, 'mean_word_length': 3.6096181046676095, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5513371', 'n_tokens_mistral': 1011, 'n_tokens_neox': 981, 'n_words': 231}