DexBackedOdexFile odexFile = DexBackedOdexFile.fromInputStream(opcodes, inputStream); return new SingletonMultiDexContainer(file.getPath(), odexFile); } catch (DexBackedOdexFile.NotAnOdexFile ex) {
@Override protected BaksmaliOptions getOptions() { BaksmaliOptions options = super.getOptions(); options.deodex = true; if (dexFile instanceof DexBackedOdexFile) { if (inlineTable == null) { options.inlineResolver = InlineMethodResolver.createInlineMethodResolver( ((DexBackedOdexFile)dexFile).getOdexVersion()); } else { File inlineTableFile = new File(inlineTable); if (!inlineTableFile.exists()) { System.err.println(String.format("Could not find file: %s", inlineTable)); System.exit(-1); } try { options.inlineResolver = new CustomInlineMethodResolver(options.classPath, inlineTableFile); } catch (IOException ex) { System.err.println(String.format("Error while reading file: %s", inlineTableFile)); ex.printStackTrace(System.err); System.exit(-1); } } } return options; }
@Nonnull public static DexBackedOdexFile fromInputStream(@Nonnull Opcodes opcodes, @Nonnull InputStream is) throws IOException { DexUtil.verifyOdexHeader(is); is.reset(); byte[] odexBuf = new byte[OdexHeaderItem.ITEM_SIZE]; ByteStreams.readFully(is, odexBuf); int dexOffset = OdexHeaderItem.getDexOffset(odexBuf); if (dexOffset > OdexHeaderItem.ITEM_SIZE) { ByteStreams.skipFully(is, dexOffset - OdexHeaderItem.ITEM_SIZE); } byte[] dexBuf = ByteStreams.toByteArray(is); return new DexBackedOdexFile(opcodes, odexBuf, dexBuf); }
DexBackedOdexFile odexFile = DexBackedOdexFile.fromInputStream(Opcodes.getDefault(), inputStream); for (String entry: odexFile.getDependencies()) { System.out.println(entry);
options.bootClassPathEntries = ((DexBackedOdexFile)dexFile).getDependencies(); } else { options.bootClassPathEntries = getDefaultBootClassPathForApi(options.apiLevel); InlineMethodResolver.createInlineMethodResolver(((DexBackedOdexFile)dexFile).getOdexVersion());
return ((DexBackedOdexFile)dexFile).getDependencies();
public static DexBackedOdexFile fromInputStream(@Nonnull Opcodes opcodes, @Nonnull InputStream is) throws IOException { if (!is.markSupported()) { throw new IllegalArgumentException("InputStream must support mark"); } is.mark(8); byte[] partialHeader = new byte[8]; try { ByteStreams.readFully(is, partialHeader); } catch (EOFException ex) { throw new NotADexFile("File is too short"); } finally { is.reset(); } verifyMagic(partialHeader); is.reset(); byte[] odexBuf = new byte[OdexHeaderItem.ITEM_SIZE]; ByteStreams.readFully(is, odexBuf); int dexOffset = OdexHeaderItem.getDexOffset(odexBuf); if (dexOffset > OdexHeaderItem.ITEM_SIZE) { ByteStreams.skipFully(is, dexOffset - OdexHeaderItem.ITEM_SIZE); } byte[] dexBuf = ByteStreams.toByteArray(is); return new DexBackedOdexFile(opcodes, odexBuf, dexBuf); }
public List<String> getDependencies() { if (this.getReader() == null) { final int dexOffset = OdexHeaderItem.getDexOffset(odexBuf); final int dependencyOffset = OdexHeaderItem
DexBackedOdexFile odexFile = DexBackedOdexFile.fromInputStream(Opcodes.getDefault(), inputStream); for (String entry: odexFile.getDependencies()) { System.out.println(entry);
return ((DexBackedOdexFile)dexFile).getDependencies();
return DexBackedOdexFile.fromInputStream(opcodes, inputStream); } catch (DexBackedOdexFile.NotAnOdexFile ex) {
@Override public void deOdex(DexFile parentFile, Method method, ClassPath cp) { if (!(parentFile instanceof DexBackedOdexFile)) { throw new RuntimeException("ODEX instruction in non-ODEX file"); } DexBackedOdexFile odexFile = (DexBackedOdexFile) parentFile; InlineMethodResolver inlineMethodResolver = InlineMethodResolver.createInlineMethodResolver(odexFile.getOdexVersion()); MethodAnalyzer analyzer = new MethodAnalyzer(cp, method, inlineMethodResolver, false); targetMethod = inlineMethodResolver.resolveExecuteInline(new AnalyzedInstruction(analyzer, instruction, -1, -1)); }
@Nonnull public static DexBackedOdexFile fromInputStream(@Nonnull Opcodes opcodes, @Nonnull InputStream is) throws IOException { DexUtil.verifyOdexHeader(is); is.reset(); byte[] odexBuf = new byte[OdexHeaderItem.ITEM_SIZE]; ByteStreams.readFully(is, odexBuf); int dexOffset = OdexHeaderItem.getDexOffset(odexBuf); if (dexOffset > OdexHeaderItem.ITEM_SIZE) { ByteStreams.skipFully(is, dexOffset - OdexHeaderItem.ITEM_SIZE); } byte[] dexBuf = ByteStreams.toByteArray(is); return new DexBackedOdexFile(opcodes, odexBuf, dexBuf); }
return DexBackedOdexFile.fromInputStream(opcodes, inputStream); } catch (DexBackedOdexFile.NotAnOdexFile ex) {
InlineMethodResolver.createInlineMethodResolver(((DexBackedOdexFile)dexFile).getOdexVersion());
return DexBackedOdexFile.fromInputStream(opcodes, inputStream); } catch (DexBackedOdexFile.NotAnOdexFile ex) {
@Override protected BaksmaliOptions getOptions() { BaksmaliOptions options = super.getOptions(); options.deodex = true; if (dexFile instanceof DexBackedOdexFile) { if (inlineTable == null) { options.inlineResolver = InlineMethodResolver.createInlineMethodResolver( ((DexBackedOdexFile)dexFile).getOdexVersion()); } else { File inlineTableFile = new File(inlineTable); if (!inlineTableFile.exists()) { System.err.println(String.format("Could not find file: %s", inlineTable)); System.exit(-1); } try { options.inlineResolver = new CustomInlineMethodResolver(options.classPath, inlineTableFile); } catch (IOException ex) { System.err.println(String.format("Error while reading file: %s", inlineTableFile)); ex.printStackTrace(System.err); System.exit(-1); } } } return options; }
DexBackedOdexFile odexFile = DexBackedOdexFile.fromInputStream(opcodes, inputStream); return new SingletonMultiDexContainer(file.getPath(), odexFile); } catch (DexBackedOdexFile.NotAnOdexFile ex) {