Skip to content

Commit

Permalink
Add OSX encrypt (PokemonGoF#5)
Browse files Browse the repository at this point in the history
* Add OSX encrypt

* Check for encryption library
  • Loading branch information
marauder37 authored and Hao Hu committed Aug 7, 2016
1 parent 30dafcf commit 66d4290
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Binary file added pogom/libencrypt-osx.so
Binary file not shown.
1 change: 1 addition & 0 deletions pogom/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'''

import os
import sys
import logging
import time
import math
Expand Down
20 changes: 12 additions & 8 deletions pogom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,20 @@ def send_to_webhook(message_type, message):

def get_encryption_lib_path():
lib_path = ""
if os.name is "nt":
if sys.platform == "win32":
lib_path = os.path.join(os.path.dirname(__file__), "encrypt.dll")
elif os.name is "posix":
elif sys.platform == "darwin":
lib_path = os.path.join(os.path.dirname(__file__), "libencrypt-osx.so")
elif sys.platform.startswith('linux'):
lib_path = os.path.join(os.path.dirname(__file__), "libencrypt.so")
else:
log.error("Operating system not supported")
return ""
err = "Unexpected/unsupported platform '{}'".format(sys.platform)
log.error(err)
raise Exception(err)

if not os.path.isfile(lib_path):
log.error("Could not find encryption library [encrypt.dll (Windows) or"
+ " libencrypt.so (Linux)]. Please make sure it's in the pogom"
+ " directory")
return ""
err = "Could not find {} encryption library {}".format(sys.platform, lib_path)
log.error(err)
raise Exception(err)

return lib_path

0 comments on commit 66d4290

Please sign in to comment.