导航菜单

页面标题

页面副标题

Hyouka private v5.8.9 - UnLockAppActivity.java 源代码

正在查看: Hyouka private v5.8.9 应用的 UnLockAppActivity.java JAVA 源代码文件

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


package com.beint.project.screens.settings.passCode;

import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.MotionEvent;
import android.view.View;
import android.widget.TextView;
import androidx.lifecycle.m0;
import bc.k0;
import bc.l0;
import bc.y0;
import com.beint.project.AbstractZangiActivity;
import com.beint.project.core.Categories.Long_UtilsKt;
import com.beint.project.core.managers.DrawableManager;
import com.beint.project.core.utils.NotificationCenter;
import com.beint.project.screens.sms.AppModeNotifierActivity;
import com.beint.project.screens.ui.EditTextForPin;
import com.beint.project.screens.ui.NumPadView;
import com.beint.project.screens.ui.UnLockAppScreen;
import com.beint.project.services.PassCodeController;
import com.beint.project.utils.DeviceTokenResolver;
import com.beint.project.utils.ProgressDialogUtils;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.Iterator;
import kotlin.jvm.internal.x;

public final class UnLockAppActivity extends AppModeNotifierActivity {
    public static final Companion Companion = new Companion(null);
    private static WeakReference<UnLockAppActivity> instance;
    private UnLockAppScreen activityView;
    private boolean animationInProgress;
    private long timerMillsUntilFinished;
    private UnLockAppActivityViewModel viewModel;
    private final long timerFinishedTime = DeviceTokenResolver.REGISTRATION_EXPIRY_TIME_MS;
    private int wrongPassCodeSetOpportunityCount = 10;

    public static final class Companion {
        private Companion() {
        }

        public Companion(kotlin.jvm.internal.g gVar) {
            this();
        }

        public final WeakReference<UnLockAppActivity> getInstance() {
            return UnLockAppActivity.instance;
        }

        public final void setInstance(WeakReference<UnLockAppActivity> weakReference) {
            UnLockAppActivity.instance = weakReference;
        }
    }

    public class WhenMappings {
        public static final int[] $EnumSwitchMapping$0;

        static {
            int[] iArr = new int[NumPadView.NumbersTouch.values().length];
            try {
                iArr[NumPadView.NumbersTouch.ONE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[NumPadView.NumbersTouch.TWO.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[NumPadView.NumbersTouch.THREE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr[NumPadView.NumbersTouch.FOUR.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr[NumPadView.NumbersTouch.FIVE.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                iArr[NumPadView.NumbersTouch.SIX.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                iArr[NumPadView.NumbersTouch.SEVEN.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                iArr[NumPadView.NumbersTouch.EIGHT.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                iArr[NumPadView.NumbersTouch.NINE.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                iArr[NumPadView.NumbersTouch.ZERO.ordinal()] = 10;
            } catch (NoSuchFieldError unused10) {
            }
            try {
                iArr[NumPadView.NumbersTouch.DELETE.ordinal()] = 11;
            } catch (NoSuchFieldError unused11) {
            }
            $EnumSwitchMapping$0 = iArr;
        }
    }

    private final void checkCode(String str) {
        UnLockAppActivityViewModel unLockAppActivityViewModel = this.viewModel;
        if (unLockAppActivityViewModel != null) {
            unLockAppActivityViewModel.checkCode(str, new UnLockAppActivity$checkCode$1(this), new UnLockAppActivity$checkCode$2(this), new UnLockAppActivity$checkCode$3(this));
        }
    }

    public final void handlePremiumOverAndFinishActivity() {
        NotificationCenter.INSTANCE.postNotificationName(NotificationCenter.NotificationType.UN_HIDE_CONTENT_HIDED_VIEW, (Object) null);
        finish();
    }

    public final void hideNumPadAndStartTimer(final long j) {
        UnLockAppScreen unLockAppScreen = this.activityView;
        UnLockAppScreen unLockAppScreen2 = null;
        if (unLockAppScreen == null) {
            kotlin.jvm.internal.k.q("activityView");
            unLockAppScreen = null;
        }
        TextView title = unLockAppScreen.getTitle();
        if (title != null) {
            title.setVisibility(8);
        }
        UnLockAppScreen unLockAppScreen3 = this.activityView;
        if (unLockAppScreen3 == null) {
            kotlin.jvm.internal.k.q("activityView");
            unLockAppScreen3 = null;
        }
        NumPadView numPad = unLockAppScreen3.getNumPad();
        if (numPad != null) {
            numPad.setVisibility(8);
        }
        UnLockAppScreen unLockAppScreen4 = this.activityView;
        if (unLockAppScreen4 == null) {
            kotlin.jvm.internal.k.q("activityView");
            unLockAppScreen4 = null;
        }
        EditTextForPin etTextForPin = unLockAppScreen4.getEtTextForPin();
        if (etTextForPin != null) {
            etTextForPin.setVisibility(8);
        }
        UnLockAppScreen unLockAppScreen5 = this.activityView;
        if (unLockAppScreen5 == null) {
            kotlin.jvm.internal.k.q("activityView");
        } else {
            unLockAppScreen2 = unLockAppScreen5;
        }
        unLockAppScreen2.getWrongPassCodeWaitingText().setVisibility(0);
        final String string = getString(2131887579);
        kotlin.jvm.internal.k.e(string, "getString(R.string.too_many_tries_text)");
        new CountDownTimer(j) {
            @Override
            public void onFinish() {
                UnLockAppScreen unLockAppScreen6;
                UnLockAppScreen unLockAppScreen7;
                UnLockAppScreen unLockAppScreen8;
                UnLockAppScreen unLockAppScreen9;
                unLockAppScreen6 = this.activityView;
                UnLockAppScreen unLockAppScreen10 = null;
                if (unLockAppScreen6 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen6 = null;
                }
                TextView title2 = unLockAppScreen6.getTitle();
                if (title2 != null) {
                    title2.setVisibility(0);
                }
                unLockAppScreen7 = this.activityView;
                if (unLockAppScreen7 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen7 = null;
                }
                NumPadView numPad2 = unLockAppScreen7.getNumPad();
                if (numPad2 != null) {
                    numPad2.setVisibility(0);
                }
                unLockAppScreen8 = this.activityView;
                if (unLockAppScreen8 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen8 = null;
                }
                EditTextForPin etTextForPin2 = unLockAppScreen8.getEtTextForPin();
                if (etTextForPin2 != null) {
                    etTextForPin2.setVisibility(0);
                }
                unLockAppScreen9 = this.activityView;
                if (unLockAppScreen9 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                } else {
                    unLockAppScreen10 = unLockAppScreen9;
                }
                unLockAppScreen10.getWrongPassCodeWaitingText().setVisibility(8);
            }

            @Override
            public void onTick(long j7) {
                UnLockAppScreen unLockAppScreen6;
                this.timerMillsUntilFinished = j7;
                unLockAppScreen6 = this.activityView;
                if (unLockAppScreen6 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen6 = null;
                }
                TextView wrongPassCodeWaitingText = unLockAppScreen6.getWrongPassCodeWaitingText();
                x xVar = x.a;
                String format = String.format(string, Arrays.copyOf(new Object[]{Long_UtilsKt.getMillsToHourSecondAndMills(j7)}, 1));
                kotlin.jvm.internal.k.e(format, "format(format, *args)");
                wrongPassCodeWaitingText.setText(format);
            }
        }.start();
    }

    @SuppressLint({"ClickableViewAccessibility"})
    private final void initTouchListeners() {
        UnLockAppScreen unLockAppScreen = this.activityView;
        if (unLockAppScreen == null) {
            kotlin.jvm.internal.k.q("activityView");
            unLockAppScreen = null;
        }
        NumPadView numPad = unLockAppScreen.getNumPad();
        if (numPad != null) {
            numPad.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public final boolean onTouch(View view, MotionEvent motionEvent) {
                    boolean initTouchListeners$lambda$1;
                    initTouchListeners$lambda$1 = UnLockAppActivity.initTouchListeners$lambda$1(UnLockAppActivity.this, view, motionEvent);
                    return initTouchListeners$lambda$1;
                }
            });
        }
    }

    public static final boolean initTouchListeners$lambda$1(UnLockAppActivity unLockAppActivity, View view, MotionEvent motionEvent) {
        kotlin.jvm.internal.k.f(unLockAppActivity, "this$0");
        if (motionEvent == null) {
            return true;
        }
        UnLockAppScreen unLockAppScreen = unLockAppActivity.activityView;
        UnLockAppScreen unLockAppScreen2 = null;
        if (unLockAppScreen == null) {
            kotlin.jvm.internal.k.q("activityView");
            unLockAppScreen = null;
        }
        NumPadView numPad = unLockAppScreen.getNumPad();
        Drawable touchedNumberDrawable = numPad != null ? numPad.getTouchedNumberDrawable(unLockAppActivity, motionEvent) : null;
        if (motionEvent.getAction() == 0 || motionEvent.getAction() == 5 || motionEvent.getAction() == 2 || motionEvent.getAction() == 7) {
            if (touchedNumberDrawable != null) {
                touchedNumberDrawable.setAlpha(95);
                UnLockAppScreen unLockAppScreen3 = unLockAppActivity.activityView;
                if (unLockAppScreen3 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                } else {
                    unLockAppScreen2 = unLockAppScreen3;
                }
                NumPadView numPad2 = unLockAppScreen2.getNumPad();
                if (numPad2 != null) {
                    numPad2.invalidate();
                }
                return true;
            }
        } else if ((motionEvent.getAction() == 1 || motionEvent.getAction() == 6 || motionEvent.getAction() == 3) && touchedNumberDrawable != null) {
            touchedNumberDrawable.setAlpha(255);
            UnLockAppScreen unLockAppScreen4 = unLockAppActivity.activityView;
            if (unLockAppScreen4 == null) {
                kotlin.jvm.internal.k.q("activityView");
            } else {
                unLockAppScreen2 = unLockAppScreen4;
            }
            NumPadView numPad3 = unLockAppScreen2.getNumPad();
            if (numPad3 != null) {
                numPad3.invalidate();
            }
            unLockAppActivity.onNumbersTouchEvent(motionEvent);
            return true;
        }
        UnLockAppScreen unLockAppScreen5 = unLockAppActivity.activityView;
        if (unLockAppScreen5 == null) {
            kotlin.jvm.internal.k.q("activityView");
        } else {
            unLockAppScreen2 = unLockAppScreen5;
        }
        NumPadView numPad4 = unLockAppScreen2.getNumPad();
        if (numPad4 != null) {
            numPad4.invalidate();
        }
        Iterator it = DrawableManager.INSTANCE.getNumPadDrawablesManager().getAllNumbers(unLockAppActivity).iterator();
        while (it.hasNext()) {
            ((Drawable) it.next()).setAlpha(255);
        }
        return true;
    }

    private final void setStatusBarColor() {
        getWindow().setStatusBarColor(androidx.core.content.a.c(this, 2131099794));
    }

    public final void showLoadingProgress() {
        ProgressDialogUtils.showDialog(this, "", getString(2131886440), false);
    }

    public final void startVibrationAndShowErrorMessage() {
        bc.g.d(k0.a(y0.c()), (jb.g) null, (l0) null, new UnLockAppActivity$startVibrationAndShowErrorMessage$1(this, null), 3, (Object) null);
    }

    public void onBackPressed() {
        AbstractZangiActivity.goToBackground();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        Long lastBgTime;
        Long timerMillsUntilFinished;
        super.onCreate(bundle);
        requestWindowFeature(1);
        setStatusBarColor();
        this.viewModel = m0.d(this, PassCodeController.INSTANCE.getPassCodeViewModelFactory()).a(UnLockAppActivityViewModel.class);
        UnLockAppScreen unLockAppScreen = new UnLockAppScreen(this);
        this.activityView = unLockAppScreen;
        setContentView(unLockAppScreen);
        if (!getIntent().getBooleanExtra("animation", false)) {
            overridePendingTransition(0, 0);
        }
        initTouchListeners();
        instance = new WeakReference<>(this);
        UnLockAppActivityViewModel unLockAppActivityViewModel = this.viewModel;
        if ((unLockAppActivityViewModel != null ? unLockAppActivityViewModel.getWrongPassCodeSatedCount() : 0) >= this.wrongPassCodeSetOpportunityCount) {
            UnLockAppActivityViewModel unLockAppActivityViewModel2 = this.viewModel;
            long j = 0;
            long longValue = (unLockAppActivityViewModel2 == null || (timerMillsUntilFinished = unLockAppActivityViewModel2.getTimerMillsUntilFinished()) == null) ? 0L : timerMillsUntilFinished.longValue();
            long currentTimeMillis = System.currentTimeMillis();
            UnLockAppActivityViewModel unLockAppActivityViewModel3 = this.viewModel;
            if (unLockAppActivityViewModel3 != null && (lastBgTime = unLockAppActivityViewModel3.getLastBgTime()) != null) {
                j = lastBgTime.longValue();
            }
            hideNumPadAndStartTimer(longValue - (currentTimeMillis - j));
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        instance = null;
    }

    public final boolean onNumbersTouchEvent(MotionEvent motionEvent) {
        kotlin.jvm.internal.k.f(motionEvent, "event");
        UnLockAppScreen unLockAppScreen = this.activityView;
        UnLockAppScreen unLockAppScreen2 = null;
        if (unLockAppScreen == null) {
            kotlin.jvm.internal.k.q("activityView");
            unLockAppScreen = null;
        }
        NumPadView numPad = unLockAppScreen.getNumPad();
        NumPadView.NumbersTouch touchType = numPad != null ? numPad.getTouchType(motionEvent) : null;
        switch (touchType == null ? -1 : WhenMappings.$EnumSwitchMapping$0[touchType.ordinal()]) {
            case 1:
                UnLockAppScreen unLockAppScreen3 = this.activityView;
                if (unLockAppScreen3 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen3 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen3, "1", null, 2, null));
                break;
            case 2:
                UnLockAppScreen unLockAppScreen4 = this.activityView;
                if (unLockAppScreen4 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen4 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen4, "2", null, 2, null));
                break;
            case 3:
                UnLockAppScreen unLockAppScreen5 = this.activityView;
                if (unLockAppScreen5 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen5 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen5, "3", null, 2, null));
                break;
            case 4:
                UnLockAppScreen unLockAppScreen6 = this.activityView;
                if (unLockAppScreen6 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen6 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen6, "4", null, 2, null));
                break;
            case 5:
                UnLockAppScreen unLockAppScreen7 = this.activityView;
                if (unLockAppScreen7 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen7 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen7, "5", null, 2, null));
                break;
            case 6:
                UnLockAppScreen unLockAppScreen8 = this.activityView;
                if (unLockAppScreen8 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen8 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen8, "6", null, 2, null));
                break;
            case 7:
                UnLockAppScreen unLockAppScreen9 = this.activityView;
                if (unLockAppScreen9 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen9 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen9, "7", null, 2, null));
                break;
            case 8:
                UnLockAppScreen unLockAppScreen10 = this.activityView;
                if (unLockAppScreen10 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen10 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen10, "8", null, 2, null));
                break;
            case 9:
                UnLockAppScreen unLockAppScreen11 = this.activityView;
                if (unLockAppScreen11 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen11 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen11, "9", null, 2, null));
                break;
            case 10:
                UnLockAppScreen unLockAppScreen12 = this.activityView;
                if (unLockAppScreen12 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                    unLockAppScreen12 = null;
                }
                checkCode(UnLockAppScreen.numPadItemClick$default(unLockAppScreen12, "0", null, 2, null));
                break;
            case 11:
                UnLockAppScreen unLockAppScreen13 = this.activityView;
                if (unLockAppScreen13 == null) {
                    kotlin.jvm.internal.k.q("activityView");
                } else {
                    unLockAppScreen2 = unLockAppScreen13;
                }
                unLockAppScreen2.numPadItemClick("", Boolean.TRUE);
                break;
        }
        return true;
    }

    @Override
    protected void onStop() {
        UnLockAppActivityViewModel unLockAppActivityViewModel = this.viewModel;
        if ((unLockAppActivityViewModel != null ? unLockAppActivityViewModel.getWrongPassCodeSatedCount() : 0) >= this.wrongPassCodeSetOpportunityCount) {
            UnLockAppActivityViewModel unLockAppActivityViewModel2 = this.viewModel;
            if (unLockAppActivityViewModel2 != null) {
                unLockAppActivityViewModel2.setWrongPassCodeSetCount(unLockAppActivityViewModel2 != null ? unLockAppActivityViewModel2.getWrongPassCodeSatedCount() : 0);
            }
            UnLockAppActivityViewModel unLockAppActivityViewModel3 = this.viewModel;
            if (unLockAppActivityViewModel3 != null) {
                unLockAppActivityViewModel3.storeTimerMillsUntilFinished(this.timerMillsUntilFinished);
            }
        } else {
            UnLockAppActivityViewModel unLockAppActivityViewModel4 = this.viewModel;
            if (unLockAppActivityViewModel4 != null) {
                unLockAppActivityViewModel4.setWrongPassCodeSetCount(0);
            }
        }
        super.onStop();
    }
}