안드로이드 서명 값 가져오는 코드
Android
Activity activity = com.unity3d.player.UnityPlayer.currentActivity;
PackageManager pm = activity.getPackageManager();
String packagename = activity.getPackageName();
PackageInfo packageinfo = pm.getPackageInfo(packagename, PackageManager.GET_SIGNATURES);
Signature[] signature = packageinfo.signatures;
int signaturehash = Integer.toHexString(signature.hashCode());
return signaturehash;
Unity
var unity = new AndroidJavaClass(“com.unity3d.player.UnityPlayer”);
var activity = unity.GetStatic.<AndroidJavaObject>(“currentActivity”);
var manager = activity.Call.<AndroidJavaObject>(“getPackageManager”);
var name = activity.Call.<String>(“getPackageName”);
var GET_SIGNATURES = 64;
var packageInfo = manager.Call.<AndroidJavaObject>(“getPackageInfo”, name, GET_SIGNATURES);
var signatures = packageInfo.Get.<AndroidJavaObject>(“signatures”);
var signatureshash = signatures[0].Call.<int>(“hashCode”).ToString(“X”);
return signatureshash;