|
|
|
@ -10,9 +10,9 @@ from android_db import AndroidSQLConn |
|
|
|
from load_things import loaded |
|
|
|
from decode_parcel import decode_parcel |
|
|
|
debug = True |
|
|
|
defaults = loaded.defaults |
|
|
|
config = loaded.config |
|
|
|
keycodes = loaded.keycodes |
|
|
|
exe = defaults.exe |
|
|
|
exe = config.defaults.exe |
|
|
|
exists = '''if [ -e "{file}" ]; then |
|
|
|
if [ -d "{file}" ]; then |
|
|
|
echo "directory" |
|
|
|
@ -168,7 +168,7 @@ class Device: |
|
|
|
if os.path.exists(local): |
|
|
|
last = os.path.split(local)[-1] |
|
|
|
real_dir = local |
|
|
|
local = os.path.join(defaults['local']['temp'],last) |
|
|
|
local = os.path.join(config['local']['temp'],last) |
|
|
|
merge_flag = True |
|
|
|
try: |
|
|
|
self.adb("pull","-a",remote,local) |
|
|
|
@ -232,7 +232,7 @@ class Device: |
|
|
|
def backup(self,*partitions,name = None): |
|
|
|
if self.mode != 'recovery': |
|
|
|
self.reboot('recovery') |
|
|
|
backupdir = defaults['local']['TWRP'] |
|
|
|
backupdir = config['local']['twrp'] |
|
|
|
options_dict = { |
|
|
|
"system": "S", |
|
|
|
"data": "D", |
|
|
|
@ -263,13 +263,13 @@ class Device: |
|
|
|
if os.path.exists(name): |
|
|
|
local_name = name |
|
|
|
name = os.path.split(name)[-1] |
|
|
|
update_path = '{}/{}'.format(defaults['remote']['updates'],name) |
|
|
|
if not self.exists(defaults['remote']['updates']): |
|
|
|
self.sudo('mkdir',defaults['remote']['updates']) |
|
|
|
update_path = '{}/{}'.format(config['remote']['updates'],name) |
|
|
|
if not self.exists(config['remote']['updates']): |
|
|
|
self.sudo('mkdir',config['remote']['updates']) |
|
|
|
if not self.exists(update_path): |
|
|
|
self.push(local_name,defaults['remote']['updates']) |
|
|
|
self.push(local_name,config['remote']['updates']) |
|
|
|
else: |
|
|
|
update_path = '{}/{}'.format(defaults['remote']['updates'],name) |
|
|
|
update_path = '{}/{}'.format(config['remote']['updates'],name) |
|
|
|
self.shell("twrp","install",update_path) |
|
|
|
if __name__ == "__main__" and debug: |
|
|
|
d = Device.prim_device() |