mirror of
https://github.com/revanced/smali.git
synced 2025-05-01 15:14:32 +02:00
Fix an issue with nop opcodes with a non-null second byte
This commit is contained in:
parent
ee3fb21461
commit
d7cd52308e
@ -69,7 +69,10 @@ public class Opcodes {
|
||||
case 0x300:
|
||||
return Opcode.ARRAY_PAYLOAD;
|
||||
default:
|
||||
return opcodesByValue[opcodeValue];
|
||||
if (opcodeValue >= 0 && opcodeValue < opcodesByValue.length) {
|
||||
return opcodesByValue[opcodeValue];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,12 @@ public class DexBackedUnknownInstruction extends DexBackedInstruction implements
|
||||
super(dexFile, Opcode.NOP, instructionStart);
|
||||
}
|
||||
|
||||
@Override public short getOriginalOpcode() {
|
||||
return (short)dexFile.readUbyte(instructionStart);
|
||||
@Override public int getOriginalOpcode() {
|
||||
int opcode = dexFile.readUbyte(instructionStart);
|
||||
if (opcode == 0) {
|
||||
opcode = dexFile.readUshort(instructionStart);
|
||||
}
|
||||
|
||||
return opcode;
|
||||
}
|
||||
}
|
||||
|
@ -32,5 +32,5 @@
|
||||
package org.jf.dexlib2.iface.instruction.formats;
|
||||
|
||||
public interface UnknownInstruction extends Instruction10x {
|
||||
short getOriginalOpcode();
|
||||
int getOriginalOpcode();
|
||||
}
|
||||
|
@ -38,9 +38,9 @@ import org.jf.dexlib2.iface.instruction.formats.UnknownInstruction;
|
||||
public class ImmutableUnknownInstruction extends ImmutableInstruction implements UnknownInstruction {
|
||||
public static final Format FORMAT = Format.Format10x;
|
||||
|
||||
protected final short originalOpcode;
|
||||
protected final int originalOpcode;
|
||||
|
||||
public ImmutableUnknownInstruction(short originalOpcode) {
|
||||
public ImmutableUnknownInstruction(int originalOpcode) {
|
||||
super(Opcode.NOP);
|
||||
this.originalOpcode = originalOpcode;
|
||||
}
|
||||
@ -53,5 +53,5 @@ public class ImmutableUnknownInstruction extends ImmutableInstruction implements
|
||||
}
|
||||
|
||||
@Override public Format getFormat() { return FORMAT; }
|
||||
@Override public short getOriginalOpcode() { return originalOpcode; }
|
||||
@Override public int getOriginalOpcode() { return originalOpcode; }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user