示例#1
0
 public static void doGetIMEI() throws Exception {
   X10flash f = null;
   try {
     Bundle b = new Bundle();
     b.setSimulate(false);
     f = new X10flash(b);
     MyLogger.getLogger().info("Please connect your phone in flash mode");
     while (!f.deviceFound()) ;
     f.openDevice(false);
     MyLogger.getLogger().info("IMEI : " + f.getPhoneProperty("IMEI"));
     f.closeDevice();
     exit();
   } catch (Exception e) {
     if (f != null) f.closeDevice();
     throw e;
   }
 }
示例#2
0
 public static void doFlash(
     String file,
     boolean wipedata,
     boolean wipecache,
     boolean excludebb,
     boolean excludekrnl,
     boolean excludesys)
     throws Exception {
   X10flash f = null;
   try {
     File bf = new File(file);
     if (!bf.exists()) {
       MyLogger.getLogger().error("File " + bf.getAbsolutePath() + " does not exist");
       exit();
     }
     MyLogger.getLogger().info("Choosed " + bf.getAbsolutePath());
     Bundle b = new Bundle(bf.getAbsolutePath(), Bundle.JARTYPE);
     b.setSimulate(false);
     b.getMeta().setCategEnabled("DATA", wipedata);
     b.getMeta().setCategEnabled("CACHE", wipecache);
     b.getMeta().setCategEnabled("BASEBAND", excludebb);
     b.getMeta().setCategEnabled("SYSTEM", excludesys);
     b.getMeta().setCategEnabled("KERNEL", excludekrnl);
     MyLogger.getLogger().info("Preparing files for flashing");
     b.open();
     f = new X10flash(b);
     MyLogger.getLogger().info("Please connect your phone in flash mode");
     while (!f.deviceFound()) ;
     f.openDevice(false);
     f.flashDevice();
     b.close();
     exit();
   } catch (Exception e) {
     if (f != null) f.closeDevice();
     throw e;
   }
 }