use of android.aapt.pb.internal.ResourcesInternal.CompiledFile in project atlas by alibaba.
the class ApkFileListUtils method getCompiledFileMd5.
private static String getCompiledFileMd5(File file) {
String md5;
try (InputStream is = new BufferedInputStream(new FileInputStream(file))) {
CodedInputStream codedInputStream = CodedInputStream.newInstance(is);
int numFiles = codedInputStream.readRawLittleEndian32();
// Preconditions.checkState(numFiles == 1, "inline xml not implemented yet");
long pbSize = codedInputStream.readRawLittleEndian64();
codedInputStream.pushLimit((int) pbSize);
CompiledFile compiledFile = CompiledFile.parser().parsePartialFrom(codedInputStream);
md5 = MD5Util.getFileMD5(compiledFile.getSourcePath());
// codedInputStream.pushLimit(0);
return md5;
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
Aggregations