ge0rg / MemorizingTrustManager

A "plugin" for Android Java to allow asking the user about SSL certificates
MIT License
180 stars 90 forks source link

Use MTM with Android Studio/Gradle #49

Open Rieger912 opened 8 years ago

Rieger912 commented 8 years ago

Hi,

I am trying to integrate MTM in an Android Studio project with gradle. Can you assist me in integrating it? I added "android.library.reference.1=submodules/MemorizingTrustManager" to gradle.properties (since I don't have a default.properties - is that correct?). Unfortunately it cannot resolve the name of the activity, when I add it to the AndroidManifest.xml of my app. Any idea?

Thanks folks!

vitalyster commented 8 years ago

1) add include submodules:MemorizingTrustManager to settings.gradle 2) in your build.gradle add into project dependencies: compile project('submodules:MemorizingTrustManager')

dbrgn commented 8 years ago

For me that did not work, I had to do it slightly different.

settings.gradle:

include ':MemorizingTrustManager'
project(':MemorizingTrustManager').projectDir = new File('libs/MemorizingTrustManager')

app/build.gradle:

dependencies {
    compile project(':MemorizingTrustManager')
}
RenHaiRenWjc commented 7 years ago

I follow the above steps to do, the results appeared some problems Error:Could not get unknown property 'MemorizingTrustManager' for settings 'GoRunning' of type org.gradle.initialization.DefaultSettings. my local.properties ` sdk.dir=F\:\sofeMuLu\sdk\androidsdk_4_5_6

android.library.reference.1=E\:\Application0206\Git\MemorizingTrustManager-master\src

android.library.reference.1=submodules/MemorizingTrustManager settings.gradle include ':app' include submodules:MemorizingTrustManager project(':MemorizingTrustManager').projectDir = new File('libs/MemorizingTrustManager')`

build.gradle dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' compile 'org.igniterealtime.smack:smack-android-extensions:4.1.4' compile 'org.igniterealtime.smack:smack-tcp:4.1.4' compile project('submodules:MemorizingTrustManager') }

what should I do?