Added appgen.py, added some modules as submodules

This commit is contained in:
fangrong 2024-09-06 13:45:28 +08:00
parent bbf223d304
commit e53bccfa38
10 changed files with 80 additions and 9 deletions

9
.gitmodules vendored
View File

@ -1,3 +1,12 @@
[submodule "py_langs"]
path = py_langs
url = https://github.com/R-YaTian/py_langs.git
[submodule "tk_tooltip"]
path = tk_tooltip
url = https://github.com/R-YaTian/tk_tooltip.git
[submodule "tkinter_tooltips"]
path = tkinter_tooltips
url = https://github.com/R-YaTian/tkinter_tooltips.git
[submodule "rmdot_files"]
path = rmdot_files
url = https://github.com/R-YaTian/rmdot_files.git

View File

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.11" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

5
.idea/misc.xml generated
View File

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
<component name="Black">
<option name="sdkName" value="Python 3.7" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>

7
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/py_langs" vcs="Git" />
</component>
</project>

View File

@ -2,7 +2,7 @@
# coding=utf-8
# TWLMagician
# Version 1.2.5
# Version 1.2.6
# Author: R-YaTian
# Original "HiyaCFW-Helper" Author: mondul <mondul@huyzona.com>
@ -22,11 +22,11 @@ from subprocess import Popen, PIPE
from struct import unpack_from
from shutil import rmtree, copyfile
from re import search
from appgen import agen
from inspect import isclass
from datetime import datetime
from time import sleep
from binascii import hexlify, unhexlify
from appgen import agen
from py_langs.langs import lang_init
from pyutils import copyfileobj, copytree
import ctypes
@ -35,7 +35,7 @@ import ssl
ssl._create_default_https_context = ssl._create_unverified_context
ntime_tmp = None
downloadfile = False
version_number = 125
version_number = 126
# Check Update
@ -447,7 +447,7 @@ class Application(Frame):
# General ToolTip
if sysname == 'Darwin':
from ToolTips import ToolTips
from tkinter_tooltips.ToolTips import ToolTips
import tkinter.font as tk_font
widgets = [ag_chk, dkp_chk, photo_chk, self.ag1_chk,
self.dkp1_chk, self.dkp2_chk, self.adv_button]
@ -468,7 +468,7 @@ class Application(Frame):
font_obj = tk_font.Font(family="Microsoft YaHei UI", size=13)
ToolTips(widgets, tooltip_text, font=font_obj)
else:
from tooltip import ToolTip
from tk_tooltip.tooltip import ToolTip
ToolTip(ag_chk, msg=_('提取Nand备份中的DSiWare软件并复制到\nroms/dsiware'))
ToolTip(dkp_chk, msg=_(
'勾选此选项将会在CFW中开启系统设置中的数据管理功能如果已经在NAND中开启了此功能则不需要勾选此选项'))
@ -1823,7 +1823,7 @@ class Application(Frame):
Popen(['chown', '-R', ug + ':' + ug, self.sd_path]).wait()
if sysname == 'Darwin':
from rmdot_files import rmdot_
from rmdot_files.rmdot_files import rmdot_
if self.adv_mode or self.transfer_mode:
out = rmdot_(self.sd_path1)
else:

49
appgen.py Normal file
View File

@ -0,0 +1,49 @@
from os import path, getcwd, mkdir, listdir
from shutil import rmtree, copyfile
def agen(apath, dst):
print('AppGen V1.8 - BY R-YaTian')
files = ['dsiware', 'appgen.py', '53524c41', '484e474a', '534c524e']
dware = path.join(dst, 'dsiware')
if dst == getcwd():
if path.exists(dware):
rmtree(dware)
mkdir(dware)
num = 0
for app in listdir(apath):
if app in files or app.endswith('.exe'):
continue
apps = path.join(apath, app)
try:
for title in listdir(path.join(apps, 'content')):
if title.endswith('.app'):
print('{}/content/{}'.format(app, title))
copyfile(path.join(apath, app, 'content', title), path.join(dware, app + '.nds'))
num += 1
except:
pass
try:
for titleid in listdir(path.join(apps, 'data')):
if titleid.endswith('.sav'):
if titleid.startswith('pri'):
print('{}/data/{}'.format(app, titleid))
copyfile(path.join(apath, app, 'data', titleid), path.join(dware, app + '.prv'))
if titleid.startswith('pub'):
print('{}/data/{}'.format(app, titleid))
copyfile(path.join(apath, app, 'data', titleid), path.join(dware, app + '.pub'))
except:
pass
if num == 0 and dst == getcwd():
rmtree(dware)
if __name__ == '__main__':
agen(getcwd(), getcwd())

@ -1 +1 @@
Subproject commit 1576564bb5d787ffcad3c4b2dba16618056bdd30
Subproject commit bacafe5c4f9742332aef767fd7da54df8a713e17

1
rmdot_files Submodule

@ -0,0 +1 @@
Subproject commit 2418011834d13ca8f891ee8a0c5ad84b72d00641

1
tk_tooltip Submodule

@ -0,0 +1 @@
Subproject commit 409856fbd28794fdc8f2a3ad0ac7543f63cbedaf

1
tkinter_tooltips Submodule

@ -0,0 +1 @@
Subproject commit 86b1da947761c6e272d2972a900a4399bcdfb00c