360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0
以下内容为反编译后的 ReportNetworkDetectActivity.java 源代码,内容仅作参考
package com.qihoo.appstore.activities;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.text.InputFilter;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ListAdapter;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.qihoo.freewifi.push.R;
import com.qihoo.speedometer.Config;
import java.util.ArrayList;
import java.util.HashMap;
public class ReportNetworkDetectActivity extends Activity implements View.OnClickListener {
private Activity f694b;
private GridView c;
private Button d;
private Button e;
private EditText f;
private EditText g;
private Spinner h;
private com.qihoo.appstore.a.a i;
private String[] k;
private boolean l;
private String m;
private String[] o;
private final com.qihoo.appstore.http.netconfig.b j = com.qihoo.appstore.http.netconfig.c.b();
public boolean f693a = false;
private boolean n = false;
public HashMap a(Context context, String str, String str2, String str3, String str4, String str5) {
if (TextUtils.isEmpty(str2)) {
str2 = context.getString(R.string.unkown);
}
if (TextUtils.isEmpty(str3)) {
str3 = context.getString(R.string.unkown);
}
HashMap hashMap = new HashMap();
hashMap.put("umsg", str3);
hashMap.put("contact", str2);
hashMap.put("project", "360baohe");
hashMap.put("sys", Build.MODEL);
hashMap.put("ver", Config.INVALID_IP + com.qihoo.express.mini.c.a.a().j());
hashMap.put("mid", com.qihoo.appstore.utils.dc.L());
hashMap.put("nettype", d());
if (!TextUtils.isEmpty(str)) {
hashMap.put("content", str);
}
hashMap.put("reportcate", str5);
hashMap.put("feedbackid", str4);
return hashMap;
}
private void a() {
String[] split;
this.h = (Spinner) findViewById(R.id.spinner1);
this.d = (Button) findViewById(R.id.btn_ok);
this.d.setOnClickListener(this);
this.e = (Button) findViewById(R.id.btn_cancel);
this.e.setOnClickListener(this);
this.k = this.f694b.getResources().getStringArray(R.array.network_reportCate);
this.c = (GridView) findViewById(R.id.listContent);
this.c.setSelector(R.drawable.list_selector);
this.i = new com.qihoo.appstore.a.a(this.f694b);
int length = this.k.length;
for (int i = 0; i < length; i++) {
this.i.a(String.valueOf(i + 1), this.k[i]);
}
this.c.setAdapter((ListAdapter) this.i);
this.c.setOnItemClickListener(new gr(this));
this.f = (EditText) findViewById(R.id.feedback);
this.f.setFilters(new InputFilter[]{new InputFilter.LengthFilter(140)});
this.g = (EditText) findViewById(R.id.email);
String t = com.qihoo.appstore.utils.de.t(this);
if (t != null) {
this.g.setText(t, TextView.BufferType.EDITABLE);
} else {
String m = com.qihoo.appstore.utils.de.m(this);
if (m != null && !Config.INVALID_IP.equals(m) && ((split = m.split(",")) == null || split.length >= 3)) {
String str = null;
if (split.length == 3 && split[1].contains("@")) {
str = split[1];
} else if (split.length == 5 && split[4].contains("@")) {
str = split[4];
}
if (str != null && !Config.INVALID_IP.equals(str)) {
if (com.qihoo.appstore.utils.de.f(str)) {
com.qihoo.appstore.utils.de.i(this, str);
}
this.g.setText(str, TextView.BufferType.EDITABLE);
}
}
}
this.h.setOnItemSelectedListener(new gs(this));
}
public void a(int i) {
ArrayList arrayList = new ArrayList();
int count = this.i.getCount();
for (int i2 = 0; i2 < count; i2++) {
com.qihoo.appstore.a.b item = this.i.getItem(i2);
if (i2 == i) {
item.a(item.a());
item.a(!item.b());
item.b(item.c());
arrayList.add(item);
} else {
item.a(item.a());
item.a(item.b());
item.b(item.c());
arrayList.add(item);
}
}
this.i.a(arrayList);
}
private synchronized void a(boolean z) {
if (!this.f693a) {
String trim = this.f.getText().toString().trim();
String trim2 = this.g.getText().toString().trim();
if (trim2.length() > 0) {
com.qihoo.appstore.utils.de.i(this, trim2);
} else {
trim2 = com.qihoo.appstore.utils.de.t(this);
}
if (trim2.equals(Config.INVALID_IP)) {
Toast.makeText(this, R.string.enter_tel_please, 0).show();
} else if (trim.equals(Config.INVALID_IP)) {
Toast.makeText(this, R.string.enter_your_content, 0).show();
} else {
new gt(this, this.f694b).c((Object[]) new Boolean[]{Boolean.valueOf(z)});
com.qihoo.appstore.r.a.a(this.n ? "dgm" : "dgi", 1);
this.f693a = true;
}
}
}
public String b() {
StringBuffer stringBuffer = new StringBuffer();
int count = this.i.getCount();
for (int i = 0; i < count; i++) {
com.qihoo.appstore.a.b item = this.i.getItem(i);
if (item.b()) {
if (stringBuffer.length() == 0) {
stringBuffer.append(item.c());
} else {
stringBuffer.append("|" + item.c());
}
}
}
if (stringBuffer.length() > 0) {
return stringBuffer.toString();
}
return null;
}
public String c() {
return com.qihoo.appstore.utils.dc.d ? "http://test1.baohe.mobilem.360.cn/feedback/update" : "http://openbox.mobilem.360.cn/feedback/update";
}
private String d() {
switch (this.j.a().a()) {
case -1:
return "NET_TYPE_NO_CONNECTION";
case 0:
default:
return "NET_TYPE_UNKOWN";
case 1:
return "NET_TYPE_WIFI";
case 2:
return "NET_TYPE_MOBILE_3G_WAP";
case 3:
return "NET_TYPE_MOBILE_3G_NET";
case 4:
return "NET_TYPE_MOBILE_2G_WAP";
case 5:
return "NET_TYPE_MOBILE_2G_NET";
case 6:
return "NET_TYPE_DEFAULT";
}
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.btn_ok:
a(true);
return;
case R.id.btn_cancel:
finish();
return;
default:
return;
}
}
@Override
protected void onCreate(Bundle bundle) {
Window window = getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.dimAmount = 0.8f;
window.setAttributes(attributes);
window.addFlags(2);
super.onCreate(bundle);
setContentView(R.layout.network_report_dialog);
this.f694b = this;
a();
this.l = getIntent().getBooleanExtra("need_send_log_file", true);
this.m = getIntent().getStringExtra("upload_log_res");
com.qihoo.appstore.utils.dc.a((Activity) this);
this.n = getIntent().getBooleanExtra("isContactUs", false);
this.o = this.f694b.getResources().getStringArray(R.array.contacts_type);
}
}