Unmarshented base64 encoded handler function on Android

Source: Internet
Author: User

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

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.