Revert "generate facet id"

This reverts commit 19374a5df4.
This commit is contained in:
Kyle Spearrin 2017-06-27 13:48:57 -04:00
parent 19374a5df4
commit 8a24a6d192
2 changed files with 0 additions and 47 deletions

View file

@ -105,10 +105,6 @@ namespace Bit.Android
{ {
LaunchApp(args); LaunchApp(args);
}); });
var appid = Utilities.GetFacetID(Application, Process.MyUid());
Console.WriteLine("APPID: " + appid);
Utilities.SendCrashEmail(appid);
} }
private void AndroidEnvironment_UnhandledExceptionRaiser(object sender, RaiseThrowableEventArgs e) private void AndroidEnvironment_UnhandledExceptionRaiser(object sender, RaiseThrowableEventArgs e)

View file

@ -3,10 +3,6 @@ using Android.App;
using Android.Content; using Android.Content;
using Java.Security; using Java.Security;
using System.IO; using System.IO;
using Java.IO;
using Java.Security.Cert;
using Android.Util;
using Android.Content.PM;
namespace Bit.Android namespace Bit.Android
{ {
@ -97,44 +93,5 @@ namespace Bit.Android
return message; return message;
} }
public static string GetFacetID(Application aContext, int callingUid)
{
var packageNames = aContext.PackageManager.GetPackagesForUid(callingUid);
if(packageNames == null)
{
return null;
}
try
{
var info = aContext.PackageManager.GetPackageInfo(packageNames[0], PackageInfoFlags.Signatures);
byte[] cert = info.Signatures[0].ToByteArray();
var input = new MemoryStream(cert);
var cf = CertificateFactory.GetInstance("X509");
var c = (X509Certificate)cf.GenerateCertificate(input);
var md = MessageDigest.GetInstance("SHA1");
return "android:apk-key-hash:" + Base64.EncodeToString(md.Digest(c.GetEncoded()),
Base64Flags.Default | Base64Flags.NoPadding | Base64Flags.NoWrap);
}
catch(PackageManager.NameNotFoundException e)
{
e.PrintStackTrace();
}
catch(CertificateException e)
{
e.PrintStackTrace();
}
catch(NoSuchAlgorithmException e)
{
e.PrintStackTrace();
}
return null;
}
} }
} }