Package io.github.neonorbit.dexplore
Class DexFactory
- java.lang.Object
-
- io.github.neonorbit.dexplore.DexFactory
-
public final class DexFactory extends java.lang.Object
A factory class for loading dex files.Supported types: apk, zip, dex, odex, oat
Available methods: Note: TheDexplore
instances created by this class are thread-safe.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description DexFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Dexplore
load(byte[] buffer)
Loads a dex or odex file from memory.static Dexplore
load(byte[] buffer, DexOptions options)
Loads a dex or odex file from memory.static Dexplore
load(java.lang.String path)
Loads a file containing one or more dex files.static Dexplore
load(java.lang.String path, DexOptions options)
Loads a file containing one or more dex files.
-
-
-
Method Detail
-
load
@Nonnull public static Dexplore load(@Nonnull java.lang.String path)
Loads a file containing one or more dex files.Note: The returned instance is thread-safe.
See also:load(String, DexOptions)
- Parameters:
path
- the path of the file to open- Returns:
- A
Dexplore
for the given file - Throws:
DexException
- if something goes wrongFileNotFoundException
- if the given file does not existUnsupportedFileException
- if the given file is not a valid dex file
-
load
@Nonnull public static Dexplore load(@Nonnull java.lang.String path, @Nonnull DexOptions options)
Loads a file containing one or more dex files.Note: The returned instance is thread-safe.
See also:load(String)
- Parameters:
path
- the path of the file to openoptions
- a set of options to apply- Returns:
- A
Dexplore
for the given file - Throws:
DexException
- if something goes wrongFileNotFoundException
- if the given file does not existUnsupportedFileException
- if the given file is not a valid dex file
-
load
@Nonnull public static Dexplore load(@Nonnull byte[] buffer)
Loads a dex or odex file from memory.Note: The returned instance is thread-safe.
See also:load(byte[], DexOptions)
- Parameters:
buffer
- a byte array containing the dex file- Returns:
- A
Dexplore
instance for the given file - Throws:
UnsupportedFileException
- if the given file is not a valid dex file
-
load
@Nonnull public static Dexplore load(@Nonnull byte[] buffer, @Nonnull DexOptions options)
Loads a dex or odex file from memory.Note: The returned instance is thread-safe.
See also:load(byte[])
- Parameters:
buffer
- a byte array containing the dex fileoptions
- a set of dex options to apply- Returns:
- A
Dexplore
instance for the given file - Throws:
UnsupportedFileException
- if the given file is not a valid dex file
-
-