399 Commits

Author SHA1 Message Date
Ben Gruver
d82252e4d6 Make sure to close the writer after dumping 2018-05-23 13:34:16 -07:00
Andreas Gampe
681222d391 Fix NaN comparison
Use Float.isNaN/Double.isNaN to correctly detect NaN.

Detected by errorprone.
2018-01-23 11:56:02 -08:00
Ben Gruver
dd22a795d8 Add an option to baksmali to allow disassembling odex opcodes
These instructions should never be present in a dex file, only in odex/oat
files. However, it's sometimes useful to be able to disassemble an otherwise
valid dex file that happens to contain odex instructions.
2017-05-15 17:01:44 -07:00
Ben Gruver
9e3e86fda0 Improve the special case logic when propagating register types
This improves the logic dealing with initializing uninitialized reference and
narrowing register types after an instance-of
2017-03-12 15:41:14 -07:00
Ben Gruver
961c21be98 Fix possible NPE when generating accessor comments 2017-03-11 13:29:14 -08:00
Ben Gruver
8e1afdda32 Clean up how api levels are handled in various places
Now that dex files store an associated Opcodes instance, we don't need to
pass the api level around as much.
2016-10-23 22:09:52 -07:00
Ben Gruver
22e85fc3ff Add a --classes option for disassemble/deodex commands 2016-10-16 13:43:34 -07:00
Ben Gruver
f2935deb16 Fix classpath loading for pre-art odex files 2016-10-15 15:39:11 -07:00
Ben Gruver
686d628128 Bad proguard! Don't strip out jcommander classes! 2016-10-04 00:10:46 -07:00
Ben Gruver
5d77b13557 Add proguard rule to keep ColonParameterSplitter 2016-10-03 20:01:39 -07:00
Ben Gruver
c2231759f5 Fix the proguard keep rules for smali/baksmali 2016-10-02 16:04:29 -07:00
Ben Gruver
6f8366a7a3 Fix the default classpath dir for an input file in the current directory 2016-10-02 12:18:52 -07:00
Ben Gruver
7f20300b92 Change DexInputEntry.loadDexFile to accept an Opcodes object instead of an api 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
7cb0937324 Add the ability to specify the oat version to use when listing vtables 2016-09-24 18:26:35 -07:00
Ben Gruver
c3270cf991 Don't attempt to list vtables for interface classes 2016-09-24 18:10:52 -07:00
Ben Gruver
158f6b0b44 Add the directory containing the input file as a classpath search dir by default 2016-09-24 18:10:18 -07:00
Ben Gruver
dcc7a2b806 Remove OatDexFile.getOatFile in favor of getContainer 2016-09-24 18:07:26 -07:00
Ben Gruver
b7f98c8758 Use --check-package-private-access by default for oat files 2016-09-19 09:08:54 -07:00
Ben Gruver
ecd89816b3 Fix up some minor issues with --normalize-virtual-methods 2016-09-19 09:08:54 -07:00
Ben Gruver
12a3d71759 Add the ability to specify an empty bootclasspath 2016-09-19 09:08:54 -07:00
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