Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
Fix file path equals None if enter nothing when file path prompt
  • Loading branch information
powenn committed Jul 12, 2023
1 parent c26f085 commit 2cead84
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
ALTSTORE_VERSION = "1_6_3"
NETMUXD_VERSION = "v0.1.4"
ANISETTE_SERVER_VERSION = "2.1.0"
SCRIPT_VERSION = "0.1.1"
SCRIPT_VERSION = "0.1.2"

# PATH AND URL
ALTSERVER_PATH = os.path.join(RESOURCE_DIRECTORY, "AltServer")
Expand Down Expand Up @@ -261,13 +261,17 @@ def getAccount(self):
def getPassword(self):
pd = getpass.getpass("Enter password of the Apple ID : ")
self.password = pd

def selectFile(self):
answer = getAnswer(
"Do you want to install AltStore ? (y/n) [n for select your own iPA] : ").lower()
if answer == 'n':
filePath = getAnswer("Enter the absolute path of the file : ")
self.filePath = filePath if filePath != "" else self.selectFile()
if filePath != "":
self.filePath = filePath
else:
self.filePath = None
print("No file path entered")
else:
self.filePath = ALTSTORE_PATH

Expand Down Expand Up @@ -306,6 +310,8 @@ def main():
installaion_manager.getAccount()
installaion_manager.getPassword()
installaion_manager.selectFile()
if installaion_manager.filePath == None:
continue
DebugPrint(installaion_manager.getInfo())
installaion_manager.run()

Expand Down Expand Up @@ -378,4 +384,3 @@ def main():
f"RUNNING AT {CURRENT_DIRECTORY} , RESOURCE_DIR : {RESOURCE_DIRECTORY}")
DebugPrint(f"ARCH : {ARCH} , NETMUXD_AVAILABLE : {NETMUXD_IS_AVAILABLE}")
main()

0 comments on commit 2cead84

Please sign in to comment.