Hey Guys, I Was Looking for Protecting Unity Made Android Apk from reverse engineering and suddenly i saw Application.genuine function of unity but documentation is kinda old for this (I Can Still Use it). But Want to know if it still worth to use with current version of unity…And if it worth how can i test it that its working…? also Best practice to use This Function or Any other function like this.
Any Suggestion will be appreciated thanks.
On Android it doesn’t work, there will be a basic implementation in upcoming 2020.2, but in previous Unity versions it simply returns true. Same is for Application.genuineCheckAvailable - it doesn’t do any checks on Android
@Tomas1856 thanks for reply any alternate for android…? I just want to Know if my builds get modified so i can run some modification in code just trying to implement a basic security system. I know it can’t be perfect but just trying to do something.
There are several options
- simply one - You can hard code a check in you c# code https://docs.unity3d.com/ScriptReference/Application-identifier.html is equal to your package name, since one of the ways to pirate a game, is to download an apk, and republish it as different package. Just don’t do simple check as
Application.identifier.Equals("com.mycompany.mygame")
Do something more complex, like letter by letter check, or hash the string, and do has check.
- more complex one - use google play license verification, here’s the plugin code - https://github.com/Unity-Technologies/GooglePlayLicenseVerification, but haven’t tried it myself, so not sure if it works well.
Thank you
@Tomas1856 has this been introduced on 2020 builds as anticipated? We’re working on 2020.1.2f1, would be useful to know if we count with this working on Android, or not yet. Thanks.
It was introduced in 2020.2.0a15, so it will be available in upcoming 2020.2, sadly it won’t be available in 2020.1
Thank you for the info, sounds worth updating to 2020.2
Could you detail a bit on what it does though? would it have some real eficacy?
It does basic check, query package name at runtime and compare it to a package name in stored location, the comparison is done not in straightforward way, to make it harder to hack.
So in short, if someone downloads your app, and republishes it with a different package name, the check should return false. You can actually will be able to validate it yourself, by changing the package name in exported gradle project.
Thanks a ton for the valuable info