大漢易經書院.apk(点击下载) / e.java


package com.lt.app.views;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.URLUtil;
import android.webkit.ValueCallback;
import android.widget.PopupWindow;
import android.widget.Toast;
import com.a.a.a;
import com.c.e;
import com.lt.app.App;
import com.lt.app.a.p;
import com.lt.app.c;
import com.lt.app.d;
import com.lt.plugin.au;
import com.lt.plugin.u;
import com.umeng.analytics.pro.ak;
import com.xiaomi.clientreport.data.Config;
import java.util.ArrayList;
import java.util.List;
import me.dhtv.app.R;
import org.json.JSONObject;

/* compiled from: LTLongClick */
public class e implements a.AbstractC0041a {

    /* renamed from: ʻ  reason: contains not printable characters */
    private final com.c.e f6416;

    /* renamed from: ʼ  reason: contains not printable characters */
    private final List<Integer> f6417;

    /* renamed from: ʽ  reason: contains not printable characters */
    private final boolean f6418;

    /* renamed from: ʾ  reason: contains not printable characters */
    private final boolean f6419;

    /* renamed from: ʿ  reason: contains not printable characters */
    private final boolean f6420;

    /* renamed from: ˆ  reason: contains not printable characters */
    private final boolean f6421;

    /* renamed from: ˈ  reason: contains not printable characters */
    private final boolean f6422;

    /* renamed from: ˉ  reason: contains not printable characters */
    private final boolean f6423;

    /* renamed from: ˊ  reason: contains not printable characters */
    private final boolean f6424;

    /* renamed from: ˋ  reason: contains not printable characters */
    private String f6425 = null;

    /* renamed from: ˎ  reason: contains not printable characters */
    private String f6426 = null;

    /* renamed from: ˏ  reason: contains not printable characters */
    private String f6427 = null;

    /* renamed from: ˑ  reason: contains not printable characters */
    private int f6428;

    /* renamed from: י  reason: contains not printable characters */
    private int f6429;

    @Override // com.a.a.a.AbstractC0041a
    /* renamed from: ʻ  reason: contains not printable characters */
    public void m8692(com.a.a.a aVar, boolean z) {
    }

    private e(com.c.e eVar, long j, long j2, com.lt.app.c.a aVar) {
        this.f6416 = eVar;
        this.f6417 = new ArrayList(5);
        boolean z = true;
        this.f6418 = (j & 2048) == 2048;
        this.f6419 = (128 & j2) == 0;
        this.f6420 = (j & 4096) == 4096;
        this.f6421 = (j & 8192) == 8192;
        this.f6422 = (j2 & 524288) == 524288;
        this.f6423 = (j2 & Config.DEFAULT_MAX_FILE_LENGTH) == Config.DEFAULT_MAX_FILE_LENGTH;
        this.f6424 = (j2 & 2097152) != 2097152 ? false : z;
        m8683(aVar);
    }

    /* access modifiers changed from: private */
    /* compiled from: LTLongClick */
    public static final class a extends Handler {

        /* renamed from: ʻ  reason: contains not printable characters */
        private final e f6439;

        private a(e eVar) {
            super(Looper.getMainLooper());
            this.f6439 = eVar;
        }

        public void handleMessage(Message message) {
            Bundle data = message.getData();
            final String str = "";
            final String string = data != null ? data.getString("url") : str;
            final String string2 = data != null ? data.getString("src") : str;
            if (data != null) {
                str = data.getString("title");
            }
            if (TextUtils.isEmpty(string2) || (!TextUtils.isEmpty(string) && TextUtils.isEmpty(str))) {
                float f = this.f6439.f6416.getContext().getResources().getDisplayMetrics().density;
                if (f < 1.0f) {
                    f = 1.0f;
                }
                this.f6439.f6416.evaluateJavascript(String.format("(function(t,e){for(var a=document,i={t:'',a:'',i:'',c:document.cookie},o=a.elementFromPoint(t,e);o;){var r=o.tagName;if(!i.a&&r&&'a'==r.toLowerCase()&&(i.a=o.href),!i.i&&r&&'img'==r.toLowerCase()&&(i.i=o.src),i.t||(i.t=(o.title?o.title:o.text?o.text:'').trim()),i.a&&i.i)break;o=o.parentNode}return JSON.stringify(i)})(%d,%d);", Integer.valueOf((int) (((float) this.f6439.f6428) / f)), Integer.valueOf((int) (((float) this.f6439.f6429) / f))), new ValueCallback<String>() {
                    /* class com.lt.app.views.e.a.AnonymousClass1 */

                    /* renamed from: ʻ  reason: contains not printable characters */
                    public void onReceiveValue(String str) {
                        String str2 = string2;
                        String str3 = str;
                        if (!TextUtils.isEmpty(str)) {
                            try {
                                JSONObject jSONObject = new JSONObject(str);
                                if (TextUtils.isEmpty(str2)) {
                                    str2 = jSONObject.optString("i");
                                }
                                if (TextUtils.isEmpty(str3)) {
                                    str3 = jSONObject.optString(ak.aH);
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                        a.this.f6439.m8687((e) string, str2, str3);
                    }
                });
                return;
            }
            this.f6439.m8687((e) string, string2, str);
        }
    }

    /* renamed from: ʻ  reason: contains not printable characters */
    public static void m8682(com.c.e eVar, com.lt.app.c.a aVar) {
        if (eVar != null && aVar != null && App.m8121(14, true)) {
            if (aVar.m8521(11) || aVar.m8521(12) || aVar.m8521(13) || aVar.m8522(7)) {
                new e(eVar, aVar.b, aVar.c, aVar);
            }
        }
    }

    /* renamed from: ʻ  reason: contains not printable characters */
    private void m8683(com.lt.app.c.a aVar) {
        this.f6416.setLongClickable(true);
        if (!App.m8121(26, true) || !aVar.m8521(30)) {
            this.f6416.setOnTouchListener(new View.OnTouchListener() {
                /* class com.lt.app.views.e.AnonymousClass1 */

                public boolean onTouch(View view, MotionEvent motionEvent) {
                    if (motionEvent.getAction() == 0) {
                        e.this.f6428 = (int) motionEvent.getX();
                        e.this.f6429 = (int) motionEvent.getY();
                    }
                    view.performClick();
                    return view.onTouchEvent(motionEvent);
                }
            });
        }
        this.f6416.setOnLongClickListener(new View.OnLongClickListener() {
            /* class com.lt.app.views.e.AnonymousClass2 */

            public boolean onLongClick(View view) {
                int r5;
                e.b lTHitTestResult = e.this.f6416.getLTHitTestResult();
                if (lTHitTestResult != null && ((r5 = lTHitTestResult.m6435()) == 0 || r5 == 1 || r5 == 5 || r5 == 6 || r5 == 7 || r5 == 8)) {
                    Message message = new Message();
                    message.setTarget(new a());
                    e.this.f6416.requestFocusNodeHref(message);
                }
                return false;
            }
        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    /* renamed from: ʻ  reason: contains not printable characters */
    private void m8687(String str, String str2, String str3) {
        if (this.f6424 || !TextUtils.isEmpty(str) || !TextUtils.isEmpty(str2)) {
            this.f6425 = str;
            this.f6426 = str2;
            this.f6427 = str3;
            com.lt.app.a aVar = (com.lt.app.a) this.f6416.getContext();
            ArrayList arrayList = new ArrayList(5);
            this.f6417.clear();
            if (this.f6424) {
                arrayList.add(App.m8114((int) R.string.long_click_capture));
                this.f6417.add(Integer.valueOf((int) R.string.long_click_capture));
            }
            if (!TextUtils.isEmpty(str)) {
                if (this.f6421) {
                    arrayList.add(App.m8114((int) R.string.long_click_url_browser));
                    this.f6417.add(Integer.valueOf((int) R.string.long_click_url_browser));
                    arrayList.add(App.m8114((int) R.string.long_click_url_copy));
                    this.f6417.add(Integer.valueOf((int) R.string.long_click_url_copy));
                }
                if (this.f6422) {
                    arrayList.add(App.m8114((int) R.string.long_click_share_link));
                    this.f6417.add(Integer.valueOf((int) R.string.long_click_share_link));
                }
            }
            if (!TextUtils.isEmpty(str2)) {
                if (this.f6418) {
                    arrayList.add(App.m8114((int) R.string.long_click_save));
                    this.f6417.add(Integer.valueOf((int) R.string.long_click_save));
                }
                if (this.f6419) {
                    arrayList.add(App.m8114((int) R.string.long_click_copy));
                    this.f6417.add(Integer.valueOf((int) R.string.long_click_copy));
                }
                if (this.f6423) {
                    arrayList.add(App.m8114((int) R.string.long_click_share_image));
                    this.f6417.add(Integer.valueOf((int) R.string.long_click_share_image));
                }
                if (this.f6420) {
                    arrayList.add(App.m8114((int) R.string.long_click_qr));
                    this.f6417.add(Integer.valueOf((int) R.string.long_click_qr));
                }
            }
            if (arrayList.size() > 0) {
                String[] strArr = new String[arrayList.size()];
                arrayList.toArray(strArr);
                com.a.a.a.m6208(aVar, aVar.m1697()).m6236(R.string.cancel).m6240(strArr).m6239(true).m6237(this).m6241();
            }
        }
    }

    @Override // com.a.a.a.AbstractC0041a
    /* renamed from: ʻ  reason: contains not printable characters */
    public void m8691(com.a.a.a aVar, int i) {
        if (i < this.f6417.size()) {
            final Context context = this.f6416.getContext();
            final int intValue = this.f6417.get(i).intValue();
            switch (intValue) {
                case R.string.long_click_capture /*{ENCODED_INT: 2131689607}*/:
                    com.lt.app.c.a r5 = App.m8128();
                    com.lt.app.a.a.m8241(this.f6416, r5.m8522(22), r5.m8522(23));
                    return;
                case R.string.long_click_copy /*{ENCODED_INT: 2131689608}*/:
                case R.string.long_click_url_copy /*{ENCODED_INT: 2131689618}*/:
                    ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService("clipboard");
                    if (clipboardManager != null) {
                        clipboardManager.setPrimaryClip(ClipData.newPlainText(null, intValue == R.string.long_click_url_copy ? this.f6425 : this.f6426));
                        Toast.makeText(context, (int) R.string.long_click_copy_succ, 1).show();
                        return;
                    }
                    return;
                case R.string.long_click_copy_succ /*{ENCODED_INT: 2131689609}*/:
                case R.string.long_click_down_failed /*{ENCODED_INT: 2131689610}*/:
                case R.string.long_click_qr_failed /*{ENCODED_INT: 2131689612}*/:
                case R.string.long_click_save_succ /*{ENCODED_INT: 2131689614}*/:
                default:
                    return;
                case R.string.long_click_qr /*{ENCODED_INT: 2131689611}*/:
                case R.string.long_click_save /*{ENCODED_INT: 2131689613}*/:
                    if (this.f6426.startsWith("data:")) {
                        int indexOf = this.f6426.indexOf("base64,");
                        if (indexOf > 0) {
                            try {
                                Bitmap r52 = c.m8502(this.f6426.substring(indexOf + 7));
                                if (intValue == R.string.long_click_save) {
                                    m8680(r52);
                                    return;
                                } else {
                                    m8681(r52, d.m8539(this.f6416.getViewEx()));
                                    return;
                                }
                            } catch (Exception unused) {
                                return;
                            }
                        } else {
                            return;
                        }
                    } else {
                        final PopupWindow r0 = d.m8539(this.f6416.getViewEx());
                        c.m8492(this.f6416, this.f6426, new u<Bitmap, Void>() {
                            /* class com.lt.app.views.e.AnonymousClass3 */

                            /* renamed from: ʻ  reason: contains not printable characters */
                            public Void process(Bitmap bitmap) {
                                r0.dismiss();
                                if (bitmap == null) {
                                    Toast.makeText(context, (int) R.string.long_click_down_failed, 1).show();
                                    return null;
                                } else if (intValue == R.string.long_click_save) {
                                    e.this.m8680((e) bitmap);
                                    return null;
                                } else {
                                    e.this.m8681((e) bitmap, (Bitmap) r0);
                                    return null;
                                }
                            }
                        });
                        return;
                    }
                case R.string.long_click_share_image /*{ENCODED_INT: 2131689615}*/:
                    p.c cVar = new p.c();
                    cVar.f6209 = this.f6426;
                    cVar.f6208 = -1;
                    p.m8399(cVar, this.f6416, (p.b) null);
                    return;
                case R.string.long_click_share_link /*{ENCODED_INT: 2131689616}*/:
                    p.e eVar = new p.e();
                    eVar.f6219 = this.f6425;
                    eVar.f6218 = this.f6427;
                    p.m8399(eVar, this.f6416, (p.b) null);
                    return;
                case R.string.long_click_url_browser /*{ENCODED_INT: 2131689617}*/:
                    d.m8547(context, this.f6425, true);
                    return;
            }
        }
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    /* renamed from: ʻ  reason: contains not printable characters */
    private void m8680(Bitmap bitmap) {
        au.m8944(this.f6416.getContext(), bitmap, new com.lt.plugin.b<Uri>() {
            /* class com.lt.app.views.e.AnonymousClass4 */

            /* renamed from: ʻ  reason: contains not printable characters */
            public void callback(Uri uri) {
                if (uri == null) {
                    Toast.makeText(e.this.f6416.getContext(), "保存失败", 0).show();
                } else {
                    Toast.makeText(e.this.f6416.getContext(), (int) R.string.long_click_save_succ, 0).show();
                }
            }
        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    /* renamed from: ʻ  reason: contains not printable characters */
    private void m8681(Bitmap bitmap, PopupWindow popupWindow) {
        if (bitmap != null) {
            final b bVar = new b(this.f6416.getContext(), popupWindow);
            c.m8491(bitmap, new com.lt.plugin.b<String>() {
                /* class com.lt.app.views.e.AnonymousClass5 */

                /* renamed from: ʻ  reason: contains not printable characters */
                public void callback(String str) {
                    bVar.obtainMessage(0, str).sendToTarget();
                }
            });
        }
    }

    /* access modifiers changed from: private */
    /* compiled from: LTLongClick */
    public static class b extends Handler {

        /* renamed from: ʻ  reason: contains not printable characters */
        private final Context f6444;

        /* renamed from: ʼ  reason: contains not printable characters */
        private final PopupWindow f6445;

        b(Context context, PopupWindow popupWindow) {
            super(Looper.getMainLooper());
            this.f6444 = context;
            this.f6445 = popupWindow;
        }

        public void handleMessage(Message message) {
            PopupWindow popupWindow = this.f6445;
            if (popupWindow != null) {
                popupWindow.dismiss();
            }
            String str = (String) message.obj;
            if (TextUtils.isEmpty(str)) {
                Toast.makeText(this.f6444, (int) R.string.long_click_qr_failed, 1).show();
            } else if (App.m8128() == null || !App.m8128().m8522(4) || (!URLUtil.isHttpUrl(str) && !URLUtil.isHttpsUrl(str))) {
                d.m8544(this.f6444, App.m8130().m8135(str));
            } else {
                d.m8553(this.f6444, str, (String) null, true);
            }
        }
    }
}