Skip to content

Commit 7d19400

Browse files
committedJul 22, 2017
Cleanup encrypt references in linux, mac and docker setups
1 parent cafd19d commit 7d19400

File tree

7 files changed

+6
-105
lines changed

7 files changed

+6
-105
lines changed
 

‎.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,3 @@ pip-selfcheck.json
147147
# Mac Gargage
148148
.DS_Store
149149
data/mqtt_client_id
150-
151-
# pgoapi files
152-
encrypt.so
153-
encrypt.dll
154-
encrypt_64.dll

‎Dockerfile

+1-5
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,12 @@ ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/requirements.txt
3232
RUN apk update
3333
RUN apk add ca-certificates wget
3434
RUN update-ca-certificates
35-
RUN wget -P /tmp/ http://pgoapi.com/pgoencrypt.tar.gz
3635

3736
RUN apk -U --no-cache add --virtual .build-dependencies python-dev gcc make musl-dev git
38-
RUN tar xvzf /tmp/pgoencrypt.tar.gz -C /tmp
39-
RUN make -C /tmp/pgoencrypt/src
40-
RUN cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encrypt.so
4137
RUN ln -s locale.h /usr/include/xlocale.h
4238
RUN pip install --no-cache-dir -r requirements.txt
4339
RUN apk del .build-dependencies
44-
RUN rm -rf /var/cache/apk/* /tmp/pgoencrypt* /usr/include/xlocale.h
40+
RUN rm -rf /var/cache/apk/* /usr/include/xlocale.h
4541
RUN find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f
4642

4743

‎configs/auth.json.example

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
],
1212
"gmapkey": "GOOGLE_MAPS_API_KEY",
1313
"hashkey" : "YOUR_PURCHASED_HASH_KEY",
14-
"encrypt_location": "",
1514
"telegram_token": "",
16-
"discord_token": "",
15+
"discord_token": "",
1716
"2captcha_token": ""
1817
}

‎pokecli.py

-1
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,6 @@ def _json_loader(filename):
755755
config.password = getpass("Password: ")
756756

757757
config.favorite_locations = load.get('favorite_locations', [])
758-
config.encrypt_location = load.get('encrypt_location', '')
759758
config.telegram_token = load.get('telegram_token', '')
760759
config.discord_token = load.get('discord_token', '')
761760
config.twocaptcha_token = load.get('2captcha_token', '')

‎pokemongo_bot/__init__.py

-65
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,6 @@ def check_session(self, position):
988988
self.api = ApiWrapper(config=self.config)
989989
self.api.set_position(*position)
990990
self.login()
991-
#self.api.set_signature_lib(self.get_encryption_lib())
992-
#self.api.set_hash_lib(self.get_hash_lib())
993991

994992
def login(self):
995993
status = {}
@@ -1115,66 +1113,6 @@ def login(self):
11151113

11161114
self.heartbeat()
11171115

1118-
def get_encryption_lib(self):
1119-
if _platform == "Windows" or _platform == "win32":
1120-
# Check if we are on 32 or 64 bit
1121-
if sys.maxsize > 2**32:
1122-
file_name = 'encrypt64.dll'
1123-
else:
1124-
file_name = 'encrypt32.dll'
1125-
if _platform.lower() == "darwin":
1126-
file_name= 'libencrypt-osx-64.so'
1127-
if _platform.lower() == "linux" or _platform.lower() == "linux2":
1128-
file_name = 'libencrypt-linux-x86-64.so'
1129-
if self.config.encrypt_location == '':
1130-
path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
1131-
else:
1132-
path = self.config.encrypt_location
1133-
1134-
full_path = ''
1135-
if os.path.isfile(path + '/' + file_name): # check encrypt_location or local dir first
1136-
full_path = path + '/' + file_name
1137-
elif os.path.isfile(path + '/src/pgoapi/pgoapi/lib/' + file_name): # if not found, check pgoapi lib folder
1138-
full_path = path + '/src/pgoapi/pgoapi/lib/' + file_name
1139-
1140-
if full_path == '':
1141-
self.logger.error(file_name + ' is not found! Please place it in the bots root directory or set encrypt_location in config.')
1142-
sys.exit(1)
1143-
else:
1144-
self.logger.info('Found '+ file_name +'! Platform: ' + _platform + ' ' + file_name + ' directory: ' + full_path)
1145-
1146-
return full_path
1147-
1148-
def get_hash_lib(self):
1149-
if _platform == "Windows" or _platform == "win32":
1150-
# Check if we are on 32 or 64 bit
1151-
if sys.maxsize > 2**32:
1152-
file_name = 'niantichash64.dll'
1153-
else:
1154-
file_name = 'niantichash32.dll'
1155-
if _platform.lower() == "darwin":
1156-
file_name= 'libniantichash-macos-64.dylib'
1157-
if _platform.lower() == "linux" or _platform.lower() == "linux2":
1158-
file_name = 'libniantichash-linux-x86-64.so'
1159-
if self.config.encrypt_location == '':
1160-
path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
1161-
else:
1162-
path = self.config.encrypt_location
1163-
1164-
full_path = ''
1165-
if os.path.isfile(path + '/' + file_name): # check encrypt_location or local dir first
1166-
full_path = path + '/'+ file_name
1167-
elif os.path.isfile(path + '/src/pgoapi/pgoapi/lib/' + file_name): # if not found, check pgoapi lib folder
1168-
full_path = path + '/src/pgoapi/pgoapi/lib/' + file_name
1169-
1170-
if full_path == '':
1171-
self.logger.error(file_name + ' is not found! Please place it in the bots root directory or set encrypt_location in config.')
1172-
sys.exit(1)
1173-
else:
1174-
self.logger.info('Found '+ file_name +'! Platform: ' + _platform + ' ' + file_name + ' directory: ' + full_path)
1175-
1176-
return full_path
1177-
11781116
def _setup_api(self):
11791117
# instantiate pgoapi @var ApiWrapper
11801118
self.api = ApiWrapper(config=self.config)
@@ -1185,9 +1123,6 @@ def _setup_api(self):
11851123
self.login()
11861124
# chain subrequests (methods) into one RPC call
11871125

1188-
#self.api.set_signature_lib(self.get_encryption_lib())
1189-
#self.api.set_hash_lib(self.get_hash_lib())
1190-
11911126
self.logger.info('')
11921127
# send empty map_cells and then our position
11931128
self.update_web_location()

‎pokemongo_bot/event_handlers/captcha_handler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_token(self, url):
3333
file_name = 'chromedriver'
3434

3535
full_path = ''
36-
if os.path.isfile(path + '/' + file_name): # check encrypt_location or local dir first
36+
if os.path.isfile(path + '/' + file_name): # check local dir first
3737
full_path = path + '/' + file_name
3838

3939
if full_path == '':

‎setup.sh

+3-26
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ pip install -r requirements.txt --upgrade
1313
pip install -r requirements.txt
1414
}
1515

16-
function Pokebotencrypt () {
17-
echo "Start to make encrypt.so."
18-
if [ -x "$(command -v curl)" ]
19-
then
20-
curl -O http://pgoapi.com/pgoencrypt.tar.gz
21-
else
22-
wget http://pgoapi.com/pgoencrypt.tar.gz
23-
fi
24-
tar -xf pgoencrypt.tar.gz
25-
cd pgoencrypt/src/
26-
make
27-
mv libencrypt.so $pokebotpath/encrypt.so
28-
cd ../..
29-
rm -rf pgoencrypt.tar.gz
30-
rm -rf pgoencrypt
31-
}
32-
3316
function Pokebotescapestring () {
3417
echo "$1" | sed 's/\//\\\//g' | sed 's/"/\\"/g' # escape slash and double quotes
3518
}
@@ -42,7 +25,7 @@ Auth generator
4225
Enter 1 for Google or 2 for Pokemon Trainer Club (PTC)
4326
-----------------
4427
" auth
45-
read -p "Input E-Mail (Google) or Username(PTC)
28+
read -p "Input E-Mail (Google) or Username (PTC)
4629
" username
4730
read -p "Input Password
4831
" -s password
@@ -131,8 +114,8 @@ echo "You are on Open SUSE"
131114
sudo zypper update
132115
sudo zypper -y install python-pip python-devel gcc make
133116
else
134-
echo "Please check if you have python pip gcc make installed on your device."
135-
echo "Wait 5 seconds to continue or Use ctrl+c to interrupt this shell."
117+
echo "Please check if you have python, pip, gcc and make installed on your device."
118+
echo "Wait 5 seconds to continue or use ctrl+c to interrupt this shell."
136119
sleep 5
137120
fi
138121
if [ ! -e /etc/fedora-release ]
@@ -141,7 +124,6 @@ easy_install virtualenv
141124
fi
142125
Pokebotreset
143126
Pokebotupdate
144-
Pokebotencrypt
145127
echo "Install complete. Starting to generate auth.json and config.json."
146128
Pokebotauth
147129
Pokebotconfig
@@ -174,7 +156,6 @@ echo " -i,--install. Install PokemonGo-Bot."
174156
echo " -b,--backup. Backup config files."
175157
echo " -a,--auth. Easy auth generator."
176158
echo " -c,--config. Easy config generator."
177-
echo " -e,--encrypt. Make encrypt.so."
178159
echo " -r,--reset. Force sync source branch."
179160
echo " -u,--update. Command git pull to update."
180161
}
@@ -183,9 +164,6 @@ case $* in
183164
--install|-i)
184165
Pokebotinstall
185166
;;
186-
--encrypt|-e)
187-
Pokebotencrypt
188-
;;
189167
--reset|-r)
190168
Pokebotreset
191169
;;
@@ -204,7 +182,6 @@ echo "Backup complete."
204182
--auth|-a)
205183
Pokebotauth
206184
;;
207-
208185
--config|-c)
209186
Pokebotconfig
210187
;;

0 commit comments

Comments
 (0)