中建乐购 v3.2.2版本的 MD5 值为:0553721e6bc6ba8dd67004696a555b81

以下内容为反编译后的 y.java 源代码,内容仅作参考


package cu;

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 f13767a;
    String f13768b;
    private MyConifg f13769c;
    private WebView f13770d;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (getActivity().getIntent().hasExtra("tel")) {
            this.f13767a = getActivity().getIntent().getStringExtra("tel");
        }
        if (getActivity().getIntent().hasExtra("web")) {
            this.f13768b = getActivity().getIntent().getStringExtra("web");
        }
        this.f13769c = 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.f13767a == null) {
                    intent = new Intent("android.intent.action.CALL", Uri.parse("tel:" + y.this.f13769c.customServicePhone));
                } else {
                    intent = new Intent("android.intent.action.CALL", Uri.parse("tel:" + y.this.f13767a));
                }
                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.f13770d = (WebView) findViewById(R.id.kefu_service_webview);
        webViewSetting(this.f13770d);
        getActivity().getWindow().setSoftInputMode(18);
        com.shopex.westore.util.o oVar = com.shopex.westore.util.o.f10523a;
        oVar.b(this.f13769c.customServiceUrl + "&memberid=" + AgentApplication.c(getContext()).K() + "&phoneModelName=" + Build.MODEL + "&phoneSystemVersion=" + Build.VERSION.RELEASE + "&appVersion=" + com.shopex.westore.util.ai.e(getContext()));
        if (this.f13768b != null) {
            WebView webView = this.f13770d;
            webView.loadUrl(this.f13768b + "&&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.f10523a;
            StringBuilder sb = new StringBuilder();
            sb.append("web = ");
            sb.append(this.f13770d.getUrl());
            oVar2.c(sb.toString());
            return;
        }
        WebView webView2 = this.f13770d;
        webView2.loadUrl(this.f13769c.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.f10523a;
        StringBuilder sb2 = new StringBuilder();
        sb2.append("customServiceUrl = ");
        sb2.append(this.f13770d.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) {
                    cv.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(cv.g.a(this.mActivity, true).getAbsolutePath(), "upload.jpg").getAbsolutePath(), false);
                    return;
                }
                return;
            case 1002:
                a(intent.getExtras());
                return;
            case 1003:
                if (intent == null) {
                    cv.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(cv.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 = cv.h.f13871d;
                    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 = cv.g.a(str);
        WebView webView = this.f13770d;
        webView.loadUrl("javascript:AndroidUploadImage('" + a2 + "');");
    }

    private void a(String str, boolean z2) {
        String a2 = cv.g.a(str);
        WebView webView = this.f13770d;
        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.f13770d.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.f13770d.getContext().getPackageName() + dl.f12156b);
        }
    }

    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:
                        cv.h.a(y.this.getActivity());
                        break;
                    case 1:
                        cv.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;
        }
    }
}