mirror of
https://github.com/revanced/smali.git
synced 2025-05-05 00:54:25 +02:00
Tweak dexlib's "skip instructions" functionality so that it doesn't read in the CodeItems or DebugInfoItems at all
git-svn-id: https://smali.googlecode.com/svn/trunk@635 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
2bdbf739bf
commit
d79d9ebbe9
@ -478,8 +478,13 @@ public class ClassDataItem extends Item<ClassDataItem> {
|
||||
int previousIndex = previousEncodedMethod==null?0:previousEncodedMethod.method.getIndex();
|
||||
method = dexFile.MethodIdsSection.getItemByIndex(in.readUnsignedLeb128() + previousIndex);
|
||||
accessFlags = in.readUnsignedLeb128();
|
||||
if (dexFile.skipInstructions()) {
|
||||
in.readUnsignedLeb128();
|
||||
codeItem = null;
|
||||
} else {
|
||||
codeItem = (CodeItem)readContext.getOptionalOffsettedItemByOffset(ItemType.TYPE_CODE_ITEM,
|
||||
in.readUnsignedLeb128());
|
||||
}
|
||||
if (codeItem != null) {
|
||||
codeItem.setParent(this);
|
||||
}
|
||||
|
@ -151,27 +151,6 @@ public class CodeItem extends Item<CodeItem> {
|
||||
|
||||
int instructionCount = in.readInt();
|
||||
|
||||
if (dexFile.skipInstructions()) {
|
||||
in.skipBytes(instructionCount * 2);
|
||||
|
||||
if (triesCount > 0) {
|
||||
in.alignTo(4);
|
||||
in.skipBytes(8 * triesCount);
|
||||
|
||||
int handlerCount = in.readUnsignedLeb128();
|
||||
for (int i=0; i<handlerCount; i++) {
|
||||
int size = in.readSignedLeb128();
|
||||
int absSize = Math.abs(size);
|
||||
for (int j=0; j<absSize; j++) {
|
||||
in.readUnsignedLeb128();
|
||||
in.readUnsignedLeb128();
|
||||
}
|
||||
if (size <= 0) {
|
||||
in.readUnsignedLeb128();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final ArrayList<Instruction> instructionList = new ArrayList<Instruction>();
|
||||
|
||||
byte[] encodedInstructions = in.readBytes(instructionCount * 2);
|
||||
@ -223,7 +202,6 @@ public class CodeItem extends Item<CodeItem> {
|
||||
in.setCursor(codeItemEnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
protected int placeItem(int offset) {
|
||||
|
@ -409,6 +409,10 @@ public class DexFile
|
||||
continue;
|
||||
}
|
||||
|
||||
if (skipInstructions && (section == CodeItemsSection || section == DebugInfoItemsSection)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int sectionOffset = readContext.getSectionOffset(section.ItemType);
|
||||
if (sectionOffset > 0) {
|
||||
int sectionSize = readContext.getSectionSize(section.ItemType);
|
||||
|
Loading…
x
Reference in New Issue
Block a user