{"id":1902,"date":"2023-04-28T11:58:54","date_gmt":"2023-04-28T03:58:54","guid":{"rendered":"https:\/\/badgameshow.com\/fly\/?p=1902"},"modified":"2023-05-02T15:46:15","modified_gmt":"2023-05-02T07:46:15","slug":"%e3%80%90android%e3%80%91accessibility-%e5%88%a9%e7%94%a8%e7%84%a1%e9%9a%9c%e7%a4%99-%e8%87%aa%e5%8b%95%e5%8c%96%e6%8e%a7%e5%88%b6app-%e7%af%84%e4%be%8b","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/fly\/%e3%80%90android%e3%80%91accessibility-%e5%88%a9%e7%94%a8%e7%84%a1%e9%9a%9c%e7%a4%99-%e8%87%aa%e5%8b%95%e5%8c%96%e6%8e%a7%e5%88%b6app-%e7%af%84%e4%be%8b\/","title":{"rendered":"\u3010Android\u3011Accessibility \u5229\u7528\u7121\u969c\u7919 \u81ea\u52d5\u5316\u63a7\u5236APP \u9ea5\u7576\u52de\u7c3d\u5230\u7bc4\u4f8b"},"content":{"rendered":"<h1>\u3010Android\u3011Accessibility \u5229\u7528\u7121\u969c\u7919 \u81ea\u52d5\u5316\u63a7\u5236APP \u9ea5\u7576\u52de\u7c3d\u5230\u7bc4\u4f8b<\/h1>\n<h4>Android Accessibility \u662f\u4e00\u9805\u63d0\u9ad8 Android \u88dd\u7f6e\u7684\u53ef\u8a2a\u554f\u6027\u7684\u529f\u80fd\u3002\u5b83\u8b93\u8996\u529b\u3001\u807d\u529b\u3001\u884c\u52d5\u6216\u8a8d\u77e5\u4e0a\u6709\u969c\u7919\u7684\u4eba\u5011\u66f4\u5bb9\u6613\u5730\u4f7f\u7528 Android \u8a2d\u5099\u3002<\/h4>\n<h4>\u7121\u969c\u7919\u529f\u80fd\u5305\u62ec\u8a9e\u97f3\u6307\u5c0e\u3001\u87a2\u5e55\u653e\u5927\u3001\u7121\u969c\u7919\u6a21\u5f0f\u548c\u7121\u969c\u7919\u9375\u76e4\u7b49\uff0c\u9019\u4e9b\u6280\u8853\u53ef\u4ee5\u5e6b\u52a9\u4f7f\u7528\u8005\u7372\u5f97\u66f4\u597d\u7684\u8a2a\u554f\u6027\u3002\u4f7f\u7528\u9019\u4e9b\u529f\u80fd\uff0c\u4f7f\u7528\u8005\u53ef\u4ee5\u66f4\u8f15\u9b06\u5730\u4f7f\u7528 Android \u8a2d\u5099\uff0c\u4f7f\u4ed6\u5011\u66f4\u7368\u7acb\u3001\u66f4\u81ea\u4fe1\u5730\u53c3\u8207\u65e5\u5e38\u6d3b\u52d5\u3002<\/h4>\n<hr \/>\n<h4>\u6587\u7ae0\u76ee\u9304<\/h4>\n<ol>\n<li><a href=\"#a\">\u5275\u5efa AccessibilityService<\/a><\/li>\n<li><a href=\"#b\">Manifest \u8a3b\u518a Service<\/a><\/li>\n<li><a href=\"#c\">\u5224\u65b7\u662f\u5426\u958b\u555f\u7121\u969c\u7919<\/a><\/li>\n<li><a href=\"#d\">\u5275\u5efa BoradcastReceiver \u76e3\u807d \u7121\u969c\u7919\u7684\u4e8b\u4ef6<\/a><\/li>\n<li><a href=\"#e\">\u5275\u5efa ViewModel \u6539\u8b8a\u6578\u64da<\/a><\/li>\n<li><a href=\"#f\">\u4f7f\u7528 uiautomatorviewer \u53d6\u5f97\u5143\u4ef6 ID<\/a><\/li>\n<li><a href=\"#g\">\u5143\u4ef6\u4ea4\u4e92<\/a><\/li>\n<li><a href=\"#h\">\u64b0\u5beb\u81ea\u52d5\u5316\u908f\u8f2f<\/a><\/li>\n<li><a href=\"#i\">AccessibilityDemo Github<\/a><\/li>\n<\/ol>\n<hr \/>\n<p><a id=\"a\"><\/a><\/p>\n<h4>1.\u5275\u5efa AccessibilityService<\/h4>\n<h5>MyAccessibilityService.kt<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">class MyAccessibilityService : AccessibilityService() {\n\n    \/\/\u81ea\u52d5\u5316\u6d41\u7a0b\n    override fun onAccessibilityEvent(event: AccessibilityEvent) {\n\n    }\n\n    \/\/ \u958b\u555f\u7121\u969c\u7919\n    override fun onServiceConnected() {\n        super.onServiceConnected()\n    }\n\n    \/\/ \u4e2d\u65b7\u7121\u969c\u7919\n    override fun onInterrupt() {\n\n    }\n\n    \/\/ \u95dc\u9589\u7121\u969c\u7919\n    override fun onUnbind(intent: Intent?): Boolean {\n        return super.onUnbind(intent)\n    }\n\n}\n<\/code><\/pre>\n<p><a id=\"b\"><\/a><\/p>\n<h4>2.Manifest \u8a3b\u518a Service<\/h4>\n<h5>AndroidManifest.xml<\/h5>\n<pre data-language=XML><code class=\"language-markup line-numbers\">&lt;service\n    android:name=\".service.MyAccessibilityService\"\n    android:exported=\"true\"\n    android:label=\"@string\/app_name\"\n    android:permission=\"android.permission.BIND_ACCESSIBILITY_SERVICE\"&gt;\n\n    &lt;intent-filter&gt;\n        &lt;action android:name=\"android.accessibilityservice.AccessibilityService\" \/&gt;\n    &lt;\/intent-filter&gt;\n\n    &lt;meta-data\n        android:name=\"android.accessibilityservice\"\n        android:resource=\"@xml\/accessibilityservice\" \/&gt;\n&lt;\/service&gt;\n<\/code><\/pre>\n<h5>accessibilityservice.xml<\/h5>\n<pre data-language=XML><code class=\"language-markup line-numbers\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;accessibility-service xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:accessibilityEventTypes=\"typeAllMask\"\n    android:accessibilityFeedbackType=\"feedbackGeneric\"\n    android:accessibilityFlags=\"flagDefault\"\n    android:canRetrieveWindowContent=\"true\"\n    android:notificationTimeout=\"100\" \/&gt;\n<\/code><\/pre>\n<p><a id=\"c\"><\/a><\/p>\n<h4>3.\u5224\u65b7\u662f\u5426\u958b\u555f\u7121\u969c\u7919<\/h4>\n<h5>MainActivity.kt<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">class MainActivity : AppCompatActivity() {\n\n    private lateinit var binding: ActivityMainBinding\n    private val accessibilityPage = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {}\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        binding = ActivityMainBinding.inflate(layoutInflater)\n        setContentView(binding.root)\n\n        binding.fab.setOnClickListener {\n            if (!isAccessibilityEnabled()) {\n                val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)\n                intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK\n                accessibilityPage.launch(intent)\n            }\n        }\n    }\n\n    private fun isAccessibilityEnabled(): Boolean {\n        val am = getSystemService(ACCESSIBILITY_SERVICE) as AccessibilityManager\n        return am.isEnabled\n    }\n\n}\n<\/code><\/pre>\n<h5>activity_main.xml<\/h5>\n<pre data-language=XML><code class=\"language-markup line-numbers\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".MainActivity\"&gt;\n\n    &lt;androidx.appcompat.widget.AppCompatTextView\n        android:id=\"@+id\/accessibleTitle\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginStart=\"12dp\"\n        android:layout_marginTop=\"12dp\"\n        android:text=\"\u7121\u969c\u7919\u72c0\u614b:\"\n        android:textColor=\"@color\/black\"\n        android:textSize=\"24sp\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" \/&gt;\n\n    &lt;androidx.appcompat.widget.AppCompatTextView\n        android:id=\"@+id\/accessibleStatus\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"\u95dc\u9589\"\n        android:textSize=\"24sp\"\n        app:layout_constraintBottom_toBottomOf=\"@+id\/accessibleTitle\"\n        app:layout_constraintStart_toEndOf=\"@+id\/accessibleTitle\"\n        app:layout_constraintTop_toTopOf=\"@+id\/accessibleTitle\" \/&gt;\n\n\n    &lt;com.google.android.material.floatingactionbutton.FloatingActionButton\n        android:layout_margin=\"12dp\"\n        android:id=\"@+id\/fab\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"bottom|end\"\n        app:layout_constraintBottom_toBottomOf=\"parent\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:srcCompat=\"@android:drawable\/ic_dialog_email\"\n        tools:ignore=\"ContentDescription\" \/&gt;\n\n&lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;\n<\/code><\/pre>\n<p><a id=\"d\"><\/a><\/p>\n<h4>4.\u5275\u5efa BoradcastReceiver \u76e3\u807d \u7121\u969c\u7919\u7684\u4e8b\u4ef6<\/h4>\n<h5>MainActivity,kt<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">class MainActivity : AppCompatActivity() {\n\n    private lateinit var binding: ActivityMainBinding\n    private val mainViewModel by viewModels&lt;MainViewModel&gt;()\n    private val accessibilityPage = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {}\n\n    \/\/ \u76e3\u807d\u7121\u969c\u7919\n    private val accessibleReceiver = object : BroadcastReceiver() {\n        override fun onReceive(context: Context, intent: Intent) {\n            if (intent.action.equals(Common.ACCESSIBLE_RECEIVER_ACTION)) {\n                mainViewModel.accessibleStatus.value =\n                    intent.getStringExtra(Common.ACCESSIBLE_STATUS)\n            }\n        }\n    }\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        binding = ActivityMainBinding.inflate(layoutInflater)\n        setContentView(binding.root)\n\n        registerReceiver(accessibleReceiver, IntentFilter(Common.ACCESSIBLE_RECEIVER_ACTION))\n\n        mainViewModel.accessibleStatus.observe(this) {\n            binding.accessibleStatus.text = it\n        }\n\n        binding.fab.setOnClickListener {\n            if (!isAccessibilityEnabled()) {\n                val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)\n                intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK\n                accessibilityPage.launch(intent)\n            } else {\n                Intent(Common.AUTO_SERVICE_PACKAGE).apply {\n                    putExtra(Common.APP_NAME, \"\u9ea5\u7576\u52de\")\n                    sendBroadcast(this)\n                }\n            }\n        }\n    }\n\n    private fun isAccessibilityEnabled(): Boolean {\n        val am = getSystemService(ACCESSIBILITY_SERVICE) as AccessibilityManager\n        return am.isEnabled\n    }\n\n    override fun onDestroy() {\n        super.onDestroy()\n        unregisterReceiver(accessibleReceiver)\n    }\n\n}\n<\/code><\/pre>\n<h5>MyAccessibilityService.kt<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">class MyAccessibilityService : AccessibilityService() {\n\n    private val serviceReceiver = object : BroadcastReceiver() {\n        override fun onReceive(context: Context, intent: Intent) {\n            if (intent.action.equals(Common.AUTO_SERVICE_PACKAGE)) {\n                performGlobalAction(GLOBAL_ACTION_HOME)\n\n                Thread.sleep(1500)\n\n                rootInActiveWindow?.findAccessibilityNodeInfosByText(intent.getStringExtra(Common.APP_NAME))\n                    ?.apply {\n                        if (size &gt; 0) {\n                            get(0).click()\n                        }\n                    }\n            }\n        }\n    }\n\n    override fun onAccessibilityEvent(event: AccessibilityEvent) {\n\n    }\n\n    override fun onServiceConnected() {\n        super.onServiceConnected()\n        registerReceiver(serviceReceiver, IntentFilter(Common.AUTO_SERVICE_PACKAGE))\n        Intent(Common.ACCESSIBLE_RECEIVER_ACTION).apply {\n            putExtra(Common.ACCESSIBLE_STATUS, \"\u958b\u555f\")\n            sendBroadcast(this)\n        }\n    }\n\n    override fun onInterrupt() {\n        Intent(Common.ACCESSIBLE_RECEIVER_ACTION).apply {\n            putExtra(Common.ACCESSIBLE_STATUS, \"\u4e2d\u65b7\")\n            sendBroadcast(this)\n        }\n    }\n\n    override fun onUnbind(intent: Intent?): Boolean {\n        unregisterReceiver(serviceReceiver)\n        Intent(Common.ACCESSIBLE_RECEIVER_ACTION).apply {\n            putExtra(Common.ACCESSIBLE_STATUS, \"\u95dc\u9589\")\n            sendBroadcast(this)\n        }\n        return super.onUnbind(intent)\n    }\n\n}\n<\/code><\/pre>\n<p><a id=\"e\"><\/a><\/p>\n<h4>5.\u5275\u5efa ViewModel \u6539\u8b8a\u6578\u64da<\/h4>\n<h5>MainViewModel.kt<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">class MainViewModel : ViewModel() {\n    val accessibleStatus = MutableLiveData&lt;String&gt;()\n}\n<\/code><\/pre>\n<h5>build.gradle<\/h5>\n<pre><code class=\"language-gradle line-numbers\">dependencies {\n    def fragment_version = \"1.5.7\"\n    implementation \"androidx.fragment:fragment-ktx:$fragment_version\"\n}\n<\/code><\/pre>\n<p><a id=\"f\"><\/a><\/p>\n<h4>6.\u4f7f\u7528 uiautomatorviewer \u53d6\u5f97\u5143\u4ef6 ID<\/h4>\n<h5>uiautomatorviewer (AppData\\Local\\Android\\Sdk\\tools\\bin)<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_f16c129a30366d92963d36cf2f21434b.jpg\" width=\"90%\" \/><\/p>\n<h5>\u624b\u6a5f\u865f\u78bc ID (tw.com.mcddaily:id\/etPhone)<\/h5>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_a5d5eba1e1658e438c20227e0697e8e1.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_a5d5eba1e1658e438c20227e0697e8e1.jpg\" alt=\"\" \/><\/a><\/p>\n<h5>\u767b\u5165\u6309\u9215 ID (com.android.camera:id\/btnNext)<\/h5>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_c0be143d427cbda0f46e87505c2ca67f.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_c0be143d427cbda0f46e87505c2ca67f.jpg\" alt=\"\" \/><\/a><\/p>\n<h5>\u5bc6\u78bc ID (com.android.camera:id\/etPwd)<\/h5>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_b42e2a252a978b4e62802b4507d0b524.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_b42e2a252a978b4e62802b4507d0b524.jpg\" alt=\"\" \/><\/a><\/p>\n<h5>\u9996\u9801\u6587\u5b57 (\u5929\u5929\u4f86\u7c3d\u5230)<\/h5>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_1c9e79c1bad48ca9b2ec571ff2419f06.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2023\/05\/wp_editor_md_1c9e79c1bad48ca9b2ec571ff2419f06.jpg\" alt=\"\" \/><\/a><br \/>\n<a id=\"g\"><\/a><\/p>\n<h4>7.\u5143\u4ef6\u4ea4\u4e92<\/h4>\n<h5>\u53d6\u5f97\u4ecb\u9762\u5143\u4ef6\u7684\u5169\u7a2e\u65b9\u5f0f<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">event.source?.findAccessibilityNodeInfosByViewId\nrootInActiveWindow?.findAccessibilityNodeInfosByViewId\n<\/code><\/pre>\n<h5>AccessibilityExtension.kt<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">\/\/ \u9ede\u64ca\nfun AccessibilityNodeInfo.click() = performAction(AccessibilityNodeInfo.ACTION_CLICK)\n\n\/\/ \u9577\u6309\nfun AccessibilityNodeInfo.longClick() =\n    performAction(AccessibilityNodeInfo.ACTION_LONG_CLICK)\n\n\/\/ \u5411\u4e0b\u6ed1\u52d5\u4e00\u4e0b\nfun AccessibilityNodeInfo.scrollForward() =\n    performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD)\n\n\/\/ \u5411\u4e0a\u6ed1\u52d5\u4e00\u4e0b\nfun AccessibilityNodeInfo.scrollBackward() =\n    performAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD)\n\n\/\/ \u586b\u5145\u6587\u5b57\nfun AccessibilityNodeInfo.input(content: String) = performAction(\n    AccessibilityNodeInfo.ACTION_SET_TEXT, Bundle().apply {\n        putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, content)\n    }\n)\n<\/code><\/pre>\n<h5>\u5168\u5c40<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">\/\/ \u8fd4\u56de\u952e\nperformGlobalAction(GLOBAL_ACTION_BACK)\n\n\/\/ Home\u952e\nperformGlobalAction(GLOBAL_ACTION_HOME)\n\n\/\/ \u622a\u5716\nperformGlobalAction(GLOBAL_ACTION_TAKE_SCREENSHOT)\n\n\/\/ \u6700\u8fd1\u4e8b\u4ef6\nperformGlobalAction(GLOBAL_ACTION_RECENTS)\n\n\/\/ \u901a\u77e5\u6b04\nperformGlobalAction(GLOBAL_ACTION_NOTIFICATIONS)\n\n\/\/ \u9396\u87a2\u5e55\nperformGlobalAction(GLOBAL_ACTION_LOCK_SCREEN)\n\n\/\/ \u9577\u6309\u96fb\u6e90\u9375\nperformGlobalAction(GLOBAL_ACTION_POWER_DIALOG)\n<\/code><\/pre>\n<p><a id=\"h\"><\/a><\/p>\n<h4>8.\u64b0\u5beb\u81ea\u52d5\u5316\u908f\u8f2f<\/h4>\n<h5>MyAccessibilityService.kt<\/h5>\n<pre><code class=\"language-kotlin line-numbers\">class MyAccessibilityService : AccessibilityService() {\n\n    private var autoTransferStatus = true\n    private var login = false\n\n    private val serviceReceiver = object : BroadcastReceiver() {\n        override fun onReceive(context: Context, intent: Intent) {\n            if (intent.action.equals(Common.AUTO_SERVICE_PACKAGE)) {\n                performGlobalAction(GLOBAL_ACTION_HOME)\n\n                Thread.sleep(1500)\n\n                rootInActiveWindow?.findAccessibilityNodeInfosByText(intent.getStringExtra(Common.APP_NAME))\n                    ?.apply {\n                        if (size &gt; 0) {\n                            get(0).click()\n                        }\n                    }\n            }\n        }\n    }\n\n    override fun onAccessibilityEvent(event: AccessibilityEvent) {\n        if (event.packageName == Common.PACKAGE_NAME &amp;&amp; event.eventType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED &amp;&amp; autoTransferStatus) {\n            if(!login) {\n                Thread.sleep(250)\n                rootInActiveWindow?.findAccessibilityNodeInfosByViewId(\"<span class=\"katex math inline\">{event.packageName}:id\/etPhone\")\n                    ?.apply {\n                        if (size>0) {\n                            get(0).input(\"0912345678\")\n                        }\n                    }\n\n                Thread.sleep(250)\n                rootInActiveWindow?.findAccessibilityNodeInfosByViewId(\"<\/span>{event.packageName}:id\/btnNext\")\n                    ?.apply {\n                        if (size &gt; 0) {\n                            get(0).click()\n                        }\n                    }\n\n                Thread.sleep(250)\n                rootInActiveWindow?.findAccessibilityNodeInfosByViewId(\"<span class=\"katex math inline\">{event.packageName}:id\/etPwd\")\n                    ?.apply {\n                        if (size>0) {\n                            get(0).input(\"a123456\")\n                        }\n                    }\n\n                Thread.sleep(250)\n                rootInActiveWindow?.findAccessibilityNodeInfosByViewId(\"<\/span>{event.packageName}:id\/btnNext\")\n                    ?.apply {\n                        if (size &gt; 0) {\n                            get(0).click()\n                        }\n                    }\n            }\n\n            Thread.sleep(250)\n            rootInActiveWindow?.findAccessibilityNodeInfosByText(\"\u5929\u5929\u4f86\u7c3d\u5230\")?.apply {\n                if (size &gt; 0) {\n                    login = true\n                    autoTransferStatus = false\n                }\n            }\n        }\n    }\n\n    override fun onServiceConnected() {\n        super.onServiceConnected()\n        registerReceiver(serviceReceiver, IntentFilter(Common.AUTO_SERVICE_PACKAGE))\n        Intent(Common.ACCESSIBLE_RECEIVER_ACTION).apply {\n            putExtra(Common.ACCESSIBLE_STATUS, \"\u958b\u555f\")\n            sendBroadcast(this)\n        }\n    }\n\n    override fun onInterrupt() {\n        Intent(Common.ACCESSIBLE_RECEIVER_ACTION).apply {\n            putExtra(Common.ACCESSIBLE_STATUS, \"\u4e2d\u65b7\")\n            sendBroadcast(this)\n        }\n    }\n\n    override fun onUnbind(intent: Intent?): Boolean {\n        unregisterReceiver(serviceReceiver)\n        Intent(Common.ACCESSIBLE_RECEIVER_ACTION).apply {\n            putExtra(Common.ACCESSIBLE_STATUS, \"\u95dc\u9589\")\n            sendBroadcast(this)\n        }\n        return super.onUnbind(intent)\n    }\n\n}\n<\/code><\/pre>\n<p><a id=\"i\"><\/a><\/p>\n<h4>9.AccessibilityDemo Github<\/h4>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/MuHongWeiWei\/AccessibilityDemo\" title=\"AccessibilityDemo Github\" target=\"_blank\" rel=\"noopener\">AccessibilityDemo Github<\/a><\/p>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u3010Android\u3011Accessibility \u5229\u7528\u7121\u969c\u7919 \u81ea\u52d5\u5316\u63a7\u5236APP \u9ea5\u7576\u52de\u7c3d\u5230\u7bc4\u4f8b Android A &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[5],"tags":[241,13,240],"class_list":["post-1902","post","type-post","status-publish","format-standard","hentry","category-android","tag-accessibility","tag-android","tag-240"],"_links":{"self":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/comments?post=1902"}],"version-history":[{"count":8,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":1912,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/1902\/revisions\/1912"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/categories?post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}