When creating a Web browser program, the system will usually encrypt the information to be generated in base64 mode.
(Encoding. After reading the android file, only the Android. OS. base64utils file is displayed.
The package is related to base64. Unfortunately, this package has only one static byte []
Decodebase64 (string data) function.
Why, there is only a decoding function, and there is no such function? Originally, I wanted to activate my own base64
. However, before you start, you should first find the android source code
There may be some uninitialized ented APIs.
I found it. Org. Apache. commons. codec. Binary. base64
Package. There is a byte [] encode (byte parray []) function, which is used for base64 encoding.
. I listed the available functions in this category below, which may be useful to you.
Package org. Apache. commons. codec. Binary;
Public class base64
Implements binaryencoder, binarydecoder
{
Public base64 ();
Public static Boolean isarraybytebase64 (byte arrayoctect []);
Public static byte [] encodebase64 (byte binarydata []);
Public static byte [] encodebase64chunked (byte binarydata []);
Public object decode (Object pobject );
Public byte [] Decode (byte parray []);
Public static byte [] encodebase64 (byte binarydata [], Boolean ischunked );
Public static byte [] decodebase64 (byte base64data []);
Public object encode (Object pobject );
Public byte [] encode (byte parray []);
The information that will be passed by base64 should be directly written in post mode, which should be fine (except for
Application/X-WWW-form-urlencoded ). However, if you want to export data in get mode.
Which of the following can be noticed? This base64 encoded URL is not safe. Because there will be '+ ','/',
'=' Character. Currently, I am working on base64 encoding before uploading data to the resource '+ '.
To '-', '/' to '_', to '=' character, all are removed. On the server side, there are also some corresponding responses
The problem is solved.
Address http://ysl-paradise.blogspot.com/2008/07/android-
Undocumented-base64.html