小编Kav*_*yap的帖子

android中到底在哪里添加Okhttp和改造proguard规则?

我明白了,但找不到在哪里添加?我还应该使用花括号{}之类的吗?

https://github.com/krschultz/android-proguard-snippets/blob/master/libraries/proguard-square-okhttp3.pro

# OkHttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
Run Code Online (Sandbox Code Playgroud)

代码:

dependencies {
    /*TODO:-> Android default libraries*/
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

    /*TODO:-> For shows Database on Google Chrome*/
    implementation 'com.facebook.stetho:stetho:1.5.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') {
        transitive = true
    }

    /*TODO:-> For View binding*/
    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'

    /*TODO:-> Server side libraries*/
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation …
Run Code Online (Sandbox Code Playgroud)

android proguard retrofit okhttp

-2
推荐指数
1
解决办法
6284
查看次数

标签 统计

android ×1

okhttp ×1

proguard ×1

retrofit ×1