Skip to content

Commit

Permalink
Merge pull request #180 from julesontheroad/Beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
julesontheroad authored Jul 23, 2020
2 parents 0656f65 + bb21536 commit a25ef3d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
1 change: 1 addition & 0 deletions py/install_dependencies.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ECHO.
ECHO Installing dependencies
ECHO.
%pycommand% -m pip install --upgrade pip
%pycommand% -m pip install wheel
%pycommand% -m pip install urllib3 unidecode tqdm bs4 tqdm requests image pywin32 pycryptodome pykakasi googletrans chardet eel bottle zstandard colorama google-auth-httplib2 google-auth-oauthlib windows-curses oauth2client comtypes
%pycommand% -m pip install --upgrade google-api-python-client
ECHO.
Expand Down
2 changes: 1 addition & 1 deletion py/ztools/lib/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def load(confFile):
pass

try:
paths.titleDatabase = ['paths']['titledb']
paths.titleDatabase = j['paths']['titledb']
except:
pass

Expand Down
4 changes: 3 additions & 1 deletion py/ztools/mtp/mtp_gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ def loop_install(tfile,destiny="SD",outfolder=None,ch_medium=True,check_fw=True,
else:
print("Couldn't find file. Skipping...")
else:
gdrive_install(item,destiny,outfolder=outfolder,ch_medium=ch_medium,check_fw=check_fw,patch_keygen=patch_keygen,ch_base=ch_base,ch_other=ch_other,checked=checked,installed_list=installed)
gdrive_install(item,destiny,outfolder=outfolder,ch_medium=ch_medium,check_fw=check_fw,patch_keygen=patch_keygen,ch_base=ch_base,ch_other=ch_other,checked=checked,installed_list=installed)
print("")

def get_library_from_path(tfile=None,filename=None):
if tfile==None:
Expand Down Expand Up @@ -868,6 +869,7 @@ def loop_transfer(tfile):
if lib!=None:
print("Item is a remote library link. Redirecting...")
gdrive_transfer(item,destiny)
print("")

def get_libs_remote_source(lib=remote_lib_file):
libraries={}
Expand Down
33 changes: 19 additions & 14 deletions py/ztools/mtp/mtpinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,10 @@ def get_installed_info(tfile=None,search_new=True,excludehb=True):
if k in installed.keys() or k.endswith('000') or k.endswith('800'):
continue
else:
baseid=get_dlc_baseid(k)
try:
baseid=get_dlc_baseid(k)
except:
baseid=k
updid=baseid[:-3]+'800'
if baseid in installed.keys() or updid in installed.keys():
fileid,fileversion,cctag,nG,nU,nD,baseid,g0,g=installed[baseid]
Expand Down Expand Up @@ -775,20 +778,22 @@ def get_archived_info(search_new=True,excludehb=True):
print("NEW DLCS")
print("..........................................................")
for k in versiondict.keys():
try:
if k in dbi_dict.keys() or k.endswith('000') or k.endswith('800'):
continue
else:
if k in dbi_dict.keys() or k.endswith('000') or k.endswith('800'):
continue
else:
try:
baseid=get_dlc_baseid(k)
updid=baseid[:-3]+'800'
if baseid in dbi_dict.keys() or updid in dbi_dict.keys():
fileid,fileversion,g0=dbi_dict[baseid]
if len(g0)>33:
g0=g0[0:30]+'...'
else:
g0=g0+((33-len(g0))*' ')
print(f"{g0} [{baseid}] -> "+forecombo+ f"[{k}] [v{versiondict[k]}]"+Style.RESET_ALL)
except:pass
except:
baseid=k
updid=baseid[:-3]+'800'
if baseid in dbi_dict.keys() or updid in dbi_dict.keys():
fileid,fileversion,g0=dbi_dict[baseid]
if len(g0)>33:
g0=g0[0:30]+'...'
else:
g0=g0+((33-len(g0))*' ')
print(f"{g0} [{baseid}] -> "+forecombo+ f"[{k}] [v{versiondict[k]}]"+Style.RESET_ALL)


def update_console(libraries="all",destiny="SD",exclude_xci=True,prioritize_nsz=True,tfile=None,verification=True,ch_medium=True,ch_other=False,autoupd_aut=True):
check_connection()
Expand Down
6 changes: 3 additions & 3 deletions py/ztools/mtp/mtpnsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def gen_nsp_parts_spec1(filepath,target_cnmt=None,cachefolder=None,keypatch=Fals
if crypto2<=crypto1:
masterKeyRev=crypto1
from mtp_tools import get_nca_ticket
check,titleKey=get_nca_ticket(filepath,fi)
if check==False:
sys.exit("Can't verify titleckey")
check,titleKey=get_nca_ticket(filepath,fi)
if check==False:
sys.exit("Can't verify titleckey")
titleKeyDec = Keys.decryptTitleKey(titleKey, Keys.getMasterKeyIndex(int(masterKeyRev)))
encKeyBlock = crypto.encrypt(titleKeyDec * 4)
if str(keypatch) != "False":
Expand Down
12 changes: 6 additions & 6 deletions py/ztools/mtp/mtpxci.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,9 @@ def gen_xci_parts_spec0(filepath,target_cnmt=None,cachefolder=None,keypatch=Fals
if crypto2<=crypto1:
masterKeyRev=crypto1
from mtp_tools import get_nca_ticket
check,titleKey=get_nca_ticket(filepath,fi)
if check==False:
sys.exit("Can't verify titleckey")
check,titleKey=get_nca_ticket(filepath,fi)
if check==False:
sys.exit("Can't verify titleckey")
titleKeyDec = Keys.decryptTitleKey(titleKey, Keys.getMasterKeyIndex(int(masterKeyRev)))
encKeyBlock = crypto.encrypt(titleKeyDec * 4)
if str(keypatch) != "False":
Expand Down Expand Up @@ -862,9 +862,9 @@ def gen_xci_parts_spec1(filepath,target_cnmt=None,cachefolder=None,keypatch=Fals
if crypto2<=crypto1:
masterKeyRev=crypto1
from mtp_tools import get_nca_ticket
check,titleKey=get_nca_ticket(filepath,fi)
if check==False:
sys.exit("Can't verify titleckey")
check,titleKey=get_nca_ticket(filepath,fi)
if check==False:
sys.exit("Can't verify titleckey")
titleKeyDec = Keys.decryptTitleKey(titleKey, Keys.getMasterKeyIndex(int(masterKeyRev)))
encKeyBlock = crypto.encrypt(titleKeyDec * 4)
if str(keypatch) != "False":
Expand Down

0 comments on commit a25ef3d

Please sign in to comment.