Recommended reading:
A brief analysis of Android phone defender custom control properties
An analysis of Android phone defender turn off automatic Updates
Detailed Android Phone Guardian Settings Wizard page
The general mobile phone does not have root permissions, into the Data/data directory, when the phone brush machine, with root permissions, you can enter the Data/data directory, view our saved password file, so we need to save the password for MD5 encryption
Gets the MessageDigest information Digest object, calling Messagedigest.getinstance ("MD5"), Parameters: Rules
Invokes the digest (bytes) method of the MessageDigest object, gets the encrypted byte[] array, parameters: byte[] Array, and invokes the GetBytes () method of the string object to get to the byte array
With each byte go and 111,111,118 bits do with the operation and get the int type: Byte & 11111111
In the for (byte b:xxxxx) loop
Run byte & 0xff to get int value
Call Integer.tohexstring (number), get 16 and return string type
To judge the length of a string to be 1, stitch it in front of the 0
Loop outside defines a StringBuffer object that invokes the StringBuffer object's append () concatenation of strings
Call the StringBuffer object's ToString () method to get the standard string result after encryption
MD5 can be cracked, including MD5 (MD5 (MD5)) in this form, encrypt all the possibilities into the database, and then compare it to your MD5 password, you can md5 add salt
The software needs to uninstall and then test and erase the previously saved SP files
Package com.qingguow.mobilesafe.utils;
Import Java.security.MessageDigest;
public class Md5util {
/**
* Get MD5 encrypted string
* @param pass
* @return/Public
static string Md5password (String pass) {
messagedigest messagedigest;
try {
messagedigest = messagedigest.getinstance ("MD5");
Byte[] Bytes=messagedigest.digest (Pass.getbytes ());
StringBuffer sb=new StringBuffer ();
for (byte b:bytes) {
int number=b & 0xff;
String str=integer.tohexstring (number);
if (Str.length () ==1) {
sb.append ("0");
}
Sb.append (str);
return sb.tostring ();
} catch (Exception e) {
e.printstacktrace ();
}
Return "";
}
}
The above content is small to introduce the Android mobile phone defender to save the password when the MD5 encryption of the relevant knowledge, hope to help everyone!