I'm looking for a way to deter some low life repackaging my iOS app - I can use such a signature to encrypt some bits of the app which would render it useless if the signature changed.
CFBundleIdentifier seems to just give me whatever I have entered at [Project] > [Build Configurations] > [Package:] - can't see this as being unique to the version of the app.
I'm trying to protect from someone modifying and/or repackaging and putting on a site like Cydia.
Also I have some components of the app that I consider proprietary - can you tell me just how exposed they are to someone lifting them and using them in their own apps.
Generally speaking, iOS apps are more difficult to decompile than Android apps.
You can use this code to calculate the signature of the embedded provision profile:
B4X:
#if Relesae
Dim b() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirAssets, "embedded.mobileprovision"))
Dim md As MessageDigest
Dim bc As ByteConverter
Dim hex As String = bc.HexFromBytes(md.GetMessageDigest(b, "SHA-256"))
Log(hex)
Page1.Title = hex
#end if
A determined hacker will be able to remove the check or modify it as needed.
A hacker will not be able to use your provision profile while signing the app. So the signature will be different.
Note that it will also be different when you compile it with a store provision so make sure to test it with the correct value. You can open the IPA file and then calculate the hash yourself.