adwiv / android-fat-aar

Gradle script that allows you to merge and embed dependencies in generted aar file
The Unlicense
1.46k stars 435 forks source link

Won´t merge consumerProguardFiles of libraries #5

Closed mklueh closed 9 years ago

mklueh commented 9 years ago

I´m using proguard in my modules.

As my project is a library, I´m using

release { consumerProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }

But proguard configurations of my sub-modules are not included in the core library after compiling

adwiv commented 9 years ago

Thanks for the pull request :+1: Looks good and have merged it.

I have one concern still and maybe you can clarify. This might correctly handle the case when minify is enabled. However if minify is not enabled, all those files should become the consumerProguardFiles instead and should be embedded in the aar file so that the application can use them. Not sure how to handle that although :) Maybe two tasks or adding to consumerProguardFiles or proguardFiles depending on whether or not the proguard task exists. I don't use multiple proguard files, so can't test myself.

Thanks.

mklueh commented 9 years ago

Hello,

if you don´t specify a consumerProguardFile, it wont even create a proguard.txt inside the library. Therefore it´s not neccessary to check if the user has specified one. Minify enabled has nothing todo with the consumerProguard files. Consumer Proguard files are packed in the aar file and executed where the library is used :)

I´ve created another pull request where I also check, if the file exists.

Thank you,

Best regards

2015-10-21 17:20 GMT+02:00 GoodBoy Adwiv notifications@github.com:

Thanks for the pull request [image: :+1:] Looks good and have merged it.

I have one concern still and maybe you can clarify. This might correctly handle the case when minify if enabled. However if minify is not enabled, all those files should become the consumerProguardFiles instead and should be embedded in the aar file so that the application can use them. Not sure how to handle that although :) Maybe two tasks or adding to consumerProguardFiles or proguardFiles depending on whether or not the proguard task exists. I don't use multiple proguard files, so can't test myself.

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/adwiv/android-fat-aar/issues/5#issuecomment-149929943 .

Best regards,

Marian Klühspies

adwiv commented 8 years ago

Hi,

I misunderstood how you are doing handling it.

I have merged the pull request.

Thanks a lot.

suhasgawde10 commented 7 years ago

where i can store my consumerProguardFiles in diffrent location.

adwiv commented 7 years ago

Hi Suhas, Couldn't understand your problem. Can you please elaborate.

suhasgawde10 commented 7 years ago

Actually i have created one library for my customer and that i have to give him by applying proguard so that the code will be obfuscate. But i have read in stack overflow that we can not apply proguard on library, once that library is used in any project, the proguard applied in that project will be applied to library also. But as i want to give that library to customer so they can not see my code. What you could suggest for this? Please help me out

adwiv commented 7 years ago

You can apply proguard on library without much problems. Ignore what you read on stackoverflow.

suhasgawde10 commented 7 years ago

actually i have already applied Proguard on My Library but problem is that when i use that aar library inside my demo application for testing, library functions are just get decompiled and shows all functionality when i click on any library function by holding ctrl key it decompile and show all functions details. any other way to protect my code.

adwiv commented 7 years ago

That is how java works. If you want harder to decompile use the paid version of proguard - Dexguard. Or write the main logic in C/C++ and use JNI.

On 26-Oct-2016 9:34 PM, "suhas gawde" notifications@github.com wrote:

actually i have already applied Proguard on My Library but problem is that when i use that aar library inside my demo application for testing, library functions are just get decompiled and shows all functionality when i click on any library function by holding ctrl key it decompile and show all functions details. any other way to protect my code.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adwiv/android-fat-aar/issues/5#issuecomment-256396517, or mute the thread https://github.com/notifications/unsubscribe-auth/AKfnZ349vM_dVYcWtoUnqpD_mA1POwAmks5q33oVgaJpZM4GS5pu .

suhasgawde10 commented 7 years ago

Ok sir , Thanks for suggesting me 👍

pinhassi commented 7 years ago

The only thing that worked for me is to define both options in my library:

release { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' consumerProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }