获取build.prop中的指定属性

来源:互联网 发布:php在线调试工具 编辑:程序博客网 时间:2024/06/06 15:54
  // 获取build.prop中的指定属性     public static String GetBuildProproperties(String PropertiesName) {         try    {            InputStream is = new BufferedInputStream(new FileInputStream(new File("/system/build.prop")));      BufferedReader br = new BufferedReader(new InputStreamReader(is));        String strTemp = "";            while ((strTemp = br.readLine()) != null)          {// 如果文件没有读完则继续               if (strTemp.indexOf(PropertiesName) != -1)        return strTemp.substring(strTemp.indexOf("=") + 1);           }          br.close();           is.close();             return null;        }catch (Exception e){         if (e.getMessage() != null)      System.out.println( e.getMessage());          else               e.printStackTrace();         return null;        }     } 

原创粉丝点击