APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Silent Camera
版本号:8.12.3
包名称:com.peace.SilentCamera

MD5 校验值:6bdafb1d58f3fe7a55bbf3e7446795c3

反编译源代码说明

CameraActivity.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.peace.SilentCamera;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.ContentObserver;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.hardware.Camera;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.location.Location;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Vibrator;
import android.provider.MediaStore;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.widget.AdapterView;
import android.widget.CompoundButton;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import com.android.billingclient.api.Purchase;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.facebook.ads.R;
import com.google.ads.mediation.facebook.FacebookMediationAdapter;
import com.google.gson.Gson;
import com.peace.SilentCamera.CameraSpec;
import com.peace.SilentCamera.d;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;

public class CameraActivity extends androidx.appcompat.app.c implements SensorEventListener {
    static boolean H1 = true;
    static final String I1 = null;
    int A1;
    AlertDialog H0;
    BroadcastReceiver I0;
    com.peace.SilentCamera.d L0;
    LinearLayout M0;
    k3.b N0;
    ImageButton P0;
    private s0 Q;
    TextView Q0;
    Camera R;
    ImageButton R0;
    int S;
    LinearLayout S0;
    App T;
    f5.b T0;
    n0 U;
    com.peace.SilentCamera.c U0;
    com.peace.SilentCamera.r V;
    AlertDialog V0;
    o0 W;
    ImageButton W0;
    TextView X;
    ImageButton X0;
    CameraSpec Y;
    ImageButton Y0;
    String[] Z;
    FrameLayout Z0;

    SensorManager f23523a0;

    TextView f23524a1;

    ImageButton f23526b1;

    ImageButton f23528c1;

    ImageButton f23530d1;

    ImageButton f23532e1;

    ImageButton f23534f1;

    ImageButton f23536g1;

    ImageButton f23538h1;

    ImageView f23540i1;

    Location f23541j0;

    ImageView f23543k0;

    l0 f23544k1;

    Vibrator f23545l0;

    Uri f23546l1;

    ImageView f23551o0;

    ImageView f23553p0;

    ImageView f23555q0;

    ImageView f23557r0;

    SeekBar f23559s0;

    SeekBar f23561t0;

    Locale f23564u1;

    ImageView f23570x1;

    ImageView f23572y1;

    ImageView f23574z1;

    float[] f23525b0 = new float[9];

    float[] f23527c0 = new float[9];

    float[] f23529d0 = new float[3];

    float[] f23531e0 = new float[3];

    float[] f23533f0 = new float[3];

    int f23535g0 = 0;

    int f23537h0 = 0;

    int f23539i0 = 0;

    int f23547m0 = 0;

    int f23549n0 = 0;

    int f23563u0 = 0;

    int f23565v0 = 0;

    int f23567w0 = 0;

    int f23569x0 = 0;

    int f23571y0 = 0;

    int f23573z0 = 0;
    int A0 = 0;
    int B0 = 0;
    int C0 = 0;
    int D0 = 0;
    boolean E0 = true;
    boolean F0 = false;
    boolean G0 = true;
    boolean J0 = true;
    boolean K0 = true;
    int O0 = 0;

    Handler f23542j1 = new Handler();

    boolean f23548m1 = false;

    boolean f23550n1 = true;

    boolean f23552o1 = true;

    String f23554p1 = "null";

    String f23556q1 = "null";

    String f23558r1 = "null";

    int f23560s1 = 14;

    int f23562t1 = 0;

    boolean f23566v1 = false;

    boolean f23568w1 = false;
    int B1 = 20;
    int C1 = 0;
    int D1 = 0;
    int E1 = 0;
    int F1 = 0;
    int G1 = 0;

    class a implements View.OnClickListener {
        a() {
        }

        @Override
        public void onClick(View view) {
            try {
                CameraActivity.this.w1();
            } catch (Throwable unused) {
            }
        }
    }

    public class a0 implements AdapterView.OnItemClickListener {
        a0() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i10, long j10) {
            Camera.Parameters parameters;
            try {
                parameters = CameraActivity.this.R.getParameters();
            } catch (Throwable unused) {
            }
            if (parameters.getSupportedColorEffects() == null) {
                new a1(CameraActivity.this).a(R.string.not_applicable);
                return;
            }
            switch (i10) {
                case 0:
                    if (parameters.getSupportedColorEffects().indexOf("none") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("none");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        CameraActivity.this.T.f23514i = 0;
                        break;
                    }
                case 1:
                    if (parameters.getSupportedColorEffects().indexOf("sepia") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("sepia");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_sepia);
                        CameraActivity.this.T.f23514i = 1;
                        break;
                    }
                case 2:
                    if (parameters.getSupportedColorEffects().indexOf("mono") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("mono");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_mono);
                        CameraActivity.this.T.f23514i = 2;
                        break;
                    }
                case 3:
                    if (parameters.getSupportedColorEffects().indexOf("negative") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("negative");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_invert);
                        CameraActivity.this.T.f23514i = 3;
                        break;
                    }
                case 4:
                    if (parameters.getSupportedColorEffects().indexOf("aqua") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("aqua");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_aqua);
                        CameraActivity.this.T.f23514i = 4;
                        break;
                    }
                case 5:
                    if (parameters.getSupportedColorEffects().indexOf("posterize") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("posterize");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_posterize);
                        CameraActivity.this.T.f23514i = 5;
                        break;
                    }
                case 6:
                    if (parameters.getSupportedColorEffects().indexOf("solarize") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("solarize");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_solorize);
                        CameraActivity.this.T.f23514i = 6;
                        break;
                    }
                case 7:
                    if (parameters.getSupportedColorEffects().indexOf("blackboard") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("blackboard");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_black_board);
                        CameraActivity.this.T.f23514i = 7;
                        break;
                    }
                case 8:
                    if (parameters.getSupportedColorEffects().indexOf("whiteboard") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setColorEffect("whiteboard");
                        CameraActivity.this.f23534f1.setImageResource(R.drawable.color_effect_white_board);
                        CameraActivity.this.T.f23514i = 8;
                        break;
                    }
            }
            CameraActivity.this.R.setParameters(parameters);
            CameraActivity.this.V.a();
        }
    }

    class b implements View.OnClickListener {
        b() {
        }

        @Override
        public void onClick(View view) {
            try {
                if (CameraActivity.this.R.getParameters().getSupportedWhiteBalance() == null) {
                    new a1(CameraActivity.this).a(R.string.not_applicable);
                } else {
                    CameraActivity.this.z1();
                }
            } catch (Throwable unused) {
            }
        }
    }

    public class b0 implements AdapterView.OnItemClickListener {
        b0() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i10, long j10) {
            try {
                Camera.Parameters parameters = CameraActivity.this.R.getParameters();
                if (i10 == 0) {
                    CameraActivity cameraActivity = CameraActivity.this;
                    App app = cameraActivity.T;
                    app.f23509d = true;
                    app.f23510e = false;
                    cameraActivity.f23528c1.setImageResource(R.drawable.focus_auto);
                    if (parameters.getSupportedFocusModes().indexOf("auto") != -1) {
                        parameters.setFocusMode("auto");
                        CameraActivity.this.R.setParameters(parameters);
                    }
                } else if (i10 == 1) {
                    CameraActivity cameraActivity2 = CameraActivity.this;
                    App app2 = cameraActivity2.T;
                    app2.f23509d = false;
                    app2.f23510e = false;
                    cameraActivity2.f23528c1.setImageResource(R.drawable.focus_manual);
                    if (parameters.getSupportedFocusModes().indexOf("auto") != -1) {
                        parameters.setFocusMode("auto");
                        CameraActivity.this.R.setParameters(parameters);
                    }
                } else if (i10 == 2) {
                    if (parameters.getSupportedFocusModes().indexOf("macro") != -1) {
                        parameters.setFocusMode("macro");
                        CameraActivity.this.R.setParameters(parameters);
                        CameraActivity cameraActivity3 = CameraActivity.this;
                        App app3 = cameraActivity3.T;
                        app3.f23509d = true;
                        app3.f23510e = true;
                        cameraActivity3.f23528c1.setImageResource(R.drawable.focus_macro);
                    } else {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                    }
                }
                CameraActivity.this.j1();
            } catch (Throwable unused) {
            }
            CameraActivity.this.V.a();
        }
    }

    class c implements View.OnClickListener {
        c() {
        }

        @Override
        public void onClick(View view) {
            CameraActivity cameraActivity = CameraActivity.this;
            cameraActivity.u1(cameraActivity);
        }
    }

    public class c0 implements l5.f<Location> {
        c0() {
        }

        @Override
        public void onSuccess(Location location) {
            if (location != null) {
                CameraActivity.this.f23541j0 = location;
            }
        }
    }

    class d implements View.OnClickListener {
        d() {
        }

        @Override
        public void onClick(View view) {
            CameraActivity.this.v1();
        }
    }

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

        @Override
        public void onClick(View view) {
            CameraActivity.this.V.a();
            CameraActivity.this.finish();
        }
    }

    class e implements View.OnClickListener {
        e() {
        }

        @Override
        public void onClick(View view) {
            CameraActivity.this.startActivity(new Intent(CameraActivity.this, (Class<?>) SettingsActivity.class));
        }
    }

    class e0 implements ScaleGestureDetector.OnScaleGestureListener {
        e0() {
        }

        @Override
        public boolean onScale(ScaleGestureDetector scaleGestureDetector) {
            try {
                float scaleFactor = scaleGestureDetector.getScaleFactor() - 1.0f;
                Camera.Parameters parameters = CameraActivity.this.R.getParameters();
                if (!parameters.isZoomSupported()) {
                    return true;
                }
                int maxZoom = parameters.getMaxZoom();
                CameraActivity cameraActivity = CameraActivity.this;
                float f10 = maxZoom;
                int i10 = (int) (cameraActivity.f23547m0 + (scaleFactor * f10));
                cameraActivity.f23547m0 = i10;
                if (i10 < 0) {
                    cameraActivity.f23547m0 = 0;
                } else if (i10 > maxZoom) {
                    cameraActivity.f23547m0 = maxZoom;
                }
                parameters.setZoom(cameraActivity.f23547m0);
                CameraActivity.this.R.setParameters(parameters);
                int max = CameraActivity.this.f23559s0.getMax();
                CameraActivity.this.f23559s0.setProgress((int) ((r0.f23547m0 / f10) * max));
                return true;
            } catch (Throwable unused) {
                return true;
            }
        }

        @Override
        public boolean onScaleBegin(ScaleGestureDetector scaleGestureDetector) {
            return true;
        }

        @Override
        public void onScaleEnd(ScaleGestureDetector scaleGestureDetector) {
        }
    }

    class f implements View.OnClickListener {
        f() {
        }

        @Override
        public void onClick(View view) {
            CameraActivity.this.f23538h1.setEnabled(false);
            CameraActivity.this.startActivity(new Intent(CameraActivity.this, (Class<?>) ViewerActivity.class));
        }
    }

    class f0 implements View.OnTouchListener {

        final ScaleGestureDetector f23586a;

        final GestureDetector f23587b;

        f0(ScaleGestureDetector scaleGestureDetector, GestureDetector gestureDetector) {
            this.f23586a = scaleGestureDetector;
            this.f23587b = gestureDetector;
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            return motionEvent.getPointerCount() >= 2 ? this.f23586a.onTouchEvent(motionEvent) : this.f23587b.onTouchEvent(motionEvent);
        }
    }

    class g implements SeekBar.OnSeekBarChangeListener {
        g() {
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int i10, boolean z9) {
            try {
                int max = seekBar.getMax();
                Camera.Parameters parameters = CameraActivity.this.R.getParameters();
                if (parameters.isZoomSupported()) {
                    int maxZoom = (parameters.getMaxZoom() * i10) / max;
                    CameraActivity.this.f23547m0 = maxZoom;
                    parameters.setZoom(maxZoom);
                    CameraActivity.this.R.setParameters(parameters);
                }
            } catch (Exception unused) {
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    }

    class g0 implements View.OnLongClickListener {
        g0() {
        }

        @Override
        public boolean onLongClick(View view) {
            CameraActivity cameraActivity = CameraActivity.this;
            cameraActivity.O0 = 1;
            try {
                cameraActivity.Q.r();
            } catch (Throwable unused) {
                CameraActivity.this.Q0();
            }
            return true;
        }
    }

    class h implements SeekBar.OnSeekBarChangeListener {
        h() {
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int i10, boolean z9) {
            try {
                Camera.Parameters parameters = CameraActivity.this.R.getParameters();
                int max = seekBar.getMax();
                int maxExposureCompensation = parameters.getMaxExposureCompensation();
                int minExposureCompensation = parameters.getMinExposureCompensation();
                CameraActivity.this.f23549n0 = (int) Math.ceil((((maxExposureCompensation - minExposureCompensation) * i10) / max) + minExposureCompensation);
                parameters.setExposureCompensation(CameraActivity.this.f23549n0);
                CameraActivity.this.R.setParameters(parameters);
            } catch (Throwable unused) {
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            try {
                Camera.Parameters parameters = CameraActivity.this.R.getParameters();
                if (parameters.isAutoExposureLockSupported()) {
                    parameters.setAutoExposureLock(false);
                    CameraActivity.this.R.setParameters(parameters);
                }
            } catch (Throwable unused) {
            }
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            try {
                Camera.Parameters parameters = CameraActivity.this.R.getParameters();
                if (parameters.isAutoExposureLockSupported()) {
                    parameters.setAutoExposureLock(true);
                    CameraActivity.this.R.setParameters(parameters);
                }
            } catch (Throwable unused) {
            }
        }
    }

    class h0 implements View.OnTouchListener {
        h0() {
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (motionEvent.getAction() == 1) {
                CameraActivity cameraActivity = CameraActivity.this;
                int i10 = cameraActivity.O0;
                if (i10 == 1) {
                    cameraActivity.O0 = 2;
                } else if (i10 == 2) {
                    cameraActivity.O0 = 0;
                } else if (i10 == 0) {
                    try {
                        cameraActivity.Q.r();
                    } catch (Throwable th) {
                        CameraActivity.this.Q0();
                        App.h(th);
                    }
                }
            }
            return false;
        }
    }

    class i extends BroadcastReceiver {
        i() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            CameraActivity cameraActivity = CameraActivity.this;
            if (cameraActivity.G0) {
                ImageView imageView = (ImageView) cameraActivity.findViewById(R.id.imageViewShutterEffect);
                String action = intent.getAction();
                if (action != null) {
                    if (action.equals("android.intent.action.SCREEN_ON")) {
                        imageView.setVisibility(4);
                        imageView.invalidate();
                        CameraActivity.this.Q.f();
                    } else if (action.equals("android.intent.action.SCREEN_OFF")) {
                        CameraActivity.this.Q.d();
                        imageView.setVisibility(0);
                        imageView.invalidate();
                    }
                }
            }
        }
    }

    class i0 implements View.OnClickListener {
        i0() {
        }

        @Override
        public void onClick(View view) {
            try {
                CameraActivity cameraActivity = CameraActivity.this;
                cameraActivity.E0 = cameraActivity.F0();
                CameraActivity cameraActivity2 = CameraActivity.this;
                if (cameraActivity2.E0) {
                    cameraActivity2.t1();
                    CameraActivity.this.F0 = false;
                } else if (s0.T.facing == 0) {
                    cameraActivity2.T.f23508c = 0;
                    cameraActivity2.W0.setImageResource(R.drawable.flash_off);
                    new a1(CameraActivity.this).a(R.string.not_applicable);
                } else {
                    cameraActivity2.t1();
                }
                CameraActivity.this.j1();
            } catch (Throwable unused) {
            }
        }
    }

    class j implements View.OnClickListener {
        j() {
        }

        @Override
        public void onClick(View view) {
            App.K.g("headerState", App.K.b("headerState", 0) == 0 ? 1 : 0);
            CameraActivity.this.F1();
        }
    }

    class j0 implements View.OnClickListener {
        j0() {
        }

        @Override
        public void onClick(View view) {
            CameraActivity.this.B1();
        }
    }

    public class k implements Runnable {
        k() {
        }

        @Override
        public void run() {
            try {
                CameraActivity.this.f23540i1.setVisibility(4);
            } catch (Throwable unused) {
            }
        }
    }

    class k0 implements View.OnClickListener {
        k0() {
        }

        @Override
        public void onClick(View view) {
            try {
                if (CameraActivity.this.R.getParameters().getSupportedColorEffects() == null) {
                    new a1(CameraActivity.this).a(R.string.not_applicable);
                } else {
                    CameraActivity cameraActivity = CameraActivity.this;
                    cameraActivity.r1(cameraActivity);
                }
            } catch (Throwable unused) {
            }
        }
    }

    class l implements View.OnClickListener {
        l() {
        }

        @Override
        public void onClick(View view) {
            CameraActivity.this.y1();
        }
    }

    class l0 extends ContentObserver {
        l0(Handler handler) {
            super(handler);
        }

        @Override
        public void onChange(boolean z9) {
            onChange(z9, null);
        }

        @Override
        public void onChange(boolean z9, Uri uri) {
            if (CameraActivity.this.Q.G) {
                CameraActivity.this.G1();
            }
        }
    }

    public class m implements AdapterView.OnItemClickListener {
        m() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i10, long j10) {
            CameraActivity cameraActivity = CameraActivity.this;
            App app = cameraActivity.T;
            if (i10 != app.f23506a) {
                app.f23506a = i10;
                cameraActivity.C1(i10);
            }
            CameraActivity.this.V.a();
        }
    }

    private class m0 implements d.f {
        private m0() {
        }

        m0(CameraActivity cameraActivity, k kVar) {
            this();
        }

        @Override
        public void a() {
        }

        @Override
        public void b(List<Purchase> list) {
            if (list.size() > 0) {
                for (Purchase purchase : list) {
                    if (purchase.c() == 1 && !purchase.f()) {
                        if (!CameraActivity.this.L0.g(p1.a.b().b(purchase.d()).a())) {
                            App.g("acknowledgePurchase_error", "in", CameraActivity.class.getSimpleName());
                        }
                    }
                    if (!App.e()) {
                        Iterator<String> it = purchase.b().iterator();
                        while (it.hasNext()) {
                            App.K.f(it.next(), true);
                        }
                        CameraActivity.this.T.i();
                    }
                }
            }
        }
    }

    public class n implements AdapterView.OnItemClickListener {
        n() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i10, long j10) {
            int i11 = 0;
            if (i10 == 0) {
                CameraActivity.this.R0.setImageResource(R.drawable.timer_off);
            } else if (i10 == 1) {
                CameraActivity.this.R0.setImageResource(R.drawable.timer_3s);
                i11 = 3;
            } else if (i10 == 2) {
                CameraActivity.this.R0.setImageResource(R.drawable.timer_5s);
                i11 = 5;
            } else if (i10 == 3) {
                CameraActivity.this.R0.setImageResource(R.drawable.timer_10s);
                i11 = 10;
            }
            App.K.g("timerSeconds", i11);
            CameraActivity.this.V.a();
        }
    }

    public class o extends j3.d {
        o() {
        }

        @Override
        public void n() {
            super.n();
            CameraActivity.this.f23566v1 = true;
        }
    }

    public class p implements AdapterView.OnItemClickListener {
        p() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i10, long j10) {
            CameraActivity cameraActivity = CameraActivity.this;
            App app = cameraActivity.T;
            boolean z9 = false;
            if (app.f23508c == 2) {
                app.f23512g = 0;
                cameraActivity.k1();
            }
            if (i10 == 0) {
                CameraActivity cameraActivity2 = CameraActivity.this;
                cameraActivity2.T.f23508c = 0;
                cameraActivity2.Q.g();
                CameraActivity.this.F0 = false;
            } else if (i10 == 1) {
                CameraActivity cameraActivity3 = CameraActivity.this;
                cameraActivity3.T.f23508c = 1;
                cameraActivity3.Q.g();
                try {
                    CameraActivity cameraActivity4 = CameraActivity.this;
                    if (s0.T.facing == 1 && !cameraActivity4.E0) {
                        z9 = true;
                    }
                    cameraActivity4.F0 = z9;
                } catch (Throwable unused) {
                }
            } else if (i10 == 2) {
                CameraActivity cameraActivity5 = CameraActivity.this;
                cameraActivity5.T.f23508c = 3;
                cameraActivity5.D1();
                CameraActivity.this.F0 = false;
            }
            CameraActivity.this.e1();
            CameraActivity.this.V.a();
        }
    }

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

        @Override
        public void onClick(View view) {
            CameraActivity cameraActivity = CameraActivity.this;
            cameraActivity.T.f23515j = 0;
            cameraActivity.g1();
            CameraActivity.this.H0.dismiss();
        }
    }

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

        @Override
        public void onClick(View view) {
            CameraActivity cameraActivity = CameraActivity.this;
            cameraActivity.T.f23515j = 1;
            cameraActivity.g1();
            CameraActivity.this.H0.dismiss();
        }
    }

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

        @Override
        public void onClick(View view) {
            CameraActivity cameraActivity = CameraActivity.this;
            cameraActivity.T.f23515j = 2;
            cameraActivity.g1();
            CameraActivity.this.H0.dismiss();
        }
    }

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

        @Override
        public void onClick(View view) {
            CameraActivity cameraActivity = CameraActivity.this;
            cameraActivity.T.f23515j = 3;
            cameraActivity.g1();
            CameraActivity.this.H0.dismiss();
        }
    }

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

        @Override
        public void onClick(View view) {
            CameraActivity cameraActivity = CameraActivity.this;
            cameraActivity.T.f23515j = 4;
            cameraActivity.g1();
            CameraActivity.this.H0.dismiss();
        }
    }

    class v implements GestureDetector.OnGestureListener {
        v() {
        }

        boolean a(float f10, float f11, float f12) {
            return Math.abs(f10) > 400.0f && Math.abs(f11) < 500.0f && Math.abs(f12) > 100.0f;
        }

        @Override
        public boolean onDown(MotionEvent motionEvent) {
            return true;
        }

        @Override
        public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent2, float f10, float f11) {
            if (!a(motionEvent2.getX() - motionEvent.getX(), motionEvent2.getY() - motionEvent.getY(), f10)) {
                CameraActivity.this.O0(motionEvent);
            }
            return false;
        }

        @Override
        public void onLongPress(MotionEvent motionEvent) {
        }

        @Override
        public boolean onScroll(MotionEvent motionEvent, MotionEvent motionEvent2, float f10, float f11) {
            return false;
        }

        @Override
        public void onShowPress(MotionEvent motionEvent) {
        }

        @Override
        public boolean onSingleTapUp(MotionEvent motionEvent) {
            CameraActivity.this.O0(motionEvent);
            return false;
        }
    }

    public class w implements CompoundButton.OnCheckedChangeListener {
        w() {
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z9) {
            CameraActivity.this.f23568w1 = z9;
            App.K.f("level", z9);
            if (z9) {
                CameraActivity.this.f23572y1.setVisibility(0);
                CameraActivity.this.f23574z1.setVisibility(0);
                CameraActivity.this.f23570x1.setVisibility(0);
            } else {
                CameraActivity.this.f23572y1.clearAnimation();
                CameraActivity.this.f23572y1.setVisibility(4);
                CameraActivity.this.f23574z1.setVisibility(4);
                CameraActivity.this.f23570x1.setVisibility(4);
            }
        }
    }

    public class x implements View.OnClickListener {

        final Switch f23613a;

        x(Switch r22) {
            this.f23613a = r22;
        }

        @Override
        public void onClick(View view) {
            this.f23613a.setChecked(!r2.isChecked());
        }
    }

    public class y implements AdapterView.OnItemClickListener {
        y() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i10, long j10) {
            try {
                CameraActivity cameraActivity = CameraActivity.this;
                cameraActivity.T.f23512g = i10;
                cameraActivity.k1();
            } catch (Throwable unused) {
            }
            CameraActivity.this.V.a();
        }
    }

    public class z implements AdapterView.OnItemClickListener {
        z() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i10, long j10) {
            Camera.Parameters parameters;
            try {
                parameters = CameraActivity.this.R.getParameters();
            } catch (Throwable unused) {
            }
            if (parameters.getSupportedWhiteBalance() == null) {
                new a1(CameraActivity.this).a(R.string.not_applicable);
                return;
            }
            switch (i10) {
                case 0:
                    if (parameters.getSupportedWhiteBalance().indexOf("auto") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("auto");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_auto);
                        CameraActivity.this.T.f23513h = 0;
                        break;
                    }
                case 1:
                    if (parameters.getSupportedWhiteBalance().indexOf("daylight") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("daylight");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_daylight);
                        CameraActivity.this.T.f23513h = 1;
                        break;
                    }
                case 2:
                    if (parameters.getSupportedWhiteBalance().indexOf("shade") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("shade");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_shade);
                        CameraActivity.this.T.f23513h = 2;
                        break;
                    }
                case 3:
                    if (parameters.getSupportedWhiteBalance().indexOf("cloudy-daylight") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("cloudy-daylight");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_cloudy);
                        CameraActivity.this.T.f23513h = 3;
                        break;
                    }
                case 4:
                    if (parameters.getSupportedWhiteBalance().indexOf("fluorescent") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("fluorescent");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_fluorescent);
                        CameraActivity.this.T.f23513h = 4;
                        break;
                    }
                case 5:
                    if (parameters.getSupportedWhiteBalance().indexOf("incandescent") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("incandescent");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_incandescent);
                        CameraActivity.this.T.f23513h = 5;
                        break;
                    }
                case 6:
                    if (parameters.getSupportedWhiteBalance().indexOf("twilight") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("twilight");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_twilight);
                        CameraActivity.this.T.f23513h = 6;
                        break;
                    }
                case 7:
                    if (parameters.getSupportedWhiteBalance().indexOf("warm-fluorescent") == -1) {
                        new a1(CameraActivity.this).a(R.string.not_applicable);
                        break;
                    } else {
                        parameters.setWhiteBalance("warm-fluorescent");
                        CameraActivity.this.f23532e1.setImageResource(R.drawable.wb_warm_fluorescent);
                        CameraActivity.this.T.f23513h = 7;
                        break;
                    }
            }
            CameraActivity.this.R.setParameters(parameters);
            CameraActivity.this.V.a();
        }
    }

    public void K0(DialogInterface dialogInterface) {
        if (isFinishing()) {
            return;
        }
        this.U0.n();
    }

    public void L0(View view) {
        this.V0.dismiss();
        finish();
    }

    public void M0(View view) {
        this.V0.dismiss();
    }

    void A0(int i10, int i11) {
        try {
            int i12 = (this.C0 - this.f23565v0) / 2;
            if (i12 > 0) {
                i11 -= i12;
            }
            this.f23540i1.setVisibility(0);
            ImageView imageView = this.f23540i1;
            imageView.layout(i10 - (imageView.getWidth() / 2), i11 - (this.f23540i1.getHeight() / 2), i10 + (this.f23540i1.getWidth() / 2), i11 + (this.f23540i1.getHeight() / 2));
            ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 1.2f, 1.0f, 1.2f, 1, 0.5f, 1, 0.5f);
            scaleAnimation.setFillBefore(true);
            scaleAnimation.setDuration(500L);
            this.f23540i1.startAnimation(scaleAnimation);
            this.f23542j1.postDelayed(new k(), 1000L);
        } catch (Throwable unused) {
        }
    }

    public void A1() {
        ImageView imageView = (ImageView) findViewById(R.id.imageViewShutterEffect);
        imageView.setVisibility(0);
        AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
        alphaAnimation.setDuration(500L);
        imageView.startAnimation(alphaAnimation);
        AlphaAnimation alphaAnimation2 = new AlphaAnimation(1.0f, 0.0f);
        alphaAnimation2.setDuration(500L);
        imageView.startAnimation(alphaAnimation2);
        imageView.setVisibility(4);
    }

    int B0(int i10) {
        if (i10 == 6) {
            return 90;
        }
        if (i10 == 3) {
            return 180;
        }
        return i10 == 8 ? 270 : 0;
    }

    void B1() {
        int i10 = this.Q.f23921h;
        if (i10 == 1 || i10 == 2 || i10 == 3) {
            return;
        }
        int i11 = this.S;
        if (i11 < 2) {
            new a1(this).a(R.string.not_applicable);
            return;
        }
        if (i11 > 2) {
            x1();
            return;
        }
        App app = this.T;
        int i12 = (app.f23506a + 1) % i11;
        app.f23506a = i12;
        C1(i12);
    }

    void C0() {
        this.T.f23506a = App.K.b("cameraID", 0);
        this.T.f23508c = App.K.b("flash", 0);
        this.T.f23509d = App.K.a("autoFocus", true);
        this.T.f23510e = App.K.a("macroFocus", false);
        this.T.f23511f = App.K.b("burstTime", 100);
        this.T.f23512g = App.K.b("sceneMode", 0);
        this.T.f23513h = App.K.b("whiteBalance", 0);
        this.T.f23514i = App.K.b("colorEffect", 0);
        this.T.f23515j = App.K.b("guideMode", 0);
        this.T.f23516k = App.K.a("touchShutter", false);
        this.T.f23517l = App.K.a("vibration", false);
        this.T.f23518m = App.K.a("geoTag", false);
        this.T.f23519n = App.K.a("mirror", false);
        this.T.F = App.K.d("path", null);
        this.T.f23520o = App.K.b("volumeKey", 0);
        this.T.E = App.K.b("aspect", -1);
        this.T.G = App.K.b("notification", 1);
        this.f23568w1 = App.K.a("level", false);
        this.B1 = App.K.b("burstNumMax", 20);
        j1();
    }

    void C1(int i10) {
        try {
            Q0();
            Camera camera = this.R;
            if (camera != null) {
                camera.setPreviewCallback(null);
                this.R.stopPreview();
                this.Q.n(null);
                this.R.release();
                this.R = null;
            }
            this.T.f23512g = 0;
            Camera open = Camera.open(i10);
            this.R = open;
            this.Q.t(open);
            App app = this.T;
            int i11 = app.f23508c;
            if (i11 == 1) {
                if (F0()) {
                    this.F0 = false;
                } else if (s0.T.facing == 0) {
                    this.T.f23508c = 0;
                    this.W0.setImageResource(R.drawable.flash_off);
                    this.F0 = false;
                } else {
                    this.F0 = true;
                }
            } else if (i11 == 2 || i11 == 3) {
                app.f23508c = 0;
                this.W0.setImageResource(R.drawable.flash_off);
                this.F0 = false;
            }
            j1();
            P0();
            if (Z0(i10, this.R)) {
                U0();
            }
        } catch (Throwable th) {
            com.google.firebase.crashlytics.a.a().c(th);
        }
    }

    void D0() {
        int checkSelfPermission;
        int checkSelfPermission2;
        if (Build.VERSION.SDK_INT >= 23) {
            checkSelfPermission = checkSelfPermission("android.permission.ACCESS_FINE_LOCATION");
            if (checkSelfPermission != 0) {
                checkSelfPermission2 = checkSelfPermission("android.permission.ACCESS_COARSE_LOCATION");
                if (checkSelfPermission2 != 0) {
                    this.T.f23518m = false;
                    this.f23541j0 = null;
                    return;
                }
            }
        }
        try {
            this.T0.b().e(this, new c0());
        } catch (Throwable unused) {
            this.T.f23518m = false;
            this.f23541j0 = null;
        }
    }

    void D1() {
        try {
            Camera.Parameters parameters = this.R.getParameters();
            if (parameters.getSupportedFlashModes().indexOf("torch") != -1) {
                parameters.setFlashMode("torch");
                this.R.setParameters(parameters);
            } else {
                new a1(this).a(R.string.not_applicable);
                this.T.f23508c = 0;
            }
        } catch (Throwable unused) {
            this.T.f23508c = 0;
        }
    }

    int E0(Context context, Uri uri) {
        if (uri.getScheme().equals("content")) {
            Cursor query = context.getContentResolver().query(uri, new String[]{"orientation"}, null, null, null);
            if (query.moveToFirst()) {
                return query.getInt(0);
            }
            query.close();
        } else if (uri.getScheme().equals("file")) {
            try {
                return B0(new androidx.exifinterface.media.a(uri.getPath()).e("Orientation", 1));
            } catch (IOException unused) {
            }
        }
        return 0;
    }

    void E1() {
        try {
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName()));
            intent.setPackage("com.android.vending");
            startActivity(intent);
        } catch (Throwable th) {
            App.h(th);
        }
    }

    boolean F0() {
        try {
            try {
                List<String> supportedFlashModes = this.R.getParameters().getSupportedFlashModes();
                if (supportedFlashModes == null || supportedFlashModes.indexOf("torch") == -1) {
                    return false;
                }
                return supportedFlashModes.indexOf("off") != -1;
            } catch (Throwable unused) {
                Camera.CameraInfo cameraInfo = s0.T;
                if (cameraInfo != null) {
                    if (cameraInfo.facing != 0) {
                        return false;
                    }
                }
                return true;
            }
        } catch (Throwable unused2) {
            return true;
        }
    }

    void F1() {
        if (App.K.b("headerState", 0) == 0) {
            this.S0.setVisibility(0);
            this.P0.setImageResource(R.drawable.ic_arrow_left_white);
            this.Q0.setVisibility(8);
            return;
        }
        this.S0.setVisibility(8);
        this.P0.setImageResource(R.drawable.ic_arrow_right_white);
        this.W.d();
        if (this.W.a()) {
            this.Q0.setVisibility(0);
        } else {
            this.Q0.setVisibility(8);
        }
    }

    void G0() {
        try {
            this.Y = new CameraSpec();
            Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
            for (int i10 = 0; i10 < this.S; i10++) {
                Camera.getCameraInfo(i10, cameraInfo);
                this.Y.cameraList.add(new CameraSpec.Camera(i10, cameraInfo.facing));
            }
        } catch (Throwable th) {
            com.google.firebase.crashlytics.a.a().c(th);
        }
    }

    public void G1() {
        int i10;
        int i11;
        int i12;
        try {
            Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
            ContentResolver contentResolver = getContentResolver();
            Cursor query = contentResolver.query(uri, null, null, null, "date_added ASC");
            if (query == null || query.getCount() <= 0) {
                return;
            }
            query.moveToLast();
            long j10 = query.getLong(query.getColumnIndexOrThrow("_id"));
            query.close();
            Bitmap thumbnail = MediaStore.Images.Thumbnails.getThumbnail(contentResolver, j10, 3, null);
            int width = thumbnail.getWidth();
            int height = thumbnail.getHeight();
            if (width < height) {
                i11 = width;
                i12 = (height - width) / 2;
                i10 = 0;
            } else {
                i10 = (width - height) / 2;
                i11 = height;
                i12 = 0;
            }
            float width2 = (this.f23538h1.getWidth() * 0.86f) / i11;
            Matrix matrix = new Matrix();
            matrix.postScale(width2, width2);
            Bitmap createBitmap = Bitmap.createBitmap(thumbnail, i10, i12, i11, i11, matrix, true);
            try {
                int E0 = E0(this, Uri.withAppendedPath(uri, String.valueOf(j10)));
                if (E0 != 0) {
                    createBitmap = R0(createBitmap, E0);
                }
            } catch (Throwable unused) {
            }
            this.f23538h1.setImageBitmap(createBitmap);
        } catch (Throwable unused2) {
        }
    }

    void H0() {
        View inflate = ((LayoutInflater) getSystemService("layout_inflater")).inflate(R.layout.dialog_finish, (ViewGroup) findViewById(R.id.linearLayoutFinish));
        AlertDialog create = new AlertDialog.Builder(this).setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                CameraActivity.this.K0(dialogInterface);
            }
        }).setView(inflate).create();
        this.V0 = create;
        create.getWindow().setBackgroundDrawable(new ColorDrawable(0));
        d1(inflate.findViewById(R.id.frameLayout));
        com.peace.SilentCamera.c cVar = new com.peace.SilentCamera.c(this, inflate, R.id.frameLayout);
        this.U0 = cVar;
        cVar.l(getResources().getColor(R.color.white), getResources().getColor(R.color.black));
        this.U0.n();
        inflate.findViewById(R.id.buttonPositive).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                CameraActivity.this.L0(view);
            }
        });
        inflate.findViewById(R.id.buttonNeutral).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                CameraActivity.this.M0(view);
            }
        });
    }

    public void H1() {
        X0();
        e1();
        f1();
        k1();
        p1();
        a1();
        g1();
        m1();
        o1();
        l1();
        n1();
        h1();
        F1();
    }

    protected void I0() {
        this.f23523a0 = (SensorManager) getSystemService("sensor");
    }

    void J0() {
        if (this.T.f23508c != 1 || F0()) {
            return;
        }
        try {
            if (s0.T.facing == 0) {
                this.T.f23508c = 0;
                this.F0 = false;
            } else {
                this.F0 = true;
            }
        } catch (Throwable unused) {
        }
    }

    void N0() {
        CameraSpec cameraSpec = (CameraSpec) new Gson().h(App.K.d("cameraSpecJson", I1), CameraSpec.class);
        this.Y = cameraSpec;
        if (cameraSpec == null || this.S != cameraSpec.cameraList.size()) {
            G0();
        }
        Y0();
    }

    void O0(MotionEvent motionEvent) {
        try {
            if (this.Q.f23921h > 0) {
                return;
            }
            if (motionEvent.getAction() == 1 || motionEvent.getAction() == 0) {
                Camera.Parameters parameters = this.R.getParameters();
                if (parameters.getMaxNumFocusAreas() <= 0) {
                    if (this.T.f23516k) {
                        this.Q.r();
                        return;
                    }
                    return;
                }
                int x9 = (int) motionEvent.getX();
                int y9 = (int) motionEvent.getY();
                int width = this.Q.f23915b.getWidth();
                int height = this.Q.f23915b.getHeight();
                int i10 = ((y9 - (height / 2)) * 1000) / (height / 2);
                int i11 = (((width / 2) - x9) * 1000) / (width / 2);
                if (i10 < -950) {
                    i10 = -950;
                } else if (i10 > 950) {
                    i10 = 950;
                }
                if (i11 < -950) {
                    i11 = -950;
                } else if (i11 > 950) {
                    i11 = 950;
                }
                Rect rect = new Rect(i10 - 50, i11 - 50, i10 + 50, i11 + 50);
                ArrayList arrayList = new ArrayList();
                arrayList.add(new Camera.Area(rect, 1));
                parameters.setFocusAreas(arrayList);
                this.R.setParameters(parameters);
                if (!this.Q.f23922i.booleanValue()) {
                    this.Q.f23922i = Boolean.TRUE;
                    App app = this.T;
                    if (app.f23516k && app.f23508c == 1 && !this.F0) {
                        try {
                            parameters.setFlashMode("torch");
                            this.R.setParameters(parameters);
                        } catch (Throwable unused) {
                        }
                    }
                    this.R.cancelAutoFocus();
                    this.Q.h();
                    this.R.autoFocus(this.Q.Q);
                }
                if (this.f23566v1) {
                    A0(x9, y9);
                }
            }
        } catch (Throwable unused2) {
        }
    }

    public void P0() {
        try {
            this.f23559s0.setProgress(0);
            this.f23561t0.setProgress(50);
        } catch (Throwable unused) {
        }
    }

    public void Q0() {
        s0 s0Var = this.Q;
        s0Var.f23921h = 0;
        this.O0 = 0;
        s0Var.E = 0;
        CountDownTimer countDownTimer = s0Var.f23926m;
        if (countDownTimer != null) {
            countDownTimer.cancel();
            this.Q.f23926m = null;
        }
        this.X.setVisibility(4);
        s0 s0Var2 = this.Q;
        s0Var2.M = 0L;
        s0Var2.N = 0L;
        s0Var2.O = 0L;
        s0Var2.f23923j = false;
        this.f23548m1 = false;
    }

    Bitmap R0(Bitmap bitmap, int i10) {
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Matrix matrix = new Matrix();
        matrix.postRotate(i10);
        return Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
    }

    void S0() {
        try {
            if (this.f23526b1.getWidth() == 0) {
                return;
            }
            int i10 = this.f23537h0;
            if (60 > i10 || i10 >= 120) {
                int i11 = this.f23539i0;
                if (-30 > i11 || i11 > 30) {
                    if (150 > i11 && i11 > -150) {
                        if (-120 <= i11 && i11 <= -60) {
                            this.G1 = -90;
                            this.F1 = 90;
                        } else {
                            if (60 > i11 || i11 > 120) {
                                return;
                            }
                            this.G1 = 90;
                            this.F1 = 270;
                        }
                    }
                    this.G1 = 180;
                    this.F1 = 180;
                } else {
                    this.G1 = 0;
                    this.F1 = 0;
                }
                int i12 = this.E1;
                int i13 = this.F1;
                if (i12 == i13) {
                    return;
                }
                if (i12 == 270 && i13 == 0) {
                    this.E1 = -90;
                } else if (i12 == 0 && i13 == 270) {
                    this.E1 = 360;
                }
                RotateAnimation rotateAnimation = new RotateAnimation(this.E1, this.F1, this.f23528c1.getWidth() * 0.5f, this.f23528c1.getHeight() * 0.5f);
                rotateAnimation.setDuration(1000L);
                rotateAnimation.setFillAfter(true);
                ImageButton[] imageButtonArr = {this.f23528c1, this.W0, this.R0, this.f23530d1, this.f23532e1, this.f23534f1, this.f23536g1, this.X0};
                for (int i14 = 0; i14 < 8; i14++) {
                    imageButtonArr[i14].startAnimation(rotateAnimation);
                }
                this.Z0.startAnimation(rotateAnimation);
                RotateAnimation rotateAnimation2 = new RotateAnimation(this.E1, this.F1, this.f23526b1.getWidth() * 0.5f, this.f23526b1.getHeight() * 0.5f);
                rotateAnimation2.setDuration(1000L);
                rotateAnimation2.setFillAfter(true);
                this.f23526b1.startAnimation(rotateAnimation2);
                RotateAnimation rotateAnimation3 = new RotateAnimation(this.E1, this.F1, this.f23538h1.getWidth() * 0.5f, this.f23538h1.getHeight() * 0.5f);
                rotateAnimation3.setDuration(1000L);
                rotateAnimation3.setFillAfter(true);
                this.f23538h1.startAnimation(rotateAnimation3);
                ImageView[] imageViewArr = {(ImageView) findViewById(R.id.imageViewTouchShutter), (ImageView) findViewById(R.id.imageViewVibration), (ImageView) findViewById(R.id.imageViewGeoTag), (ImageView) findViewById(R.id.imageViewMirror)};
                RotateAnimation rotateAnimation4 = new RotateAnimation(this.E1, this.F1, r0.getWidth() * 0.5f, r0.getHeight() * 0.5f);
                rotateAnimation4.setDuration(1000L);
                rotateAnimation4.setFillAfter(true);
                int i15 = 0;
                for (int i16 = 0; i16 < 4; i16++) {
                    ImageView imageView = imageViewArr[i16];
                    if ((i15 == 0 && this.T.f23516k) || ((i15 == 1 && this.T.f23517l) || ((i15 == 2 && this.T.f23518m) || (i15 == 3 && this.T.f23519n && s0.T.facing == 1)))) {
                        imageView.startAnimation(rotateAnimation4);
                    } else {
                        imageView.clearAnimation();
                        imageView.setVisibility(4);
                    }
                    i15++;
                }
                RotateAnimation rotateAnimation5 = new RotateAnimation(this.E1, this.F1, this.f23551o0.getWidth() * 0.5f, this.f23551o0.getHeight() * 0.5f);
                rotateAnimation5.setDuration(1000L);
                rotateAnimation5.setFillAfter(true);
                this.f23551o0.startAnimation(rotateAnimation5);
                this.f23553p0.startAnimation(rotateAnimation5);
                this.f23555q0.startAnimation(rotateAnimation5);
                this.f23557r0.startAnimation(rotateAnimation5);
                this.f23538h1.setRotation(0.0f);
                this.E1 = this.F1;
            }
        } catch (Throwable unused) {
        }
    }

    void T0() {
        this.C1 = this.D1;
        this.D1 = this.f23539i0;
        int i10 = this.f23567w0;
        int i11 = i10 / 2;
        int i12 = ((i10 * 16) / 9) / 2;
        int width = i11 - (this.f23572y1.getWidth() / 2);
        int height = i12 - (this.f23572y1.getHeight() / 2);
        int width2 = this.f23572y1.getWidth() + width;
        int height2 = this.f23572y1.getHeight() + height;
        this.f23572y1.layout(width, height, width2, height2);
        this.f23570x1.layout(width, height, width2, height2);
        if (Math.abs(this.f23539i0 % 90) <= 1) {
            this.f23572y1.setImageResource(R.drawable.level_yellow);
        } else {
            this.f23572y1.setImageResource(R.drawable.level_white);
        }
        RotateAnimation rotateAnimation = new RotateAnimation(this.C1, this.D1, this.f23572y1.getWidth() * 0.5f, this.f23572y1.getHeight() * 0.5f);
        rotateAnimation.setDuration(2000L);
        rotateAnimation.setFillAfter(true);
        this.f23572y1.startAnimation(rotateAnimation);
        int i13 = this.f23537h0;
        if (-1 > i13 || i13 > 1) {
            this.f23574z1.setColorFilter(-1);
        } else {
            this.f23574z1.setColorFilter(-13312);
        }
        int cos = (int) (this.A1 * Math.cos((this.f23537h0 * 3.141592653589793d) / 180.0d));
        if (cos < 5) {
            cos = 0;
        }
        int i14 = cos / 2;
        int i15 = this.f23537h0;
        this.f23574z1.layout(i11 - i14, (i12 - i15) - 1, i11 + i14, (i12 - i15) + 1);
    }

    void U0() {
        App.K.i("cameraSpecJson", new Gson().r(this.Y));
    }

    void V0() {
        try {
            if (App.e()) {
                this.N0 = null;
                this.f23566v1 = true;
                return;
            }
            k3.b bVar = new k3.b(this);
            this.N0 = bVar;
            bVar.setAdUnitId(getString(R.string.ad_id_banner));
            s0 s0Var = this.Q;
            int i10 = s0Var.F;
            if (i10 > 400) {
                s0Var.F = i10 - getResources().getDimensionPixelSize(R.dimen.margin_small);
            }
            float f10 = getResources().getDisplayMetrics().density;
            this.N0.setAdSizes(new j3.h((int) (this.M0.getWidth() / f10), (int) (this.Q.F / f10)));
            this.M0.addView(this.N0);
            this.M0.setGravity(80);
            this.N0.setAdListener(new o());
            this.N0.e(com.peace.SilentCamera.c.f23831l);
        } catch (Throwable th) {
            App.h(th);
        }
    }

    void W0() {
        App.K.g("cameraID", this.T.f23506a);
        App.K.g("flash", this.T.f23508c);
        App.K.f("autoFocus", this.T.f23509d);
        App.K.f("macroFocus", this.T.f23510e);
        App.K.g("burstTime", this.T.f23511f);
        App.K.g("sceneMode", this.T.f23512g);
        App.K.g("whiteBalance", this.T.f23513h);
        App.K.g("colorEffect", this.T.f23514i);
        App.K.g("guideMode", this.T.f23515j);
        App.K.f("touchShutter", this.T.f23516k);
        App.K.f("vibration", this.T.f23517l);
        App.K.f("geoTag", this.T.f23518m);
        App.K.f("mirror", this.T.f23519n);
        App.K.g("volumeKey", this.T.f23520o);
        App.K.g("aspect", this.T.E);
        App.K.g("notification", this.T.G);
    }

    void X0() {
        int i10;
        ImageView imageView = (ImageView) findViewById(R.id.aspect_mask_top);
        ImageView imageView2 = (ImageView) findViewById(R.id.aspect_mask_bottom);
        int i11 = this.f23567w0;
        int i12 = this.f23569x0;
        int i13 = this.f23563u0;
        if (i13 <= 0 || (i10 = this.f23565v0) <= 0) {
            i10 = i12;
        } else {
            i11 = i13;
        }
        int i14 = i10 - i12;
        int i15 = (int) ((i11 * 16.0f) / 9.0f);
        this.C0 = i15;
        int i16 = i10 - i15;
        this.A0 = i11;
        this.f23571y0 = 0;
        int i17 = this.T.E;
        if (i17 == 0) {
            imageView.setVisibility(4);
            imageView2.setVisibility(4);
            this.B0 = this.C0;
            if (i16 >= 0) {
                this.f23573z0 = 0;
                return;
            } else {
                this.f23573z0 = i16 / 2;
                return;
            }
        }
        if (i17 == 1) {
            this.B0 = (int) ((i11 * 3.0f) / 2.0f);
        } else if (i17 == 2) {
            this.B0 = (int) ((i11 * 4.0f) / 3.0f);
        } else if (i17 == 3) {
            this.B0 = i11;
        }
        int i18 = (i15 - this.B0) / 2;
        int i19 = (i16 + i18) - i14;
        if (i16 < 0) {
            i18 += i16 / 2;
            i19 = i18 - i14;
        }
        this.f23573z0 = i18;
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i11, i18);
        layoutParams.addRule(10);
        imageView.setLayoutParams(layoutParams);
        RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(i11, i19);
        layoutParams2.addRule(12);
        imageView2.setLayoutParams(layoutParams2);
        imageView.setVisibility(0);
        imageView2.setVisibility(0);
    }

    void Y0() {
        try {
            int i10 = this.S;
            if (i10 == 0) {
                return;
            }
            this.Z = new String[i10];
            String string = getString(R.string.back_camera);
            String string2 = getString(R.string.front_camera);
            Iterator<CameraSpec.Camera> it = this.Y.cameraList.iterator();
            int i11 = 0;
            int i12 = 0;
            float f10 = 0.0f;
            float f11 = 0.0f;
            while (it.hasNext()) {
                CameraSpec.Camera next = it.next();
                if (next.facing == 0) {
                    if (i12 == 0) {
                        this.Z[next.id] = string;
                        f11 = next.horizontalViewAngle;
                    } else {
                        if (f11 != 0.0f) {
                            float f12 = next.horizontalViewAngle;
                            if (f12 != 0.0f) {
                                if (f12 > f11) {
                                    this.Z[next.id] = string + " (" + getString(R.string.wide) + ")";
                                } else {
                                    this.Z[next.id] = string + " (" + getString(R.string.tele) + ")";
                                }
                            }
                        }
                        this.Z[next.id] = string + " " + (i11 + 1);
                    }
                    i12++;
                } else {
                    if (i11 == 0) {
                        this.Z[next.id] = string2;
                        f10 = next.horizontalViewAngle;
                    } else {
                        if (f10 != 0.0f) {
                            float f13 = next.horizontalViewAngle;
                            if (f13 != 0.0f) {
                                if (f13 > f10) {
                                    this.Z[next.id] = string2 + " (" + getString(R.string.wide) + ")";
                                } else {
                                    this.Z[next.id] = string2 + " (" + getString(R.string.tele) + ")";
                                }
                            }
                        }
                        this.Z[next.id] = string2 + " " + (i11 + 1);
                    }
                    i11++;
                }
            }
        } catch (Throwable th) {
            com.google.firebase.crashlytics.a.a().c(th);
        }
    }

    boolean Z0(int i10, Camera camera) {
        try {
            CameraSpec.Camera camera2 = this.Y.cameraList.get(i10);
            Camera.Parameters parameters = camera.getParameters();
            if (parameters == null || camera2.horizontalViewAngle == parameters.getHorizontalViewAngle()) {
                return false;
            }
            if (camera2.horizontalViewAngle != 0.0f) {
                G0();
                camera2 = this.Y.cameraList.get(i10);
            }
            camera2.focalLength = parameters.getFocalLength();
            camera2.horizontalViewAngle = parameters.getHorizontalViewAngle();
            camera2.verticalViewAngle = parameters.getVerticalViewAngle();
            Y0();
            return true;
        } catch (Throwable th) {
            com.google.firebase.crashlytics.a.a().c(th);
            return false;
        }
    }

    void a1() {
        try {
            Camera.Parameters parameters = this.R.getParameters();
            if (parameters.getSupportedColorEffects() == null) {
                this.f23534f1.setImageResource(R.drawable.color_effect_none);
                return;
            }
            switch (this.T.f23514i) {
                case 0:
                    if (parameters.getSupportedColorEffects().indexOf("none") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("none");
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        this.T.f23514i = 0;
                        break;
                    }
                case 1:
                    if (parameters.getSupportedColorEffects().indexOf("sepia") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("sepia");
                        this.f23534f1.setImageResource(R.drawable.color_effect_sepia);
                        this.T.f23514i = 1;
                        break;
                    }
                case 2:
                    if (parameters.getSupportedColorEffects().indexOf("mono") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("mono");
                        this.f23534f1.setImageResource(R.drawable.color_effect_mono);
                        this.T.f23514i = 2;
                        break;
                    }
                case 3:
                    if (parameters.getSupportedColorEffects().indexOf("negative") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("negative");
                        this.f23534f1.setImageResource(R.drawable.color_effect_invert);
                        this.T.f23514i = 3;
                        break;
                    }
                case 4:
                    if (parameters.getSupportedColorEffects().indexOf("aqua") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("aqua");
                        this.f23534f1.setImageResource(R.drawable.color_effect_aqua);
                        this.T.f23514i = 4;
                        break;
                    }
                case 5:
                    if (parameters.getSupportedColorEffects().indexOf("posterize") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("posterize");
                        this.f23534f1.setImageResource(R.drawable.color_effect_posterize);
                        this.T.f23514i = 5;
                        break;
                    }
                case 6:
                    if (parameters.getSupportedColorEffects().indexOf("solarize") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("solarize");
                        this.f23534f1.setImageResource(R.drawable.color_effect_solorize);
                        this.T.f23514i = 6;
                        break;
                    }
                case 7:
                    if (parameters.getSupportedColorEffects().indexOf("blackboard") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("blackboard");
                        this.f23534f1.setImageResource(R.drawable.color_effect_black_board);
                        this.T.f23514i = 7;
                        break;
                    }
                case 8:
                    if (parameters.getSupportedColorEffects().indexOf("whiteboard") == -1) {
                        this.f23534f1.setImageResource(R.drawable.color_effect_none);
                        break;
                    } else {
                        parameters.setColorEffect("whiteboard");
                        this.f23534f1.setImageResource(R.drawable.color_effect_white_board);
                        this.T.f23514i = 8;
                        break;
                    }
            }
            this.R.setParameters(parameters);
        } catch (Exception unused) {
        }
    }

    void b1() {
        try {
            this.f23554p1 = Build.MANUFACTURER;
            this.f23556q1 = Build.DEVICE;
            this.f23558r1 = Build.VERSION.RELEASE;
            this.f23560s1 = Build.VERSION.SDK_INT;
            this.f23562t1 = 318;
            this.f23564u1 = Locale.getDefault();
        } catch (Throwable th) {
            App.h(th);
        }
    }

    void c1() {
        Display defaultDisplay = getWindowManager().getDefaultDisplay();
        Point point = new Point();
        defaultDisplay.getRealSize(point);
        this.f23563u0 = point.x;
        this.f23565v0 = point.y;
        defaultDisplay.getSize(point);
        this.f23567w0 = point.x;
        this.f23569x0 = point.y;
        this.D0 = defaultDisplay.getRotation();
        int dimensionPixelSize = App.e() ? this.f23569x0 : this.f23569x0 - getResources().getDimensionPixelSize(R.dimen.ad_banner_height);
        int i10 = (this.f23567w0 * 16) / 9;
        if (dimensionPixelSize > i10) {
            dimensionPixelSize = i10;
        }
        this.T.I = dimensionPixelSize - ((int) (getResources().getDisplayMetrics().density * 200.0f));
    }

    void d1(View view) {
        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
        view.getLayoutParams().width = (int) (displayMetrics.widthPixels * 1.0d);
        view.getLayoutParams().height = (int) (view.getLayoutParams().width * 0.8d);
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        if (keyEvent.getAction() == 0) {
            int keyCode = keyEvent.getKeyCode();
            if (keyCode != 4) {
                if (keyCode == 27 || keyCode == 97) {
                    try {
                        this.Q.r();
                    } catch (Throwable unused) {
                        Q0();
                    }
                    return true;
                }
                if (keyCode == 24) {
                    int i10 = this.T.f23520o;
                    if (i10 == 0) {
                        try {
                            this.Q.r();
                        } catch (Throwable unused2) {
                            Q0();
                        }
                    } else if (i10 == 1) {
                        w0(1);
                    } else if (i10 == 2) {
                        v0(1);
                    } else if (i10 == 4) {
                        this.O0 = 1;
                        try {
                            this.Q.r();
                        } catch (Throwable unused3) {
                            Q0();
                        }
                    }
                    return true;
                }
                if (keyCode == 25) {
                    int i11 = this.T.f23520o;
                    if (i11 == 0) {
                        try {
                            this.Q.r();
                        } catch (Throwable unused4) {
                            Q0();
                        }
                    } else if (i11 == 1) {
                        w0(0);
                    } else if (i11 == 2) {
                        v0(0);
                    } else if (i11 == 4) {
                        this.O0 = 1;
                        try {
                            this.Q.r();
                        } catch (Throwable unused5) {
                            Q0();
                        }
                    }
                    return true;
                }
                if (keyCode == 99) {
                    B1();
                    return true;
                }
                if (keyCode == 100) {
                    this.O0 = 1;
                    try {
                        this.Q.r();
                    } catch (Throwable unused6) {
                        Q0();
                    }
                    return true;
                }
                switch (keyCode) {
                    case FacebookMediationAdapter.ERROR_BANNER_SIZE_MISMATCH:
                        w0(0);
                        return true;
                    case FacebookMediationAdapter.ERROR_REQUIRES_ACTIVITY_CONTEXT:
                        w0(1);
                        return true;
                    case FacebookMediationAdapter.ERROR_FACEBOOK_INITIALIZATION:
                        v0(0);
                        return true;
                    case FacebookMediationAdapter.ERROR_REQUIRES_UNIFIED_NATIVE_ADS:
                        v0(1);
                        return true;
                }
            }
            this.G0 = false;
        }
        try {
            return super.dispatchKeyEvent(keyEvent);
        } catch (Throwable unused7) {
            return false;
        }
    }

    void e1() {
        int i10 = this.T.f23508c;
        if (i10 == 0) {
            this.W0.setImageResource(R.drawable.flash_off);
            return;
        }
        if (i10 == 1) {
            this.W0.setImageResource(R.drawable.flash_on);
        } else if (i10 == 2) {
            this.W0.setImageResource(R.drawable.flash_auto);
        } else if (i10 == 3) {
            this.W0.setImageResource(R.drawable.flash_torch);
        }
    }

    void f1() {
        try {
            Camera.Parameters parameters = this.R.getParameters();
            if (this.T.f23510e) {
                if (parameters.getSupportedFocusModes().indexOf("macro") != -1) {
                    parameters.setFocusMode("macro");
                    this.R.setParameters(parameters);
                }
                this.f23528c1.setImageResource(R.drawable.focus_macro);
                return;
            }
            if (parameters.getSupportedFocusModes().indexOf("auto") != -1) {
                parameters.setFocusMode("auto");
                this.R.setParameters(parameters);
            }
            if (this.T.f23509d) {
                this.f23528c1.setImageResource(R.drawable.focus_auto);
            } else {
                this.f23528c1.setImageResource(R.drawable.focus_manual);
            }
        } catch (Exception unused) {
        }
    }

    void g1() {
        int i10 = this.T.f23515j;
        if (i10 == 0) {
            this.f23536g1.setImageResource(R.drawable.guide_mode_none);
        } else if (i10 == 1) {
            this.f23536g1.setImageResource(R.drawable.guide_mode_trifurcation);
        } else if (i10 == 2) {
            this.f23536g1.setImageResource(R.drawable.guide_mode_symmetry);
        } else if (i10 == 3) {
            this.f23536g1.setImageResource(R.drawable.guide_mode_railman);
        } else if (i10 == 4) {
            this.f23536g1.setImageResource(R.drawable.guide_mode_fibonacci);
        }
        ImageView imageView = (ImageView) findViewById(R.id.imageViewGuide);
        this.f23543k0 = imageView;
        imageView.setLayoutParams(new RelativeLayout.LayoutParams(this.A0, this.B0));
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.f23543k0.getLayoutParams();
        marginLayoutParams.setMargins(0, this.f23573z0, 0, 0);
        this.f23543k0.setLayoutParams(marginLayoutParams);
        int i11 = this.T.f23515j;
        if (i11 == 0) {
            this.f23543k0.setVisibility(4);
            return;
        }
        if (i11 == 1) {
            this.f23543k0.setVisibility(0);
            this.f23543k0.setImageResource(R.drawable.guide_trifurcation);
            return;
        }
        if (i11 == 2) {
            this.f23543k0.setVisibility(0);
            this.f23543k0.setImageResource(R.drawable.guide_symmetry);
        } else if (i11 == 3) {
            this.f23543k0.setVisibility(0);
            this.f23543k0.setImageResource(R.drawable.guide_railman);
        } else if (i11 == 4) {
            this.f23543k0.setVisibility(0);
            this.f23543k0.setImageResource(R.drawable.guide_fibonacci);
        }
    }

    void h1() {
        if (this.f23568w1) {
            this.f23572y1.setVisibility(0);
            this.f23574z1.setVisibility(0);
            this.f23570x1.setVisibility(0);
        } else {
            this.f23572y1.clearAnimation();
            this.f23572y1.setVisibility(4);
            this.f23574z1.setVisibility(4);
            this.f23570x1.setVisibility(4);
        }
    }

    void i1() {
        try {
            int b10 = App.K.b("activeCount", 0);
            if (b10 == 0) {
                App.K.h("firstActiveDate", System.currentTimeMillis());
                App.K.h("lastActiveDate", System.currentTimeMillis());
                App.K.g("activeCount", b10 + 1);
            } else {
                App.K.h("lastActiveDate", System.currentTimeMillis());
                if (Integer.MAX_VALUE > b10) {
                    App.K.g("activeCount", b10 + 1);
                }
            }
        } catch (Throwable th) {
            App.h(th);
        }
    }

    void j1() {
        App app = this.T;
        int i10 = app.f23508c;
        if (i10 == 0) {
            if (app.f23509d || app.f23510e) {
                this.Q.f23924k = 2;
                return;
            } else {
                this.Q.f23924k = 0;
                return;
            }
        }
        if (i10 == 1) {
            if (this.F0) {
                this.Q.f23924k = 7;
            } else {
                this.Q.f23924k = 2;
            }
        }
    }

    void k1() {
        try {
            switch (this.T.f23512g) {
                case 0:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_auto);
                    break;
                case 1:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_portrait);
                    break;
                case 2:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_landscape);
                    break;
                case 3:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_night);
                    break;
                case 4:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_night_portrait);
                    break;
                case 5:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_sports);
                    break;
                case 6:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_sunset);
                    break;
                case 7:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_beach);
                    break;
                case 8:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_party);
                    break;
                case 9:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_fireworks);
                    break;
                case 10:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_selfie);
                    break;
                case 11:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_hdr);
                    break;
                case 12:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_snow);
                    break;
                case 13:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_candlelight);
                    break;
                case 14:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_theatre);
                    break;
                case 15:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_action);
                    break;
                case 16:
                    this.f23530d1.setImageResource(R.drawable.scene_mode_barcode);
                    break;
            }
        } catch (Throwable unused) {
        }
    }

    void l1() {
        this.W.d();
        if (this.W.a()) {
            this.f23524a1.setVisibility(0);
        } else {
            this.f23524a1.setVisibility(8);
        }
    }

    void m1() {
        ImageView imageView = (ImageView) findViewById(R.id.imageViewTouchShutter);
        if (this.T.f23516k) {
            imageView.setVisibility(0);
        } else {
            imageView.clearAnimation();
            imageView.setVisibility(4);
        }
        ImageView imageView2 = (ImageView) findViewById(R.id.imageViewVibration);
        if (this.T.f23517l) {
            imageView2.setVisibility(0);
        } else {
            imageView2.clearAnimation();
            imageView2.setVisibility(4);
        }
        ImageView imageView3 = (ImageView) findViewById(R.id.imageViewGeoTag);
        if (this.T.f23518m) {
            imageView3.setVisibility(0);
        } else {
            imageView3.clearAnimation();
            imageView3.setVisibility(4);
        }
        try {
            ImageView imageView4 = (ImageView) findViewById(R.id.imageViewMirror);
            if (s0.T.facing == 1 && this.T.f23519n) {
                imageView4.setVisibility(0);
            } else {
                imageView4.clearAnimation();
                imageView4.setVisibility(4);
            }
        } catch (Throwable unused) {
        }
    }

    void n1() {
        int b10 = App.K.b("timerSeconds", 0);
        if (b10 == 0) {
            this.R0.setImageResource(R.drawable.timer_off);
            return;
        }
        if (b10 == 3) {
            this.R0.setImageResource(R.drawable.timer_3s);
        } else if (b10 == 5) {
            this.R0.setImageResource(R.drawable.timer_5s);
        } else if (b10 == 10) {
            this.R0.setImageResource(R.drawable.timer_10s);
        }
    }

    void o1() {
        this.f23538h1.setEnabled(true);
    }

    @Override
    public void onAccuracyChanged(Sensor sensor, int i10) {
    }

    @Override
    public void onBackPressed() {
        if (s1()) {
            return;
        }
        super.onBackPressed();
    }

    @Override
    @SuppressLint({"ClickableViewAccessibility"})
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.T = (App) getApplication();
        this.U = new n0(this);
        this.W = new o0(this);
        u0();
        t0();
        s0 s0Var = new s0(this);
        this.Q = s0Var;
        s0Var.setBackgroundColor(-16777216);
        setContentView(this.Q);
        addContentView((RelativeLayout) getLayoutInflater().inflate(R.layout.activity_camera, (ViewGroup) null), new ViewGroup.LayoutParams(-1, -1));
        this.Q.m(this);
        GestureDetector gestureDetector = new GestureDetector(this, new v());
        this.Q.f23915b.setOnTouchListener(new f0(new ScaleGestureDetector(this, new e0()), gestureDetector));
        this.T.f23506a = App.K.b("cameraID", -1);
        int numberOfCameras = Camera.getNumberOfCameras();
        this.S = numberOfCameras;
        App app = this.T;
        if (app.f23506a >= numberOfCameras) {
            app.f23506a = 0;
        }
        try {
            if (app.f23506a == -1) {
                Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
                int i10 = 0;
                while (true) {
                    if (i10 >= this.S) {
                        break;
                    }
                    Camera.getCameraInfo(i10, cameraInfo);
                    if (cameraInfo.facing == 0) {
                        break;
                    } else {
                        i10++;
                    }
                }
            }
        } catch (Throwable th) {
            this.T.f23506a = 0;
            App.h(th);
        }
        App.K.g("cameraID", this.T.f23506a);
        N0();
        this.T.F = App.K.d("path", null);
        if (this.f23552o1) {
            String str = this.T.F;
            if (str == null) {
                this.Q.i();
            } else if (Build.VERSION.SDK_INT >= 30) {
                if (!str.equals(App.N) && !this.T.F.equals(App.O)) {
                    this.Q.i();
                }
            } else if (!str.contains(App.M) && !this.T.F.equals(App.O)) {
                this.Q.i();
            }
        }
        this.f23540i1 = (ImageView) findViewById(R.id.imageViewFocusArea);
        ImageButton imageButton = (ImageButton) findViewById(R.id.imageButtonShutter);
        this.f23526b1 = imageButton;
        imageButton.setOnLongClickListener(new g0());
        this.f23526b1.setOnTouchListener(new h0());
        ImageButton imageButton2 = (ImageButton) findViewById(R.id.imageButtonFlash);
        this.W0 = imageButton2;
        imageButton2.setOnClickListener(new i0());
        ImageButton imageButton3 = (ImageButton) findViewById(R.id.imageButtonSwitch);
        this.X0 = imageButton3;
        imageButton3.setOnClickListener(new j0());
        ImageButton imageButton4 = (ImageButton) findViewById(R.id.imageButtonEffect);
        this.f23534f1 = imageButton4;
        imageButton4.setOnClickListener(new k0());
        ImageButton imageButton5 = (ImageButton) findViewById(R.id.imageButtonScene);
        this.f23530d1 = imageButton5;
        imageButton5.setOnClickListener(new a());
        ImageButton imageButton6 = (ImageButton) findViewById(R.id.imageButtonWhiteBalance);
        this.f23532e1 = imageButton6;
        imageButton6.setOnClickListener(new b());
        ImageButton imageButton7 = (ImageButton) findViewById(R.id.imageButtonFocus);
        this.f23528c1 = imageButton7;
        imageButton7.setOnClickListener(new c());
        ImageButton imageButton8 = (ImageButton) findViewById(R.id.imageButtonGuide);
        this.f23536g1 = imageButton8;
        imageButton8.setOnClickListener(new d());
        this.Z0 = (FrameLayout) findViewById(R.id.frameLayoutSettings);
        this.f23524a1 = (TextView) findViewById(R.id.textViewNewLabelSettings);
        ImageButton imageButton9 = (ImageButton) findViewById(R.id.imageButtonSettings);
        this.Y0 = imageButton9;
        imageButton9.setOnClickListener(new e());
        ImageButton imageButton10 = (ImageButton) findViewById(R.id.imageButtonViewer);
        this.f23538h1 = imageButton10;
        imageButton10.setOnClickListener(new f());
        this.f23555q0 = (ImageView) findViewById(R.id.imageViewZoomMinus);
        this.f23557r0 = (ImageView) findViewById(R.id.imageViewZoomPlus);
        SeekBar seekBar = (SeekBar) findViewById(R.id.seekBarZoom);
        this.f23559s0 = seekBar;
        seekBar.setOnSeekBarChangeListener(new g());
        this.f23551o0 = (ImageView) findViewById(R.id.imageViewExposureMinus);
        this.f23553p0 = (ImageView) findViewById(R.id.imageViewExposurePlus);
        SeekBar seekBar2 = (SeekBar) findViewById(R.id.seekBarExposure);
        this.f23561t0 = seekBar2;
        seekBar2.setOnSeekBarChangeListener(new h());
        this.X = (TextView) findViewById(R.id.textViewCounter);
        this.f23545l0 = (Vibrator) getSystemService("vibrator");
        this.f23572y1 = (ImageView) findViewById(R.id.imageViewLevelRoll);
        this.f23570x1 = (ImageView) findViewById(R.id.imageViewLevelBase);
        this.f23574z1 = (ImageView) findViewById(R.id.imageViewLevelPitch);
        this.A1 = (int) (getResources().getDisplayMetrics().density * 34.0f);
        I0();
        c1();
        b1();
        this.I0 = new i();
        this.S0 = (LinearLayout) findViewById(R.id.linearLayoutHeader);
        this.Q0 = (TextView) findViewById(R.id.textViewNewLabelDisplayHeader);
        ImageButton imageButton11 = (ImageButton) findViewById(R.id.imageButtonDisplayHeader);
        this.P0 = imageButton11;
        imageButton11.setOnClickListener(new j());
        ImageButton imageButton12 = (ImageButton) findViewById(R.id.imageButtonTimer);
        this.R0 = imageButton12;
        imageButton12.setOnClickListener(new l());
        this.M0 = (LinearLayout) findViewById(R.id.linearLayoutAdView);
        registerReceiver(this.I0, new IntentFilter("android.intent.action.SCREEN_ON"));
        registerReceiver(this.I0, new IntentFilter("android.intent.action.SCREEN_OFF"));
        this.f23544k1 = new l0(new Handler());
        if (App.e() || !H1) {
            return;
        }
        H0();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        try {
            AlertDialog alertDialog = this.Q.L;
            if (alertDialog != null && alertDialog.isShowing()) {
                this.Q.L.dismiss();
            }
            k3.b bVar = this.N0;
            if (bVar != null) {
                bVar.a();
            }
            BroadcastReceiver broadcastReceiver = this.I0;
            if (broadcastReceiver != null) {
                unregisterReceiver(broadcastReceiver);
            }
            com.peace.SilentCamera.d dVar = this.L0;
            if (dVar != null) {
                dVar.h();
            }
            com.peace.SilentCamera.c cVar = this.U0;
            if (cVar != null) {
                cVar.g();
            }
        } catch (Throwable unused) {
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        Q0();
        App app = this.T;
        if (app.f23508c == 3) {
            app.f23508c = 0;
            this.Q.g();
        }
        this.f23523a0.unregisterListener(this);
        k3.b bVar = this.N0;
        if (bVar != null) {
            bVar.c();
        }
        W0();
        getContentResolver().unregisterContentObserver(this.f23544k1);
    }

    @Override
    public void onRequestPermissionsResult(int i10, String[] strArr, int[] iArr) {
        int checkSelfPermission;
        super.onRequestPermissionsResult(i10, strArr, iArr);
        if (Build.VERSION.SDK_INT >= 23) {
            checkSelfPermission = checkSelfPermission("android.permission.ACCESS_FINE_LOCATION");
            if (checkSelfPermission == 0) {
                return;
            }
            this.T.f23518m = false;
            this.f23541j0 = null;
            App.K.f("geoTag", false);
            findViewById(R.id.imageViewGeoTag).setVisibility(4);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        if (this.R == null) {
            try {
                Camera open = Camera.open(this.T.f23506a);
                this.R = open;
                this.Q.n(open);
            } catch (Throwable th) {
                if (this.f23550n1) {
                    q1(0);
                }
                App.h(th);
            }
        }
        SensorManager sensorManager = this.f23523a0;
        sensorManager.registerListener(this, sensorManager.getDefaultSensor(1), 2);
        SensorManager sensorManager2 = this.f23523a0;
        sensorManager2.registerListener(this, sensorManager2.getDefaultSensor(2), 2);
        this.L0 = new com.peace.SilentCamera.d(this, new m0(this, null));
        getContentResolver().registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, true, this.f23544k1);
        y0();
        this.G0 = true;
        this.K0 = true;
    }

    @Override
    public void onSensorChanged(SensorEvent sensorEvent) {
        float[] fArr;
        int type = sensorEvent.sensor.getType();
        if (type == 1) {
            this.f23529d0 = (float[]) sensorEvent.values.clone();
        } else if (type == 2) {
            this.f23531e0 = (float[]) sensorEvent.values.clone();
        }
        float[] fArr2 = this.f23531e0;
        if (fArr2 == null || (fArr = this.f23529d0) == null) {
            return;
        }
        SensorManager.getRotationMatrix(this.f23525b0, null, fArr, fArr2);
        SensorManager.remapCoordinateSystem(this.f23525b0, 1, 3, this.f23527c0);
        SensorManager.getOrientation(this.f23527c0, this.f23533f0);
        this.f23535g0 = (int) Math.floor(Math.toDegrees(this.f23533f0[0]));
        this.f23537h0 = (int) Math.floor(Math.toDegrees(this.f23533f0[1]));
        int floor = (int) Math.floor(Math.toDegrees(this.f23533f0[2]));
        this.f23539i0 = floor;
        int i10 = this.D0;
        if (i10 == 3) {
            int i11 = floor - 90;
            this.f23539i0 = i11;
            if (i11 < -180) {
                this.f23539i0 = floor + 270;
            }
        } else if (i10 == 1) {
            int i12 = floor + 90;
            this.f23539i0 = i12;
            if (i12 > 180) {
                this.f23539i0 = floor - 270;
            }
        } else if (i10 == 2) {
            int i13 = floor + 180;
            this.f23539i0 = i13;
            if (i13 > 180) {
                this.f23539i0 = floor - 180;
            }
        }
        if (this.f23568w1) {
            T0();
        }
        S0();
    }

    @Override
    protected void onStart() {
        super.onStart();
        C0();
    }

    @Override
    protected void onUserLeaveHint() {
        super.onUserLeaveHint();
        this.G0 = false;
    }

    @Override
    public void onWindowFocusChanged(boolean z9) {
        super.onWindowFocusChanged(z9);
        if (this.J0) {
            this.T0 = f5.e.a(this);
            V0();
            J0();
            if (Z0(this.T.f23506a, this.R)) {
                U0();
            }
            this.J0 = false;
        }
        if (this.K0) {
            if (this.T.f23518m) {
                D0();
            } else {
                this.f23541j0 = null;
            }
            H1();
            i1();
            k3.b bVar = this.N0;
            if (bVar != null) {
                bVar.d();
            }
            G1();
            this.K0 = false;
        }
    }

    void p1() {
        try {
            Camera.Parameters parameters = this.R.getParameters();
            if (parameters.getSupportedWhiteBalance() == null) {
                this.f23532e1.setImageResource(R.drawable.wb_auto);
                return;
            }
            switch (this.T.f23513h) {
                case 0:
                    if (parameters.getSupportedWhiteBalance().indexOf("auto") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("auto");
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        this.T.f23513h = 0;
                        break;
                    }
                case 1:
                    if (parameters.getSupportedWhiteBalance().indexOf("daylight") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("daylight");
                        this.f23532e1.setImageResource(R.drawable.wb_daylight);
                        this.T.f23513h = 1;
                        break;
                    }
                case 2:
                    if (parameters.getSupportedWhiteBalance().indexOf("shade") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("shade");
                        this.f23532e1.setImageResource(R.drawable.wb_shade);
                        this.T.f23513h = 2;
                        break;
                    }
                case 3:
                    if (parameters.getSupportedWhiteBalance().indexOf("cloudy-daylight") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("cloudy-daylight");
                        this.f23532e1.setImageResource(R.drawable.wb_cloudy);
                        this.T.f23513h = 3;
                        break;
                    }
                case 4:
                    if (parameters.getSupportedWhiteBalance().indexOf("fluorescent") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("fluorescent");
                        this.f23532e1.setImageResource(R.drawable.wb_fluorescent);
                        this.T.f23513h = 4;
                        break;
                    }
                case 5:
                    if (parameters.getSupportedWhiteBalance().indexOf("incandescent") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("incandescent");
                        this.f23532e1.setImageResource(R.drawable.wb_incandescent);
                        this.T.f23513h = 5;
                        break;
                    }
                case 6:
                    if (parameters.getSupportedWhiteBalance().indexOf("twilight") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("twilight");
                        this.f23532e1.setImageResource(R.drawable.wb_twilight);
                        this.T.f23513h = 6;
                        break;
                    }
                case 7:
                    if (parameters.getSupportedWhiteBalance().indexOf("warm-fluorescent") == -1) {
                        this.f23532e1.setImageResource(R.drawable.wb_auto);
                        break;
                    } else {
                        parameters.setWhiteBalance("warm-fluorescent");
                        this.f23532e1.setImageResource(R.drawable.wb_warm_fluorescent);
                        this.T.f23513h = 7;
                        break;
                    }
            }
            this.R.setParameters(parameters);
        } catch (Exception unused) {
        }
    }

    public void q1(int i10) {
        com.peace.SilentCamera.r rVar = new com.peace.SilentCamera.r(this);
        this.V = rVar;
        rVar.n(R.string.camera_stop_error);
        if (i10 == 0) {
            this.V.o(getString(R.string.camera_open_error));
            this.V.f(getString(R.string.camera_open_error_message));
        } else if (i10 == 102) {
            this.V.e(R.string.camera_stop_error_message_overheat);
        } else {
            this.V.e(R.string.camera_stop_error_message);
        }
        this.V.i(R.string.ok, new d0());
        try {
            this.V.p();
        } catch (Throwable unused) {
        }
    }

    public void r1(Context context) {
        com.peace.SilentCamera.r rVar = new com.peace.SilentCamera.r(this);
        this.V = rVar;
        rVar.n(R.string.color_effect);
        this.V.d(new String[]{getString(R.string.none), getString(R.string.sepia), getString(R.string.mono), getString(R.string.negative), getString(R.string.aqua), getString(R.string.posterize), getString(R.string.solarize), getString(R.string.blackboard), getString(R.string.whiteboard)}, new a0());
        this.V.p();
    }

    boolean s1() {
        if (this.V0 == null || !H1 || isFinishing()) {
            return false;
        }
        this.V0.show();
        return true;
    }

    void t0() {
        Intent intent = getIntent();
        String action = getIntent().getAction();
        String stringExtra = intent.getStringExtra("from");
        intent.removeExtra("from");
        if (stringExtra != null && stringExtra.equals("notification")) {
            App.g("notification", "action", "open");
            if (action != null) {
                if (action.equals("update")) {
                    E1();
                    return;
                } else {
                    if (!action.equals(PurchaseActivity.class.getSimpleName()) || App.e()) {
                        return;
                    }
                    Intent intent2 = new Intent(this, (Class<?>) SettingsActivity.class);
                    intent2.setAction(PurchaseActivity.class.getSimpleName());
                    startActivity(intent2);
                    return;
                }
            }
            return;
        }
        if (action == null || action.contains("android")) {
            Bundle extras = intent.getExtras();
            if (extras != null) {
                Uri uri = (Uri) extras.getParcelable("output");
                this.f23546l1 = uri;
                if (uri != null) {
                    this.f23548m1 = true;
                    this.T.f23507b = 0;
                    App.K.g("mode", 0);
                    return;
                }
                return;
            }
            return;
        }
        if (action.equals(GalleryFolderActivity.class.getSimpleName()) || action.equals(EditorActivity.class.getSimpleName())) {
            if (this.f23552o1) {
                Intent intent3 = new Intent(this, (Class<?>) ViewerActivity.class);
                intent3.setAction(action);
                startActivity(intent3);
            }
        } else if (action.equals(SettingsActivity.class.getSimpleName())) {
            startActivity(new Intent(this, (Class<?>) SettingsActivity.class));
        }
        if (stringExtra == null) {
            App.g("AppShortcuts", "action", action);
        } else if (stringExtra.contains("TileService")) {
            App.g("tile_service", "action", action);
        } else if (stringExtra.contains("Widget")) {
            App.g("widget", "action", action);
        }
    }

    void t1() {
        com.peace.SilentCamera.r rVar = new com.peace.SilentCamera.r(this);
        this.V = rVar;
        rVar.o(getString(R.string.flash_mode));
        ArrayList arrayList = new ArrayList(Arrays.asList(getString(R.string.off), getString(R.string.on)));
        if (this.E0) {
            arrayList.add(getString(R.string.flashlight));
        }
        this.V.d((String[]) arrayList.toArray(new String[arrayList.size()]), new p());
        this.V.p();
    }

    void u0() {
        int checkSelfPermission;
        int checkSelfPermission2;
        try {
            if (Build.VERSION.SDK_INT >= 23) {
                checkSelfPermission = checkSelfPermission("android.permission.CAMERA");
                this.f23550n1 = checkSelfPermission == 0;
                checkSelfPermission2 = checkSelfPermission(PermissionActivity.t0());
                boolean z9 = checkSelfPermission2 == 0;
                this.f23552o1 = z9;
                if (this.f23550n1 && z9) {
                    return;
                }
                Intent intent = new Intent(this, (Class<?>) PermissionActivity.class);
                intent.putExtra("intentFrom", CameraActivity.class.getSimpleName());
                startActivity(intent);
                finish();
            }
        } catch (Throwable th) {
            App.h(th);
        }
    }

    public void u1(Context context) {
        com.peace.SilentCamera.r rVar = new com.peace.SilentCamera.r(this);
        this.V = rVar;
        rVar.n(R.string.focus_mode);
        this.V.d(new String[]{getString(R.string.auto_focus), getString(R.string.manual_focus), getString(R.string.macro_focus)}, new b0());
        this.V.p();
    }

    void v0(int i10) {
        try {
            Camera.Parameters parameters = this.R.getParameters();
            if (parameters.isAutoExposureLockSupported()) {
                parameters.setAutoExposureLock(false);
            }
            int maxExposureCompensation = parameters.getMaxExposureCompensation();
            int minExposureCompensation = parameters.getMinExposureCompensation();
            if (i10 == 0) {
                int ceil = (int) (this.f23549n0 - Math.ceil(maxExposureCompensation / 10.0f));
                this.f23549n0 = ceil;
                if (ceil < minExposureCompensation) {
                    this.f23549n0 = minExposureCompensation;
                }
            } else {
                int ceil2 = (int) (this.f23549n0 + Math.ceil(maxExposureCompensation / 10.0f));
                this.f23549n0 = ceil2;
                if (ceil2 > maxExposureCompensation) {
                    this.f23549n0 = maxExposureCompensation;
                }
            }
            this.R.setParameters(parameters);
            this.f23561t0.setProgress((int) (((this.f23549n0 - minExposureCompensation) / (maxExposureCompensation - minExposureCompensation)) * this.f23561t0.getMax()));
        } catch (Throwable unused) {
        }
    }

    public void v1() {
        AlertDialog alertDialog = this.H0;
        if ((alertDialog == null || !alertDialog.isShowing()) && !isFinishing()) {
            View inflate = ((LayoutInflater) getSystemService("layout_inflater")).inflate(R.layout.dialog_guide, (ViewGroup) findViewById(R.id.linearLayoutMain));
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setView(inflate);
            AlertDialog create = builder.create();
            this.H0 = create;
            try {
                create.getWindow().setBackgroundDrawable(new ColorDrawable(0));
            } catch (Throwable th) {
                App.h(th);
            }
            inflate.findViewById(R.id.textViewNone).setOnClickListener(new q());
            inflate.findViewById(R.id.textViewTrifurcation).setOnClickListener(new r());
            inflate.findViewById(R.id.textViewSymmetry).setOnClickListener(new s());
            inflate.findViewById(R.id.textViewRailman).setOnClickListener(new t());
            inflate.findViewById(R.id.textViewFibonacci).setOnClickListener(new u());
            Switch r12 = (Switch) inflate.findViewById(R.id.switchLevel);
            r12.setChecked(App.K.a("level", false));
            r12.setOnCheckedChangeListener(new w());
            inflate.findViewById(R.id.linearLayoutLevel).setOnClickListener(new x(r12));
            if (isFinishing()) {
                return;
            }
            this.H0.show();
        }
    }

    void w0(int i10) {
        try {
            Camera.Parameters parameters = this.R.getParameters();
            if (parameters.isZoomSupported()) {
                int maxZoom = parameters.getMaxZoom();
                if (i10 == 0) {
                    int i11 = this.f23547m0 - (maxZoom / 10);
                    this.f23547m0 = i11;
                    if (i11 < 0) {
                        this.f23547m0 = 0;
                    }
                } else {
                    int i12 = this.f23547m0 + (maxZoom / 10);
                    this.f23547m0 = i12;
                    if (i12 > maxZoom) {
                        this.f23547m0 = maxZoom;
                    }
                }
                parameters.setZoom(this.f23547m0);
                this.R.setParameters(parameters);
                this.f23559s0.setProgress((int) ((this.f23547m0 / maxZoom) * this.f23559s0.getMax()));
            }
        } catch (Throwable unused) {
        }
    }

    public void w1() {
        com.peace.SilentCamera.r rVar = new com.peace.SilentCamera.r(this);
        this.V = rVar;
        rVar.n(R.string.scene_mode);
        this.V.d(new String[]{getString(R.string.auto), getString(R.string.portrait), getString(R.string.landscape), getString(R.string.night), getString(R.string.night_portrait), getString(R.string.sports), getString(R.string.sunset), getString(R.string.beach), getString(R.string.party), getString(R.string.fireworks), getString(R.string.steadyphoto), getString(R.string.hdr), getString(R.string.snow), getString(R.string.candle_light), getString(R.string.theatre), getString(R.string.action), getString(R.string.barcode)}, new y());
        this.V.p();
    }

    public void x0() {
        int b10;
        try {
            int b11 = App.K.b("shutterCount", 0);
            if (b11 < Integer.MAX_VALUE) {
                App.K.g("shutterCount", b11 + 1);
            }
            if (App.K.a("isEvaluate", false) || (b10 = App.K.b("count", 0)) >= Integer.MAX_VALUE) {
                return;
            }
            App.K.g("count", b10 + 1);
        } catch (Throwable th) {
            App.h(th);
        }
    }

    void x1() {
        String[] strArr = this.Z;
        if (strArr == null) {
            return;
        }
        for (String str : strArr) {
            if (str == null) {
                return;
            }
        }
        com.peace.SilentCamera.r rVar = new com.peace.SilentCamera.r(this);
        this.V = rVar;
        rVar.o(getString(R.string.camera_select));
        this.V.d(this.Z, new m());
        this.V.p();
    }

    void y0() {
        long longValue = App.K.c("sessionLastTime", 0L).longValue();
        long currentTimeMillis = System.currentTimeMillis();
        if (currentTimeMillis - longValue >= TTAdConstant.AD_MAX_EVENT_TIME) {
            App.K.h("sessionLastTime", currentTimeMillis);
            App.K.e("sessionNum", 0);
        }
    }

    void y1() {
        this.V = new com.peace.SilentCamera.r(this);
        this.V.d(new String[]{getString(R.string.none), "3 " + getString(R.string.second), "5 " + getString(R.string.second), "10 " + getString(R.string.second)}, new n());
        this.V.n(R.string.timer_count);
        this.V.p();
    }

    public void z0() {
        try {
            WindowManager.LayoutParams attributes = getWindow().getAttributes();
            attributes.screenBrightness = 1.0f;
            getWindow().setAttributes(attributes);
            ImageView imageView = (ImageView) findViewById(R.id.imageViewDisplayFlash);
            imageView.setVisibility(0);
            AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
            alphaAnimation.setDuration(2000L);
            imageView.startAnimation(alphaAnimation);
            AlphaAnimation alphaAnimation2 = new AlphaAnimation(1.0f, 0.0f);
            alphaAnimation2.setDuration(2000L);
            imageView.startAnimation(alphaAnimation2);
            imageView.setVisibility(4);
        } catch (Throwable unused) {
            ((ImageView) findViewById(R.id.imageViewDisplayFlash)).setVisibility(4);
        }
    }

    public void z1() {
        com.peace.SilentCamera.r rVar = new com.peace.SilentCamera.r(this);
        this.V = rVar;
        rVar.n(R.string.white_balance);
        this.V.d(new String[]{getString(R.string.auto), getString(R.string.daylight), getString(R.string.shade), getString(R.string.cloudy_daylight), getString(R.string.fluorescent), getString(R.string.incandescent), getString(R.string.twilight), getString(R.string.warm_fluorescent)}, new z());
        this.V.p();
    }
}