mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 16:44:25 +02:00
Add Item.isPlaced() method and replace getOffset() != -1 with !isPlaced() in ClassDefItem
This commit is contained in:
parent
e5466fee23
commit
d320d6ce8c
@ -324,7 +324,7 @@ public class ClassDefItem extends Item<ClassDefItem> {
|
||||
}
|
||||
|
||||
private void placeClass(ClassDefItem classDefItem) {
|
||||
if (classDefItem.getOffset() == -1) {
|
||||
if (!classDefItem.isPlaced()) {
|
||||
TypeIdItem superType = classDefItem.superType;
|
||||
ClassDefItem superClassDefItem = unplacedClassDefsByType.get(superType);
|
||||
|
||||
|
@ -189,6 +189,7 @@ public abstract class Item<T extends Item> implements Comparable<T> {
|
||||
|
||||
|
||||
/**
|
||||
* Note that the item must have been placed before calling this method (See <code>DexFile.place()</code>)
|
||||
* @return the offset in the dex file where this item is located
|
||||
*/
|
||||
public int getOffset() {
|
||||
@ -198,7 +199,8 @@ public abstract class Item<T extends Item> implements Comparable<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the index of this item within the item's containing section
|
||||
* Note that the item must have been placed before calling this method (See <code>DexFile.place()</code>)
|
||||
* @return the index of this item within the item's containing section.
|
||||
*/
|
||||
public int getIndex() {
|
||||
Preconditions.checkState(index != -1,
|
||||
@ -206,6 +208,13 @@ public abstract class Item<T extends Item> implements Comparable<T> {
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if this item has been placed, otherwise False
|
||||
*/
|
||||
public boolean isPlaced() {
|
||||
return offset != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the <code>DexFile</code> that contains this item
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user