public static CheckIN_File parseCheckIN_byPackageName(String string, int projectType) { CheckIN_File f = new CheckIN_File(); String[] lines = string.split("\n"); boolean barajRelease = true; boolean barajVersion = true; // boolean barajOrange = true; for (int i = 0; i < lines.length; i++) { String l = lines[i]; // System.out.println("line:" + lines[i]); // System.out.println("line:"+l); if (barajRelease) { if (l.contains("[release]")) { f.versionTypeRelease = "release"; barajRelease = false; // System.out.println(f.versionTypeRelease); continue; } if (l.contains("[debug]")) { barajRelease = false; f.versionTypeRelease = "debug"; // System.out.println(f.versionTypeRelease); continue; } // vvv // if (l.contains("[hisec")) { // barajRelease = false; // f.versionTypeRelease = l; // // System.out.println(f.versionTypeRelease); // continue; // } } else { if (barajVersion) { if (projectType == 1) { Pattern pattern = Pattern.compile("\\d{6}"); if (l.matches(".*\\d{6}.*")) { Matcher matcher = pattern.matcher(l); matcher.find(); String version = matcher.group(); if (version.startsWith("14")) { f.voipVersionNumber = version; f.versionNumber = version; barajVersion = false; } // System.out.println(matcher.group()); // System.out.println(matcher.replaceAll("\t")); continue; } } if (projectType == 2) { Pattern pattern = Pattern.compile("\\d{6}"); if (l.matches(".*\\d{6}.*")) { Matcher matcher = pattern.matcher(l); matcher.find(); String version = matcher.group(); if (version.startsWith("13")) { f.baseVersionNumber = version; f.versionNumber = version; barajVersion = false; } continue; // System.out.println(matcher.group()); // System.out.println(matcher.replaceAll("\t")); } } if (projectType == 3) { Pattern pattern2 = Pattern.compile("\\d{4}"); if (l.matches(".*\\d{4}.*")) { Matcher matcher2 = pattern2.matcher(l); matcher2.find(); String version = matcher2.group(); // System.out.println(matcher2.group()); if (version.startsWith("10")) { f.smsVersionNumber = version; f.versionNumber = version; barajVersion = false; } // System.out.println(matcher.group()); // System.out.println(matcher.replaceAll("\t")); continue; } } if (projectType == 4) { Pattern pattern5 = Pattern.compile("\\d{5}"); if (l.matches(".*\\d{5}.*")) { Matcher matcher = pattern5.matcher(l); matcher.find(); String version = matcher.group(); if (version.startsWith("12")) { f.versionNumber = version; System.out.println(version); } // System.out.println(matcher.group()); // System.out.println(matcher.replaceAll("\t")); continue; } } } else { // /////////// if (l.contains("[orange]")) { f.versionTypeOrange = "orange"; // System.out.println(f.versionTypeOrange); break; } if (l.contains("[red]")) { f.versionTypeOrange = "red"; // System.out.println(f.versionTypeOrange); break; } // if(!(l.contains("[red]")) && !(l.contains("[orange]")) && l.contains("[12")){ // System.out.println("aaa"+l); // } } } // if (l.contains("/sda1")) { // continue; // } // // if (l.contains("[default]")) { // f.default_bool = true; // continue; // } // // if (l.contains("[com.navayo")) { // String tmp1 = l.trim().split(" ")[l.trim().split(" ").length - // 1]; // if (f.packageName.length() > 0) { // f.packageName = tmp1.substring(1, tmp1.length() - 1) // + " ; " + f.packageName; // } else { // f.packageName = tmp1.substring(1, tmp1.length() - 1); // } // // System.out.println(f.packageName); // continue; // } // Pattern pattern1 = // Pattern.compile("\\d\\.\\d\\.\\d{4}\\.\\d{4}"); // if (l.matches(".*\\d\\.\\d\\.\\d{4}\\.\\d{4}.*")) { // // Matcher matcher1 = pattern1.matcher(l); // matcher1.find(); // String version = matcher1.group(); // //System.out.println(matcher1.group()); // if (version.startsWith("1.3")) { // f.baseONLYVersionNumber = version; // } // // System.out.println(matcher.group()); // // System.out.println(matcher.replaceAll("\t")); // continue; // } } return f; }
// by logout public static CheckIN_File parseCheckIN(String string) { CheckIN_File f = new CheckIN_File(); String[] lines = string.split("\n"); for (int i = 0; i < lines.length; i++) { String l = lines[i]; // System.out.println("line:" + lines[i]); if (l.contains("/sda1")) { continue; } if (l.contains("[default]")) { f.default_bool = true; continue; } if (l.contains("[com.navayo")) { String tmp1 = l.trim().split(" ")[l.trim().split(" ").length - 1]; if (f.packageName.length() > 0) { f.packageName = tmp1.substring(1, tmp1.length() - 1) + " ; " + f.packageName; } else { f.packageName = tmp1.substring(1, tmp1.length() - 1); } // System.out.println(f.packageName); continue; } if (l.contains("[orange]")) { if (f.versionTypeOrange.length() > 0) { if (!f.versionTypeOrange.equals("orange")) { System.out.println("KONFLIKT !!!!!!!!!!!!!!!!!"); } } f.versionTypeOrange = "orange"; // System.out.println(f.versionTypeOrange); continue; } if (l.contains("[red]")) { if (f.versionTypeOrange.length() > 0) { if (!f.versionTypeOrange.equals("red")) { System.out.println("KONFLIKT1 !!!!!!!!!!!!!!!!!"); } } f.versionTypeOrange = "red"; // System.out.println(f.versionTypeOrange); continue; } if (l.contains("[release]")) { if (f.versionTypeRelease.length() > 0) { if (!f.versionTypeRelease.equals("release")) { System.out.println("KONFLIKT2 !!!!!!!!!!!!!!!!!"); } } f.versionTypeRelease = "release"; // System.out.println(f.versionTypeRelease); continue; } if (l.contains("[debug]")) { if (f.versionTypeRelease.length() > 0) { if (!f.versionTypeRelease.equals("debug")) { System.out.println("KONFLIKT3 !!!!!!!!!!!!!!!!!"); } } f.versionTypeRelease = "debug"; // System.out.println(f.versionTypeRelease); continue; } Pattern pattern = Pattern.compile("\\d{6}"); if (l.matches(".*\\d{6}.*")) { Matcher matcher = pattern.matcher(l); matcher.find(); String version = matcher.group(); if (version.startsWith("14")) { f.voipVersionNumber = version; } if (version.startsWith("13")) { f.baseVersionNumber = version; } // System.out.println(matcher.group()); // System.out.println(matcher.replaceAll("\t")); continue; } Pattern pattern1 = Pattern.compile("\\d\\.\\d\\.\\d{4}\\.\\d{4}"); if (l.matches(".*\\d\\.\\d\\.\\d{4}\\.\\d{4}.*")) { Matcher matcher1 = pattern1.matcher(l); matcher1.find(); String version = matcher1.group(); // System.out.println(matcher1.group()); if (version.startsWith("1.3")) { f.baseONLYVersionNumber = version; } // System.out.println(matcher.group()); // System.out.println(matcher.replaceAll("\t")); continue; } Pattern pattern2 = Pattern.compile("\\d{4}"); if (l.matches(".*\\d{4}.*")) { Matcher matcher2 = pattern2.matcher(l); matcher2.find(); String version = matcher2.group(); // System.out.println(matcher2.group()); if (version.startsWith("10")) { f.smsVersionNumber = version; } // System.out.println(matcher.group()); // System.out.println(matcher.replaceAll("\t")); continue; } } return f; }