01318cded8
use decodeHighUnsignedNibble instead of decodeHighSignedNibble for regB in Instruction22t
...
git-svn-id: https://smali.googlecode.com/svn/trunk@512 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:28:28 +00:00
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
8d1bb1cc83
change instances of Assert.assertFalse() to Assert.fail()
...
git-svn-id: https://smali.googlecode.com/svn/trunk@510 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:57 +00:00
404816815f
use out.toByteArray() instead of out.getArray(), so we get a correctly sized array instead of the oversized internal buffer
...
git-svn-id: https://smali.googlecode.com/svn/trunk@509 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:49 +00:00
4433deb7dc
Use an int to store the 'base' value, when decoding a special debug opcode, to prevent an incorrect negative value
...
git-svn-id: https://smali.googlecode.com/svn/trunk@508 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:42 +00:00
91aa1ef2fa
Use the correct comparison for the keys, when writing out a sparse switch data pseudo-instruction
...
git-svn-id: https://smali.googlecode.com/svn/trunk@507 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:36 +00:00
526d617e05
When writing an Instruction31t opcode, align the offset to the switch/array data
...
git-svn-id: https://smali.googlecode.com/svn/trunk@506 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:30 +00:00
7570fe0382
Fix the way offsets are handled in Instruction21t and Instruction22t
...
Use a short internally for the offset, and validate the value in updateOffset()
git-svn-id: https://smali.googlecode.com/svn/trunk@505 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:23 +00:00
f6c7706102
ensure the string index is <= 0xFFFF before writing a string-const instruction
...
git-svn-id: https://smali.googlecode.com/svn/trunk@504 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:14 +00:00
d6a7a212e0
Add additional strings, to ensure we get at least one that has an index > 0xFFFF
...
git-svn-id: https://smali.googlecode.com/svn/trunk@503 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:27:07 +00:00
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
9ab2b45ec8
whitespace fixes
...
git-svn-id: https://smali.googlecode.com/svn/trunk@501 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:26:13 +00:00
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
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
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
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
b6ce091ae3
fix an issue reading the string index for indexes >16bits, for the const-string/jumbo opcode
...
git-svn-id: https://smali.googlecode.com/svn/trunk@495 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-09 09:56:13 +00:00
8fc44f0bbc
updated version number to 1.01
...
git-svn-id: https://smali.googlecode.com/svn/trunk@494 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-09 09:56:04 +00:00
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
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
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
3ff70dc8da
add support for the .locals directive in smali
...
git-svn-id: https://smali.googlecode.com/svn/trunk@490 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-23 07:19:06 +00:00
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
87e8649095
Added wrapper scripts for baksmali.jar and smali.jar
...
git-svn-id: https://smali.googlecode.com/svn/trunk@488 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-08 17:57:53 +00:00
6de675fc3d
Add a possible cause to the error message when one of the classes for superclass lookup cannot be found
...
git-svn-id: https://smali.googlecode.com/svn/trunk@486 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-08 06:59:55 +00:00
3cf2781481
Print version info in usage message
...
git-svn-id: https://smali.googlecode.com/svn/trunk@485 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-08 06:26:08 +00:00
688d1b1295
update integration tests to use new label format
...
git-svn-id: https://smali.googlecode.com/svn/trunk@484 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-08 05:34:23 +00:00
dade116d27
update version to 1.0
...
git-svn-id: https://smali.googlecode.com/svn/trunk@483 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-08 05:22:23 +00:00
6ff845a9c1
open the odex file as read-only
...
git-svn-id: https://smali.googlecode.com/svn/trunk@482 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-08 05:00:55 +00:00
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
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
b09920f24f
Use the shorter form of decodeUnsignedShort
...
git-svn-id: https://smali.googlecode.com/svn/trunk@479 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-19 03:34:03 +00:00
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
cd5d4c0385
Use proper hygiene. Close those files/streams!
...
git-svn-id: https://smali.googlecode.com/svn/trunk@477 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-14 02:37:26 +00:00
1d93e2c7a8
Updated the description for the rewrite option
...
git-svn-id: https://smali.googlecode.com/svn/trunk@476 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-14 02:27:37 +00:00
bdf45f5b4f
whitespace fix
...
git-svn-id: https://smali.googlecode.com/svn/trunk@475 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-14 02:15:13 +00:00
dee6ba748e
Add a rewrite option, to rewrite the input smali files using the new label syntax
...
git-svn-id: https://smali.googlecode.com/svn/trunk@474 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-14 02:14:59 +00:00
518fe629c1
minor tweaks to the lexer and parser so that none of the input is thrown away
...
git-svn-id: https://smali.googlecode.com/svn/trunk@473 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 23:52:22 +00:00
e66d450f42
update version to 0.97
...
git-svn-id: https://smali.googlecode.com/svn/trunk@472 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 23:51:24 +00:00
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
c8d83493d1
Add support for reading a classes.dex file from an apk/jar
...
git-svn-id: https://smali.googlecode.com/svn/trunk@470 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 21:55:24 +00:00
4080fe659d
Improve handling of the dex and odex magic values
...
git-svn-id: https://smali.googlecode.com/svn/trunk@469 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 19:57:25 +00:00
343848c849
Include the first 8 bytes of the file when reporting a bad magic value
...
git-svn-id: https://smali.googlecode.com/svn/trunk@468 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 19:45:54 +00:00
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
dbaa44be6c
wasn't propogating deadness in all cases
...
git-svn-id: https://smali.googlecode.com/svn/trunk@462 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-11 03:14:40 +00:00
a37715b6ec
remove debugging printf
...
git-svn-id: https://smali.googlecode.com/svn/trunk@461 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-11 01:58:34 +00:00
a948461964
Check for null when looking up a superclass
...
git-svn-id: https://smali.googlecode.com/svn/trunk@460 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-11 01:45:28 +00:00
cc4bbc46ea
Fixed a crash when trying to look up the superclass for Object
...
git-svn-id: https://smali.googlecode.com/svn/trunk@459 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-11 01:44:57 +00:00
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
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