和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518
以下内容为反编译后的 McloudSdk.java 源代码,内容仅作参考
package com.chinamobile.mcloud.api;
import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Log;
import com.chinamobile.mcloud.api.auth.McloudAuthApi;
import com.chinamobile.mcloud.api.auth.McloudAuthSdk;
import com.chinamobile.mcloud.api.base.McloudConfig;
import com.chinamobile.mcloud.api.base.McloudEvent;
import com.chinamobile.mcloud.api.base.McloudSdkType;
import com.chinamobile.mcloud.api.msg.McloudMsgApi;
import com.chinamobile.mcloud.api.msg.McloudMsgSdk;
import com.huawei.mcs.McsSdk;
import com.huawei.mcs.api.McsApi;
import com.huawei.mcs.base.config.McsConfig;
import com.huawei.tep.utils.Logger;
public class McloudSdk implements McloudApi {
private static McloudSdk instance = null;
private McloudAuthSdk mcloudAuthSdk;
private McloudMsgSdk mcloudMsgSdk;
private McloudSdkListener mcloudSdkListener;
private McsApi mcsSdk;
private McloudSdkType sdkType = McloudSdkType.None;
private McloudSdk() {
}
public static synchronized McloudSdk getInstance() {
McloudSdk mcloudSdk;
synchronized (McloudSdk.class) {
if (instance == null) {
instance = new McloudSdk();
}
mcloudSdk = instance;
}
return mcloudSdk;
}
@Override
public boolean check(String str, String str2) {
return this.mcsSdk.check(str, str2);
}
@Override
public String get(String str) {
return McloudConfig.get(str);
}
@Override
public void init(Context context, McloudSdkListener mcloudSdkListener) {
this.mcloudSdkListener = mcloudSdkListener;
if (this.mcsSdk == null) {
if (this.mcsSdk == null) {
this.sdkType = McloudSdkType.Service;
}
if (this.mcsSdk == null) {
this.mcsSdk = new McsSdk();
this.sdkType = McloudSdkType.Static;
}
if (this.mcsSdk != null) {
this.mcsSdk.init(context);
switch (this.sdkType) {
case Static:
case Service:
case Plugin:
this.mcsSdk.set(McsConfig.ADDR_AAS, "http://aas.caiyun.feixin.10086.cn/");
this.mcsSdk.set(McsConfig.ADDR_AAS_HTTPS, "https://aas.caiyun.feixin.10086.cn/");
this.mcsSdk.set(McsConfig.MCS_APPLICATION_CLIENTTYPE, "414");
McsConfig.setString(McsConfig.HICLOUD_SERVICE_CHANNEL, "10000023");
try {
this.mcsSdk.set(McsConfig.MCS_APPLICATION_VERSION, String.valueOf(context.getPackageManager().getPackageInfo(context.getApplicationContext().getPackageName(), 0).versionCode));
} catch (PackageManager.NameNotFoundException e) {
Logger.w("McloudSdk", e);
}
this.mcsSdk.set(McsConfig.HICLOUD_USERROOT_ID, "00019700101000000001");
this.mcsSdk.set(McsConfig.HICLOUD_FOLDER_PRESET_ID, "00019700101000000001");
if (this.mcloudSdkListener != null) {
this.mcloudSdkListener.onMcloudSdkEvent(McloudEvent.success, this.sdkType, null);
return;
}
return;
default:
Log.d("Sdk", "load error");
return;
}
}
}
}
@Override
public McloudAuthApi mCloudAuthApi() {
if (this.mcloudAuthSdk == null) {
this.mcloudAuthSdk = McloudAuthSdk.getInstance(this.mcsSdk);
}
return this.mcloudAuthSdk;
}
@Override
public McloudMsgApi mCloudMsgApi() {
if (this.mcloudMsgSdk == null) {
this.mcloudMsgSdk = McloudMsgSdk.getInstance(this.mcsSdk);
}
return this.mcloudMsgSdk;
}
@Override
public void set(String str, String str2) {
McloudConfig.set(str, str2);
}
}