Ben Gruver
37d14becd1
Fix register propagation when overriding a register type from a predecessor
2015-10-14 21:57:23 -07:00
Ben Gruver
398630dde5
Infer the register type based on the result of an instance-of instruction
...
In oat files, it's possible that a check-cast is removed based on the
register being provably of the type being cast to, based on the result
of an instance-of check.
Supporting this in general would require more sophisticated static analysis
than is currently done. Instead, this adds a special-case specifically
for the case of an instance-of followed immediately by an if-eqz
2015-10-13 21:59:47 -07:00
Ben Gruver
ccf087b0dd
Bump up MAX_OAT_VERSION to 71
2015-10-01 22:51:10 -07:00
Ben Gruver
7844089286
Add support for alternate field ordering starting at oat version 67
2015-10-01 22:50:35 -07:00
Ben Gruver
827e2db34d
Add support for normalizing virtual methods
...
This is useful, for example, when comparing the result of deodexing with
the original dex file, to remove the "false" differences caused by the
different potential ways to reference a given virtual method.
2015-09-30 20:36:12 -07:00
Ben Gruver
c8c70ac58e
Add support for calculating field offsets for art
2015-09-30 20:36:12 -07:00
Ben Gruver
64785d79a3
Add support for using an oat file as the boot class path
2015-09-30 20:36:12 -07:00
Ben Gruver
8920228819
Add oat support in DexFileFactory
2015-09-30 20:36:12 -07:00
Ben Gruver
3ff884b1c3
Add art-specific opcodes and opcode values
2015-09-29 23:41:30 -07:00
Ben Gruver
e5266afb14
Add a minimal parser for oat files
2015-09-29 23:40:52 -07:00
Alex Light
c456c55c40
Make smali respect order of implements
...
Previously smali would reorder implements directives to be
alphabetical in the dex file. In the Java 8 Language the order of
interfaces may affect the order of initializer invocation when using
default methods. Therefore we will preserve this order in
smali/baksmai.
Bug: 24338722
Change-Id: I6851b02a5402c7d4cd4b60af54052c320e48d0bf
2015-09-24 13:04:30 -07:00
Ben Gruver
0c7e7b7ffc
Add ability to list methods/fields/types when assembling with smali
...
This can be useful in analyzing why you are going over the 64k
method/field/type limit
2015-09-05 16:11:21 -07:00
Ben Gruver
4d8ec4c795
Handle invalid debug item offsets more gracefully
2015-08-26 15:55:30 -07:00
Ben Gruver
3065d6b7de
Add backwards compatible version of DexFileFactory.loadDexFile and Opcodes
...
Keep the old prototype, so we don't break existing code.
2015-06-18 17:44:30 -07:00
Ben Gruver
b960e8950b
Replace a missed usage of Iterators.emptyIterator()
2015-06-18 17:40:57 -07:00
Ben Gruver
7c97ddbb45
Remove usages of the deprecated Iterators.emptyIterator() method
2015-06-18 13:34:12 -07:00
Ben Gruver
0f1e995099
Add the generated accessorTest to source control
...
Some java compilers don't generate the synthetic accessor methods in the
way that the accessorTest is trying to test. So we build the test dex
file using a known-good compiler and check it in, ensuring the test is
always run using an appropriate dex file.
2015-05-23 11:26:35 -07:00
Ben Gruver
abd113eb3b
Ensure the stream is closed in DexFileFactory.loadDexFile
2015-04-09 21:33:33 -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
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
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