导航菜单

页面标题

页面副标题

Ampture v4.3.1 - mSettingsActivity.java 源代码

正在查看: Ampture v4.3.1 应用的 mSettingsActivity.java JAVA 源代码文件

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


package com.kaunik.ampture.activity;

import android.app.ActivityOptions;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.LocaleList;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowInsets;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SwitchCompat;
import androidx.core.graphics.Insets;
import androidx.core.view.WindowInsetsCompat;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.materialswitch.MaterialSwitch;
import com.google.android.material.switchmaterial.SwitchMaterial;
import com.google.firebase.crashlytics.buildtools.ndk.internal.elf.EMachine;
import com.google.firebase.crashlytics.buildtools.reloc.org.apache.http.protocol.HTTP;
import com.google.firebase.encoders.json.BuildConfig;
import com.kaunik.ampture.R;
import com.kaunik.ampture.databinding.ActivityMsettingsBinding;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;

@Metadata(d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000bH\u0002J\u0010\u0010\f\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000bH\u0002J\b\u0010\r\u001a\u00020\tH\u0016J\u0012\u0010\u000e\u001a\u00020\t2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0015J\b\u0010\u0011\u001a\u00020\tH\u0014J\b\u0010\u0012\u001a\u00020\tH\u0002J\b\u0010\u0013\u001a\u00020\tH\u0003J\u0010\u0010\u0014\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000bH\u0002J\u0010\u0010\u0015\u001a\u00020\t2\u0006\u0010\u0016\u001a\u00020\u0017H\u0002J\b\u0010\u0018\u001a\u00020\tH\u0002J\u0010\u0010\u0019\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u001bH\u0002J\b\u0010\u001c\u001a\u00020\tH\u0002R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u001d"}, d2 = {"Lcom/kaunik/ampture/activity/mSettingsActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "alertDialog", "Landroidx/appcompat/app/AlertDialog;", "binding", "Lcom/kaunik/ampture/databinding/ActivityMsettingsBinding;", "materialDialog", "enableAppLock", BuildConfig.FLAVOR, "sharedPref", "Landroid/content/SharedPreferences;", "enableEnhancedPrivacyMode", "finish", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "openDefaultAppSettings", "openDefaultBrowserSettings", "restoreDefaultPrivacySettings", "setLocale", "language", BuildConfig.FLAVOR, "showIncognitoModeDialog", "showPrivacyModeDialog", "enabled", BuildConfig.FLAVOR, "showRestartDialog", "app_release"}, k = 1, mv = {1, 9, 0}, xi = EMachine.EM_H8S)
public final class mSettingsActivity extends AppCompatActivity {
    private AlertDialog alertDialog;
    private ActivityMsettingsBinding binding;
    private AlertDialog materialDialog;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityMsettingsBinding inflate = ActivityMsettingsBinding.inflate(getLayoutInflater());
        Intrinsics.checkNotNullExpressionValue(inflate, "inflate(...)");
        this.binding = inflate;
        ActivityMsettingsBinding activityMsettingsBinding = null;
        if (inflate == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            inflate = null;
        }
        setContentView(inflate.getRoot());
        ActivityMsettingsBinding activityMsettingsBinding2 = this.binding;
        if (activityMsettingsBinding2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding2 = null;
        }
        SwitchCompat enableAppLockSwitch = activityMsettingsBinding2.enableAppLockSwitch;
        Intrinsics.checkNotNullExpressionValue(enableAppLockSwitch, "enableAppLockSwitch");
        MSettingsActivityKt.applySwitchTheme(enableAppLockSwitch);
        ActivityMsettingsBinding activityMsettingsBinding3 = this.binding;
        if (activityMsettingsBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding3 = null;
        }
        SwitchCompat preventIPTrackSwitch = activityMsettingsBinding3.preventIPTrackSwitch;
        Intrinsics.checkNotNullExpressionValue(preventIPTrackSwitch, "preventIPTrackSwitch");
        MSettingsActivityKt.applySwitchTheme(preventIPTrackSwitch);
        ActivityMsettingsBinding activityMsettingsBinding4 = this.binding;
        if (activityMsettingsBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding4 = null;
        }
        activityMsettingsBinding4.getRoot().setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
            @Override
            public final WindowInsets onApplyWindowInsets(View view, WindowInsets windowInsets) {
                WindowInsets onCreate$lambda$0;
                onCreate$lambda$0 = mSettingsActivity.onCreate$lambda$0(view, windowInsets);
                return onCreate$lambda$0;
            }
        });
        final SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", 0);
        boolean z = sharedPreferences.getBoolean("OneClickPrivacyEnabled", false);
        if (z) {
            ActivityMsettingsBinding activityMsettingsBinding5 = this.binding;
            if (activityMsettingsBinding5 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding5 = null;
            }
            activityMsettingsBinding5.safeBrowsingLayout.setVisibility(8);
            ActivityMsettingsBinding activityMsettingsBinding6 = this.binding;
            if (activityMsettingsBinding6 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding6 = null;
            }
            activityMsettingsBinding6.blockDownloadLayout.setVisibility(8);
        } else {
            ActivityMsettingsBinding activityMsettingsBinding7 = this.binding;
            if (activityMsettingsBinding7 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding7 = null;
            }
            activityMsettingsBinding7.safeBrowsingLayout.setVisibility(0);
            ActivityMsettingsBinding activityMsettingsBinding8 = this.binding;
            if (activityMsettingsBinding8 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding8 = null;
            }
            activityMsettingsBinding8.blockDownloadLayout.setVisibility(0);
        }
        ActivityMsettingsBinding activityMsettingsBinding9 = this.binding;
        if (activityMsettingsBinding9 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding9 = null;
        }
        final SwitchCompat switchCompat = activityMsettingsBinding9.oneClickSwitchPrivacySwitch;
        switchCompat.setChecked(z);
        Intrinsics.checkNotNull(switchCompat);
        MSettingsActivityKt.applySwitchTheme(switchCompat);
        switchCompat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
                mSettingsActivity.onCreate$lambda$3$lambda$2(sharedPreferences, switchCompat, this, compoundButton, z2);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding10 = this.binding;
        if (activityMsettingsBinding10 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding10 = null;
        }
        SwitchCompat quickUrlSwitch = activityMsettingsBinding10.quickUrlSwitch;
        Intrinsics.checkNotNullExpressionValue(quickUrlSwitch, "quickUrlSwitch");
        MSettingsActivityKt.applySwitchTheme(quickUrlSwitch);
        boolean z2 = sharedPreferences.getBoolean("ShowQuickUrl", true);
        ActivityMsettingsBinding activityMsettingsBinding11 = this.binding;
        if (activityMsettingsBinding11 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding11 = null;
        }
        activityMsettingsBinding11.quickUrlSwitch.setChecked(z2);
        ActivityMsettingsBinding activityMsettingsBinding12 = this.binding;
        if (activityMsettingsBinding12 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding12 = null;
        }
        activityMsettingsBinding12.quickUrlSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z3) {
                mSettingsActivity.onCreate$lambda$4(sharedPreferences, this, compoundButton, z3);
            }
        });
        boolean z3 = sharedPreferences.getBoolean("AppLockEnabled", false);
        ActivityMsettingsBinding activityMsettingsBinding13 = this.binding;
        if (activityMsettingsBinding13 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding13 = null;
        }
        activityMsettingsBinding13.enableAppLockSwitch.setChecked(z3);
        ActivityMsettingsBinding activityMsettingsBinding14 = this.binding;
        if (activityMsettingsBinding14 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding14 = null;
        }
        activityMsettingsBinding14.enableAppLockSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z4) {
                mSettingsActivity.onCreate$lambda$5(sharedPreferences, this, compoundButton, z4);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding15 = this.binding;
        if (activityMsettingsBinding15 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding15 = null;
        }
        activityMsettingsBinding15.setAmptureAsDefaultBrowserBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$6(mSettingsActivity.this, view);
            }
        });
        boolean z4 = sharedPreferences.getBoolean("DefaultDeviceLanguage", true);
        ActivityMsettingsBinding activityMsettingsBinding16 = this.binding;
        if (activityMsettingsBinding16 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding16 = null;
        }
        activityMsettingsBinding16.defaultDeviceLanguageSwitch.setChecked(z4);
        ActivityMsettingsBinding activityMsettingsBinding17 = this.binding;
        if (activityMsettingsBinding17 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding17 = null;
        }
        SwitchCompat defaultDeviceLanguageSwitch = activityMsettingsBinding17.defaultDeviceLanguageSwitch;
        Intrinsics.checkNotNullExpressionValue(defaultDeviceLanguageSwitch, "defaultDeviceLanguageSwitch");
        MSettingsActivityKt.applySwitchTheme(defaultDeviceLanguageSwitch);
        ActivityMsettingsBinding activityMsettingsBinding18 = this.binding;
        if (activityMsettingsBinding18 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding18 = null;
        }
        activityMsettingsBinding18.defaultDeviceLanguageSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$7(sharedPreferences, this, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding19 = this.binding;
        if (activityMsettingsBinding19 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding19 = null;
        }
        final SwitchCompat switchCompat2 = activityMsettingsBinding19.hapticSwitch;
        switchCompat2.setChecked(sharedPreferences.getBoolean("HapticEnabled", true));
        Intrinsics.checkNotNull(switchCompat2);
        MSettingsActivityKt.applySwitchTheme(switchCompat2);
        switchCompat2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$10$lambda$9(sharedPreferences, switchCompat2, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding20 = this.binding;
        if (activityMsettingsBinding20 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding20 = null;
        }
        final SwitchCompat switchCompat3 = activityMsettingsBinding20.exitFullscreenSwitch;
        switchCompat3.setChecked(sharedPreferences.getBoolean("ExitFullscreen", false));
        Intrinsics.checkNotNull(switchCompat3);
        MSettingsActivityKt.applySwitchTheme(switchCompat3);
        switchCompat3.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$13$lambda$12(sharedPreferences, switchCompat3, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding21 = this.binding;
        if (activityMsettingsBinding21 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding21 = null;
        }
        final SwitchCompat switchCompat4 = activityMsettingsBinding21.hideBookmarkSwitch;
        switchCompat4.setChecked(sharedPreferences.getBoolean("HideBookmarkEnabled", false));
        Intrinsics.checkNotNull(switchCompat4);
        MSettingsActivityKt.applySwitchTheme(switchCompat4);
        switchCompat4.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$16$lambda$15(sharedPreferences, switchCompat4, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding22 = this.binding;
        if (activityMsettingsBinding22 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding22 = null;
        }
        final SwitchCompat switchCompat5 = activityMsettingsBinding22.enableShortCut;
        switchCompat5.setChecked(sharedPreferences.getBoolean("IsEnabled", true));
        Intrinsics.checkNotNull(switchCompat5);
        MSettingsActivityKt.applySwitchTheme(switchCompat5);
        ActivityMsettingsBinding activityMsettingsBinding23 = this.binding;
        if (activityMsettingsBinding23 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding23 = null;
        }
        activityMsettingsBinding23.showUsefullFeaturesPreview.setImageResource(switchCompat5.isChecked() ? R.drawable.img_usefullfeatureon : R.drawable.img_usegullfeatureoff);
        switchCompat5.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$19$lambda$18(sharedPreferences, this, switchCompat5, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding24 = this.binding;
        if (activityMsettingsBinding24 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding24 = null;
        }
        activityMsettingsBinding24.giftAmptureBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$21(mSettingsActivity.this, sharedPreferences, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding25 = this.binding;
        if (activityMsettingsBinding25 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding25 = null;
        }
        activityMsettingsBinding25.goToDownloadsBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$22(sharedPreferences, this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding26 = this.binding;
        if (activityMsettingsBinding26 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding26 = null;
        }
        activityMsettingsBinding26.changeSearchEngineBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$23(sharedPreferences, this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding27 = this.binding;
        if (activityMsettingsBinding27 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding27 = null;
        }
        activityMsettingsBinding27.changeAppThemeActivityRedirectBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$24(sharedPreferences, this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding28 = this.binding;
        if (activityMsettingsBinding28 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding28 = null;
        }
        activityMsettingsBinding28.showAppBookmarkBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$25(sharedPreferences, this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding29 = this.binding;
        if (activityMsettingsBinding29 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding29 = null;
        }
        final SwitchCompat switchCompat6 = activityMsettingsBinding29.safeBrowsingSwitch;
        switchCompat6.setChecked(sharedPreferences.getBoolean("SafeBrowsingEnabled", true));
        Intrinsics.checkNotNull(switchCompat6);
        MSettingsActivityKt.applySwitchTheme(switchCompat6);
        switchCompat6.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$28$lambda$27(sharedPreferences, switchCompat6, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding30 = this.binding;
        if (activityMsettingsBinding30 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding30 = null;
        }
        final SwitchCompat switchCompat7 = activityMsettingsBinding30.blockDownloadSwitch;
        switchCompat7.setChecked(sharedPreferences.getBoolean("BlockDownload", false));
        Intrinsics.checkNotNull(switchCompat7);
        MSettingsActivityKt.applySwitchTheme(switchCompat7);
        switchCompat7.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$31$lambda$30(sharedPreferences, switchCompat7, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding31 = this.binding;
        if (activityMsettingsBinding31 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding31 = null;
        }
        activityMsettingsBinding31.backmSettings.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$32(mSettingsActivity.this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding32 = this.binding;
        if (activityMsettingsBinding32 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding32 = null;
        }
        final SwitchCompat switchCompat8 = activityMsettingsBinding32.javascriptSwitch;
        switchCompat8.setChecked(sharedPreferences.getBoolean("JavascriptEnabled", true));
        Intrinsics.checkNotNull(switchCompat8);
        MSettingsActivityKt.applySwitchTheme(switchCompat8);
        switchCompat8.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$37$lambda$36(sharedPreferences, switchCompat8, this, compoundButton, z5);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding33 = this.binding;
        if (activityMsettingsBinding33 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding33 = null;
        }
        final SwitchCompat switchCompat9 = activityMsettingsBinding33.preventIPTrackSwitch;
        switchCompat9.setChecked(sharedPreferences.getBoolean("IsIPTrackingPrevented", false));
        Intrinsics.checkNotNull(switchCompat9);
        MSettingsActivityKt.applySwitchTheme(switchCompat9);
        switchCompat9.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$40$lambda$39(sharedPreferences, switchCompat9, this, compoundButton, z5);
            }
        });
        CheckBox checkBox = (CheckBox) findViewById(R.id.dataSaverModeBtn);
        final SharedPreferences sharedPreferences2 = getSharedPreferences("settings", 0);
        checkBox.setChecked(sharedPreferences2.getBoolean("data_saver_mode", false));
        checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z5) {
                mSettingsActivity.onCreate$lambda$43(sharedPreferences2, this, compoundButton, z5);
            }
        });
        boolean z5 = sharedPreferences.getBoolean("SwipeRefreshEnabled", true);
        ActivityMsettingsBinding activityMsettingsBinding34 = this.binding;
        if (activityMsettingsBinding34 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding34 = null;
        }
        activityMsettingsBinding34.swipeToRefreshTurnOnBtn.setChecked(z5);
        ActivityMsettingsBinding activityMsettingsBinding35 = this.binding;
        if (activityMsettingsBinding35 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding35 = null;
        }
        activityMsettingsBinding35.swipeToRefreshTurnOnBtn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z6) {
                mSettingsActivity.onCreate$lambda$45(sharedPreferences, compoundButton, z6);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding36 = this.binding;
        if (activityMsettingsBinding36 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding36 = null;
        }
        activityMsettingsBinding36.sendMailBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$47(mSettingsActivity.this, sharedPreferences, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding37 = this.binding;
        if (activityMsettingsBinding37 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding37 = null;
        }
        activityMsettingsBinding37.aboutVideoBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$48(mSettingsActivity.this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding38 = this.binding;
        if (activityMsettingsBinding38 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding38 = null;
        }
        activityMsettingsBinding38.privacyPolicyBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$49(mSettingsActivity.this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding39 = this.binding;
        if (activityMsettingsBinding39 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding39 = null;
        }
        activityMsettingsBinding39.aboutBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$50(mSettingsActivity.this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding40 = this.binding;
        if (activityMsettingsBinding40 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding40 = null;
        }
        activityMsettingsBinding40.faqBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$51(mSettingsActivity.this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding41 = this.binding;
        if (activityMsettingsBinding41 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding41 = null;
        }
        activityMsettingsBinding41.websiteBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$52(mSettingsActivity.this, view);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding42 = this.binding;
        if (activityMsettingsBinding42 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding42 = null;
        }
        final SwitchCompat switchCompat10 = activityMsettingsBinding42.saveHistorySwitch;
        switchCompat10.setChecked(!sharedPreferences.getBoolean("SaveHistory", true));
        Intrinsics.checkNotNull(switchCompat10);
        MSettingsActivityKt.applySwitchTheme(switchCompat10);
        switchCompat10.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z6) {
                mSettingsActivity.onCreate$lambda$55$lambda$54(sharedPreferences, switchCompat10, this, compoundButton, z6);
            }
        });
        ActivityMsettingsBinding activityMsettingsBinding43 = this.binding;
        if (activityMsettingsBinding43 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityMsettingsBinding = activityMsettingsBinding43;
        }
        activityMsettingsBinding.rateUsBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.onCreate$lambda$56(mSettingsActivity.this, view);
            }
        });
    }

    public static final WindowInsets onCreate$lambda$0(View view, WindowInsets insets) {
        Intrinsics.checkNotNullParameter(view, "view");
        Intrinsics.checkNotNullParameter(insets, "insets");
        WindowInsetsCompat windowInsetsCompat = WindowInsetsCompat.toWindowInsetsCompat(insets);
        Intrinsics.checkNotNullExpressionValue(windowInsetsCompat, "toWindowInsetsCompat(...)");
        Insets insets2 = windowInsetsCompat.getInsets(WindowInsetsCompat.Type.systemBars());
        Intrinsics.checkNotNullExpressionValue(insets2, "getInsets(...)");
        view.setPadding(0, insets2.top, 0, insets2.bottom);
        return insets;
    }

    public static final void onCreate$lambda$3$lambda$2(SharedPreferences sharedPreferences, MaterialSwitch this_apply, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("OneClickPrivacyEnabled", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MSettingsActivityKt.performHapticFeedback((View) this_apply);
        }
        ActivityMsettingsBinding activityMsettingsBinding = null;
        if (z) {
            Intrinsics.checkNotNull(sharedPreferences);
            this$0.enableEnhancedPrivacyMode(sharedPreferences);
            ActivityMsettingsBinding activityMsettingsBinding2 = this$0.binding;
            if (activityMsettingsBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding2 = null;
            }
            activityMsettingsBinding2.safeBrowsingLayout.setVisibility(8);
            ActivityMsettingsBinding activityMsettingsBinding3 = this$0.binding;
            if (activityMsettingsBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityMsettingsBinding = activityMsettingsBinding3;
            }
            activityMsettingsBinding.blockDownloadLayout.setVisibility(8);
        } else {
            Intrinsics.checkNotNull(sharedPreferences);
            this$0.restoreDefaultPrivacySettings(sharedPreferences);
            ActivityMsettingsBinding activityMsettingsBinding4 = this$0.binding;
            if (activityMsettingsBinding4 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding4 = null;
            }
            activityMsettingsBinding4.safeBrowsingLayout.setVisibility(0);
            ActivityMsettingsBinding activityMsettingsBinding5 = this$0.binding;
            if (activityMsettingsBinding5 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityMsettingsBinding = activityMsettingsBinding5;
            }
            activityMsettingsBinding.blockDownloadLayout.setVisibility(0);
        }
        this$0.showPrivacyModeDialog(z);
    }

    public static final void onCreate$lambda$4(SharedPreferences sharedPreferences, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("ShowQuickUrl", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            ActivityMsettingsBinding activityMsettingsBinding = this$0.binding;
            if (activityMsettingsBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding = null;
            }
            View quickUrlSwitch = activityMsettingsBinding.quickUrlSwitch;
            Intrinsics.checkNotNullExpressionValue(quickUrlSwitch, "quickUrlSwitch");
            MSettingsActivityKt.performHapticFeedback(quickUrlSwitch);
        }
    }

    public static final void onCreate$lambda$5(SharedPreferences sharedPreferences, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        if (z) {
            Intrinsics.checkNotNull(sharedPreferences);
            this$0.enableAppLock(sharedPreferences);
        } else {
            edit.putBoolean("AppLockEnabled", false);
            edit.remove("AppLockPasscode");
            edit.apply();
            Toast.makeText((Context) this$0, "App Lock disabled", 0).show();
        }
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            ActivityMsettingsBinding activityMsettingsBinding = this$0.binding;
            if (activityMsettingsBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding = null;
            }
            View enableAppLockSwitch = activityMsettingsBinding.enableAppLockSwitch;
            Intrinsics.checkNotNullExpressionValue(enableAppLockSwitch, "enableAppLockSwitch");
            MSettingsActivityKt.performHapticFeedback(enableAppLockSwitch);
        }
    }

    public static final void onCreate$lambda$6(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        this$0.openDefaultBrowserSettings();
    }

    public static final void onCreate$lambda$7(SharedPreferences sharedPreferences, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        String str;
        LocaleList locales;
        Locale locale;
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("DefaultDeviceLanguage", z);
        edit.apply();
        if (!z) {
            str = "en";
        } else if (Build.VERSION.SDK_INT >= 24) {
            locales = this$0.getResources().getConfiguration().getLocales();
            locale = locales.get(0);
            str = locale.getLanguage();
        } else {
            str = this$0.getResources().getConfiguration().locale.getLanguage();
        }
        Intrinsics.checkNotNull(str);
        this$0.setLocale(str);
        this$0.showRestartDialog();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            ActivityMsettingsBinding activityMsettingsBinding = this$0.binding;
            if (activityMsettingsBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityMsettingsBinding = null;
            }
            View defaultDeviceLanguageSwitch = activityMsettingsBinding.defaultDeviceLanguageSwitch;
            Intrinsics.checkNotNullExpressionValue(defaultDeviceLanguageSwitch, "defaultDeviceLanguageSwitch");
            MSettingsActivityKt.performHapticFeedback(defaultDeviceLanguageSwitch);
        }
    }

    public static final void onCreate$lambda$10$lambda$9(SharedPreferences sharedPreferences, MaterialSwitch this_apply, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("HapticEnabled", z);
        edit.apply();
        MSettingsActivityKt.performHapticFeedback((View) this_apply);
    }

    public static final void onCreate$lambda$13$lambda$12(SharedPreferences sharedPreferences, MaterialSwitch this_apply, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("ExitFullscreen", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MSettingsActivityKt.performHapticFeedback((View) this_apply);
        }
    }

    public static final void onCreate$lambda$16$lambda$15(SharedPreferences sharedPreferences, MaterialSwitch this_apply, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("HideBookmarkEnabled", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MSettingsActivityKt.performHapticFeedback((View) this_apply);
        }
    }

    public static final void onCreate$lambda$19$lambda$18(SharedPreferences sharedPreferences, mSettingsActivity this$0, MaterialSwitch this_apply, CompoundButton compoundButton, boolean z) {
        int i;
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("IsEnabled", z);
        edit.apply();
        ActivityMsettingsBinding activityMsettingsBinding = this$0.binding;
        if (activityMsettingsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding = null;
        }
        ImageView imageView = activityMsettingsBinding.showUsefullFeaturesPreview;
        if (z) {
            i = R.drawable.img_usefullfeatureon;
        } else {
            i = R.drawable.img_usegullfeatureoff;
        }
        imageView.setImageResource(i);
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            this_apply.performHapticFeedback(6);
        }
    }

    public static final void onCreate$lambda$21(mSettingsActivity this$0, SharedPreferences sharedPreferences, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent();
        intent.setAction("android.intent.action.SEND");
        intent.putExtra("android.intent.extra.TEXT", "Hey there! 😊\nLoving the Ampture Browser! Thought you might want to try it out too. Consider it a little gift! 🎁\nDownload it here: https://play.google.com/store/apps/details?id=com.kaunik.ampture 📲\nHappy browsing! 🚀");
        intent.setType(HTTP.PLAIN_TEXT_TYPE);
        this$0.startActivity(Intent.createChooser(intent, null));
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            view.performHapticFeedback(0);
        }
    }

    public static final void onCreate$lambda$22(SharedPreferences sharedPreferences, mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MainActivityKt.performHapticFeedback((Context) this$0, 50L);
        }
        this$0.startActivity(new Intent("android.intent.action.VIEW_DOWNLOADS"));
    }

    public static final void onCreate$lambda$23(SharedPreferences sharedPreferences, mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MainActivityKt.performHapticFeedback((Context) this$0, 50L);
        }
        Context context = (Context) this$0;
        Intent intent = new Intent(context, (Class<?>) ChangeSearchEngineActivity.class);
        if (Build.VERSION.SDK_INT >= 29) {
            this$0.startActivity(intent, ActivityOptions.makeCustomAnimation(context, R.anim.slide_up, android.R.anim.fade_out).toBundle());
        } else {
            this$0.startActivity(intent);
        }
    }

    public static final void onCreate$lambda$24(SharedPreferences sharedPreferences, mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MainActivityKt.performHapticFeedback((Context) this$0, 50L);
        }
        this$0.startActivity(new Intent((Context) this$0, (Class<?>) ThemeActivity.class));
    }

    public static final void onCreate$lambda$25(SharedPreferences sharedPreferences, mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MainActivityKt.performHapticFeedback((Context) this$0, 50L);
        }
        this$0.startActivity(new Intent((Context) this$0, (Class<?>) BookmarkActivity.class));
        this$0.finish();
    }

    public static final void onCreate$lambda$28$lambda$27(SharedPreferences sharedPreferences, MaterialSwitch this_apply, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("SafeBrowsingEnabled", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MSettingsActivityKt.performHapticFeedback((View) this_apply);
        }
    }

    public static final void onCreate$lambda$31$lambda$30(SharedPreferences sharedPreferences, MaterialSwitch this_apply, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("BlockDownload", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MSettingsActivityKt.performHapticFeedback((View) this_apply);
        }
    }

    public static final void onCreate$lambda$32(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        this$0.finish();
        Animation loadAnimation = AnimationUtils.loadAnimation((Context) this$0, R.anim.fade_out);
        ActivityMsettingsBinding activityMsettingsBinding = this$0.binding;
        if (activityMsettingsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding = null;
        }
        activityMsettingsBinding.backmSettings.startAnimation(loadAnimation);
    }

    public static final void onCreate$lambda$37$lambda$36(SharedPreferences sharedPreferences, MaterialSwitch this_apply, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("JavascriptEnabled", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MSettingsActivityKt.performHapticFeedback((View) this_apply);
        }
        ActivityMsettingsBinding activityMsettingsBinding = null;
        if (z) {
            ActivityMsettingsBinding activityMsettingsBinding2 = this$0.binding;
            if (activityMsettingsBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityMsettingsBinding = activityMsettingsBinding2;
            }
            activityMsettingsBinding.preventIPTrackSwitch.setChecked(false);
            sharedPreferences.edit().putBoolean("IsIPTrackingPrevented", false).apply();
            return;
        }
        ActivityMsettingsBinding activityMsettingsBinding3 = this$0.binding;
        if (activityMsettingsBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityMsettingsBinding = activityMsettingsBinding3;
        }
        activityMsettingsBinding.preventIPTrackSwitch.setChecked(true);
        sharedPreferences.edit().putBoolean("IsIPTrackingPrevented", true).apply();
        AlertDialog create = new MaterialAlertDialogBuilder((Context) this$0).setTitle("JavaScript Disabled").setMessage("JavaScript has been disabled. Disabling JavaScript can lead to limited website functionality, as many sites rely on it for interactive features. However, it can also result in faster loading times, increased privacy, and reduced security risks. Please note that the effects can vary greatly depending on the website.").setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        }).setCancelable(true).create();
        Window window = create.getWindow();
        if (window != null) {
            window.setBackgroundDrawableResource(R.drawable.custom_tabs_textview);
        }
        create.show();
    }

    public static final void onCreate$lambda$40$lambda$39(SharedPreferences sharedPreferences, SwitchMaterial this_apply, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("IsIPTrackingPrevented", z);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            MSettingsActivityKt.performHapticFeedback((View) this_apply);
        }
        ActivityMsettingsBinding activityMsettingsBinding = null;
        if (z) {
            ActivityMsettingsBinding activityMsettingsBinding2 = this$0.binding;
            if (activityMsettingsBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityMsettingsBinding = activityMsettingsBinding2;
            }
            activityMsettingsBinding.javascriptSwitch.setChecked(false);
            sharedPreferences.edit().putBoolean("JavascriptEnabled", false).apply();
            return;
        }
        ActivityMsettingsBinding activityMsettingsBinding3 = this$0.binding;
        if (activityMsettingsBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityMsettingsBinding = activityMsettingsBinding3;
        }
        activityMsettingsBinding.javascriptSwitch.setChecked(true);
        sharedPreferences.edit().putBoolean("JavascriptEnabled", true).apply();
    }

    public static final void onCreate$lambda$43(SharedPreferences sharedPreferences, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        sharedPreferences.edit().putBoolean("data_saver_mode", z).apply();
        AlertDialog alertDialog = this$0.alertDialog;
        if (alertDialog != null) {
            alertDialog.dismiss();
        }
        AlertDialog create = new MaterialAlertDialogBuilder((Context) this$0).setTitle("Data Saver Mode").setMessage(z ? "Data saver mode is enabled. This will block network images to save data." : "Data saver mode is disabled. Network images will be loaded.").setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        }).create();
        Window window = create.getWindow();
        if (window != null) {
            window.setBackgroundDrawableResource(R.drawable.custom_tabs_textview);
        }
        this$0.materialDialog = create;
        if (create != null) {
            create.show();
        }
    }

    public static final void onCreate$lambda$45(SharedPreferences sharedPreferences, CompoundButton compoundButton, boolean z) {
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("SwipeRefreshEnabled", z);
        edit.apply();
    }

    public static final void onCreate$lambda$47(mSettingsActivity this$0, SharedPreferences sharedPreferences, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent("android.intent.action.SEND");
        intent.setType(HTTP.PLAIN_TEXT_TYPE);
        intent.putExtra("android.intent.extra.EMAIL", new String[]{"[email protected]"});
        if (intent.resolveActivity(this$0.getPackageManager()) != null) {
            this$0.startActivity(Intent.createChooser(intent, "Send Email"));
        }
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            view.performHapticFeedback(0);
        }
    }

    public static final void onCreate$lambda$48(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse("https://www.youtube.com/shorts/9xVRR4P1S6k "));
        this$0.startActivity(intent);
        if (view.getContext().getSharedPreferences("MyPrefs", 0).getBoolean("HapticEnabled", true)) {
            Intrinsics.checkNotNull(view);
            MSettingsActivityKt.performHapticFeedback(view);
        }
    }

    public static final void onCreate$lambda$49(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse("https://docs.google.com/document/d/1XqomCSrNb7e7cShezOEXhZwKoK36PiRptt47uO-4PmY/edit?usp=sharing"));
        this$0.startActivity(intent);
        if (view.getContext().getSharedPreferences("MyPrefs", 0).getBoolean("HapticEnabled", true)) {
            Intrinsics.checkNotNull(view);
            MSettingsActivityKt.performHapticFeedback(view);
        }
    }

    public static final void onCreate$lambda$50(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse("https://docs.google.com/document/d/1B9HdwJ0YhG5l-kHBYjYGMgxlRp0Fnrmt56ONKcmzkk0/edit?usp=sharing"));
        this$0.startActivity(intent);
        if (view.getContext().getSharedPreferences("MyPrefs", 0).getBoolean("HapticEnabled", true)) {
            Intrinsics.checkNotNull(view);
            MSettingsActivityKt.performHapticFeedback(view);
        }
    }

    public static final void onCreate$lambda$51(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse("https://docs.google.com/document/d/1hSb19rlIe3xYc7pFZ0KHllAIhfD4mZiyham3xUlOZB0/edit?usp=sharing"));
        this$0.startActivity(intent);
        if (view.getContext().getSharedPreferences("MyPrefs", 0).getBoolean("HapticEnabled", true)) {
            Intrinsics.checkNotNull(view);
            MSettingsActivityKt.performHapticFeedback(view);
        }
    }

    public static final void onCreate$lambda$52(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse("https://ampture.xyz"));
        this$0.startActivity(intent);
        if (view.getContext().getSharedPreferences("MyPrefs", 0).getBoolean("HapticEnabled", true)) {
            Intrinsics.checkNotNull(view);
            MSettingsActivityKt.performHapticFeedback(view);
        }
    }

    public static final void onCreate$lambda$55$lambda$54(SharedPreferences sharedPreferences, MaterialSwitch this_apply, mSettingsActivity this$0, CompoundButton compoundButton, boolean z) {
        Intrinsics.checkNotNullParameter(this_apply, "$this_apply");
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        boolean z2 = !z;
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putBoolean("SaveHistory", z2);
        edit.apply();
        if (sharedPreferences.getBoolean("HapticEnabled", true)) {
            this_apply.performHapticFeedback(0);
        }
        if (z2) {
            return;
        }
        this$0.showIncognitoModeDialog();
    }

    public static final void onCreate$lambda$56(mSettingsActivity this$0, View view) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + this$0.getApplicationContext().getPackageName()));
        intent.addFlags(1208483840);
        try {
            this$0.startActivity(intent);
        } catch (ActivityNotFoundException unused) {
            this$0.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://play.google.com/store/apps/details?id=" + this$0.getApplicationContext().getPackageName())));
        }
        if (view.getContext().getSharedPreferences("MyPrefs", 0).getBoolean("HapticEnabled", true)) {
            Intrinsics.checkNotNull(view);
            MSettingsActivityKt.performHapticFeedback(view);
        }
    }

    private final void enableEnhancedPrivacyMode(SharedPreferences sharedPref) {
        SharedPreferences.Editor edit = sharedPref.edit();
        edit.putBoolean("SafeBrowsingEnabled", true);
        edit.putBoolean("BlockDownload", true);
        edit.putBoolean("SaveHistory", false);
        edit.putBoolean("JavascriptEnabled", true);
        edit.putBoolean("IsIPTrackingPrevented", false);
        edit.putBoolean("BlockPopups", true);
        edit.putBoolean("ForceHttps", true);
        edit.putBoolean("BlockGeolocation", true);
        edit.putBoolean("BlockCookies", true);
        edit.putBoolean("DisableCache", true);
        edit.putBoolean("BlockThirdPartyRequests", true);
        edit.putBoolean("DisableWebRTC", true);
        edit.putBoolean("PreventCrossSiteTracking", true);
        edit.putBoolean("DoNotTrack", true);
        edit.putBoolean("BlockAutoplayMedia", true);
        edit.putBoolean("BlockMaliciousSites", true);
        edit.putBoolean("SecureDNS", true);
        edit.apply();
        ActivityMsettingsBinding activityMsettingsBinding = this.binding;
        ActivityMsettingsBinding activityMsettingsBinding2 = null;
        if (activityMsettingsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding = null;
        }
        activityMsettingsBinding.safeBrowsingSwitch.setChecked(true);
        ActivityMsettingsBinding activityMsettingsBinding3 = this.binding;
        if (activityMsettingsBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding3 = null;
        }
        activityMsettingsBinding3.blockDownloadSwitch.setChecked(true);
        ActivityMsettingsBinding activityMsettingsBinding4 = this.binding;
        if (activityMsettingsBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding4 = null;
        }
        activityMsettingsBinding4.preventIPTrackSwitch.setChecked(false);
        ActivityMsettingsBinding activityMsettingsBinding5 = this.binding;
        if (activityMsettingsBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding5 = null;
        }
        activityMsettingsBinding5.javascriptSwitch.setChecked(true);
        ActivityMsettingsBinding activityMsettingsBinding6 = this.binding;
        if (activityMsettingsBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityMsettingsBinding2 = activityMsettingsBinding6;
        }
        activityMsettingsBinding2.saveHistorySwitch.setChecked(true);
    }

    private final void restoreDefaultPrivacySettings(SharedPreferences sharedPref) {
        SharedPreferences.Editor edit = sharedPref.edit();
        edit.putBoolean("SafeBrowsingEnabled", true);
        edit.putBoolean("BlockDownload", false);
        edit.putBoolean("IsIPTrackingPrevented", false);
        edit.putBoolean("JavascriptEnabled", true);
        edit.putBoolean("SaveHistory", true);
        edit.putBoolean("BlockPopups", false);
        edit.putBoolean("ForceHttps", true);
        edit.putBoolean("BlockGeolocation", false);
        edit.putBoolean("BlockCookies", false);
        edit.putBoolean("DisableCache", false);
        edit.putBoolean("BlockThirdPartyRequests", false);
        edit.putBoolean("DisableWebRTC", false);
        edit.putBoolean("PreventCrossSiteTracking", false);
        edit.putBoolean("DoNotTrack", false);
        edit.putBoolean("BlockAutoplayMedia", false);
        edit.putBoolean("BlockMaliciousSites", true);
        edit.putBoolean("SecureDNS", false);
        edit.apply();
        ActivityMsettingsBinding activityMsettingsBinding = this.binding;
        ActivityMsettingsBinding activityMsettingsBinding2 = null;
        if (activityMsettingsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding = null;
        }
        activityMsettingsBinding.safeBrowsingSwitch.setChecked(true);
        ActivityMsettingsBinding activityMsettingsBinding3 = this.binding;
        if (activityMsettingsBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding3 = null;
        }
        activityMsettingsBinding3.blockDownloadSwitch.setChecked(false);
        ActivityMsettingsBinding activityMsettingsBinding4 = this.binding;
        if (activityMsettingsBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding4 = null;
        }
        activityMsettingsBinding4.saveHistorySwitch.setChecked(false);
        ActivityMsettingsBinding activityMsettingsBinding5 = this.binding;
        if (activityMsettingsBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding5 = null;
        }
        activityMsettingsBinding5.preventIPTrackSwitch.setChecked(false);
        ActivityMsettingsBinding activityMsettingsBinding6 = this.binding;
        if (activityMsettingsBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityMsettingsBinding2 = activityMsettingsBinding6;
        }
        activityMsettingsBinding2.javascriptSwitch.setChecked(true);
    }

    private final void showPrivacyModeDialog(boolean enabled) {
        AlertDialog create = new MaterialAlertDialogBuilder((Context) this).setTitle(enabled ? "Enhanced Privacy Mode Activated" : "Enhanced Privacy Mode Deactivated").setMessage(enabled ? "Enhanced Privacy Mode enables multiple privacy features including:\n\n• Safe browsing\n• Incognito Mode\n• Blocking automatic downloads\n• Popup blocking\n• Forcing HTTPS connections\n• Geolocation blocking\n• Cookie blocking\n• Cache disabling\n• Cross-site tracking prevention\n• Using secure DNS\n• Blocking malicious sites\n\nJavaScript remains enabled for website compatibility." : "Standard privacy settings have been restored. You can still configure individual privacy features as needed.").setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        }).setCancelable(true).create();
        Window window = create.getWindow();
        if (window != null) {
            window.setBackgroundDrawableResource(R.drawable.custom_tabs_textview);
        }
        this.materialDialog = create;
        create.show();
    }

    private final void showIncognitoModeDialog() {
        AlertDialog create = new MaterialAlertDialogBuilder((Context) this).setTitle("Incognito Mode Activated").setMessage("All history will be cleared when you fully close the app. You will be able to use the browser as an incognito browser.").setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        }).setCancelable(true).create();
        Window window = create.getWindow();
        if (window != null) {
            window.setBackgroundDrawableResource(R.drawable.custom_tabs_textview);
        }
        this.materialDialog = create;
        if (create != null) {
            create.show();
        }
    }

    private final void openDefaultBrowserSettings() {
        Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
        intent.setData(Uri.fromParts("package", getPackageName(), null));
        startActivity(intent);
    }

    private final void openDefaultAppSettings() {
        startActivity(new Intent("android.settings.MANAGE_DEFAULT_APPS_SETTINGS"));
    }

    private final void enableAppLock(final SharedPreferences sharedPref) {
        View inflate = getLayoutInflater().inflate(R.layout.dialog_set_passcode, (ViewGroup) null);
        final EditText editText = (EditText) inflate.findViewById(R.id.passcodeInput);
        final AlertDialog create = new MaterialAlertDialogBuilder((Context) this, R.style.CustomMaterialDialog).setTitle("Set a new Passcode").setMessage("Enter a passcode for App Lock (4 to 16 digits)").setView(inflate).setPositiveButton("OK", (DialogInterface.OnClickListener) null).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                mSettingsActivity.enableAppLock$lambda$63(mSettingsActivity.this, dialogInterface, i);
            }
        }).setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                mSettingsActivity.enableAppLock$lambda$64(sharedPref, this, dialogInterface);
            }
        }).create();
        Intrinsics.checkNotNullExpressionValue(create, "create(...)");
        create.setCancelable(false);
        create.show();
        create.getButton(-1).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                mSettingsActivity.enableAppLock$lambda$65(editText, sharedPref, this, create, view);
            }
        });
    }

    public static final void enableAppLock$lambda$63(mSettingsActivity this$0, DialogInterface dialogInterface, int i) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        dialogInterface.dismiss();
        ActivityMsettingsBinding activityMsettingsBinding = this$0.binding;
        if (activityMsettingsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding = null;
        }
        activityMsettingsBinding.enableAppLockSwitch.setChecked(false);
    }

    public static final void enableAppLock$lambda$64(SharedPreferences sharedPref, mSettingsActivity this$0, DialogInterface dialogInterface) {
        Intrinsics.checkNotNullParameter(sharedPref, "$sharedPref");
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        if (sharedPref.contains("AppLockPasscode")) {
            return;
        }
        ActivityMsettingsBinding activityMsettingsBinding = this$0.binding;
        if (activityMsettingsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityMsettingsBinding = null;
        }
        activityMsettingsBinding.enableAppLockSwitch.setChecked(false);
    }

    public static final void enableAppLock$lambda$65(EditText editText, SharedPreferences sharedPref, mSettingsActivity this$0, AlertDialog materialDialog, View view) {
        Intrinsics.checkNotNullParameter(sharedPref, "$sharedPref");
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(materialDialog, "$materialDialog");
        String obj = editText.getText().toString();
        if (obj.length() == 0) {
            editText.setError("Passcode cannot be empty");
            return;
        }
        if (obj.length() < 4 || obj.length() > 16) {
            editText.setError("Passcode must be between 4 and 16 digits");
            return;
        }
        SharedPreferences.Editor edit = sharedPref.edit();
        edit.putBoolean("AppLockEnabled", true);
        edit.putString("AppLockPasscode", obj);
        edit.apply();
        Toast.makeText((Context) this$0, "App Lock enabled", 0).show();
        materialDialog.dismiss();
    }

    private final void showRestartDialog() {
        if (this.alertDialog == null) {
            AlertDialog create = new MaterialAlertDialogBuilder((Context) this).setTitle("Language Change").setMessage("You need to restart the app for the language changes to take effect.").setPositiveButton("OK", new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    dialogInterface.dismiss();
                }
            }).setCancelable(false).create();
            Window window = create.getWindow();
            if (window != null) {
                window.setBackgroundDrawableResource(R.drawable.custom_tabs_textview);
            }
            this.alertDialog = create;
        }
        AlertDialog alertDialog = this.alertDialog;
        if (alertDialog != null) {
            alertDialog.show();
        }
    }

    private final void setLocale(String language) {
        Locale locale = new Locale(language);
        Locale.setDefault(locale);
        Configuration configuration = getResources().getConfiguration();
        configuration.setLocale(locale);
        getResources().updateConfiguration(configuration, getResources().getDisplayMetrics());
        if (Build.VERSION.SDK_INT >= 26) {
            Context createConfigurationContext = createConfigurationContext(configuration);
            getResources().updateConfiguration(createConfigurationContext.getResources().getConfiguration(), createConfigurationContext.getResources().getDisplayMetrics());
        }
        sendBroadcast(new Intent("UPDATE_LANGUAGE"));
    }

    public void finish() {
        super.finish();
        if (Build.VERSION.SDK_INT >= 29) {
            overridePendingTransition(R.anim.slide_up, R.anim.slide_down);
        }
    }

    protected void onDestroy() {
        super.onDestroy();
        AlertDialog alertDialog = this.alertDialog;
        if (alertDialog != null) {
            alertDialog.dismiss();
        }
        this.alertDialog = null;
        AlertDialog alertDialog2 = this.materialDialog;
        if (alertDialog2 != null) {
            alertDialog2.dismiss();
        }
        this.materialDialog = null;
    }
}