导航菜单

页面标题

页面副标题

pg 娱乐 v1.0.7.202506242308 - WindowPermissionCompat.java 源代码

正在查看: pg 娱乐 v1.0.7.202506242308 应用的 WindowPermissionCompat.java JAVA 源代码文件

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


package com.hjq.permissions;

import android.content.Context;
import android.content.Intent;
import android.provider.Settings;

final class WindowPermissionCompat {
    private static final int OP_SYSTEM_ALERT_WINDOW_DEFAULT_VALUE = 24;
    private static final String OP_SYSTEM_ALERT_WINDOW_FIELD_NAME = "OP_SYSTEM_ALERT_WINDOW";

    WindowPermissionCompat() {
    }

    static boolean isGrantedPermission(Context context) {
        if (AndroidVersion.isAndroid6()) {
            return Settings.canDrawOverlays(context);
        }
        if (AndroidVersion.isAndroid4_4()) {
            return PermissionUtils.checkOpNoThrow(context, OP_SYSTEM_ALERT_WINDOW_FIELD_NAME, 24);
        }
        return true;
    }

    static Intent getPermissionIntent(Context context) {
        if (AndroidVersion.isAndroid6()) {
            if (AndroidVersion.isAndroid11() && PhoneRomUtils.isMiui() && PhoneRomUtils.isMiuiOptimization()) {
                return StartActivityManager.addSubIntentToMainIntent(PermissionIntentManager.getMiuiPermissionPageIntent(context), PermissionUtils.getApplicationDetailsIntent(context));
            }
            Intent intent = new Intent("android.settings.action.MANAGE_OVERLAY_PERMISSION");
            intent.setData(PermissionUtils.getPackageNameUri(context));
            return PermissionUtils.areActivityIntent(context, intent) ? intent : PermissionUtils.getApplicationDetailsIntent(context);
        }
        if (PhoneRomUtils.isEmui()) {
            return StartActivityManager.addSubIntentToMainIntent(PermissionIntentManager.getEmuiWindowPermissionPageIntent(context), PermissionUtils.getApplicationDetailsIntent(context));
        }
        if (PhoneRomUtils.isMiui()) {
            return StartActivityManager.addSubIntentToMainIntent(PhoneRomUtils.isMiuiOptimization() ? PermissionIntentManager.getMiuiWindowPermissionPageIntent(context) : null, PermissionUtils.getApplicationDetailsIntent(context));
        }
        if (PhoneRomUtils.isColorOs()) {
            return StartActivityManager.addSubIntentToMainIntent(PermissionIntentManager.getColorOsWindowPermissionPageIntent(context), PermissionUtils.getApplicationDetailsIntent(context));
        }
        if (PhoneRomUtils.isOriginOs()) {
            return StartActivityManager.addSubIntentToMainIntent(PermissionIntentManager.getOriginOsWindowPermissionPageIntent(context), PermissionUtils.getApplicationDetailsIntent(context));
        }
        if (PhoneRomUtils.isOneUi()) {
            return StartActivityManager.addSubIntentToMainIntent(PermissionIntentManager.getOneUiWindowPermissionPageIntent(context), PermissionUtils.getApplicationDetailsIntent(context));
        }
        return PermissionUtils.getApplicationDetailsIntent(context);
    }
}