robovm icon indicating copy to clipboard operation
robovm copied to clipboard

Get app signature (or part of it) during runtime

Open dotw opened this issue 6 years ago • 3 comments

Hi guys, I just moved to robovm these days though I'm using libgd for years and mainly focusing the android part. For android, I want to prevent repacking for my game, during the runtime, I'm checking the signature of the app, if it's aligned with the part of my signature, I think it's not repackaged by the 3rd party, or the game will be exit automatically.

In RoboVM, I want to implement the same logic - comparing the signature, but have no idea of it. how to get the signature in RoboVM?

dotw avatar Mar 19 '18 05:03 dotw

would getting bundle ID be enough for you ? NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];

There is no need to bother with signature on iOS as there is only one distribution point App Store and there is only one app with bundle id possible. So it would be enough just to compare bundle id

dkimitsa avatar Mar 19 '18 09:03 dkimitsa

@dkimitsa thanks for your reply. As I know some devices can be jailbreak. In such case, the app can be repacked and uploaded to cydia(or somewhere else), that's why I want to check the signature. Will the bundleIdentifier be changed when using a different profile or signature?

dotw avatar Mar 20 '18 08:03 dotw

@dotw: not necessarily. But you can change the bundle identifier (also known as app id) when resigning.

In fact you need a distribution certificate that is able to sign an app with the given bundle identifier. So if you dont have one that matches that id, you have to change it.

I am not sure if Apple prevents other people from creating a provisioning profile and distribution cert that has the same app-id as someone else. But if so you can be certain that no one else uses your bundle identifier.

LordTylus avatar Jul 11 '18 06:07 LordTylus