diff options
-rw-r--r-- | tools/dexdeps/src/com/android/dexdeps/DexData.java | 10 | ||||
-rw-r--r-- | tools/dexdeps/src/com/android/dexdeps/Main.java | 9 | ||||
-rw-r--r-- | tools/dexdeps/src/com/android/dexdeps/Output.java | 12 |
3 files changed, 23 insertions, 8 deletions
diff --git a/tools/dexdeps/src/com/android/dexdeps/DexData.java b/tools/dexdeps/src/com/android/dexdeps/DexData.java index 89dff182a..d55c4b673 100644 --- a/tools/dexdeps/src/com/android/dexdeps/DexData.java +++ b/tools/dexdeps/src/com/android/dexdeps/DexData.java @@ -49,7 +49,7 @@ public class DexData { * @throws IOException if we encounter a problem while reading * @throws DexDataException if the DEX contents look bad */ - public void load() throws IOException { + public void load(boolean includeCMClasses) throws IOException { parseHeaderItem(); loadStrings(); @@ -59,7 +59,7 @@ public class DexData { loadMethodIds(); loadClassDefs(); - markInternalClasses(); + markInternalClasses(includeCMClasses); } /** @@ -288,7 +288,7 @@ public class DexData { * Sets the "internal" flag on type IDs which are defined in the * DEX file or within the VM (e.g. primitive classes and arrays). */ - void markInternalClasses() { + void markInternalClasses(boolean includeCMClasses) { for (int i = mClassDefs.length -1; i >= 0; i--) { mTypeIds[mClassDefs[i].classIdx].internal = true; } @@ -296,6 +296,10 @@ public class DexData { for (int i = 0; i < mTypeIds.length; i++) { String className = mStrings[mTypeIds[i].descriptorIdx]; + if (includeCMClasses && className.startsWith("Lcyanogenmod")) { + mTypeIds[i].internal = false; + continue; + } if (className.length() == 1) { // primitive class mTypeIds[i].internal = true; diff --git a/tools/dexdeps/src/com/android/dexdeps/Main.java b/tools/dexdeps/src/com/android/dexdeps/Main.java index 410694aee..09afec064 100644 --- a/tools/dexdeps/src/com/android/dexdeps/Main.java +++ b/tools/dexdeps/src/com/android/dexdeps/Main.java @@ -39,6 +39,11 @@ public class Main { private boolean mJustClasses = false; /** + * Whether to include "cyanogenmod" namespace classes in the dump. + */ + private boolean mIncludeCMClasses = false; + + /** * Entry point. */ public static void main(String[] args) { @@ -57,7 +62,7 @@ public class Main { for (String fileName : mInputFileNames) { RandomAccessFile raf = openInputFile(fileName); DexData dexData = new DexData(raf); - dexData.load(); + dexData.load(mIncludeCMClasses); if (first) { first = false; @@ -200,6 +205,8 @@ public class Main { //System.out.println("+++ using format " + mOutputFormat); } else if (arg.equals("--just-classes")) { mJustClasses = true; + } else if (arg.equals("--include-cm-classes")) { + mIncludeCMClasses = true; } else { System.err.println("Unknown option '" + arg + "'"); throw new UsageException(); diff --git a/tools/dexdeps/src/com/android/dexdeps/Output.java b/tools/dexdeps/src/com/android/dexdeps/Output.java index dbe3bc2da..40e2592da 100644 --- a/tools/dexdeps/src/com/android/dexdeps/Output.java +++ b/tools/dexdeps/src/com/android/dexdeps/Output.java @@ -216,9 +216,11 @@ public class Output { out.println(IN3 + "<constructor name=\"" + classNameOnly(declClassName) + "\">"); } else { - out.println(IN3 + "<method name=\"" + mref.getName() + - "\" return=\"" + descriptorToDot(mref.getReturnTypeName()) + - "\">"); + if (!mref.getName().equals("<clinit>")) { + out.println(IN3 + "<method name=\"" + mref.getName() + + "\" return=\"" + descriptorToDot(mref.getReturnTypeName()) + + "\">"); + } } String[] args = mref.getArgumentTypeNames(); for (int j = 0; j < args.length; j++) { @@ -228,7 +230,9 @@ public class Output { if (constructor) { out.println(IN3 + "</constructor>"); } else { - out.println(IN3 + "</method>"); + if (!mref.getName().equals("<clinit>")) { + out.println(IN3 + "</method>"); + } } } } |