Home > Mobile >  Why the same a base64 decoding is normal in Java, Android is different in it?
Why the same a base64 decoding is normal in Java, Android is different in it?

Time:10-05

Base64: MGXvX + LVhDJPhrJXnZai6CDvg8Tgs8eIzFe0i5XKhmu5wcavibVjsYm1 + 3 omoxl3rfs07vq1gm1hqwhtsb9edp4wffrvhdxhcq3tdnocjwf2bycoubiqljx0nysvocprwgsnsvjyknxyhoovrv1wer1v9fmio7u3ju6qo2xv1us=
It should be: after decoding what __

Java used in the
 Base64. GetDecoder (). The decode () 
decoding, it is normal
Android is
 import android. Util. Base64. 

If you use the
 import Java. Util. Base64. 
must be minimum SDK to 26, but I'm a compatible to the SDK 21...

So I use the
 Base64. Decode (string, Base64. DEFAULT)) 

this methodBut the decoding out will be a lot more

Bosses, how to solve ah
I watched the Java. Util. The decode method Base64, actually use is
 public byte [] decode (String SRC) {
Return the decode (SRC) getBytes (ISO_8859_1. INSTANCE));
}

So should be a coding problem? But Android inside even wrote code for ISO_8859_1 getBytes method, or so...


CodePudding user response:

Base64 classes in Java and Android SDK is different, it's best to copy a used in the project's source code

CodePudding user response:

reference 1/f, the blue sky ywj response:
Base64 classes in Java and Android SDK is different, it's best to copy a to the project source code used in the
ok thank you I try!

CodePudding user response:

reference 1/f, the blue sky ywj response:
Base64 classes in Java and Android SDK is different, it's best to copy a to the project source code used in the
I put the normal execution in Java code is packaged into a jar package and then introduce the Android Studio to the inside, but the results are wrong, the front have a lot of other things...
  • Related