diff options
author | Benoit Lamarche <benoitlamarche@google.com> | 2015-07-20 15:18:46 +0200 |
---|---|---|
committer | Benoit Lamarche <benoitlamarche@google.com> | 2015-07-20 17:05:16 +0200 |
commit | 4f813952709a38ad4bb22323d84b9ed887a6e36f (patch) | |
tree | dce644e78ccc0326b4c7cdfa7ae57dde8637c9d7 | |
parent | 778812bfdb6d754db747786d9986d7a608e596bb (diff) | |
download | toolchain_jack-4f813952709a38ad4bb22323d84b9ed887a6e36f.tar.gz toolchain_jack-4f813952709a38ad4bb22323d84b9ed887a6e36f.tar.bz2 toolchain_jack-4f813952709a38ad4bb22323d84b9ed887a6e36f.zip |
When obfuscating, drop local var debug info
except when there is "-keepattributes LocalVarTable"
Bug: 22596989
Change-Id: Iadf5e94fd6df95198b89a0f3833786f4b64a6e9c
-rw-r--r-- | jack/src/com/android/jack/Options.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/jack/src/com/android/jack/Options.java b/jack/src/com/android/jack/Options.java index dc713f45..f1e595a1 100644 --- a/jack/src/com/android/jack/Options.java +++ b/jack/src/com/android/jack/Options.java @@ -681,6 +681,10 @@ public class Options { configBuilder.setString(SOURCES, Joiner.on(File.pathSeparator).join(inputSources)); } + if (emitLocalDebugInfo != null) { + configBuilder.set(EMIT_LOCAL_DEBUG_INFO, emitLocalDebugInfo); + } + configBuilder.pushDefaultLocation(new StringLocation("proguard flags")); if (flags != null) { @@ -693,8 +697,12 @@ public class Options { flags.keepAttribute("RuntimeVisibleParameterAnnotations")); configBuilder.set(ParameterAnnotationRemover.EMIT_RUNTIME_INVISIBLE_PARAMETER_ANNOTATION, flags.keepAttribute("RuntimeInvisibleParameterAnnotations")); - configBuilder.set(EMIT_LINE_NUMBER_DEBUG_INFO, - flags.keepAttribute("LineNumberTable")); + + if (flags.obfuscate()) { // do not override debug info config when shrinking + configBuilder.set(EMIT_LINE_NUMBER_DEBUG_INFO, flags.keepAttribute("LineNumberTable")); + configBuilder.set(EMIT_LOCAL_DEBUG_INFO, flags.keepAttribute("LocalVariableTable")); + } + configBuilder.set(Options.FLAGS, flags); configBuilder.set( Options.USE_MIXED_CASE_CLASSNAME, flags.getUseMixedCaseClassName()); @@ -782,9 +790,6 @@ public class Options { configBuilder.popDefaultLocation(); - if (emitLocalDebugInfo != null) { - configBuilder.set(EMIT_LOCAL_DEBUG_INFO, emitLocalDebugInfo); - } if (importedLibraries != null) { configBuilder.setString(IMPORTED_LIBRARIES, Joiner.on(',').join(importedLibraries)); } |