Buggy code:
public class Settings { static final String TAG = "Superuser" ; SQLiteDatabase mDatabase ; Context mContext ; public static void setString ( Context context , String name , String value ) { } public static String getString ( Context context , String name ) { } public static String getString ( Context context , String name , String defaultValue ) { } public static void setInt ( Context context , String name , int value ) { } public static int getInt ( Context context , String name , int defaultValue ) { } public static void setLong ( Context context , String name , long value ) { } public static long getLong ( Context context , String name , long defaultValue ) { } public static void setBoolean ( Context context , String name , boolean value ) { } public static boolean getBoolean ( Context context , String name , boolean defaultValue ) { } private static final String KEY_LOGGING = "logging" ; public static boolean getLogging ( Context context ) { } public static void setLogging ( Context context , boolean logging ) { } private static final String KEY_TIMEOUT = "timeout" ; public static final int REQUEST_TIMEOUT_DEFAULT = 30 ; public static int getRequestTimeout ( Context context ) { } public static void setTimeout ( Context context , int timeout ) { } private static final String KEY_NOTIFICATION = "notification" ; public static final int NOTIFICATION_TYPE_NONE = 0 ; public static final int NOTIFICATION_TYPE_TOAST = 1 ; public static final int NOTIFICATION_TYPE_NOTIFICATION = 2 ; public static final int NOTIFICATION_TYPE_DEFAULT = Settings . NOTIFICATION_TYPE_TOAST ; public static int getNotificationType ( Context context ) { } public static void setNotificationType ( Context context , int notification ) { } public static final String KEY_PIN = "pin" ; public static final boolean isPinProtected ( Context context ) { } private static String digest ( String value ) { } public static void setPin ( Context context , String pin ) { } public static boolean checkPin ( Context context , String pin ) { } private static final String KEY_REQUIRE_PREMISSION = "require_permission" ; public static boolean getRequirePermission ( Context context ) { } public static void setRequirePermission ( Context context , boolean require ) { } private static final String KEY_AUTOMATIC_RESPONSE = "automatic_response" ; public static final int AUTOMATIC_RESPONSE_PROMPT = 0 ; public static final int AUTOMATIC_RESPONSE_ALLOW = 1 ; public static final int AUTOMATIC_RESPONSE_DENY = 2 ; public static final int AUTOMATIC_RESPONSE_DEFAULT = Settings . AUTOMATIC_RESPONSE_PROMPT ; public static int getAutomaticResponse ( Context context ) { } public static void setAutomaticResponse ( Context context , int response ) { } public static String readFile ( String filename ) throws IOException { } public static String readFile ( File file ) throws IOException { } public static void writeFile ( File file , String string ) throws IOException { } public static void writeFile ( String file , String string ) throws IOException { } public static byte [ ] readToEndAsArray ( InputStream input ) throws IOException { } public static String readToEnd ( InputStream input ) throws IOException { } public static final int MULTIUSER_MODE_OWNER_ONLY = 0 ; public static final int MULTIUSER_MODE_OWNER_MANAGED = 1 ; public static final int MULTIUSER_MODE_USER = 2 ; public static final int MULTIUSER_MODE_NONE = 3 ; private static final String MULTIUSER_VALUE_OWNER_ONLY = "owner" ; private static final String MULTIUSER_VALUE_OWNER_MANAGED = "managed" ; private static final String MULTIUSER_VALUE_USER = "user" ; public static final int getMultiuserMode ( Context context ) { } public static void setMultiuserMode ( Context context , int mode ) { } public static final int SUPERUSER_ACCESS_DISABLED = 0 ; public static final int SUPERUSER_ACCESS_APPS_ONLY = 1 ; public static final int SUPERUSER_ACCESS_ADB_ONLY = 2 ; public static final int SUPERUSER_ACCESS_APPS_AND_ADB = 3 ; public static int getSuperuserAccess ( ) { try { Class < ? > c = Class . forName ( "android.os.SystemProperties" ) ; Method m = c . getMethod ( "get" , String . class ) ; String value = ( ( String ) ( m . invoke ( null , "persist.sys.root_access" ) ) ) ; int val = Integer . valueOf ( value ) ; switch ( val ) { case Settings . SUPERUSER_ACCESS_DISABLED : case Settings . SUPERUSER_ACCESS_APPS_ONLY : case Settings . SUPERUSER_ACCESS_ADB_ONLY : case Settings . SUPERUSER_ACCESS_APPS_AND_ADB : return val ; default : return Settings . SUPERUSER_ACCESS_DISABLED ; } } catch ( Exception e ) { <START_BUG> return Settings . SUPERUSER_ACCESS_APPS_AND_ADB ; <END_BUG> } } public static void setSuperuserAccess ( int mode ) { } private static final String CHECK_SU_QUIET = "check_su_quiet" ; public static final int getCheckSuQuietCounter ( Context context ) { } public static final void setCheckSuQuietCounter ( Context context , int counter ) { } private static final String KEY_THEME = "theme" ; public static final int THEME_LIGHT = 0 ; public static final int THEME_DARK = 1 ; public static void applyDarkThemeSetting ( Activity activity , int dark ) { } public static final int getTheme ( Context context ) { } public static final void setTheme ( Context context , int theme ) { } }

Fix:
return Settings . SUPERUSER_ACCESS_DISABLED ;