419 Commits

Author SHA1 Message Date
Ben Gruver
75bef01d10 Merge branch 'master' into smalidea 2015-03-18 21:00:32 -07:00
Ben Gruver
1aad736c20 Ensure that sparse switch items are written out in the correct order 2015-03-17 21:18:19 -07:00
Ben Gruver
0c982a02f1 Add Member and Annotatable interfaces 2015-03-16 20:52:55 -07:00
Ben Gruver
bf167c2f0e Make sure the elements are sorted in an encoded annotation 2015-03-16 20:36:34 -07:00
Ben Gruver
b76dee7ebd Don't assume dx is on-path. Rather, grab it from maven central
The version of dx in maven central seems to be fairly old, but it works
well enough for our purposes.
2015-03-16 19:54:57 -07:00
Igor Murashkin
144951a9e9 Add lambda experimental dalvik opcodes
* Add new -X/--experimental flag to [dis]assemble opcodes not in art yet
* Add new opcodes liberate-variable, box-lambda, unbox-lambda,
                  capture-variable, create-lambda, invoke-lambda
* Add support for encoding 25x instructions
* Adds LambdaTest to check new opcodes assemble/disassemble properly

TODO: invoke-lambda-range

Change-Id: I5c8bcbfa8b6cb9a13ef2017fce2d1b7fda6e11c3
2015-03-16 11:40:58 -07:00
Ben Gruver
8c1d8ddef2 Merge branch 'master' into smalidea3 2015-03-04 20:58:14 -08:00
Ben Gruver
6a56d9a9e9 Merge pull request #29 from yirkha/master
Fix for Dalvik VM crash on parameter annotations
2015-03-03 18:08:44 -08:00
Ben Gruver
3279a8cd4b Simplify how the accessorTest is built and run 2015-03-01 22:30:33 -08:00
Jiri Hruska
5dde46b43d Fix for Dalvik VM crash on parameter annotations
Dalvik VM before Jelly Bean MR1 (4.2) crashes if there are any
NO_OFFSET (0) values in parameter annotation list.
(https://code.google.com/p/android/issues/detail?id=35304)
2015-02-19 02:59:41 +01:00
Ben Gruver
e6da8cd564 Massage the tries before using them for method analysis 2015-02-01 20:14:37 -08:00
Ben Gruver
e778f7b865 Make the checkPackagePrivateAccess functionality an option
This is only needed for 4.2.0, but not 4.2.1. Both are api 17, so we can't
tie this functionality to an api level.
2014-12-28 15:03:02 -08:00
Ben Gruver
83ec5cf9a3 Merge pull request #25 from yyjdelete/patch-1
checkPackagePrivateAccess only for API 17(4.2)
2014-12-28 14:49:44 -08:00
Ben Gruver
d83c439ce2 Fix some generics issues when compiling with java 8 2014-12-28 14:15:08 -08:00
Ben Gruver
aae58716e7 Fix some javadoc issues 2014-12-28 14:14:19 -08:00
Ben Gruver
d15e31526f Expose the various fixed-size item counts in DexBackedDexFile 2014-12-28 12:25:03 -08:00
Ben Gruver
7296c9e957 Refactor VariableSizeLookaheadIterator
Previously, when referencing instance fields from readNextItem,
the fields wouldn't have been initialized yet on the first call to
readNextItem
2014-12-28 12:15:17 -08:00
yyjdelete
d1dbf6b14b Use options.checkPackagePrivateAccess 2014-11-14 21:59:08 +08:00
yyjdelete
62c103d92a checkPackagePrivateAccess only for API 17(4.2)
Google revert this for compatibility.
see 7284c78e14 for details.

BTW, it seems that is also disabled for late 4.2
2014-11-14 20:50:13 +08:00
Ben Gruver
686cf35c8e Add some additional checks related to instruction size 2014-11-06 23:03:46 -08:00
Connor Tumbleson
6811d13935 Implement dex entry for non classes.dex files 2014-11-06 23:09:44 -06:00
edwardxwu
d354893f71 Fixed the bug of not setting the location field of the instruction in addInstruction(i,instruction) method 2014-08-29 20:45:22 -07:00
Ben Gruver
0d8418ff1f Allow but ignore multiple exception handlers for the same exception 2014-07-21 18:54:30 -07:00
Ben Gruver
4143313b05 Fix potential NPE in MethodAnalyzer 2014-07-19 20:27:00 -07:00
Ben Gruver
d33fd6773c Implement implicit method/field references in baksmali 2014-07-19 20:26:50 -07:00
Ben Gruver
a37e508ffa Add missing "break" from switch statement in BuilderClassPool 2014-07-15 22:57:25 -07:00
Ben Gruver
5280047b42 Ensure the annotation elements are sorted when written 2014-07-15 22:54:41 -07:00
Ben Gruver
2d8cbfe6bc Add support for non-standard invoke-object-init/range instructions 2014-02-02 19:29:26 -08:00
Ben Gruver
4357de47e3 Add new experimental dex rewriter functionality 2014-01-18 20:34:30 -08:00
Ben Gruver
78328a6035 Minor comment fix in MutableMethodImplementation 2014-01-18 15:47:57 -08:00
Ben Gruver
1d28b32ff5 Refactor the maven upload build stuff
This also adds the required javadoc jars
2014-01-18 11:33:39 -08:00
Ben Gruver
5b411f3447 Add gradle configuration for uploading smali artifacts to maven 2014-01-17 02:04:07 -08:00
Ben Gruver
90db3a16b7 Lazily create the lists in MethodLocation
Millions of MethodLocations can be created and kept in memory when
using the Builder interface to build a large dex file. The arrays
backing these lists were taking up a large amount of memory.
2014-01-16 21:29:26 -08:00
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