和通讯录 v3.9.6版本的 MD5 值为:669178e2ee1b2311daf378bd20c6bbe1
以下内容为反编译后的 ad.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.mms2.transaction;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.text.TextUtils;
import com.chinamobile.contacts.im.mms2.utils.CommonTools;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.google.android.mms.util.SqliteWrapper;
import com.huawei.mcs.cloud.msg.base.mms.Telephony;
public class ad {
private static final String[] d = {"type", Telephony.Carriers.MMSC, Telephony.Carriers.MMSPROXY, Telephony.Carriers.MMSPORT};
private String f2754a;
private String f2755b;
private int c;
public ad(Context context, String str) {
String str2;
boolean z;
Cursor cursor;
int sim;
this.c = -1;
try {
if (str != null) {
try {
str2 = "apn='" + str.trim() + "'";
} catch (Exception e) {
e = e;
z = false;
cursor = null;
} catch (Throwable th) {
th = th;
ApplicationUtils.closeCursor(null);
throw th;
}
} else {
str2 = null;
}
cursor = SqliteWrapper.query(context, context.getContentResolver(), Uri.withAppendedPath(com.chinamobile.contacts.im.mms2.g.d.f2711a, Telephony.Carriers.CURRENT), d, str2, null, null);
if (cursor != null) {
z = false;
while (cursor.moveToNext() && TextUtils.isEmpty(this.f2754a)) {
try {
if (a(cursor.getString(0), "mms")) {
try {
this.f2754a = cursor.getString(1).trim();
this.f2755b = cursor.getString(2);
if (d()) {
String string = cursor.getString(3);
try {
this.c = Integer.parseInt(string);
} catch (NumberFormatException e2) {
if (TextUtils.isEmpty(string)) {
com.chinamobile.contacts.im.feiliao.e.e("TransactionSettings", "mms port not set!");
} else {
com.chinamobile.contacts.im.feiliao.e.a("TransactionSettings", "Bad port number format: " + string + e2.toString());
}
}
z = true;
} else {
z = true;
}
} catch (Exception e3) {
e = e3;
z = true;
}
}
} catch (Exception e4) {
e = e4;
}
}
ApplicationUtils.closeCursor(cursor);
if (!z && TextUtils.isEmpty(this.f2754a)) {
com.chinamobile.contacts.im.feiliao.e.a("TransactionSettings", "Invalid APN setting: MMSC is empty");
}
sim = CommonTools.getInstance().getSim(context);
if (sim != 1) {
this.f2754a = "http://mmsc.monternet.com";
this.f2755b = "10.0.0.172";
this.c = 80;
return;
} else if (sim == 2) {
this.f2754a = "http://mmsc.myuni.com.cn";
this.f2755b = "10.0.0.172";
this.c = 80;
return;
} else {
if (sim == 3) {
this.f2754a = "http://mmsc.vnet.mobi";
this.f2755b = "10.0.0.200";
this.c = 80;
return;
}
return;
}
}
try {
com.chinamobile.contacts.im.feiliao.e.a("TransactionSettings", "Apn is not found in Database!");
ApplicationUtils.closeCursor(cursor);
return;
} catch (Exception e5) {
e = e5;
z = false;
}
com.chinamobile.contacts.im.feiliao.e.a("TransactionSettings", e.getMessage() + " ");
ApplicationUtils.closeCursor(cursor);
if (!z) {
com.chinamobile.contacts.im.feiliao.e.a("TransactionSettings", "Invalid APN setting: MMSC is empty");
}
sim = CommonTools.getInstance().getSim(context);
if (sim != 1) {
}
} catch (Throwable th2) {
th = th2;
}
}
public ad(String str, String str2, int i) {
this.c = -1;
this.f2754a = str != null ? str.trim() : null;
this.f2755b = str2;
this.c = i;
}
public String a() {
return this.f2754a;
}
public String b() {
return this.f2755b;
}
public int c() {
return this.c;
}
public boolean d() {
return (this.f2755b == null || this.f2755b.trim().length() == 0) ? false : true;
}
private static boolean a(String str, String str2) {
if (TextUtils.isEmpty(str)) {
return true;
}
for (String str3 : str.split(",")) {
if (str3.equals(str2) || str3.equals("*")) {
return true;
}
}
return false;
}
}