Package soot.asm
Class AsmUtil
- java.lang.Object
-
- soot.asm.AsmUtil
-
public class AsmUtil extends Object
- Author:
- eric
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbaseTypeName(String s)strips suffix for indicating an array typestatic intbyteCodeToJavaVersion(int bytecodeVersion)static StringgetTrueClassName(String cls)Returns the true file name of a given class filestatic StringgetTrueClassName(IFoundFile file, String cls)Returns the true file name of a given class filestatic booleanisDWord(Type type)Determines if a type is a dword type.static intjavaToBytecodeVersion(int javaVersion)static Type[]jimpleTypesOfFieldOrMethodDescriptor(String descriptor)static StringremoveWebPaths(String cls)static TypetoBaseType(String internal, com.google.common.base.Optional<String> moduleName)Converts an internal class name to a Type.static StringtoInternalName(String qual)Converts a fully qualified class name to an internal name.static StringtoInternalName(SootClass cls)Determines and returns the internal name of a class.static List<Type>toJimpleDesc(String desc, com.google.common.base.Optional<String> moduleName)Converts a method signature to a list of types, with the last entry in the returned list denoting the return type.static TypetoJimpleRefType(String desc, com.google.common.base.Optional<String> moduleName)Converts a type descriptor to a Jimple reference type.static TypetoJimpleType(String desc, com.google.common.base.Optional<String> moduleName)Converts a type descriptor to a Jimple type.static StringtoQualifiedName(String internal)Converts an internal class name to a fully qualified name.static byte[]toUtf8(String s)Utility method; converts the given String into a utf8 encoded array of bytes.
-
-
-
Method Detail
-
isDWord
public static boolean isDWord(Type type)
Determines if a type is a dword type.- Parameters:
type- the type to check.- Returns:
trueif its a dword type.
-
toBaseType
public static Type toBaseType(String internal, com.google.common.base.Optional<String> moduleName)
Converts an internal class name to a Type.- Parameters:
internal- internal name.- Returns:
- type
-
toQualifiedName
public static String toQualifiedName(String internal)
Converts an internal class name to a fully qualified name.- Parameters:
internal- internal name.- Returns:
- fully qualified name.
-
toInternalName
public static String toInternalName(String qual)
Converts a fully qualified class name to an internal name.- Parameters:
qual- fully qualified class name.- Returns:
- internal name.
-
toInternalName
public static String toInternalName(SootClass cls)
Determines and returns the internal name of a class.- Parameters:
cls- the class.- Returns:
- corresponding internal name.
-
toJimpleRefType
public static Type toJimpleRefType(String desc, com.google.common.base.Optional<String> moduleName)
Converts a type descriptor to a Jimple reference type.- Parameters:
desc- the descriptor.- Returns:
- the reference type.
-
toJimpleType
public static Type toJimpleType(String desc, com.google.common.base.Optional<String> moduleName)
Converts a type descriptor to a Jimple type.- Parameters:
desc- the descriptor.- Returns:
- equivalent Jimple type.
-
toJimpleDesc
public static List<Type> toJimpleDesc(String desc, com.google.common.base.Optional<String> moduleName)
Converts a method signature to a list of types, with the last entry in the returned list denoting the return type.- Parameters:
desc- method signature.- Returns:
- list of types.
-
baseTypeName
public static String baseTypeName(String s)
strips suffix for indicating an array type
-
byteCodeToJavaVersion
public static int byteCodeToJavaVersion(int bytecodeVersion)
-
javaToBytecodeVersion
public static int javaToBytecodeVersion(int javaVersion)
-
jimpleTypesOfFieldOrMethodDescriptor
public static Type[] jimpleTypesOfFieldOrMethodDescriptor(String descriptor)
-
toUtf8
public static byte[] toUtf8(String s)
Utility method; converts the given String into a utf8 encoded array of bytes.- Parameters:
s- String to encode.- Returns:
- array of bytes, utf8 encoded version of s.
-
getTrueClassName
public static String getTrueClassName(IFoundFile file, String cls)
Returns the true file name of a given class file- Parameters:
file- the file (may be null)cls- the class- Returns:
- the true class name
-
getTrueClassName
public static String getTrueClassName(String cls)
Returns the true file name of a given class file- Parameters:
cls- the class- Returns:
- the true class name
-
-