Package org.jf.dexlib2.dexbacked
Class ZipDexContainer
- java.lang.Object
-
- org.jf.dexlib2.dexbacked.ZipDexContainer
-
- All Implemented Interfaces:
MultiDexContainer<DexBackedDexFile>
public class ZipDexContainer extends java.lang.Object implements MultiDexContainer<DexBackedDexFile>
Represents a zip file that contains dex files (i.e. an apk or jar file)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZipDexContainer.NotAZipFileException
-
Nested classes/interfaces inherited from interface org.jf.dexlib2.iface.MultiDexContainer
MultiDexContainer.DexEntry<T extends DexFile>
-
-
Constructor Summary
Constructors Constructor Description ZipDexContainer(java.io.File zipFilePath, Opcodes opcodes)
Constructs a new ZipDexContainer for the given zip file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getDexEntryNames()
Gets a list of the names of dex files in this zip file.MultiDexContainer.DexEntry<DexBackedDexFile>
getEntry(java.lang.String entryName)
Loads a dex file from a specific named entry.protected java.util.zip.ZipFile
getZipFile()
protected boolean
isDex(java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry zipEntry)
boolean
isZipFile()
protected MultiDexContainer.DexEntry
loadEntry(java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry zipEntry)
-
-
-
Constructor Detail
-
ZipDexContainer
public ZipDexContainer(@Nonnull java.io.File zipFilePath, @Nullable Opcodes opcodes)
Constructs a new ZipDexContainer for the given zip file- Parameters:
zipFilePath
- The path to the zip file
-
-
Method Detail
-
getDexEntryNames
@Nonnull public java.util.List<java.lang.String> getDexEntryNames() throws java.io.IOException
Gets a list of the names of dex files in this zip file.- Specified by:
getDexEntryNames
in interfaceMultiDexContainer<DexBackedDexFile>
- Returns:
- A list of the names of dex files in this zip file
- Throws:
java.io.IOException
-
getEntry
@Nullable public MultiDexContainer.DexEntry<DexBackedDexFile> getEntry(@Nonnull java.lang.String entryName) throws java.io.IOException
Loads a dex file from a specific named entry.- Specified by:
getEntry
in interfaceMultiDexContainer<DexBackedDexFile>
- Parameters:
entryName
- The name of the entry- Returns:
- A ZipDexFile, or null if there is no entry with the given name
- Throws:
DexBackedDexFile.NotADexFile
- If the entry isn't a dex filejava.io.IOException
-
isZipFile
public boolean isZipFile()
-
isDex
protected boolean isDex(@Nonnull java.util.zip.ZipFile zipFile, @Nonnull java.util.zip.ZipEntry zipEntry) throws java.io.IOException
- Throws:
java.io.IOException
-
getZipFile
protected java.util.zip.ZipFile getZipFile() throws java.io.IOException
- Throws:
java.io.IOException
-
loadEntry
@Nonnull protected MultiDexContainer.DexEntry loadEntry(@Nonnull java.util.zip.ZipFile zipFile, @Nonnull java.util.zip.ZipEntry zipEntry) throws java.io.IOException
- Throws:
java.io.IOException
-
-