137 Commits

Author SHA1 Message Date
JesusFreke@JesusFreke.com
7f9cfb3a68 rename "indexed labels" stuff to "sequential labels"
git-svn-id: https://smali.googlecode.com/svn/trunk@530 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-26 00:10:05 +00:00
JesusFreke@JesusFreke.com
630f5dc2dc Add support for the -b option for baksmali, to suppress the output of debug info
git-svn-id: https://smali.googlecode.com/svn/trunk@522 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-25 23:05:20 +00:00
JesusFreke@JesusFreke.com
311ee79fab Complete and fix-up the implementation of autofixing instructions
git-svn-id: https://smali.googlecode.com/svn/trunk@511 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:28:21 +00:00
JesusFreke@JesusFreke.com
fda2e631ac Refactor instructions to store individual pieces of data instead of just using an offset into a buffer
Also included is a partial implementation of the logic needed to automatically fix various types of issues

git-svn-id: https://smali.googlecode.com/svn/trunk@502 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:26:59 +00:00
JesusFreke@JesusFreke.com
5867263eb5 line ending and trailing whitespace cleanup
git-svn-id: https://smali.googlecode.com/svn/trunk@500 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:25:59 +00:00
JesusFreke@JesusFreke.com
eb78b7fa64 Minor cleanup
git-svn-id: https://smali.googlecode.com/svn/trunk@499 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:24:58 +00:00
JesusFreke@JesusFreke.com
d1dc954863 Remove unused comment parameter for instruction method items
git-svn-id: https://smali.googlecode.com/svn/trunk@498 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:24:50 +00:00
JesusFreke@JesusFreke.com
e24e70f9ad Handle unresolvable instructions in a more intellegent manner
Don't replace an unresolvable instruction with replacement instruction(s) that
are larger, to avoid inserting extra bytes, and possibly moving jump type
instructions too far from their targets.

git-svn-id: https://smali.googlecode.com/svn/trunk@497 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:24:27 +00:00
JesusFreke@JesusFreke.com
e2684fa219 - refactored/simplified the label code
- changed the handler_ label prefix to catch_ and catchall_
- added support for the new -i/--indexed-labels option, which numbers the labels incrementally for each method by type, rather than using the bytecode offset

git-svn-id: https://smali.googlecode.com/svn/trunk@493 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-01 08:14:21 +00:00
JesusFreke@JesusFreke.com
8555ce95d5 converted the labels in the deodex tests to the new label format
git-svn-id: https://smali.googlecode.com/svn/trunk@492 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-01 08:13:57 +00:00
JesusFreke@JesusFreke.com
a5fb30849d minor verbage change for the -l/--use-locals option
git-svn-id: https://smali.googlecode.com/svn/trunk@491 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-23 07:27:19 +00:00
JesusFreke@JesusFreke.com
ff80035f43 add support for the .locals directive and the --use-locals/-l option for baksmali
git-svn-id: https://smali.googlecode.com/svn/trunk@489 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-23 06:47:33 +00:00
JesusFreke@JesusFreke.com
090e553f34 check if a static final field is set within the static constructor, and if so, add a comment stating such if it makes sense to do so (for primitive types, or reference/array types that have a non-null initializer)
git-svn-id: https://smali.googlecode.com/svn/trunk@481 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-19 04:48:50 +00:00
JesusFreke@JesusFreke.com
05c9404ecd set the SparseArrays even if classDataItem is null
git-svn-id: https://smali.googlecode.com/svn/trunk@480 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-19 04:47:17 +00:00
JesusFreke@JesusFreke.com
29f49465ca Use a SparseArray instead of a HashMap, and add get*Count methods to AnnotationDirectoryItem so we can initialize the SparseArrays with the correct capacity
git-svn-id: https://smali.googlecode.com/svn/trunk@478 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-19 03:18:35 +00:00
JesusFreke@JesusFreke.com
3d632a6234 Fixed the template for commented out labels
git-svn-id: https://smali.googlecode.com/svn/trunk@471 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 22:06:09 +00:00
JesusFreke@JesusFreke.com
4a0d9d3fa1 Change the sytax for labels from label: to :label
git-svn-id: https://smali.googlecode.com/svn/trunk@467 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 02:50:42 +00:00
JesusFreke@JesusFreke.com
04473936a1 remove test println
git-svn-id: https://smali.googlecode.com/svn/trunk@458 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:45:15 +00:00
JesusFreke@JesusFreke.com
8e9ceda4f9 expand the test case to test out more stuff
git-svn-id: https://smali.googlecode.com/svn/trunk@457 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:43:44 +00:00
JesusFreke@JesusFreke.com
a171922cbd add TODO
git-svn-id: https://smali.googlecode.com/svn/trunk@456 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:43:15 +00:00
JesusFreke@JesusFreke.com
c65a8d8b5f Added better support for the case when an optimized instruction can't be resolved due to the object register always being null. It should comment out any dead code following the unresolved instruction (to prevent verification issues, due to the changed method call)
git-svn-id: https://smali.googlecode.com/svn/trunk@455 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:40:58 +00:00
JesusFreke@JesusFreke.com
cf4e7ce360 added another deodex test case
git-svn-id: https://smali.googlecode.com/svn/trunk@453 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 01:22:25 +00:00
JesusFreke@JesusFreke.com
c3deed2751 Added a tricky test case for the deodexer
git-svn-id: https://smali.googlecode.com/svn/trunk@450 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 05:15:40 +00:00
JesusFreke@JesusFreke.com
f0e3677538 fix the "null" fixed instructions.. again
git-svn-id: https://smali.googlecode.com/svn/trunk@442 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 20:34:19 +00:00
JesusFreke@JesusFreke.com
285dfd013a Fix the registers in the dummy method calls used to replace null pointer method invokes/field accesses
git-svn-id: https://smali.googlecode.com/svn/trunk@438 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 08:27:52 +00:00
JesusFreke@JesusFreke.com
631326836e Add opcode parameter
git-svn-id: https://smali.googlecode.com/svn/trunk@437 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 07:28:06 +00:00
JesusFreke@JesusFreke.com
5b89857df3 Initial commit of deodex functionality in dexlib and baksmali
git-svn-id: https://smali.googlecode.com/svn/trunk@435 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 06:27:32 +00:00
JesusFreke@JesusFreke.com
5f98a29260 Add support for the odex only opcodes
git-svn-id: https://smali.googlecode.com/svn/trunk@432 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-30 04:28:11 +00:00
JesusFreke@JesusFreke.com
aaa11529d4 Check if the method is static to determine if there is an extra "this" register, not if it's a direct method
git-svn-id: https://smali.googlecode.com/svn/trunk@428 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-29 05:03:13 +00:00
JesusFreke@JesusFreke.com
f5f30468ad refactored the options a bit
git-svn-id: https://smali.googlecode.com/svn/trunk@394 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-11 08:12:23 +00:00
JesusFreke@JesusFreke.com
3c23129eec Added support for writing parameter registers with the p<n> syntax
git-svn-id: https://smali.googlecode.com/svn/trunk@376 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-08 23:44:28 +00:00
JesusFreke@JesusFreke.com
149225a27f Set the Bytes attribute multiple times, instead of using an array of bytes
git-svn-id: https://smali.googlecode.com/svn/trunk@373 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-08 21:14:37 +00:00
JesusFreke@JesusFreke.com
fdf48625bb Refactor instruction 35c to set the Registers attribute multiple times, instead of setting it to an array
git-svn-id: https://smali.googlecode.com/svn/trunk@372 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-07 07:06:47 +00:00
JesusFreke@JesusFreke.com
7885a819a0 refactor ClassDefinition to use template attributes instead of object parameters
git-svn-id: https://smali.googlecode.com/svn/trunk@371 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-07 06:48:37 +00:00
JesusFreke@JesusFreke.com
fa7e91bff2 refactor the references to use template attributes instead of object parameters
git-svn-id: https://smali.googlecode.com/svn/trunk@370 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-06 07:15:50 +00:00
JesusFreke@JesusFreke.com
a3cf936fc2 refactor all the encoded value stuff to use template attributes instead of object properties
git-svn-id: https://smali.googlecode.com/svn/trunk@368 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-06 06:47:07 +00:00
JesusFreke@JesusFreke.com
cc32387e75 Fix for filled array pseudo instruction
git-svn-id: https://smali.googlecode.com/svn/trunk@367 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-06 05:22:20 +00:00
JesusFreke@JesusFreke.com
7ab77bc90b Refactoring baksmali so that the template attributes are passed in, instead of relying on reflection to get attributes from an object
git-svn-id: https://smali.googlecode.com/svn/trunk@366 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-06 05:03:52 +00:00
JesusFreke@JesusFreke.com
814580d4cf The stored offset is a relative offset from the position of the instruction, not an absolute offset
git-svn-id: https://smali.googlecode.com/svn/trunk@364 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-05 05:35:11 +00:00
JesusFreke@JesusFreke.com
416b72fc74 StringTemplate does't seem to want to iterate over the byte array returned by the iterator, but it works if you return an object and access the byte array as an attribute
git-svn-id: https://smali.googlecode.com/svn/trunk@363 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-05 05:33:53 +00:00
JesusFreke@JesusFreke.com
9596186473 - Return individual items from the iterator, instead of returning the same object every time
- Simplify PackedSwitchMethodItem, so that it just returns the target as a string, instead of an object

git-svn-id: https://smali.googlecode.com/svn/trunk@362 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-05 05:31:51 +00:00
JesusFreke@JesusFreke.com
866267dfb7 Store the string values, not the objects
git-svn-id: https://smali.googlecode.com/svn/trunk@360 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-05 04:21:38 +00:00
JesusFreke@JesusFreke.com
8140e9fca2 The annotation visibility should be lowercase
git-svn-id: https://smali.googlecode.com/svn/trunk@358 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-05 03:56:34 +00:00
JesusFreke@JesusFreke.com
2700dc281c Add check for null parameterName value
git-svn-id: https://smali.googlecode.com/svn/trunk@353 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-04 06:22:26 +00:00
JesusFreke@JesusFreke.com
630a384c6b Check for null source file
git-svn-id: https://smali.googlecode.com/svn/trunk@344 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-04 03:48:08 +00:00
JesusFreke@JesusFreke.com
0fa2c67bfd Check for null code item
git-svn-id: https://smali.googlecode.com/svn/trunk@343 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-04 03:47:48 +00:00
JesusFreke@JesusFreke.com
cf6729c1ee Lots of misc cleanup/refactoring to work with the new dexlib
git-svn-id: https://smali.googlecode.com/svn/trunk@336 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-03 05:47:16 +00:00
JesusFreke@JesusFreke.com
2062d413eb Fixed an issue with the template that prevented baksmali from working
git-svn-id: https://smali.googlecode.com/svn/trunk@234 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-07-03 18:55:36 +00:00
JesusFreke@JesusFreke.com
a537069854 Improved version handling
git-svn-id: https://smali.googlecode.com/svn/trunk@225 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-06-27 04:43:53 +00:00
JesusFreke@JesusFreke.com
9293a116b3 Added an option to only read the dex file then exit (mostly for profiling)
git-svn-id: https://smali.googlecode.com/svn/trunk@224 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-06-27 02:10:07 +00:00