导航菜单

页面标题

页面副标题

度娘 v1.0.1 - t.java 源代码

正在查看: 度娘 v1.0.1 应用的 t.java JAVA 源代码文件

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


package f4;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.PowerManager;
import android.provider.Settings;
import android.util.Log;
import androidx.core.app.q0;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

final class t implements a9.m, a9.o {

    private final Context f8426h;

    private b f8427i;

    private Activity f8428j;

    private int f8429k;

    private Map<Integer, Integer> f8430l;

    @FunctionalInterface
    interface a {
        void a(int i10);
    }

    @FunctionalInterface
    interface b {
        void a(Map<Integer, Integer> map);
    }

    @FunctionalInterface
    interface c {
        void a(boolean z10);
    }

    public t(Context context) {
        this.f8426h = context;
    }

    private int b() {
        List<String> c10 = v.c(this.f8426h, 21);
        if (!(c10 == null || c10.isEmpty())) {
            return 1;
        }
        Log.d("permissions_handler", "Bluetooth permission missing in manifest");
        return 0;
    }

    private int c() {
        int checkSelfPermission;
        if (Build.VERSION.SDK_INT < 33) {
            return q0.e(this.f8426h).a() ? 1 : 0;
        }
        checkSelfPermission = this.f8426h.checkSelfPermission("android.permission.POST_NOTIFICATIONS");
        if (checkSelfPermission == 0) {
            return 1;
        }
        return v.b(this.f8428j, "android.permission.POST_NOTIFICATIONS");
    }

    private int e(int r15) {
        throw new UnsupportedOperationException("Method not decompiled: f4.t.e(int):int");
    }

    private boolean f() {
        List<String> c10 = v.c(this.f8426h, 37);
        boolean z10 = c10 != null && c10.contains("android.permission.WRITE_CALENDAR");
        boolean z11 = c10 != null && c10.contains("android.permission.READ_CALENDAR");
        if (z10 && z11) {
            return true;
        }
        if (!z10) {
            Log.d("permissions_handler", "android.permission.WRITE_CALENDAR missing in manifest");
        }
        if (!z11) {
            Log.d("permissions_handler", "android.permission.READ_CALENDAR missing in manifest");
        }
        return false;
    }

    private void g(String str, int i10) {
        if (this.f8428j == null) {
            return;
        }
        Intent intent = new Intent(str);
        if (!str.equals("android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS")) {
            intent.setData(Uri.parse("package:" + this.f8428j.getPackageName()));
        }
        this.f8428j.startActivityForResult(intent, i10);
        this.f8429k++;
    }

    @Override
    public boolean a(int i10, int i11, Intent intent) {
        int i12;
        boolean canScheduleExactAlarms;
        boolean isNotificationPolicyAccessGranted;
        boolean canRequestPackageInstalls;
        boolean canDrawOverlays;
        boolean isExternalStorageManager;
        boolean isIgnoringBatteryOptimizations;
        Activity activity = this.f8428j;
        int i13 = 0;
        i13 = 0;
        if (activity == null) {
            return false;
        }
        if (this.f8430l == null) {
            this.f8429k = 0;
            return false;
        }
        int i14 = 23;
        if (i10 == 209) {
            if (Build.VERSION.SDK_INT >= 23) {
                String packageName = this.f8426h.getPackageName();
                PowerManager powerManager = (PowerManager) this.f8426h.getSystemService("power");
                if (powerManager != null) {
                    isIgnoringBatteryOptimizations = powerManager.isIgnoringBatteryOptimizations(packageName);
                    if (isIgnoringBatteryOptimizations) {
                        i13 = 1;
                    }
                }
            } else {
                i13 = 2;
            }
            i14 = 16;
            i12 = i13;
        } else if (i10 == 210) {
            if (Build.VERSION.SDK_INT < 30) {
                return false;
            }
            isExternalStorageManager = Environment.isExternalStorageManager();
            i14 = 22;
            i12 = isExternalStorageManager;
        } else if (i10 == 211) {
            if (Build.VERSION.SDK_INT < 23) {
                return false;
            }
            canDrawOverlays = Settings.canDrawOverlays(activity);
            i12 = canDrawOverlays;
        } else if (i10 == 212) {
            if (Build.VERSION.SDK_INT < 26) {
                return false;
            }
            canRequestPackageInstalls = activity.getPackageManager().canRequestPackageInstalls();
            i14 = 24;
            i12 = canRequestPackageInstalls;
        } else if (i10 == 213) {
            if (Build.VERSION.SDK_INT < 23) {
                return false;
            }
            isNotificationPolicyAccessGranted = ((NotificationManager) activity.getSystemService("notification")).isNotificationPolicyAccessGranted();
            i14 = 27;
            i12 = isNotificationPolicyAccessGranted;
        } else {
            if (i10 != 214) {
                return false;
            }
            i14 = 34;
            AlarmManager alarmManager = (AlarmManager) activity.getSystemService("alarm");
            if (Build.VERSION.SDK_INT >= 31) {
                canScheduleExactAlarms = alarmManager.canScheduleExactAlarms();
                i12 = canScheduleExactAlarms;
            } else {
                i12 = 1;
            }
        }
        this.f8430l.put(Integer.valueOf(i14), Integer.valueOf(i12));
        int i15 = this.f8429k - 1;
        this.f8429k = i15;
        b bVar = this.f8427i;
        if (bVar != null && i15 == 0) {
            bVar.a(this.f8430l);
        }
        return true;
    }

    void d(int i10, a aVar) {
        aVar.a(e(i10));
    }

    void h(List<Integer> list, b bVar, f4.b bVar2) {
        Map<Integer, Integer> map;
        int i10;
        Map<Integer, Integer> map2;
        int i11;
        int i12;
        int i13;
        String str;
        String str2;
        if (this.f8429k > 0) {
            str2 = "A request for permissions is already running, please wait for it to finish before doing another request (note that you can request multiple permissions at the same time).";
        } else {
            if (this.f8428j != null) {
                this.f8427i = bVar;
                this.f8430l = new HashMap();
                this.f8429k = 0;
                ArrayList arrayList = new ArrayList();
                for (Integer num : list) {
                    if (e(num.intValue()) != 1) {
                        List<String> c10 = v.c(this.f8428j, num.intValue());
                        if (c10 != null && !c10.isEmpty()) {
                            int i14 = Build.VERSION.SDK_INT;
                            if (i14 >= 23 && num.intValue() == 16) {
                                i13 = 209;
                                str = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
                            } else if (i14 >= 30 && num.intValue() == 22) {
                                i13 = 210;
                                str = "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION";
                            } else if (i14 >= 23 && num.intValue() == 23) {
                                i13 = 211;
                                str = "android.settings.action.MANAGE_OVERLAY_PERMISSION";
                            } else if (i14 >= 26 && num.intValue() == 24) {
                                i13 = 212;
                                str = "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
                            } else if (i14 >= 23 && num.intValue() == 27) {
                                i13 = 213;
                                str = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
                            } else if (i14 < 31 || num.intValue() != 34) {
                                if (num.intValue() != 37 && num.intValue() != 0) {
                                    arrayList.addAll(c10);
                                    i12 = this.f8429k + c10.size();
                                } else if (f()) {
                                    arrayList.add("android.permission.WRITE_CALENDAR");
                                    arrayList.add("android.permission.READ_CALENDAR");
                                    i12 = this.f8429k + 2;
                                } else {
                                    map = this.f8430l;
                                    i10 = 0;
                                }
                                this.f8429k = i12;
                            } else {
                                i13 = 214;
                                str = "android.settings.REQUEST_SCHEDULE_EXACT_ALARM";
                            }
                            g(str, i13);
                        } else if (!this.f8430l.containsKey(num)) {
                            if (num.intValue() != 16 || Build.VERSION.SDK_INT >= 23) {
                                map2 = this.f8430l;
                                i11 = 0;
                            } else {
                                map2 = this.f8430l;
                                i11 = 2;
                            }
                            map2.put(num, i11);
                            if (num.intValue() == 22 && Build.VERSION.SDK_INT < 30) {
                                map = this.f8430l;
                                i10 = 2;
                            }
                            map = this.f8430l;
                            i10 = 0;
                        }
                        map.put(num, i10);
                    } else if (!this.f8430l.containsKey(num)) {
                        map = this.f8430l;
                        i10 = 1;
                        map.put(num, i10);
                    }
                }
                if (arrayList.size() > 0) {
                    androidx.core.app.b.r(this.f8428j, (String[]) arrayList.toArray(new String[0]), 24);
                }
                b bVar3 = this.f8427i;
                if (bVar3 == null || this.f8429k != 0) {
                    return;
                }
                bVar3.a(this.f8430l);
                return;
            }
            Log.d("permissions_handler", "Unable to detect current Activity.");
            str2 = "Unable to detect current Android Activity.";
        }
        bVar2.a("PermissionHandler.PermissionManager", str2);
    }

    public void i(Activity activity) {
        this.f8428j = activity;
    }

    void j(int i10, c cVar, f4.b bVar) {
        Activity activity = this.f8428j;
        if (activity == null) {
            Log.d("permissions_handler", "Unable to detect current Activity.");
            bVar.a("PermissionHandler.PermissionManager", "Unable to detect current Android Activity.");
            return;
        }
        List<String> c10 = v.c(activity, i10);
        if (c10 == null) {
            Log.d("permissions_handler", "No android specific permissions needed for: " + i10);
            cVar.a(false);
            return;
        }
        if (!c10.isEmpty()) {
            cVar.a(androidx.core.app.b.s(this.f8428j, c10.get(0)));
            return;
        }
        Log.d("permissions_handler", "No permissions found in manifest for: " + i10 + " no need to show request rationale");
        cVar.a(false);
    }

    @Override
    public boolean onRequestPermissionsResult(int i10, String[] strArr, int[] iArr) {
        int g10;
        Map<Integer, Integer> map;
        int i11;
        Integer valueOf;
        if (i10 != 24) {
            this.f8429k = 0;
            return false;
        }
        if (this.f8430l == null) {
            return false;
        }
        if (strArr.length == 0 && iArr.length == 0) {
            Log.w("permissions_handler", "onRequestPermissionsResult is called without results. This is probably caused by interfering request codes. If you see this error, please file an issue in flutter-permission-handler, including a list of plugins used by this application: https://github.com/Baseflow/flutter-permission-handler/issues");
            return false;
        }
        List asList = Arrays.asList(strArr);
        int indexOf = asList.indexOf("android.permission.WRITE_CALENDAR");
        if (indexOf >= 0) {
            int k10 = v.k(this.f8428j, "android.permission.WRITE_CALENDAR", iArr[indexOf]);
            this.f8430l.put(36, Integer.valueOf(k10));
            int indexOf2 = asList.indexOf("android.permission.READ_CALENDAR");
            if (indexOf2 >= 0) {
                int intValue = v.i(Integer.valueOf(k10), Integer.valueOf(v.k(this.f8428j, "android.permission.READ_CALENDAR", iArr[indexOf2]))).intValue();
                this.f8430l.put(37, Integer.valueOf(intValue));
                this.f8430l.put(0, Integer.valueOf(intValue));
            }
        }
        for (int i12 = 0; i12 < strArr.length; i12++) {
            String str = strArr[i12];
            if (!str.equals("android.permission.WRITE_CALENDAR") && !str.equals("android.permission.READ_CALENDAR") && (g10 = v.g(str)) != 20) {
                int i13 = iArr[i12];
                if (g10 == 8) {
                    valueOf = v.i(this.f8430l.get(8), Integer.valueOf(v.k(this.f8428j, str, i13)));
                    map = this.f8430l;
                    i11 = 8;
                } else if (g10 == 7) {
                    if (!this.f8430l.containsKey(7)) {
                        this.f8430l.put(7, Integer.valueOf(v.k(this.f8428j, str, i13)));
                    }
                    if (!this.f8430l.containsKey(14)) {
                        this.f8430l.put(14, Integer.valueOf(v.k(this.f8428j, str, i13)));
                    }
                } else if (g10 == 4) {
                    int k11 = v.k(this.f8428j, str, i13);
                    if (!this.f8430l.containsKey(4)) {
                        map = this.f8430l;
                        i11 = 4;
                        valueOf = Integer.valueOf(k11);
                    }
                } else if (g10 == 3) {
                    int k12 = v.k(this.f8428j, str, i13);
                    if (Build.VERSION.SDK_INT < 29 && !this.f8430l.containsKey(4)) {
                        this.f8430l.put(4, Integer.valueOf(k12));
                    }
                    if (!this.f8430l.containsKey(5)) {
                        this.f8430l.put(5, Integer.valueOf(k12));
                    }
                    this.f8430l.put(Integer.valueOf(g10), Integer.valueOf(k12));
                } else if (g10 == 9 || g10 == 32) {
                    this.f8430l.put(Integer.valueOf(g10), Integer.valueOf(e(g10)));
                } else if (!this.f8430l.containsKey(Integer.valueOf(g10))) {
                    this.f8430l.put(Integer.valueOf(g10), Integer.valueOf(v.k(this.f8428j, str, i13)));
                }
                map.put(i11, valueOf);
            }
        }
        int length = this.f8429k - iArr.length;
        this.f8429k = length;
        b bVar = this.f8427i;
        if (bVar == null || length != 0) {
            return true;
        }
        bVar.a(this.f8430l);
        return true;
    }
}