@Test public void testMethodSignature() { String sig = "([Lcom.google.Search;I)Lcom.google.Money;"; String result = Obfuscate.hashMethodSignature(sig); assertEquals("hash of " + sig + " gives " + result, result.indexOf("google"), -1); System.out.println(result); }
public static String hashMethodSignature(String signature) { SignatureParser parser = new SignatureParser(signature); StringBuilder buf = new StringBuilder("("); for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) { String param = i.next(); buf.append(hashSignature(param)); } buf.append(")"); buf.append(hashSignature(parser.getReturnTypeSignature())); return buf.toString(); }
Obfuscate { public static String hashMethodSignature(String signature) { SignatureParser parser = new SignatureParser(signature); StringBuilder buf = new StringBuilder("("); for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) { String param = i.next(); buf.append(hashSignature(param)); } buf.append(")"); buf.append(hashSignature(parser.getReturnTypeSignature())); return buf.toString(); } }
Obfuscate { public static String hashMethodSignature(String signature) { SignatureParser parser = new SignatureParser(signature); StringBuilder buf = new StringBuilder("("); for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) { String param = i.next(); buf.append(hashSignature(param)); } buf.append(")"); buf.append(hashSignature(parser.getReturnTypeSignature())); return buf.toString(); }  }
Obfuscate { public static String hashMethodSignature(String signature) { SignatureParser parser = new SignatureParser(signature); StringBuilder buf = new StringBuilder("("); for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) { String param = i.next(); buf.append(hashSignature(param)); } buf.append(")"); buf.append(hashSignature(parser.getReturnTypeSignature())); return buf.toString(); }  static String hashData(String in); static String hashFilename(String fileName); static String hashClass(@DottedClassName String className); static String hashSignature(String signature); static String hashFieldSignature(String signature); static String hashMethodSignature(String signature); static BugInstance obfuscate(BugInstance b); }
Obfuscate { public static String hashMethodSignature(String signature) { SignatureParser parser = new SignatureParser(signature); StringBuilder buf = new StringBuilder("("); for (Iterator<String> i = parser.parameterSignatureIterator(); i.hasNext();) { String param = i.next(); buf.append(hashSignature(param)); } buf.append(")"); buf.append(hashSignature(parser.getReturnTypeSignature())); return buf.toString(); }  static String hashData(String in); static String hashFilename(String fileName); static String hashClass(@DottedClassName String className); static String hashSignature(String signature); static String hashFieldSignature(String signature); static String hashMethodSignature(String signature); static BugInstance obfuscate(BugInstance b);  }