Commit Graph

295 Commits

Author SHA1 Message Date
3ce2b6fcee remove unneeded TODO
git-svn-id: https://smali.googlecode.com/svn/trunk@521 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-24 08:08:23 +00:00
5f758b60b4 fix an issue that occurs when a switch statement is the first instruction in a method
git-svn-id: https://smali.googlecode.com/svn/trunk@520 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-24 08:08:14 +00:00
b145895c49 remove an invalid assert
git-svn-id: https://smali.googlecode.com/svn/trunk@519 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-24 08:08:02 +00:00
146fbfd33a Throw an error if a switch data pseudo-instruction is encountered when auto-fixing a method.
git-svn-id: https://smali.googlecode.com/svn/trunk@518 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-24 08:07:44 +00:00
a8ca776c1d Remove unneeded TODO
git-svn-id: https://smali.googlecode.com/svn/trunk@517 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-24 08:07:33 +00:00
2e52e0e6e4 remove unneeded TODO: and added a new one
git-svn-id: https://smali.googlecode.com/svn/trunk@516 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-24 08:07:23 +00:00
2904f40603 Fix an issue when the current address immediatly after an AdvancePC debug instruction doesn't point to an instruction
git-svn-id: https://smali.googlecode.com/svn/trunk@515 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 23:46:18 +00:00
2ededb89b9 Don't set the encoded debug info when nothing needed to be changed
git-svn-id: https://smali.googlecode.com/svn/trunk@514 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 23:46:12 +00:00
e266117407 Add the offset past the end of the last instruction to the sparse arrays that translate between the new and old offsets
git-svn-id: https://smali.googlecode.com/svn/trunk@513 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 23:46:06 +00:00
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
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
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
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
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
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
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
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
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
ddc8655d10 Fix some null checking logic
git-svn-id: https://smali.googlecode.com/svn/trunk@454 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 02:01:38 +00:00
61eedba1ab Fix a bug when creating a dex file that has a blank section for one of the indexed item types
git-svn-id: https://smali.googlecode.com/svn/trunk@452 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 06:58:50 +00:00
a6bf1ed0fe store types as strings, to allow for intermediate types that don't exist in the dex file
git-svn-id: https://smali.googlecode.com/svn/trunk@451 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 06:38:01 +00:00
e942607e1a delete TODO
git-svn-id: https://smali.googlecode.com/svn/trunk@449 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 05:09:45 +00:00
726d88404d Handle a rare case where deodexing an instruction invalidates a previously deodexed instruction somewhere else because of the new register information available
git-svn-id: https://smali.googlecode.com/svn/trunk@448 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 04:21:20 +00:00
8b260a1d81 Changed the instruction map to a Sparse array, plus various cleanup
git-svn-id: https://smali.googlecode.com/svn/trunk@447 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 03:40:31 +00:00
c2c37aed3b removed todo comment
git-svn-id: https://smali.googlecode.com/svn/trunk@446 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 01:44:48 +00:00
a3d7d2423d - removed insn.fixed
- added a merge table for the register type merge logic

git-svn-id: https://smali.googlecode.com/svn/trunk@445 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 01:43:57 +00:00
6fa95185b7 Added caching for the rest of the deodexerant commands
git-svn-id: https://smali.googlecode.com/svn/trunk@443 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 23:04:44 +00:00
7f91677f24 Add a check on the vtable index when doing a virtual method lookup
git-svn-id: https://smali.googlecode.com/svn/trunk@441 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 20:27:12 +00:00
665884682c - Add support for the change in deodexerant where it now dumps all vtable entries, instead of having to query for a specific one
- cache the vtable information we get from deodexerant

git-svn-id: https://smali.googlecode.com/svn/trunk@440 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 20:19:28 +00:00
d24694eda4 minor cleanup
git-svn-id: https://smali.googlecode.com/svn/trunk@436 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 07:27:42 +00:00
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
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
73a63516fc preliminary support for reading in odex files
git-svn-id: https://smali.googlecode.com/svn/trunk@431 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-30 02:32:27 +00:00
2ec8d992d0 Don't use substraction to compare signed integral types, use comparisons
git-svn-id: https://smali.googlecode.com/svn/trunk@427 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-28 07:30:42 +00:00
fd427e41ea use the address, not the address delta when calling emitAdvancePC
git-svn-id: https://smali.googlecode.com/svn/trunk@425 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-28 05:31:21 +00:00
c604ed6c1a Add .hashcode and .equals to EncodedCatchHandler and EncodedTypeAddrPair, so that the TryListBuilder can build a unique hash to avoid duplicate EncodedCatchHandler entries
git-svn-id: https://smali.googlecode.com/svn/trunk@424 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-28 03:58:42 +00:00
0da75f71eb Initialize the offset of ClassDefItems to -1 before placing them
git-svn-id: https://smali.googlecode.com/svn/trunk@423 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-26 04:42:18 +00:00
e88cdf2010 If the ArrayData pseudo instruction has an odd size, write out a final padding byte
git-svn-id: https://smali.googlecode.com/svn/trunk@422 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-26 03:08:55 +00:00