public static boolean verifyDexFileMd5(File file,String md5){
  if (file == null || md5 == null) {
    return false;
  }
  String fileMd5;
  if (isRawDexFile(file.getName())) {
    fileMd5=getMD5(file);
  }
 else {
    ZipFile dexJar=null;
    try {
      dexJar=new ZipFile(file);
      ZipEntry classesDex=dexJar.getEntry(ShareConstants.DEX_IN_JAR);
      if (null == classesDex) {
        return false;
      }
      fileMd5=getMD5(dexJar.getInputStream(classesDex));
    }
 catch (    IOException e) {
      return false;
    }
 finally {
      SharePatchFileUtil.closeZip(dexJar);
    }
  }
  return md5.equals(fileMd5);
}

public static boolean verifyDexFileMd5 ( File file , String md5 ) { if ( file == null || md5 == null ) { return false ; } String fileMd5 ; if ( isRawDexFile ( file . getName ( ) ) ) { fileMd5 = getMD5 ( file ) ; } else { ZipFile dexJar = null ; try { dexJar = new ZipFile ( file ) ; ZipEntry classesDex = dexJar . getEntry ( ShareConstants . DEX_IN_JAR ) ; if ( null == classesDex ) { return false ; } fileMd5 = getMD5 ( dexJar . getInputStream ( classesDex ) ) ; } catch ( IOException e ) { return false ; } finally { SharePatchFileUtil . closeZip ( dexJar ) ; } } return md5 . equals ( fileMd5 ) ; }
returns whether the dex file is a valid file . dex may wrap with jar
