Skip to content

Commit

Permalink
Get Clipper to work in Android 10
Browse files Browse the repository at this point in the history
Change the front program to Clipper, do the clipper.get and change back to PokemonGO.
Do some small waits in between.
The idea is base on some note from Tuan Chau @tuanchauict , he is mention in a issue note on Clipper (/majido/clipper/issues/9), "Seems like we need to open the app to the foreground to achieve it."
  • Loading branch information
J-G-Froejk authored May 12, 2020
1 parent 2d22fae commit fd79c87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pokemonlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ async def read_logcat(self):
return line

async def get_clipboard(self):
return_code, stdout, stderr = await self.run(["adb", "-s", await self.get_device(), "shell", "am start -n ca.zgrs.clipper/.Main"])
await asyncio.sleep(0.3)
await self.send_intent("clipper.get")
return_code, stdout, stderr = await self.run(["adb", "-s", await self.get_device(), "shell", "am start -n com.nianticlabs.pokemongo/com.nianticproject.holoholo.libholoholo.unity.UnityMainActivity"])
await asyncio.sleep(0.3)
while True:
line = await self.read_logcat()
match = RE_CLIPBOARD_TEXT.match(line)
Expand Down

1 comment on commit fd79c87

@J-G-Froejk
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JGFNEED The While True in line 112, is probably not right any more.

Please sign in to comment.