导航菜单

页面标题

页面副标题

TodoCrédito v1.4 - a.java 源代码

正在查看: TodoCrédito v1.4 应用的 a.java JAVA 源代码文件

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


package x3;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.util.ArrayMap;
import androidx.annotation.NonNull;
import com.kongzue.dialogx.DialogX;
import com.kongzue.dialogx.interfaces.BaseDialog;
import com.kongzue.dialogx.util.DialogXFloatingWindowActivity;
import java.lang.reflect.Field;

public class a implements Application.ActivityLifecycleCallbacks {

    public static a f14339b;

    public static Application f14340c;

    public InterfaceC0235a f14341a;

    public interface InterfaceC0235a {
        void a(Activity activity);
    }

    public a(InterfaceC0235a interfaceC0235a) {
        this.f14341a = interfaceC0235a;
    }

    public static Application b() {
        Application application = f14340c;
        if (application != null) {
            return application;
        }
        try {
            try {
                try {
                    return (Application) Class.forName("android.app.ActivityThread").getMethod("currentApplication", new Class[0]).invoke(null, null);
                } catch (Exception unused) {
                    return (Application) Class.forName("android.app.AppGlobals").getMethod("getInitialApplication", new Class[0]).invoke(null, null);
                }
            } catch (Exception unused2) {
                Class<?> cls = Class.forName("android.app.ActivityThread");
                return (Application) cls.getDeclaredMethod("getApplication", new Class[0]).invoke(cls.getDeclaredMethod("currentActivityThread", new Class[0]).invoke(null, new Object[0]), new Object[0]);
            }
        } catch (Exception unused3) {
            return null;
        }
    }

    public static Application c(Context context) {
        if (context != null) {
            return (Application) context.getApplicationContext();
        }
        try {
            try {
                try {
                    return (Application) Class.forName("android.app.ActivityThread").getMethod("currentApplication", new Class[0]).invoke(null, null);
                } catch (Exception unused) {
                    Class<?> cls = Class.forName("android.app.ActivityThread");
                    return (Application) cls.getDeclaredMethod("getApplication", new Class[0]).invoke(cls.getDeclaredMethod("currentActivityThread", new Class[0]).invoke(null, new Object[0]), new Object[0]);
                }
            } catch (Exception unused2) {
                DialogX.b("DialogX.init: 初始化异常,请确保init方法内传入的Context是有效的。");
                return null;
            }
        } catch (Exception unused3) {
            return (Application) Class.forName("android.app.AppGlobals").getMethod("getInitialApplication", new Class[0]).invoke(null, null);
        }
    }

    public static Activity d() {
        ArrayMap arrayMap;
        try {
            Class<?> cls = Class.forName("android.app.ActivityThread");
            Object invoke = cls.getMethod("currentActivityThread", new Class[0]).invoke(null, new Object[0]);
            Field declaredField = cls.getDeclaredField("mActivities");
            declaredField.setAccessible(true);
            arrayMap = (ArrayMap) declaredField.get(invoke);
        } catch (Exception e9) {
            e9.printStackTrace();
        }
        if (arrayMap.size() < 1) {
            return null;
        }
        for (Object obj : arrayMap.values()) {
            Class<?> cls2 = obj.getClass();
            Field declaredField2 = cls2.getDeclaredField("paused");
            declaredField2.setAccessible(true);
            if (!declaredField2.getBoolean(obj)) {
                Field declaredField3 = cls2.getDeclaredField("activity");
                declaredField3.setAccessible(true);
                return (Activity) declaredField3.get(obj);
            }
        }
        return null;
    }

    public static void e(Context context, InterfaceC0235a interfaceC0235a) {
        if (context == null) {
            Application application = f14340c;
            if (application != null) {
                e(application, interfaceC0235a);
                return;
            }
            return;
        }
        Application c9 = c(context);
        if (c9 == null) {
            DialogX.b("DialogX 未初始化(E1)。\n请检查是否在启动对话框前进行初始化操作,使用以下代码进行初始化:\nDialogX.init(context);\n\n另外建议您前往查看 DialogX 的文档进行使用:https://github.com/kongzue/DialogX");
            return;
        }
        f14340c = c9;
        a aVar = f14339b;
        if (aVar != null) {
            c9.unregisterActivityLifecycleCallbacks(aVar);
        }
        a aVar2 = new a(interfaceC0235a);
        f14339b = aVar2;
        c9.registerActivityLifecycleCallbacks(aVar2);
    }

    public static boolean f(Activity activity) {
        if (activity == null) {
            return true;
        }
        for (String str : DialogX.f7557z) {
            if (activity.getClass().getName().contains(str)) {
                return true;
            }
        }
        return false;
    }

    public final void a(Activity activity) {
        InterfaceC0235a interfaceC0235a;
        if (activity.isDestroyed() || activity.isFinishing() || (activity instanceof DialogXFloatingWindowActivity) || (interfaceC0235a = this.f14341a) == null) {
            return;
        }
        interfaceC0235a.a(activity);
    }

    @Override
    public void onActivityCreated(@NonNull Activity activity, Bundle bundle) {
        InterfaceC0235a interfaceC0235a = this.f14341a;
        if (interfaceC0235a == null || (activity instanceof DialogXFloatingWindowActivity)) {
            return;
        }
        interfaceC0235a.a(activity);
    }

    @Override
    public void onActivityDestroyed(@NonNull Activity activity) {
        if (BaseDialog.K() == activity) {
            BaseDialog.i();
        }
        if (Build.VERSION.SDK_INT < 29) {
            BaseDialog.W(activity);
        }
    }

    @Override
    public void onActivityPaused(@NonNull Activity activity) {
    }

    @Override
    public void onActivityPreDestroyed(@NonNull Activity activity) {
        if (Build.VERSION.SDK_INT >= 29) {
            BaseDialog.W(activity);
        }
    }

    @Override
    public void onActivityPreResumed(@NonNull Activity activity) {
        super.onActivityPreResumed(activity);
        if (Build.VERSION.SDK_INT >= 29) {
            a(activity);
        }
    }

    @Override
    public void onActivityResumed(@NonNull Activity activity) {
        if (activity.isDestroyed() || activity.isFinishing() || (activity instanceof DialogXFloatingWindowActivity)) {
            return;
        }
        if (Build.VERSION.SDK_INT < 29) {
            a(activity);
        }
        BaseDialog.S(activity);
    }

    @Override
    public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle bundle) {
    }

    @Override
    public void onActivityStarted(@NonNull Activity activity) {
        if (f14340c == null) {
            BaseDialog.M(activity);
        }
    }

    @Override
    public void onActivityStopped(@NonNull Activity activity) {
    }
}