mirror of
https://github.com/revanced/smali.git
synced 2025-05-03 16:14:29 +02:00
Clean up some more TODOs
This commit is contained in:
parent
d38f3a7983
commit
05201785fe
@ -31,9 +31,6 @@
|
|||||||
|
|
||||||
package org.jf.dexlib2.dexbacked;
|
package org.jf.dexlib2.dexbacked;
|
||||||
|
|
||||||
import org.jf.dexlib2.base.BaseExceptionHandler;
|
|
||||||
import org.jf.dexlib2.iface.ExceptionHandler;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class DexBackedTypedExceptionHandler extends DexBackedExceptionHandler {
|
public class DexBackedTypedExceptionHandler extends DexBackedExceptionHandler {
|
||||||
@ -42,7 +39,6 @@ public class DexBackedTypedExceptionHandler extends DexBackedExceptionHandler {
|
|||||||
private final int handlerCodeAddress;
|
private final int handlerCodeAddress;
|
||||||
|
|
||||||
public DexBackedTypedExceptionHandler(@Nonnull DexReader reader) {
|
public DexBackedTypedExceptionHandler(@Nonnull DexReader reader) {
|
||||||
// TODO: verify dalvik doesn't accept an exception handler that points in the middle of an instruction
|
|
||||||
this.dexFile = reader.dexBuf;
|
this.dexFile = reader.dexBuf;
|
||||||
this.typeId = reader.readSmallUleb128();
|
this.typeId = reader.readSmallUleb128();
|
||||||
this.handlerCodeAddress = reader.readSmallUleb128();
|
this.handlerCodeAddress = reader.readSmallUleb128();
|
||||||
|
@ -48,7 +48,6 @@ public class DexBackedInstruction35c extends DexBackedInstruction implements Ins
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public int getRegisterCount() {
|
@Override public int getRegisterCount() {
|
||||||
//TODO: make sure dalvik verifies that this is in the correct range
|
|
||||||
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
|
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ public class DexBackedInstruction35mi extends DexBackedInstruction implements In
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public int getRegisterCount() {
|
@Override public int getRegisterCount() {
|
||||||
//TODO: make sure dalvik verifies that this is in the correct range
|
|
||||||
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
|
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ public class DexBackedInstruction35ms extends DexBackedInstruction implements In
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public int getRegisterCount() {
|
@Override public int getRegisterCount() {
|
||||||
//TODO: make sure dalvik verifies that this is in the correct range
|
|
||||||
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
|
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,6 @@ import com.google.common.collect.ImmutableSet;
|
|||||||
import org.jf.dexlib2.base.BaseMethodParameter;
|
import org.jf.dexlib2.base.BaseMethodParameter;
|
||||||
import org.jf.dexlib2.iface.Annotation;
|
import org.jf.dexlib2.iface.Annotation;
|
||||||
import org.jf.dexlib2.iface.MethodParameter;
|
import org.jf.dexlib2.iface.MethodParameter;
|
||||||
import org.jf.util.ExceptionWithContext;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -51,10 +50,6 @@ public class ParameterIterator implements Iterator<MethodParameter> {
|
|||||||
public ParameterIterator(@Nonnull List<? extends CharSequence> parameterTypes,
|
public ParameterIterator(@Nonnull List<? extends CharSequence> parameterTypes,
|
||||||
@Nonnull List<? extends Set<? extends Annotation>> parameterAnnotations,
|
@Nonnull List<? extends Set<? extends Annotation>> parameterAnnotations,
|
||||||
@Nonnull Iterator<String> parameterNames) {
|
@Nonnull Iterator<String> parameterNames) {
|
||||||
// TODO: verify if dalvik allows this
|
|
||||||
if (parameterAnnotations.size() > parameterTypes.size()) {
|
|
||||||
throw new ExceptionWithContext("Too many parameter annotations");
|
|
||||||
}
|
|
||||||
this.parameterTypes = parameterTypes.iterator();
|
this.parameterTypes = parameterTypes.iterator();
|
||||||
this.parameterAnnotations = parameterAnnotations.iterator();
|
this.parameterAnnotations = parameterAnnotations.iterator();
|
||||||
this.parameterNames = parameterNames;
|
this.parameterNames = parameterNames;
|
||||||
|
@ -46,7 +46,6 @@ public abstract class ImmutableInstruction implements Instruction {
|
|||||||
|
|
||||||
protected ImmutableInstruction(@Nonnull Opcode opcode) {
|
protected ImmutableInstruction(@Nonnull Opcode opcode) {
|
||||||
this.opcode = opcode;
|
this.opcode = opcode;
|
||||||
//TODO: check performance. Move into subclasses if needed, where we can access the field directly
|
|
||||||
Preconditions.checkFormat(opcode, getFormat());
|
Preconditions.checkFormat(opcode, getFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user