mirror of
https://github.com/revanced/smali.git
synced 2025-05-07 18:04:32 +02:00
Fixed an issue with generated dex files that have no field references
git-svn-id: https://smali.googlecode.com/svn/trunk@57 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
4fd96cb22d
commit
56c3e45ad4
@ -55,8 +55,15 @@ public abstract class SectionHeaderInfo extends CompositeField<SectionHeaderInfo
|
|||||||
if (!section.isPlaced()) {
|
if (!section.isPlaced()) {
|
||||||
throw new RuntimeException("Trying to write a reference to a section that hasn't been placed.");
|
throw new RuntimeException("Trying to write a reference to a section that hasn't been placed.");
|
||||||
}
|
}
|
||||||
|
int size = section.size();
|
||||||
sectionSizeField.cacheValue(section.size());
|
sectionSizeField.cacheValue(section.size());
|
||||||
|
|
||||||
|
if (size == 0) {
|
||||||
|
//we have to set the offset to 0 or dalvik will complain
|
||||||
|
sectionOffsetField.cacheValue(0);
|
||||||
|
} else {
|
||||||
sectionOffsetField.cacheValue(section.getOffset());
|
sectionOffsetField.cacheValue(section.getOffset());
|
||||||
|
}
|
||||||
|
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user