1. Are you ready for the Galaxy S20? Here is everything we know so far!

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

Discussion in 'Android Development' started by gopipeddisetti, Dec 20, 2018.

  1. gopipeddisetti

    Thread Starter

    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.
     


  2. Deleted User

    Deleted User Guest

    The best you can do is obfuscate your source code, or bytecode, using a tool such as ProGuard.
     
    scary alien likes this.
  3. gopipeddisetti

    Thread Starter


    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.**
     
  4. Deleted User

    Deleted User Guest

    Have you had a look at the logs, like it tells you to?
     
    scary alien likes this.
Loading...

Share This Page

Loading...