Commit Graph

1302 Commits

Author SHA1 Message Date
b7b15efc03 Replace BasicMethodParameter with TypeReference 2012-11-10 13:30:07 -08:00
f81150ad43 Implement hashCode and equals for references 2012-11-10 13:08:06 -08:00
4060490e85 Get rid of old commented code block for methods in ClassDefinition 2012-11-09 23:56:13 -08:00
98eede2ce1 Don't write default field values for static final fields that are set in <clinit> 2012-11-09 23:55:15 -08:00
60631f684f Detect static final fields that are set in the static initializer 2012-11-09 23:55:12 -08:00
987cdc3e0e Sort the classes before disassembling 2012-11-09 22:54:39 -08:00
42b6dc3e37 Minor cleanup of synthetic accessor code 2012-11-09 22:34:20 -08:00
3563a20427 Fix invalid cast in ImmutableInstruction20t 2012-11-09 21:16:55 -08:00
2b8845bb24 Re-implement SyntheticAccessorResolver 2012-11-09 21:16:51 -08:00
db389aa3a1 Make ClassDef implement TypeReference 2012-11-04 22:49:36 -08:00
b116cb0ac9 Add DexBacked implementations for all instructions 2012-11-04 16:47:20 -08:00
f4662586da Clean up imports in dexlib2 2012-11-04 13:56:09 -08:00
b0383884fa Add and use ImmutabeleListUtils.nullToEmptyList() 2012-11-04 13:53:41 -08:00
a8e05220c1 Refactor how method/field/string/type references are handled 2012-11-04 13:04:21 -08:00
c42ffd8dbe Fix the offset calculation for paramater annotations 2012-11-03 18:06:47 -07:00
7fe0543b66 Cache the MethodParameters in MethodDefinition 2012-11-03 18:06:47 -07:00
6b93c7cc35 Don't precompute the full method string in MethodDefinition 2012-11-03 18:06:47 -07:00
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
8ae711cf3b Get rid of the vestigal commented out code in IndentingWriter 2012-11-03 01:08:04 -07:00
dccca459e9 Fix some null issues in the immutable implementation 2012-11-01 22:41:06 -07:00
db49fd7714 Use a for instead of foreach loop when iterating over MethodItems
This is measurably faster than the previous version
2012-11-01 21:16:28 -07:00
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
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
476e704c86 Use getType to get the annotation type for an annotation encoded value 2012-10-31 22:24:44 -07:00
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
09058f9914 Don't forget to intern the switch labels 2012-10-31 20:42:17 -07:00
d3dd617d25 Switch key/value in the switch maps 2012-10-31 20:37:39 -07:00
4499f63c6c Add a space after the # for .end/.restart local 2012-10-31 20:28:35 -07:00
c3a3ee3799 Refactor the writeParameters method a bit
- Accepts a method instead of the parameter list directly
- Uses the correct pN register values for non-static vs. static methods
- Adds a space after the # for the type comment
2012-10-31 20:20:28 -07:00
db4316ef6d Add TODO regarding parameter/local names 2012-10-31 19:49:52 -07:00
51984fc259 Read the field name index in a field_id_item as a uint 2012-10-31 19:40:55 -07:00
c12bbf3a25 Read the element count of a packed switch payload as a ushort 2012-10-31 19:28:45 -07:00
1ff61d42de Increment the offset correctly when reading a sized long 2012-10-31 19:28:12 -07:00
ebd6178008 Increment the offset correctly when reading a long 2012-10-31 19:27:52 -07:00
522c2dd268 Use the correct method when decoding strings
Use Utf8Utils.utf8BytesWithUtf18LengthToString instead of
utf8BytesToString
2012-10-31 19:27:19 -07:00
1b598a1817 Read interface type indexes as ushort, not uint 2012-10-31 19:25:56 -07:00
b030b16785 Fix the payload opcode values in Opcode.getOpcodeByValue 2012-10-30 23:56:45 -07:00
1c3a283ac3 Position the reader correctly after a nop 2012-10-30 23:43:25 -07:00
38e925db25 use Instruciton.getCodeUnits() in InstructionOffsetMap 2012-10-30 23:42:47 -07:00
a8ef706d1d Increment the reader by the correct amount for payload instructions 2012-10-30 23:05:50 -07:00
f8a63e41aa Fix how signed values are checked in Preconditions 2012-10-30 23:05:06 -07:00
8b5490919c Merge branch 'master' into dexlib_redesign 2012-10-30 22:13:19 -07:00
3a96d5d432 Change how release vs. non-release is detected
This allows the smali/baksmali builds to be simplified a bit
2012-10-29 21:42:29 -07:00
eee0ff70fd Return the correct instruction size 2012-10-28 15:03:13 -07:00
43b6b5f200 Tweak nomenclature for special debug opcodes to match dex-format.html 2012-10-28 15:03:13 -07:00
16f257ee8f Use .param instead of .parameter and normalize param/local syntax 2012-10-28 15:03:13 -07:00
b11a01715a Centralize debug info related parsing into DebugInfo class 2012-10-28 15:03:13 -07:00
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
ba114e7211 Add a version of getInstructionIndexAtCodeOffset that defaults to exact 2012-10-28 13:14:13 -07:00
3615fd4b5b Use getType instead of getString for method return type 2012-10-28 13:13:48 -07:00