{"id":893,"date":"2020-08-25T00:22:40","date_gmt":"2020-08-24T20:52:40","guid":{"rendered":"http:\/\/amkia.ir\/blog\/?p=893"},"modified":"2021-08-27T17:56:48","modified_gmt":"2021-08-27T13:26:48","slug":"%d8%a7%d8%b5%d9%84%d8%a7%d8%ad-%d8%ae%d8%b7%d8%a7-%d8%b9%d8%af%d9%85-%d8%a7%d8%b1%d8%aa%d8%a8%d8%a7%d8%b7-%d8%a8%d8%a7-%d8%b3%d8%b1%d9%88%d8%b1-cleartext-traffic","status":"publish","type":"post","link":"http:\/\/amkia.ir\/blog\/?p=893","title":{"rendered":"\u06f1\u06f1\u06f0- \u0627\u0635\u0644\u0627\u062d \u062e\u0637\u0627 \u0639\u062f\u0645 \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627 \u0633\u0631\u0648\u0631 (cleartext traffic)"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">com.androidnetworking.error.ANError: com.androidnetworking.error.ANError: java.net.UnknownServiceException: CLEARTEXT communication to amkia.ir not permitted by network security policy<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u062f\u0631 \u0627\u0646\u062f\u0631\u0648\u06cc\u062f \u06f8 \u0628\u0647 \u0628\u0639\u062f \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633 \u0647\u0627\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f (\u062c\u0627\u0648\u0627) \u0645\u0634\u06a9\u0644\u06cc \u062f\u0627\u0631\u0646\u062f \u0628\u0627 \u0639\u062f\u0645 \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627 \u0633\u0631\u0648\u0631 \u06a9\u0647 \u0628\u0627 \u06af\u0630\u0631\u0627\u0646\u062f\u0646 \u0645\u0631\u0627\u062d\u0644 \u0632\u06cc\u0631 \u0627\u06cc\u0646 \u0645\u0634\u06a9\u0644 \u062d\u0644 \u062e\u0648\u0627\u0647\u062f \u0634\u062f:<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u0627\u0628\u062a\u062f\u0627 \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u0627\u0634\u062a\u0628\u0627\u0647 \u0631\u0627\u06cc\u062c &#8220;https:\/\/&#8221; \u0628\u0647 \u062c\u0627\u06cc &#8220;http:\/\/&#8221; \u0648 \u06cc\u0627 \u0628\u0627\u0644\u0639\u06a9\u0633 \u0631\u0648 \u0646\u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u0633\u067e\u0633 \u06cc\u06a9 Android Resource File \u0628\u0627 \u0646\u0627\u0645 network_security_config \u062f\u0631 \u067e\u0648\u0634\u0647 xml (\u0627\u06af\u0631 \u0627\u06cc\u0646 \u067e\u0648\u0634\u0647 \u0645\u0648\u062c\u0648\u062f \u0646\u06cc\u0633\u062a \u062f\u0631 Res \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc \u06a9\u0646\u06cc\u0645) \u0645\u06cc \u0633\u0627\u0632\u06cc\u0645 \u0648 \u06a9\u062f\u0647\u0627\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u0645\u06cc \u06a9\u0646\u06cc\u0645:<\/p>\r\n<pre class=\"lang:java decode:true \">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;network-security-config&gt;\r\n    &lt;domain-config cleartextTrafficPermitted=\"true\"&gt;\r\n        &lt;domain includeSubdomains=\"true\"&gt;api.example.com(\u062f\u0627\u0645\u06cc\u0646 \u0645\u0648\u0631\u062f \u0646\u0638\u0631)\r\n&lt;\/domain&gt;\r\n    &lt;\/domain-config&gt;\r\n&lt;\/network-security-config&gt;<\/pre>\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u062f\u0631 \u0641\u0627\u06cc\u0644 AndroidManifest \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u0645\u06cc \u06a9\u0646\u06cc\u0645:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:java decode:true \">&lt;uses-permission android:name=\"android.permission.INTERNET\"\/&gt;<\/pre>\r\n<pre class=\"lang:java decode:true \">    &lt;application\r\n...\r\n        android:usesCleartextTraffic=\"true\"\r\n        android:networkSecurityConfig=\"@xml\/network_security_config\"&gt;\r\n\r\n    &lt;\/application&gt;<\/pre>\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n\r\n<div id=\"themify_builder_content-893\" data-postid=\"893\" class=\"themify_builder_content themify_builder_content-893 themify_builder\">\n\n    <\/div>\n<!-- \/themify_builder_content -->","protected":false},"excerpt":{"rendered":"<p>com.androidnetworking.error.ANError: com.androidnetworking.error.ANError: java.net.UnknownServiceException: CLEARTEXT communication to amkia.ir not permitted by network security policy \u062f\u0631 \u0627\u0646\u062f\u0631\u0648\u06cc\u062f \u06f8 \u0628\u0647 \u0628\u0639\u062f \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633 \u0647\u0627\u06cc \u0627\u0646\u062f\u0631\u0648\u06cc\u062f (\u062c\u0627\u0648\u0627) \u0645\u0634\u06a9\u0644\u06cc \u062f\u0627\u0631\u0646\u062f \u0628\u0627 \u0639\u062f\u0645 \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627 \u0633\u0631\u0648\u0631 \u06a9\u0647 \u0628\u0627 \u06af\u0630\u0631\u0627\u0646\u062f\u0646 \u0645\u0631\u0627\u062d\u0644 \u0632\u06cc\u0631 \u0627\u06cc\u0646 \u0645\u0634\u06a9\u0644 \u062d\u0644 \u062e\u0648\u0627\u0647\u062f \u0634\u062f: \u0627\u0628\u062a\u062f\u0627 \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u0627\u0634\u062a\u0628\u0627\u0647 \u0631\u0627\u06cc\u062c &#8220;https:\/\/&#8221; \u0628\u0647 \u062c\u0627\u06cc &#8220;http:\/\/&#8221; \u0648 \u06cc\u0627 \u0628\u0627\u0644\u0639\u06a9\u0633 \u0631\u0648 \u0646\u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":897,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[191],"tags":[193,194,192],"class_list":["post-893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-191","tag-cleartext","tag-cleartext-traffic","tag-network-security-policy","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=893"}],"version-history":[{"count":11,"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=\/wp\/v2\/posts\/893\/revisions"}],"predecessor-version":[{"id":979,"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=\/wp\/v2\/posts\/893\/revisions\/979"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=\/wp\/v2\/media\/897"}],"wp:attachment":[{"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/amkia.ir\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}