Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #155 from Noctem/0.45.0
Browse files Browse the repository at this point in the history
Update hashing for 0.45.0
  • Loading branch information
keyphact authored Nov 12, 2016
2 parents f551cd6 + c242033 commit 5f83229
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 20 deletions.
Binary file removed pgoapi/lib/libniantichash-freebsd-64.so
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-freebsd-i386.so
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-freebsd-x86-64.so
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-linux-arm32.so
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-linux-arm64.so
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-linux-i386.so
Binary file not shown.
Binary file modified pgoapi/lib/libniantichash-linux-x86-64.so
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-macos-i386.dylib
Binary file not shown.
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-windows-i686.dll
Binary file not shown.
Binary file added pgoapi/lib/libniantichash-windows-x86-64.dll
Binary file not shown.
Binary file removed pgoapi/lib/niantichash32.dll
Binary file not shown.
Binary file removed pgoapi/lib/niantichash64.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion pgoapi/rpc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def _build_main_request(self, subrequests, player_position=None):
sen.gravity_z = random.triangular(-1, .7, -0.8)
sen.status = 3

sig.field25 = 10038237239822475814
sig.field25 = 16892874496697272497

if self.device_info:
for key in self.device_info:
Expand Down
39 changes: 20 additions & 19 deletions pgoapi/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

log = logging.getLogger(__name__)

HASH_SEED = 0x61247FBF # static hash seed from app
HASH_SEED = 0x46E945F8 # static hash seed from app
EARTH_RADIUS = 6371000 # radius of Earth in meters

def f2i(float):
Expand Down Expand Up @@ -172,30 +172,31 @@ def long_to_bytes(val, endianness='big'):
def get_hash_lib_path():
# win32 doesn't mean necessarily 32 bits
hash_lib = None
arch = platform.architecture()[0]
if sys.platform == "win32" or sys.platform == "cygwin":
if platform.architecture()[0] == '64bit':
hash_lib = "niantichash64.dll"
if arch == '64bit':
hash_lib = "libniantichash-windows-x86-64.dll"
else:
hash_lib = "niantichash32.dll"
hash_lib = "libniantichash-windows-i686.dll"
elif sys.platform == "darwin":
hash_lib = "libniantichash-macos-64.dylib"
elif os.uname()[4].startswith("arm") and platform.architecture()[0] == '32bit':
hash_lib = "libniantichash-linux-arm-32.so"
elif os.uname()[4].startswith("aarch64") and platform.architecture()[0] == '64bit':
hash_lib = "libniantichash-linux-arm-64.so"
if arch == '64bit':
hash_lib = "libniantichash-macos-x86-64.dylib"
else:
hash_lib = "libniantichash-macos-i386.dylib"
elif os.uname()[4].startswith("arm") and arch == '32bit':
hash_lib = "libniantichash-linux-arm32.so"
elif os.uname()[4].startswith("aarch64") and arch == '64bit':
hash_lib = "libniantichash-linux-arm64.so"
elif sys.platform.startswith('linux'):
if "centos" in platform.platform():
if platform.architecture()[0] == '64bit':
hash_lib = "libniantichash-centos-x86-64.so"
else:
hash_lib = "libniantichash-linux-x86-32.so"
if arch == '64bit':
hash_lib = "libniantichash-linux-x86-64.so"
else:
if platform.architecture()[0] == '64bit':
hash_lib = "libniantichash-linux-x86-64.so"
else:
hash_lib = "libniantichash-linux-x86-32.so"
hash_lib = "libniantichash-linux-i386.so"
elif sys.platform.startswith('freebsd'):
hash_lib = "libniantichash-freebsd-64.so"
if arch == '64bit':
hash_lib = "libniantichash-freebsd-x86-64.so"
else:
hash_lib = "libniantichash-freebsd-i386.so"
else:
err = "Unexpected/unsupported platform '{}'".format(sys.platform)
log.error(err)
Expand Down

0 comments on commit 5f83229

Please sign in to comment.