Android APK Debuggable Check isDebuggable(Context context)

Here you can find the source of isDebuggable(Context context)

Description

is Debuggable

License

Open Source License

Declaration

public static boolean isDebuggable(Context context) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

public class Main {
    public static boolean isDebuggable(Context context) {
        PackageManager pm = context.getPackageManager();
        try {//w  w  w .  j a  v a 2s  . co m
            ApplicationInfo info = pm.getApplicationInfo(
                    context.getPackageName(), 0);
            return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
        } catch (PackageManager.NameNotFoundException e) {
        }

        return true;
    }
}

Related

  1. isDebuggable(Context ctx)