mirror of
https://codeberg.org/vanous/huafetcher.git
synced 2025-01-10 07:02:03 +01:00
Add support for EPO files
This commit is contained in:
parent
f599a645de
commit
f797233820
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,6 +9,7 @@ cep_7days.zip
|
||||
cep_1week.zip
|
||||
cep_pak.bin
|
||||
lle_1week.zip
|
||||
epo.zip
|
||||
credentials.*
|
||||
README.html
|
||||
tmp
|
||||
|
@ -18,20 +18,28 @@ wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Huami-Server-Pairing
|
||||
|
||||
Install [Buildozer](https://github.com/kivy/buildozer/) and [Kivy](https://github.com/kivy/kivy)
|
||||
|
||||
```bash
|
||||
pip install buildozer
|
||||
pip install kivy
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### Run
|
||||
|
||||
```bash
|
||||
python main.py
|
||||
```
|
||||
|
||||
### Make Android apk
|
||||
|
||||
```bash
|
||||
buildozer -v android debug deploy run
|
||||
```
|
||||
|
||||
## User
|
||||
|
||||
|
@ -161,8 +161,8 @@ class HuamiAmazfit:
|
||||
|
||||
def get_gps_data(self) -> None:
|
||||
"""Download GPS packs: almanac and AGPS"""
|
||||
agps_packs = ["AGPS_ALM", "AGPSZIP", "LLE", "AGPS"]
|
||||
agps_file_names = ["cep_1week.zip", "cep_7days.zip", "lle_1week.zip", "cep_pak.bin"]
|
||||
agps_packs = ["AGPS_ALM", "AGPSZIP", "LLE", "AGPS", "EPO"]
|
||||
agps_file_names = ["cep_1week.zip", "cep_7days.zip", "lle_1week.zip", "cep_pak.bin", "epo.zip"]
|
||||
agps_link = urls.URLS['agps']
|
||||
|
||||
headers = urls.PAYLOADS['agps']
|
||||
|
8
main.py
8
main.py
@ -471,7 +471,7 @@ class Main(App):
|
||||
|
||||
self.huamidevice.get_gps_data()
|
||||
agps_file_names = ["cep_alm_pak.zip"]
|
||||
agps_file_names = ["cep_1week.zip", "cep_7days.zip", "lle_1week.zip", "cep_pak.bin"]
|
||||
agps_file_names = ["cep_1week.zip", "cep_7days.zip", "lle_1week.zip", "cep_pak.bin", "epo.zip"]
|
||||
data_dir="./tmp"
|
||||
if ( platform == 'android' ):
|
||||
from jnius import autoclass
|
||||
@ -479,6 +479,9 @@ class Main(App):
|
||||
Environment = autoclass('android.os.Environment')
|
||||
File = autoclass('java.io.File')
|
||||
data_dir = Environment.getExternalStorageDirectory().getPath()
|
||||
elif not os.path.exists(data_dir):
|
||||
os.mkdir(data_dir)
|
||||
|
||||
debug_print(data_dir)
|
||||
for filename in agps_file_names:
|
||||
sdpathfile = os.path.join(data_dir, filename)
|
||||
@ -486,6 +489,9 @@ class Main(App):
|
||||
print(f"process {filename}")
|
||||
if "zip" not in filename:
|
||||
continue
|
||||
if filename == "epo.zip":
|
||||
# epo zip files should not be extracted
|
||||
continue
|
||||
with zipfile.ZipFile(filename, "r") as zip_f:
|
||||
#zip_f.extractall()
|
||||
zip_f.extractall(data_dir)
|
||||
|
Loading…
Reference in New Issue
Block a user