Skip to content

Commit

Permalink
Consider webviews of chrome and firefox as valid pogo topmost given P…
Browse files Browse the repository at this point in the history
…TC oauth
  • Loading branch information
Grennith committed Mar 31, 2024
1 parent 5d42036 commit 5b8f606
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mapadroid/websocket/communicator.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 5b8f606

Please sign in to comment.