diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index c0a27effe4..b3f497ec3b 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -979,25 +979,29 @@ def get_encryption_lib(self): if _platform == "Windows" or _platform == "win32": # Check if we are on 32 or 64 bit if sys.maxsize > 2**32: - file_name = 'src/pgoapi/pgoapi/lib/encrypt64.dll' + file_name = 'encrypt64.dll' else: - file_name = 'src/pgoapi/pgoapi/lib/encrypt32.dll' + file_name = 'encrypt32.dll' if _platform.lower() == "darwin": - file_name= 'src/pgoapi/pgoapi/lib/libencrypt-osx-64.so' + file_name= 'libencrypt-osx-64.so' if _platform.lower() == "linux" or _platform.lower() == "linux2": - file_name = 'src/pgoapi/pgoapi/lib/libencrypt-linux-x86-64.so' + file_name = 'libencrypt-linux-x86-64.so' if self.config.encrypt_location == '': path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) else: path = self.config.encrypt_location - full_path = path + '/'+ file_name - if not os.path.isfile(full_path): + full_path = '' + if os.path.isfile(path + '/' + file_name): # check encrypt_location or local dir first + full_path = path + '/' + file_name + elif os.path.isfile(path + '/src/pgoapi/pgoapi/lib/' + file_name): # if not found, check pgoapi lib folder + full_path = path + '/src/pgoapi/pgoapi/lib/' + file_name + + if full_path == '': self.logger.error(file_name + ' is not found! Please place it in the bots root directory or set encrypt_location in config.') - self.logger.info('Platform: '+ _platform + ' ' + file_name + ' directory: '+ path) sys.exit(1) else: - self.logger.info('Found '+ file_name +'! Platform: ' + _platform + ' ' + file_name + ' directory: ' + path) + self.logger.info('Found '+ file_name +'! Platform: ' + _platform + ' ' + file_name + ' directory: ' + full_path) return full_path @@ -1005,25 +1009,29 @@ def get_hash_lib(self): if _platform == "Windows" or _platform == "win32": # Check if we are on 32 or 64 bit if sys.maxsize > 2**32: - file_name = 'src/pgoapi/pgoapi/lib/niantichash64.dll' + file_name = 'niantichash64.dll' else: - file_name = 'src/pgoapi/pgoapi/lib/niantichash32.dll' + file_name = 'niantichash32.dll' if _platform.lower() == "darwin": - file_name= 'src/pgoapi/pgoapi/lib/libniantichash-osx-64.so' + file_name= 'libniantichash-macos-64.dylib' if _platform.lower() == "linux" or _platform.lower() == "linux2": - file_name = 'src/pgoapi/pgoapi/lib/libniantichash-linux-x86-64.so' + file_name = 'libniantichash-linux-x86-64.so' if self.config.encrypt_location == '': path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) else: path = self.config.encrypt_location - full_path = path + '/'+ file_name - if not os.path.isfile(full_path): - self.logger.error(file_name + ' is not found! Please place it in the bots root directory') - self.logger.info('Platform: '+ _platform + ' ' + file_name + ' directory: '+ path) + full_path = '' + if os.path.isfile(path + '/' + file_name): # check encrypt_location or local dir first + full_path = path + '/'+ file_name + elif os.path.isfile(path + '/src/pgoapi/pgoapi/lib/' + file_name): # if not found, check pgoapi lib folder + full_path = path + '/src/pgoapi/pgoapi/lib/' + file_name + + if full_path == '': + self.logger.error(file_name + ' is not found! Please place it in the bots root directory or set encrypt_location in config.') sys.exit(1) else: - self.logger.info('Found '+ file_name +'! Platform: ' + _platform + ' ' + file_name + ' directory: ' + path) + self.logger.info('Found '+ file_name +'! Platform: ' + _platform + ' ' + file_name + ' directory: ' + full_path) return full_path diff --git a/requirements.txt b/requirements.txt index 8f0a4ea255..74aee95ae5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ numpy==1.11.0 networkx==1.11 --e git+https://github.com/pogodevorg/pgoapi.git/@v0.43.3-alpha#egg=pgoapi +-e git+https://github.com/sebastienvercammen/pgoapi.git#egg=pgoapi geopy==1.11.0 geographiclib==1.46.3 protobuf==3.0.0b4