导航菜单

页面标题

页面副标题

Fancy Optimizer v4.6.3 - BatteryDeveloperActivity.java 源代码

正在查看: Fancy Optimizer v4.6.3 应用的 BatteryDeveloperActivity.java JAVA 源代码文件

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


package com.fancyclean.boost.battery.ui.activity;

import android.app.Dialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.NumberPicker;
import androidx.annotation.NonNull;
import com.thinkyeah.common.ui.dialog.c;
import com.thinkyeah.common.ui.thinklist.a;
import com.thinkyeah.common.ui.view.TitleBar;
import f.g;
import j6.f;
import java.util.ArrayList;
import jl.d;
import vj.h;

public class BatteryDeveloperActivity extends v7.a<hl.b> {
    public static final h o = new h("BatteryDeveloperActivity");
    public f l;
    public final a m = new a();
    public final g n = new g(this, 10);

    public class a implements a.c {
        public a() {
        }

        public final boolean a(int i, boolean z10) {
            return true;
        }

        public final void b(int i, boolean z10) {
            SharedPreferences.Editor edit;
            ?? r12 = BatteryDeveloperActivity.this;
            if (i == 0) {
                SharedPreferences sharedPreferences = r12.getSharedPreferences("battery_info", 0);
                edit = sharedPreferences != null ? sharedPreferences.edit() : null;
                if (edit == null) {
                    return;
                }
                edit.putBoolean("log_monitor_info", z10);
                edit.apply();
                return;
            }
            if (i == 1) {
                SharedPreferences sharedPreferences2 = r12.getSharedPreferences("battery", 0);
                boolean z11 = !(sharedPreferences2 == null ? false : sharedPreferences2.getBoolean("is_debugging_battery", false));
                SharedPreferences sharedPreferences3 = r12.getSharedPreferences("battery", 0);
                edit = sharedPreferences3 != null ? sharedPreferences3.edit() : null;
                if (edit != null) {
                    edit.putBoolean("is_debugging_battery", z11);
                    edit.apply();
                }
                r12.X2();
                return;
            }
            if (i != 2) {
                return;
            }
            SharedPreferences sharedPreferences4 = r12.getSharedPreferences("battery", 0);
            boolean z12 = !(sharedPreferences4 == null ? false : sharedPreferences4.getBoolean("debug_battery_is_charging", false));
            SharedPreferences sharedPreferences5 = r12.getSharedPreferences("battery", 0);
            edit = sharedPreferences5 != null ? sharedPreferences5.edit() : null;
            if (edit == null) {
                return;
            }
            edit.putBoolean("debug_battery_is_charging", z12);
            edit.apply();
        }
    }

    public static class b extends c<BatteryDeveloperActivity> {
        public static final int c = 0;

        @NonNull
        public final Dialog onCreateDialog(Bundle bundle) {
            if (getActivity() == null || getArguments() == null) {
                return d0();
            }
            FrameLayout frameLayout = new FrameLayout(getActivity());
            NumberPicker numberPicker = new NumberPicker(getActivity());
            numberPicker.setMaxValue(100);
            numberPicker.setMinValue(0);
            numberPicker.setWrapSelectorWheel(false);
            numberPicker.setValue(getArguments().getInt("currentNumber"));
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
            layoutParams.gravity = 1;
            numberPicker.setLayoutParams(layoutParams);
            frameLayout.addView(numberPicker);
            c.a aVar = new c.a(getActivity());
            aVar.d = "Set Battery Percent";
            aVar.x = frameLayout;
            aVar.d(2131886274, (DialogInterface.OnClickListener) null);
            aVar.e(2131887429, new l6.a(0, this, numberPicker));
            return aVar.a();
        }
    }

    public final void X2() {
        ArrayList arrayList = new ArrayList();
        SharedPreferences sharedPreferences = getSharedPreferences("battery_info", 0);
        com.thinkyeah.common.ui.thinklist.a aVar = new com.thinkyeah.common.ui.thinklist.a("Log Monitor Info", this, sharedPreferences == null ? false : sharedPreferences.getBoolean("log_monitor_info", false), 0);
        a aVar2 = this.m;
        aVar.setToggleButtonClickListener(aVar2);
        arrayList.add(aVar);
        SharedPreferences sharedPreferences2 = getSharedPreferences("battery", 0);
        com.thinkyeah.common.ui.thinklist.a aVar3 = new com.thinkyeah.common.ui.thinklist.a("Enable Debugging", this, sharedPreferences2 == null ? false : sharedPreferences2.getBoolean("is_debugging_battery", false), 1);
        aVar3.setToggleButtonClickListener(aVar2);
        arrayList.add(aVar3);
        SharedPreferences sharedPreferences3 = getSharedPreferences("battery", 0);
        if (sharedPreferences3 == null ? false : sharedPreferences3.getBoolean("is_debugging_battery", false)) {
            com.thinkyeah.common.ui.thinklist.a aVar4 = new com.thinkyeah.common.ui.thinklist.a("Is Charging", this, this.l.f(), 2);
            aVar4.setToggleButtonClickListener(aVar2);
            arrayList.add(aVar4);
            d dVar = new d(this, 3, "Battery Percent");
            StringBuilder sb2 = new StringBuilder();
            SharedPreferences sharedPreferences4 = getSharedPreferences("battery", 0);
            sb2.append(sharedPreferences4 != null ? sharedPreferences4.getInt("debug_battery_percent", 20) : 20);
            sb2.append("");
            dVar.setValue(sb2.toString());
            dVar.setThinkItemClickListener(this.n);
            arrayList.add(dVar);
        }
        findViewById(2131363202).setAdapter(new jl.b(arrayList));
    }

    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(2131558524);
        TitleBar.a configure = findViewById(2131363196).getConfigure();
        configure.f("Battery");
        configure.g(new t4.a(this, 5));
        configure.a();
        this.l = f.e(this);
        X2();
    }
}