285 Commits

Author SHA1 Message Date
Ben Gruver
05201785fe Clean up some more TODOs 2013-05-03 21:02:39 -07:00
Ben Gruver
d38f3a7983 Fix up line number handling to be unsigned int safe 2013-05-03 19:35:47 -07:00
Ben Gruver
6fc32629c2 Look up ClassDefs in ClassPath using a hashmap 2013-04-30 21:57:13 -07:00
Ben Gruver
6893c660a3 Remove the spurious logging of classpath file names in ClassPath 2013-04-30 21:57:13 -07:00
Ben Gruver
936cc551f7 Clean up some TODOs 2013-04-30 21:57:08 -07:00
Ben Gruver
d8d16fd844 Get rid of the unneeded classDataOffset in DexBackedClassDef 2013-04-30 21:40:36 -07:00
Ben Gruver
df8e480211 Write the correct header version based on the api level 2013-04-30 20:43:57 -07:00
Ben Gruver
03a4ffa1f4 Delete some unneeded TODOs 2013-04-29 23:49:55 -07:00
Ben Gruver
42627b850c Add new DexBuilder interface
This is a different "front-end" for the existing writer functionality that
is meant to be a more memory efficient method for building a new dex file
from scratch
2013-04-29 23:05:05 -07:00
Ben Gruver
1726f028a8 Get rid of the annotation set ref list pool 2013-04-29 20:10:54 -07:00
Ben Gruver
fbdc6cb9cb Clean up how the annotation directory items are written 2013-04-29 20:10:54 -07:00
Ben Gruver
816e793f81 Tweak to the numSectionItems field naming in DexWriter 2013-04-29 20:10:54 -07:00
Ben Gruver
242dd62a71 Get rid of the encoded array pool 2013-04-29 20:10:50 -07:00
Ben Gruver
0f198bc78b Fix some nitpicks in dex writer code path 2013-04-28 12:17:45 -07:00
Ben Gruver
3c3a3c4af8 Add missing @Nonnull attributes for various EncodedValue.getValue() methods 2013-04-28 01:11:23 -07:00
Ben Gruver
1bf6f23245 Implementation of new generificationified writer functionality 2013-04-27 22:23:30 -07:00
Ben Gruver
afc0a7d325 If an exception occurs while dumping, write out what we have so far 2013-04-27 22:22:55 -07:00
Ben Gruver
8340ecf3d5 Fix potential formatting issue with local variable signatures in dump output 2013-04-27 22:22:55 -07:00
Ben Gruver
70c5b247e6 Fix formatting issue with negative jump offsets in dump output 2013-04-27 22:22:55 -07:00
Ben Gruver
231034cf95 Make sure to truncate the output file before writing the new dex file 2013-04-20 01:28:31 -07:00
Ben Gruver
2fe6041fa9 Add support for empty sparse switch data instructions 2013-04-20 01:28:31 -07:00
Ben Gruver
c89097680e Add support for empty packed switch data instructions 2013-04-20 01:28:31 -07:00
Ben Gruver
4879652a47 Remove the unused classes field from writer.DexFile 2013-04-20 01:28:31 -07:00
Ben Gruver
f939e912b5 Fix issue with out-of-order iteration of virtual methods 2013-04-19 14:29:07 -07:00
Ben Gruver
b6435e7a47 Add support to smali for a .source directive with no source file 2013-04-18 00:27:16 -07:00
Ben Gruver
83f77f51aa Refactor how api specific Opcodes work (make them non-static) 2013-04-17 22:32:08 -07:00
Ben Gruver
9062640179 Fix issue with interning proto_id_items while writing dex file 2013-04-17 00:25:05 -07:00
Ben Gruver
3d5423ed2b Tweak how hashCode and equals works for MethodReferences
This fixes an issue where method references weren't being properly
interned when generating a dex file
2013-04-17 00:13:12 -07:00
Ben Gruver
dda097947f Fix implementation of equals for BaseTypeReference
This fixes the implementation so it matches what is described in the
documentation for the TypeReference interface. Specifically, it allows
for comparison to a CharSequence
2013-04-17 00:12:20 -07:00
Ben Gruver
36b6a31685 Fix issue with empty superclass when dumping a Ljava/lang/Object; class 2013-04-16 23:19:06 -07:00
Ben Gruver
0dceb148f3 Update to latest antlr3/string template 2013-04-15 20:47:53 -07:00
Ben Gruver
6c15046f2b Refactor smali to use dexlib2
Array data instructions aren't working yet
2013-04-15 20:47:00 -07:00
Ben Gruver
ab73502b60 Massage the try blocks before writing them out to a dex file 2013-04-14 18:36:05 -07:00
Ben Gruver
8c3d16b7ee Add logic to TryListBuilder to merge contiguous try blocks with identical handlers 2013-04-14 18:14:06 -07:00
Ben Gruver
5916df9999 Port TryListBuilder from dexlib 2013-04-14 17:17:00 -07:00
Ben Gruver
bddef6af3c Always use one of 2 pre-built ImmutableBooleanEncodedValue instances 2013-04-13 21:44:56 -07:00
Ben Gruver
f24f26738d Add AnnotationVisibility.getVisibility(String) 2013-04-13 21:44:18 -07:00
Ben Gruver
ddf18a996e Add convenience constructor for ImmutableClassDef 2013-04-13 20:19:41 -07:00
Ben Gruver
8979759556 Gracefully handle duplicate fields/methods in baksmali 2013-04-13 18:55:34 -07:00
Ben Gruver
0a18ea7f8b Separate direct/virtual methods and static/instance fields in the ClassDef interface
This is unfortunately required to support not-quite-well-formed dex files
containing duplicate static/instance fields, or duplicate direct/virtual methods,
which dalvik inadvertently allows.

In cases when there are duplicate fields/methods in the same category, we
unambiguously remove/hide the latter duplicate fields/methods.
2013-04-13 16:25:37 -07:00
Ben Gruver
2363e6e43c Gracefully handle unknown instructions 2013-04-11 23:58:43 -07:00
Ben Gruver
5fa302678c Add support for custom inline tables 2013-04-10 21:14:46 -07:00
Ben Gruver
fd258ad543 Add support for class path entries that look like dalvik-cache entries 2013-04-09 23:44:06 -07:00
Ben Gruver
2887ade533 Remove unneeded/unused getFormat() method in UnresolvedOdexInstruction 2013-04-09 23:43:02 -07:00
Ben Gruver
45dfbd6d58 Remove invalid assert 2013-04-09 23:42:33 -07:00
Ben Gruver
39b3a7c5a9 Fix issue when deodexing invoke-object-init/range instruction 2013-04-09 23:42:20 -07:00
Ben Gruver
ac2686b3fc Add the ability to parse dependencies from odex files 2013-04-09 23:41:27 -07:00
Ben Gruver
5c6cad2822 Fix an issue when there's a dir with the same base name as a class path entry 2013-04-09 17:42:37 -07:00
Ben Gruver
8c2d92d954 Enforce strict reference equality for uninit ref register types 2013-04-08 21:45:22 -07:00
Ben Gruver
3f05570b6b Always use .equals for comparing RegisterType instances 2013-04-08 20:27:35 -07:00