feat: app

This commit is contained in:
hashbro
2026-10-10 01:53:17 +08:00
parent af714468ee
commit ea82eddbf0
8 changed files with 320 additions and 182 deletions
+51
View File
@@ -0,0 +1,51 @@
#!/usr/bin/env python3
"""Patch an iOS Info.plist: set bundle identity, white launch screen, icons."""
import plistlib
import sys
import os
def main():
plist_path = sys.argv[1]
app_name = sys.argv[2]
bundle_id = sys.argv[3]
version = sys.argv[4]
with open(plist_path, 'rb') as f:
plist = plistlib.load(f)
# Set identity
plist['CFBundleDisplayName'] = app_name
plist['CFBundleName'] = app_name
plist['CFBundleIdentifier'] = bundle_id
plist['CFBundleShortVersionString'] = version
plist['CFBundleVersion'] = version
# White launch screen
plist.pop('UILaunchStoryboardName', None)
plist['UILaunchScreen'] = {}
# Icon references (loose PNGs)
plist['CFBundleIcons'] = {
'CFBundlePrimaryIcon': {
'CFBundleIconName': 'AppIcon',
'CFBundleIconFiles': ['AppIcon60x60'],
}
}
plist['CFBundleIcons~ipad'] = {
'CFBundlePrimaryIcon': {
'CFBundleIconFiles': [
'AppIcon60x60@2x',
'AppIcon60x60@3x',
'AppIcon76x76@2x~ipad',
],
'CFBundleIconName': 'AppIcon',
}
}
with open(plist_path, 'wb') as f:
plistlib.dump(plist, f)
print(f"OK: patched {plist_path}")
if __name__ == '__main__':
main()