百度手机卫士 v8.8.0版本的 MD5 值为:a85894a6923c8a39f0c3a3a686ad7443
以下内容为反编译后的 RegistManager.java 源代码,内容仅作参考
package com.quickbird.sdk.internal;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.provider.Settings;
import android.text.TextUtils;
import com.baidu.mobads.interfaces.utils.IXAdSystemUtils;
import com.quickbird.mini.utils.TelephonyUtils;
import com.quickbird.sdk.QuickBird;
import com.quickbird.sdk.utils.QBLogger;
import com.quickbird.sdk.utils.QBNetworkUtils;
import java.io.IOException;
import java.net.URISyntaxException;
import org.json.JSONException;
import org.json.JSONObject;
public class RegistManager {
private static final int APP_CLIENT_TYPE = 0;
private static final int APP_CONN_TYPE = 1;
private static final int APP_ID = 6;
public static final int NET_UNUSABLE = 2;
public static final int NO_SIM = 1;
public static final int SUCCESS = 0;
private static final String TAG = "RegistManager";
public static final int UNSUPPORTED = 3;
private Context mContext;
public RegistManager(Context context) {
this.mContext = context;
}
public int regist() {
if (!QBNetworkUtils.isExistSimCard(this.mContext)) {
return 1;
}
if (!QBNetworkUtils.isNetworkAvaialble(this.mContext)) {
return 2;
}
try {
activateQb();
return 0;
} catch (IOException e) {
e.printStackTrace();
return 2;
} catch (URISyntaxException e2) {
e2.printStackTrace();
return 3;
} catch (JSONException e3) {
e3.printStackTrace();
return 3;
} catch (Exception e4) {
e4.printStackTrace();
return 3;
}
}
public void activateQb() {
String macAddress;
long currentTimeMillis = System.currentTimeMillis();
JSONObject jSONObject = new JSONObject();
WifiInfo connectionInfo = ((WifiManager) this.mContext.getSystemService(IXAdSystemUtils.NT_WIFI)).getConnectionInfo();
jSONObject.put("app_id", 6);
jSONObject.put("app_uuid", Settings.Secure.getString(this.mContext.getContentResolver(), "android_id"));
String imei = TelephonyUtils.getIMEI(this.mContext);
if (QuickBird.SDK_DEBUG) {
QBLogger.d(TAG, "Imei : " + imei);
}
jSONObject.put("imei", imei);
String imsi = TelephonyUtils.getIMSI(this.mContext);
if (QuickBird.SDK_DEBUG) {
QBLogger.d(TAG, "Imsi : " + imsi);
}
jSONObject.put("imsi", imsi);
jSONObject.put("pref_enable_compression", 1);
jSONObject.put("pref_image_quality", 1);
jSONObject.put("pref_enable_adblock", 0);
if (connectionInfo != null && (macAddress = connectionInfo.getMacAddress()) != null) {
jSONObject.put("dev_mac_addr", macAddress.replaceAll(":", ""));
}
jSONObject.put("dev_model", TelephonyUtils.getModel());
jSONObject.put("os_name", TelephonyUtils.getOsName());
jSONObject.put("os_ver", TelephonyUtils.getOsVersion());
jSONObject.put("os_lang", TelephonyUtils.getUserLanguage());
jSONObject.put("os_cracked", TelephonyUtils.isCracked() ? 1 : 0);
jSONObject.put("os_aus", 1);
jSONObject.put("app_ver_code", getVersionCode());
jSONObject.put("app_connection_type", 1);
jSONObject.put("app_client_type", 0);
if (QuickBird.SDK_DEBUG) {
QBLogger.d(QuickBird.SDK_TAG, "Posting:https://sjws-tzapi.baidu.com/account/activate/");
}
String post = HttpsClient.post(this.mContext, SdkConstant.SDK_ACTIVATE_URL, jSONObject);
if (QuickBird.SDK_DEBUG) {
QBLogger.d(QuickBird.SDK_TAG, "Respond:");
QBLogger.d(QuickBird.SDK_TAG, post);
}
JSONObject jSONObject2 = new JSONObject(post);
String string = jSONObject2.getString("token");
if (TextUtils.isEmpty(imsi)) {
imsi = "unknown";
}
UserManager.getInstance(this.mContext).updateUserInfos(string, jSONObject2.getString("host"), jSONObject2.getString("port"), imei, imsi);
if (QuickBird.SDK_DEBUG) {
QBLogger.d(QuickBird.SDK_TAG, "Activate used:" + (System.currentTimeMillis() - currentTimeMillis) + " ms");
}
}
private int getVersionCode() {
try {
return this.mContext.getPackageManager().getPackageInfo(this.mContext.getPackageName(), 16384).versionCode;
} catch (Exception e) {
if (QuickBird.SDK_DEBUG) {
QBLogger.d(TAG, "Get application version code error!");
}
if (QuickBird.SDK_DEBUG) {
e.printStackTrace();
}
return 0;
}
}
}