导航菜单

页面标题

页面副标题

MedEd v5.3.6 - TedPermissionActivity.java 源代码

正在查看: MedEd v5.3.6 应用的 TedPermissionActivity.java JAVA 源代码文件

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


package com.gun0912.tedpermission;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import androidx.appcompat.app.AlertController;
import androidx.appcompat.app.c;
import defpackage.A23;
import defpackage.B23;
import defpackage.C0498Rq2;
import defpackage.C23;
import defpackage.D23;
import defpackage.F23;
import defpackage.InterfaceC3067yb2;
import defpackage.rH;
import defpackage.y23;
import defpackage.z23;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;

public class TedPermissionActivity extends ag {
    public static ArrayDeque J0;
    public CharSequence A0;
    public String[] B0;
    public String C0;
    public boolean D0;
    public String E0;
    public CharSequence F;
    public String F0;
    public CharSequence G;
    public String G0;
    public boolean H0;
    public CharSequence I;
    public int I0;

    public final void P(boolean z) {
        ArrayList arrayList = new ArrayList();
        for (String str : this.B0) {
            if (!str.equals("android.permission.SYSTEM_ALERT_WINDOW")) {
                Context context = F23.a;
                if (!(str.equals("android.permission.SYSTEM_ALERT_WINDOW") ? Settings.canDrawOverlays(r8) : dT.a(F23.a, str) == 0)) {
                    arrayList.add(str);
                }
            } else if (!Settings.canDrawOverlays(getApplicationContext())) {
                arrayList.add(str);
            }
        }
        if (arrayList.isEmpty()) {
            Q(null);
            return;
        }
        if (z) {
            Q(arrayList);
            return;
        }
        if (arrayList.size() == 1 && arrayList.contains("android.permission.SYSTEM_ALERT_WINDOW")) {
            Q(arrayList);
        } else if (this.H0 || TextUtils.isEmpty(this.G)) {
            F5.g(this, (String[]) arrayList.toArray(new String[arrayList.size()]), 10);
        } else {
            new c.a(this, Ar2.Theme_AppCompat_Light_Dialog_Alert).setTitle(this.F).c(this.G).b().e(this.G0, new z23(this, arrayList)).h();
            this.H0 = true;
        }
    }

    public final void Q(List<String> list) {
        finish();
        overridePendingTransition(0, 0);
        ArrayDeque arrayDeque = J0;
        if (arrayDeque != null) {
            InterfaceC3067yb2 interfaceC3067yb2 = (InterfaceC3067yb2) arrayDeque.pop();
            if (rH.Q(list)) {
                interfaceC3067yb2.a();
            } else {
                interfaceC3067yb2.b(list);
            }
            if (J0.size() == 0) {
                J0 = null;
            }
        }
    }

    public final void finish() {
        super/*android.app.Activity*/.finish();
        overridePendingTransition(0, 0);
    }

    public final void onActivityResult(int i, int i2, Intent intent) {
        if (i != 30) {
            if (i == 31) {
                P(false);
                return;
            } else if (i != 2000) {
                super/*androidx.fragment.app.e*/.onActivityResult(i, i2, intent);
                return;
            } else {
                P(true);
                return;
            }
        }
        if (Settings.canDrawOverlays(getApplicationContext()) || TextUtils.isEmpty(this.A0)) {
            P(false);
            return;
        }
        c.a aVar = new c.a(this, Ar2.Theme_AppCompat_Light_Dialog_Alert);
        CharSequence charSequence = this.A0;
        AlertController.b bVar = aVar.a;
        bVar.f = charSequence;
        bVar.k = false;
        aVar.e(this.F0, new C23(this));
        if (this.D0) {
            if (TextUtils.isEmpty(this.E0)) {
                this.E0 = getString(C0498Rq2.tedpermission_setting);
            }
            String str = this.E0;
            D23 d23 = new D23(this);
            bVar.g = str;
            bVar.h = d23;
        }
        aVar.h();
    }

    public final void onCreate(Bundle bundle) {
        overridePendingTransition(0, 0);
        super/*androidx.fragment.app.e*/.onCreate(bundle);
        getWindow().addFlags(16);
        if (bundle != null) {
            this.B0 = bundle.getStringArray("permissions");
            this.F = bundle.getCharSequence("rationale_title");
            this.G = bundle.getCharSequence("rationale_message");
            this.I = bundle.getCharSequence("deny_title");
            this.A0 = bundle.getCharSequence("deny_message");
            this.C0 = bundle.getString("package_name");
            this.D0 = bundle.getBoolean("setting_button", true);
            this.G0 = bundle.getString("rationale_confirm_text");
            this.F0 = bundle.getString("denied_dialog_close_text");
            this.E0 = bundle.getString("setting_button_text");
            this.I0 = bundle.getInt("screen_orientation", -1);
        } else {
            Intent intent = getIntent();
            this.B0 = intent.getStringArrayExtra("permissions");
            this.F = intent.getCharSequenceExtra("rationale_title");
            this.G = intent.getCharSequenceExtra("rationale_message");
            this.I = intent.getCharSequenceExtra("deny_title");
            this.A0 = intent.getCharSequenceExtra("deny_message");
            this.C0 = intent.getStringExtra("package_name");
            this.D0 = intent.getBooleanExtra("setting_button", true);
            this.G0 = intent.getStringExtra("rationale_confirm_text");
            this.F0 = intent.getStringExtra("denied_dialog_close_text");
            this.E0 = intent.getStringExtra("setting_button_text");
            this.I0 = intent.getIntExtra("screen_orientation", -1);
        }
        String[] strArr = this.B0;
        int length = strArr.length;
        int i = 0;
        while (true) {
            if (i >= length) {
                break;
            }
            if (!strArr[i].equals("android.permission.SYSTEM_ALERT_WINDOW")) {
                i++;
            } else if (!Settings.canDrawOverlays(getApplicationContext())) {
                Intent intent2 = new Intent("android.settings.action.MANAGE_OVERLAY_PERMISSION", Uri.fromParts("package", this.C0, null));
                if (TextUtils.isEmpty(this.G)) {
                    startActivityForResult(intent2, 30);
                } else {
                    c.a aVar = new c.a(this, Ar2.Theme_AppCompat_Light_Dialog_Alert);
                    CharSequence charSequence = this.G;
                    AlertController.b bVar = aVar.a;
                    bVar.f = charSequence;
                    bVar.k = false;
                    aVar.e(this.G0, new y23(this, intent2));
                    aVar.h();
                    this.H0 = true;
                }
            }
        }
        P(false);
        setRequestedOrientation(this.I0);
    }

    public final void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super/*androidx.fragment.app.e*/.onRequestPermissionsResult(i, strArr, iArr);
        Context context = F23.a;
        ArrayList arrayList = new ArrayList();
        for (String str : strArr) {
            if (!(str.equals("android.permission.SYSTEM_ALERT_WINDOW") ? Settings.canDrawOverlays(r4) : dT.a(F23.a, str) == 0)) {
                arrayList.add(str);
            }
        }
        if (arrayList.isEmpty()) {
            Q(null);
            return;
        }
        if (TextUtils.isEmpty(this.A0)) {
            Q(arrayList);
            return;
        }
        c.a aVar = new c.a(this, Ar2.Theme_AppCompat_Light_Dialog_Alert);
        aVar.setTitle(this.I).c(this.A0).b().e(this.F0, new A23(this, arrayList));
        if (this.D0) {
            if (TextUtils.isEmpty(this.E0)) {
                this.E0 = getString(C0498Rq2.tedpermission_setting);
            }
            String str2 = this.E0;
            B23 b23 = new B23(this);
            AlertController.b bVar = aVar.a;
            bVar.g = str2;
            bVar.h = b23;
        }
        aVar.h();
    }

    public final void onSaveInstanceState(Bundle bundle) {
        bundle.putStringArray("permissions", this.B0);
        bundle.putCharSequence("rationale_title", this.F);
        bundle.putCharSequence("rationale_message", this.G);
        bundle.putCharSequence("deny_title", this.I);
        bundle.putCharSequence("deny_message", this.A0);
        bundle.putString("package_name", this.C0);
        bundle.putBoolean("setting_button", this.D0);
        bundle.putString("denied_dialog_close_text", this.F0);
        bundle.putString("rationale_confirm_text", this.G0);
        bundle.putString("setting_button_text", this.E0);
        super/*OL*/.onSaveInstanceState(bundle);
    }
}