导航菜单

页面标题

页面副标题

MX Player v1.97.8 - d.java 源代码

正在查看: MX Player v1.97.8 应用的 d.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.mxtech.subtitle.service;

import android.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.text.Editable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import androidx.appcompat.app.d;
import com.microsoft.identity.common.java.WarningType;
import com.mxtech.subtitle.service.SubtitleService;
import com.mxtech.widget.DecorEditText;
import defpackage.e4i;
import defpackage.gfh;
import defpackage.mdg;
import defpackage.mfg;
import defpackage.tya;
import defpackage.weh;
import defpackage.woa;
import defpackage.ym4;
import java.util.ArrayList;
import java.util.Locale;

public final class d {
    public final androidx.appcompat.app.d a;
    public final ArrayList<c> b;

    public class a implements DialogInterface.OnShowListener {
        public final b b;

        public class ViewOnClickListenerC0043a implements View.OnClickListener {
            public ViewOnClickListenerC0043a() {
            }

            @Override
            public final void onClick(android.view.View r14) {
                throw new UnsupportedOperationException("Method not decompiled: com.mxtech.subtitle.service.d.a.ViewOnClickListenerC0043a.onClick(android.view.View):void");
            }
        }

        public a(b bVar) {
            this.b = bVar;
        }

        @Override
        public final void onShow(DialogInterface dialogInterface) {
            Button c = ((androidx.appcompat.app.d) dialogInterface).c(-1);
            if (c != null) {
                c.setOnClickListener(new ViewOnClickListenerC0043a());
            }
        }
    }

    public interface b {
        void a(String[] strArr);
    }

    @SuppressLint({"InflateParams", WarningType.NewApi})
    public d(ym4 ym4Var, String[] strArr, b bVar) {
        ArrayList<c> arrayList = new ArrayList<>();
        this.b = arrayList;
        Context context = ym4Var.getContext();
        androidx.appcompat.app.d a2 = new d.a(context).a();
        this.a = a2;
        View inflate = a2.getLayoutInflater().inflate(2131560371, (ViewGroup) null);
        com.mxtech.subtitle.service.b bVar2 = new com.mxtech.subtitle.service.b();
        int length = strArr.length;
        boolean z = false;
        int i = 0;
        while (true) {
            if (i >= length) {
                break;
            }
            if (strArr[i].equals("opensubtitles.org")) {
                z = true;
                break;
            }
            i++;
        }
        arrayList.add(new c(ym4Var, inflate, bVar2, z));
        this.a.g(inflate);
        this.a.setTitle(2131890337);
        this.a.f(-2, context.getString(R.string.cancel), (DialogInterface.OnClickListener) null);
        this.a.f(-1, context.getString(R.string.ok), (DialogInterface.OnClickListener) null);
        this.a.setOnShowListener(new a(bVar));
        ym4Var.B5(this.a);
    }

    public static class c extends ClickableSpan implements CompoundButton.OnCheckedChangeListener, TextWatcher {
        public final Context b;
        public final ym4 c;
        public final com.mxtech.subtitle.service.b d;
        public final int f;
        public final String g;
        public final CheckBox h;
        public final View i;
        public final DecorEditText j;
        public final DecorEditText k;
        public final TextView l;
        public final TextView m;
        public final e4i.a n;
        public boolean o;

        public c(ym4 ym4Var, View view, com.mxtech.subtitle.service.b bVar, boolean z) {
            Context context = ym4Var.getContext();
            this.b = context;
            this.c = ym4Var;
            this.d = bVar;
            int i = com.mxtech.subtitle.service.b.c;
            this.f = i;
            this.g = ".cr.os";
            View findViewById = view.findViewById(2131365256);
            this.i = findViewById;
            DecorEditText decorEditText = (DecorEditText) view.findViewById(2131365257);
            this.j = decorEditText;
            DecorEditText decorEditText2 = (DecorEditText) view.findViewById(2131365254);
            this.k = decorEditText2;
            TextView textView = (TextView) view.findViewById(2131365258);
            this.m = textView;
            TextView textView2 = (TextView) view.findViewById(2131365255);
            this.l = textView2;
            if (textView2 != null) {
                if ((i & 3) != 0) {
                    SpannableString spannableString = new SpannableString(context.getString(2131889880));
                    spannableString.setSpan(this, 0, spannableString.length(), 33);
                    textView2.setText(spannableString);
                    textView2.setMovementMethod(LinkMovementMethod.getInstance());
                    textView2.setImportantForAccessibility(2);
                } else {
                    textView2.setVisibility(8);
                }
            }
            if (textView != null) {
                String o = mfg.o(2131890557, "opensubtitles.org");
                if ((i & 4) != 0) {
                    SpannableStringBuilder append = new SpannableStringBuilder(o).append(' ').append((CharSequence) context.getString(2131886363));
                    String spannableStringBuilder = append.toString();
                    int indexOf = spannableStringBuilder.indexOf(91);
                    if (indexOf >= 0) {
                        int i2 = indexOf + 1;
                        int indexOf2 = spannableStringBuilder.indexOf(93, i2);
                        if (indexOf2 > 0) {
                            append.setSpan(this, i2, indexOf2, 33);
                            append.delete(indexOf2, indexOf2 + 1);
                            append.delete(indexOf, i2);
                            textView.setText(append);
                            textView.setTextColor(textView.getTextColors().getDefaultColor());
                            textView.setMovementMethod(LinkMovementMethod.getInstance());
                            textView.setImportantForAccessibility(2);
                        }
                    } else {
                        textView.setText(o);
                    }
                }
            }
            if (decorEditText != null && decorEditText2 != null) {
                String string = tya.o.b.getString(".cr.os", null);
                if (string != null) {
                    e4i.a a = e4i.a(string);
                    this.n = a;
                    if (a != null) {
                        decorEditText.setText(a.a);
                        decorEditText2.setText(a.b);
                    }
                }
                bVar.E(decorEditText, decorEditText2);
                decorEditText2.addTextChangedListener(this);
            }
            CheckBox checkBox = (CheckBox) view.findViewById(2131365253);
            this.h = checkBox;
            checkBox.setChecked(z);
            checkBox.setOnCheckedChangeListener(this);
            if (findViewById != null) {
                if (checkBox.isChecked()) {
                    findViewById.setVisibility(0);
                } else {
                    findViewById.setVisibility(8);
                }
            }
        }

        public final int a(String str, String str2, String str3) throws InterruptedException {
            int i;
            try {
                this.d.p(str, str2, str3);
                i = (this.f & 64) != 0 ? 1 : 0;
            } catch (SubtitleService.EmailAlreadyUsedException unused) {
                i = -2;
            } catch (SubtitleService.NetworkException unused2) {
                i = -11;
            } catch (SubtitleService.UsernameExistException unused3) {
                i = -1;
            } catch (SubtitleService.ServerException unused4) {
                i = -10;
            } catch (SubtitleService.SubtitleServiceException unused5) {
                i = -100;
            }
            if (i == 1 || i == 0) {
                mdg mdgVar = new mdg("osRegistered", weh.c);
                do2.n("result", 1, mdgVar.b);
                gfh.d(mdgVar);
            } else {
                mdg mdgVar2 = new mdg("osRegistered", weh.c);
                do2.n("result", 0, mdgVar2.b);
                gfh.d(mdgVar2);
            }
            return i;
        }

        public final void b(String str) {
            try {
                this.b.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
            } catch (Exception e) {
                Log.e("MX.SiteSelector", "", e);
            }
        }

        @Override
        public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            View view = this.i;
            if (view != null) {
                if (this.h.isChecked()) {
                    view.setVisibility(0);
                } else {
                    view.setVisibility(8);
                }
            }
        }

        @Override
        public final void onClick(View view) {
            ym4 ym4Var = this.c;
            if (ym4Var.isFinishing()) {
                return;
            }
            com.mxtech.subtitle.service.b bVar = this.d;
            if (view != this.l) {
                if (view == this.m) {
                    bVar.getClass();
                    StringBuilder sb = new StringBuilder("http://www.opensubtitles.org/");
                    String language = Locale.getDefault().getLanguage();
                    woa.a aVar = woa.a;
                    language.getClass();
                    sb.append(language.equals("in") ? "id" : !language.equals("iw") ? language : "he");
                    sb.append("/faq");
                    b(sb.toString());
                    return;
                }
                return;
            }
            int i = this.f;
            if ((i & 1) != 0) {
                int i2 = (i & 32) != 0 ? 6 : 4;
                if ((i & 16) != 0) {
                    i2 |= 1;
                }
                uzf uzfVar = new uzf(ym4Var, i2, this);
                bVar.E(uzfVar.g, uzfVar.i);
                uzfVar.setTitle(mfg.o(2131890336, "opensubtitles.org"));
                ym4Var.c4(uzfVar, null);
                return;
            }
            if ((i & 2) != 0) {
                bVar.getClass();
                StringBuilder sb2 = new StringBuilder("http://www.opensubtitles.org/");
                String language2 = Locale.getDefault().getLanguage();
                woa.a aVar2 = woa.a;
                language2.getClass();
                sb2.append(language2.equals("in") ? "id" : !language2.equals("iw") ? language2 : "he");
                sb2.append("/newuser");
                b(sb2.toString());
            }
        }

        @Override
        public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            this.o = true;
        }

        @Override
        public final void afterTextChanged(Editable editable) {
        }

        @Override
        public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }
    }
}