Ben Gruver
4ffbfa2e71
Initial commit of writer functionality
...
It's not fully functional yet, but the structure is there, and it's
got most item types
2012-11-18 14:33:32 -08:00
Ben Gruver
22c3185bb7
Major cleanup of the interface and library in general
2012-11-17 17:51:36 -08:00
Ben Gruver
bea9627ed7
Change the nomenclature from CodeOffset to CodeAddress for absolute code positions
2012-11-16 22:54:14 -08:00
Ben Gruver
cb5cf3d6c0
Delete the MethodPrototype interface
2012-11-16 22:53:03 -08:00
Ben Gruver
85b3146224
Use final and a private constructor for non-instantiable classes
2012-11-16 22:35:12 -08:00
Ben Gruver
d71c98f6b9
Return the correct register count in ImmutableMethodImplementation
2012-11-12 23:03:18 -08:00
Ben Gruver
2d7e111135
Add sorted interface and immutable implementations
2012-11-12 22:55:06 -08:00
Ben Gruver
ddf2021942
Add @Nonnull for ImmutableListConverter methods
2012-11-12 22:25:15 -08:00
Ben Gruver
60ca2ce0ae
Add base implementations of Annotation and AnnotationElement
2012-11-12 22:25:15 -08:00
Ben Gruver
8f14d3641c
Make StringReference and TypeReference implement CharSequence
2012-11-12 22:25:11 -08:00
Ben Gruver
c6e54994a7
Use collections of annotations, not lists.
2012-11-12 22:20:39 -08:00
Ben Gruver
12b970ed4d
Use collections instead of lists for variable size "lists" in the dex file
...
Only things that can be accessed in the dex file in a random access manner
should be exposed as a list. If the list must be read sequentially, it is
exposed in the interface as a Collection if the size is available up-front
or as an Iterable if the size can only be determined by iterating over the
list.
2012-11-12 22:20:33 -08:00
Ben Gruver
65d969c23b
Rename VariableSizeIterator to VariableSizeLookaheadIterator
...
This improves the implementation, and is now used for debug info
2012-11-11 12:49:38 -08:00
Ben Gruver
b26b492fcc
Get rid of BaseAnnotation
2012-11-10 21:04:31 -08:00
Ben Gruver
e27e44bee3
Refactor EnumEncodedValue to use a field reference
2012-11-10 17:36:16 -08:00
Ben Gruver
b76e75c8bc
Implement hashCode and equals for encoded values
2012-11-10 17:33:28 -08:00
Ben Gruver
ff9eb9fa61
Remove the unnecessary abstract methods from the base reference implementations
2012-11-10 16:21:30 -08:00
Ben Gruver
f7823c4fe1
Add MethodPrototype interface
2012-11-10 16:03:43 -08:00
Ben Gruver
b7b15efc03
Replace BasicMethodParameter with TypeReference
2012-11-10 13:30:07 -08:00
Ben Gruver
f81150ad43
Implement hashCode and equals for references
2012-11-10 13:08:06 -08:00
Ben Gruver
98eede2ce1
Don't write default field values for static final fields that are set in <clinit>
2012-11-09 23:55:15 -08:00
Ben Gruver
60631f684f
Detect static final fields that are set in the static initializer
2012-11-09 23:55:12 -08:00
Ben Gruver
42b6dc3e37
Minor cleanup of synthetic accessor code
2012-11-09 22:34:20 -08:00
Ben Gruver
3563a20427
Fix invalid cast in ImmutableInstruction20t
2012-11-09 21:16:55 -08:00
Ben Gruver
2b8845bb24
Re-implement SyntheticAccessorResolver
2012-11-09 21:16:51 -08:00
Ben Gruver
db389aa3a1
Make ClassDef implement TypeReference
2012-11-04 22:49:36 -08:00
Ben Gruver
b116cb0ac9
Add DexBacked implementations for all instructions
2012-11-04 16:47:20 -08:00
Ben Gruver
f4662586da
Clean up imports in dexlib2
2012-11-04 13:56:09 -08:00
Ben Gruver
b0383884fa
Add and use ImmutabeleListUtils.nullToEmptyList()
2012-11-04 13:53:41 -08:00
Ben Gruver
a8e05220c1
Refactor how method/field/string/type references are handled
2012-11-04 13:04:21 -08:00
Ben Gruver
c42ffd8dbe
Fix the offset calculation for paramater annotations
2012-11-03 18:06:47 -07:00
Ben Gruver
d1662b67fe
Refactor dexbacked implementations
...
Made construction of a new dexbacked item as light weight as possible,
only the very mimimum in computed/stored. Some of the values that were
previously calculated/loaded in the constructor are now lazily loaded
upon first use.
In general, nothing is cached, unless the item can't be fully read by
the consumer without causing the value to be computed multiple times.
Otherwise, it is up to the consume to decide if/when/what they want to
cache.
2012-11-03 18:06:41 -07:00
Ben Gruver
dccca459e9
Fix some null issues in the immutable implementation
2012-11-01 22:41:06 -07:00
Ben Gruver
8582095cfb
Fix up and improve how parameters are mapped to registers, for local info
...
This additionally adds the local info for the "this" parameter
2012-11-01 21:14:17 -07:00
Ben Gruver
269c15688b
Add the local info for the implicit "this" param
...
This also fixes some minor issues with using the correct register
for parameter info
2012-11-01 00:16:30 -07:00
Ben Gruver
476e704c86
Use getType to get the annotation type for an annotation encoded value
2012-10-31 22:24:44 -07:00
Ben Gruver
3f3427d0dd
Reset annotation iterators for virtual methods/instance fields
...
The method/field number restarts when we go from direct to virtual methods
and from static to instance fields, so we have to reset the annotation
iterators accordingly
2012-10-31 21:20:12 -07:00
Ben Gruver
51984fc259
Read the field name index in a field_id_item as a uint
2012-10-31 19:40:55 -07:00
Ben Gruver
c12bbf3a25
Read the element count of a packed switch payload as a ushort
2012-10-31 19:28:45 -07:00
Ben Gruver
1ff61d42de
Increment the offset correctly when reading a sized long
2012-10-31 19:28:12 -07:00
Ben Gruver
ebd6178008
Increment the offset correctly when reading a long
2012-10-31 19:27:52 -07:00
Ben Gruver
522c2dd268
Use the correct method when decoding strings
...
Use Utf8Utils.utf8BytesWithUtf18LengthToString instead of
utf8BytesToString
2012-10-31 19:27:19 -07:00
Ben Gruver
1b598a1817
Read interface type indexes as ushort, not uint
2012-10-31 19:25:56 -07:00
Ben Gruver
b030b16785
Fix the payload opcode values in Opcode.getOpcodeByValue
2012-10-30 23:56:45 -07:00
Ben Gruver
1c3a283ac3
Position the reader correctly after a nop
2012-10-30 23:43:25 -07:00
Ben Gruver
38e925db25
use Instruciton.getCodeUnits() in InstructionOffsetMap
2012-10-30 23:42:47 -07:00
Ben Gruver
a8ef706d1d
Increment the reader by the correct amount for payload instructions
2012-10-30 23:05:50 -07:00
Ben Gruver
f8a63e41aa
Fix how signed values are checked in Preconditions
2012-10-30 23:05:06 -07:00
Ben Gruver
eee0ff70fd
Return the correct instruction size
2012-10-28 15:03:13 -07:00
Ben Gruver
43b6b5f200
Tweak nomenclature for special debug opcodes to match dex-format.html
2012-10-28 15:03:13 -07:00