feat(gui): improve smali printer to show bytecode (#1114) (PR #1126)

* improve smali printer to show bytecode
* set insnStart position before start decoding
* swithed line 62 and line 63, to get the proper bytes, insnStart must to be set before start to decode.

Co-authored-by: tobias <tobias.hotmail.com>
This commit is contained in:
LBJ-the-GOAT
2021-03-02 21:02:56 +08:00
committed by GitHub
parent 3a69ac23c0
commit 650863836c
20 changed files with 1174 additions and 18 deletions
@@ -31,4 +31,6 @@ public interface IClassData {
List<IAnnotation> getAnnotations();
String getDisassembledCode();
String getDisassembledCodeV2();
}
@@ -34,4 +34,9 @@ public class FieldRefHandle implements IMethodHandle {
public void load() {
// already loaded
}
@Override
public String toString() {
return type + ": " + fieldRef;
}
}
@@ -2,19 +2,21 @@ package jadx.api.plugins.input.insns;
import org.jetbrains.annotations.Nullable;
import jadx.api.plugins.input.data.ICallSite;
import jadx.api.plugins.input.data.IFieldData;
import jadx.api.plugins.input.data.IMethodRef;
import jadx.api.plugins.input.data.*;
import jadx.api.plugins.input.insns.custom.ICustomPayload;
public interface InsnData {
void decode();
int getOffset();
int getOffset(); // offset within method
int getFileOffset(); // offset within dex file
Opcode getOpcode();
byte[] getByteCode();
InsnIndexType getIndexType();
int getRawOpcodeUnit();
@@ -39,6 +41,10 @@ public interface InsnData {
ICallSite getIndexAsCallSite();
IMethodProto getIndexAsProto(int protoIndex);
IMethodHandle getIndexAsMethodHandle();
@Nullable
ICustomPayload getPayload();
}