{"id":460709,"date":"2025-05-23T09:00:16","date_gmt":"2025-05-23T09:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=460709"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=460709","title":{"rendered":"<span>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Konfeature, \u043d\u0430\u0448\u0443 open-source \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Feature Flags<\/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<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/75f\/c26\/ed9\/75fc26ed9b4a25dc2010f846dae2d792.png\" width=\"1920\" height=\"1080\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/75f\/c26\/ed9\/75fc26ed9b4a25dc2010f846dae2d792.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/75f\/c26\/ed9\/75fc26ed9b4a25dc2010f846dae2d792.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u042d\u0442\u043e \u0421\u0430\u0448\u0430 \u0422\u0430\u0431\u043e\u043b\u0438\u043d \u2014 \u0441\u0442\u0430\u0440\u0448\u0438\u0439 android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 red_mad_robot. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/RedMadRobot\/Konfeature\">Konfeature<\/a> \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Feature Flags \u0438 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439.<\/p>\n<h2>Feature Flags \u0432 android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435\u00a0<\/h2>\n<p>\u00ab\u0424\u0438\u0447\u0430 \u0424\u043b\u0430\u0433\u0438\u00bb \u2014 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0439 CI\/CD-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0433\u0438\u0431\u043a\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043b\u044e\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Feature Flags:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0439 rollout \u2014 \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u0447\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0451 \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u0440\u0438\u0441\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>A\/B-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043c\u0435\u0442\u0440\u0438\u043a \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043e\u0442\u043a\u0430\u0442 \u2014 \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0430\u0441\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u0443\u044e \u0444\u0438\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0435\u0437 \u0432\u044b\u043f\u0443\u0441\u043a\u0430 Hotfix;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u2014 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u044f\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Feature Flags<\/h3>\n<p><strong>1. \u0427\u0451\u0442\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 remote \u0438 local-only \u0444\u043b\u0430\u0433\u0438<\/strong><\/p>\n<ul>\n<li>\n<p>Remote \u0444\u043b\u0430\u0433\u0438 \u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u2014 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0438\u0447;<\/p>\n<\/li>\n<li>\n<p>Local-only \u0444\u043b\u0430\u0433\u0438 \u2014 \u0445\u0430\u0440\u0434\u043a\u043e\u0434 \u0438\u043b\u0438 debug-\u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u2014 \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 remote-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/strong><\/p>\n<p>\u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>Firebase Remote Config \u2014 \u0434\u043b\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Google;<\/p>\n<\/li>\n<li>\n<p>HMS Remote Configuration \u2014 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 Huawei;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Backend \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Feature Flags \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p><strong>3. \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438<\/strong><\/p>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Feature Fags \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0443\u0434\u0430 \u043e\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e: \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433, Firebase, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 API;<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u043b\u0438 \u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0440\u043d\u0443\u043b \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e Boolean.<\/p>\n<\/li>\n<\/ul>\n<p><strong>4. \u0413\u0438\u0431\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435<\/strong><\/p>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 QA, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\/\u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u043b\u0430\u0433\u043e\u0432 \u0432 runtime;<\/p>\n<\/li>\n<li>\n<p>\u042d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d.<\/p>\n<\/li>\n<\/ul>\n<p><strong>5. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/strong><\/p>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043a\u043e\u0434 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Feature Flags \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0418\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<strong> <\/strong>\u0441\u0432\u043e\u0438\u043c\u0438 \u0444\u043b\u0430\u0433\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a Konfeature \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Feature Flags\u00a0<\/h2>\n<p>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0432\u0435\u0441 \u043f\u044f\u0442\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Feature Flags, \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0438 \u043f\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e API.<\/p>\n<ol>\n<li>\n<p><code>FeatureConfig<\/code> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0433\u0440\u0443\u043f\u043f\u0435 Feature Flags;<\/p>\n<\/li>\n<li>\n<p><code>FeatureSource <\/code>\u2014 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Feature Flags;<\/p>\n<\/li>\n<li>\n<p><code>Interceptor<\/code> \u2014 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Feature Flags, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><code>Spec<\/code> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 FeatureConfig;<\/p>\n<\/li>\n<li>\n<p><code>Logger<\/code> \u2014 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<\/li>\n<\/ol>\n<h3>1. FeatureConfig<\/h3>\n<p><strong>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 Feature Flags \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <\/strong><code><strong>FeatureConfig<\/strong><\/code><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 <code>FeatureConfig<\/code>, \u0443\u043a\u0430\u0437\u0430\u0432 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 <code>name<\/code> \u0438 <code>description<\/code> \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"kotlin\">class FeatureAConfig: FeatureConfig(       name = \"Feature A\",       description = \"Description of Feature A\"   )<\/code><\/pre>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c Feature Flag, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0435\u043b\u0435\u0433\u0430\u0442 <code>by toggle<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p><code>key<\/code> \u2014 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 <code>FeatureSource<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>description<\/code> \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 Feature Flag \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><code>defaultValue<\/code> \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p><code>sourceSelectionStrategy<\/code> \u2014 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u0430 <code>FeatureSource<\/code>, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0442\u043e\u0438\u0442 <code>SourceSelectionStrategy.None<\/code> \u2014 \u044d\u0442\u043e local-only \u0444\u043b\u0430\u0433.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"kotlin\">class FeatureAConfig: FeatureConfig(       name = \"Feature A\",       description = \"Description of Feature A\"   ) {          val isDetailedFeatureDescriptionEnabled by toggle(           key = \"detailed_feature_a_description\",           description = \"show detailed description of feature A\",           defaultValue = true,         sourceSelectionStrategy = SourceSelectionStrategy.None       )     }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u2014 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c <code>FeatureConfig<\/code> \u0432 Konfeature.<\/p>\n<pre><code class=\"kotlin\">val featureAConfig = FeatureAConfig()  konfeature {       register(featureAConfig) }<\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c <code>FeatureAConfig<\/code> \u0432\u043e <code>ViewModel<\/code>.<\/p>\n<pre><code class=\"kotlin\">class SomeViewModel(featureAConfig: FeatureAConfig): ViewModel() {  \u00a0\u00a0\u00a0\u00a0init {\u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (featureAConfig.isDetailedFeatureDescriptionEnabled) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0showDetailedFeatureDescription()  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}  \u00a0\u00a0\u00a0\u00a0}  \u00a0\u00a0\u00a0\u00a0private fun showDetailedFeatureDescription() { ... } }<\/code><\/pre>\n<p><strong>\u0414\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <\/strong>\u2014 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 DI \u0441 Hilt.\u00a0<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <code>app<\/code> \u0438 \u0434\u0432\u0430 \u0444\u0438\u0447\u0430-\u043c\u043e\u0434\u0443\u043b\u044f: <code>featureA<\/code> \u0438 <code>featureB<\/code>.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <code>featureA<\/code> \u043e\u0431\u044a\u044f\u0432\u0438\u043c Singleton \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<pre><code class=\"kotlin\">@Singleton   class FeatureAConfig @Inject constructor(): FeatureConfig(       name = \"Feature A\",       description = \"Description of Feature A\"   ) {          val isDetailedFeatureDescriptionEnabled by toggle(           key = \"detailed_feature_a_description\",           description = \"show detailed description of feature A\",           defaultValue = true,           sourceSelectionStrategy = SourceSelectionStrategy.None       )      }<\/code><\/pre>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <code>Dagger DI<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c <code>FeatureAConfig<\/code> \u0432 \u043e\u0431\u0449\u0438\u0439 <code>Set&lt;FeatureConfig&gt;<\/code>.<\/p>\n<pre><code class=\"kotlin\">@InstallIn(SingletonComponent::class)   @Module   class FeatureAModule {          @Provides @IntoSet       fun provideFeatureConfig(config: FeatureAConfig): FeatureConfig = config      }<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>featureB<\/code>. \u0412 <code>app<\/code> \u043c\u043e\u0434\u0443\u043b\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 <code>Set&lt;FeatureConfig&gt;<\/code>.<\/p>\n<pre><code class=\"kotlin\">@InstallIn(SingletonComponent::class)   @Module   class AppModule {          @Singleton       @JvmSuppressWildcards         @Provides         fun provideKonfeature(configs: Set&lt;FeatureConfig&gt;): Konfeature {           return konfeature {               configs.forEach(::register)           }       }   }<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0438\u0437\u0431\u0435\u0436\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430 \u0432\u043d\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439.<\/p>\n<h3>2. FeatureSource<\/h3>\n<p><code>FeatureSource<\/code> \u2014 \u044d\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f Feature Flags, \u043e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 name, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 <code>SourceSelectionStrategy<\/code> \u0438 \u043e\u0442\u0434\u0430\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e <code>key<\/code>.<\/p>\n<pre><code class=\"kotlin\">public interface FeatureSource {      public val name: String      public fun get(key: String): Any? }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f <code>FirebaseRemoteConfig<\/code>.<\/p>\n<pre><code class=\"kotlin\">  class FirebaseFeatureSource(     private val remoteConfig: FirebaseRemoteConfig ) : FeatureSource {          override val name: String = \"FirebaseRemoteConfig\"      override fun get(key: String): Any? {         return remoteConfig             .getValue(key)             .takeIf { source == FirebaseRemoteConfig.VALUE_SOURCE_REMOTE }             ?.let { value: FirebaseRemoteConfigValue -&gt;                 value.getOrNull { asBoolean() }                     ?: value.getOrNull { asString() }                     ?: value.getOrNull { asLong() }                     ?: value.getOrNull { asDouble() }             }     }              private fun FirebaseRemoteConfigValue.getOrNull(         getter: FirebaseRemoteConfigValue.() -&gt; Any?     ): Any? {                 return try {             getter()             } catch (error: IllegalArgumentException) {             null         }             } }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b Feature Flags \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 <code>FirebaseFeatureSource<\/code>, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 Konfeature.<\/p>\n<pre><code class=\"kotlin\">val featureAConfig = FeatureAConfig() val source: FeatureSource = FirebaseFeatureSource(remoteConfig)  val konfeatureInstance = konfeature {     addSource(source)     register(featureAConfig)  }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 <code>FeatureAConfig<\/code>\u00a0\u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f <code>sourceSelectionStrategy<\/code> c <code>SourceSelectionStrategy.None<\/code> \u043d\u0430 <code>SourceSelectionStrategy.Any<\/code> \u0438\u043b\u0438 <code>SourceSelectionStrategy.anyOf(\"FirebaseRemoteConfig\")<\/code>\u2014 Feature Flag \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 <code>FirebaseRemoteConfig<\/code>.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <code>FeatureSource<\/code>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u2014 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e <code>FeatureSource<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0434\u043b\u044f Feature Flag \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>key<\/code>.<\/p>\n<h2>3. Interceptor<\/h2>\n<p><code>Intereceptor<\/code> \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Feature Flag, \u0435\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041a\u0430\u043a \u0438 <code>FeatureSource<\/code>, \u0438\u043c\u0435\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 <code>name<\/code>.<\/p>\n<pre><code class=\"kotlin\">public interface Interceptor {      public val name: String      public fun intercept(         valueSource: FeatureValueSource,          key: String,          value: Any     ): Any? }<\/code><\/pre>\n<p><code>FeatureValueSource<\/code> \u2014 \u044d\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f Feature Flag \u2014 <code>FeatureSource<\/code>, <code>Interceptor<\/code> \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"kotlin\">public sealed class FeatureValueSource {          public class Source(public val name: String) : FeatureValueSource()          public class Interceptor(public val name: String) : FeatureValueSource()          public object Default : FeatureValueSource()  }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 <code>intercept<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>null<\/code>, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Feature Flag \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <code>Interceptor<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>DebugPanelInterceptor<\/code>. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Debug Panel, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Feature Flags \u0432 Debug \u0441\u0431\u043e\u0440\u043a\u0430x.<\/p>\n<pre><code class=\"kotlin\">class DebugPanelInterceptor : Interceptor {      private val values = mutableMapOf&lt;String, Any&gt;()      override val name: String = \"DebugPanelInterceptor\"      override fun intercept(         valueSource: FeatureValueSource,          key: String,          value: Any ): Any? {         return values[key]     }      fun setFeatureValue(key: String, value: Any) {         values[key] = value     }      fun removeFeatureValue(key: String) {         values.remove(key)     } }<\/code><\/pre>\n<p>\u042d\u0442\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u043e\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 Konfeature.<\/p>\n<pre><code class=\"kotlin\">val featureAConfig = FeatureAConfig() val source: FeatureSource = FirebaseFeatureSource(remoteConfig) val debugPanelInterceptor: Interceptor = DebugPanelInterceptor()  val konfeatureInstance = konfeature {     addSource(source)     register(featureAConfig)      addInterceptor(debugPanelInterceptor) }<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <code>Interceptor<\/code>, \u043d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>FeatureSource<\/code>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u043f\u0440\u043e\u0441\u0438\u0442 <strong>\u0432\u0441\u0435<\/strong> <code>Interceptor<\/code> \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<h3>4. Spec<\/h3>\n<p>Konfeature \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0435\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Feature Flag.<\/p>\n<pre><code class=\"kotlin\">public interface Konfeature {          public val spec: List&lt;FeatureConfigSpec&gt;          public fun &lt;T : Any&gt; getValue(spec: FeatureValueSpec&lt;T&gt;): FeatureValue&lt;T&gt;   }<\/code><\/pre>\n<p><code>FeatureConfigSpec<\/code> \u0437\u0434\u0435\u0441\u044c \u2014 \u044d\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e <code>FeatureConfig<\/code>.<\/p>\n<pre><code class=\"kotlin\">public interface FeatureConfigSpec {       public val name: String              public val description: String       public val values: List&lt;FeatureValueSpec&lt;out Any&gt;&gt;   }<\/code><\/pre>\n<p>\u0410 <code>FeatureValueSpec<\/code> \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e Feature Flag.<\/p>\n<pre><code class=\"kotlin\">public class FeatureValueSpec&lt;T : Any&gt;(       public val key: String,       public val description: String,       public val defaultValue: T,       public val sourceSelectionStrategy: SourceSelectionStrategy   )<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0432 <code>FeatureValueSpec<\/code> \u0432 \u043c\u0435\u0442\u043e\u0434 <code>getValue<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>FeatureValue<\/code>.<\/p>\n<pre><code class=\"kotlin\">public class FeatureValue&lt;T&gt;(       public val source: FeatureValueSource,       public val value: T,   )<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 Feature Flags \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u043c\u0438 \u043f\u043e <code>FeatureConfig<\/code> \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c Feature Flags \u0432 Debug Panel \u2014 \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u043b\u044e\u0447\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h3>5. Logger<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<pre><code class=\"kotlin\">public interface Logger {          public fun log(severity: Severity, message: String)          public enum class Severity {           WARNING, INFO       }   }<\/code><\/pre>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f:<\/p>\n<p>1. \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e Feature Flag \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f;<\/p>\n<pre><code class=\"kotlin\">Get value 'true' by key 'profile_feature' from 'Source(name=FirebaseRemoteConfig)'<\/code><\/pre>\n<p>2. \u043e\u0448\u0438\u0431\u043a\u0430, \u0435\u0441\u043b\u0438 FeatureSource \u0432\u0435\u0440\u043d\u0443\u043b \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f.<\/p>\n<pre><code class=\"kotlin\">Unexpected value type for 'profile_button_appear_duration': expected type is 'kotlin.Long', but value from 'Source(name=FirebaseRemoteConfig)' is 'true' with type 'kotlin.Boolean'<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <code>Logger<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Timber.<\/p>\n<pre><code class=\"kotlin\">class TimberLogger: Logger {          override fun log(severity: Severity, message: String) {         if (severity == INFO) {             Timber.tag(TAG).i(message)             } else if (severity == WARNING) {             Timber.tag(TAG).w(message)         }     }          companion object {         private const val TAG = \"FeatureFlags\"     } }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, <code>TimberLogger<\/code> \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 Konfeature.<\/p>\n<pre><code class=\"kotlin\">val featureAConfig = FeatureAConfig() val source: FeatureSource = FirebaseFeatureSource(remoteConfig) val debugPanelInterceptor: Interceptor = DebugPanelInterceptor() val logger: Logger = TimberLogger()  val konfeatureInstance = konfeature {     addSource(source)     register(featureAConfig)      addInterceptor(debugPanelInterceptor)     setLogger(logger) }<\/code><\/pre>\n<h3>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c<\/h3>\n<ul>\n<li>\n<p>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Kotlin Multiplatform, \u043d\u043e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e JVM Target;<\/p>\n<\/li>\n<li>\n<p>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043b\u0435\u0433\u0430\u0442 by value \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442 Boolean.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/strong><\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u0432 <a href=\"https:\/\/github.com\/RedMadRobot\/Konfeature\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e Konfeature<\/a>;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u2014 \u043e\u043d\u0430 \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 DI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 Hilt;<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e \u2014 \u0432\u0430\u0448\u0438 \u043a\u0435\u0439\u0441\u044b \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<p><strong>\u041d\u0430\u0434<\/strong>\u00a0<strong>\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438<\/strong><\/p>\n<p>\u0442\u0435\u043a\u0441\u0442 \u2014 \u0421\u0430\u0448\u0430 \u0422\u0430\u0431\u043e\u043b\u0438\u043d;<\/p>\n<p>\u0440\u0435\u0434\u0430\u043a\u0442\u0443\u0440\u0430 \u2014 \u0418\u0433\u043e\u0440\u044c \u0420\u0435\u0448\u0435\u0442\u043d\u0438\u043a\u043e\u0432;<\/p>\n<p>\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u2014 \u042e\u043b\u044f \u0415\u0444\u0438\u043c\u043e\u0432\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/911972\/\"> https:\/\/habr.com\/ru\/articles\/911972\/<\/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<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u042d\u0442\u043e \u0421\u0430\u0448\u0430 \u0422\u0430\u0431\u043e\u043b\u0438\u043d \u2014 \u0441\u0442\u0430\u0440\u0448\u0438\u0439 android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 red_mad_robot. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/RedMadRobot\/Konfeature\">Konfeature<\/a> \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Feature Flags \u0438 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439.<\/p>\n<h2>Feature Flags \u0432 android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435\u00a0<\/h2>\n<p>\u00ab\u0424\u0438\u0447\u0430 \u0424\u043b\u0430\u0433\u0438\u00bb \u2014 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0439 CI\/CD-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0433\u0438\u0431\u043a\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043b\u044e\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Feature Flags:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0439 rollout \u2014 \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u0447\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0451 \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u0440\u0438\u0441\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>A\/B-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043c\u0435\u0442\u0440\u0438\u043a \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043e\u0442\u043a\u0430\u0442 \u2014 \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0430\u0441\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u0443\u044e \u0444\u0438\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0435\u0437 \u0432\u044b\u043f\u0443\u0441\u043a\u0430 Hotfix;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u2014 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u044f\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Feature Flags<\/h3>\n<p><strong>1. \u0427\u0451\u0442\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 remote \u0438 local-only \u0444\u043b\u0430\u0433\u0438<\/strong><\/p>\n<ul>\n<li>\n<p>Remote \u0444\u043b\u0430\u0433\u0438 \u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u2014 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0438\u0447;<\/p>\n<\/li>\n<li>\n<p>Local-only \u0444\u043b\u0430\u0433\u0438 \u2014 \u0445\u0430\u0440\u0434\u043a\u043e\u0434 \u0438\u043b\u0438 debug-\u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u2014 \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 remote-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/strong><\/p>\n<p>\u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>Firebase Remote Config \u2014 \u0434\u043b\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Google;<\/p>\n<\/li>\n<li>\n<p>HMS Remote Configuration \u2014 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 Huawei;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Backend \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Feature Flags \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p><strong>3. \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438<\/strong><\/p>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Feature Fags \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0443\u0434\u0430 \u043e\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e: \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433, Firebase, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 API;<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u043b\u0438 \u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0440\u043d\u0443\u043b \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e Boolean.<\/p>\n<\/li>\n<\/ul>\n<p><strong>4. \u0413\u0438\u0431\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435<\/strong><\/p>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 QA, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\/\u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u043b\u0430\u0433\u043e\u0432 \u0432 runtime;<\/p>\n<\/li>\n<li>\n<p>\u042d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d.<\/p>\n<\/li>\n<\/ul>\n<p><strong>5. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/strong><\/p>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043a\u043e\u0434 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Feature Flags \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0418\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<strong> <\/strong>\u0441\u0432\u043e\u0438\u043c\u0438 \u0444\u043b\u0430\u0433\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a Konfeature \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Feature Flags\u00a0<\/h2>\n<p>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0432\u0435\u0441 \u043f\u044f\u0442\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Feature Flags, \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0438 \u043f\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e API.<\/p>\n<ol>\n<li>\n<p><code>FeatureConfig<\/code> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0433\u0440\u0443\u043f\u043f\u0435 Feature Flags;<\/p>\n<\/li>\n<li>\n<p><code>FeatureSource <\/code>\u2014 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Feature Flags;<\/p>\n<\/li>\n<li>\n<p><code>Interceptor<\/code> \u2014 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Feature Flags, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><code>Spec<\/code> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 FeatureConfig;<\/p>\n<\/li>\n<li>\n<p><code>Logger<\/code> \u2014 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<\/li>\n<\/ol>\n<h3>1. FeatureConfig<\/h3>\n<p><strong>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 Feature Flags \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <\/strong><code><strong>FeatureConfig<\/strong><\/code><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 <code>FeatureConfig<\/code>, \u0443\u043a\u0430\u0437\u0430\u0432 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 <code>name<\/code> \u0438 <code>description<\/code> \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"kotlin\">class FeatureAConfig: FeatureConfig(       name = \"Feature A\",       description = \"Description of Feature A\"   )<\/code><\/pre>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c Feature Flag, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0435\u043b\u0435\u0433\u0430\u0442 <code>by toggle<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p><code>key<\/code> \u2014 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 <code>FeatureSource<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>description<\/code> \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 Feature Flag \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><code>defaultValue<\/code> \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p><code>sourceSelectionStrategy<\/code> \u2014 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u0430 <code>FeatureSource<\/code>, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0442\u043e\u0438\u0442 <code>SourceSelectionStrategy.None<\/code> \u2014 \u044d\u0442\u043e local-only \u0444\u043b\u0430\u0433.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"kotlin\">class FeatureAConfig: FeatureConfig(       name = \"Feature A\",       description = \"Description of Feature A\"   ) {          val isDetailedFeatureDescriptionEnabled by toggle(           key = \"detailed_feature_a_description\",           description = \"show detailed description of feature A\",           defaultValue = true,         sourceSelectionStrategy = SourceSelectionStrategy.None       )     }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u2014 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c <code>FeatureConfig<\/code> \u0432 Konfeature.<\/p>\n<pre><code class=\"kotlin\">val featureAConfig = FeatureAConfig()  konfeature {       register(featureAConfig) }<\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c <code>FeatureAConfig<\/code> \u0432\u043e <code>ViewModel<\/code>.<\/p>\n<pre><code class=\"kotlin\">class SomeViewModel(featureAConfig: FeatureAConfig): ViewModel() {  \u00a0\u00a0\u00a0\u00a0init {\u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (featureAConfig.isDetailedFeatureDescriptionEnabled) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0showDetailedFeatureDescription()  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}  \u00a0\u00a0\u00a0\u00a0}  \u00a0\u00a0\u00a0\u00a0private fun showDetailedFeatureDescription() { ... } }<\/code><\/pre>\n<p><strong>\u0414\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <\/strong>\u2014 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 DI \u0441 Hilt.\u00a0<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <code>app<\/code> \u0438 \u0434\u0432\u0430 \u0444\u0438\u0447\u0430-\u043c\u043e\u0434\u0443\u043b\u044f: <code>featureA<\/code> \u0438 <code>featureB<\/code>.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <code>featureA<\/code> \u043e\u0431\u044a\u044f\u0432\u0438\u043c Singleton \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<pre><code class=\"kotlin\">@Singleton   class FeatureAConfig @Inject constructor(): FeatureConfig(       name = \"Feature A\",       description = \"Description of Feature A\"   ) {          val isDetailedFeatureDescriptionEnabled by toggle(           key = \"detailed_feature_a_description\",           description = \"show detailed description of feature A\",           defaultValue = true,           sourceSelectionStrategy = SourceSelectionStrategy.None       )      }<\/code><\/pre>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <code>Dagger DI<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c <code>FeatureAConfig<\/code> \u0432 \u043e\u0431\u0449\u0438\u0439 <code>Set&lt;FeatureConfig&gt;<\/code>.<\/p>\n<pre><code class=\"kotlin\">@InstallIn(SingletonComponent::class)   @Module   class FeatureAModule {          @Provides @IntoSet       fun provideFeatureConfig(config: FeatureAConfig): FeatureConfig = config      }<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>featureB<\/code>. \u0412 <code>app<\/code> \u043c\u043e\u0434\u0443\u043b\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 <code>Set&lt;FeatureConfig&gt;<\/code>.<\/p>\n<pre><code class=\"kotlin\">@InstallIn(SingletonComponent::class)   @Module   class AppModule {          @Singleton       @JvmSuppressWildcards         @Provides         fun provideKonfeature(configs: Set&lt;FeatureConfig&gt;): Konfeature {           return konfeature {               configs.forEach(::register)           }       }   }<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0438\u0437\u0431\u0435\u0436\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430 \u0432\u043d\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439.<\/p>\n<h3>2. FeatureSource<\/h3>\n<p><code>FeatureSource<\/code> \u2014 \u044d\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f Feature Flags, \u043e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 name, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 <code>SourceSelectionStrategy<\/code> \u0438 \u043e\u0442\u0434\u0430\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e <code>key<\/code>.<\/p>\n<pre><code class=\"kotlin\">public interface FeatureSource {      public val name: String      public fun get(key: String): Any? }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f <code>FirebaseRemoteConfig<\/code>.<\/p>\n<pre><code class=\"kotlin\">  class FirebaseFeatureSource(     private val remoteConfig: FirebaseRemoteConfig ) : FeatureSource {          override val name: String = \"FirebaseRemoteConfig\"      override fun get(key: String): Any? {         return remoteConfig             .getValue(key)             .takeIf { source == FirebaseRemoteConfig.VALUE_SOURCE_REMOTE }             ?.let { value: FirebaseRemoteConfigValue -&gt;                 value.getOrNull { asBoolean() }                     ?: value.getOrNull { asString() }                     ?: value.getOrNull { asLong() }                     ?: value.getOrNull { asDouble() }             }     }              private fun FirebaseRemoteConfigValue.getOrNull(         getter: FirebaseRemoteConfigValue.() -&gt; Any?     ): Any? {                 return try {             getter()             } catch (error: IllegalArgumentException) {             null         }             } }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b Feature Flags \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 <code>FirebaseFeatureSource<\/code>, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 Konfeature.<\/p>\n<pre><code class=\"kotlin\">val featureAConfig = FeatureAConfig() val source: FeatureSource = FirebaseFeatureSource(remoteConfig)  val konfeatureInstance = konfeature {     addSource(source)     register(featureAConfig)  }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 <code>FeatureAConfig<\/code>\u00a0\u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f <code>sourceSelectionStrategy<\/code> c <code>SourceSelectionStrategy.None<\/code> \u043d\u0430 <code>SourceSelectionStrategy.Any<\/code> \u0438\u043b\u0438 <code>SourceSelectionStrategy.anyOf(\"FirebaseRemoteConfig\")<\/code>\u2014 Feature Flag \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 <code>FirebaseRemoteConfig<\/code>.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <code>FeatureSource<\/code>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u2014 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e <code>FeatureSource<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0434\u043b\u044f Feature Flag \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>key<\/code>.<\/p>\n<h2>3. Interceptor<\/h2>\n<p><code>Intereceptor<\/code> \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Feature Flag, \u0435\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041a\u0430\u043a \u0438 <code>FeatureSource<\/code>, \u0438\u043c\u0435\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 <code>name<\/code>.<\/p>\n<pre><code class=\"kotlin\">public interface Interceptor {      public val name: String      public fun intercept(         valueSource: FeatureValueSource,          key: String,          value: Any     ): Any? }<\/code><\/pre>\n<p><code>FeatureValueSource<\/code> \u2014 \u044d\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f Feature Flag \u2014 <code>FeatureSource<\/code>, <code>Interceptor<\/code> \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"kotlin\">public sealed class FeatureValueSource {          public class Source(public val name: String) : FeatureValueSource()          public class Interceptor(public val name: String) : FeatureValueSource()          public object Default : FeatureValueSource()  }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 <code>intercept<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>null<\/code>, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Feature Flag \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <code>Interceptor<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>DebugPanelInterceptor<\/code>. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Debug Panel, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Feature Flags \u0432 Debug \u0441\u0431\u043e\u0440\u043a\u0430x.<\/p>\n<pre><code class=\"kotlin\">class DebugPanelInterceptor : Interceptor {      private val values = mutableMapOf&lt;String, Any&gt;()      override val name: String = \"DebugPanelInterceptor\"      override fun intercept(         valueSource: FeatureValueSource,          key: String,          value: Any ): Any? {         return values[key]     }      fun setFeatureValue(key: String, value: Any) {         values[key] = value     }      fun removeFeatureValue(key: String) {         values.remove(key)     } }<\/code><\/pre>\n<p>\u042d\u0442\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u043e\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 Konfeature.<\/p>\n<pre><code class=\"kotlin\">val featureAConfig = FeatureAConfig() val source: FeatureSource = FirebaseFeatureSource(remoteConfig) val debugPanelInterceptor: Interceptor = DebugPanelInterceptor()  val konfeatureInstance = konfeature {     addSource(source)     register(featureAConfig)      addInterceptor(debugPanelInterceptor) }<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <code>Interceptor<\/code>, \u043d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>FeatureSource<\/code>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u043f\u0440\u043e\u0441\u0438\u0442 <strong>\u0432\u0441\u0435<\/strong> <code>Interceptor<\/code> \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<h3>4. Spec<\/h3>\n<p>Konfeature \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0435\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Feature Flag.<\/p>\n<pre><code class=\"kotlin\">public interface Konfeature {          public val spec: List&lt;FeatureConfigSpec&gt;          public fun &lt;T : Any&gt; getValue(spec: FeatureValueSpec&lt;T&gt;): FeatureValue&lt;T&gt;   }<\/code><\/pre>\n<p><code>FeatureConfigSpec<\/code> \u0437\u0434\u0435\u0441\u044c \u2014 \u044d\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e <code>FeatureConfig<\/code>.<\/p>\n<pre><code class=\"kotlin\">public interface FeatureConfigSpec {    <\/code><\/pre>\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-460709","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/460709","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=460709"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/460709\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=460709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=460709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=460709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}