Permalink
Browse files

ProGuard Safety test

  • Loading branch information...
ievgeniitkachenko
ievgeniitkachenko committed Nov 13, 2018
1 parent 7185d72 commit 5e1fd765a4d95ca644e90b3d6f0849715529d272
@@ -10,10 +10,25 @@ android {
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
configRelease {
storeFile file("../testtest.jks")
storePassword "testtest"
keyAlias "testtest"
keyPassword "testtest"
v1SigningEnabled true
v2SigningEnabled true
}
}

buildTypes {
debug {
signingConfig signingConfigs.configRelease
}
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.configRelease
}
}
compileOptions {
@@ -19,3 +19,16 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**

# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# OkHttp platform used only on JVM and when Conscrypt dependency is available.
-dontwarn okhttp3.internal.platform.ConscryptPlatform
@@ -15,16 +15,19 @@
import okhttp3.Response;

public class MainActivity extends AppCompatActivity {
// private static final String JSON_URL = "https://raw.githubusercontent.com/itkacher/OkHttpProfiler/master/large_random_json.json";
// private static final String JSON_URL = "https://raw.githubusercontent.com/itkacher/OkHttpProfiler/master/large_random_json.json";
private static final String JSON_URL = "https://raw.githubusercontent.com/itkacher/OkHttpProfiler/master/colors.json";
private OkHttpClient mClient = new OkHttpClient.Builder().addInterceptor(
new OkHttpProfilerInterceptor()
).build();
private OkHttpClient mClient;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
builder.addInterceptor(new OkHttpProfilerInterceptor());
}
mClient = builder.build();
sendRequest();
findViewById(R.id.send_request).setOnClickListener(v -> {
sendRequest();
BIN +2.21 KB testtest.jks
Binary file not shown.

0 comments on commit 5e1fd76

Please sign in to comment.