From 5b8f60625ea74e95eb7afa8ea3208ed9545d8cd2 Mon Sep 17 00:00:00 2001 From: Till Skrodzki Date: Sun, 31 Mar 2024 14:46:01 +0200 Subject: [PATCH] Consider webviews of chrome and firefox as valid pogo topmost given PTC oauth --- mapadroid/websocket/communicator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mapadroid/websocket/communicator.py b/mapadroid/websocket/communicator.py index 0ed423bc7..26dbe501e 100644 --- a/mapadroid/websocket/communicator.py +++ b/mapadroid/websocket/communicator.py @@ -1,7 +1,7 @@ import asyncio import re from ipaddress import IPv4Address, ip_address -from typing import Optional +from typing import Optional, Set import websockets from aiofile import async_open @@ -188,7 +188,11 @@ async def is_pogo_topmost(self) -> bool: topmost = await self.__run_get_gesponse("more topmost app\r\n") if topmost is None: return False - return "com.nianticlabs.pokemongo" in topmost + valid_pogo_states: Set[str] = {"com.nianticlabs.pokemongo", + "ExternalAppBrowserActivity", # PTC OAuth with Firefox + "CustomTabActivity" # PTC OAuth with Chrome + } + return any(x in topmost for x in valid_pogo_states) async def topmost_app(self) -> Optional[MessageTyping]: topmost = await self.__run_get_gesponse("more topmost app\r\n")