{"id":12672,"date":"2022-11-24T15:06:16","date_gmt":"2022-11-24T07:06:16","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=12672"},"modified":"2022-11-24T15:06:17","modified_gmt":"2022-11-24T07:06:17","slug":"%e5%b0%8f%e7%b1%b3%e5%bc%80%e5%8f%91%e5%b9%b3%e5%8f%b0%e6%9c%ba%e5%9e%8b%e4%bf%a1%e6%81%af%e8%8e%b7%e5%8f%96%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/12672\/","title":{"rendered":"\u5c0f\u7c73\u5f00\u53d1\u5e73\u53f0\u673a\u578b\u4fe1\u606f\u83b7\u53d6\u8bf4\u660e"},"content":{"rendered":"\n<p>\u5c0f\u7c73\u5f00\u53d1\u5e73\u53f0<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%9c%ba%e5%9e%8b%e4%bf%a1%e6%81%af\/\" title=\"\u673a\u578b\u4fe1\u606f\" target=\"_blank\">\u673a\u578b\u4fe1\u606f<\/a><\/span>\u83b7\u53d6\u8bf4\u660e<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"_0\">\u7b80\u4ecb<\/h2>\n\n\n\n<p><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e5%b0%8f%e7%b1%b3%e6%89%8b%e6%9c%ba%e6%9c%ba%e5%9e%8b\/\" title=\"\u5c0f\u7c73\u624b\u673a\u673a\u578b\" target=\"_blank\">\u5c0f\u7c73\u624b\u673a\u673a\u578b<\/a><\/span>\u4fe1\u606f\u6216\u6709\u76f8\u5173\u8c03\u6574\u66f4\u65b0\uff0c\u4e3a\u65b9\u4fbfApp\u5f00\u53d1\u8005\u51c6\u786e\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\uff0c\u73b0\u63d0\u4f9b\u4ee5\u4e0b\u4fe1\u606f\u4f9b\u5f00\u53d1\u8005\u4f7f\u7528\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"_1\">1\u3001<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%9c%ba%e5%9e%8b\/\" title=\"\u673a\u578b\" target=\"_blank\">\u673a\u578b<\/a><\/span>\u540d\u79f0<\/h2>\n\n\n\n<p>\u65b0\u589ero.product.marketname\u5c5e\u6027\uff0c\u503c\u4e3a<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%89%8b%e6%9c%ba%e8%ae%be%e5%a4%87%e5%90%8d\/\" title=\"\u624b\u673a\u8bbe\u5907\u540d\" target=\"_blank\">\u624b\u673a\u8bbe\u5907\u540d<\/a><\/span>\uff08\u4e0a\u5e02\u673a\u578b\u540d\u79f0\uff09\uff1b<\/p>\n\n\n\n<p>\u5386\u53f2\u5df2\u53d1\u5e03\u624b\u673a\u4e0a<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e8%ae%be%e5%a4%87%e5%9e%8b%e5%8f%b7\/\" title=\"\u8bbe\u5907\u578b\u53f7\" target=\"_blank\">\u8bbe\u5907\u578b\u53f7<\/a><\/span>\u7684\u5c5e\u6027ro.product.model\u4f9d\u7136\u6709\u6548\uff0c\u4ee5\u540e\u65b0\u53d1\u5e03\u7684\u673a\u578b\u4e0a\u4e0d\u518d\u751f\u6548\u3002\u8bf7\u5f00\u53d1\u8005\u53ca\u65f6\u9002\u914d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"_1_0\">\u63a5\u53e3\u8bf4\u660e\u4e0e\u793a\u4f8b<\/h3>\n\n\n\n<p>\u5efa\u8bae\u5e94\u7528\u4f18\u5148\u8bfb\u53d6\u5c5e\u6027ro.product.marketname\uff0c\u5982\u679c\u8fd4\u56de\u503c\u4e0d\u4e3a\u7a7a\uff0c\u8fd9\u4e2a\u503c\u5c31\u662f\u624b\u673a\u8bbe\u5907\u578b\u53f7\u3002\u5982\u679c\u6b64\u5c5e\u6027\u8fd4\u56de\u503c\u4e3a\u7a7a\uff0c\u5219\u8bfb\u53d6\u4e4b\u524d\u7684\u5c5e\u6027ro.product.model\u503c\u3002<\/p>\n\n\n\n<p>\u53c2\u8003\u4ee3\u7801:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>public<\/strong> <strong>static<\/strong> String <strong>getDeviceName<\/strong>() {\n    String deviceName = \"\";\n    <strong>try<\/strong> {\n        Class SystemProperties = Class.forName(\"android.os.SystemProperties\");\n        Method get = SystemProperties.getDeclaredMethod(\"get\", String.class, String.class);\n        deviceName = (String) get.invoke(SystemProperties, \"ro.product.marketname\", \"\");\n        <strong>if<\/strong> (TextUtils.isEmpty(deviceName)) {\n            deviceName = (String) get.invoke(SystemProperties, \"ro.product.model\", \"\");\n        }\n    } <strong>catch<\/strong> (InvocationTargetException | NoSuchMethodException | IllegalAccessException | ClassNotFoundException e) {\n        e.printStackTrace();\n    }\n    <strong>return<\/strong> deviceName;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"_2\">2\u3001CPU \u578b\u53f7\u4fe1\u606f<\/h2>\n\n\n\n<p>GKI 2.0 \u4e4b\u524d\uff0c\/proc\/cpuinfo \u4e2d\u5305\u542b Hardware \u76f8\u5173\u4fe1\u606f\uff0c\u5e94\u7528\u53ef\u4ee5\u4ece\u4e2d\u8bfb\u53d6 cpu \u578b\u53f7\u4fe1\u606f\uff1b<\/p>\n\n\n\n<p>GKI 2.0 \u4e4b\u540e\uff0c\/proc\/cpuinfo \u4e2d\u4e0d\u518d\u5305\u542b Hardware \u76f8\u5173\u4fe1\u606f\uff0c\u5e94\u7528\u65e0\u6cd5\u4ece\u4e2d\u8bfb\u53d6\u5230 cpu \u578b\u53f7\u4fe1\u606f\uff0c\u9700\u8981\u4ece android.os.SystemProperties \u4e2d\u8bfb\u53d6 ro.soc.model \u5c5e\u6027\u4fe1\u606f\u3002\u53c2\u8003\u8bf4\u660e\uff1a<a href=\"https:\/\/source.android.com\/devices\/architecture\/kernel\/generic-kernel-image?hl=zh-cn\" target=\"_blank\" rel=\"noreferrer noopener\"><u>\u5173\u4e8e GKI \u5185\u6838\u7248\u672c\u8bf4\u660e<\/u><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"_2_0\">CPU \u578b\u53f7\u83b7\u53d6\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u5efa\u8bae\u4f18\u5148\u4ece android.os.SystemProperties \u4e2d\u8bfb\u53d6 ro.soc.model \u5c5e\u6027\u4fe1\u606f\uff0c\u82e5\u6b64\u5c5e\u6027\u4fe1\u606f\u4e3a\u7a7a\uff0c\u5219\u518d\u4ece \/proc\/cpuinfo \u4e2d\u8bfb\u53d6 Hardware \u4fe1\u606f\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u7c73\u624b\u673a\u673a\u578b\u4fe1\u606f\u6216\u6709\u76f8\u5173\u8c03\u6574\u66f4\u65b0\uff0c\u4e3a\u65b9\u4fbfApp\u5f00\u53d1\u8005\u51c6\u786e\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\uff0c\u73b0\u63d0\u4f9b\u4ee5\u4e0b\u4fe1\u606f\u4f9b\u5f00\u53d1\u8005\u4f7f\u7528\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,94,160],"tags":[5703,5902,5903,5906,5904,5905,5907],"special":[67],"attr":[],"class_list":["post-12672","post","type-post","status-publish","format-standard","hentry","category-appsj","category-appjc","category-appcs","tag-5703","tag-5902","tag-5903","tag-5906","tag-5904","tag-5905","tag-5907","special-xiaomikfpt","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/12672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=12672"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/12672\/revisions"}],"predecessor-version":[{"id":12673,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/12672\/revisions\/12673"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=12672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=12672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=12672"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=12672"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=12672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}