SD Maid v5.6.3版本的 MD5 值为:b283f6effbd880c54f4e4da72852de99

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


package eu.thedarken.sdm.tools.bugs.reporter;

import a5.a;
import a5.f;
import a5.h;
import ab.c;
import android.annotation.SuppressLint;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import butterknife.BindView;
import butterknife.ButterKnife;
import eu.thedarken.sdm.R;
import java.util.Arrays;
import java.util.Locale;
import ta.n0;
import ta.p;
import uc.n;
public final class ReportActivity extends n implements c.b {
    public static final int B = 0;
    public c.a A;
    @BindView
    public EditText comment;
    @BindView
    public EditText primary;
    @BindView
    public TextView primaryCaption;
    @BindView
    public TextView primaryLabel;
    @BindView
    public EditText secondary;
    @BindView
    public TextView secondaryCaption;
    @BindView
    public TextView secondaryLabel;
    @BindView
    public EditText tertiary;
    @BindView
    public TextView tertiaryCaption;
    @BindView
    public TextView tertiaryLabel;
    @BindView
    public EditText title;
    @BindView
    public TextView titleCaption;
    @BindView
    public Toolbar toolbar;
    @BindView
    public RadioGroup typeGroup;
    public ab.c f4894x;
    public final f y = new f();
    public boolean f4895z;

    public static final class a extends n0 {
        public a() {
        }

        @Override
        public final void afterTextChanged(Editable editable) {
            qd.c.f("s", editable);
            ReportActivity reportActivity = ReportActivity.this;
            ab.c F1 = reportActivity.F1();
            String obj = editable.toString();
            qd.c.f("title", obj);
            F1.f302g = obj;
            F1.f(new ab.f(F1));
            int length = 8 - editable.length();
            if (length <= 0) {
                TextView textView = reportActivity.titleCaption;
                if (textView != null) {
                    textView.setVisibility(4);
                    return;
                } else {
                    qd.c.k("titleCaption");
                    throw null;
                }
            }
            TextView textView2 = reportActivity.titleCaption;
            if (textView2 == null) {
                qd.c.k("titleCaption");
                throw null;
            }
            String format = String.format(Locale.getDefault(), "%d characters required", Arrays.copyOf(new Object[]{Integer.valueOf(length)}, 1));
            qd.c.e("format(locale, format, *args)", format);
            textView2.setText(format);
            TextView textView3 = reportActivity.titleCaption;
            if (textView3 != null) {
                textView3.setVisibility(0);
            } else {
                qd.c.k("titleCaption");
                throw null;
            }
        }
    }

    public static final class b extends n0 {
        public b() {
        }

        @Override
        public final void afterTextChanged(Editable editable) {
            qd.c.f("s", editable);
            ReportActivity reportActivity = ReportActivity.this;
            ab.c F1 = reportActivity.F1();
            String obj = editable.toString();
            qd.c.f("primary", obj);
            F1.h = obj;
            F1.f(new ab.f(F1));
            int length = 32 - editable.length();
            if (length <= 0) {
                TextView textView = reportActivity.primaryCaption;
                if (textView != null) {
                    textView.setVisibility(4);
                    return;
                } else {
                    qd.c.k("primaryCaption");
                    throw null;
                }
            }
            TextView textView2 = reportActivity.primaryCaption;
            if (textView2 == null) {
                qd.c.k("primaryCaption");
                throw null;
            }
            String format = String.format(Locale.getDefault(), "%d characters required", Arrays.copyOf(new Object[]{Integer.valueOf(length)}, 1));
            qd.c.e("format(locale, format, *args)", format);
            textView2.setText(format);
            TextView textView3 = reportActivity.primaryCaption;
            if (textView3 != null) {
                textView3.setVisibility(0);
            } else {
                qd.c.k("primaryCaption");
                throw null;
            }
        }
    }

    public static final class c extends n0 {
        public c() {
        }

        @Override
        public final void afterTextChanged(Editable editable) {
            qd.c.f("s", editable);
            ReportActivity reportActivity = ReportActivity.this;
            ab.c F1 = reportActivity.F1();
            String obj = editable.toString();
            qd.c.f("secondary", obj);
            F1.f303i = obj;
            F1.f(new ab.f(F1));
            int length = 32 - editable.length();
            if (length <= 0) {
                TextView textView = reportActivity.secondaryCaption;
                if (textView != null) {
                    textView.setVisibility(4);
                    return;
                } else {
                    qd.c.k("secondaryCaption");
                    throw null;
                }
            }
            TextView textView2 = reportActivity.secondaryCaption;
            if (textView2 == null) {
                qd.c.k("secondaryCaption");
                throw null;
            }
            String format = String.format(Locale.getDefault(), "%d characters required", Arrays.copyOf(new Object[]{Integer.valueOf(length)}, 1));
            qd.c.e("format(locale, format, *args)", format);
            textView2.setText(format);
            TextView textView3 = reportActivity.secondaryCaption;
            if (textView3 != null) {
                textView3.setVisibility(0);
            } else {
                qd.c.k("secondaryCaption");
                throw null;
            }
        }
    }

    public static final class d extends n0 {
        public d() {
        }

        @Override
        public final void afterTextChanged(Editable editable) {
            qd.c.f("s", editable);
            ReportActivity reportActivity = ReportActivity.this;
            ab.c F1 = reportActivity.F1();
            String obj = editable.toString();
            qd.c.f("tertiary", obj);
            F1.f304j = obj;
            F1.f(new ab.f(F1));
            int length = 32 - editable.length();
            if (length <= 0 || reportActivity.A != c.a.BUG) {
                reportActivity.I1().setVisibility(4);
                return;
            }
            TextView I1 = reportActivity.I1();
            String format = String.format(Locale.getDefault(), "%d characters required", Arrays.copyOf(new Object[]{Integer.valueOf(length)}, 1));
            qd.c.e("format(locale, format, *args)", format);
            I1.setText(format);
            reportActivity.I1().setVisibility(0);
        }
    }

    public static final class e extends n0 {
        public e() {
        }

        @Override
        public final void afterTextChanged(Editable editable) {
            qd.c.f("s", editable);
            ab.c F1 = ReportActivity.this.F1();
            String obj = editable.toString();
            qd.c.f("comment", obj);
            F1.f305k = obj;
            F1.f(new ab.f(F1));
        }
    }

    @Override
    @SuppressLint({"SetTextI18n"})
    public final void D0(c.a aVar) {
        RadioGroup radioGroup;
        int i10;
        qd.c.f("type", aVar);
        this.A = aVar;
        int ordinal = aVar.ordinal();
        if (ordinal == 0) {
            TextView textView = this.primaryLabel;
            if (textView == null) {
                qd.c.k("primaryLabel");
                throw null;
            }
            textView.setText("What happened?");
            EditText editText = this.primary;
            if (editText == null) {
                qd.c.k("primary");
                throw null;
            }
            editText.setHint("Did you press something and the app closed?");
            TextView textView2 = this.secondaryLabel;
            if (textView2 == null) {
                qd.c.k("secondaryLabel");
                throw null;
            }
            textView2.setText("What did you expect to happen?");
            EditText editText2 = this.secondary;
            if (editText2 == null) {
                qd.c.k("secondary");
                throw null;
            }
            editText2.setHint("How does the outcome deviate from your expectations?");
            TextView textView3 = this.tertiaryLabel;
            if (textView3 == null) {
                qd.c.k("tertiaryLabel");
                throw null;
            }
            textView3.setText("How can I reproduce the issue?");
            EditText editText3 = this.tertiary;
            if (editText3 == null) {
                qd.c.k("tertiary");
                throw null;
            }
            editText3.setHint("What do I need to press and do to cause it. A step by step guide would be great.");
            I1().setVisibility(0);
            radioGroup = this.typeGroup;
            if (radioGroup == null) {
                qd.c.k("typeGroup");
                throw null;
            }
            i10 = R.id.type_bug;
        } else if (ordinal != 1) {
            return;
        } else {
            TextView textView4 = this.primaryLabel;
            if (textView4 == null) {
                qd.c.k("primaryLabel");
                throw null;
            }
            textView4.setText("What should the feature do?");
            EditText editText4 = this.primary;
            if (editText4 == null) {
                qd.c.k("primary");
                throw null;
            }
            editText4.setHint("e.g. Make coffee when the make coffee button is pressed...");
            TextView textView5 = this.secondaryLabel;
            if (textView5 == null) {
                qd.c.k("secondaryLabel");
                throw null;
            }
            textView5.setText("When would you use it?");
            EditText editText5 = this.secondary;
            if (editText5 == null) {
                qd.c.k("secondary");
                throw null;
            }
            editText5.setHint("Daily, I need at least one coffee in the morning.");
            TextView textView6 = this.tertiaryLabel;
            if (textView6 == null) {
                qd.c.k("tertiaryLabel");
                throw null;
            }
            textView6.setText("How would you implement it?");
            EditText editText6 = this.tertiary;
            if (editText6 == null) {
                qd.c.k("tertiary");
                throw null;
            }
            editText6.setHint("Just share your thoughts, I'm not looking for programming advice, just ideas :).");
            I1().setVisibility(8);
            radioGroup = this.typeGroup;
            if (radioGroup == null) {
                qd.c.k("typeGroup");
                throw null;
            }
            i10 = R.id.type_request;
        }
        radioGroup.check(i10);
    }

    public final ab.c F1() {
        ab.c cVar = this.f4894x;
        if (cVar != null) {
            return cVar;
        }
        qd.c.k("presenter");
        throw null;
    }

    public final TextView I1() {
        TextView textView = this.tertiaryCaption;
        if (textView != null) {
            return textView;
        }
        qd.c.k("tertiaryCaption");
        throw null;
    }

    @Override
    public final void N(String str, String str2, String str3, String str4, String str5) {
        EditText editText = this.title;
        if (editText == null) {
            qd.c.k("title");
            throw null;
        }
        editText.setText(str);
        EditText editText2 = this.primary;
        if (editText2 == null) {
            qd.c.k("primary");
            throw null;
        }
        editText2.setText(str2);
        EditText editText3 = this.secondary;
        if (editText3 == null) {
            qd.c.k("secondary");
            throw null;
        }
        editText3.setText(str3);
        EditText editText4 = this.tertiary;
        if (editText4 == null) {
            qd.c.k("tertiary");
            throw null;
        }
        editText4.setText(str4);
        EditText editText5 = this.comment;
        if (editText5 != null) {
            editText5.setText(str5);
        } else {
            qd.c.k("comment");
            throw null;
        }
    }

    @Override
    public final void R(Uri uri) {
        p.d d10 = new p(this).d(String.valueOf(uri));
        d10.d = this;
        d10.f9767e = true;
        d10.c();
        finish();
    }

    @Override
    public final void k1(boolean z4) {
        this.f4895z = z4;
        p1();
    }

    @Override
    public final void onCreate(Bundle bundle) {
        a.C0005a c0005a = new a.C0005a();
        c0005a.a(new b5.e(this));
        c0005a.f190b = new h(this);
        c0005a.f189a = new b5.c(this);
        c0005a.b(this);
        super.onCreate(bundle);
        setContentView(R.layout.core_bugreport_activity);
        ButterKnife.b(this);
        Toolbar toolbar = this.toolbar;
        if (toolbar == null) {
            qd.c.k("toolbar");
            throw null;
        }
        z1(toolbar);
        this.y.a(bundle);
        RadioGroup radioGroup = this.typeGroup;
        if (radioGroup == null) {
            qd.c.k("typeGroup");
            throw null;
        }
        radioGroup.setOnCheckedChangeListener(new d9.d(1, this));
        EditText editText = this.title;
        if (editText == null) {
            qd.c.k("title");
            throw null;
        }
        editText.addTextChangedListener(new a());
        EditText editText2 = this.primary;
        if (editText2 == null) {
            qd.c.k("primary");
            throw null;
        }
        editText2.addTextChangedListener(new b());
        EditText editText3 = this.secondary;
        if (editText3 == null) {
            qd.c.k("secondary");
            throw null;
        }
        editText3.addTextChangedListener(new c());
        EditText editText4 = this.tertiary;
        if (editText4 == null) {
            qd.c.k("tertiary");
            throw null;
        }
        editText4.addTextChangedListener(new d());
        EditText editText5 = this.comment;
        if (editText5 != null) {
            editText5.addTextChangedListener(new e());
        } else {
            qd.c.k("comment");
            throw null;
        }
    }

    @Override
    public final boolean onCreateOptionsMenu(Menu menu) {
        qd.c.f("menu", menu);
        getMenuInflater().inflate(R.menu.bugreporter_menu, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public final boolean onOptionsItemSelected(MenuItem menuItem) {
        p pVar;
        String str;
        qd.c.f("item", menuItem);
        if (menuItem.getItemId() == R.id.menu_send) {
            ab.c F1 = F1();
            new io.reactivex.rxjava3.internal.operators.single.b(new ab.b(F1)).j(io.reactivex.rxjava3.schedulers.a.f7049b).g(io.reactivex.rxjava3.android.schedulers.b.a()).a(new io.reactivex.rxjava3.internal.observers.d(new ab.b(F1)));
            return true;
        }
        if (menuItem.getItemId() == R.id.menu_github) {
            pVar = new p(this);
            str = "https://sdmaid.darken.eu/issues";
        } else if (menuItem.getItemId() != R.id.menu_help) {
            if (menuItem.getItemId() == 16908332) {
                finish();
                return true;
            }
            return super.onOptionsItemSelected(menuItem);
        } else {
            pVar = new p(this);
            str = "https://github.com/d4rken/sdmaid-public/wiki/Reporting-a-bug";
        }
        p.d d10 = pVar.d(str);
        d10.d = this;
        d10.f9767e = true;
        d10.c();
        return true;
    }

    @Override
    public final boolean onPrepareOptionsMenu(Menu menu) {
        qd.c.f("menu", menu);
        menu.findItem(R.id.menu_send).setVisible(this.f4895z);
        return super.onPrepareOptionsMenu(menu);
    }

    @Override
    public final void onSaveInstanceState(Bundle bundle) {
        qd.c.f("outState", bundle);
        this.y.b(bundle);
        super.onSaveInstanceState(bundle);
    }
}