public class JarUtils
extends java.lang.Object
| Constructor and Description | 
|---|
JarUtils()  | 
| Modifier and Type | Method and Description | 
|---|---|
static byte[] | 
getBytes(java.io.InputStream is)
Reads an InputStream and returns the read byte[] 
 | 
static org.objectweb.asm.tree.ClassNode | 
getNode(byte[] bytez)
Creates a new ClassNode instances from the provided byte[] 
 | 
static void | 
loadResources(java.io.File zipFile)
Loads resources only, just for .APK 
 | 
static void | 
put(java.io.File jarFile,
   java.util.HashMap<java.lang.String,org.objectweb.asm.tree.ClassNode> clazzList)
Loads the classes and resources from the input jar file 
 | 
static void | 
saveAsJar(java.util.ArrayList<org.objectweb.asm.tree.ClassNode> nodeList,
         java.lang.String path)
Saves a jar without the manifest 
 | 
static void | 
saveAsJar(java.util.ArrayList<org.objectweb.asm.tree.ClassNode> nodeList,
         java.lang.String path,
         java.lang.String manifest)
Saves as jar with manifest 
 | 
public static void put(java.io.File jarFile,
                       java.util.HashMap<java.lang.String,org.objectweb.asm.tree.ClassNode> clazzList)
                throws java.io.IOException
jarFile - the input jar fileclazzList - the existing map of loaded classesjava.io.IOExceptionpublic static void loadResources(java.io.File zipFile)
                          throws java.io.IOException
zipFile - the input zip filejava.io.IOExceptionpublic static byte[] getBytes(java.io.InputStream is)
                       throws java.io.IOException
the - InputStreamjava.io.IOExceptionpublic static org.objectweb.asm.tree.ClassNode getNode(byte[] bytez)
bytez - the class file's byte[]public static void saveAsJar(java.util.ArrayList<org.objectweb.asm.tree.ClassNode> nodeList,
                             java.lang.String path,
                             java.lang.String manifest)
nodeList - the loaded ClassNodespath - the exact path of the output jar filemanifest - the manifest contentspublic static void saveAsJar(java.util.ArrayList<org.objectweb.asm.tree.ClassNode> nodeList,
                             java.lang.String path)
nodeList - The loaded ClassNodespath - the exact jar output path