Package proguard.io.util
Class IOUtil
java.lang.Object
proguard.io.util.IOUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassPoolReads the classes from the specified jar file and returns them as a class pool.static ClassPoolReads the classes from the specified jar file and returns them as a class pool.static ClassPoolread(File file, boolean isLibrary, boolean initializeKotlinMetadata, BiFunction<DataEntryReader, ClassVisitor, DataEntryReader> extraDataEntryReader) Reads the classes from the specified jar file and returns them as a class pool.static ClassPoolReads the classes from the specified jar file and returns them as a class pool.static ClassPoolReads the classes from the specified jar file and returns them as a class pool.static ClassPoolread(ClassPath classPath, String classNameFilter, boolean android, boolean isLibrary, boolean initializeKotlinMetadata, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, BiFunction<DataEntryReader, ClassVisitor, DataEntryReader> extraDataEntryReader) static ClassPoolread(ClassPath classPath, String classNameFilter, boolean android, boolean isLibrary, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, BiFunction<DataEntryReader, ClassVisitor, DataEntryReader> extraDataEntryReader) Reads the classes from the specified jar file and returns them as a class pool.static voidWrites the classes from the given class pool to a specified jar.static voidWrites the classes from the given class pool to a specified jar.
-
Method Details
-
read
Reads the classes from the specified jar file and returns them as a class pool.- Parameters:
fileName- the file name.isLibrary- specifies whether classes should be represented as ProgramClass instances (for processing) or LibraryClass instances (more compact).- Returns:
- a new class pool with the read classes.
- Throws:
IOException
-
read
public static ClassPool read(String fileName, boolean isLibrary, boolean initializeKotlinMetadata) throws IOException Reads the classes from the specified jar file and returns them as a class pool.- Parameters:
fileName- the file name.isLibrary- specifies whether classes should be represented as ProgramClass instances (for processing) or LibraryClass instances (more compact).initializeKotlinMetadata- specifies to initialize the Kotlin metadata model.- Returns:
- a new class pool with the read classes.
- Throws:
IOException
-
read
Reads the classes from the specified jar file and returns them as a class pool.- Parameters:
file- the file.isLibrary- specifies whether classes should be represented as ProgramClass instances (for processing) or LibraryClass instances (more compact).- Returns:
- a new class pool with the read classes.
- Throws:
IOException
-
read
public static ClassPool read(File file, boolean isLibrary, boolean initializeKotlinMetadata) throws IOException Reads the classes from the specified jar file and returns them as a class pool.- Parameters:
file- the file.isLibrary- specifies whether classes should be represented as ProgramClass instances (for processing) or LibraryClass instances (more compact).initializeKotlinMetadata- specifies to initialize the Kotlin metadata model.- Returns:
- a new class pool with the read classes.
- Throws:
IOException
-
read
public static ClassPool read(File file, boolean isLibrary, boolean initializeKotlinMetadata, BiFunction<DataEntryReader, ClassVisitor, throws IOExceptionDataEntryReader> extraDataEntryReader) Reads the classes from the specified jar file and returns them as a class pool.- Parameters:
file- the name of the file.isLibrary- specifies whether classes should be represented as ProgramClass instances (for processing) or LibraryClass instances (more compact).initializeKotlinMetadata- specifies to initialize the Kotlin metadata model.extraDataEntryReader- Optionally provide a function that wraps the reader in another reader.- Returns:
- a new class pool with the read classes.
- Throws:
IOException
-
read
public static ClassPool read(ClassPath classPath, String classNameFilter, boolean android, boolean isLibrary, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, BiFunction<DataEntryReader, ClassVisitor, throws IOExceptionDataEntryReader> extraDataEntryReader) Reads the classes from the specified jar file and returns them as a class pool.- Parameters:
isLibrary- specifies whether classes should be represented as ProgramClass instances (for processing) or LibraryClass instances (more compact).extraDataEntryReader- Optionally provide a function that wraps the reader in another reader.- Returns:
- a new class pool with the read classes.
- Throws:
IOException
-
read
public static ClassPool read(ClassPath classPath, String classNameFilter, boolean android, boolean isLibrary, boolean initializeKotlinMetadata, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, BiFunction<DataEntryReader, ClassVisitor, throws IOExceptionDataEntryReader> extraDataEntryReader) - Throws:
IOException
-
writeJar
public static void writeJar(ClassPool programClassPool, String outputJarFileName) throws IOException Writes the classes from the given class pool to a specified jar.- Parameters:
programClassPool- the classes to write.outputJarFileName- the name of the output jar file.- Throws:
IOException
-
writeJar
public static void writeJar(ClassPool programClassPool, String outputJarFileName, String mainClassName) throws IOException Writes the classes from the given class pool to a specified jar.- Parameters:
programClassPool- the classes to write.outputJarFileName- the name of the output jar file.- Throws:
IOException
-