String dexFile = args[0]; String pattern = args[1]; Dex dex = new Dex(new File(dexFile)); int count = new Grep(dex, Pattern.compile(pattern), new PrintWriter(System.out)).grep(); System.exit((count > 0) ? 0 : 1);