{"category":{"version":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","_id":"588861fa165af631008ee1bc","__v":0,"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"},"parentDoc":null,"project":"54861bb654b3ce0b00367292","user":"54861b9f3681d914006992a4","version":{"__v":1,"_id":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","createdAt":"2017-01-25T08:29:46.061Z","releaseDate":"2017-01-25T08:29:46.061Z","categories":["588861fa165af631008ee1b9","588861fa165af631008ee1ba","588861fa165af631008ee1bb","588861fa165af631008ee1bc","588861fa165af631008ee1bd","588861fa165af631008ee1be","588861fa165af631008ee1bf","588861fa165af631008ee1c0","588861fa165af631008ee1c1","588861fa165af631008ee1c2","588861fa165af631008ee1c3","588861fa165af631008ee1c4","588861fa165af631008ee1c5","588861fa165af631008ee1c6","588861fa165af631008ee1c7","588861fa165af631008ee1c8","588861fa165af631008ee1c9"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.0.0","version":"5.0"},"_id":"588861fa165af631008ee1ce","__v":0,"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":36,"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