com.googlecode.d2j.reader.zip.ZipUtil.readDex()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中com.googlecode.d2j.reader.zip.ZipUtil.readDex()方法的一些代码示例,展示了ZipUtil.readDex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipUtil.readDex()方法的具体详情如下:
包路径:com.googlecode.d2j.reader.zip.ZipUtil
类名称:ZipUtil
方法名:readDex

ZipUtil.readDex介绍

[英]read the dex file from file, if the file is a zip file, it will return the content of classes.dex in the zip file.
[中]从文件中读取dex文件,如果该文件是zip文件,它将返回类的内容。zip文件中的dex。

代码示例

代码示例来源:origin: pxb1988/dex2jar

/**
 * read the dex file from file, if the file is a zip file, it will return the content of classes.dex in the zip
 * file.
 * 
 * @param file
 * @return
 * @throws IOException
 */
public static byte[] readDex(File file) throws IOException {
  return readDex(file.toPath());
}

代码示例来源:origin: pxb1988/dex2jar

public static byte[] readDex(Path file) throws IOException {
  return readDex(Files.readAllBytes(file));
}

代码示例来源:origin: pxb1988/dex2jar

public static Baksmali from(Path in) throws IOException {
  return from(ZipUtil.readDex(in));
}

代码示例来源:origin: pxb1988/dex2jar

public static void doFile(Path srcDex, Path dest) throws IOException {
  doData(ZipUtil.readDex(srcDex), dest);
}

代码示例来源:origin: pxb1988/dex2jar

public static Baksmali from(File in) throws IOException {
  return from(ZipUtil.readDex(in));
}

代码示例来源:origin: pxb1988/dex2jar

public static byte[] readDex(InputStream in) throws IOException {
  return readDex(toByteArray(in));
}

代码示例来源:origin: pxb1988/dex2jar

public static Baksmali from(InputStream in) throws IOException {
  return from(ZipUtil.readDex(in));
}

代码示例来源:origin: pxb1988/dex2jar

public static Dex2jar from(byte[] in) throws IOException {
  return from(new DexFileReader(ZipUtil.readDex(in)));
}

代码示例来源:origin: pxb1988/dex2jar

Map<String, DexClassNode> readDex(File path) throws IOException {
  DexFileReader dexFileReader = new DexFileReader(ZipUtil.readDex(path));
  DexFileNode dexFileNode = new DexFileNode();
  dexFileReader.accept(dexFileNode);
  Map<String, DexClassNode> map = new HashMap<>();
  for (DexClassNode c : dexFileNode.clzs) {
    map.put(c.className, c);
  }
  return map;
}

代码示例来源:origin: pxb1988/dex2jar

byte[] data = ZipUtil.readDex(new File(f).toPath());
DexFileReader r = new DexFileReader(data);
r.accept(fv);
byte[] data = ZipUtil.readDex(stub);
DexFileReader r = new DexFileReader(data);
r.accept(new DexFileVisitor(out) {

代码示例来源:origin: pxb1988/dex2jar

private DexFileNode readDex(Path f) {
  DexFileNode fileNode = new DexFileNode();
  DexFileReader reader = null;
  try {
    reader = new DexFileReader(ZipUtil.readDex(f));
  } catch (IOException e) {
    throw new RuntimeException("Fail to read dex:" + f);
  }
  reader.accept(fileNode);
  return fileNode;
}

代码示例来源:origin: SparkInLee/dexdiff

/**
 * read the dex file from file, if the file is a zip file, it will return the content of classes.dex in the zip
 * file.
 * 
 * @param file
 * @return
 * @throws IOException
 */
public static byte[] readDex(File file) throws IOException {
  return readDex(file.toPath());
}

代码示例来源:origin: SparkInLee/dexdiff

public static byte[] readDex(Path file) throws IOException {
  return readDex(Files.readAllBytes(file));
}

代码示例来源:origin: SparkInLee/dexdiff

public static void doFile(Path srcDex, Path dest) throws IOException {
  doData(ZipUtil.readDex(srcDex), dest);
}

代码示例来源:origin: SparkInLee/dexdiff

public static byte[] readDex(InputStream in) throws IOException {
  return readDex(toByteArray(in));
}

相关文章