导航菜单

页面标题

页面副标题

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

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

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


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

import android.animation.ValueAnimator;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import com.adtiny.core.d;
import com.airbnb.lottie.LottieAnimationView;
import com.facebook.internal.i0;
import com.fancyclean.boost.networkspeed.ui.presenter.NetworkSpeedTestPresenter;
import com.fancyclean.boost.networkspeed.ui.view.GaugeView;
import com.github.mikephil.charting.charts.LineChart;
import com.thinkyeah.common.ui.dialog.c;
import com.thinkyeah.common.ui.view.TitleBar;
import gl.d;
import java.util.HashMap;
import java.util.Locale;
import java.util.Objects;
import t4.e;
import t4.j;
import u9.b;

@d(NetworkSpeedTestPresenter.class)
public class NetworkSpeedTestMainActivity extends v7.a<u9.a> implements b {
    public static final int B = 0;
    public t9.a l;
    public GaugeView m;
    public TextView o;
    public TextView p;
    public TextView q;
    public TextView r;
    public TextView s;
    public TextView t;
    public ImageView u;
    public View v;
    public LottieAnimationView w;

    public long f196x;

    public long f197y;
    public final Handler n = new Handler(Looper.getMainLooper());

    public boolean f198z = false;
    public boolean A = false;

    public static class a extends c<NetworkSpeedTestMainActivity> {
        public static final int c = 0;

        @NonNull
        public final Dialog onCreateDialog(@Nullable Bundle bundle) {
            c.a aVar = new c.a(getActivity());
            aVar.g(2131886719);
            aVar.c(2131886664);
            aVar.e(2131887775, (DialogInterface.OnClickListener) null);
            aVar.d(2131886790, new e(this, 7));
            return aVar.a();
        }

        public final void onStart() {
            super/*androidx.fragment.app.DialogFragment*/.onStart();
            Context context = getContext();
            if (context != null) {
                try {
                    AlertDialog dialog = getDialog();
                    Objects.requireNonNull(dialog);
                    dialog.getButton(-2).setTextColor(ContextCompat.getColor(context, 2131100607));
                } catch (NullPointerException unused) {
                }
            }
        }
    }

    public static String X2(j7.a aVar) {
        return String.format("%s %s", (String) aVar.d, (String) aVar.e);
    }

    @Override
    public final void A0() {
        this.o.setText(getString(2131887754));
        this.p.setText(getString(2131887754));
    }

    @Override
    public final void G1(String str, String str2) {
        this.o.setText(new Locale(ml.d.c().getLanguage(), str2).getDisplayCountry());
        this.p.setText(str);
    }

    @Override
    public final void K() {
        this.A = false;
        Y2();
        this.m.e();
        this.s.setVisibility(8);
        this.u.setVisibility(8);
        this.n.postDelayed(new androidx.appcompat.widget.b(this, 14), 1000L);
    }

    @Override
    public final void M0(long j) {
        this.f197y = j;
        this.r.setText(X2(x9.a.c(j)));
        this.l.d(j / 1048576.0f);
        this.m.d(j, 2);
    }

    @Override
    public final void N(long j) {
        this.A = true;
        this.f197y = j;
        this.l.d(j / 1048576.0f);
        Y2();
        this.r.setText(X2(x9.a.c(j)));
        this.n.postDelayed(new androidx.appcompat.widget.b(this, 14), 1000L);
        this.m.e();
        this.s.setVisibility(8);
        this.u.setVisibility(8);
        long currentTimeMillis = System.currentTimeMillis();
        SharedPreferences sharedPreferences = getSharedPreferences("network_speed_test", 0);
        SharedPreferences.Editor edit = sharedPreferences == null ? null : sharedPreferences.edit();
        if (edit == null) {
            return;
        }
        edit.putLong("last_network_speed_test_time", currentTimeMillis);
        edit.apply();
    }

    @Override
    public final void T() {
        this.s.setVisibility(0);
        this.u.setVisibility(0);
        this.t.setVisibility(8);
        this.s.setText(getString(2131887575));
        this.u.setImageResource(2131231552);
        this.m.e();
    }

    @Override
    public final void V0() {
        this.m.e();
        this.f198z = false;
    }

    public final void Y2() {
        String str = this.f198z ? "success" : "failure";
        String str2 = this.A ? "success" : "failure";
        tk.b a10 = tk.b.a();
        HashMap r = android.support.v4.media.b.r("speed_test_status_download", str, "speed_test_status_upload", str2);
        r.put("speed_test_download", x9.a.b(this.f196x));
        r.put("speed_test_upload", x9.a.b(this.f197y));
        a10.b("network_speed_test_done", r);
    }

    @Override
    public final void a(boolean z10) {
        if (!z10) {
            finish();
            return;
        }
        GaugeView gaugeView = (GaugeView) findViewById(2131362245);
        this.m = gaugeView;
        gaugeView.setListener(new s9.a(this));
        GaugeView gaugeView2 = this.m;
        gaugeView2.getClass();
        ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 270.0f);
        ValueAnimator ofInt = ValueAnimator.ofInt(0, 255);
        ofFloat.setDuration(gaugeView2.A).addUpdateListener(new j(gaugeView2, 2));
        ofFloat.addListener(new w9.b(gaugeView2, ofInt));
        ofInt.setDuration(gaugeView2.A / 2).addUpdateListener(new b9.a(gaugeView2, 1));
        ofInt.addListener(new com.fancyclean.boost.networkspeed.ui.view.a(gaugeView2));
        ofFloat.start();
    }

    @Override
    public final void d1(long j) {
        this.f196x = j;
        this.q.setText(X2(x9.a.c(j)));
        this.l.c(j / 1048576.0f);
        this.m.d(j, 1);
    }

    public final void finish() {
        this.w.a();
        com.adtiny.core.d.b().h(this, "I_NetworkSpeedTest", (d.l) null);
        super/*android.app.Activity*/.finish();
    }

    public final void onBackPressed() {
        if (((u9.a) W2()).E0()) {
            new a().j0(this, "ConfirmExitSpeedTestDialogFragment");
        } else {
            super/*androidx.activity.ComponentActivity*/.onBackPressed();
        }
    }

    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(2131558495);
        TitleBar.a configure = findViewById(2131363196).getConfigure();
        configure.f(getString(2131887952));
        int i = 20;
        configure.g(new t4.b(this, i));
        configure.a();
        this.t = (TextView) findViewById(2131362184);
        this.v = findViewById(2131362623);
        this.s = (TextView) findViewById(2131363108);
        this.u = (ImageView) findViewById(2131363107);
        this.s.setAlpha(0.0f);
        this.u.setImageAlpha(0);
        this.s.setText(getString(2131887575));
        this.u.setImageResource(2131231552);
        this.w = findViewById(2131362622);
        this.q = (TextView) findViewById(2131362153);
        this.r = (TextView) findViewById(2131363731);
        this.o = (TextView) findViewById(2131362618);
        this.p = (TextView) findViewById(2131362382);
        this.l = new t9.a(this, (LineChart) findViewById(2131361806));
        this.v.setOnClickListener(new i0(this, i));
        if (bundle == null) {
            ((u9.a) W2()).a();
            tk.b.a().b("ACT_NetworkSpeedTestStart", (HashMap) null);
        }
    }

    public final void onDestroy() {
        Handler handler = this.n;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
        }
        ((u9.a) W2()).x0();
        super/*il.b*/.onDestroy();
    }

    @Override
    public final void w1(long j) {
        this.f198z = true;
        this.f196x = j;
        this.q.setText(X2(x9.a.c(j)));
        this.l.c(j / 1048576.0f);
        this.m.e();
    }

    @Override
    public final void y1() {
        this.s.setVisibility(0);
        this.u.setVisibility(0);
        this.t.setVisibility(8);
        this.s.setText(getString(2131887758));
        this.u.setImageResource(2131231561);
        this.m.e();
    }

    @Override
    public final Context getContext() {
        return this;
    }
}