MD5 校验值:719081c19dfabad7b000ef11fc4f3317
SettingsFragment.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package com.samruston.flip.settings; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import androidx.fragment.app.e; import androidx.lifecycle.f; import androidx.lifecycle.h; import androidx.preference.Preference; import androidx.preference.SwitchPreferenceCompat; import androidx.preference.i; import androidx.preference.l; import androidx.recyclerview.widget.LinearLayoutManager; import com.samruston.flip.CustomRatesActivity; import com.samruston.flip.NotificationsConfigActivity; import com.samruston.flip.R; import com.samruston.flip.UpgradeActivity; import com.samruston.flip.settings.SettingsFragment; import com.samruston.flip.utils.EventTracker; import com.samruston.flip.utils.ProMode; import com.samruston.flip.utils.Utils; import com.samruston.flip.utils.WidgetManager; import d4.WACp.QALqxpFtNki; import f0.a; import kotlin.Metadata; import z3.k; @Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\r\u0010\u000eJ\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\u001c\u0010\b\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u00022\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0016J\b\u0010\t\u001a\u00020\u0004H\u0016R\u0016\u0010\u000b\u001a\u00020\n8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b\u000b\u0010\f¨\u0006\u000f"}, d2 = {"Lcom/samruston/flip/settings/SettingsFragment;", "Landroidx/preference/i;", "Landroid/os/Bundle;", "savedInstanceState", "Ln3/x;", "onActivityCreated", "", "rootKey", "onCreatePreferences", "onDestroy", "Lcom/samruston/flip/utils/ProMode;", "adBuddy", "Lcom/samruston/flip/utils/ProMode;", "<init>", "()V", "app_release"}, k = 1, mv = {1, 8, LinearLayoutManager.HORIZONTAL}) public final class SettingsFragment extends i { private ProMode adBuddy; @Override public a getDefaultViewModelCreationExtras() { return f.a(this); } public static final boolean onCreatePreferences$lambda$0(SettingsFragment settingsFragment, Preference preference) { k.f(settingsFragment, "this$0"); k.f(preference, "it"); EventTracker.INSTANCE.trackTappedAd("settings"); settingsFragment.startActivity(new Intent(settingsFragment.requireActivity(), (Class<?>) UpgradeActivity.class)); return true; } public static final boolean onCreatePreferences$lambda$1(SettingsFragment settingsFragment, Preference preference) { k.f(settingsFragment, "this$0"); k.f(preference, "it"); settingsFragment.startActivity(new Intent(settingsFragment.getActivity(), (Class<?>) NotificationsConfigActivity.class)); return true; } public static final boolean onCreatePreferences$lambda$2(SettingsFragment settingsFragment, Preference preference) { k.f(settingsFragment, "this$0"); k.f(preference, "it"); settingsFragment.startActivity(new Intent(settingsFragment.getActivity(), (Class<?>) CustomRatesActivity.class)); return true; } public static final boolean onCreatePreferences$lambda$3(SettingsFragment settingsFragment, Preference preference, Object obj) { k.f(settingsFragment, "this$0"); k.f(preference, "preference"); SharedPreferences.Editor edit = l.b(settingsFragment.requireActivity()).edit(); k.d(obj, "null cannot be cast to non-null type kotlin.Boolean"); edit.putBoolean("showLastUpdatedWidget", ((Boolean) obj).booleanValue()).apply(); WidgetManager widgetManager = WidgetManager.INSTANCE; e activity = settingsFragment.getActivity(); k.c(activity); widgetManager.updateAllWidgets(activity, true); return true; } public static final boolean onCreatePreferences$lambda$4(SettingsFragment settingsFragment, Preference preference, Object obj) { k.f(settingsFragment, "this$0"); k.f(preference, "preference"); SharedPreferences.Editor edit = l.b(settingsFragment.requireActivity()).edit(); k.d(obj, "null cannot be cast to non-null type kotlin.Boolean"); edit.putBoolean("showSymbolWidget", ((Boolean) obj).booleanValue()).apply(); WidgetManager widgetManager = WidgetManager.INSTANCE; e activity = settingsFragment.getActivity(); k.c(activity); widgetManager.updateAllWidgets(activity, true); return true; } public static final boolean onCreatePreferences$lambda$5(SettingsFragment settingsFragment, Preference preference) { k.f(settingsFragment, QALqxpFtNki.vNazARkIhad); k.f(preference, "it"); settingsFragment.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://translate.samruston.com/project/coincalc"))); return true; } @Override public void onCreatePreferences(Bundle bundle, String str) { ProMode.Companion companion = ProMode.INSTANCE; Context requireContext = requireContext(); k.e(requireContext, "requireContext()"); if (!companion.hasPurchased(requireContext)) { addPreferencesFromResource(R.xml.preference_pro_disabled); Preference findPreference = findPreference("proMode"); if (findPreference != null) { findPreference.setOnPreferenceClickListener(new Preference.e() { @Override public final boolean a(Preference preference) { boolean onCreatePreferences$lambda$0; onCreatePreferences$lambda$0 = SettingsFragment.onCreatePreferences$lambda$0(SettingsFragment.this, preference); return onCreatePreferences$lambda$0; } }); } } e requireActivity = requireActivity(); k.e(requireActivity, "requireActivity()"); if (companion.hasPurchased(requireActivity)) { addPreferencesFromResource(R.xml.preference_pro_enabled); } addPreferencesFromResource(R.xml.preferences); Preference findPreference2 = findPreference("notifications"); if (findPreference2 != null) { findPreference2.setOnPreferenceClickListener(new Preference.e() { @Override public final boolean a(Preference preference) { boolean onCreatePreferences$lambda$1; onCreatePreferences$lambda$1 = SettingsFragment.onCreatePreferences$lambda$1(SettingsFragment.this, preference); return onCreatePreferences$lambda$1; } }); } Preference findPreference3 = findPreference("customRates"); if (findPreference3 != null) { findPreference3.setOnPreferenceClickListener(new Preference.e() { @Override public final boolean a(Preference preference) { boolean onCreatePreferences$lambda$2; onCreatePreferences$lambda$2 = SettingsFragment.onCreatePreferences$lambda$2(SettingsFragment.this, preference); return onCreatePreferences$lambda$2; } }); } SwitchPreferenceCompat switchPreferenceCompat = (SwitchPreferenceCompat) findPreference("showLastUpdatedWidget"); if (switchPreferenceCompat != null) { switchPreferenceCompat.setOnPreferenceChangeListener(new Preference.d() { @Override public final boolean a(Preference preference, Object obj) { boolean onCreatePreferences$lambda$3; onCreatePreferences$lambda$3 = SettingsFragment.onCreatePreferences$lambda$3(SettingsFragment.this, preference, obj); return onCreatePreferences$lambda$3; } }); } SwitchPreferenceCompat switchPreferenceCompat2 = (SwitchPreferenceCompat) findPreference("showSymbolWidget"); if (switchPreferenceCompat2 != null) { switchPreferenceCompat2.setOnPreferenceChangeListener(new Preference.d() { @Override public final boolean a(Preference preference, Object obj) { boolean onCreatePreferences$lambda$4; onCreatePreferences$lambda$4 = SettingsFragment.onCreatePreferences$lambda$4(SettingsFragment.this, preference, obj); return onCreatePreferences$lambda$4; } }); } Preference findPreference4 = findPreference("translate"); if (findPreference4 != null) { findPreference4.setOnPreferenceClickListener(new Preference.e() { @Override public final boolean a(Preference preference) { boolean onCreatePreferences$lambda$5; onCreatePreferences$lambda$5 = SettingsFragment.onCreatePreferences$lambda$5(SettingsFragment.this, preference); return onCreatePreferences$lambda$5; } }); } } @Override public void onDestroy() { Utils utils = Utils.INSTANCE; e requireActivity = requireActivity(); k.e(requireActivity, "requireActivity()"); utils.setNightMode(requireActivity); super.onDestroy(); } @Override public void onActivityCreated(Bundle bundle) { super.onActivityCreated(bundle); e requireActivity = requireActivity(); k.e(requireActivity, "requireActivity()"); ProMode proMode = null; this.adBuddy = new ProMode(requireActivity, null); h lifecycle = getViewLifecycleOwner().getLifecycle(); ProMode proMode2 = this.adBuddy; if (proMode2 == null) { k.s("adBuddy"); } else { proMode = proMode2; } lifecycle.a(proMode); } }