中建乐购 v3.2.3版本的 MD5 值为:3856d0da11f056931d64951d23a4b3b8
以下内容为反编译后的 y.java 源代码,内容仅作参考
package db;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.shopex.westore.AgentApplication;
import com.thirdbureau.homepage.MyConifg;
import com.umeng.analytics.pro.dl;
import com.zjsjtz.ecstore.R;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class y extends com.shopex.westore.b {
String f14223a;
String f14224b;
private MyConifg f14225c;
private WebView f14226d;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (getActivity().getIntent().hasExtra("tel")) {
this.f14223a = getActivity().getIntent().getStringExtra("tel");
}
if (getActivity().getIntent().hasExtra("web")) {
this.f14224b = getActivity().getIntent().getStringExtra("web");
}
this.f14225c = AgentApplication.d(this.mActivity);
this.mActionBar.setTitle(R.string.customer_service);
this.mActionBar.c(R.drawable.icon_phone, new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent;
if (y.this.f14223a == null) {
intent = new Intent("android.intent.action.CALL", Uri.parse("tel:" + y.this.f14225c.customServicePhone));
} else {
intent = new Intent("android.intent.action.CALL", Uri.parse("tel:" + y.this.f14223a));
}
y.this.startActivity(intent);
}
});
}
@Override
public void init(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
super.init(layoutInflater, viewGroup, bundle);
this.rootView = layoutInflater.inflate(R.layout.fragment_kefu_service, (ViewGroup) null);
this.f14226d = (WebView) findViewById(R.id.kefu_service_webview);
webViewSetting(this.f14226d);
getActivity().getWindow().setSoftInputMode(18);
com.shopex.westore.util.o oVar = com.shopex.westore.util.o.f10576a;
oVar.b(this.f14225c.customServiceUrl + "&memberid=" + AgentApplication.c(getContext()).K() + "&phoneModelName=" + Build.MODEL + "&phoneSystemVersion=" + Build.VERSION.RELEASE + "&appVersion=" + com.shopex.westore.util.ai.e(getContext()));
if (this.f14224b != null) {
WebView webView = this.f14226d;
webView.loadUrl(this.f14224b + "&&memberid=" + AgentApplication.c(getContext()).K() + "&&phoneModelName=" + Build.MODEL + "&&phoneSystemVersion=" + Build.VERSION.RELEASE + "&&appVersion=" + com.shopex.westore.util.ai.e(getContext()) + "&&anapp=1&&name=" + AgentApplication.c(getContext()).a(getContext()));
com.shopex.westore.util.o oVar2 = com.shopex.westore.util.o.f10576a;
StringBuilder sb = new StringBuilder();
sb.append("web = ");
sb.append(this.f14226d.getUrl());
oVar2.c(sb.toString());
return;
}
WebView webView2 = this.f14226d;
webView2.loadUrl(this.f14225c.customServiceUrl + "&&memberid=" + AgentApplication.c(getContext()).K() + "&&phoneModelName=" + Build.MODEL + "&&phoneSystemVersion=" + Build.VERSION.RELEASE + "&&appVersion=" + com.shopex.westore.util.ai.e(getContext()) + "&&anapp=1&&name=" + AgentApplication.c(getContext()).a(getContext()));
com.shopex.westore.util.o oVar3 = com.shopex.westore.util.o.f10576a;
StringBuilder sb2 = new StringBuilder();
sb2.append("customServiceUrl = ");
sb2.append(this.f14226d.getUrl());
oVar3.c(sb2.toString());
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
if (i3 == -1) {
a(i2, intent);
}
super.onActivityResult(i2, i3, intent);
}
private void a(int i2, Intent intent) {
Bitmap bitmap;
File file;
BufferedOutputStream bufferedOutputStream;
switch (i2) {
case 1001:
if (intent == null) {
dc.r.a(this.mActivity, this.mActivity.getResources().getString(R.string.no_selected_image));
return;
}
Bundle extras = intent.getExtras();
if (extras != null) {
a((Bitmap) extras.getParcelable("data"), new File(dc.g.a(this.mActivity, true).getAbsolutePath(), "upload.jpg").getAbsolutePath(), false);
return;
}
return;
case 1002:
a(intent.getExtras());
return;
case 1003:
if (intent == null) {
dc.r.a(this.mActivity, this.mActivity.getResources().getString(R.string.no_selected_image));
return;
}
BufferedOutputStream bufferedOutputStream2 = null;
try {
try {
try {
bitmap = MediaStore.Images.Media.getBitmap(this.mActivity.getContentResolver(), intent.getData());
file = new File(dc.g.a(this.mActivity, true).getAbsolutePath(), "upload.jpg");
bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file));
} catch (IOException e2) {
e = e2;
}
} catch (Throwable th) {
th = th;
}
try {
bitmap.compress(Bitmap.CompressFormat.JPEG, 60, bufferedOutputStream);
bufferedOutputStream.flush();
bufferedOutputStream.close();
a(bitmap, file.getAbsolutePath(), true);
} catch (IOException e3) {
e = e3;
bufferedOutputStream2 = bufferedOutputStream;
e.printStackTrace();
if (bufferedOutputStream2 != null) {
bufferedOutputStream2.close();
return;
}
return;
} catch (Throwable th2) {
th = th2;
bufferedOutputStream2 = bufferedOutputStream;
if (bufferedOutputStream2 != null) {
try {
bufferedOutputStream2.close();
} catch (IOException unused) {
}
}
throw th;
}
if (bufferedOutputStream != null) {
bufferedOutputStream.close();
return;
}
return;
} catch (IOException unused2) {
return;
}
default:
return;
}
}
private void a(Bundle bundle) {
FileOutputStream fileOutputStream;
Bitmap bitmap = (Bitmap) bundle.get("data");
FileOutputStream fileOutputStream2 = null;
try {
try {
try {
File file = dc.h.f14327d;
fileOutputStream = new FileOutputStream(file);
if (bitmap != null) {
try {
if (bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream)) {
fileOutputStream.flush();
fileOutputStream.close();
}
a(file.getAbsolutePath(), true);
} catch (IOException e2) {
e = e2;
fileOutputStream2 = fileOutputStream;
e.printStackTrace();
fileOutputStream2.close();
return;
} catch (Throwable th) {
th = th;
try {
fileOutputStream.close();
} catch (IOException e3) {
e3.printStackTrace();
}
throw th;
}
}
fileOutputStream.close();
} catch (IOException e4) {
e = e4;
}
} catch (Throwable th2) {
th = th2;
fileOutputStream = fileOutputStream2;
}
} catch (IOException e5) {
while (true) {
e5.printStackTrace();
return;
}
}
}
private void a(Bitmap bitmap, String str, boolean z2) {
String a2 = dc.g.a(str);
WebView webView = this.f14226d;
webView.loadUrl("javascript:AndroidUploadImage('" + a2 + "');");
}
private void a(String str, boolean z2) {
String a2 = dc.g.a(str);
WebView webView = this.f14226d;
webView.loadUrl("javascript:AndroidUploadImage('" + a2 + "');");
}
@JavascriptInterface
@SuppressLint({"SetJavaScriptEnabled", "JavascriptInterface"})
private void webViewSetting(WebView webView) {
WebSettings settings = webView.getSettings();
settings.setCacheMode(-1);
webView.setWebChromeClient(new b());
webView.setWebViewClient(new WebViewClient());
settings.setUseWideViewPort(true);
settings.setAllowFileAccess(true);
settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
webView.setBackgroundColor(0);
settings.setJavaScriptEnabled(true);
webView.requestFocusFromTouch();
this.f14226d.addJavascriptInterface(new a(), "appclient");
settings.setDomStorageEnabled(true);
webView.setVerticalScrollBarEnabled(false);
if (Build.VERSION.SDK_INT <= 19) {
WebView.setWebContentsDebuggingEnabled(true);
WebSettings settings2 = webView.getSettings();
settings2.setDatabasePath("/data/data/" + this.f14226d.getContext().getPackageName() + dl.f12214b);
}
}
public void a() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("请选择图片");
builder.setSingleChoiceItems(new CharSequence[]{"拍照", "从手机相册选择"}, 0, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
switch (i2) {
case 0:
dc.h.a(y.this.getActivity());
break;
case 1:
dc.h.b(y.this.getActivity());
break;
}
dialogInterface.dismiss();
}
});
builder.show();
}
public final class a {
a() {
}
@JavascriptInterface
public void clickAddImage() {
y.this.mHandler.post(new Runnable() {
@Override
public void run() {
y.this.a();
}
});
}
}
public final class b extends WebChromeClient {
b() {
}
@Override
public boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
jsResult.confirm();
return true;
}
}
}