Skip to content

Commit

Permalink
use upstream android_backup (#101)
Browse files Browse the repository at this point in the history
* use upstream android_backup

* use non-streaming mode for reading just the database file

* fix install_requires to be saner
  • Loading branch information
rytilahti authored Nov 1, 2017
1 parent 26b13ba commit 05711fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 230 deletions.
226 changes: 0 additions & 226 deletions miio/android_backup.py

This file was deleted.

4 changes: 2 additions & 2 deletions miio/extract_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from Crypto.Cipher import AES
from pprint import pformat as pf
import attr
from .android_backup import AndroidBackup
from android_backup import AndroidBackup

logging.basicConfig(level=logging.INFO)
_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -111,7 +111,7 @@ def main(backup, write_to_disk, password, dump_all, dump_raw):
reader = BackupDatabaseReader(dump_raw)
if backup.endswith(".ab"):
DBFILE = "apps/com.xiaomi.smarthome/db/miio2.db"
with AndroidBackup(backup) as f:
with AndroidBackup(backup, stream=False) as f:
tar = f.read_data(password)
try:
db = tar.extractfile(DBFILE)
Expand Down
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@
packages=["miio", "mirobo"],

python_requires='>=3.4',
install_requires=['construct', 'click', 'cryptography', 'pretty_cron',
'typing', 'zeroconf', 'pycrypto', 'attrs', 'pytz'],
install_requires=['construct',
'click',
'cryptography',
'pretty_cron',
'typing',
'zeroconf',
'pycrypto',
'attrs',
'android_backup'],

entry_points={
'console_scripts': [
Expand Down

0 comments on commit 05711fd

Please sign in to comment.