386 Commits

Author SHA1 Message Date
Ben Gruver
029ad25c66 Skip the call to String.format when annotating, if there are no values 2013-12-12 01:35:29 -08:00
Ben Gruver
4f2620415d Add better handling for various types of invalid instructions 2013-12-08 17:44:11 -08:00
Ben Gruver
9057764c22 Add ReferenceInstruction.getReferenceType() 2013-12-07 15:11:37 -08:00
Ben Gruver
d3ba85b2ee Fix typo in method index OOB error message 2013-12-07 15:11:37 -08:00
Ben Gruver
dc802b0660 Make CodeItem annotations more robust 2013-12-07 15:11:37 -08:00
Ben Gruver
d7cd52308e Fix an issue with nop opcodes with a non-null second byte 2013-12-07 15:11:37 -08:00
Ben Gruver
b49126325f Fix the start offset when calculating the signature header value 2013-11-10 22:07:02 -08:00
Ben Gruver
20f675b86b When writing a debug item, always include all parameters 2013-11-10 22:07:02 -08:00
Ben Gruver
08d90ec360 Don't write out 0-length type lists 2013-11-10 22:07:02 -08:00
Ben Gruver
f6958ae4bc Don't trim empty parameter annotations 2013-11-10 22:07:02 -08:00
Ben Gruver
263083faed Use StringReference for MethodImplementationBuilder.addSetSourceFile 2013-10-23 14:23:35 -07:00
Ben Gruver
a2bf7f64bc Fix issue with BuilderPackedSwitchPayload instructions
The transformation is performed lazily, and the keys were incorrect
when iterating over the elements more than once
2013-10-17 16:46:06 -07:00
Ben Gruver
899b1e6611 Improve MutableMethodImplementation for external use
Add various utility methods and use more specific overrides, to better
allow external users to access labels
2013-10-14 17:45:46 -07:00
Ben Gruver
902ba7d72d Fix annotation/initial value issues when iterating over fields/methods in a DexBackedDexFile
Make sure to make a new annotation/initial value iterator when making a new
field/method iterator
2013-10-12 02:14:02 -07:00
Ben Gruver
9f48c72390 Fix issues with converting switch statements in MutableMethodImplementation 2013-10-12 01:50:53 -07:00
Ben Gruver
135631b11b Fix issue with Format21lh instructions in MutableMethodImplementation 2013-10-12 01:10:38 -07:00
Ben Gruver
987ac1ed12 Fix the name and type being swapped when converting to ImmutableDebugInfo 2013-10-11 21:50:01 -07:00
Ben Gruver
bc6fcd5ae3 Fix accidental case fall-throughs in MutableMethodImplementation 2013-10-11 21:32:33 -07:00
Ben Gruver
1697b1d97d Fix "hat" literal conversion in MutableMethodImplementation 2013-10-11 21:32:01 -07:00
Ben Gruver
6926ece0cd Check for null before using Iterables.filter 2013-10-10 19:46:02 -07:00
Ben Gruver
216ca5376b Always use the 035 version magic value when writing a dex file 2013-10-10 19:37:56 -07:00
Ben Gruver
7618e1636c Make extra sure we don't output blank debug items 2013-09-28 17:57:33 -07:00
Ben Gruver
84be16bf51 Fix DebugItems in the new builder stuff 2013-09-21 14:40:49 -07:00
Ben Gruver
edd961477e Remove the now unused builder instructions and instruction factories 2013-09-15 12:55:36 -07:00
Ben Gruver
f7d6d5fade Gracefully handle instructions with invalid references 2013-09-14 19:53:21 -07:00
Ben Gruver
45b8a4dae8 Allow "large" uleb128 values for method/field index deltas 2013-09-14 12:47:23 -07:00
Ben Gruver
5ff4ee9a3f Add missing copyright/license headers 2013-09-14 00:43:41 -07:00
Ben Gruver
6762350ca0 Add ability to converting MethodImplementation to MutableMethodImplementation 2013-09-14 00:32:32 -07:00
Ben Gruver
9a2de93a99 Implement just-in-time instruction fixup due to string jumboification 2013-09-08 21:41:23 -07:00
Ben Gruver
99b46173c5 Generify the IO requirements for writing a dex file
The DexWriter implementations now write to a generic "DexDataStore", instead
of writing directly to a file.

Also, writing of the DebugItems and CodeItems are linked, with the code
items being written to a temporary location, and then the entire code item
section is written as a batch after the debug item section.
2013-09-08 15:30:58 -07:00
Ben Gruver
160449b83a Implement instruction fixing in MutableMethodImplementation 2013-09-07 14:54:16 -07:00
Ben Gruver
e80efa670f Implement instructions for the method builder 2013-09-02 12:20:13 -07:00
Ben Gruver
688611814d Implement debug items for the method impl builder 2013-09-01 16:44:20 -07:00
Ben Gruver
bb7937fd30 Get rid of the MethodItem concept 2013-09-01 09:37:49 -07:00
Ben Gruver
897832aa15 Implement try blocks for the method builder 2013-08-31 15:37:10 -07:00
Ben Gruver
160fc1cdba Split off a separate MutableMethodImplementation and implement labels 2013-08-31 14:12:58 -07:00
Ben Gruver
e94ee6fe80 Delete InstructionWriteUtil 2013-08-25 11:07:43 -07:00
Ben Gruver
dff046e1b5 Delete BuilderMethodImplementation, and simplify the DexWriter stuff accordingly
DexBuilder.internMethod now accepts a generic MethodImplementation instead. It is assumed that
the various String/Type/etc. references will have been interned by and returned from the
appropriate DexBuilder methodDelete BuilderMethodImplementation

DexBuilder.internMethod now accepts a generic MethodImplementation instead. It
is assumed that the various String/Type/etc. references will have been
interned by and returned from the appropriate DexBuilder method
2013-08-24 21:53:05 -07:00
Ben Gruver
0cd8417155 Remove the Instruction template parameter from DexWriter 2013-08-24 21:49:26 -07:00
Ben Gruver
e9aa2c230f Remove the Instruction template parameter from InstructionFactory 2013-08-24 21:47:57 -07:00
Ben Gruver
ca5de1d803 Remove the Instruction template parameter from ClassSection 2013-08-24 21:36:21 -07:00
Ben Gruver
6f135aeb74 Remove the ExceptionHandler template parameter from ClassSection
In DexBuilder, instead of statically specifying a specific ExceptionHandler
type, we dynamically check that the exception type reference returned from
the ExceptionHandler is of the proper type
2013-08-24 21:29:20 -07:00
Ben Gruver
9bbcaae91f Remove the DebugItem template parameter from ClassSection
In DexBuilder, instead of statically specifying a specific DebugItem type,
we dynamically check that the various String/Type References returned by
the items are of the proper type
2013-08-24 21:29:10 -07:00
Ben Gruver
a4e0efe9a5 Add ExceptionHandler.getExceptionTypeReference method 2013-08-24 20:23:12 -07:00
Ben Gruver
f320ed5293 Remove some incorrectly applied @Nonnull attributes 2013-08-24 18:53:32 -07:00
Ben Gruver
f97289cf3e Remove unneeded format precondition checks
The format precondition check should always occur in the base instruction
class
2013-08-24 18:53:32 -07:00
Ben Gruver
766f285a70 Initial stub MethodImplementationBuilder and integration into smali 2013-08-24 18:53:26 -07:00
Ben Gruver
e636af4931 Fix bound check for short offset in Precoditions class 2013-06-22 13:07:39 -07:00
Ben Gruver
198e0816cf Fix argument name for offsets in Preconditions class 2013-06-22 13:02:33 -07:00
Ben Gruver
a96cdbee3a Merge pull request #15 from izzytwosheds/bugfixes
Interface methods in the vtable are called on current class, not interface
2013-06-15 20:38:14 -07:00