예제 #1
0
        private void buttonGenerate_Click(object sender, EventArgs e)
        {
            var keytool = textKeytool.Text;

            if (string.IsNullOrEmpty(keytool))
            {
                ShowMsg("Unable to locate keytool.exe", "Java's keystore.exe utility is required to generate signatures.  Please manually locate keytool.exe.");
                return;
            }

            AndroidSignatureTool.Core.SignatureInfo sig = null;

            if (radioDefault.Checked)
            {
                try { sig = helper.GetSignaturesFromKeystore(keytool); }
                catch (Exception ex)
                {
                    ShowMsg("Failed To Generate Signature", ex.ToString());
                    return;
                }
            }
            else
            {
                var keystore = textKeystore.Text;

                if (!System.IO.File.Exists(keystore))
                {
                    ShowMsg("Cannot find Keystore", "Please enter a valid path to your custom .keystore file");
                    return;
                }

                var alias     = textAlias.Text;
                var storepass = textStorePass.Text;
                var keypass   = textKeyPass.Text;

                try { sig = helper.GetSignaturesFromKeystore(keytool, keystore, alias, storepass, keypass); }
                catch (Exception ex)
                {
                    ShowMsg("Failed to Generate Signatures", ex.ToString());
                }
            }

            if (sig != null)
            {
                textMd5.Text  = sig.MD5;
                textSha1.Text = sig.SHA1;
            }
        }
예제 #2
0
		public static void Main (string[] args)
		{
			AndroidSignatureTool.Core.Helper helper = new AndroidSignatureTool.Core.Helper ();
			var sigs = helper.GetSignaturesFromKeystore ();

			if (sigs != null) {
				System.Console.WriteLine ("MD5:  {0}", sigs.MD5);
				System.Console.WriteLine ("SHA1: {0}", sigs.SHA1);
			}
		}