1737 Commits

Author SHA1 Message Date
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
Frieder Bluemle
58a4809720 Update Gradle wrapper to 3.5 2017-05-15 15:46:58 -07:00
Wojtek Kaliciński
dd11921529 Fix for counting method implementation sizes 2017-04-25 12:02:57 -07:00
Wojtek Kaliciński
b65e942e7e Add support for getting byte sizes to dex backed references 2017-04-21 13:54:27 -07:00
Ben Gruver
76d69c7466 Bump smalidea version to v0.05 2017-03-31 17:06:53 -07:00
Ben Gruver
10fd792f59 Correctly calculate the offset for switch targets in smalidea
This fixes an issue where watches on registers (among other things) don't
work inside a method containing a switch statement, due to a failure
analyzing the method.
2017-03-31 17:06:53 -07:00
Ben Gruver
cef72530bb Merge pull request #504 from Furniel/master
Fixed Android M and N deodexing(Fixes #503)
2017-03-29 10:07:49 -07:00
Furniel
9df7a67273 Fixed Android M and N deodexing(Fixes #503) 2017-03-29 12:39:44 +03:00
Ben Gruver
48cde6219d Add initial support for vdex files
This is the bare minimum to get deodexing to work with vdex files.
2017-03-25 16:25:49 -07:00
Ben Gruver
bda4477bae Update version to 2.2.0 2017-03-22 00:15:14 -07:00
Ben Gruver
e72e07fc2e Update version to 0.04 2017-03-21 23:53:11 -07:00
Ben Gruver
8ed2f18601 Add Project argument to SmaliClassFinder constructor
In some cases, scope.getProject() may be null. Apparently, IDEA will
automatically pass in the project if you specify one in the constructor.
See, e.g. MigrationElementFinder in the IDEA source.
2017-03-21 23:26:06 -07:00
Ben Gruver
a15fc84ace Add missing read actions in SmaliPositionManager 2017-03-21 22:03:42 -07:00
Ben Gruver
fa13b13bbd Update linked version of IDEA to 2016.3.5 2017-03-21 21:59:02 -07:00
Ben Gruver
1390c6cff6 getStubOrPsiParent() -> getParentByStub() 2017-03-21 21:22:29 -07:00
Ben Gruver
75fdec6e1d Use newer jcommander version for release
The newer version has some fixes we need, but we should still ensure
that we can compile against the old version, since that's the version
currently in AOSP.
2017-03-21 21:22:06 -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
152250d900 Fix missing format argument 2017-03-11 13:20:23 -08:00
Ben Gruver
cd1e5c5068 Fix download link in README.md 2017-02-22 17:05:01 -08:00
Ben Gruver
1a83d5a2d0 Propagate sideways conversions after an instance-of + if-eq/if-eqz
Previously, we only propagated the conversion if it was a narrowing
conversion, to avoid problems that can occur with member access with
widening conversions.

However, it should be safe to do the conversion for a "sideways"
conversion - one that is neither widening or narrowing.

This can happen if we don't yet have full knowledge of the register types,
or, less likely, if the "true" branch is impossible to reach.

In the first case, we should get better type info as we continue to analyze
the method, and we'll revisit the conversion once we have better type info.

Or, if it really is an impossible conversion, we still want to propagate
the type from the instance-of to the true branch.
2017-01-07 18:11:39 -08:00
Ben Gruver
adb12356c3 Don't perform type narrowing after an instance-of on dalvik 2016-11-12 12:54:02 -08:00
Ben Gruver
5e387e5931 Add better error message for when instruction offset is out of range 2016-11-06 14:25:25 -08:00
Ben Gruver
a0ccd94bf9 Improve the error message for a truncated last instruction 2016-10-23 22:10:11 -07: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
7a95aa296f Add additional exception info if StringReference doesn't resolve to a String 2016-10-23 13:55:23 -07:00
Ben Gruver
8f7d1a897d Fix null start/end locations in SmaliCodeFragmentFactory.evaluateRegister 2016-10-23 13:15:32 -07:00
Ben Gruver
0e773cbe9b Don't attempt to evaluate an out-of-bounds register 2016-10-23 12:49:19 -07:00
Ben Gruver
ca0a4bdf37 Remove some unneeded casts in BuilderClassDef 2016-10-23 11:54:50 -07:00
Ben Gruver
fd8a1b4adc Make BuilderAnnotationSet public
It is used as a return type of public api BuilderClassDef.getAnnotations
2016-10-23 11:54:14 -07:00
Ben Gruver
c8e896b984 Add default dependencies for Android N 2016-10-17 16:19:15 -07:00
Ben Gruver
cb14aa7074 Remove obsolete TODO 2016-10-17 16:16:28 -07:00
Ben Gruver
8fa96e2fcd Resolve odex dependencies to jar files when needed 2016-10-17 16:15:17 -07:00
Ben Gruver
5401a9cbaa Bump the version number to v2.2b4 2016-10-16 14:18:56 -07:00
Ben Gruver
16d4b5656b Use a BufferedInputStream in ZipDexContainer.isDex 2016-10-16 13:46:42 -07:00
Ben Gruver
a6593575e7 Be more precise about narrowing after an instance-of
Only do the additional narrowing when all predecessors of the instance-of
are equivalent move instructions.
2016-10-16 13:45:30 -07:00
Ben Gruver
22e85fc3ff Add a --classes option for disassemble/deodex commands 2016-10-16 13:43:34 -07:00
Albert Gorski
43669ecc6e Ensure all smali files are closed after the writing is complete
This makes sure that all smali files are closed after writing to them by
surrounding the writer code with a try/finally block that closes the output
stream once the writing has completed or when an exception occurs.
2016-10-15 21:12:23 -07:00
Albert Gorski
e75f2b230a Ensure the ZipFile is closed in isZipFile() of ZipDexContainer
When calling isZipFile() in ZipDexContainer, the ZipFile would remain open if
the file was in fact a zip file but the ZipFile object would then go out of
scope thus creating a resource leak. This ensures that the ZipFile is closed
by adding a finally clause containing a close call at the end of the try catch
block.
2016-10-15 21:12:23 -07:00
Ben Gruver
5189797292 Unify how sections are referenced in DexPool and DexBuilder 2016-10-15 20:58:19 -07:00
Ben Gruver
f2935deb16 Fix classpath loading for pre-art odex files 2016-10-15 15:39:11 -07:00
Ben Gruver
4eefe294e4 Add a public utility method for verifying dex/odex headers 2016-10-15 15:07:32 -07:00
Ben Gruver
145bc820d3 Add a ClassPath(Iterable<ClassProvider>) constructor 2016-10-15 10:27:10 -07:00
Narayan Kamath
55c33ebb09 Add a placeholder ART version number / api level for aosp/master.
Also make invoke-polymorphic conditional on this new art version.

This also fixes a bug where the version was being selected incorrectly
due to a parameter name that shadowed a local variable.
2016-10-07 15:06:07 +01:00
Ben Gruver
615d383320 Make ZipDexContainer more subclass-friendly 2016-10-04 23:05:47 -07:00
Ben Gruver
2996766649 Add MultiDexContainer.getOpcodes() 2016-10-04 23:03:38 -07:00
Ben Gruver
4d59c14ef1 Bump the version number to 2.2b3 2016-10-04 00:11:33 -07:00
Ben Gruver
686d628128 Bad proguard! Don't strip out jcommander classes! 2016-10-04 00:10:46 -07:00
Ben Gruver
331fdcca07 Bump the version number to 2.2b2 2016-10-03 20:09:56 -07:00
Ben Gruver
5d77b13557 Add proguard rule to keep ColonParameterSplitter 2016-10-03 20:01:39 -07:00