Commit Graph

81 Commits

Author SHA1 Message Date
Ben Gruver
32a400396d Fix up the whitespace normalization in TextUtils.normalizeWhitespace
Previously, all inter-line whitespace was being removed. And it now
normalizes trailing new lines as well
2015-05-01 10:49:40 -05:00
Ben Gruver
a01bf8c832 Don't propagate exceptions from RoundtripTest.runTest() 2015-05-01 10:49:29 -05:00
Ben Gruver
ce8a993bc7 Extract out a base RoundtripTest and IdenticalRoundtripTest class 2015-05-01 10:49:08 -05:00
Ben Gruver
6d3497f72d Add Member and Annotatable interfaces 2015-05-01 10:48:36 -05:00
Ben Gruver
eb3b01f318 Make sure the elements are sorted in an encoded annotation 2015-05-01 10:48:11 -05:00
Ben Gruver
757e1dac45 Don't assume dx is on-path. Rather, grab it from maven central
The version of dx in maven central seems to be fairly old, but it works
well enough for our purposes.

Conflicts:
	build.gradle
2015-05-01 10:48:00 -05:00
Igor Murashkin
58b7c27316 Add lambda experimental dalvik opcodes
* Add new -X/--experimental flag to [dis]assemble opcodes not in art yet
* Add new opcodes liberate-variable, box-lambda, unbox-lambda,
                  capture-variable, create-lambda, invoke-lambda
* Add support for encoding 25x instructions
* Adds LambdaTest to check new opcodes assemble/disassemble properly

TODO: invoke-lambda-range

Change-Id: I5c8bcbfa8b6cb9a13ef2017fce2d1b7fda6e11c3
2015-05-01 10:46:51 -05:00
Ben Gruver
d54c78d966 Use [^] for the lexer's catch-all rule
[^] matches the entire character set, while . doesn't match new lines, etc.
2015-05-01 10:46:07 -05:00
Ben Gruver
8284715f4d Don't try to test for reserved file names
Instead, we'll just check os.name
2015-05-01 10:45:50 -05:00
Ben Gruver
b903c2066a Enable parallel gradle execution by default 2015-05-01 10:45:01 -05:00
Ben Gruver
df0156aa7e Use single-quotes in build.gradle files when double-quotes aren't needed
Conflicts:
	brut.apktool.smali/baksmali/build.gradle
	brut.apktool.smali/smali/build.gradle
	build.gradle
2015-05-01 10:43:59 -05:00
Ben Gruver
d36b066007 Simplify how the accessorTest is built and run
Conflicts:
	brut.apktool.smali/dexlib2/build.gradle
	brut.apktool.smali/dexlib2/src/accessorTest/java/org/jf/dexlib2/AccessorTest.java
	dexlib2/src/accessorTest/java/org/jf/dexlib2/AccessorTest.java
	dexlib2/src/test/java/org/jf/dexlib2/AccessorTest.java
2015-05-01 10:41:41 -05:00
Ben Gruver
13b4c65ca1 Use the antlr plugin for gradle
Conflicts:
	brut.apktool.smali/smali/build.gradle
	brut.apktool.smali/smali/src/main/antlr3/smaliParser.g
	brut.apktool.smali/smali/src/main/antlr3/smaliTreeWalker.g
	brut.apktool.smali/smali/src/test/antlr3/org/jf/smali/expectedTokensTestGrammar.g
	smali/src/main/antlr/smaliParser.g
	smali/src/main/antlr/smaliTreeWalker.g
	smali/src/main/antlr3/smaliParser.g
	smali/src/main/antlr3/smaliTreeWalker.g
	smali/src/test/antlr/org/jf/smali/expectedTokensTestGrammar.g
	smali/src/test/antlr3/org/jf/smali/expectedTokensTestGrammar.g
2015-05-01 10:37:03 -05:00
Ben Gruver
08dca73690 Use the jflex plugin for gradle
Conflicts:
	brut.apktool.smali/smali/build.gradle
	brut.apktool.smali/smali/src/main/jflex/smaliLexer.flex
	build.gradle
	smali/src/main/jflex/smaliLexer.flex
	smali/src/main/jflex/smaliLexer.jflex
2015-05-01 10:31:01 -05:00
Connor Tumbleson
0003d56389 Switch to Proguard Gradle 2015-05-01 10:26:10 -05:00
Ben Gruver
b8016ae6ef Use the proguard plugin for gradle
Conflicts:
	brut.apktool.smali/baksmali/build.gradle
	brut.apktool.smali/smali/build.gradle
	build.gradle
2015-05-01 09:19:55 -05:00
Connor Tumbleson
46d2fb899f Upgrade to gradle 2.3
- port of b3f933d27a140db265c47d2771937d88e126ac5a
2015-05-01 09:15:56 -05:00
Jiri Hruska
9450cc915c Fix for Dalvik VM crash on parameter annotations
Dalvik VM before Jelly Bean MR1 (4.2) crashes if there are any
NO_OFFSET (0) values in parameter annotation list.
(https://code.google.com/p/android/issues/detail?id=35304)
2015-05-01 09:11:35 -05:00
Ben Gruver
2abcd59cbe Remove stale license noticeds from NOTICE file 2015-05-01 09:09:37 -05:00
Connor Tumbleson
d1cea54cc7 [skip] fix proguard warning 2015-04-16 08:24:13 -05:00
Connor Tumbleson
ea38c65e82 beab30089c
- update remaining reference to Proguard 5.2
2015-02-28 07:40:48 -06:00
Connor Tumbleson
2590521b33 fix all cherry-picks dumping files in wrong location 2015-01-21 08:10:42 -06:00
Ben Gruver
604e326412 Bump version number to 2.0.5
Conflicts:
	build.gradle
2015-01-21 07:43:36 -06:00
Ben Gruver
2312848efc Make ClassFileNameHandler thread-safe 2015-01-21 07:42:30 -06:00
Ben Gruver
d9e5b0a487 Switch the default for implicit references 2015-01-21 07:42:18 -06:00
Ben Gruver
97c52167cf Add stringtemplate dependency to smali, because proguard.
Conflicts:
	build.gradle
2015-01-21 07:42:02 -06:00
Ben Gruver
59a0d2f09b Refactor ClassFileNameHandler
This makes the logic quite a bit easier to follow, and fixes an issue
with the previous implementatation, where it didn't correctly handle
the case when were multiple long names that collided after being
shortened

Conflicts:
	brut.apktool.smali/util/src/main/java/ds/tree/DuplicateKeyException.java
	brut.apktool.smali/util/src/main/java/ds/tree/RadixTree.java
	brut.apktool.smali/util/src/main/java/ds/tree/RadixTreeImpl.java
	brut.apktool.smali/util/src/main/java/ds/tree/RadixTreeNode.java
	brut.apktool.smali/util/src/main/java/ds/tree/Visitor.java
	brut.apktool.smali/util/src/main/java/ds/tree/VisitorImpl.java
2015-01-21 07:40:52 -06:00
Jeff Smith
12107ecde8 No need to reevaluate 'resource != null' 2015-01-21 07:39:34 -06:00
Jeff Smith
f5765d37c8 Give comment-generating functions more precise naming 2015-01-21 07:39:20 -06:00
Jeff Smith
a4d5d2299b baksmali: Write comments about possible floating-point values
Conflicts:
	brut.apktool.smali/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java
2015-01-21 07:39:11 -06:00
Connor Tumbleson
5afd6f5e69 [skip] adjust path to match apktool structure 2015-01-21 07:33:51 -06:00
Ben Gruver
52482802dc Make the checkPackagePrivateAccess functionality an option
This is only needed for 4.2.0, but not 4.2.1. Both are api 17, so we can't
tie this functionality to an api level.
2015-01-21 07:30:19 -06:00
Connor Tumbleson
89e6b06521 Implement dex entry for non classes.dex files
Conflicts:
	brut.apktool.smali/dexlib2/src/main/java/org/jf/dexlib2/DexFileFactory.java
2015-01-21 07:29:57 -06:00
Ben Gruver
6b6c2c09b6 Fix some generics issues when compiling with java 8 2015-01-21 07:27:17 -06:00
Ben Gruver
07ceb4fc8a Disable doclint for java 8
Conflicts:
	build.gradle
2015-01-21 07:26:53 -06:00
Ben Gruver
026d353fc7 Fix some javadoc issues 2015-01-21 07:25:12 -06:00
Ben Gruver
0153548c30 Expose the various fixed-size item counts in DexBackedDexFile 2015-01-21 07:24:58 -06:00
Ben Gruver
853da5a172 Refactor VariableSizeLookaheadIterator
Previously, when referencing instance fields from readNextItem,
the fields wouldn't have been initialized yet on the first call to
readNextItem
2015-01-21 07:24:47 -06:00
yyjdelete
3d3db44773 Use options.checkPackagePrivateAccess 2015-01-21 07:24:35 -06:00
yyjdelete
b2cf6b1d32 checkPackagePrivateAccess only for API 17(4.2)
Google revert this for compatibility.
see 7284c78e14 for details.

BTW, it seems that is also disabled for late 4.2
2015-01-21 07:24:24 -06:00
Ben Gruver
959133cbf0 Add some additional checks related to instruction size 2015-01-21 07:24:08 -06:00
edwardxwu
fe42130f05 Fixed the bug of not setting the location field of the instruction in addInstruction(i,instruction) method 2015-01-21 07:23:41 -06:00
Ben Gruver
1d597910e2 Improve the readability of the newline normalization stuff for tests 2015-01-21 07:22:40 -06:00
Ben Gruver
5388ed57ba Fix potential NPE in MethodAnalyzer 2015-01-21 07:22:27 -06:00
Ben Gruver
1b0a917a6a Implement implicit method/field references in baksmali 2015-01-21 07:21:57 -06:00
Ben Gruver
2772be8e9d Implement implicit method/field references in smali 2015-01-21 07:21:37 -06:00
Ben Gruver
4801482960 Add missing "break" from switch statement in BuilderClassPool 2015-01-21 07:21:27 -06:00
Ben Gruver
ca13778fe8 Ensure the annotation elements are sorted when written 2015-01-21 07:20:42 -06:00
Ben Gruver
b66bf0500b Improve how method parameter lists are lexed 2015-01-21 07:20:31 -06:00
Ben Gruver
e1742d8547 Clean up some unused/unneeded tokens in smaliParser.g 2015-01-21 07:14:26 -06:00