Skip to content
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

Attempt to add proguard configuration to aar #399

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Attempt to add proguard configuration to aar #399

wants to merge 2 commits into from

Conversation

emartynov
Copy link

This is called "attempt" since I was not able to build it on Mac.

Because I was not able to build binary after hour installing ndk, playing with tools (gradle, AGP) update and playing with bash file trying to disable old platform types that are not supported by latest NDK.

Please review and comment.

@developernotes
Copy link
Member

Hi @emartynov

Thank you for your interest in SQLCipher for Android. Is there a reason for the nested defaultConfig within your diff?

@emartynov
Copy link
Author

Hey, this looks like indeed a mistake. If I would just able to build the library to check. I will try on side project library and update gradle file here.

@developernotes
Copy link
Member

Hi @emartynov

Great, thanks. Please feel free to update the pull request once you've had a chance to confirm.

artob added a commit to drydart/flutter_sqlcipher that referenced this pull request Nov 23, 2018
public static final android.os.Parcelable$Creator *;
}

-keep class net.sqlcipher.** {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is keeping too much. This should be reduced to specific classes/methods/variables.
The reason for supplying Proguard rules in a library is for the clients (developers) to not waste time on examining the library's internals. However, this rule is useless as every developer can come up with such a solution for every library.

@brodycj
Copy link
Contributor

brodycj commented Jun 3, 2020

@emartynov @developernotes I was wondering if there are any plans to develop this further?

From a quick search I found something that looks interesting: https://developer.android.com/studio/build/shrink-code

@developernotes
Copy link
Member

Hi @brodybits, @emartynov

Yes, we would certainly be interested in including something like this within a future release of the software. We will need to evaluation what options to configure within the ProGuard file to prevent any unnecessary removal during compilation time.

@AlexTrotsenko
Copy link

@developernotes As far as I see, everyone still have to add following rules manually according to the README, right?

-keep,includedescriptorclasses class net.sqlcipher.** { *; }
-keep,includedescriptorclasses interface net.sqlcipher.** { *; }

If it's the case - how about adding this two lines into the proguard rules to the project sources?
Then it can referenced via consumerProguardFiles in the way as it's suggested in the official documentation?

Could be a good starting point or ?

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.

5 participants