227 Commits

Author SHA1 Message Date
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
e27e44bee3 Refactor EnumEncodedValue to use a field reference 2012-11-10 17:36:16 -08:00
Ben Gruver
4060490e85 Get rid of old commented code block for methods in ClassDefinition 2012-11-09 23:56:13 -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
987cdc3e0e Sort the classes before disassembling 2012-11-09 22:54:39 -08:00
Ben Gruver
42b6dc3e37 Minor cleanup of synthetic accessor code 2012-11-09 22:34:20 -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
a8e05220c1 Refactor how method/field/string/type references are handled 2012-11-04 13:04:21 -08:00
Ben Gruver
7fe0543b66 Cache the MethodParameters in MethodDefinition 2012-11-03 18:06:47 -07:00
Ben Gruver
6b93c7cc35 Don't precompute the full method string in MethodDefinition 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
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
Ben Gruver
09058f9914 Don't forget to intern the switch labels 2012-10-31 20:42:17 -07:00
Ben Gruver
d3dd617d25 Switch key/value in the switch maps 2012-10-31 20:37:39 -07:00
Ben Gruver
4499f63c6c Add a space after the # for .end/.restart local 2012-10-31 20:28:35 -07:00
Ben Gruver
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
Ben Gruver
db4316ef6d Add TODO regarding parameter/local names 2012-10-31 19:49:52 -07:00
Ben Gruver
8b5490919c Merge branch 'master' into dexlib_redesign 2012-10-30 22:13:19 -07:00
Ben Gruver
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
Ben Gruver
16f257ee8f Use .param instead of .parameter and normalize param/local syntax 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
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
8b1508ee58 Start switching baksmali over to dexlib2 2012-10-21 23:17:56 -07:00
Ben Gruver
9f1d05eb44 Move Utf8Utils to util module, and split out StringUtils 2012-10-21 21:19:39 -07:00
Ben Gruver
bf95959ae4 Move ExceptionWithContext to Util module 2012-10-15 20:23:01 -07:00
Ben Gruver
1176b75123 Add support for new virtual table generation
This adds support for a fix in dalvik that changes the way
virtual tables are generated.

This new logic can be turned on with the -K option. This option
will be removed once the new functionality can be tied to a released
api level, at which point, it will be triggered when using an
appropriate api level with the -a option.
2012-10-11 19:59:49 -07:00
Ben Gruver
92a9aa2aa5 Minor cleanup of synthetic access related stuff 2012-10-08 19:18:06 -07:00
Ben Gruver
60bb8c675c Simply the generic-ity around Instruction, OffsetInstruction and InstructionMethodItem 2012-09-25 20:18:42 -07:00
Ben Gruver
de3a5f95ae Fix how the classpath is set for JavaExec gradle tasks 2012-09-24 00:20:30 -07:00
Ben Gruver
40c48da564 The great tab cleanup of 2012 2012-09-23 21:16:21 -07:00
Ben Gruver
181c04c839 Add copyright/license for build scripts 2012-09-16 00:03:44 -07:00
Ben Gruver
9382ba8591 Use JavaExec instead of ant.java 2012-09-15 23:17:12 -07:00
Ben Gruver
c9afead1a9 Implement proguard support 2012-09-15 22:56:10 -07:00
Ben Gruver
5cf9fe7c0a Generate fat jars for smali and baksmali 2012-09-15 19:21:34 -07:00
Ben Gruver
7d1263a4ff Implement versioning in the gradle build 2012-09-15 19:21:30 -07:00
Ben Gruver
1026c6c10c gradleize baksmali project 2012-09-15 15:58:43 -07:00
Ben Gruver
4af666e4a6 Remove support for the extended opcodes 2012-08-24 16:54:05 -07:00
Ben Gruver
5934004fe3 Allow try end addresses that fall in the middle of an instruction 2012-08-24 14:52:55 -07:00
Ben Gruver
343df2f456 Simplify deodexing
This makes it possible to deodex an odex file using only the dependencies
listed in the odex file itself. Adding extra dependencies via the -c
option should no longer be needed.
2012-07-05 21:55:54 -07:00
Ben Gruver
5b4073a85c Add the findbugs library to baksmali explicitly, rather than transitively through dexlib 2012-07-05 21:54:03 -07:00
Ben Gruver
a9ce1cf3ec For unknown opcodes, mention the original opcode value in a comment 2012-07-03 22:36:29 -07:00
Ben Gruver
5f2ad8bd13 Suppress some warnings when doing the proguard thing 2012-06-20 22:22:11 -07:00
Ben Gruver
0534f304b6 Use proguard on the assembled smali/baksmali jars
This is primarily to remove any unused classes, to reduce the jar size
2012-06-20 16:32:28 -07:00
Ben Gruver
7bb622e0b1 Set the default local to en-US, to avoid locale specific weirdness 2012-06-19 18:03:44 -07:00
Ben Gruver
3f70d08442 Gracefully handle duplicate methods and fields in baksmali
baksmali will emit duplicate methods and fields as commented blocks, when it
is safe to do so.
2012-06-19 16:03:20 -07:00
Ben Gruver
cf01f5db09 Refactor ClassDefItem
This primarily adds nullable/nonnull annotations, and fixes a few related issues
2012-06-05 18:34:09 -07:00