{"id":335656,"date":"2022-07-13T09:00:26","date_gmt":"2022-07-13T09:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=335656"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=335656","title":{"rendered":"<span>[Android] \u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043e\u043a flavors \u0438 buildTypes \u043c\u0430\u043b\u043e\u0439 \u043a\u0440\u043e\u0432\u044c\u044e \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c BuildConfig<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u043b\u0435\u0439\u0432\u043e\u0440\u043e\u0432 \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u0412\u043e\u0437\u043d\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441. \u0413\u043e\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442<\/h2>\n<p>\u0418\u043c\u0435\u043b\u0430\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u043b\u0435\u0439\u0432\u043e\u0440 \u0438 \u0442\u0438\u043f \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u0438\u0437-\u0437\u0430 BuildConfig, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b: \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438 \u0444\u0438\u0447 \u0438 \u0442.\u043f. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u043b\u0435\u0439\u0432\u043e\u0440\u0430 \u0438 \u0442\u0438\u043f\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 BuildConfig, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043c\u0435\u043d\u0430 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u0443\u0441\u043a\u0430\u0445 \u043a\u043e\u0434\u0430 \u0438\u0437 \u043d\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f fastapp, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0437-\u0437\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f. \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 runtime \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GlobalConfig \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 BuildConfig. \u201c\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b\u201d \u0432 GlobalConfig \u2013 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 var, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f app, \u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u044f fastapp. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b Google \u0438 Huawei \u0438\u0437 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4fc\/224\/b82\/4fc224b8267a17946a879b3fc3d3e676.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4fc\/224\/b82\/4fc224b8267a17946a879b3fc3d3e676.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h3>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c fastapp \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0442\u0443\u0434\u0430 \u0432\u0441\u0435, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u043c application-\u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0430 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c app \u2013 Android-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u0412\u043e \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u043a\u0440\u043e\u043c\u0435 fastapp, \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c buildConfig \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e buildFeatures \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043a\u043b\u0430\u0441\u0441 BuildConfig. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u0449\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u2013 common, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c app \u0438 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b build.gradle \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438.<\/p>\n<p>fastapp\/build.gradle<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.application' \/\/ [...]  android {     buildFeatures {         buildConfig = true     }      buildTypes {         debug {             buildConfigField 'boolean', 'PRINT_LOGS', 'true'         }         qa {             buildConfigField 'boolean', 'PRINT_LOGS', 'true'         }         release {             buildConfigField 'boolean', 'PRINT_LOGS', 'false'         }     }      flavorDimensions 'market', 'server'      productFlavors {         google {             dimension 'market'             buildConfigField 'String', 'PLATFORM', '\"google\"'         }         huawei {             dimension 'market'             buildConfigField 'String', 'PLATFORM', '\"huawei\"'         }          dev {             dimension 'server'             buildConfigField 'String', 'BASE_API_URL', \"\\\"${apiUrl}\\\"\"         }         prod {             dimension 'server'             buildConfigField 'String', 'BASE_API_URL', \"\\\"${apiUrl}\\\"\"         }     } }<\/code><\/pre>\n<p>app\/build.gradle<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.library' \/\/ [...]  android {     defaultConfig {         \/\/ [...]          buildConfigField 'int', 'DB_VERSION', '14'     }      buildFeatures {         buildConfig = true     } }  dependencies {     implementation project(\":common\")      \/\/ [...] }<\/code><\/pre>\n<p>common\/build.gradle<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.library' \/\/ [...]  android {     buildFeatures {         buildConfig = false     } }  dependencies {     \/\/ [...] }<\/code><\/pre>\n<p>build.gradle \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.library' \/\/ [...]  android {     buildFeatures {         buildConfig = false     } }  dependencies {     implementation project(\":common\")      \/\/ [...] }<\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430<\/h3>\n<p>GlobalConfig \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 object \u0441 var-\u043f\u043e\u043b\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 runtime. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e\u043b\u0435\u0439 \u0432 build.gradle \u043c\u043e\u0434\u0443\u043b\u044f fastapp.<\/p>\n<pre><code class=\"kotlin\">object GlobalConfig {     \/\/ [...]      var PRINT_LOGS: Boolean by singleAssign()     var PLATFORM: String by singleAssign()     var BASE_API_URL: String by singleAssign() }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f singleAssign \u0434\u0435\u043b\u0435\u0433\u0430\u0442.<\/p>\n<details class=\"spoiler\">\n<summary>SingleAssignDelegate.kt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"kotlin\">internal inline fun &lt;reified T> singleAssign() = SingleAssignDelegate&lt;T>()  internal class SingleAssignDelegate &lt;T> : ReadWriteProperty&lt;Any?, T> {     private var savedValue: T? = null      override fun getValue(         thisRef: Any?,         property: KProperty&lt;*>     ): T = savedValue!!      override fun setValue(         thisRef: Any?,         property: KProperty&lt;*>,         value: T     ) {         if (savedValue == null) {             savedValue = value         }     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 DI \u0438 Application \u043a\u043b\u0430\u0441\u0441\u0430<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f dummy-\u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c common. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u043c dummy-\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0442\u043e\u0431\u044b &#171;\u043f\u043e\u0442\u0440\u043e\u0433\u0430\u0442\u044c&#187; Hilt-\u043c\u043e\u0434\u0443\u043b\u044c, \u0432 \u0431\u043b\u043e\u043a\u0435 init \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0435\u0439 \u0434\u043b\u044f GlobalConfig \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 BuildConfig. \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0443 ConfigModule, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u043e\u0439.<\/p>\n<p>Dummy.kt<\/p>\n<pre><code class=\"kotlin\">object Dummy<\/code><\/pre>\n<p>App.kt<\/p>\n<pre><code class=\"kotlin\">@HiltAndroidApp class App : Application() {     \/\/ [...]      @Inject     lateinit var dummy: Dummy      override fun onCreate() {         super.onCreate()          if (GlobalConfig.PRINT_LOGS) {             Timber.plant(Timber.DebugTree())         }          \/\/ [...]     } }<\/code><\/pre>\n<p>ConfigModule.kt<\/p>\n<pre><code class=\"kotlin\">@Module @InstallIn(SingletonComponent::class) object ConfigModule {     init {         with(GlobalConfig) {             \/\/ [...]              PRINT_LOGS = BuildConfig.PRINT_LOGS             PLATFORM = BuildConfig.PLATFORM             BASE_API_URL = BuildConfig.BASE_API_URL         }     }      @Provides     @Singleton     fun provideDummy() = Dummy }<\/code><\/pre>\n<p><em>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0435\u0437 Dummy \u0438 ConfigModule<\/em>: \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0431\u043b\u043e\u043a\u0435 init \u043a\u043b\u0430\u0441\u0441\u0430 App \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Hilt-\u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0442\u044c dummy-\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<details class=\"spoiler\">\n<summary>App.kt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"kotlin\">class App : Application() {     init {         with(GlobalConfig) {             \/\/ [...]              PRINT_LOGS = BuildConfig.PRINT_LOGS             PLATFORM = BuildConfig.PLATFORM             BASE_API_URL = BuildConfig.BASE_API_URL         }     }      override fun onCreate() {         super.onCreate()          if (GlobalConfig.PRINT_LOGS) {             Timber.plant(Timber.DebugTree())         }          \/\/ [...]     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c 4 \u043a\u0435\u0439\u0441\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<h3>\u041a\u0435\u0439\u0441 1\/4: Room \u0438 \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0435 \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0432 defaultConfig \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c BuildConfig \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f app. \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e, \u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0447\u0430\u0441\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f app.<\/p>\n<p>AppRoomDatabase.kt<\/p>\n<pre><code class=\"kotlin\">@Database(     entities = [         \/\/ [...]     ],     version = BuildConfig.DB_VERSION ) abstract class AppRoomDatabase : RoomDatabase() {     \/\/ [...] }<\/code><\/pre>\n<p>app\/build.gradle<\/p>\n<pre><code class=\"kotlin\">android {     defaultConfig {         \/\/ [...]          buildConfigField 'int', 'DB_VERSION', '14'     } }<\/code><\/pre>\n<h3>\u041a\u0435\u0439\u0441 2\/4: Retrofit Service Interface \u0438 \u043a\u043b\u044e\u0447\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435<\/h3>\n<p>\u041a\u0435\u0439\u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433:\u00a0 \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 Retrofit \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0438\u0437 BuildConfig.<\/p>\n<pre><code class=\"kotlin\">@POST(\"api\/${BuildConfig.API_KEY}\") suspend fun query(@Body request: RequestBody): JsonObject<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u044e\u0447 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u043b\u0435\u0439\u0432\u043e\u0440\u0430 \u0438 \u0442\u0438\u043f\u0430 \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0432\u044b\u0448\u0435 \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u044e\u0447 \u0447\u0435\u0440\u0435\u0437 @Path \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e.  <\/p>\n<pre><code class=\"kotlin\">@POST(\"api\/{key}\") suspend fun query(     @Path(\"key\") key: String,     @Body request: RequestBody ): JsonObject<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u0434\u0430\u0435\u043c \u043a\u043b\u044e\u0447 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GlobalConfig: api.query(GlobalConfig.ANOTHER_KEY, request).<\/p>\n<h3>\u041a\u0435\u0439\u0441 3\/4: BarcodeAnalyzer \u0444\u0430\u0431\u0440\u0438\u043a\u0430<\/h3>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u043e\u0431\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c common \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 BarcodeAnalyzerImpl \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 ScanSession, \u043e\u0442\u0441\u044e\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c common \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<pre><code class=\"kotlin\">class ScanSession(     private val scanWindowArea: ScanWindowArea,     private val type: BarcodeAnalyzerType? = QR,     private val onBarcodeScanned: ((String) -> Unit)? = null, ) {     private val barcodeAnalyzer by lazy {         BarcodeAnalyzerImpl(type, scanWindowArea, displaySize) { code ->             onBarcodeScanned?.invoke(code)         }     }     private val displaySize by lazy { \/* [...] *\/ }      \/\/ [...] }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0442\u044c, \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044f \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0440\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438: \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c common<\/p>\n<pre><code class=\"kotlin\">class ScanSession(     private val barcodeAnalyzerFactory: BarcodeAnalyzerFactory,     private val scanWindowArea: ScanWindowArea,     private val type: BarcodeAnalyzerType? = QR,     private val onBarcodeScanned: ((String) -> Unit)? = null, ) {     private val barcodeAnalyzer by lazy {         barcodeAnalyzerFactory.create(type, scanWindowArea, displaySize) { code ->             onBarcodeScanned?.invoke(code)         }     }     private val displaySize by lazy { \/* [...] *\/ }      \/\/ [...] }  interface BarcodeAnalyzerFactory {     fun create(         type: BarcodeAnalyzerType?,         scanArea: ScanWindowArea,         displaySize: Size,         onBarcodeScanned: ((String) -> Unit)? = null     ): BarcodeAnalyzer }<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei<\/p>\n<pre><code class=\"kotlin\">@Provides @Singleton fun provideBarcodeAnalyzerFactory(): BarcodeAnalyzerFactory {     return object : BarcodeAnalyzerFactory {         override fun create(             type: BarcodeAnalyzerType?,             scanArea: ScanWindowArea,             displaySize: Size,             onBarcodeScanned: ((String) -> Unit)?         ): BarcodeAnalyzer {             return BarcodeAnalyzerImpl(type, scanArea, displaySize, onBarcodeScanned)         }     } }<\/code><\/pre>\n<h3>\u041a\u0435\u0439\u0441 4\/4: \u041f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0436\u0435\u043d\u0438\u0435 ISP (Interface Segregation Principle, \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430)<\/h3>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438. \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 common. \u042d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 app, \u0430 \u0442\u0430\u043a \u0436\u0435 \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0443\u0436\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c common<\/p>\n<pre><code class=\"kotlin\">interface Repository {     val notModel: Boolean     var model: Model \/\/ common \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e Model \u0432 app \u043c\u043e\u0434\u0443\u043b\u0435 }<\/code><\/pre>\n<p>\u0420\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0432 app, \u0430 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c common.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c app<\/p>\n<pre><code class=\"kotlin\">interface Repository2 {     \/\/ [...]     var model: Model }  class RepositoryImpl(     \/\/ [...] ) : Repository, Repository2<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c common<\/p>\n<pre><code class=\"kotlin\">interface Repository {     val notModel: Boolean     \/\/ [...] }<\/code><\/pre>\n<h2>Benchmarks<\/h2>\n<p>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u0441\u043b\u0435. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0434\u043e\u0445\u043e\u0434\u0438\u043b\u043e \u0434\u043e 1 \u0447\u0430\u0441\u0430. \u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u043e\u0441\u044c \u0432 \u0440\u0430\u0437\u044b \u0438 \u0441\u0442\u0430\u043b\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u043d\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/890\/cea\/8db\/890cea8db8dc6536b05fa68d629b542d.png\" width=\"1581\" height=\"701\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/890\/cea\/8db\/890cea8db8dc6536b05fa68d629b542d.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0427\u0435\u043a-\u043b\u0438\u0441\u0442<\/h2>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0444\u0430\u0439\u043b\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 fastapp.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u043a\u0440\u043e\u043c\u0435 fastaapp, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e BuildConfig. (\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0435\u0440\u0441\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u043a\u043e.)<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u0433\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, BuildConfig \u043d\u0430 GlobalConfig (\u0435\u0441\u043b\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0443\u043d\u043a\u0442, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f app \u043d\u0430 fastapp \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CI.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c [google\/huawei]Implementation \u043d\u0430 implementation \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 com.android.application \u043c\u043e\u0434\u0443\u043b\u0435.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0432\u0441\u0435\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0431\u044b\u043b \u043e\u0434\u0438\u043d \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u043b\u0435\u0439\u0432\u043e\u0440\u043e\u0432 \u0438 \u0442\u0438\u043f\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438 \u0438\u0437 BuildConfig, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c fastapp. \u0412 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c GlobalConfig. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f fastapp.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/676634\/\"> https:\/\/habr.com\/ru\/post\/676634\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u043b\u0435\u0439\u0432\u043e\u0440\u043e\u0432 \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u0412\u043e\u0437\u043d\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441. \u0413\u043e\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442<\/h2>\n<p>\u0418\u043c\u0435\u043b\u0430\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u043b\u0435\u0439\u0432\u043e\u0440 \u0438 \u0442\u0438\u043f \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u0438\u0437-\u0437\u0430 BuildConfig, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b: \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438 \u0444\u0438\u0447 \u0438 \u0442.\u043f. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u043b\u0435\u0439\u0432\u043e\u0440\u0430 \u0438 \u0442\u0438\u043f\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 BuildConfig, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043c\u0435\u043d\u0430 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u0443\u0441\u043a\u0430\u0445 \u043a\u043e\u0434\u0430 \u0438\u0437 \u043d\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f fastapp, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0437-\u0437\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f. \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 runtime \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GlobalConfig \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 BuildConfig. \u201c\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b\u201d \u0432 GlobalConfig \u2013 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 var, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f app, \u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u044f fastapp. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b Google \u0438 Huawei \u0438\u0437 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h3>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c fastapp \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0442\u0443\u0434\u0430 \u0432\u0441\u0435, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u043c application-\u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0430 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c app \u2013 Android-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u0412\u043e \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u043a\u0440\u043e\u043c\u0435 fastapp, \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c buildConfig \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e buildFeatures \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043a\u043b\u0430\u0441\u0441 BuildConfig. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u0449\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u2013 common, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c app \u0438 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b build.gradle \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438.<\/p>\n<p>fastapp\/build.gradle<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.application' \/\/ [...]  android {     buildFeatures {         buildConfig = true     }      buildTypes {         debug {             buildConfigField 'boolean', 'PRINT_LOGS', 'true'         }         qa {             buildConfigField 'boolean', 'PRINT_LOGS', 'true'         }         release {             buildConfigField 'boolean', 'PRINT_LOGS', 'false'         }     }      flavorDimensions 'market', 'server'      productFlavors {         google {             dimension 'market'             buildConfigField 'String', 'PLATFORM', '\"google\"'         }         huawei {             dimension 'market'             buildConfigField 'String', 'PLATFORM', '\"huawei\"'         }          dev {             dimension 'server'             buildConfigField 'String', 'BASE_API_URL', \"\\\"${apiUrl}\\\"\"         }         prod {             dimension 'server'             buildConfigField 'String', 'BASE_API_URL', \"\\\"${apiUrl}\\\"\"         }     } }<\/code><\/pre>\n<p>app\/build.gradle<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.library' \/\/ [...]  android {     defaultConfig {         \/\/ [...]          buildConfigField 'int', 'DB_VERSION', '14'     }      buildFeatures {         buildConfig = true     } }  dependencies {     implementation project(\":common\")      \/\/ [...] }<\/code><\/pre>\n<p>common\/build.gradle<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.library' \/\/ [...]  android {     buildFeatures {         buildConfig = false     } }  dependencies {     \/\/ [...] }<\/code><\/pre>\n<p>build.gradle \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei<\/p>\n<pre><code class=\"kotlin\">apply plugin: 'com.android.library' \/\/ [...]  android {     buildFeatures {         buildConfig = false     } }  dependencies {     implementation project(\":common\")      \/\/ [...] }<\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430<\/h3>\n<p>GlobalConfig \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 object \u0441 var-\u043f\u043e\u043b\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 runtime. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e\u043b\u0435\u0439 \u0432 build.gradle \u043c\u043e\u0434\u0443\u043b\u044f fastapp.<\/p>\n<pre><code class=\"kotlin\">object GlobalConfig {     \/\/ [...]      var PRINT_LOGS: Boolean by singleAssign()     var PLATFORM: String by singleAssign()     var BASE_API_URL: String by singleAssign() }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f singleAssign \u0434\u0435\u043b\u0435\u0433\u0430\u0442.<\/p>\n<details class=\"spoiler\">\n<summary>SingleAssignDelegate.kt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"kotlin\">internal inline fun &lt;reified T> singleAssign() = SingleAssignDelegate&lt;T>()  internal class SingleAssignDelegate &lt;T> : ReadWriteProperty&lt;Any?, T> {     private var savedValue: T? = null      override fun getValue(         thisRef: Any?,         property: KProperty&lt;*>     ): T = savedValue!!      override fun setValue(         thisRef: Any?,         property: KProperty&lt;*>,         value: T     ) {         if (savedValue == null) {             savedValue = value         }     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 DI \u0438 Application \u043a\u043b\u0430\u0441\u0441\u0430<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f dummy-\u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c common. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u043c dummy-\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0442\u043e\u0431\u044b &#171;\u043f\u043e\u0442\u0440\u043e\u0433\u0430\u0442\u044c&#187; Hilt-\u043c\u043e\u0434\u0443\u043b\u044c, \u0432 \u0431\u043b\u043e\u043a\u0435 init \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0435\u0439 \u0434\u043b\u044f GlobalConfig \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 BuildConfig. \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0443 ConfigModule, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u043e\u0439.<\/p>\n<p>Dummy.kt<\/p>\n<pre><code class=\"kotlin\">object Dummy<\/code><\/pre>\n<p>App.kt<\/p>\n<pre><code class=\"kotlin\">@HiltAndroidApp class App : Application() {     \/\/ [...]      @Inject     lateinit var dummy: Dummy      override fun onCreate() {         super.onCreate()          if (GlobalConfig.PRINT_LOGS) {             Timber.plant(Timber.DebugTree())         }          \/\/ [...]     } }<\/code><\/pre>\n<p>ConfigModule.kt<\/p>\n<pre><code class=\"kotlin\">@Module @InstallIn(SingletonComponent::class) object ConfigModule {     init {         with(GlobalConfig) {             \/\/ [...]              PRINT_LOGS = BuildConfig.PRINT_LOGS             PLATFORM = BuildConfig.PLATFORM             BASE_API_URL = BuildConfig.BASE_API_URL         }     }      @Provides     @Singleton     fun provideDummy() = Dummy }<\/code><\/pre>\n<p><em>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0435\u0437 Dummy \u0438 ConfigModule<\/em>: \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0431\u043b\u043e\u043a\u0435 init \u043a\u043b\u0430\u0441\u0441\u0430 App \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Hilt-\u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0442\u044c dummy-\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<details class=\"spoiler\">\n<summary>App.kt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"kotlin\">class App : Application() {     init {         with(GlobalConfig) {             \/\/ [...]              PRINT_LOGS = BuildConfig.PRINT_LOGS             PLATFORM = BuildConfig.PLATFORM             BASE_API_URL = BuildConfig.BASE_API_URL         }     }      override fun onCreate() {         super.onCreate()          if (GlobalConfig.PRINT_LOGS) {             Timber.plant(Timber.DebugTree())         }          \/\/ [...]     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c 4 \u043a\u0435\u0439\u0441\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<h3>\u041a\u0435\u0439\u0441 1\/4: Room \u0438 \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0435 \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0432 defaultConfig \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c BuildConfig \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f app. \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e, \u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0447\u0430\u0441\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f app.<\/p>\n<p>AppRoomDatabase.kt<\/p>\n<pre><code class=\"kotlin\">@Database(     entities = [         \/\/ [...]     ],     version = BuildConfig.DB_VERSION ) abstract class AppRoomDatabase : RoomDatabase() {     \/\/ [...] }<\/code><\/pre>\n<p>app\/build.gradle<\/p>\n<pre><code class=\"kotlin\">android {     defaultConfig {         \/\/ [...]          buildConfigField 'int', 'DB_VERSION', '14'     } }<\/code><\/pre>\n<h3>\u041a\u0435\u0439\u0441 2\/4: Retrofit Service Interface \u0438 \u043a\u043b\u044e\u0447\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435<\/h3>\n<p>\u041a\u0435\u0439\u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433:\u00a0 \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 Retrofit \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0438\u0437 BuildConfig.<\/p>\n<pre><code class=\"kotlin\">@POST(\"api\/${BuildConfig.API_KEY}\") suspend fun query(@Body request: RequestBody): JsonObject<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u044e\u0447 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u043b\u0435\u0439\u0432\u043e\u0440\u0430 \u0438 \u0442\u0438\u043f\u0430 \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0432\u044b\u0448\u0435 \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u044e\u0447 \u0447\u0435\u0440\u0435\u0437 @Path \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e.  <\/p>\n<pre><code class=\"kotlin\">@POST(\"api\/{key}\") suspend fun query(     @Path(\"key\") key: String,     @Body request: RequestBody ): JsonObject<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u0434\u0430\u0435\u043c \u043a\u043b\u044e\u0447 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GlobalConfig: api.query(GlobalConfig.ANOTHER_KEY, request).<\/p>\n<h3>\u041a\u0435\u0439\u0441 3\/4: BarcodeAnalyzer \u0444\u0430\u0431\u0440\u0438\u043a\u0430<\/h3>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u043e\u0431\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c common \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 BarcodeAnalyzerImpl \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 ScanSession, \u043e\u0442\u0441\u044e\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c common \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<pre><code class=\"kotlin\">class ScanSession(     private val scanWindowArea: ScanWindowArea,     private val type: BarcodeAnalyzerType? = QR,     private val onBarcodeScanned: ((String) -> Unit)? = null, ) {     private val barcodeAnalyzer by lazy {         BarcodeAnalyzerImpl(type, scanWindowArea, displaySize) { code ->             onBarcodeScanned?.invoke(code)         }     }     private val displaySize by lazy { \/* [...] *\/ }      \/\/ [...] }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0442\u044c, \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044f \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0440\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438: \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c common<\/p>\n<pre><code class=\"kotlin\">class ScanSession(     private val barcodeAnalyzerFactory: BarcodeAnalyzerFactory,     private val scanWindowArea: ScanWindowArea,     private val type: BarcodeAnalyzerType? = QR,     private val onBarcodeScanned: ((String) -> Unit)? = null, ) {     private val barcodeAnalyzer by lazy {         barcodeAnalyzerFactory.create(type, scanWindowArea, displaySize) { code ->             onBarcodeScanned?.invoke(code)         }     }     private val displaySize by lazy { \/* [...] *\/ }      \/\/ [...] }  interface BarcodeAnalyzerFactory {     fun create(         type: BarcodeAnalyzerType?,         scanArea: ScanWindowArea,         displaySize: Size,         onBarcodeScanned: ((String) -> Unit)? = null     ): BarcodeAnalyzer }<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 Google \u0438 Huawei<\/p>\n<pre><code class=\"kotlin\">@Provides @Singleton fun provideBarcodeAnalyzerFactory(): BarcodeAnalyzerFactory {     return object : BarcodeAnalyzerFactory {         override fun create(             type: BarcodeAnalyzerType?,             scanArea: ScanWindowArea,             displaySize: Size,             onBarcodeScanned: ((String) -> Unit)?         ): BarcodeAnalyzer {             return BarcodeAnalyzerImpl(type, scanArea, displaySize, onBarcodeScanned)         }     } }<\/code><\/pre>\n<h3>\u041a\u0435\u0439\u0441 4\/4: \u041f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0436\u0435\u043d\u0438\u0435 ISP (Interface Segregation Principle, \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430)<\/h3>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-335656","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335656"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335656\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}