小红书.apk(点击下载) / g.java


package uh2;

import android.annotation.TargetApi;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
import android.util.Log;
import com.tencent.wcdb.database.SQLiteDatabase;
import n02.e;

/* compiled from: QikuUtils */
public class g {
    public static void a(Context context) {
        Intent intent = new Intent();
        intent.setClassName("com.android.settings", "com.android.settings.Settings$OverlaySettingsActivity");
        intent.setFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
        if (d(intent, context)) {
            context.startActivity(intent);
            return;
        }
        intent.setClassName("com.qihoo360.mobilesafe", "com.qihoo360.mobilesafe.ui.index.AppEnterActivity");
        if (d(intent, context)) {
            context.startActivity(intent);
        } else {
            Log.e("QikuUtils", "can't open permission page with particular name, please use \"adb shell dumpsys activity\" command and tell me the name of the float window permission page");
        }
    }

    public static boolean b(Context context) {
        if (Build.VERSION.SDK_INT >= 19) {
            return c(context, 24);
        }
        return true;
    }

    @TargetApi(19)
    public static boolean c(Context context, int i10) {
        if (Build.VERSION.SDK_INT >= 19) {
            AppOpsManager appOpsManager = (AppOpsManager) context.getSystemService("appops");
            try {
                Class cls = Integer.TYPE;
                if (((Integer) AppOpsManager.class.getDeclaredMethod("checkOp", cls, cls, String.class).invoke(appOpsManager, Integer.valueOf(i10), Integer.valueOf(Binder.getCallingUid()), context.getPackageName())).intValue() == 0) {
                    return true;
                }
                return false;
            } catch (Exception e14) {
                Log.e("QikuUtils", Log.getStackTraceString(e14));
            }
        } else {
            Log.e("", "Below API 19 cannot invoke!");
            return false;
        }
    }

    public static boolean d(Intent intent, Context context) {
        return intent != null && e.f(context.getPackageManager(), intent, 65536).size() > 0;
    }
}