Current location - Quotes Website - Signature design - How does autojs view the signature password?
How does autojs view the signature password?
Skip/* * * to get the signing password of the application.

*/functiongetcertificatesha1fingerprint () {//Get the package manager letpm = context. Getpackagemanager()// Get the name of the SHA package to be obtained at present. Other package names can also be used, but it should be noted that//the premise of using other package names is that the parameter Context passed by this method should be the corresponding package tpackagename = context. getpackagename (); //Returns signature information letflags = packagemanager. Gets the signature contained in the package; //Get all the content information classes of the package, so that packageinfo =. getpackageinfo (packagename,flags); //signature information let signatures = packageinfo. Signature; Etcert = signature [0]. ToByteArray()// Converts the name into a byte array stream, EtinpenetTelerayInputStream (CERT); //Certificate factory class, which realizes the function of factory certificate algorithm and makes cf = certificatefactory. getinstance(" x509 "); //X509 certificate, X.509 is a very common certificate format let c = cf.generate certificate (input); //Encryption algorithm class, in which parameters can make encryption algorithms such as MD4 and MD5 let MD = messagedigest. getinstance(" sha 1 "); //Get the public key let public key = md.digest (c.getencoded ()); //Format conversion from byte to hexadecimal Let Hexstring = Byte2Hexformatted (public key); Returns hexString// The following is the function of converting the obtained code into16 {let str = new stringbuilder (arr), byte2hexformed (arr). Length * 2); For (let I = 0;; i 2) h = h.substring(l - 2,l); str . append(h . touppercase())if(I