Skip to content

Commit

Permalink
feat: specify bundle id
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfzxcvbn committed Jun 3, 2024
1 parent e9d1968 commit 3e14bd4
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 11 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,29 @@ this is really messy. i made this without caring about quality so there's probab
also, there might be some remaining shared app containers due to app extensions. you can use [pyzule](https://github.com/asdfzxcvbn/pyzule) to remove app extensions, change the app display name, and modify the app further.

don't change the bundle id though.. not sure if that would break anything due to changing `application-identifier`. you can try if you want and tell me if it works, just open an issue or dm me on telegram or something.

## updating duped apps
let's think of this example: you need to duplicate discord, so you run this command:

```shell
$ python appdupe.py -i ~/Discord-v217.0.ipa -o ~/DiscordDupe
[?] ipa file extension not detected, appending manually
[*] using seed: "7c54c5db-d6c3-41f7-a5ab-c21d87e3e4e2" (save this!)
[*] will use bundle id: fyi.zxcvbn.appdupe.700603c620 (save this!)
[*] will use team id: 1429A9E38A
[*] done, remember to remove app extensions (if u wanna)
```

everything works fine! but what if you wanted to update the duped discord? starting in v1.1 you can use -s and -b to achieve this. simply remember to save the command's output (like appdupe tells you to) then run:

```shell
# "700603c620" was the last part of the bundle id given to us last time
$ python appdupe.py -i ~/Discord-v218.0.ipa -o ~/DiscordDupeUpdated -s "7c54c5db-d6c3-41f7-a5ab-c21d87e3e4e2" -b 700603c620
[?] ipa file extension not detected, appending manually
[*] using seed: "7c54c5db-d6c3-41f7-a5ab-c21d87e3e4e2" (save this!)
[*] will use bundle id: fyi.zxcvbn.appdupe.700603c620 (save this!)
[*] will use team id: 1429A9E38A
[*] done, remember to remove app extensions (if u wanna)
```

then you can install the updated ipa normally, and you'll keep all your data.
33 changes: 22 additions & 11 deletions appdupe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,26 @@
help="duplicated ipa to create")

# bundle id will be changed to `fyi.zxcvbn.appdupe.<BUNDLE>`
# <BUNDLE> will be always be random,
# only teamid is derived from seed
# <BUNDLE> will be always be random, only teamid is derived from seed
parser.add_argument("-s", metavar="seed",
help="a \"seed\" to derive the app id from "
"(any string of your choosing -- will always produce same output)")
"(any string of your choosing)")

parser.add_argument("-b", metavar="id", help="bundle id to use (see README)")

args = parser.parse_args()

# thanks pyzule for source
if not args.o.endswith(".ipa"):
print("[?] ipa file extension not detected, appending manually")
args.o += ".ipa"
if os.path.exists(args.o):
overwrite = (input(f"[<] {args.o} already exists. overwrite? [Y/n] ")
.lower().strip())
if overwrite in ("y", "yes", ""):
del overwrite
else:
print("[>] quitting.")
quit()
quit("[>] quitting.")

# no ipa checks this time. maybe use the tool correctly? :D
if args.s is None:
Expand All @@ -42,15 +45,23 @@
# team identifiers are 10 chars, A-Z, and 0-9
HASHED_STR = sha256(args.s.encode()).hexdigest().upper()
TEAM_ID = HASHED_STR[-10:]

# bundle will be random every time, shared teamid will allow
# apps to communicate with each other (e.g. youtube, ytmusic, google docs)
BUNDLE = f"fyi.zxcvbn.appdupe.{uuid4().hex[:10]}"
BUNDLE_TI = f"fyi.zxcvbn.appdupe.{TEAM_ID}"

print(f"[*] using seed: \"{args.s}\"")
# bundle will be random every time (unless specified),
# shared teamid will allow apps to communicate with each other
# (e.g. youtube, ytmusic, google docs)
if args.b is None:
BUNDLE = f"fyi.zxcvbn.appdupe.{uuid4().hex[:10]}"
elif len(args.b) != 10:
quit("[!] -b argument has invalid length (see README)")
elif any(c not in "0123456789abcdef" for c in args.b):
quit("[!] -b argument is invalid (see README)")
else:
BUNDLE = f"fyi.zxcvbn.appdupe.{args.b}"

print(f"[*] using seed: \"{args.s}\" (save this!)")
print(f"[*] will use bundle id: {BUNDLE} (save this!)")
print(f"[*] will use team id: {TEAM_ID}")
print(f"[*] will use bundle id: {BUNDLE}")

# objectives (what we are setting):
# 1. application-identifier = "<TEAM_ID>.<BUNDLE>" (unique)
Expand Down

0 comments on commit 3e14bd4

Please sign in to comment.