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
Ben Gruver
b11a01715a
Centralize debug info related parsing into DebugInfo class
2012-10-28 15:03:13 -07:00
Ben Gruver
754b3c4dc0
Nearly full switch over to dexlib2 in baksmali
...
No odex handling/register analysis yet, and there are still a few minor
features that haven't been reimplemented yet.
Still lots of bugs :)
2012-10-28 15:03:08 -07:00
Ben Gruver
ba114e7211
Add a version of getInstructionIndexAtCodeOffset that defaults to exact
2012-10-28 13:14:13 -07:00
Ben Gruver
3615fd4b5b
Use getType instead of getString for method return type
2012-10-28 13:13:48 -07:00
Ben Gruver
12e071db60
Refactor how parameters/parameter names are handled
2012-10-28 13:13:11 -07:00
Ben Gruver
87179940cb
Restart the numbering for encoded methods/fields
2012-10-28 12:34:25 -07:00
Ben Gruver
08840432d4
Use an iterable rather than a list for debug items
2012-10-27 22:39:07 -07:00
Ben Gruver
bfe20a295d
Add support to dexlib2 for parameter names
2012-10-27 14:52:34 -07:00
Ben Gruver
005690e855
Fix reading order for DexBackedExceptionHandler
2012-10-27 12:34:57 -07:00
Ben Gruver
9c60ef2a10
Add support in dexlib2 for debug info
2012-10-26 22:23:20 -07:00
Ben Gruver
c307c1887d
Implement support in dexlib2 for payload instructions
2012-10-26 00:49:31 -07:00
Ben Gruver
68f69b899f
Rename DexReader.skipBytes to moveRelative, and add setOffset
2012-10-26 00:06:08 -07:00
Ben Gruver
2e34c4499c
Fix superclass and interfaces in DexBackedClassDef
2012-10-24 22:25:39 -07:00
Ben Gruver
4e3124206a
Improve how access flags are handled
2012-10-24 22:13:11 -07:00
Ben Gruver
7ccb5fcfec
Refactor annotations and encoded values in baksmali
2012-10-24 21:15:42 -07:00
Ben Gruver
ca21c1e890
Add a test for InstructionOffsetMap
2012-10-23 22:56:42 -07:00
Ben Gruver
d62490d669
Fix Preconditions.check3rcRegisterCount
2012-10-23 22:53:41 -07:00
Ben Gruver
e2f2c89ddc
Fix a multitude of format related issues with immutable instructions
2012-10-23 22:53:41 -07:00
Ben Gruver
0033480503
Fix the missing return type for method references
2012-10-23 22:53:41 -07:00
Ben Gruver
d23b567c2b
Remove some unneeded interfaces
2012-10-23 22:53:41 -07:00
Ben Gruver
3ad13f4fe3
Add InstructionOffsetMap utility class
...
This provides a convenient way to map back and forth between
instruction offsets and indexes within a method
2012-10-23 22:53:37 -07:00
Ben Gruver
ccc4c13ae6
Use code offsets rather than indexes for instructions
...
I had initially wanted to use instruction indexes at the dexlib level,
rather than the actual code unit offsets/addresses. But after additional
thought, I decided to stick with code units, and then provide a utility
for easily mapping between indexes/offsets (not implemented yet).
2012-10-23 20:01:18 -07:00
Ben Gruver
38d58eb4f4
Fix the format of ImmutableInstruction10x
2012-10-21 23:17:04 -07:00
Ben Gruver
ebc11d3216
Add zip file support in DexFileFactory
2012-10-21 22:14:18 -07:00
Ben Gruver
ec47cb62a8
Add DexFileFactory
2012-10-21 21:43:30 -07:00
Ben Gruver
58f5f0c417
Implement support for indexed items in DexBuffer
2012-10-21 21:43:16 -07:00
Ben Gruver
0f7b4c40f4
Fix the class data offset in DexBackedClassDef
2012-10-21 21:41:54 -07:00