ksaa 2025.6.23.0__py3-none-any.whl → 2025.7.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kotonebot/backend/context/context.py +0 -2
- kotonebot/client/__init__.py +1 -2
- kotonebot/client/device.py +155 -4
- kotonebot/client/host/adb_common.py +94 -0
- kotonebot/client/host/custom.py +27 -21
- kotonebot/client/host/leidian_host.py +14 -23
- kotonebot/client/host/mumu12_host.py +70 -24
- kotonebot/client/host/protocol.py +4 -1
- kotonebot/client/host/windows_common.py +55 -0
- kotonebot/client/implements/__init__.py +2 -1
- kotonebot/client/implements/adb.py +1 -44
- kotonebot/client/implements/adb_raw.py +2 -9
- kotonebot/client/implements/nemu_ipc/__init__.py +8 -0
- kotonebot/client/implements/nemu_ipc/external_renderer_ipc.py +280 -0
- kotonebot/client/implements/nemu_ipc/nemu_ipc.py +327 -0
- kotonebot/client/implements/remote_windows.py +8 -14
- kotonebot/client/implements/uiautomator2.py +5 -16
- kotonebot/client/implements/windows.py +5 -36
- kotonebot/client/registration.py +2 -67
- kotonebot/config/base_config.py +4 -2
- kotonebot/debug_entry.py +4 -2
- kotonebot/errors.py +7 -0
- kotonebot/kaa/common.py +18 -0
- kotonebot/kaa/main/dmm_host.py +13 -32
- kotonebot/kaa/main/gr.py +373 -33
- kotonebot/kaa/main/kaa.py +30 -3
- kotonebot/kaa/metadata.py +42 -0
- kotonebot/kaa/resources/__pycache__/__init__.cpython-310.pyc +0 -0
- kotonebot/kaa/resources/game.db +0 -0
- kotonebot/kaa/resources/game_ver.txt +0 -0
- kotonebot/kaa/resources/idol_cards/i_card-skin-hmsz-3-005_0.png +0 -0
- kotonebot/kaa/resources/idol_cards/i_card-skin-hmsz-3-005_1.png +0 -0
- kotonebot/kaa/tasks/R.py +132 -132
- {ksaa-2025.6.23.0.dist-info → ksaa-2025.7.3.0.dist-info}/METADATA +4 -1
- {ksaa-2025.6.23.0.dist-info → ksaa-2025.7.3.0.dist-info}/RECORD +172 -165
- /kotonebot/kaa/sprites/{c5ea3dfd-6761-466e-b44c-86592ef05323.png → 01ce8957-465d-4278-b297-f58b36c73285.png} +0 -0
- /kotonebot/kaa/sprites/{84bb4986-0295-4a45-9486-86e31fcdf1f1.png → 02048c24-3002-4122-b24b-15a2c2fb502f.png} +0 -0
- /kotonebot/kaa/sprites/{b01c25d2-21bf-4db9-b5b2-ec35817f1b04.png → 02de663b-a039-4530-b10b-fd5aea9f600e.png} +0 -0
- /kotonebot/kaa/sprites/{e1e0d751-9006-4fa4-a933-4c0dc5e1f3d2.png → 047454d6-9cbb-432d-b670-bde2d5f5fc9a.png} +0 -0
- /kotonebot/kaa/sprites/{920a3974-4875-4d2b-bbac-caa175c03ce0.png → 081ca89e-0f95-45e5-a855-5b7e49295af5.png} +0 -0
- /kotonebot/kaa/sprites/{0235ae3d-1741-4a81-8053-f60bc395ee85.png → 0a0dfcba-7ae4-415a-9361-7f3c4ec16ef9.png} +0 -0
- /kotonebot/kaa/sprites/{9c7f1bcc-0bc8-454b-95fb-56a803030771.png → 0a586241-e005-45a6-b12f-eed8089d8fd8.png} +0 -0
- /kotonebot/kaa/sprites/{5152e3fa-079c-4592-8df7-656101694df8.png → 0ad61c60-5458-400d-9788-437edb32608a.png} +0 -0
- /kotonebot/kaa/sprites/{f611bbd9-c062-4989-96a4-65ff6c59673c.png → 0b452661-3720-4fa3-9e52-6fdc69517396.png} +0 -0
- /kotonebot/kaa/sprites/{bed9575d-ccad-4f4e-825e-47b2a9cb0925.png → 0db398fd-3551-4a15-b734-ca5a7b54150f.png} +0 -0
- /kotonebot/kaa/sprites/{0d4b669e-5e43-4458-b65a-5565797335ae.png → 0e0686c7-9fe8-4f82-9d05-7922e55fc1a9.png} +0 -0
- /kotonebot/kaa/sprites/{264e056f-3bcc-4b16-94d4-f767c78ab6f5.png → 109ff896-1f96-465a-ad6f-ef410789e140.png} +0 -0
- /kotonebot/kaa/sprites/{b65724b4-ec8f-48a9-9ab2-e7ce5b8f35b2.png → 1140cce1-90e4-44cd-9acc-c2491841fbd4.png} +0 -0
- /kotonebot/kaa/sprites/{7f6cb60e-6ab3-4db4-86e1-8558250062a4.png → 124fb25f-47ac-468d-97af-f90c9604f1c5.png} +0 -0
- /kotonebot/kaa/sprites/{5868ebfb-5e61-4ac6-b270-acb1e89b738f.png → 1470cd16-3340-4a0a-854f-3acf9b882cb1.png} +0 -0
- /kotonebot/kaa/sprites/{1aaceb21-dc5c-4a58-96d3-d2c66b2fb357.png → 156d67bb-562c-42df-b55a-aea0b6ad71dd.png} +0 -0
- /kotonebot/kaa/sprites/{abcc709c-1f4d-4832-a063-eafbad94ac31.png → 17608ef8-fe7c-4fc7-b811-a6c05e838881.png} +0 -0
- /kotonebot/kaa/sprites/{dbd537c7-d1d3-4d64-9ccd-43dd4519bedd.png → 1a4c5291-70a9-4923-aadf-f7e6a28c7aa5.png} +0 -0
- /kotonebot/kaa/sprites/{d4c47cc7-5b3e-4c3e-8e80-78cb94e7eed9.png → 1db583b2-c82a-4576-9ca9-b7409bc1ca95.png} +0 -0
- /kotonebot/kaa/sprites/{7cabdf91-2f15-4991-b165-eb9cdd557af6.png → 1fc998a7-cfa2-4485-9742-1ae87306a9fc.png} +0 -0
- /kotonebot/kaa/sprites/{dde03640-6c3a-4b13-a783-f672816bfec4.png → 24cdb395-915e-4816-9406-efd1aafa70c1.png} +0 -0
- /kotonebot/kaa/sprites/{94433cf2-dd04-4b74-ae14-e5e3d945f579.png → 25151748-2eb2-4f08-94f1-f1be2fbea3da.png} +0 -0
- /kotonebot/kaa/sprites/{cdbbb5ba-5117-488a-8172-48cfc92c14c6.png → 25598023-8999-4737-9f3c-9da71bb88748.png} +0 -0
- /kotonebot/kaa/sprites/{d3e6e2e9-c5b5-463f-98f4-de72c9320d9d.png → 26b9efc1-51be-4784-bf78-2b929abac650.png} +0 -0
- /kotonebot/kaa/sprites/{e394ff91-09d3-41e1-bbf5-bc42a71a623b.png → 276522a3-d8f0-4b0f-8ee5-dce3f2cb87a5.png} +0 -0
- /kotonebot/kaa/sprites/{dfb14c98-f672-4906-80bd-d2a18bdd62cd.png → 277035b5-7eee-4ca8-80dd-f73d78e7531f.png} +0 -0
- /kotonebot/kaa/sprites/{15465879-eb84-4ca6-ae0f-d3c5ac71e723.png → 28ea2cc9-e9f2-4573-968a-0c88562c696a.png} +0 -0
- /kotonebot/kaa/sprites/{aa3b717f-67f8-445f-a6bf-b89f7200d95b.png → 28f44641-894d-4047-bc56-b932ac5a32a0.png} +0 -0
- /kotonebot/kaa/sprites/{4a310bdd-0a7d-4669-9d57-6ae69bc8f022.png → 2a0e9656-26ba-4d7a-a414-6045e521b92c.png} +0 -0
- /kotonebot/kaa/sprites/{bfec58df-2628-454f-92aa-769cad186448.png → 2a2770d2-7fd8-4bb0-89a7-c507046fc892.png} +0 -0
- /kotonebot/kaa/sprites/{cf66ae12-48bc-4512-a988-0e5de337c76d.png → 2b9fb35b-4a3b-440d-bcac-1eb1fdfe0e21.png} +0 -0
- /kotonebot/kaa/sprites/{c3ec61aa-f62e-46fd-b359-48864ea7a150.png → 2fc3fa82-cc3d-4164-839f-d0bd7f8a32f5.png} +0 -0
- /kotonebot/kaa/sprites/{1aae0ab3-f619-47e0-8bf6-3d3791f7d445.png → 2fd135e1-8010-4a53-90a3-2a950c5a43bf.png} +0 -0
- /kotonebot/kaa/sprites/{d1699baa-467b-46d1-9276-aae78fe8f589.png → 3037118b-4a82-4cfc-ad95-db8a03f779d5.png} +0 -0
- /kotonebot/kaa/sprites/{1d5f7454-672d-4e87-a368-ec4bb32f9b1f.png → 33aaec9e-dccc-441a-b91a-4784f1eb4498.png} +0 -0
- /kotonebot/kaa/sprites/{a8b3fdce-9e4a-495c-839e-0142f67fee69.png → 359e43b3-6b85-4f8c-86a1-4d4c1ae75779.png} +0 -0
- /kotonebot/kaa/sprites/{09fb5e41-6caa-4246-a415-8317b12d8d81.png → 3a4e2e77-c49b-4f69-bfd1-19fbe4f5c9a5.png} +0 -0
- /kotonebot/kaa/sprites/{038c69e6-7cb0-4c8d-99da-b537e48a86b7.png → 3bf0a104-739e-4bef-9304-4aa77e5e18ea.png} +0 -0
- /kotonebot/kaa/sprites/{cb24b3df-1ec3-4ffd-95f1-ca4b0dd5b7da.png → 3ea8a020-5605-47ce-8d3a-d812d0583058.png} +0 -0
- /kotonebot/kaa/sprites/{42d8b5dc-ef27-4411-b8b5-d981e562990b.png → 404c6271-1af4-4f63-be02-e82b318eb072.png} +0 -0
- /kotonebot/kaa/sprites/{8e48af2b-c083-4480-a27c-c59c31a7ede1.png → 43550662-cd46-4312-b18b-949cba98d173.png} +0 -0
- /kotonebot/kaa/sprites/{52f7c8b1-af88-43c5-a999-de4da3caa03a.png → 441c2df2-43ac-4ff3-814e-6230c510bce6.png} +0 -0
- /kotonebot/kaa/sprites/{58a5f51d-d1a3-480b-8dde-ecead34d9f02.png → 44430184-c35e-4bb8-8858-ed5cec580c36.png} +0 -0
- /kotonebot/kaa/sprites/{a4075991-98da-4d06-bcde-28054cd124d2.png → 4466c3fe-a5ad-4960-a137-0d735441b12e.png} +0 -0
- /kotonebot/kaa/sprites/{efb28e1d-7b52-4e20-aec5-117c798b7fbe.png → 46debd92-df4c-49d6-a3f6-c83a4c72be70.png} +0 -0
- /kotonebot/kaa/sprites/{448ea37d-a10d-4102-ac9f-a58403ee8914.png → 49e46cda-a6ac-44c8-8901-60956ca5151d.png} +0 -0
- /kotonebot/kaa/sprites/{faf360e8-7845-4fcf-b0a6-0f5f93c050f1.png → 4cca8c07-b33f-4f57-8c2b-3fff8cb4424a.png} +0 -0
- /kotonebot/kaa/sprites/{a1bba683-a740-4eaf-8c37-3b1042b963b0.png → 4fe4fbf2-4dbf-44d2-8dd6-a3f3c9f0d1b7.png} +0 -0
- /kotonebot/kaa/sprites/{7516c9a1-87ec-4d2f-ac5e-40d1aec27104.png → 501eaf11-021e-4764-93ed-0be6ea0ed5df.png} +0 -0
- /kotonebot/kaa/sprites/{5ee8e9a8-b133-4ab7-a52c-e7e4e1d1ce7b.png → 525b6f3a-acc8-4bd8-be4b-cc1f44fb377a.png} +0 -0
- /kotonebot/kaa/sprites/{6114d53e-dd69-4cee-82a7-7e43b338ff8d.png → 540547f7-5633-440c-b7ad-b54529436479.png} +0 -0
- /kotonebot/kaa/sprites/{c5e16f75-9b5a-4853-a144-275f3d20c186.png → 540a0d73-7158-4872-808f-abcb11ba1aef.png} +0 -0
- /kotonebot/kaa/sprites/{a3b15425-0bfd-4668-a3a9-2ab64da8505f.png → 559485ee-a27f-4824-ad7a-e57d0c613ed5.png} +0 -0
- /kotonebot/kaa/sprites/{8f1e5644-1079-44b1-9d44-97bae3817bc5.png → 56a7aed8-6367-40dd-a6a1-fc8a840abd9b.png} +0 -0
- /kotonebot/kaa/sprites/{2e00ac54-d23a-4d51-82f2-829c012552a6.png → 5d8bbe9f-4732-495a-8d27-80cfd2ea12f5.png} +0 -0
- /kotonebot/kaa/sprites/{4eaa5db2-d624-4df4-b2e4-01f72755f1a4.png → 612d508d-e77c-492e-854d-30141733bd27.png} +0 -0
- /kotonebot/kaa/sprites/{d5d854fc-1b87-43d4-b32d-66eccb66fa41.png → 62031705-40e0-4b74-b7b9-07f1fffd122f.png} +0 -0
- /kotonebot/kaa/sprites/{0a6c6b1e-7a80-428e-a483-1858bfb8ac59.png → 62a4c9fd-35e6-4982-b9f4-e3a5685eac13.png} +0 -0
- /kotonebot/kaa/sprites/{68838f92-5916-424e-a37e-47e0b3834eb3.png → 685fb958-ec13-4826-8e78-3575ff42df27.png} +0 -0
- /kotonebot/kaa/sprites/{b1e7f24e-f246-406e-9073-58e2f3e4e819.png → 689aa894-304a-48d2-8b6e-794dc967b1f6.png} +0 -0
- /kotonebot/kaa/sprites/{1b6be6dd-2711-441a-9fa6-3281a6ad10c7.png → 69266fc9-c8fe-48ea-8d68-8ace8c606049.png} +0 -0
- /kotonebot/kaa/sprites/{1ccdcacf-4f7d-442c-8e2f-09aa7fe14e56.png → 699df701-37a2-4e17-afae-5b49ab826926.png} +0 -0
- /kotonebot/kaa/sprites/{ba759205-ce99-4417-8cab-d32fe55dff4c.png → 6a7eacf1-f14e-45cf-8ef7-7f933d4fa664.png} +0 -0
- /kotonebot/kaa/sprites/{969eb98c-f761-4007-b8bd-2b3fb8d1f08c.png → 6af19ba1-ca74-473b-8788-61132e5fc084.png} +0 -0
- /kotonebot/kaa/sprites/{3cc9685d-6347-4114-9d39-7683c2dc9df6.png → 6be05914-aa45-4e55-a0bb-7ec16e76d7b1.png} +0 -0
- /kotonebot/kaa/sprites/{534d1310-3503-46d3-8ecd-426d9bcf183e.png → 6f342de5-b179-4120-ab6d-404c3eee5caa.png} +0 -0
- /kotonebot/kaa/sprites/{60be53a6-98e9-4fc6-9285-85506dc0e335.png → 6fc5543e-9d09-4f06-8331-64ee62bd73c3.png} +0 -0
- /kotonebot/kaa/sprites/{0fbcb3f6-9ca0-43c7-975b-e7c15c26c897.png → 7036c80b-28fd-4a54-a8f9-06a23d89e861.png} +0 -0
- /kotonebot/kaa/sprites/{b8aada91-eedd-4c53-99f3-f903d547235e.png → 71fe9437-3d7a-4321-9e5c-d6b81d954002.png} +0 -0
- /kotonebot/kaa/sprites/{a1cf80ee-64bf-4d54-a7db-ffadf3c97026.png → 7344f9d8-fccb-44e3-ab43-a180cfce2217.png} +0 -0
- /kotonebot/kaa/sprites/{90def878-cd6e-46e5-9dc4-9c92dd904b80.png → 74e207b4-a13e-47cc-bf23-dbf77089ea3c.png} +0 -0
- /kotonebot/kaa/sprites/{faf069e1-f623-47c1-b879-cfa246fbc7df.png → 76aca556-0042-4f84-a29a-30e6a631aa72.png} +0 -0
- /kotonebot/kaa/sprites/{e5eeb9af-8003-4981-bf56-2e32e76cec5d.png → 7aa7c3dc-02e8-4d70-a026-d1afb34f37f9.png} +0 -0
- /kotonebot/kaa/sprites/{9cd7e1f1-13c4-471e-abee-223ffd9126cb.png → 7d4d40cf-a6db-41ef-90fd-2fb0a6f5087d.png} +0 -0
- /kotonebot/kaa/sprites/{17a8b0a5-5b71-4612-8a68-16c51f03c71b.png → 7d7ccd61-8d92-49b4-aa7e-b1e73906371e.png} +0 -0
- /kotonebot/kaa/sprites/{e5259dfb-3a49-4cfc-9f89-b42958ce6eec.png → 807904aa-30fd-4a9b-8acb-ca4b235281bc.png} +0 -0
- /kotonebot/kaa/sprites/{8b9c115b-d4ce-492e-88cb-08bd01c43570.png → 81a6e258-670c-4646-90ef-a76846cf5d37.png} +0 -0
- /kotonebot/kaa/sprites/{5dd0cc39-4102-4f0f-8ad3-342bbf825977.png → 81bf65f2-9cc3-4613-9611-e7b5ec14c31c.png} +0 -0
- /kotonebot/kaa/sprites/{b5d4265c-82e0-470d-a48e-8aa4edbdef5a.png → 84af97ac-7e73-4ae8-88a6-9b3a18c81fbe.png} +0 -0
- /kotonebot/kaa/sprites/{aefdec38-e3b6-4762-aed8-33107686ddac.png → 85347bb8-c28d-4a40-bd55-386c530727c2.png} +0 -0
- /kotonebot/kaa/sprites/{4b20b364-5f5f-4b34-960e-b0cfd08b1662.png → 884a25c2-7b98-4a33-a975-6f918a8301aa.png} +0 -0
- /kotonebot/kaa/sprites/{29cb7b0f-5684-4516-8fae-4439f7f28e08.png → 88ed3d25-070a-411d-b4fb-8a9df068b091.png} +0 -0
- /kotonebot/kaa/sprites/{1bb00a74-2fdc-4973-84ae-dc1edee15f81.png → 94b8429e-64d9-49da-945c-d2d3dcccb587.png} +0 -0
- /kotonebot/kaa/sprites/{df97421e-4b74-430e-b3d1-ed9bac6918a7.png → 95e591bb-f0e6-457e-83e3-0909cb5c8877.png} +0 -0
- /kotonebot/kaa/sprites/{9aef1aa8-41e1-42a7-83ad-b4e212ee3976.png → 982d2e5d-4493-44a5-b922-e71649fd6bc5.png} +0 -0
- /kotonebot/kaa/sprites/{302fde7d-de85-44c7-ba57-fe4b5f6db5fa.png → 99ae067f-72f2-4d13-a2de-f78ce13ec5a3.png} +0 -0
- /kotonebot/kaa/sprites/{66678caa-7b25-4ff7-8c3a-017f67279349.png → 9b425fee-9118-4015-9242-29bf1150e704.png} +0 -0
- /kotonebot/kaa/sprites/{83f17b06-2792-4035-bc90-1800279ae131.png → 9bf5d8a8-30c1-4ce7-9888-bcada63d48e6.png} +0 -0
- /kotonebot/kaa/sprites/{c25c7ce5-ad8d-4b2c-83eb-ae6d4871a6c3.png → 9fb0b19e-ae0c-4c9e-8ec8-b126113b6091.png} +0 -0
- /kotonebot/kaa/sprites/{0ad2f603-a3ad-4a92-a398-c411145fd8e9.png → a241cff0-d803-4c8f-bcd0-22bda2adc8a7.png} +0 -0
- /kotonebot/kaa/sprites/{83acbca8-3567-4262-a1e7-50f158348d45.png → a26dc021-2a28-4f79-bd11-48c4a1261f0d.png} +0 -0
- /kotonebot/kaa/sprites/{ca2adfb8-1e88-4a31-b3cc-1f70568ce4a3.png → a2ab29ef-ddc7-4885-9f88-850858b0c995.png} +0 -0
- /kotonebot/kaa/sprites/{17414e9e-b046-49e0-9596-cad1f4673a9e.png → a388f87d-9a69-4189-b80a-e230d7d7b964.png} +0 -0
- /kotonebot/kaa/sprites/{83cf48ba-d1af-4674-a52e-6bb80a626db7.png → a53820f6-1572-413a-b7b1-2bc08690884f.png} +0 -0
- /kotonebot/kaa/sprites/{a1853223-d6b9-4660-af4e-91e59bdddc3c.png → a5bd802e-d10c-4e95-9b62-1ffd92aca4ab.png} +0 -0
- /kotonebot/kaa/sprites/{f12c2b0b-8273-4197-a8c6-2a8ef2788a9b.png → a6d63930-bb09-443c-95ae-47ad6a9f9cc4.png} +0 -0
- /kotonebot/kaa/sprites/{9d5dd50c-3341-41a4-a3dd-ccc00edcf201.png → ab4cd19c-ad2b-4ed7-baeb-eef6a12939b2.png} +0 -0
- /kotonebot/kaa/sprites/{080b3cf5-ce35-4382-9bfa-d6a12efb09b3.png → abd7bfbf-5f08-452a-b216-22fb0af4e955.png} +0 -0
- /kotonebot/kaa/sprites/{e9c45a73-2011-4584-87b7-c4e566eba87f.png → ac4579ad-2000-4283-8e13-53fe525725bf.png} +0 -0
- /kotonebot/kaa/sprites/{dad4ff8c-07f4-4b07-abd3-5d02bbcc4562.png → ada79928-ea1a-4537-89e7-a02877dc6e7d.png} +0 -0
- /kotonebot/kaa/sprites/{1f2981d8-5eb6-4332-aa9b-17f4db2d4163.png → af4b7a1d-4cb2-432c-8dbb-c333950c58c2.png} +0 -0
- /kotonebot/kaa/sprites/{7aa2435c-da90-4d52-b831-88dbec57dde9.png → b5d02984-ec1f-48f5-8593-0bc0e4babc1f.png} +0 -0
- /kotonebot/kaa/sprites/{25910d8e-d57f-409f-b0be-ee68c5af4920.png → bba69e83-b9f4-4a24-a95b-190c985c5b22.png} +0 -0
- /kotonebot/kaa/sprites/{1639278d-67e0-4452-a2b5-ec4cf4011f42.png → bc10fc41-960e-4151-aad2-325367b20895.png} +0 -0
- /kotonebot/kaa/sprites/{66172bc0-3869-4a48-a26d-0dc3fa404ab8.png → bc94b664-bbcf-4b59-8e4b-7dbf03997309.png} +0 -0
- /kotonebot/kaa/sprites/{bb0ae68d-44d5-47c6-91dd-a529bc34225b.png → bf44c221-0af9-497e-a2e8-cdc497348257.png} +0 -0
- /kotonebot/kaa/sprites/{2dd34393-ee6f-4b19-8a9c-76556d1bd7d7.png → bff85e9a-df48-429f-a82e-ceff41f8527b.png} +0 -0
- /kotonebot/kaa/sprites/{ed6d3e3d-0f04-4fa4-b0f9-fdbf324649f6.png → c4985caa-1e42-4980-9a76-a660a7b12c67.png} +0 -0
- /kotonebot/kaa/sprites/{f8eec9b2-55ca-4195-b098-a5393d02a98a.png → c5447438-3b41-465e-b438-157f5e61c764.png} +0 -0
- /kotonebot/kaa/sprites/{ad172750-d1a6-4a25-8ce8-9483f4b5affb.png → c696843a-1e17-4c0d-a92c-eb54f9356daf.png} +0 -0
- /kotonebot/kaa/sprites/{c571e1c0-ff85-4b2e-97ed-97d33b8d92e3.png → cc959ce4-8619-4bd7-8a85-02f97cf6cc51.png} +0 -0
- /kotonebot/kaa/sprites/{65d2a5e5-48aa-4390-bb87-bfd8e044e4f6.png → ce0df3fa-5d88-4b20-9cf1-6b4abac4c110.png} +0 -0
- /kotonebot/kaa/sprites/{26580772-ff20-4dcf-8496-f939e0f2890d.png → d2a8f04f-38c1-4a67-8c57-43e0334887ef.png} +0 -0
- /kotonebot/kaa/sprites/{2f74b04f-1992-4584-8dc6-e789b081ddc3.png → db375f07-c682-4aae-880a-a2cf13d0dac0.png} +0 -0
- /kotonebot/kaa/sprites/{d60a395b-d907-416a-b091-36bfee4948b3.png → dd4c523c-1286-4f68-89f5-371464aa138c.png} +0 -0
- /kotonebot/kaa/sprites/{694d3a07-9697-4bda-984d-967779d530f7.png → e2d3a8c0-3998-4643-b084-c21b2304843c.png} +0 -0
- /kotonebot/kaa/sprites/{6156116e-56dd-4b41-a6de-ccec55dab7c8.png → e3c1f79a-0077-43db-bd00-ba04d7ca8d3b.png} +0 -0
- /kotonebot/kaa/sprites/{2d145ade-b926-4276-b872-baec4ef78308.png → e47acec2-3466-419a-acad-30618239aab9.png} +0 -0
- /kotonebot/kaa/sprites/{f72bd3d6-850d-4190-9775-938f474d263c.png → e671d7bd-cf40-425f-b941-3e1adf4624e8.png} +0 -0
- /kotonebot/kaa/sprites/{9f99b0e9-8cc0-4877-8f8a-d26257ef5386.png → e703f139-9612-4e4a-be30-db32423d57d9.png} +0 -0
- /kotonebot/kaa/sprites/{4e8f3e59-edfa-4523-939d-bc46988fc909.png → e89906b2-7354-4724-80ef-7c7fe5cd3ef5.png} +0 -0
- /kotonebot/kaa/sprites/{6aa34982-e7ab-4001-808f-8c5cf370d087.png → ea0440b1-a7a5-4db0-828a-f907b0531cd5.png} +0 -0
- /kotonebot/kaa/sprites/{7b7dad18-a838-4267-b3c7-6ab43b8361f0.png → ecdf7c70-d50e-41f4-a2ee-c4f6dd5a2617.png} +0 -0
- /kotonebot/kaa/sprites/{5d3d61e9-bf13-4668-b0c7-fed730ea2ed6.png → ed331876-f724-4a9f-a494-7823be883a76.png} +0 -0
- /kotonebot/kaa/sprites/{a7da51c2-8444-4770-a16b-b6543e40197f.png → ee7f4e24-6cbc-41ed-9327-d6843ac6a820.png} +0 -0
- /kotonebot/kaa/sprites/{f6bfbf6a-6e53-4563-9345-3f3756d6ea9a.png → f1758956-6b88-49f7-9ecf-44db49d1e6fe.png} +0 -0
- /kotonebot/kaa/sprites/{f025027f-daa0-4943-8395-5d7d44cc7f15.png → f6063ed7-f59e-4c37-93e2-026c805826ea.png} +0 -0
- /kotonebot/kaa/sprites/{69b022a8-e42f-4985-bd16-b4a530ad8a20.png → f699ed29-e7aa-4c53-8320-3df785078ec3.png} +0 -0
- /kotonebot/kaa/sprites/{eae83523-e58c-4db9-a356-4335a5da3dc8.png → f897b52f-b9d8-4d94-9d98-1ed6bf7b6c76.png} +0 -0
- /kotonebot/kaa/sprites/{f528ea0e-1e55-4e41-844f-bb1db9185ef8.png → f92f9af7-77ef-4814-a64b-ce8f340a9cf9.png} +0 -0
- /kotonebot/kaa/sprites/{c484ca57-6b19-46b5-a107-1805a7488d48.png → fccea764-f5db-45c6-ace1-140844e0d0f0.png} +0 -0
- /kotonebot/kaa/sprites/{97adee05-1586-4589-93e6-c6c3a9cdae9d.png → feb8f473-8a2e-40a5-b6e0-dffafd35edc1.png} +0 -0
- /kotonebot/kaa/{clear_logs.py → tasks/clear_logs.py} +0 -0
- {ksaa-2025.6.23.0.dist-info → ksaa-2025.7.3.0.dist-info}/WHEEL +0 -0
- {ksaa-2025.6.23.0.dist-info → ksaa-2025.7.3.0.dist-info}/entry_points.txt +0 -0
- {ksaa-2025.6.23.0.dist-info → ksaa-2025.7.3.0.dist-info}/licenses/LICENSE +0 -0
- {ksaa-2025.6.23.0.dist-info → ksaa-2025.7.3.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from abc import ABC
|
|
2
|
+
from typing import Literal
|
|
3
|
+
from typing_extensions import assert_never
|
|
4
|
+
|
|
5
|
+
from kotonebot import logging
|
|
6
|
+
from kotonebot.client.device import WindowsDevice
|
|
7
|
+
from .protocol import Device, WindowsHostConfig, RemoteWindowsHostConfig
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
WindowsRecipes = Literal['windows', 'remote_windows']
|
|
11
|
+
|
|
12
|
+
# Windows 相关的配置类型联合
|
|
13
|
+
WindowsHostConfigs = WindowsHostConfig | RemoteWindowsHostConfig
|
|
14
|
+
|
|
15
|
+
class CommonWindowsCreateDeviceMixin(ABC):
|
|
16
|
+
"""
|
|
17
|
+
通用 Windows 创建设备的 Mixin。
|
|
18
|
+
该 Mixin 定义了创建 Windows 设备的通用接口。
|
|
19
|
+
"""
|
|
20
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
21
|
+
super().__init__(*args, **kwargs)
|
|
22
|
+
|
|
23
|
+
def create_device(self, recipe: WindowsRecipes, config: WindowsHostConfigs) -> Device:
|
|
24
|
+
"""
|
|
25
|
+
创建 Windows 设备。
|
|
26
|
+
"""
|
|
27
|
+
match recipe:
|
|
28
|
+
case 'windows':
|
|
29
|
+
if not isinstance(config, WindowsHostConfig):
|
|
30
|
+
raise ValueError(f"Expected WindowsHostConfig for 'windows' recipe, got {type(config)}")
|
|
31
|
+
from kotonebot.client.implements.windows import WindowsImpl
|
|
32
|
+
d = WindowsDevice()
|
|
33
|
+
impl = WindowsImpl(
|
|
34
|
+
device=d,
|
|
35
|
+
window_title=config.window_title,
|
|
36
|
+
ahk_exe_path=config.ahk_exe_path
|
|
37
|
+
)
|
|
38
|
+
d._screenshot = impl
|
|
39
|
+
d._touch = impl
|
|
40
|
+
return d
|
|
41
|
+
case 'remote_windows':
|
|
42
|
+
if not isinstance(config, RemoteWindowsHostConfig):
|
|
43
|
+
raise ValueError(f"Expected RemoteWindowsHostConfig for 'remote_windows' recipe, got {type(config)}")
|
|
44
|
+
from kotonebot.client.implements.remote_windows import RemoteWindowsImpl
|
|
45
|
+
d = WindowsDevice()
|
|
46
|
+
impl = RemoteWindowsImpl(
|
|
47
|
+
device=d,
|
|
48
|
+
host=config.host,
|
|
49
|
+
port=config.port
|
|
50
|
+
)
|
|
51
|
+
d._screenshot = impl
|
|
52
|
+
d._touch = impl
|
|
53
|
+
return d
|
|
54
|
+
case _:
|
|
55
|
+
assert_never(f'Unsupported Windows recipe: {recipe}')
|
|
@@ -9,7 +9,7 @@ from adbutils._device import AdbDevice as AdbUtilsDevice
|
|
|
9
9
|
|
|
10
10
|
from ..device import AndroidDevice
|
|
11
11
|
from ..protocol import AndroidCommandable, Touchable, Screenshotable
|
|
12
|
-
from ..registration import
|
|
12
|
+
from ..registration import ImplConfig
|
|
13
13
|
from dataclasses import dataclass
|
|
14
14
|
|
|
15
15
|
logger = logging.getLogger(__name__)
|
|
@@ -83,46 +83,3 @@ class AdbImpl(AndroidCommandable, Touchable, Screenshotable):
|
|
|
83
83
|
if duration is not None:
|
|
84
84
|
logger.warning("Swipe duration is not supported with AdbDevice. Ignoring duration.")
|
|
85
85
|
self.adb.shell(f"input touchscreen swipe {x1} {y1} {x2} {y2}")
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
def _create_adb_device_base(config: AdbImplConfig, impl_class: type) -> AndroidDevice:
|
|
89
|
-
"""
|
|
90
|
-
通用的 ADB 设备创建工厂函数。
|
|
91
|
-
其他任意基于 ADB 的 Impl 可以直接复用这个函数。
|
|
92
|
-
|
|
93
|
-
:param config: ADB 实现配置
|
|
94
|
-
:param impl_class: 实现类或工厂函数。构造函数接收 adb_connection 参数。
|
|
95
|
-
"""
|
|
96
|
-
from adbutils import adb
|
|
97
|
-
|
|
98
|
-
if config.disconnect:
|
|
99
|
-
logger.debug('adb disconnect %s', config.addr)
|
|
100
|
-
adb.disconnect(config.addr)
|
|
101
|
-
if config.connect:
|
|
102
|
-
logger.debug('adb connect %s', config.addr)
|
|
103
|
-
result = adb.connect(config.addr)
|
|
104
|
-
if 'cannot connect to' in result:
|
|
105
|
-
raise ValueError(result)
|
|
106
|
-
serial = config.device_serial or config.addr
|
|
107
|
-
logger.debug('adb wait for %s', serial)
|
|
108
|
-
adb.wait_for(serial, timeout=config.timeout)
|
|
109
|
-
devices = adb.device_list()
|
|
110
|
-
logger.debug('adb device_list: %s', devices)
|
|
111
|
-
d = [d for d in devices if d.serial == serial]
|
|
112
|
-
if len(d) == 0:
|
|
113
|
-
raise ValueError(f"Device {config.addr} not found")
|
|
114
|
-
d = d[0]
|
|
115
|
-
|
|
116
|
-
device = AndroidDevice(d)
|
|
117
|
-
impl = impl_class(d)
|
|
118
|
-
device._touch = impl
|
|
119
|
-
device._screenshot = impl
|
|
120
|
-
device.commands = impl
|
|
121
|
-
|
|
122
|
-
return device
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
@register_impl('adb', config_model=AdbImplConfig)
|
|
126
|
-
def create_adb_device(config: AdbImplConfig) -> AndroidDevice:
|
|
127
|
-
"""AdbImpl 工厂函数"""
|
|
128
|
-
return _create_adb_device_base(config, AdbImpl)
|
|
@@ -11,9 +11,8 @@ import numpy as np
|
|
|
11
11
|
from cv2.typing import MatLike
|
|
12
12
|
from adbutils._utils import adb_path
|
|
13
13
|
|
|
14
|
-
from .adb import AdbImpl
|
|
14
|
+
from .adb import AdbImpl
|
|
15
15
|
from adbutils._device import AdbDevice as AdbUtilsDevice
|
|
16
|
-
from ..registration import register_impl
|
|
17
16
|
from kotonebot import logging
|
|
18
17
|
|
|
19
18
|
logger = logging.getLogger(__name__)
|
|
@@ -157,10 +156,4 @@ class AdbRawImpl(AdbImpl):
|
|
|
157
156
|
logger.verbose(f"adb raw screenshot wait time: {time.time() - start_time:.4f}s")
|
|
158
157
|
data = self.__data
|
|
159
158
|
self.__data = None
|
|
160
|
-
return data
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
@register_impl('adb_raw', config_model=AdbImplConfig)
|
|
164
|
-
def create_adb_raw_device(config: AdbImplConfig):
|
|
165
|
-
"""AdbRawImpl 工厂函数"""
|
|
166
|
-
return _create_adb_device_base(config, AdbRawImpl)
|
|
159
|
+
return data
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import ctypes
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
logger = logging.getLogger(__name__)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class NemuIpcIncompatible(RuntimeError):
|
|
9
|
+
"""MuMu12 IPC 环境不兼容或 DLL 加载失败"""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ExternalRendererIpc:
|
|
13
|
+
r"""对 `external_renderer_ipc.dll` 的轻量封装。
|
|
14
|
+
|
|
15
|
+
该类仅处理 DLL 加载与原型声明,并提供带有类型提示的薄包装方法,
|
|
16
|
+
方便在其他模块中调用且保持类型安全。
|
|
17
|
+
传入参数为 MuMu 根目录(如 F:\Apps\Netease\MuMuPlayer-12.0)。
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, mumu_root_folder: str):
|
|
21
|
+
if os.name != "nt":
|
|
22
|
+
raise NemuIpcIncompatible("ExternalRendererIpc only supports Windows.")
|
|
23
|
+
|
|
24
|
+
self.lib = self.__load_dll(mumu_root_folder)
|
|
25
|
+
self.raise_on_error: bool = True
|
|
26
|
+
"""是否在调用 DLL 函数失败时抛出异常。"""
|
|
27
|
+
self.__declare_prototypes()
|
|
28
|
+
|
|
29
|
+
def connect(self, nemu_folder: str, instance_id: int) -> int:
|
|
30
|
+
"""
|
|
31
|
+
建立连接。
|
|
32
|
+
|
|
33
|
+
API 原型:
|
|
34
|
+
`int nemu_connect(const wchar_t* path, int index)`
|
|
35
|
+
|
|
36
|
+
:param nemu_folder: 模拟器安装路径。
|
|
37
|
+
:param instance_id: 模拟器实例 ID。
|
|
38
|
+
:return: 成功返回连接 ID,失败返回 0。
|
|
39
|
+
"""
|
|
40
|
+
return self.lib.nemu_connect(nemu_folder, instance_id)
|
|
41
|
+
|
|
42
|
+
def disconnect(self, connect_id: int) -> None:
|
|
43
|
+
"""
|
|
44
|
+
断开连接。
|
|
45
|
+
|
|
46
|
+
API 原型:
|
|
47
|
+
`void nemu_disconnect(int handle)`
|
|
48
|
+
|
|
49
|
+
:param connect_id: 连接 ID。
|
|
50
|
+
:return: 无返回值。
|
|
51
|
+
"""
|
|
52
|
+
return self.lib.nemu_disconnect(connect_id)
|
|
53
|
+
|
|
54
|
+
def get_display_id(self, connect_id: int, pkg: str, app_index: int) -> int:
|
|
55
|
+
"""
|
|
56
|
+
获取指定包的 display id。
|
|
57
|
+
|
|
58
|
+
API 原型:
|
|
59
|
+
`int nemu_get_display_id(int handle, const char* pkg, int appIndex)`
|
|
60
|
+
|
|
61
|
+
:param connect_id: 连接 ID。
|
|
62
|
+
:param pkg: 包名。
|
|
63
|
+
:param app_index: 多开应用索引。
|
|
64
|
+
:return: <0 表示失败,>=0 表示有效 display id。
|
|
65
|
+
"""
|
|
66
|
+
return self.lib.nemu_get_display_id(connect_id, pkg.encode('utf-8'), app_index)
|
|
67
|
+
|
|
68
|
+
def capture_display(
|
|
69
|
+
self,
|
|
70
|
+
connect_id: int,
|
|
71
|
+
display_id: int,
|
|
72
|
+
buf_len: int,
|
|
73
|
+
width_ptr: ctypes.c_void_p,
|
|
74
|
+
height_ptr: ctypes.c_void_p,
|
|
75
|
+
buffer_ptr: ctypes.c_void_p,
|
|
76
|
+
) -> int:
|
|
77
|
+
"""
|
|
78
|
+
截取指定显示屏内容。
|
|
79
|
+
|
|
80
|
+
API 原型:
|
|
81
|
+
`int nemu_capture_display(int handle, unsigned int displayid, int buffer_size, int *width, int *height, unsigned char* pixels)`
|
|
82
|
+
|
|
83
|
+
:param connect_id: 连接 ID。
|
|
84
|
+
:param display_id: 显示屏 ID。
|
|
85
|
+
:param buf_len: 缓冲区长度(字节)。
|
|
86
|
+
:param width_ptr: 用于接收宽度的指针(ctypes.c_void_p/int 指针)。
|
|
87
|
+
:param height_ptr: 用于接收高度的指针(ctypes.c_void_p/int 指针)。
|
|
88
|
+
:param buffer_ptr: 用于接收像素数据的指针(ctypes.c_void_p/unsigned char* 指针)。
|
|
89
|
+
:return: 0 表示成功,>0 表示失败。
|
|
90
|
+
"""
|
|
91
|
+
return self.lib.nemu_capture_display(
|
|
92
|
+
connect_id,
|
|
93
|
+
display_id,
|
|
94
|
+
buf_len,
|
|
95
|
+
width_ptr,
|
|
96
|
+
height_ptr,
|
|
97
|
+
buffer_ptr,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def input_text(self, connect_id: int, text: str) -> int:
|
|
101
|
+
"""
|
|
102
|
+
输入文本。
|
|
103
|
+
|
|
104
|
+
API 原型:
|
|
105
|
+
`int nemu_input_text(int handle, int size, const char* buf)`
|
|
106
|
+
|
|
107
|
+
:param connect_id: 连接 ID。
|
|
108
|
+
:param text: 输入文本(utf-8)。
|
|
109
|
+
:return: 0 表示成功,>0 表示失败。
|
|
110
|
+
"""
|
|
111
|
+
buf = text.encode('utf-8')
|
|
112
|
+
return self.lib.nemu_input_text(connect_id, len(buf), buf)
|
|
113
|
+
|
|
114
|
+
def input_touch_down(self, connect_id: int, display_id: int, x: int, y: int) -> int:
|
|
115
|
+
"""
|
|
116
|
+
发送触摸按下事件。
|
|
117
|
+
|
|
118
|
+
API 原型:
|
|
119
|
+
`int nemu_input_event_touch_down(int handle, int displayid, int x_point, int y_point)`
|
|
120
|
+
|
|
121
|
+
:param connect_id: 连接 ID。
|
|
122
|
+
:param display_id: 显示屏 ID。
|
|
123
|
+
:param x: 触摸点 X 坐标。
|
|
124
|
+
:param y: 触摸点 Y 坐标。
|
|
125
|
+
:return: 0 表示成功,>0 表示失败。
|
|
126
|
+
"""
|
|
127
|
+
return self.lib.nemu_input_event_touch_down(connect_id, display_id, x, y)
|
|
128
|
+
|
|
129
|
+
def input_touch_up(self, connect_id: int, display_id: int) -> int:
|
|
130
|
+
"""
|
|
131
|
+
发送触摸抬起事件。
|
|
132
|
+
|
|
133
|
+
API 原型:
|
|
134
|
+
`int nemu_input_event_touch_up(int handle, int displayid)`
|
|
135
|
+
|
|
136
|
+
:param connect_id: 连接 ID。
|
|
137
|
+
:param display_id: 显示屏 ID。
|
|
138
|
+
:return: 0 表示成功,>0 表示失败。
|
|
139
|
+
"""
|
|
140
|
+
return self.lib.nemu_input_event_touch_up(connect_id, display_id)
|
|
141
|
+
|
|
142
|
+
def input_key_down(self, connect_id: int, display_id: int, key_code: int) -> int:
|
|
143
|
+
"""
|
|
144
|
+
发送按键按下事件。
|
|
145
|
+
|
|
146
|
+
API 原型:
|
|
147
|
+
`int nemu_input_event_key_down(int handle, int displayid, int key_code)`
|
|
148
|
+
|
|
149
|
+
:param connect_id: 连接 ID。
|
|
150
|
+
:param display_id: 显示屏 ID。
|
|
151
|
+
:param key_code: 按键码。
|
|
152
|
+
:return: 0 表示成功,>0 表示失败。
|
|
153
|
+
"""
|
|
154
|
+
return self.lib.nemu_input_event_key_down(connect_id, display_id, key_code)
|
|
155
|
+
|
|
156
|
+
def input_key_up(self, connect_id: int, display_id: int, key_code: int) -> int:
|
|
157
|
+
"""
|
|
158
|
+
发送按键抬起事件。
|
|
159
|
+
|
|
160
|
+
API 原型:
|
|
161
|
+
`int nemu_input_event_key_up(int handle, int displayid, int key_code)`
|
|
162
|
+
|
|
163
|
+
:param connect_id: 连接 ID。
|
|
164
|
+
:param display_id: 显示屏 ID。
|
|
165
|
+
:param key_code: 按键码。
|
|
166
|
+
:return: 0 表示成功,>0 表示失败。
|
|
167
|
+
"""
|
|
168
|
+
return self.lib.nemu_input_event_key_up(connect_id, display_id, key_code)
|
|
169
|
+
|
|
170
|
+
def input_finger_touch_down(self, connect_id: int, display_id: int, finger_id: int, x: int, y: int) -> int:
|
|
171
|
+
"""
|
|
172
|
+
多指触摸按下。
|
|
173
|
+
|
|
174
|
+
API 原型:
|
|
175
|
+
`int nemu_input_event_finger_touch_down(int handle, int displayid, int finger_id, int x_point, int y_point)`
|
|
176
|
+
|
|
177
|
+
:param connect_id: 连接 ID。
|
|
178
|
+
:param display_id: 显示屏 ID。
|
|
179
|
+
:param finger_id: 手指编号(1-10)。
|
|
180
|
+
:param x: 触摸点 X 坐标。
|
|
181
|
+
:param y: 触摸点 Y 坐标。
|
|
182
|
+
:return: 0 表示成功,>0 表示失败。
|
|
183
|
+
"""
|
|
184
|
+
return self.lib.nemu_input_event_finger_touch_down(connect_id, display_id, finger_id, x, y)
|
|
185
|
+
|
|
186
|
+
def input_finger_touch_up(self, connect_id: int, display_id: int, finger_id: int) -> int:
|
|
187
|
+
"""
|
|
188
|
+
多指触摸抬起。
|
|
189
|
+
|
|
190
|
+
API 原型:
|
|
191
|
+
`int nemu_input_event_finger_touch_up(int handle, int displayid, int slot_id)`
|
|
192
|
+
|
|
193
|
+
:param connect_id: 连接 ID。
|
|
194
|
+
:param display_id: 显示屏 ID。
|
|
195
|
+
:param finger_id: 手指编号(1-10)。
|
|
196
|
+
:return: 0 表示成功,>0 表示失败。
|
|
197
|
+
"""
|
|
198
|
+
return self.lib.nemu_input_event_finger_touch_up(connect_id, display_id, finger_id)
|
|
199
|
+
|
|
200
|
+
# ------------------------------------------------------------------
|
|
201
|
+
# 内部工具
|
|
202
|
+
# ------------------------------------------------------------------
|
|
203
|
+
|
|
204
|
+
def __load_dll(self, mumu_root_folder: str) -> ctypes.CDLL:
|
|
205
|
+
"""尝试多条路径加载 DLL。传入为 MuMu 根目录。"""
|
|
206
|
+
candidate_paths = [
|
|
207
|
+
os.path.join(mumu_root_folder, "shell", "sdk", "external_renderer_ipc.dll"),
|
|
208
|
+
os.path.join(
|
|
209
|
+
mumu_root_folder,
|
|
210
|
+
"shell",
|
|
211
|
+
"nx_device",
|
|
212
|
+
"12.0",
|
|
213
|
+
"sdk",
|
|
214
|
+
"external_renderer_ipc.dll",
|
|
215
|
+
),
|
|
216
|
+
]
|
|
217
|
+
for p in candidate_paths:
|
|
218
|
+
if not os.path.exists(p):
|
|
219
|
+
continue
|
|
220
|
+
try:
|
|
221
|
+
return ctypes.CDLL(p)
|
|
222
|
+
except OSError as e: # pragma: no cover
|
|
223
|
+
logger.warning("Failed to load DLL (%s): %s", p, e)
|
|
224
|
+
raise NemuIpcIncompatible("external_renderer_ipc.dll not found or failed to load.")
|
|
225
|
+
|
|
226
|
+
def __declare_prototypes(self) -> None:
|
|
227
|
+
"""声明 DLL 函数原型,确保 ctypes 类型安全。"""
|
|
228
|
+
# 连接 / 断开
|
|
229
|
+
self.lib.nemu_connect.argtypes = [ctypes.c_wchar_p, ctypes.c_int]
|
|
230
|
+
self.lib.nemu_connect.restype = ctypes.c_int
|
|
231
|
+
|
|
232
|
+
self.lib.nemu_disconnect.argtypes = [ctypes.c_int]
|
|
233
|
+
self.lib.nemu_disconnect.restype = None
|
|
234
|
+
|
|
235
|
+
# 获取 display id
|
|
236
|
+
self.lib.nemu_get_display_id.argtypes = [ctypes.c_int, ctypes.c_char_p, ctypes.c_int]
|
|
237
|
+
self.lib.nemu_get_display_id.restype = ctypes.c_int
|
|
238
|
+
|
|
239
|
+
# 截图
|
|
240
|
+
self.lib.nemu_capture_display.argtypes = [
|
|
241
|
+
ctypes.c_int,
|
|
242
|
+
ctypes.c_uint,
|
|
243
|
+
ctypes.c_int,
|
|
244
|
+
ctypes.c_void_p,
|
|
245
|
+
ctypes.c_void_p,
|
|
246
|
+
ctypes.c_void_p,
|
|
247
|
+
]
|
|
248
|
+
self.lib.nemu_capture_display.restype = ctypes.c_int
|
|
249
|
+
|
|
250
|
+
# 输入文本
|
|
251
|
+
self.lib.nemu_input_text.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_char_p]
|
|
252
|
+
self.lib.nemu_input_text.restype = ctypes.c_int
|
|
253
|
+
|
|
254
|
+
# 触摸
|
|
255
|
+
self.lib.nemu_input_event_touch_down.argtypes = [
|
|
256
|
+
ctypes.c_int,
|
|
257
|
+
ctypes.c_int,
|
|
258
|
+
ctypes.c_int,
|
|
259
|
+
ctypes.c_int,
|
|
260
|
+
]
|
|
261
|
+
self.lib.nemu_input_event_touch_down.restype = ctypes.c_int
|
|
262
|
+
|
|
263
|
+
self.lib.nemu_input_event_touch_up.argtypes = [ctypes.c_int, ctypes.c_int]
|
|
264
|
+
self.lib.nemu_input_event_touch_up.restype = ctypes.c_int
|
|
265
|
+
|
|
266
|
+
# 按键
|
|
267
|
+
self.lib.nemu_input_event_key_down.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int]
|
|
268
|
+
self.lib.nemu_input_event_key_down.restype = ctypes.c_int
|
|
269
|
+
|
|
270
|
+
self.lib.nemu_input_event_key_up.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int]
|
|
271
|
+
self.lib.nemu_input_event_key_up.restype = ctypes.c_int
|
|
272
|
+
|
|
273
|
+
# 多指触摸
|
|
274
|
+
self.lib.nemu_input_event_finger_touch_down.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]
|
|
275
|
+
self.lib.nemu_input_event_finger_touch_down.restype = ctypes.c_int
|
|
276
|
+
|
|
277
|
+
self.lib.nemu_input_event_finger_touch_up.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int]
|
|
278
|
+
self.lib.nemu_input_event_finger_touch_up.restype = ctypes.c_int
|
|
279
|
+
|
|
280
|
+
logger.debug("DLL function prototypes declared")
|