Closed teflocarbon closed 2 weeks ago
hmm... that actually is really strange
could you please see if you can reproduce this with pyzule?
debugged the issue with the author. summary:
codesign
is unable to extract the entitlements only from the main binary (for some reason?) and logs:b"Executable=/private/var/folders/d3/3v3wd4390c76s9j518cn498c0000gn/T/tmpcz06ndqj/Payload/Discord.app/Discord\n/var/folders/d3/3v3wd4390c76s9j518cn498c0000gn/T/tmpcz06ndqj/Payload/Discord.app: no signature\nwarning: Specifying ':' in the path is deprecated and will not work in a future release\nwarning: binary contains an invalid entitlements blob. The OS will ignore these entitlements.\n"
Failed to dump entitlements, using empty
Original entitlements:
{}
Failed to read old team id
Failed to read old app id prefix
codesign_dump_entitlements()
to use ldid like so:def codesign_dump_entitlements(executable: str) -> Dict[Any, Any]:
proc = run_process("ldid", "-e", executable)
return plist_loads(decode_clean(proc.stdout))
and this line with: old_entitlements = codesign_dump_entitlements(f"{component}/{info['CFBundleExecutable']}")
the issue is also apparently fixed when the entitlements plist is exported with ldid and then the binary is signed with codesign
this means ldid
must be signing the binary incorrectly to cause the "binary contains an invalid entitlements blob" warning. i'll open an issue in the morning (i'm sleepy asf rn)
have you searched the existing issues?
describe the bug.
Environment
Description
Push notifications stop working when injecting tweaks using cyan, despite entitlements remaining identical. This occurs even though the signing process completes successfully.
Expected Behavior
Push notifications should work normally after injecting tweaks with cyan.
Actual Behavior
Push notifications fail to arrive when the app is closed, despite proper entitlements and signing.
Steps to Reproduce:
When using cyan to add tweaks to a .ipa, it caused the main binary of the application to be modified on some way, causing certain entitlements like push notifications to break.
This was the command that I used.
cyan -i com.hammerandchisel.discord-252.0-985746746-869832312_decrypted.ipa -f io.github.revenge-mod.app_1.0.0_iphoneos-arm.deb -o com.hammerandchisel.discord-252.0-985746746-869832312_decrypted_revenge.ipa
To make sure that the issue was not due to the tweak itself, I tested four versions of the app.
The original decrypted version had no issues with notifications and neither did the one that had the binary replaced. The output with no tweaks worked fine as well (Pretty sure this is just unpack + repack) The output ipa from cyan after being modified with a tweak did not work though.
The tweak that was used was v250.0 of Revenge but I don't believe it has much relevance. It can be found here though. https://github.com/revenge-mod/revenge-tweak
The signing service that was used was my own Apple Developer account with SignTools CI. I don't notice any particular difference when they were being signed.
I checked the entitlements with ldid and I found no difference between the two.
However, they did both have two different hashes. Original: 3224b6b42fa64831ea56c68d9bbb6ab4c1552240bbc1446fd745f546d87cc757 Discord Cyan: b055e8a0543a37c803148ac812e97370fb3a5edb4fca4f04c876e49f1e8d5f71 Discord
There is also a small file size difference as well. Original: 36562304 bytes Tweaked: 35917504 bytes
Extra Information
Cyan Logs
I didn't notice a verbose option so this is just what it typically says.