Class Decompile
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.JavaExec
com.cleanroommc.gradle.api.task.LazilyConstructedJavaExec
com.cleanroommc.gradle.api.task.MavenJarExec
com.cleanroommc.gradle.api.task.common.Decompile
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.process.BaseExecSpec, org.gradle.process.JavaExecSpec, org.gradle.process.JavaForkOptions, org.gradle.process.ProcessForkOptions, org.gradle.util.Configurable<org.gradle.api.Task>
Runs the Cleanflower decompiler. Decompiler options are passed as free-form key/value pairs through
getOptions() rather than dedicated properties, since the tool can be swapped out
and each tool version (may) define its own option set.
The default tool is com.cleanroommc:cleanflower:1.0.0, resolved through the decompiler
configuration. Adding a dependency to that configuration replaces the default. The option names documented
on getOptions() is the cleanflower v1.0.0 option set.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidabstract org.gradle.api.file.RegularFilePropertyabstract org.gradle.api.file.RegularFilePropertyabstract org.gradle.api.provider.ListProperty<String> Additional raw decompiler arguments, appended aftergetOptions()abstract org.gradle.api.file.ConfigurableFileCollectionabstract org.gradle.api.provider.ListProperty<String> -only=<prefix>: only decompile classes matching these prefixesDecompiler options, rendered as--<key>=<value>arguments in insertion order.abstract org.gradle.api.provider.Property<Boolean> --silent: suppress the decompiler's console outputMethods inherited from class MavenJarExec
defaultLogFile, getProviders, getToolClasspath, getUseDefaultToolArgumentsMethods inherited from class LazilyConstructedJavaExec
afterExec, args, args, environment, environment, exec, getLogFile, jvmArgs, jvmArgs, setAllJvmArgs, setArgs, setEnvironment, setJvmArgs, setSystemProperties, systemProperties, systemPropertyMethods inherited from class org.gradle.api.tasks.JavaExec
bootstrapClasspath, classpath, copyTo, copyTo, debugOptions, executable, getAllJvmArgs, getArgs, getArgumentProviders, getBootstrapClasspath, getClasspath, getCommandLine, getDebug, getDebugOptions, getDefaultCharacterEncoding, getEnableAssertions, getEnvironment, getErrorOutput, getExecActionFactory, getExecutable, getExecutionResult, getJavaLauncher, getJavaToolchainService, getJavaVersion, getJvmArgs, getJvmArgumentProviders, getJvmArguments, getMainClass, getMainModule, getMaxHeapSize, getMinHeapSize, getModularity, getObjectFactory, getPropertyFactory, getProviderFactory, getStandardInput, getStandardOutput, getSystemProperties, getWorkingDir, isIgnoreExitValue, setAllJvmArgs, setArgs, setArgsString, setBootstrapClasspath, setClasspath, setDebug, setDefaultCharacterEncoding, setEnableAssertions, setErrorOutput, setExecutable, setExecutable, setIgnoreExitValue, setJvmArgs, setMaxHeapSize, setMinHeapSize, setStandardInput, setStandardOutput, setWorkingDir, setWorkingDir, workingDirMethods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingMethods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjectsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
Decompile
public Decompile()
-
-
Method Details
-
getCompiledJar
@InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getCompiledJar() -
getLibraries
@Optional @Classpath @InputFiles public abstract org.gradle.api.file.ConfigurableFileCollection getLibraries() -
getOptions
Decompiler options, rendered as--<key>=<value>arguments in insertion order. Booleans are rendered as1/0; other values viatoString(). Unset options fallback to the tool's own defaults. Values that only exist as bare flags (no=valueform) belong ingetExtraArgs()instead.Valid option keys for cleanflower v1.0.0. Overriding the tool through the
decompilerconfiguration may void this list, consult the replacement tool's documentation instead.Core options:
remove-bridge: removebridgemethods from the outputremove-synthetic: removesyntheticmethods and fields from the outputdecompile-inner: process inner classes and add them to the outputdecompile-java4: resugar the Java 1-4 class reference formatdecompile-assert: decompile assert statementshide-empty-super: hidesuper()calls with no parametershide-default-constructor: hide constructors with no parameters and no codedecompile-generics: decompile generics in classes, methods, fields and variablesincorporate-returns: integrate returns better in try-catch blocksensure-synchronized-monitors: deduce missingmonitorexitsforsynchronizedblocksdecompile-enums: decompile enumsdecompile-preview: decompile preview/incubating Java featuresremove-getclass: remove syntheticgetClass()calls fromobj.new Inner()constructskeep-literals: keep NaN, infinities and pi values as isboolean-as-int: represent integers 0 and 1 as booleansascii-strings: escape non-ASCII characters in string and character literalssynthetic-not-set: treat some known structures as synthetic even when not markedundefined-as-object: treat nameless types as java.lang.Objectuse-lvt-names: use LVT names for locals and parameters instead of var<index>_<version>use-method-parameters: use names from theMethodParametersattributeremove-empty-try-catch: removetry-catchblocks with no codedecompile-finally: decompilefinallyblockslambda-to-anonymous-class: decompile lambdas as anonymous classesbytecode-source-mapping: map bytecode to source linesdump-code-lines: dump line mappings to output archive zip entry extra dataignore-invalid-bytecode: ignore malformed bytecodeverify-anonymous-classes: verify that anonymous classes are localternary-constant-simplification: fold ternary branches with boolean constantspattern-matching: decompile with if and switch pattern matchingtry-loop-fix: fix rare malformed decompilation of try blocks inside while loopsternary-in-if: [experimental] collapse if statements with a ternary in their conditiondecompile-switch-expressions: decompile switch expressionsshow-hidden-statements: [debug] display hidden code blocksoverride-annotation: display override annotations for methods known to the decompilersimplify-stack: simplify variables across stack bounds to resugar complex statementsverify-merges: [experimental] verify the validity of variable merges harderold-try-dedup: [experimental] use the old try deduplication algorithminclude-classpath: include the entire classpath when resolving referencesinclude-runtime: '1' or 'current' for the current Java runtime, or a path to another runtimeexplicit-generics: put explicit diamond generic arguments on method callsinline-simple-lambdas: remove braces on simple one-line lambdaslog-level: one of 'info', 'debug', 'warn', 'error'max-time-per-method: [deprecated] maximum time in seconds to process a methodrename-members: rename classes, fields and methods with a number suffix to help deobfuscationuser-renamer-class: path to a class implementing IIdentifierRenamernew-line-separator: use \n line separators instead of the OS defaultindent-string: indentation stringpreferred-line-length: max line length before formatting is appliedbanner: message to display at the top of each decompiled fileerror-message: message to display when an error occurs in the decompilerthread-count: decompilation thread count, -1 uses all available coresskip-extra-files: skip copying non-class files to the outputwarn-inconsistent-inner-attributes: warn about inconsistent inner class attributesdump-bytecode-on-error: put the bytecode in the method body when an error occursdump-exception-on-error: put the exception message in the method body when an error occursdecompiler-comments: add decompiler comments about odd bytecode or unfixable problemssourcefile-comments: add debug comments showing the class SourceFile attributedecompile-complex-constant-dynamic: decompile complex constant-dynamic expressions to a similar non-lazy expressionforce-jsr-inline: force processing of JSR instructions even in Java 7+ class filesdump-text-tokens: dump text tokens on each class fileremove-imports: remove import statements from the decompiled codemark-corresponding-synthetics: mark lambdas and anonymous/local classes with their synthetic constructsexcluded-classes: exclude classes whose fully qualified names match this regular expressionvalidate-inner-classes-names: skip inner classes whose names are not'$'-separated correctly
Bundled plugin options:
kt-enable: enable the Kotlin pluginkt-show-public: show public visibility in Kotlin outputkt-unknown-defaults: string to use for unknown Kotlin default argumentskt-collapse-string-concat: collapse string concatenation in Kotlin outputvariable-renaming: variable renamer to use (e.g. 'jad', 'tiny')rename-parameters: rename parameters as well as localsjad-style-variable-naming: use JAD-style variable namingjad-style-parameter-naming: use JAD-style parameter namingresugar-idea-notnull: resugar IntelliJ IDEA's @NotNull assertions
-
getOnlyClasses
-only=<prefix>: only decompile classes matching these prefixes -
getSilent
--silent: suppress the decompiler's console output -
getExtraArgs
Additional raw decompiler arguments, appended aftergetOptions() -
getDecompiledJar
@OutputFile public abstract org.gradle.api.file.RegularFileProperty getDecompiledJar() -
beforeExec
protected void beforeExec()- Overrides:
beforeExecin classLazilyConstructedJavaExec
-