Skip to content

Remove dependencies on commons-codec.jar and guava-r09.jar (to reduce java method count by ~7900 methods) #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2014

Conversation

jeffdcamp
Copy link
Contributor

Android has a 65k limit on the number of methods in a single dex file. Sqlite jar dependencies add a large number of methods as follows:

sqlcipher.jar - 768 methods
commons-codec.jar - 244 methods
guava.jar - 7655 methods!!

After looking at the sqlcipher code, it appears that the commons-codec and guava dependecies can easily be removed (saving a total of 7899 methods!!). There are a lot of apps, including ours, that are getting close to the 65k method limit, and removing the dependencies on commons-codec AND especially guava would be greatly appreciated!

The following are links to the documentation and implementation of the replaced code:

Commons Codec
http://commons.apache.org/proper/commons-codec/apidocs/
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Hex.java?view=markup

GUAVA
http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/index.html
https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/collect/Maps.java

@d-tarasov
Copy link

Awesome! I hope that this will be merged into master and we've got this changes in the next SQLCipher release

@mandrachek
Copy link

So, what's the likelyhood this will get merged?

@zsiegel
Copy link

zsiegel commented Aug 4, 2014

+1 for merging this as well. these dependencies are massive.

@FabianFrank
Copy link

+:100:

It makes absolute no sense to include Guava for a single Maps.newHashMap();, especially because with the latest Android SDK you can use the diamond operator anyways.

When I saw the Guava dependency my first intuition was "I'll rip this out and build myself", imagine my face when the grep for "com.google" only showed 1 line of code.

Same for commons codec, this must go in, it's a massive improvement!

@developernotes developernotes merged commit 7630e6e into sqlcipher:master Aug 18, 2014
@developernotes
Copy link
Member

Hi @jeffdcamp

Our apologizes for missing this pull request, I've just run the test suite against all supported platforms using your branch and everything is running smooth. I've merged this into master. Thanks!

@jeffdcamp
Copy link
Contributor Author

AWESOME! Thanks for doing this!

On Mon, Aug 18, 2014 at 1:08 PM, Nick Parker [email protected]
wrote:

Hi @jeffdcamp https://github.com/jeffdcamp

Our apologizes for missing this pull request, I've just run the test suite
against all supported platforms using your branch and everything is running
smooth. I've merged this into master. Thanks!


Reply to this email directly or view it on GitHub
#121 (comment)
.

@zsiegel
Copy link

zsiegel commented Aug 18, 2014

Excellent.

Just curious and maybe I'm missing something but when i try and build the latest since the build.xml file isn't present I cant complete the build. Am i missing something here?

I was trying to generate the latest arm and x86 binaries from the source.

@developernotes
Copy link
Member

Hi @zsiegel

Could you try running make init before you call make? That should generate the build.xml file.

@FabianFrank
Copy link

make init will only create build.xml if you have android sdk for api level 7 installed, which is not documented clearly, see #136

@FabianFrank
Copy link

Thanks a lot for merging this! 👍

@zsiegel
Copy link

zsiegel commented Aug 18, 2014

@FabianFrank thank you. that fixed things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants