号簿助手 v4.6.31版本的 MD5 值为:9d7ff98a6bb5cc178eac2df4d1b2f0e0
以下内容为反编译后的 GetPlatformConfigJob.java 源代码,内容仅作参考
package com.chinatelecom.pim.core.threadpool.impl;
import android.content.Context;
import com.chinatelecom.pim.core.CoreManagerFactory;
import com.chinatelecom.pim.core.model.PlatformConfig;
import com.chinatelecom.pim.core.threadpool.BackgroundJob;
import com.chinatelecom.pim.core.threadpool.ICallback;
import com.chinatelecom.pim.core.threadpool.model.Runner;
import com.chinatelecom.pim.foundation.lang.log.Log;
import com.chinatelecom.pim.foundation.lang.net.HttpCallback;
import ctuab.proto.message.GetConfigProto;
import java.io.IOException;
import java.io.InputStream;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.util.EntityUtils;
public class GetPlatformConfigJob implements BackgroundJob<InputStream> {
private ICallback callback;
private Context context;
protected Log logger = Log.build(GetPlatformConfigJob.class);
private InputStream inputStream = null;
public GetPlatformConfigJob(Context context, ICallback callback) {
this.context = context;
this.callback = callback;
}
@Override
public void prepare(Runner.Info info) {
this.callback.prepare();
}
@Override
public InputStream run(Runner.Info info) {
CoreManagerFactory.getInstance().getHttpTemplateFactory().getHttpTemplate().execute(new HttpCallback() {
@Override
public void call(HttpClient client) throws Exception {
HttpPost httpPost = new HttpPost("http://sync.189.cn/UabSyncService/uabconfig.uab");
HttpResponse httpResponse = client.execute(httpPost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
GetPlatformConfigJob.this.inputStream = httpResponse.getEntity().getContent();
GetPlatformConfigJob.this.logger.debug("respContent:{}", EntityUtils.toString(httpResponse.getEntity()));
} else if (httpResponse.getStatusLine().getStatusCode() != 500) {
GetPlatformConfigJob.this.logger.debug("StatusCode:{}", Integer.valueOf(httpResponse.getStatusLine().getStatusCode()));
}
}
});
return this.inputStream;
}
@Override
public void onComplete(Runner.Info info, InputStream inputStream) {
PlatformConfig platformConfig = new PlatformConfig();
try {
GetConfigProto.GetConfigResponse response = GetConfigProto.GetConfigResponse.parseFrom(inputStream);
platformConfig.getEnvironment().setAuthUrl(response.getAuthUrl());
platformConfig.getEnvironment().setClientReportUrl(response.getClientReportUrl());
platformConfig.getEnvironment().setGetUserCloudSummaryUrl(response.getGetUserCloudSummaryUrl());
platformConfig.getEnvironment().setQueryClientVersionUrl(response.getQueryClientVersionUrl());
platformConfig.getEnvironment().setQueryMobileNoUrl(response.getQueryMobileNoUrl());
platformConfig.getEnvironment().setGetSplashUrl(response.getGetSplashUrl());
platformConfig.getEnvironment().setGetSysMsgUrl(response.getGetSysMsgUrl());
platformConfig.getEnvironment().setQueryPublicInfoUrl(response.getQueryPublicInfoUrl());
platformConfig.getEnvironment().setQueryCommentInfoUrl(response.getQueryCommentsUrl());
platformConfig.getEnvironment().setNewDeviceSignUrl(response.getNewDeviceSignUrl());
platformConfig.getEnvironment().setTpnoolUrl(response.getTpnoolUrl());
platformConfig.getEnvironment().setGetContactAdUrl(response.getGetContactAdUrl());
platformConfig.getEnvironment().setGetReadAmountUrl(response.getReadAmountUrl());
platformConfig.getEnvironment().setGetHCodeUrl(response.getGetHcodeUrl());
platformConfig.getEnvironment().setGetPublicTelephoneUrl(response.getGetPublicTelephoneUrl());
platformConfig.getEnvironment().setUploadAllEncryptedUrl(response.getUploadAllEncryptedUrl());
platformConfig.getEnvironment().setDownloadAllEncryptedUrl(response.getDownloadAllEncryptedUrl());
platformConfig.getEnvironment().setDownloadContactEncryptedUrl(response.getDownloadContactEncryptedUrl());
platformConfig.getEnvironment().setSyncUploadContactEncryptedUrl(response.getSyncUploadContactEncryptedUrl());
platformConfig.getEnvironment().setSlowSyncEncryptedUrl(response.getSlowSyncEncryptedUrl());
platformConfig.getEnvironment().setSyncSmsEncryptedUrl(response.getSyncSmsEncryptedUrl());
platformConfig.getEnvironment().setUploadSmsEncryptedUrl(response.getUploadSmsEncryptedUrl());
platformConfig.getEnvironment().setDownloadSmsEncryptedUrl(response.getDownloadSmsEncryptedUrl());
platformConfig.getEnvironment().setBackupCalllogEncryptedUrl(response.getBackupCalllogEncryptedUrl());
platformConfig.getEnvironment().setRecoverCalllogEncryptedUrl(response.getRecoverCalllogEncryptedUrl());
} catch (IOException e) {
e.printStackTrace();
}
this.callback.complete(platformConfig);
}
}