mirror of
https://github.com/revanced/smali.git
synced 2025-06-13 04:27:38 +02:00
Fix a bug when creating a dex file that has a blank section for one of the indexed item types
git-svn-id: https://smali.googlecode.com/svn/trunk@452 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -497,7 +497,7 @@ public class DexFile
|
||||
int sectionCount = 0;
|
||||
|
||||
for (Section section: sectionsByType) {
|
||||
if (section != null && (section.ItemType.isIndexedItem() || section.getItems().size() > 0)) {
|
||||
if (section != null && section.getItems().size() > 0) {
|
||||
sectionCount++;
|
||||
}
|
||||
}
|
||||
@ -505,7 +505,7 @@ public class DexFile
|
||||
Section[] sections = new Section[sectionCount];
|
||||
sectionCount = 0;
|
||||
for (Section section: sectionsByType) {
|
||||
if (section != null && (section.ItemType.isIndexedItem() || section.getItems().size() > 0)) {
|
||||
if (section != null && section.getItems().size() > 0) {
|
||||
sections[sectionCount++] = section;
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public abstract class Section<T extends Item> {
|
||||
/**
|
||||
* The offset of this section within the <code>DexFile</code>
|
||||
*/
|
||||
protected int offset = -1;
|
||||
protected int offset = 0;
|
||||
|
||||
/**
|
||||
* The type of item that this section holds
|
||||
@ -93,7 +93,7 @@ public abstract class Section<T extends Item> {
|
||||
offset = item.placeAt(offset, i);
|
||||
}
|
||||
} else {
|
||||
this.offset = -1;
|
||||
this.offset = 0;
|
||||
}
|
||||
|
||||
return offset;
|
||||
|
Reference in New Issue
Block a user