769 Commits

Author SHA1 Message Date
JesusFreke@JesusFreke.com
4fb7679be9 Refactor the rules related to the .parameter directive, so that it doesn't use syntactic predicates
git-svn-id: https://smali.googlecode.com/svn/trunk@716 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:56 +00:00
JesusFreke@JesusFreke.com
368a8faed9 Call a method to throw the OdexedInstructionException, instead of throwing the exception itself
This prevents java from complaining about unreachable code after the throw statement

git-svn-id: https://smali.googlecode.com/svn/trunk@715 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:52 +00:00
JesusFreke@JesusFreke.com
cda416b795 Sort the annotations in an AnnotationSetItem based on the TypeIdItem index
git-svn-id: https://smali.googlecode.com/svn/trunk@714 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:48 +00:00
JesusFreke@JesusFreke.com
f2370e3a2e Add tests for the various types of annotations
git-svn-id: https://smali.googlecode.com/svn/trunk@713 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:43 +00:00
JesusFreke@JesusFreke.com
ec643e6520 Use the SIMPLE_NAME token for label names, instead of creating a new LABEL token
git-svn-id: https://smali.googlecode.com/svn/trunk@712 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:39 +00:00
JesusFreke@JesusFreke.com
28a614553b Use the simple_name rule instead of matching SIMPLE_NAME in the local_directive rule
git-svn-id: https://smali.googlecode.com/svn/trunk@711 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:35 +00:00
JesusFreke@JesusFreke.com
10b9349716 Use method_name instead of simple_name for the method branch of the type_field_method_literal rule
git-svn-id: https://smali.googlecode.com/svn/trunk@710 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-17 07:02:30 +00:00
JesusFreke@JesusFreke.com
fbea4e751f Cleaned up imports
git-svn-id: https://smali.googlecode.com/svn/trunk@709 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:26:08 +00:00
JesusFreke@JesusFreke.com
6b3647e984 Cleaned up imports
git-svn-id: https://smali.googlecode.com/svn/trunk@708 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:26:01 +00:00
JesusFreke@JesusFreke.com
2feb05f645 Rewrite smali's lexer, and modify the parser and tree walker accordingly
The lexer is now much more like a normal lexer, instead of having the long multi-token rules

git-svn-id: https://smali.googlecode.com/svn/trunk@707 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:57 +00:00
JesusFreke@JesusFreke.com
3e4c1193cf Update dump option to use -D instead of -d
git-svn-id: https://smali.googlecode.com/svn/trunk@706 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:54 +00:00
JesusFreke@JesusFreke.com
6a7f2e2d24 Move to ANTLR v3.2
git-svn-id: https://smali.googlecode.com/svn/trunk@705 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:47 +00:00
JesusFreke@JesusFreke.com
b3abca4c90 cleaned up imports
git-svn-id: https://smali.googlecode.com/svn/trunk@704 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:29 +00:00
JesusFreke@JesusFreke.com
cf01189c7f Update version to 1.2.3
git-svn-id: https://smali.googlecode.com/svn/trunk@703 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-16 07:25:24 +00:00
JesusFreke@JesusFreke.com
2371e35aae Exit on the first error by default, but add the -I option for ignoring errors and continuing with disassembly
git-svn-id: https://smali.googlecode.com/svn/trunk@701 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:25 +00:00
JesusFreke@JesusFreke.com
0808ee81c6 use Array.clone instead of Arrays.copyOf, to be compliant with java 5
git-svn-id: https://smali.googlecode.com/svn/trunk@700 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:17 +00:00
JesusFreke@JesusFreke.com
bde73b303c minor changes to option usage info
git-svn-id: https://smali.googlecode.com/svn/trunk@699 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:13 +00:00
JesusFreke@JesusFreke.com
db806b1261 minor reformatting - reorder the options
git-svn-id: https://smali.googlecode.com/svn/trunk@698 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:09 +00:00
JesusFreke@JesusFreke.com
c6734e8a60 Fix a typo in the commented out format for a packed-switch structure
git-svn-id: https://smali.googlecode.com/svn/trunk@697 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:06 +00:00
JesusFreke@JesusFreke.com
d293bc1eb3 Always read and write files using UTF8
git-svn-id: https://smali.googlecode.com/svn/trunk@696 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:03:01 +00:00
JesusFreke@JesusFreke.com
51cf2f54d5 Add support in smali for the invoke-direct-quick opcode
git-svn-id: https://smali.googlecode.com/svn/trunk@695 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:56 +00:00
JesusFreke@JesusFreke.com
e861da1285 Fix the output format for the .parameter directive
git-svn-id: https://smali.googlecode.com/svn/trunk@694 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:52 +00:00
JesusFreke@JesusFreke.com
c1cc0e0934 Add better support for the case when an odex file has missing classes
git-svn-id: https://smali.googlecode.com/svn/trunk@693 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:48 +00:00
JesusFreke@JesusFreke.com
19b601436a Fix the formatting of the instruction offset comment
git-svn-id: https://smali.googlecode.com/svn/trunk@692 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:39 +00:00
JesusFreke@JesusFreke.com
baec3bc450 Fix the workaround for the ext.jar BCP special case
git-svn-id: https://smali.googlecode.com/svn/trunk@691 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:35 +00:00
JesusFreke@JesusFreke.com
306fe8753a Use the platform specific newline character/string
git-svn-id: https://smali.googlecode.com/svn/trunk@690 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:31 +00:00
JesusFreke@JesusFreke.com
adb1511f4e minor linewrap change
git-svn-id: https://smali.googlecode.com/svn/trunk@689 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:27 +00:00
JesusFreke@JesusFreke.com
0b2f7d6a57 delete IndentingPrintWriter and refactor everything to use IndentingWriter directly
git-svn-id: https://smali.googlecode.com/svn/trunk@688 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:16 +00:00
JesusFreke@JesusFreke.com
bf483ac86d use a character comparison instead of a string comparison for TypeIdItem.getRegisterCount()
git-svn-id: https://smali.googlecode.com/svn/trunk@687 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:11 +00:00
JesusFreke@JesusFreke.com
bba8645009 minor optimizations in ByteArrayInput
git-svn-id: https://smali.googlecode.com/svn/trunk@686 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:08 +00:00
JesusFreke@JesusFreke.com
1f29ee7351 Change ByteArrayInput.readNullTerminatedBytes() to ByteArrayInput.readNullTerminatedUtf8String()
git-svn-id: https://smali.googlecode.com/svn/trunk@685 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:02:03 +00:00
JesusFreke@JesusFreke.com
89325d96cc minor line wrap change
git-svn-id: https://smali.googlecode.com/svn/trunk@684 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:01:55 +00:00
JesusFreke@JesusFreke.com
4b82fba3ba Refactor dexlib so that sections are read in based on the dependency order
This allows us to simply the read logic somewhat, getting rid of the concept of a "pre-created" item

git-svn-id: https://smali.googlecode.com/svn/trunk@683 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:01:41 +00:00
JesusFreke@JesusFreke.com
483ebdf2cc Use a pre-generated array of all AccessFlag enum values, instead of calling AccessFlags.values(), which always instantiates a new array
git-svn-id: https://smali.googlecode.com/svn/trunk@682 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:01:37 +00:00
JesusFreke@JesusFreke.com
6eae34831f Refactor dexlib so that the output is generated directly, instead of using the StringTemplate library
git-svn-id: https://smali.googlecode.com/svn/trunk@681 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:01:17 +00:00
JesusFreke@JesusFreke.com
a7139f6586 Fixed the copyright noticed for files that came from dx, and had been mistakenly changed to the smali BSD license
git-svn-id: https://smali.googlecode.com/svn/trunk@680 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:01:08 +00:00
JesusFreke@JesusFreke.com
78bde01ad4 Add the ability to read the dependency information from an odex file, and use those dependencies as the BOOTCLASSPATH by default for odex files
git-svn-id: https://smali.googlecode.com/svn/trunk@679 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:01:03 +00:00
JesusFreke@JesusFreke.com
dfb1b8c6c0 Update version to 1.2.2
git-svn-id: https://smali.googlecode.com/svn/trunk@678 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-04-03 23:00:55 +00:00
JesusFreke@JesusFreke.com
db26b663aa Change the way the "dead" instructions are handled, so that loops within the dead code are handled properly
git-svn-id: https://smali.googlecode.com/svn/trunk@674 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-06 06:12:30 +00:00
JesusFreke@JesusFreke.com
650725bbd3 Check for unreachable instructions and comment them out
git-svn-id: https://smali.googlecode.com/svn/trunk@673 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-06 06:12:16 +00:00
JesusFreke@JesusFreke.com
10a9518111 Add additional context information to exceptions when building a MethodDefinition object
git-svn-id: https://smali.googlecode.com/svn/trunk@672 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-06 06:12:09 +00:00
JesusFreke@JesusFreke.com
cbc21d5ece Don't forget to replace un-deodexable instructions
git-svn-id: https://smali.googlecode.com/svn/trunk@671 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-06 06:12:03 +00:00
JesusFreke@JesusFreke.com
cf52e5cd48 When loading boot class path files, if a jar file doesn't have a classes.dex file, skip it and continue looking
git-svn-id: https://smali.googlecode.com/svn/trunk@670 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-04 07:45:01 +00:00
JesusFreke@JesusFreke.com
8eaecd53d3 Load all the class path classes using TempClassInfo, before starting to creating the ClassDefs for them
This fixes an issue when a class in a boot class path jar has a superclass that is in a later boot class path jar

git-svn-id: https://smali.googlecode.com/svn/trunk@669 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-04 07:44:35 +00:00
JesusFreke@JesusFreke.com
74eeca35f7 Add additional error context for errors that occur while loading the boot class path files
git-svn-id: https://smali.googlecode.com/svn/trunk@668 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-04 07:44:08 +00:00
JesusFreke@JesusFreke.com
6786055f35 Move the HelpFormatter subclass to the util project and use it for both smali and baksmali
git-svn-id: https://smali.googlecode.com/svn/trunk@667 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-03 07:12:06 +00:00
JesusFreke@JesusFreke.com
c616a0dadc Add support for detecting the console width in unix and windows environments, and printing the usage info accordingly
git-svn-id: https://smali.googlecode.com/svn/trunk@666 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-03 07:11:32 +00:00
JesusFreke@JesusFreke.com
7bb8ace93b add -V option for baksmali to verify the bytecode
git-svn-id: https://smali.googlecode.com/svn/trunk@664 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-03 03:26:53 +00:00
JesusFreke@JesusFreke.com
7025dfb753 Split the analysis logic into an analysis pass and a verification pass
git-svn-id: https://smali.googlecode.com/svn/trunk@663 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-03 03:26:33 +00:00
JesusFreke@JesusFreke.com
ef24b31c98 Refactor the MethodAnalyzer API so that the instructions are returned as a read-only list
git-svn-id: https://smali.googlecode.com/svn/trunk@662 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-03-03 03:26:17 +00:00