• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Possible to hide used third party libraries files in .aar file?

Dec 20, 2018
11
0
Hello,

I am developing an Android library (APIs). As part of this, I am using some other third party library (free) too. I will provide the detailed documentation to the developers who want to use my APIs also. When developer want to use my library, the developer will import my library .aar file and use the APIs. Eventhough I am providing .aar file, the developer is able to see the source code of my library. I am aware about pro-guard. I didn't want to expose my source code to the end developers. At lease, I didn't want to expose to the outside people about the third party library that I am using. Can anybody suggest me how to do this?

Thanks in advance.

Best Regards,
Gopi.
 
The best you can do is obfuscate your source code, or bytecode, using a tool such as ProGuard.


Thank you for your Suggestion ,

I did changes but i am facing some issue please look into my code.
build.gardle
buildTypes {
release {
minifyEnabled true // shrink
useProguard false // obfuscate
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true // shrink
useProguard true // don't obfuscate

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

}

i am getting this error
Warning:eek:kio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:eek:kio_Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:there were 3 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

proguard-rules.pro

-dontwarn com.intel.webrtc.base.*
-dontwarn com.intel.webrtc.conference.*
-dontwarn org.webrtc.*
-dontwarn android.databinding.*

-dontwarn org.codehaus.**
-dontwarn okio.**
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones