1 package jp
.gr
.java_conf
.ofnhwx
.olib
.utils
;
3 import android
.content
.Context
;
4 import android
.content
.pm
.PackageManager
;
5 import android
.content
.pm
.PackageManager
.NameNotFoundException
;
11 public final class ODebug
{
13 private static final String DEBUG_PACKAGE
= "jp.gr.java_conf.ofnhwx.debug";
14 private static final String SU_PACKAGE
= "com.noshufou.android.su";
18 private static final boolean findPackage(Context context
, String packageName
) {
20 PackageManager pm
= context
.getPackageManager();
21 pm
.getApplicationInfo(packageName
, 0);
23 } catch (NameNotFoundException e
) {
33 public static final boolean isEnabled(Context context
) {
34 return findPackage(context
, DEBUG_PACKAGE
);
38 * root環境の判定.`Superuser'のインストール状態で判定を行う.
42 public static final boolean isRooted(Context context
) {
43 return findPackage(context
, SU_PACKAGE
);