public class DexPrinter
extends java.lang.Object
Creates apk or jar file with compiled dex classes.
Main entry point for the "dex" output format.
Use add(SootClass) to add classes that should be printed as dex
output and print() to finally print the classes.
If the printer has found the original APK of an added class (via
SourceLocator.dexClassIndex()), the files in the APK are
copied to a new one, replacing it's classes.dex and excluding the
signature files. Note that you have to sign and align the APK yourself, with
jarsigner and zipalign, respectively.
If Options#output_jar flag is set, the printer produces JAR
file.
If there is no original APK and Options#output_jar flag is
not set the printer just emits a classes.dex.
| Modifier and Type | Field and Description |
|---|---|
protected MultiDexBuilder |
dexBuilder |
protected java.io.File |
originalApk |
static java.util.regex.Pattern |
SIGNATURE_FILE_PATTERN |
| Constructor and Description |
|---|
DexPrinter() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(SootClass c) |
protected MultiDexBuilder |
createDexBuilder()
Creates the
MultiDexBuilder that shall be used for creating
potentially multiple dex files. |
void |
print() |
protected static FieldReference |
toFieldReference(SootField f) |
protected static FieldReference |
toFieldReference(SootFieldRef ref) |
protected static MethodReference |
toMethodReference(SootMethodRef m) |
protected static TypeReference |
toTypeReference(Type t) |
public static final java.util.regex.Pattern SIGNATURE_FILE_PATTERN
protected MultiDexBuilder dexBuilder
protected java.io.File originalApk
protected MultiDexBuilder createDexBuilder()
MultiDexBuilder that shall be used for creating
potentially multiple dex files. This method makes sure that users of Soot can
overwrite the MultiDexBuilder with custom strategies.MultiDexBuilderprotected static FieldReference toFieldReference(SootField f)
protected static FieldReference toFieldReference(SootFieldRef ref)
protected static MethodReference toMethodReference(SootMethodRef m)
protected static TypeReference toTypeReference(Type t)
public void add(SootClass c)
public void print()