mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 12:17:37 +02:00
Added asserts to check if items are being placed in the original locations, when writing a dex file "in place"
git-svn-id: https://smali.googlecode.com/svn/trunk@377 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -79,6 +79,7 @@ public abstract class Item<T extends Item> implements Comparable<T> {
|
||||
*/
|
||||
protected int placeAt(int offset, int index) {
|
||||
assert offset % getItemType().ItemAlignment == 0:"The offset is not aligned";
|
||||
assert !dexFile.getInplace() || (offset == this.offset && this.index == index);
|
||||
|
||||
this.offset = offset;
|
||||
this.index = index;
|
||||
|
@ -85,6 +85,7 @@ public abstract class Section<T extends Item> {
|
||||
protected int placeAt(int offset) {
|
||||
if (items.size() > 0) {
|
||||
offset = AlignmentUtils.alignOffset(offset, ItemType.ItemAlignment);
|
||||
assert !DexFile.getInplace() || offset == this.offset;
|
||||
this.offset = offset;
|
||||
|
||||
for (int i=0; i < items.size(); i++) {
|
||||
|
Reference in New Issue
Block a user