酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

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


package com.kugou.common.useraccount.app;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.LinearLayout;
import com.kugou.common.R;
import com.kugou.common.utils.br;
import java.util.HashMap;

public class OldRetrieveByEmailFragment extends CommonBaseAccountFragment {
    protected static HashMap<String, Integer> n = new HashMap<>();
    protected LinearLayout O_;

    protected WebView f52791a;
    private boolean ah;

    protected LinearLayout f52792c;

    protected String f52793d;

    protected String f52794e;
    protected String f;
    protected String g;
    protected String h;
    protected String i;
    protected String j;
    protected final int k = 1;
    protected final int l = 2;
    protected final int m = 3;
    protected Handler o = new com.kugou.framework.common.utils.stacktrace.e() {
        @Override
        public void handleMessage(Message message) {
            int i = message.what;
            if (i != 1) {
                if (i != 2) {
                    if (i != 3) {
                        return;
                    }
                    OldRetrieveByEmailFragment.this.showToast(message.arg1);
                } else {
                    String str = (String) message.obj;
                    OldRetrieveByEmailFragment oldRetrieveByEmailFragment = OldRetrieveByEmailFragment.this;
                    oldRetrieveByEmailFragment.showToast(oldRetrieveByEmailFragment.getString(R.string.kg_download_error_tips, str));
                }
            }
        }
    };
    protected boolean p = false;
    protected Object q = new Object();
    private final int ai = 1;
    private final int aj = 2;
    private final int ak = 3;
    private final int al = 4;
    private final int am = 5;
    private final int an = 6;

    public class c {
    }

    protected Object a() {
        return "";
    }

    public String f() {
        return "android";
    }

    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        return layoutInflater.inflate(R.layout.kg_old_retrieve_password_fragment, viewGroup, false);
    }

    @Override
    @TargetApi(11)
    public void onActivityCreated(Bundle bundle) {
        super.onActivityCreated(bundle);
        j().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                OldRetrieveByEmailFragment oldRetrieveByEmailFragment = OldRetrieveByEmailFragment.this;
                oldRetrieveByEmailFragment.b(oldRetrieveByEmailFragment.f52791a);
                OldRetrieveByEmailFragment.this.finish();
            }
        });
        l();
        m();
        b();
        this.j = "http://m.kugou.com/forget.php?act=html&view=0";
        com.kugou.common.web.a.a.removeJavascriptInterface(this.f52791a);
        this.f52791a.loadUrl(this.j);
    }

    @SuppressLint({"NewApi"})
    private void l() {
        c("找回密码");
        this.f52791a = (WebView) findViewById(R.id.app_wv);
        if (this.f52791a == null) {
            throw new RuntimeException("Your content must have a TextView whose id attribute is 'R.id.app_wv'");
        }
        this.O_ = (LinearLayout) findViewById(R.id.kg_common_loading_bar);
        if (this.O_ == null) {
            throw new RuntimeException("Your content must have a TextView whose id attribute is 'R.id.loading_bar'");
        }
        this.f52792c = (LinearLayout) findViewById(R.id.refresh_bar);
        LinearLayout linearLayout = this.f52792c;
        if (linearLayout == null) {
            throw new RuntimeException("Your content must have a TextView whose id attribute is 'R.id.refresh_bar'");
        }
        if (linearLayout == null) {
            throw new RuntimeException("Your content must have a TextView whose id attribute is 'R.id.common_title_colse_button'");
        }
        this.f52791a.setVerticalScrollBarEnabled(false);
        WebSettings settings = this.f52791a.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setSavePassword(false);
        settings.setDefaultTextEncodingName("utf-8");
        settings.setCacheMode(2);
        this.f52791a.setWebViewClient(new b());
        this.f52791a.setWebChromeClient(new a(f(), c.class));
        if (!com.kugou.common.web.a.a.Is_Injected_Open) {
            this.f52791a.addJavascriptInterface(a(), f());
        }
        this.f52792c.findViewById(R.id.btn_refresh).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (br.Q(OldRetrieveByEmailFragment.this.getActivity().getApplicationContext())) {
                    OldRetrieveByEmailFragment.this.e();
                    com.kugou.common.web.a.a.removeJavascriptInterface(OldRetrieveByEmailFragment.this.f52791a);
                    OldRetrieveByEmailFragment.this.f52791a.loadUrl(OldRetrieveByEmailFragment.this.j);
                    return;
                }
                OldRetrieveByEmailFragment.this.a(R.string.comm_no_network);
            }
        });
        com.kugou.common.web.a.a.removeJavascriptInterface(this.f52791a);
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i == 4 && this.f52791a.canGoBack()) {
            this.f52791a.goBack();
            return true;
        }
        return super.onKeyDown(i, keyEvent);
    }

    @Override
    public void onDestroyView() {
        this.p = true;
        this.o.removeMessages(1);
        synchronized (this.q) {
            if (this.f52791a != null) {
                this.f52791a.removeAllViews();
                this.f52791a.clearCache(true);
                this.f52791a.destroy();
                this.f52791a = null;
            }
        }
        super.onDestroyView();
    }

    protected void a(int i) {
        this.o.obtainMessage(3, i, 0).sendToTarget();
    }

    protected void b() {
        this.O_.setVisibility(0);
        this.f52792c.setVisibility(8);
        this.f52791a.setVisibility(8);
    }

    protected void c() {
        this.f52792c.setVisibility(0);
        this.O_.setVisibility(8);
        this.f52791a.setVisibility(8);
    }

    protected void e() {
        this.f52791a.setVisibility(0);
        this.f52792c.setVisibility(8);
        this.O_.setVisibility(8);
    }

    public class b extends com.kugou.common.datacollect.view.web.c {
        protected b() {
        }

        @Override
        @TargetApi(11)
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            com.kugou.common.web.a.a.removeJavascriptInterface(webView);
            webView.loadUrl(str);
            return true;
        }

        @Override
        public void onReceivedError(WebView webView, int i, String str, String str2) {
            super.onReceivedError(webView, i, str, str2);
            webView.loadData("<html><p></p></html>", "text/html", "utf-8");
            OldRetrieveByEmailFragment.this.c();
        }

        @Override
        public void onPageFinished(WebView webView, String str) {
            super.onPageFinished(webView, str);
        }
    }

    public class a extends com.kugou.common.web.a.a {
        public a(String str, Class cls) {
            super(str, cls);
        }

        @Override
        public void onProgressChanged(WebView webView, int i) {
            super.onProgressChanged(webView, i);
        }

        @Override
        public void onReceivedTitle(WebView webView, String str) {
            super.onReceivedTitle(webView, str);
            if (OldRetrieveByEmailFragment.this.ah) {
                return;
            }
            OldRetrieveByEmailFragment.this.ah = true;
            OldRetrieveByEmailFragment.this.e();
        }
    }

    private void m() {
        this.f52793d = "#ffffff";
        this.f52794e = "#000000";
        this.f = "#666666";
        this.g = "#666666";
        this.h = "#ffffff";
        if (com.kugou.common.skin.d.o(getActivity())) {
            this.i = b(5);
            this.f52793d = b(6);
            return;
        }
        int e2 = com.kugou.common.skin.d.e();
        if (e2 == 0) {
            this.i = "#72AAD6";
        } else if (e2 == 1) {
            this.i = "#DB778F";
        } else {
            this.i = "#2A2A2A";
        }
    }

    private String b(int i) {
        int a2;
        com.kugou.common.skin.b g = com.kugou.common.skin.c.g();
        switch (i) {
            case 1:
                a2 = g.a();
                break;
            case 2:
                a2 = g.b();
                break;
            case 3:
                a2 = g.c();
                break;
            case 4:
                a2 = g.d();
                break;
            case 5:
            case 6:
                return a(com.kugou.common.skin.d.i(getActivity()));
            default:
                a2 = g.b();
                break;
        }
        return a(getString(a2));
    }

    private String a(String str) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        if (!str.startsWith("#")) {
            return str;
        }
        if (str.length() < 9) {
            return "";
        }
        return "#" + str.substring(3, 9);
    }

    @Override
    @TargetApi(11)
    public void onSkinColorChanged() {
        super.onSkinColorChanged();
        m();
        com.kugou.common.web.a.a.removeJavascriptInterface(this.f52791a);
        this.f52791a.loadUrl("javascript:notifySkinChanged()");
    }
}