feat: Update mountddi, replace the pairing commands, switch to localdevvpn

* Update mountddi.py

* Update pairing command description and embed content

* Update crash.py

* Update afc.py

* Update VPN app reference in error message

* Update footer text in embed message

* feat: update mount ddi to be downloaded on the fly

also fix some small errors and update errorcodes.json

---------

Co-authored-by: neoarz <email@neoarz.dev>
This commit is contained in:
CelloSerenity
2025-12-07 16:08:09 -07:00
committed by GitHub
parent 0d3fcb8146
commit b7d010e44c
8 changed files with 65 additions and 43 deletions

Binary file not shown.

View File

@@ -328,5 +328,10 @@
"name": "malformed_package_archive",
"description": "malformed package archive",
"code": -67
},
{
"name": "developer_mode_not_enabled",
"description": "Developer mode is not enabled",
"code": -68
}
]
]

View File

@@ -1,7 +1,9 @@
import discord
from discord.ext import commands
import os
import aiohttp
import shutil
import tempfile
def mountddi_command():
@commands.hybrid_command(name="mountddi", description="How to manually mount DDI")
@@ -11,23 +13,27 @@ def mountddi_command():
embed = discord.Embed(
color=0xFA8C4A,
description=(
"# How to Manually Mount DDI\n\n---\n\n"
"# How to Mount your DDI (Developer Disk Image):\n\n---\n\n"
"1. Ensure you are connected to StikDebug's VPN and Wi-Fi.*\n"
"2. Force close StikDebug from the app switcher, then repon it.\n"
"## This should resolve your error! Remember, this must be done every time you restart your device.\n"
"If it doesn't work after a couple tries or you live in a country where github.com is blocked, try the steps below to manually mount the DDI:*\n"
"1. **Download the DDI.zip file attached above:**\n"
" - Save it to your device and extract the contents\n\n"
"2. **Replace the DDI folder in StikDebug:**\n"
" - Navigate to the StikDebug default directory on your iPhone/iPad\n"
" - Delete the existing DDI folder completely\n"
" - Replace it with the DDI folder from the downloaded zip\n"
" - Make sure it's in the StikDebug default directory\n\n"
" - Replace it with the DDI folder from uncompressing the downloaded zip\n"
" - Make sure it's in StikDebug's default directory\n\n"
"3. **Restart and retry:**\n"
" - Completely restart StikDebug\n"
" - See if you get the same error again\n\n"
" - If you still get the same error, ask the idevice server for more help\n\n"
),
)
embed.set_author(
name="idevice", icon_url="https://yes.nighty.works/raw/snLMuO.png"
)
embed.set_footer(text="Last Edited by neoarz")
embed.set_footer(text="Last Edited by CelloSerenity")
embed.timestamp = discord.utils.utcnow()
view = discord.ui.View()
@@ -40,16 +46,43 @@ def mountddi_command():
)
)
ddi_file_path = os.path.join(os.path.dirname(__file__), "files/DDI.zip")
file = (
discord.File(ddi_file_path, filename="DDI.zip")
if os.path.exists(ddi_file_path)
else None
)
if file:
await context.send(embed=embed, view=view, file=file)
else:
await context.send(embed=embed, view=view)
temp_dir = tempfile.mkdtemp()
try:
ddi_dir = os.path.join(temp_dir, "DDI")
os.makedirs(ddi_dir)
base_url = "https://raw.githubusercontent.com/doronz88/DeveloperDiskImage/main/PersonalizedImages/Xcode_iOS_DDI_Personalized"
files = ["BuildManifest.plist", "Image.dmg", "Image.dmg.trustcache"]
async with aiohttp.ClientSession() as session:
for filename in files:
file_url = f"{base_url}/{filename}"
async with session.get(file_url) as response:
if response.status != 200:
await context.send(f"Error: Failed to download {filename} (Status: {response.status})")
return
file_path = os.path.join(ddi_dir, filename)
with open(file_path, "wb") as f:
while True:
chunk = await response.content.read(8192)
if not chunk:
break
f.write(chunk)
zip_base_name = os.path.join(temp_dir, "DDI")
shutil.make_archive(zip_base_name, 'zip', root_dir=temp_dir, base_dir="DDI")
zip_file_path = zip_base_name + ".zip"
if os.path.exists(zip_file_path):
await context.send(embed=embed, view=view, file=discord.File(zip_file_path, filename="DDI.zip"))
else:
await context.send("Error: Failed to create zip file.", embed=embed, view=view)
except Exception as e:
await context.send(f"An error occurred: {e}")
finally:
shutil.rmtree(temp_dir)
return mountddi