OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 FeedbackActivity.java 源代码,内容仅作参考
package com.excelliance.kxqp.ui;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.Html;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.VersionManager;
import com.excelliance.kxqp.Versioning;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.swipe.SwipeView;
import com.excelliance.kxqp.swipe.i;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.regex.Pattern;
public class FeedbackActivity extends BaseActivity implements TextWatcher {
private int f13741a;
private String f13742b = "FeedbackActivity";
private Button c;
private EditText d;
private EditText e;
private Context f;
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
requestWindowFeature(1);
this.f = this;
this.f13741a = getResources().getIdentifier("ly_feedback", "layout", getPackageName());
if (this.f13741a > 0) {
setContentView(this.f13741a);
a();
}
this.f13741a = getResources().getIdentifier("status_bg_blue", "color", getPackageName());
if (com.excelliance.kxqp.swipe.h.c(this.f.getApplicationContext()) && this.f13741a != 0) {
a(this, this.f13741a);
}
this.f13741a = getResources().getIdentifier("et_address", "id", getPackageName());
if (this.f13741a > 0) {
EditText editText = (EditText) findViewById(this.f13741a);
this.f13741a = getResources().getIdentifier("dr_feeback2", "drawable", getPackageName());
Versioning.setBackgroundDrawable(this.f13741a, editText, getResources());
editText.addTextChangedListener(this);
}
this.f13741a = getResources().getIdentifier("editTextFeedback", "id", getPackageName());
if (this.f13741a > 0) {
EditText editText2 = (EditText) findViewById(this.f13741a);
this.f13741a = getResources().getIdentifier("dr_feeback2", "drawable", getPackageName());
Versioning.setBackgroundDrawable(this.f13741a, editText2, getResources());
editText2.addTextChangedListener(this);
}
this.f13741a = getResources().getIdentifier("noInput", "id", getPackageName());
if (this.f13741a > 0) {
findViewById(this.f13741a).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InputMethodManager inputMethodManager = (InputMethodManager) FeedbackActivity.this.getSystemService("input_method");
if (Build.VERSION.SDK_INT >= 3) {
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
});
}
e();
d();
c();
}
private void c() {
SharedPreferences sharedPreferences = getSharedPreferences("appsConfig", Build.VERSION.SDK_INT < 11 ? 0 : 4);
this.f13741a = this.f.getResources().getIdentifier("tv_tel", "id", this.f.getPackageName());
if (this.f13741a != 0) {
TextView textView = (TextView) findViewById(this.f13741a);
final String string = sharedPreferences.getString("tel", null);
if (string == null || string.length() == 0) {
this.f13741a = getResources().getIdentifier("telephone", "string", this.f.getPackageName());
if (this.f13741a != 0) {
string = this.f.getResources().getString(this.f13741a);
}
}
this.f13741a = this.f.getResources().getIdentifier("tx_tel", "string", this.f.getPackageName());
textView.setText(Html.fromHtml(this.f.getResources().getString(this.f13741a, "<u>" + string + "</u>")));
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FeedbackActivity.this.startActivity(new Intent("android.intent.action.DIAL", Uri.parse("tel:" + string)));
}
});
}
this.f13741a = this.f.getResources().getIdentifier("tv_qg", "id", this.f.getPackageName());
if (this.f13741a != 0) {
TextView textView2 = (TextView) findViewById(this.f13741a);
String string2 = sharedPreferences.getString("qg", null);
if (string2 == null || string2.length() == 0) {
this.f13741a = getResources().getIdentifier("qq_group", "string", this.f.getPackageName());
if (this.f13741a != 0) {
string2 = this.f.getResources().getString(this.f13741a);
}
}
this.f13741a = this.f.getResources().getIdentifier("tx_qg", "string", this.f.getPackageName());
if (this.f13741a != 0) {
textView2.setText(Html.fromHtml(this.f.getResources().getString(this.f13741a, "<u>" + string2 + "</u>")));
}
textView2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
PackageManager packageManager = FeedbackActivity.this.getPackageManager();
try {
if (!com.excelliance.kxqp.util.a.a(FeedbackActivity.this.f, "com.tencent.mobileqq")) {
if (com.excelliance.kxqp.util.a.a(FeedbackActivity.this.f, "com.tencent.qqlite")) {
FeedbackActivity.this.startActivity(packageManager.getLaunchIntentForPackage("com.tencent.qqlite"));
}
} else {
FeedbackActivity.this.startActivity(packageManager.getLaunchIntentForPackage("com.tencent.mobileqq"));
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
@Override
protected void onResume() {
super.onResume();
i.b();
SwipeView.a((Context) this, false);
}
@Override
protected void onDestroy() {
super.onDestroy();
SwipeView.setSwipeView(true);
}
@Override
public void onWindowFocusChanged(boolean z) {
super.onWindowFocusChanged(z);
i.b();
}
public boolean a(String str) {
return Pattern.compile("^((13[0-9])|(14[^4,\\D])|(15[^4,\\D])|(17[\\d])|(18[0-9]))\\d{8}$").matcher(str).matches();
}
private void d() {
this.f13741a = getResources().getIdentifier("tx_prompt", "id", getPackageName());
if (this.f13741a != 0) {
TextView textView = (TextView) findViewById(this.f13741a);
textView.setTypeface(com.excelliance.kxqp.swipe.a.a.b(this));
String string = com.excelliance.kxqp.swipe.a.a.getString(this, "faq");
String charSequence = textView.getText().toString();
if (string != null) {
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(charSequence);
int indexOf = charSequence.indexOf(string);
int length = string.length() + indexOf;
if (indexOf < 0) {
indexOf = 0;
}
spannableStringBuilder.setSpan(new a(null), indexOf, length, 33);
textView.setText(spannableStringBuilder);
textView.setMovementMethod(LinkMovementMethod.getInstance());
}
}
}
@Override
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (i == 4) {
keyEvent.getRepeatCount();
}
return super.onKeyDown(i, keyEvent);
}
private void e() {
this.f13741a = getResources().getIdentifier("ib_back", "id", getPackageName());
if (this.f13741a > 0) {
ImageButton imageButton = (ImageButton) findViewById(this.f13741a);
this.f13741a = getResources().getIdentifier("button_back", "drawable", getPackageName());
if (this.f13741a > 0) {
imageButton.setImageDrawable(getResources().getDrawable(this.f13741a));
}
imageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FeedbackActivity.this.finish();
InputMethodManager inputMethodManager = (InputMethodManager) FeedbackActivity.this.getSystemService("input_method");
if (Build.VERSION.SDK_INT >= 3) {
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
});
if (com.excelliance.kxqp.swipe.h.c(this.f.getApplicationContext())) {
Object parent = imageButton.getParent();
this.f13741a = getResources().getIdentifier("add_title_bg_blue", "color", getPackageName());
if (this.f13741a == 0 || parent == null || !(parent instanceof View)) {
return;
}
Versioning.setBackgroundDrawable(this.f13741a, (View) parent, this.f);
}
}
}
@Override
public boolean onTouchEvent(MotionEvent motionEvent) {
if ((motionEvent.getAction() & 255) == 0) {
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService("input_method");
if (Build.VERSION.SDK_INT >= 3 && this.c != null) {
inputMethodManager.hideSoftInputFromWindow(this.c.getWindowToken(), 0);
}
}
return super.onTouchEvent(motionEvent);
}
public void a() {
this.d = (EditText) findViewById(getResources().getIdentifier("et_address", "id", getPackageName()));
this.d.setTypeface(com.excelliance.kxqp.swipe.a.a.b(this));
this.e = (EditText) findViewById(getResources().getIdentifier("editTextFeedback", "id", getPackageName()));
this.e.setTypeface(com.excelliance.kxqp.swipe.a.a.b(this));
int identifier = getResources().getIdentifier("button_feedback_submit", "id", getPackageName());
if (identifier > 0) {
this.c = (Button) findViewById(identifier);
this.c.setTypeface(com.excelliance.kxqp.swipe.a.a.b(this));
int identifier2 = getResources().getIdentifier("dr_feedback_br_dr", "drawable", getPackageName());
if (identifier2 > 0) {
Versioning.setBackgroundDrawable(identifier2, this.c, getResources());
}
this.c.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final String obj = FeedbackActivity.this.d.getText().toString();
final String obj2 = FeedbackActivity.this.e.getText().toString();
GameUtil.getIntance();
if (!GameUtil.isNetworkConnected(FeedbackActivity.this.f)) {
Toast.makeText(FeedbackActivity.this.getApplicationContext(), FeedbackActivity.this.getResources().getIdentifier("network_error_retry", "string", FeedbackActivity.this.getPackageName()), 0).show();
return;
}
if (obj.length() > 32) {
Toast.makeText(FeedbackActivity.this.getApplicationContext(), FeedbackActivity.this.getResources().getIdentifier("error_ceelphone_long", "string", FeedbackActivity.this.getPackageName()), 0).show();
return;
}
if (obj2 == null || obj2.length() <= 0) {
Toast.makeText(FeedbackActivity.this.getApplicationContext(), FeedbackActivity.this.getResources().getIdentifier("error_feedback_content", "string", FeedbackActivity.this.getPackageName()), 0).show();
} else {
if (obj2.length() > 128) {
Toast.makeText(FeedbackActivity.this.getApplicationContext(), FeedbackActivity.this.getResources().getIdentifier("error_feedback_content_long", "string", FeedbackActivity.this.getPackageName()), 0).show();
return;
}
new Thread() {
@Override
public void run() {
FeedbackActivity.this.a(obj, obj2);
}
}.start();
Toast.makeText(FeedbackActivity.this.getApplicationContext(), FeedbackActivity.this.getResources().getIdentifier("feedback_success_tips", "string", FeedbackActivity.this.getPackageName()), 1).show();
FeedbackActivity.this.d.setText("");
FeedbackActivity.this.e.setText("");
}
}
});
}
}
public void a(String str, String str2) {
String str3;
String f;
String a2;
Log.d(this.f13742b, "sendFeedback entered");
try {
new ArrayList();
GameUtil intance = GameUtil.getIntance();
String o = GameUtil.o(this);
if (o != null && o.length() > 0) {
str3 = "http://folder." + o + "/userfeedback.php";
StringBuilder sb = new StringBuilder(str3);
sb.append("?chid=" + intance.h());
sb.append("&subchid=" + intance.i());
sb.append("&vc=" + GameUtil.g(this.f));
sb.append("&vn=" + GameUtil.h(this.f));
sb.append("&compver=" + VersionManager.getInstance().l());
sb.append("&mainver=" + intance.m());
sb.append("&api=" + Build.VERSION.SDK_INT);
sb.append("&release=" + Build.VERSION.RELEASE);
sb.append("&brand=" + URLEncoder.encode(Build.BRAND, "UTF-8").replaceAll("\\+", "%20"));
sb.append("&manufacturer=" + URLEncoder.encode(Build.MANUFACTURER, "UTF-8").replaceAll("\\+", "%20"));
sb.append("&model=" + URLEncoder.encode(Build.MODEL, "UTF-8").replaceAll("\\+", "%20"));
sb.append("&product=" + URLEncoder.encode(Build.PRODUCT, "UTF-8").replaceAll("\\+", "%20"));
f = VersionManager.getInstance().f();
if (f != null) {
sb.append("&uid=" + f);
}
sb.append("&mobile=" + URLEncoder.encode(str, "UTF-8"));
sb.append("&fmsg=" + URLEncoder.encode(str2, "UTF-8"));
Log.d(this.f13742b, "sendFeedback getURL = " + sb.toString());
a2 = bd.a(sb.toString(), 12000, 12000);
if (cd.a(a2)) {
Log.d(this.f13742b, "sendFeedback result:" + a2 + ", response = ");
return;
}
return;
}
str3 = com.excelliance.kxqp.i.d + "/userfeedback.php";
StringBuilder sb2 = new StringBuilder(str3);
sb2.append("?chid=" + intance.h());
sb2.append("&subchid=" + intance.i());
sb2.append("&vc=" + GameUtil.g(this.f));
sb2.append("&vn=" + GameUtil.h(this.f));
sb2.append("&compver=" + VersionManager.getInstance().l());
sb2.append("&mainver=" + intance.m());
sb2.append("&api=" + Build.VERSION.SDK_INT);
sb2.append("&release=" + Build.VERSION.RELEASE);
sb2.append("&brand=" + URLEncoder.encode(Build.BRAND, "UTF-8").replaceAll("\\+", "%20"));
sb2.append("&manufacturer=" + URLEncoder.encode(Build.MANUFACTURER, "UTF-8").replaceAll("\\+", "%20"));
sb2.append("&model=" + URLEncoder.encode(Build.MODEL, "UTF-8").replaceAll("\\+", "%20"));
sb2.append("&product=" + URLEncoder.encode(Build.PRODUCT, "UTF-8").replaceAll("\\+", "%20"));
f = VersionManager.getInstance().f();
if (f != null) {
}
sb2.append("&mobile=" + URLEncoder.encode(str, "UTF-8"));
sb2.append("&fmsg=" + URLEncoder.encode(str2, "UTF-8"));
Log.d(this.f13742b, "sendFeedback getURL = " + sb2.toString());
a2 = bd.a(sb2.toString(), 12000, 12000);
if (cd.a(a2)) {
}
} catch (Exception e) {
Log.d(this.f13742b, "sendFeedback e=" + e);
e.printStackTrace();
}
}
@Override
public void afterTextChanged(Editable editable) {
if (this.d.getText().toString() != null && this.d.getText().toString().length() > 0 && this.e.getText().toString() != null && this.e.getText().toString().length() > 0) {
if (a(this.d.getText().toString())) {
this.c.setEnabled(true);
return;
} else {
this.c.setEnabled(false);
return;
}
}
this.c.setEnabled(false);
}
public class a extends ClickableSpan {
private final View.OnClickListener f13752b;
@Override
public void onClick(View view) {
}
public a(View.OnClickListener onClickListener) {
this.f13752b = onClickListener;
}
@Override
public void updateDrawState(TextPaint textPaint) {
textPaint.setColor(com.excelliance.kxqp.swipe.a.a.getcolor(FeedbackActivity.this, "feedback_tx_c2"));
}
}
}