From 9d3fca1572732c6abbea2613a8dd7594de283e32 Mon Sep 17 00:00:00 2001 From: Ruslan Arslanov Date: Thu, 18 Jul 2019 14:34:52 +0300 Subject: [PATCH] Update README.md for plugin version 1.0.6 [4] --- README.md | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6d9dfb2..5cfdc0a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ buildscript { } dependencies { - classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.5" + classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.6" } } ``` @@ -31,7 +31,7 @@ buildscript { } } dependencies { - classpath("gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.5") + classpath("gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.6") } } ``` @@ -76,12 +76,23 @@ for each build. ### Advanced configuration +For **Groovy** ```groovy proguardDictionaries { - dictionaryNames = ["any", "files, "you", "want"] - minLineLength 20 // Default value: 10 - maxLineLength 50 // Default value: 30 - linesCountInDictionary 50000 // Default value: 30000 + dictionaryNames = [ "any", "files, "you", "want" ] + minLineLength 20 // Default value: 10 + maxLineLength 50 // Default value: 30 + linesCountInDictionary 50000 // Default value: 30000 +} +``` + +For **Kotlin DSL** +```kotlin +proguardDictionaries { + dictionaryNames = [ "any", "files, "you", "want" ] + minLineLength = 20 // Default value: 10 + maxLineLength = 50 // Default value: 30 + linesCountInDictionary = 50000 // Default value: 30000 } ``` @@ -97,12 +108,12 @@ Add to your `proguard-rules.pro` file: ## Program classes number issue -**Important:** if the final number of classes in `*.apk` after code shrinking by Proguard / R8 -**exceeds the `linesCountInDictionary` value**, then all remaining classes **will be named by -default** – starting with first alphabet letters. +**Important:** if the final number of classes in `*.apk` after code shrinking **exceeds the +`linesCountInDictionary` value**, then all remaining classes **will be named by default** – +starting with first alphabet letters. Thus, the `linesCountInDictionary` value must be greater than a number of program classes after -the code shrinking. +code shrinking. The default size of the dictionary is `30000` lines. @@ -118,7 +129,7 @@ Or: **Analyze APK...**). 3. In APK Analyzer window select `classes.dex` file. Check the value in the line "This dex file defines X classes..." -4. If more than one `*.dex` files present in APK, select each of them and sum up all classes numbers. +4. If more `*.dex` files present in APK, select each of them and sum up all classes numbers. Finally, set the value of `linesCountInDictionary` slightly greater than the resulting number of program classes to keep an extra space for application grow (e. g. if program contains