和通讯录 v3.9.6版本的 MD5 值为:669178e2ee1b2311daf378bd20c6bbe1
以下内容为反编译后的 UserAutoregisterController.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.mobilecard.controller;
import android.text.TextUtils;
import android.util.Log;
import com.chinamobile.contacts.im.App;
import com.chinamobile.contacts.im.config.LoginInfoSP;
import com.chinamobile.contacts.im.mobilecard.HttpsClientManager;
import com.chinamobile.contacts.im.mobilecard.OneCardLoginController;
import com.chinamobile.contacts.im.mobilecard.SignatureUtil;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.chinamobile.contacts.im.utils.aq;
import com.huawei.mcs.cloud.msg.base.mms.Telephony;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;
public class UserAutoregisterController {
public static final String CHANNELCODE = "6106229BEB5F4C891524F86B5890F2F4";
public static boolean getAccessToken() {
boolean z;
try {
HashMap hashMap = new HashMap();
String randomString = OneCardLoginController.getRandomString(12);
HashMap hashMap2 = new HashMap();
hashMap2.put("app_key", OneCardLoginController.APP_KEY);
hashMap2.put("access_token", LoginInfoSP.getAccessToken(App.b()));
hashMap2.put("once", randomString);
hashMap2.put("version", OneCardLoginController.API_VERSION);
hashMap2.put("sdk_from", "java");
hashMap2.put("phoneNumber", LoginInfoSP.getMobile(App.b()));
hashMap2.put("imsi", ApplicationUtils.getSubscriberId(App.b()));
hashMap2.put("imei", ApplicationUtils.getDeviceIMEI(App.b()));
hashMap2.put("channelCode", CHANNELCODE);
hashMap2.put("client_version", ApplicationUtils.getVersionName(App.b()));
hashMap2.put("device_id", ApplicationUtils.getUUID(App.b()));
hashMap2.put("clientType", "4");
String nornmalSignature = SignatureUtil.getNornmalSignature(hashMap2);
hashMap.put("app_key", OneCardLoginController.APP_KEY);
hashMap.put("access_token", LoginInfoSP.getAccessToken(App.b()));
hashMap.put("once", randomString);
hashMap.put("version", OneCardLoginController.API_VERSION);
hashMap.put("sdk_from", "java");
hashMap.put("phoneNumber", LoginInfoSP.getMobile(App.b()));
hashMap.put("imsi", ApplicationUtils.getSubscriberId(App.b()));
hashMap.put("imei", ApplicationUtils.getDeviceIMEI(App.b()));
hashMap.put("channelCode", CHANNELCODE);
hashMap.put("signature", nornmalSignature);
hashMap.put("client_version", ApplicationUtils.getVersionName(App.b()));
hashMap.put("device_id", ApplicationUtils.getUUID(App.b()));
hashMap.put("clientType", "4");
String doHttpsPost = HttpsClientManager.doHttpsPost("https://api.cytxl.com.cn/mobilecard/userAutoregister.json", hashMap);
if (TextUtils.isEmpty(doHttpsPost)) {
z = false;
} else {
aq.a("UserAutoregisterController", "---" + doHttpsPost);
JSONObject jSONObject = new JSONObject(doHttpsPost);
if (jSONObject.optInt(Telephony.TextBasedSmsColumns.ERROR_CODE, -1) == 0) {
z = true;
} else {
String optString = jSONObject.optString("error_message", "");
if (!TextUtils.isEmpty(optString)) {
Log.e("OneCardLoginController", optString);
}
z = false;
}
String optString2 = jSONObject.optString("authcode", "");
if (!TextUtils.isEmpty(optString2)) {
LoginInfoSP.saveAuthcode(App.b(), optString2);
}
}
return z;
} catch (JSONException e) {
e.printStackTrace();
return false;
} catch (Exception e2) {
e2.printStackTrace();
return false;
}
}
}