mirror of
https://github.com/revanced/smali.git
synced 2025-05-09 10:54:29 +02:00
Don't output parameter names when using the -b/--no-debug-info option
This commit is contained in:
parent
84be16bf51
commit
44c5c07c57
@ -263,7 +263,7 @@ public class ClassDefinition {
|
|||||||
|
|
||||||
MethodImplementation methodImpl = method.getImplementation();
|
MethodImplementation methodImpl = method.getImplementation();
|
||||||
if (methodImpl == null) {
|
if (methodImpl == null) {
|
||||||
MethodDefinition.writeEmptyMethodTo(methodWriter, method);
|
MethodDefinition.writeEmptyMethodTo(methodWriter, method, options);
|
||||||
} else {
|
} else {
|
||||||
MethodDefinition methodDefinition = new MethodDefinition(this, method, methodImpl);
|
MethodDefinition methodDefinition = new MethodDefinition(this, method, methodImpl);
|
||||||
methodDefinition.writeTo(methodWriter);
|
methodDefinition.writeTo(methodWriter);
|
||||||
@ -308,7 +308,7 @@ public class ClassDefinition {
|
|||||||
|
|
||||||
MethodImplementation methodImpl = method.getImplementation();
|
MethodImplementation methodImpl = method.getImplementation();
|
||||||
if (methodImpl == null) {
|
if (methodImpl == null) {
|
||||||
MethodDefinition.writeEmptyMethodTo(methodWriter, method);
|
MethodDefinition.writeEmptyMethodTo(methodWriter, method, options);
|
||||||
} else {
|
} else {
|
||||||
MethodDefinition methodDefinition = new MethodDefinition(this, method, methodImpl);
|
MethodDefinition methodDefinition = new MethodDefinition(this, method, methodImpl);
|
||||||
methodDefinition.writeTo(methodWriter);
|
methodDefinition.writeTo(methodWriter);
|
||||||
|
@ -31,6 +31,7 @@ package org.jf.baksmali.Adaptors;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import org.jf.baksmali.Adaptors.Debug.DebugMethodItem;
|
import org.jf.baksmali.Adaptors.Debug.DebugMethodItem;
|
||||||
import org.jf.baksmali.Adaptors.Format.InstructionMethodItemFactory;
|
import org.jf.baksmali.Adaptors.Format.InstructionMethodItemFactory;
|
||||||
|
import org.jf.baksmali.baksmaliOptions;
|
||||||
import org.jf.dexlib2.AccessFlags;
|
import org.jf.dexlib2.AccessFlags;
|
||||||
import org.jf.dexlib2.Format;
|
import org.jf.dexlib2.Format;
|
||||||
import org.jf.dexlib2.Opcode;
|
import org.jf.dexlib2.Opcode;
|
||||||
@ -113,7 +114,8 @@ public class MethodDefinition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void writeEmptyMethodTo(IndentingWriter writer, Method method) throws IOException {
|
public static void writeEmptyMethodTo(IndentingWriter writer, Method method,
|
||||||
|
baksmaliOptions options) throws IOException {
|
||||||
writer.write(".method ");
|
writer.write(".method ");
|
||||||
writeAccessFlags(writer, method.getAccessFlags());
|
writeAccessFlags(writer, method.getAccessFlags());
|
||||||
writer.write(method.getName());
|
writer.write(method.getName());
|
||||||
@ -127,7 +129,7 @@ public class MethodDefinition {
|
|||||||
writer.write('\n');
|
writer.write('\n');
|
||||||
|
|
||||||
writer.indent(4);
|
writer.indent(4);
|
||||||
writeParameters(writer, method, methodParameters);
|
writeParameters(writer, method, methodParameters, options);
|
||||||
AnnotationFormatter.writeTo(writer, method.getAnnotations());
|
AnnotationFormatter.writeTo(writer, method.getAnnotations());
|
||||||
writer.deindent(4);
|
writer.deindent(4);
|
||||||
writer.write(".end method\n");
|
writer.write(".end method\n");
|
||||||
@ -164,7 +166,7 @@ public class MethodDefinition {
|
|||||||
writer.printSignedIntAsDec(methodImpl.getRegisterCount());
|
writer.printSignedIntAsDec(methodImpl.getRegisterCount());
|
||||||
}
|
}
|
||||||
writer.write('\n');
|
writer.write('\n');
|
||||||
writeParameters(writer, method, methodParameters);
|
writeParameters(writer, method, methodParameters, classDef.options);
|
||||||
|
|
||||||
if (registerFormatter == null) {
|
if (registerFormatter == null) {
|
||||||
registerFormatter = new RegisterFormatter(classDef.options, methodImpl.getRegisterCount(),
|
registerFormatter = new RegisterFormatter(classDef.options, methodImpl.getRegisterCount(),
|
||||||
@ -218,7 +220,8 @@ public class MethodDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void writeParameters(IndentingWriter writer, Method method,
|
private static void writeParameters(IndentingWriter writer, Method method,
|
||||||
List<? extends MethodParameter> parameters) throws IOException {
|
List<? extends MethodParameter> parameters,
|
||||||
|
baksmaliOptions options) throws IOException {
|
||||||
boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
|
boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
|
||||||
int registerNumber = isStatic?0:1;
|
int registerNumber = isStatic?0:1;
|
||||||
for (MethodParameter parameter: parameters) {
|
for (MethodParameter parameter: parameters) {
|
||||||
@ -229,7 +232,7 @@ public class MethodDefinition {
|
|||||||
writer.write(".param p");
|
writer.write(".param p");
|
||||||
writer.printSignedIntAsDec(registerNumber);
|
writer.printSignedIntAsDec(registerNumber);
|
||||||
|
|
||||||
if (parameterName != null) {
|
if (parameterName != null && options.outputDebugInfo) {
|
||||||
writer.write(", ");
|
writer.write(", ");
|
||||||
ReferenceFormatter.writeStringReference(writer, parameterName);
|
ReferenceFormatter.writeStringReference(writer, parameterName);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user