{"_id":"57f9d8686bc01a0e00352d19","category":{"_id":"57d51ad68191880e008bb51b","project":"54861bb654b3ce0b00367292","__v":0,"version":"57b96d6b1d08500e00bf81d1","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-11T08:50:30.403Z","from_sync":false,"order":3,"slug":"android-essentials-kit","title":"Android / Essentials KIt"},"user":"54861b9f3681d914006992a4","version":{"_id":"57b96d6b1d08500e00bf81d1","__v":7,"project":"54861bb654b3ce0b00367292","createdAt":"2016-08-21T08:59:23.326Z","releaseDate":"2016-08-21T08:59:23.326Z","categories":["57b96d6b1d08500e00bf81d2","57b96d6b1d08500e00bf81d3","57b96d6b1d08500e00bf81d4","57b96d6b1d08500e00bf81d5","57b96d6b1d08500e00bf81d6","57b96d6b1d08500e00bf81d7","57b96d6b1d08500e00bf81d8","57b96d6b1d08500e00bf81d9","57b96d6b1d08500e00bf81da","57b96d6b1d08500e00bf81db","57b96d6b1d08500e00bf81dc","57b97748306b9b0e001dd53f","57d12c6c1227b40e0044908a","57d51ad68191880e008bb51b","57d52b5cf350090e00fe073e","57d5468a17b492170053a3f0","57df9df05927cb0e002bce1e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"4.0.0","version":"4.0"},"__v":0,"parentDoc":null,"project":"54861bb654b3ce0b00367292","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-09T05:40:56.921Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"In order to run ProGuard on your app if you're using Elasticode SDK some steps should be done:\n1. Create lint.xml under project_path/gradle folder\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"lintOptions{\\n\\tlintConfig rootProject.file('gradle/lint.xml')\\n}\\n\\ndexOptions {\\n\\tpreDexLibraries = false\\n}\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n2. Add to your app:gradle next lines\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"lintOptions {\\n\\t\\tlintConfig rootProject.file('gradle/lint.xml')\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n3. Put this lines into your proguard-rules.pro\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-injars libs\\n-keepattributes *Annotation*, InnerClasses, Exceptions, Signature\\n-keepattributes EnclosingMethod\\n-keepattributes SourceFile,LineNumberTable\\n-keep public class * extends java.lang.Exception\\n\\n# Keep Elasticode SDK libs \\n-dontwarn retrofit2.**\\n-keep class retrofit2.** { *; }\\n\\n-keep class com.squareup.picasso.** { *; }\\n-dontwarn com.squareup.picasso.**\\n-keep class com.squareup.picasso.LruCache { *; }\\n-dontwarn com.squareup.picasso.LruCache\\n\\n-dontwarn com.google.gson.**\\n-keep class com.google.gson.** { *; }\\n-keep class sun.misc.Unsafe { *; }\\n-keep class com.google.gson.stream.** { *; }\\n\\n-dontwarn okio.**\\n-keep class okio.** { *; }\\n-dontwarn okhttp3.**\\n-keep class okhttp3.** { *; }\\n\\n-dontwarn com.jakewharton.picasso.**\\n-keep class com.jakewharton.picasso.** { *; }\\n\\n# Keep SDK\\n-keep class com.elasticode.network.** { *; }\\n-dontwarn com.elasticode.network.**\\n-keep class com.elasticode.provider.** { *; }\\n-dontwarn com.elasticode.provider.**\\n-keep class com.elasticode.model.** { *; }\\n-dontwarn com.elasticode.model.**\\n-keep class com.elasticode.utils.** { *; }\\n-dontwarn com.elasticode.utils.**\\n-keep class com.elasticode.view.** { *; }\\n-dontwarn com.elasticode.view.**\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n4. Don't forget to keep your own classes and libs","excerpt":"","slug":"prepare-your-app-for-proguard","type":"basic","title":"Prepare your app for ProGuard"}

Prepare your app for ProGuard


In order to run ProGuard on your app if you're using Elasticode SDK some steps should be done: 1. Create lint.xml under project_path/gradle folder [block:code] { "codes": [ { "code": "lintOptions{\n\tlintConfig rootProject.file('gradle/lint.xml')\n}\n\ndexOptions {\n\tpreDexLibraries = false\n}", "language": "xml" } ] } [/block] 2. Add to your app:gradle next lines [block:code] { "codes": [ { "code": "lintOptions {\n\t\tlintConfig rootProject.file('gradle/lint.xml')", "language": "xml" } ] } [/block] 3. Put this lines into your proguard-rules.pro [block:code] { "codes": [ { "code": "-injars libs\n-keepattributes *Annotation*, InnerClasses, Exceptions, Signature\n-keepattributes EnclosingMethod\n-keepattributes SourceFile,LineNumberTable\n-keep public class * extends java.lang.Exception\n\n# Keep Elasticode SDK libs \n-dontwarn retrofit2.**\n-keep class retrofit2.** { *; }\n\n-keep class com.squareup.picasso.** { *; }\n-dontwarn com.squareup.picasso.**\n-keep class com.squareup.picasso.LruCache { *; }\n-dontwarn com.squareup.picasso.LruCache\n\n-dontwarn com.google.gson.**\n-keep class com.google.gson.** { *; }\n-keep class sun.misc.Unsafe { *; }\n-keep class com.google.gson.stream.** { *; }\n\n-dontwarn okio.**\n-keep class okio.** { *; }\n-dontwarn okhttp3.**\n-keep class okhttp3.** { *; }\n\n-dontwarn com.jakewharton.picasso.**\n-keep class com.jakewharton.picasso.** { *; }\n\n# Keep SDK\n-keep class com.elasticode.network.** { *; }\n-dontwarn com.elasticode.network.**\n-keep class com.elasticode.provider.** { *; }\n-dontwarn com.elasticode.provider.**\n-keep class com.elasticode.model.** { *; }\n-dontwarn com.elasticode.model.**\n-keep class com.elasticode.utils.** { *; }\n-dontwarn com.elasticode.utils.**\n-keep class com.elasticode.view.** { *; }\n-dontwarn com.elasticode.view.**", "language": "xml" } ] } [/block] 4. Don't forget to keep your own classes and libs