541 Commits

Author SHA1 Message Date
Ben Gruver
37f5436932 Allow interning classes into a DexPool externally 2016-10-01 17:07:18 -07:00
Ben Gruver
9c039ef1de Implement ReflectionUtils.dexToJavaName 2016-10-01 17:07:18 -07:00
Ben Gruver
8f27f45fb1 Add Opcodes.getDefault
This replace various uses of hardcoded Opcodes.forApi() with
Opcodes.getDefault() or other alternatives as applicable
2016-10-01 17:07:18 -07:00
Ben Gruver
0de5ef0ce7 Add support for the buggy post-default method vtable generation
This replicates the buggy vtable generation logic for Android 7.0
2016-10-01 17:07:17 -07:00
Ben Gruver
a54523e080 More default method vtable fixes 2016-09-24 18:16:55 -07:00
Ben Gruver
8081311d30 Implement toString for Method/Field/Proto references 2016-09-24 18:15:07 -07:00
Ben Gruver
17054d5c3d Load oat dependencies by default, if present 2016-09-24 18:11:50 -07:00
Ben Gruver
dcc7a2b806 Remove OatDexFile.getOatFile in favor of getContainer 2016-09-24 18:07:26 -07:00
Albert Gorski
8b309d62f4 Use guava's 'Joiner' instead of 'String.join'
This replaces the usage of the Java 8 'String.join' method with guava's
'Joiner' which is Java 6 compatible.
2016-09-22 23:25:11 -07:00
Ben Gruver
bb062e9336 Fix ReflectionUtils.javaToDexName
Fixes the conversion for primitive and array types
2016-09-22 19:50:27 -07:00
Ben Gruver
1aa9df3867 Fix the ordering of methods in the post-default-method vtable calculation 2016-09-22 19:49:29 -07:00
Ben Gruver
ecd89816b3 Fix up some minor issues with --normalize-virtual-methods 2016-09-19 09:08:54 -07:00
Ben Gruver
815f023e4e Use a class reference for interface methods in the vtable 2016-09-19 09:08:54 -07:00
Ben Gruver
41ba26d00a Improve the canNarrowAfterInstanceOf check when using an empty bootclasspath
If the types in question can't be resolved, we just assume that the
narrowing can't happen.
2016-09-19 09:08:54 -07:00
Ben Gruver
31ad2bc100 Refactor how classpath loading works 2016-09-19 09:08:53 -07:00
Ben Gruver
4c77ad7617 Minor fixes to OatVersions.txt 2016-09-19 09:08:53 -07:00
Ben Gruver
5544281ed6 Clean up some lint in ClassPath/ClassProto 2016-09-19 09:08:53 -07:00
Ben Gruver
db9f86dfdd Make getRegisterType throw AnalysisException instead of ExceptionWithContext
This will cause MethodAnalyzer to print more information when this occurs
2016-09-19 09:08:53 -07:00
Ben Gruver
26a4f1e603 Fix an issue with instance-of type inference
We should only infer the register type after an if-eqz/nez if it has a
single predecessor that is the instance-of instruction.
2016-09-19 09:08:53 -07:00
Ben Gruver
9ec379a561 Add support for vtable generation for post-default method ART
The interfaces are iterated over in a different order when populating the
vtable
2016-09-19 09:08:53 -07:00
Ben Gruver
d13be24e27 Don't propagate a non-narrowing conversion through a move 2016-09-17 21:30:28 -07:00
Ben Gruver
fbfe388e40 The list dex command should generate an error when used on a non-zip/oat file 2016-09-17 21:30:28 -07:00
Ben Gruver
d7d995cc2d Remove the now-unused experimental opcodes flag/functionality 2016-09-17 21:30:28 -07:00
Ben Gruver
e7e58a6996 Fix reading a dex file from a zip file 2016-09-04 14:00:01 -07:00
Ben Gruver
fdfb6d10f4 Update OatVersions.txt to version 86 2016-09-04 11:47:04 -07:00
Ben Gruver
22a2807101 Implement DexFileFactory.loadAllDexFiles 2016-08-30 22:36:15 -07:00
Ben Gruver
3587c6f2a6 Refactor DexFileFactory and implement new syntax for dex entries 2016-08-30 22:36:15 -07:00
Ben Gruver
41a5b4953c Fix the dump command to work with dex files in an oat file 2016-08-30 22:16:16 -07:00
Ben Gruver
4254a2073a Use a java 6-friendly string joiner 2016-08-27 12:01:35 -07:00
Ben Gruver
3735d4778f Merge branch 'master' into v2.2_WIP 2016-08-27 12:01:22 -07:00
Ben Gruver
7079014a29 Add more error detail when interfaces can't be fully resolved 2016-08-23 11:38:40 -07:00
Narayan Kamath
99b80bbc5a Revert "Add lambda experimental dalvik opcodes"
This reverts commit 144951a9e9e6c87866245f2bdeebf0ebedaa0e38.
2016-08-17 13:15:18 +01:00
Narayan Kamath
afc1f15939 smali/dexlib: deal with invoke-polymorphic / invoke-polymorphic/range.
- Introduces two new instruction formats, 45cc and 4rcc. As the name suggests,
  these instructions are similar to 35c and 3rc, expect that they encode an
  additional constant pool reference in their 4th byte.

- Introduce two new instructions, invoke-polymorphic and
  invoke-polymorphic/range - used to implement signature polymorphism.

- Allow instructions to directly reference the proto_id section of the
  dex file. This involves the introduction of a new kind of reference
  (MethodProtoReference) and has the side effect of cleaning up a fair
  amount of special casing in ProtoPool.

- Disable support for ART version based switches (and remove LambdaTest
  which depends on it). Experimental lambda support and support for ART
  version based switches will be removed in a follow up change.

Bug: 30550796
Test: test-art
Test: ./gradlew build
2016-08-17 13:03:12 +01:00
Ben Gruver
c347e68b46 Allow invalid register references in debug items related to locals.
Art doesn't complain about this, so we shouldn't throw an error when
encountering a dex file with something like this.
2016-07-10 21:35:07 -07:00
Ben Gruver
db49ae1d03 Track register narrowing via instance-of after a move 2016-05-28 18:52:26 -07:00
Ben Gruver
e474301e60 Revamp how classpath loading works 2016-05-28 18:51:42 -07:00
Ben Gruver
f84e0f4562 Fix up some nullness and other minor issues in MethodAnalyzer/AnalyzedInstruction 2016-05-16 16:58:54 -07:00
Ben Gruver
c4948a5c49 Add initial support for N preview odexes 2016-05-16 16:58:54 -07:00
Ben Gruver
bccdc809fa Add "list field offsets" and "list vtables" commands to baksmali
This is a reimplementation of the "DumpFields" and "DumpVtables" entry
points that were previously in dexlib2
2016-05-16 16:58:54 -07:00
Ben Gruver
90cacb9d0d Implement various list commands in baksmali
This adds commands to list strings, methods, fields, types and classes
2016-05-16 16:58:54 -07:00
Ben Gruver
735746595f Implement a new command line interface for smali 2016-05-16 16:58:54 -07:00
Ben Gruver
93100e57b2 Improve how the instance-of + if-eqz/if-nez type propagation works
We now perform the type propagation while analyzing the if-eqz/if-nez
instruction. Additionally, AnalyzedInstruction.setsRegister now has
special case logic to check for this case, so we don't incorrectly
propagate the original type past the if-eqz/if-nez
2016-04-23 14:01:36 -07:00
Ben Gruver
9802cf3428 Propagate the narrowed type for an if-nez after an instance-of 2016-04-23 11:08:21 -07:00
Alex Light
40bbf5c347 Dex version 37 support
Make dexlib able to read and write version 37 dex files.

Bug: 27809626

Change-Id: I3d0ca6201c7abe7763d2fb925e9ee1edbef24230
2016-04-04 11:00:02 -07:00
Ben Gruver
6417e812e1 Refactor ClassPath to take ClassProviders
This allows for a more general mechanism for providing defined classes
2016-02-26 21:13:29 -08:00
Ben Gruver
5b2943d89b Check for switch offset validity in the MethodAnalyzer 2016-02-20 12:04:47 -08:00
Ben Gruver
8533ab7429 Merge branch 'master' into smalidea 2016-02-13 15:43:37 -08:00
Ben Gruver
3e265038f5 Implement support for adding new labels to a MutableMethodImplementation 2015-10-18 13:24:34 -07:00
Ben Gruver
b8e255f389 Add support for 64-bit oat files 2015-10-17 14:47:10 -07:00
Ben Gruver
e202aeede5 Pass in the Opcodes to use for SyntheticAccessorFSM 2015-10-17 13:50:26 -07:00