Android Hardened Signature Tool (source code download)

Source: Internet
Author: User
Tags sha1

background

Every time Android is hardened to command line signature good trouble, just before the creation of an icon tool.

So it is easier to change than to write batch processing.

Principle

In fact, using the WinForm program to invoke the console to execute commands, the Android Signature command is as follows

%java_home%\bin\jarsigner-digestalg sha1-sigalg Md5withrsa-verbose-keystore [Your keystore]-signedjar [Signed path] [path to be signed] ] [alias of KeyStore]

In the interface to select the parameters after the pop-up console, enter the password on the line, very convenient (seemingly password can also put into parameters, lazy study, have known the great God for comment).

Interface effect

Before the icon generation tool changed, simply click on the line.

Icon-generated features castrated the size of iOS.

Follow the top-down steps to click on the line.

If you do not set the Java_home parameter in the environment variable, the program startup will be prompted, if set up, you do not need to click "Configure Java Directory".

If you configure the Java directory yourself, point to the root of the JDK and do not point to bin.

Key source

As always, all the source code has comments. Please don't be picky about naming. Half an hour to get something.

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Diagnostics;usingSystem.IO;namespacewindowsformsapplication1.dal{ Public classSignture { Public Static stringCmdformat ="{0}\\bin\\jarsigner";  Public Static stringCmdstrformat ="-digestalg sha1-sigalg md5withrsa-verbose-keystore {0}-signedjar {1} {2} {3}"; /// <summary>        ///checking the Java environment/// </summary>        /// <returns></returns>         Public Static BOOLisjavaenvirsettled () {return string. IsNullOrEmpty (Environment.getenvironmentvariable ("Java_home")); }        /// <summary>        ///run the cmd command///The command window is displayed/// </summary>        /// <param name= "CmdExe" >Specify the full path of the application</param>        /// <param name= "Cmdstr" >executing command-line arguments</param>         Public Static BOOLRuncmd (stringCmdExe,stringcmdstr) {            BOOLresult =false; Try            {                using(Process Mypro =NewProcess ()) {                    //Specifies the application and command-line arguments that the startup process is callingProcessStartInfo psi =NewProcessStartInfo (CmdExe, CMDSTR); Mypro.startinfo=psi;                    Mypro.start ();                    Mypro.waitforexit (); Result=true; }            }            Catch            {            }            returnresult; }         Public Static stringSavepath (stringfile) {            stringFilePath =path.getdirectoryname (file); stringFileName =path.getfilenamewithoutextension (file); returnFilePath +"\\"+ FileName +". signed.apk"; }    }}
View Code
Private voidButtonx4_click (Objectsender, EventArgs e) {            //Execution            stringalign=TextBox1.Text; stringSavedpath =DAL.            Signture.savepath (Apkpath); stringcmd =string. Format (DAL.            Signture.cmdformat, Javapath); stringCmdstr =string. Format (DAL.            Signture.cmdstrformat, KeyPath, Savedpath, Apkpath, align); DAL.        Signture.runcmd (cmd, cmdstr); }
View Code

What else are you capable of?

Because the code has been placed here, and has been satisfied with my own needs, so the function updates that only wait for me to use the time changed.

1. You can develop a simple change of brain hole to use in bulk channel package

2. Carry out other commands, such as taking MD5 yards or something.

Source Address:

Link: http://pan.baidu.com/s/1c2YAD4 Password: uvy9

P.S.
Oneself in doing independent development, hope wide knot hero, especially like me brain short-circuit without react recklessly anroid, iOS native want to do something of friends.

App Independent Development Group 533838427

Public number "Lazy Wen"-->lanwenapp<--

Android Hardened Signature Tool (source code download)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.