378 Commits

Author SHA1 Message Date
Ben Gruver
1d26e1be09 Rename the list classpath command to list dependencies 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
86459bbb86 Use the specified api level when loading a dex file in the disassemble command 2016-09-19 09:08:53 -07:00
Ben Gruver
fb10b5731c Add AnalysisArguments.loadClassPathForDexFile 2016-09-19 09:08:53 -07:00
Ben Gruver
7e8afc4d8a Clean up DexInputCommand a bit 2016-09-19 09:08:53 -07:00
Ben Gruver
12a3fd2712 Fix an issue when using the list classpath command with an odex file 2016-09-19 09:08:53 -07:00
Ben Gruver
9f794030da Fix how parameter delegates are handled 2016-09-17 21:30:28 -07:00
Ben Gruver
c12b7e6e00 Change the classpath arguments to be split only by a colon 2016-09-17 21:30:28 -07:00
Ben Gruver
c9c8ddb3ef Don't manually split the classes argument for list vtables 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
30bdb7fda9 Do a cleanup pass on the various commands/arguments/help text 2016-09-05 10:07:58 -07:00
Ben Gruver
149e989994 The list field offsets command doesn't need the --check-package-private-access parameter 2016-09-04 14:09:15 -07:00
Ben Gruver
99394b3daf Rework and fix the --resolve-resources parameter 2016-09-04 13:58:54 -07:00
Ben Gruver
763caf1ef6 Add help verbiage for the new syntax for specifying a specific dex entry
This also pulls up dex input parameter into the base DexInputCommand
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
36be93a76a Make DumpCommand a DexInputCommand 2016-08-30 22:16:16 -07:00
Ben Gruver
3735d4778f Merge branch 'master' into v2.2_WIP 2016-08-27 12:01:22 -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
442ebd2893 Reword the "multiple entries" error to match the new CLI 2016-05-30 13:05:11 -07:00
Ben Gruver
ca48e6f7d0 Revamp the CLI usage/help formatting 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
8a5a6e3fc5 Add a --classes parameter to the list vtables command 2016-05-16 16:58:55 -07:00
Ben Gruver
f66362d073 Fix up the deodex warning 2016-05-16 16:58:54 -07:00
Ben Gruver
175480d4d0 Add a command to list the classpath stored in an oat or odex file 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
75cf7e4c64 Add a command to baksmali to list the dex files in an apk/oat 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
0e9be306a2 Update url in --version message 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
5a5eafb818 Implement a new command line interface for baksmali 2016-05-16 16:58:53 -07:00
Ben Gruver
87d10dac27 Add more programmatic-friendly entry points for smali/baksmali
This adds entry points that are more friendly to programmatic usage. E.g.
no calls to System.exit()
2016-02-28 12:19:27 -08:00
Ben Gruver
11d179bfdb Get rid of the default 6 thread maximum thing 2016-02-28 11:22:16 -08: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
6429b3daa9 Clean up the jar naming
The previous naming was interfering with 'gr install' installing the
artifacts locally.
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
e202aeede5 Pass in the Opcodes to use for SyntheticAccessorFSM 2015-10-17 13:50:26 -07:00
Ben Gruver
3124e94d4b Add support for static volatile opcodes in OdexedFieldInstructionMapper
This fixes a regression introduced in 2.1
2015-10-16 19:07:50 -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
d6b17b9935 Don't add an empty .param annotation when not writing debug info 2015-10-13 18:46:13 -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
d6043955f5 Fix minor issue in DisassemblyTest 2015-10-01 19:03:23 -07:00
Ben Gruver
ea3fdd7e86 Merge branch 'master' into smalidea 2015-10-01 08:34:21 -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
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